CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/Alignment/CommonAlignmentAlgorithm/src/AlignmentExtendedCorrelationsEntry.cc

Go to the documentation of this file.
00001 
00002 #include "Alignment/CommonAlignmentAlgorithm/interface/AlignmentExtendedCorrelationsEntry.h"
00003 
00004 
00005 AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry( void ) :
00006 //   theCounter( 0 ),
00007   theNRows( 0 ),
00008   theNCols( 0 )
00009 {}
00010 
00011 
00012 AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry( short unsigned int nRows,
00013                                                                         short unsigned int nCols ) :
00014 //   theCounter( 0 ),
00015   theNRows( nRows ),
00016   theNCols( nCols ),
00017   theData( nRows*nCols )
00018 {}
00019 
00020 
00021 AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry( short unsigned int nRows,
00022                                                       short unsigned int nCols,
00023                                                       const float init ) :
00024 //   theCounter( 0 ),
00025   theNRows( nRows ),
00026   theNCols( nCols ),
00027   theData( nRows*nCols, init )
00028 {}
00029 
00030 
00031 AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry( const AlgebraicMatrix& mat ) :
00032 //   theCounter( 0 ),
00033   theNRows( mat.num_row() ),
00034   theNCols( mat.num_col() ),
00035   theData( mat.num_row()*mat.num_col() )
00036 {
00037   for ( int i = 0; i < mat.num_row(); ++i )
00038   {
00039     for ( int j = 0; j < mat.num_col(); ++j )
00040     {
00041       theData[i*theNCols+j] = mat[i][j];
00042     }
00043   }
00044 }
00045 
00046 
00047 void AlignmentExtendedCorrelationsEntry::operator*=( const float multiply )
00048 {
00049   for ( std::vector< float >::iterator it = theData.begin(); it != theData.end(); ++it ) (*it) *= multiply;
00050 }
00051 
00052 
00053 AlgebraicMatrix AlignmentExtendedCorrelationsEntry::matrix( void ) const
00054 {
00055   AlgebraicMatrix result( theNRows, theNCols );
00056 
00057   for ( int i = 0; i < theNRows; ++i )
00058   {
00059     for ( int j = 0; j < theNCols; ++j )
00060     {
00061       result[i][j] = theData[i*theNCols+j];
00062     }
00063   }
00064 
00065   return result;
00066 }