File indexing completed on 2024-04-06 11:56:09
0001
0002 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsEntry.h"
0003
0004 AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry(void)
0005 :
0006 theNRows(0),
0007 theNCols(0) {}
0008
0009 AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry(short unsigned int nRows,
0010 short unsigned int nCols)
0011 :
0012 theNRows(nRows),
0013 theNCols(nCols),
0014 theData(nRows * nCols) {}
0015
0016 AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry(short unsigned int nRows,
0017 short unsigned int nCols,
0018 const float init)
0019 :
0020 theNRows(nRows),
0021 theNCols(nCols),
0022 theData(nRows * nCols, init) {}
0023
0024 AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry(const AlgebraicMatrix& mat)
0025 :
0026 theNRows(mat.num_row()),
0027 theNCols(mat.num_col()),
0028 theData(mat.num_row() * mat.num_col()) {
0029 for (int i = 0; i < mat.num_row(); ++i) {
0030 for (int j = 0; j < mat.num_col(); ++j) {
0031 theData[i * theNCols + j] = mat[i][j];
0032 }
0033 }
0034 }
0035
0036 void AlignmentExtendedCorrelationsEntry::operator*=(const float multiply) {
0037 for (std::vector<float>::iterator it = theData.begin(); it != theData.end(); ++it)
0038 (*it) *= multiply;
0039 }
0040
0041 AlgebraicMatrix AlignmentExtendedCorrelationsEntry::matrix(void) const {
0042 AlgebraicMatrix result(theNRows, theNCols);
0043
0044 for (int i = 0; i < theNRows; ++i) {
0045 for (int j = 0; j < theNCols; ++j) {
0046 result[i][j] = theData[i * theNCols + j];
0047 }
0048 }
0049
0050 return result;
0051 }