Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51

#include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsEntry.h"

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry(void)
    :  //   theCounter( 0 ),
      theNRows(0),
      theNCols(0) {}

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry(short unsigned int nRows,
                                                                       short unsigned int nCols)
    :  //   theCounter( 0 ),
      theNRows(nRows),
      theNCols(nCols),
      theData(nRows * nCols) {}

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry(short unsigned int nRows,
                                                                       short unsigned int nCols,
                                                                       const float init)
    :  //   theCounter( 0 ),
      theNRows(nRows),
      theNCols(nCols),
      theData(nRows * nCols, init) {}

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry(const AlgebraicMatrix& mat)
    :  //   theCounter( 0 ),
      theNRows(mat.num_row()),
      theNCols(mat.num_col()),
      theData(mat.num_row() * mat.num_col()) {
  for (int i = 0; i < mat.num_row(); ++i) {
    for (int j = 0; j < mat.num_col(); ++j) {
      theData[i * theNCols + j] = mat[i][j];
    }
  }
}

void AlignmentExtendedCorrelationsEntry::operator*=(const float multiply) {
  for (std::vector<float>::iterator it = theData.begin(); it != theData.end(); ++it)
    (*it) *= multiply;
}

AlgebraicMatrix AlignmentExtendedCorrelationsEntry::matrix(void) const {
  AlgebraicMatrix result(theNRows, theNCols);

  for (int i = 0; i < theNRows; ++i) {
    for (int j = 0; j < theNCols; ++j) {
      result[i][j] = theData[i * theNCols + j];
    }
  }

  return result;
}