FACT++  1.0
void zofits::copyTransposeTile ( const char *  src,
char *  dest,
uint32_t  num_rows 
)
inlineprotected

Transpose a tile to a new buffer

Parameters
srcbuffer hosting the regular, row-ordered data
destthe target buffer that will receive the transposed data

Definition at line 851 of file zofits.h.

References i, FITS::kOrderByCol, and FITS::kOrderByRow.

852  {
853  const uint32_t thisRoundNumRows = (num_rows%fNumRowsPerTile) ? num_rows%fNumRowsPerTile : fNumRowsPerTile;
854 
855  //copy the tile and transpose it
856  for (uint32_t i=0;i<fRealColumns.size();i++)
857  {
858  switch (fRealColumns[i].block_head.getOrdering())
859  {
860  case FITS::kOrderByRow:
861  //regular, "semi-transposed" copy
862  for (uint32_t k=0;k<thisRoundNumRows;k++)
863  {
864  memcpy(dest, src+k*fRealRowWidth+fRealColumns[i].col.offset, fRealColumns[i].col.size*fRealColumns[i].col.num);
865  dest += fRealColumns[i].col.size*fRealColumns[i].col.num;
866  }
867  break;
868 
869  case FITS::kOrderByCol:
870  //transposed copy
871  for (uint32_t j=0;j<fRealColumns[i].col.num;j++)
872  for (uint32_t k=0;k<thisRoundNumRows;k++)
873  {
874  memcpy(dest, src+k*fRealRowWidth+fRealColumns[i].col.offset+fRealColumns[i].col.size*j, fRealColumns[i].col.size);
875  dest += fRealColumns[i].col.size;
876  }
877  break;
878  };
879  }
880  }
uint32_t fNumRowsPerTile
Number of rows per tile.
Definition: zofits.h:980
int i
Definition: db_dim_client.c:21
std::vector< CompressedColumn > fRealColumns
Vector hosting the columns of the file.
Definition: zofits.h:1005
uint32_t fRealRowWidth
Width in bytes of one uncompressed row.
Definition: zofits.h:1006