CMS 3D CMS Logo

Public Member Functions | Private Attributes

AlignmentExtendedCorrelationsEntry Class Reference

#include <AlignmentExtendedCorrelationsEntry.h>

List of all members.

Public Member Functions

 AlignmentExtendedCorrelationsEntry (void)
 Default constructor.
 AlignmentExtendedCorrelationsEntry (short unsigned int nRows, short unsigned int nCols)
 Constructor. Leaves the correlations matrix uninitialized.
 AlignmentExtendedCorrelationsEntry (const AlgebraicMatrix &mat)
 Constructor from CLHEP matrix.
 AlignmentExtendedCorrelationsEntry (short unsigned int nRows, short unsigned int nCols, const float init)
 Constructor. Initializes all elements of the correlations matrix to the given value.
AlgebraicMatrix matrix (void) const
 Retrieve the correlation matrix in a CLHEP matrix representation;.
const short unsigned int numCol (void) const
 Get the number of columns of the correlation matrix.
const short unsigned int numRow (void) const
 Get the number of rows of the correlation matrix.
const float operator() (short unsigned int iRow, short unsigned int jCol) const
 Read or write an element of the correlations matrix. NOTE: Indexing starts from [0,0].
float & operator() (short unsigned int iRow, short unsigned int jCol)
 Read or write an element of the correlations matrix. NOTE: Indexing starts from [0,0].
void operator*= (const float multiply)
 Multiply all elements of the correlations matrix with a given number.
 ~AlignmentExtendedCorrelationsEntry (void)
 Destructor.

Private Attributes

std::vector< float > theData
short unsigned int theNCols
short unsigned int theNRows

Detailed Description

Data container for a correlations matrix (represented by a vector of floats), with basic access functions. NOTE: This class is designed specifically for the use within AlignmentExtendedCorrelationsStore, and is not intended to be used elsewhere.

Definition at line 13 of file AlignmentExtendedCorrelationsEntry.h.


Constructor & Destructor Documentation

AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( void  )

Default constructor.

Definition at line 5 of file AlignmentExtendedCorrelationsEntry.cc.

                                                                             :
//   theCounter( 0 ),
  theNRows( 0 ),
  theNCols( 0 )
{}
AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( short unsigned int  nRows,
short unsigned int  nCols 
) [explicit]

Constructor. Leaves the correlations matrix uninitialized.

Definition at line 12 of file AlignmentExtendedCorrelationsEntry.cc.

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

Constructor. Initializes all elements of the correlations matrix to the given value.

Definition at line 21 of file AlignmentExtendedCorrelationsEntry.cc.

                                                                         :
//   theCounter( 0 ),
  theNRows( nRows ),
  theNCols( nCols ),
  theData( nRows*nCols, init )
{}
AlignmentExtendedCorrelationsEntry::AlignmentExtendedCorrelationsEntry ( const AlgebraicMatrix mat) [explicit]

Constructor from CLHEP matrix.

Definition at line 31 of file AlignmentExtendedCorrelationsEntry.cc.

References i, j, theData, and theNCols.

                                                                                                   :
//   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];
    }
  }
}
AlignmentExtendedCorrelationsEntry::~AlignmentExtendedCorrelationsEntry ( void  ) [inline]

Destructor.

Definition at line 31 of file AlignmentExtendedCorrelationsEntry.h.

{}

Member Function Documentation

AlgebraicMatrix AlignmentExtendedCorrelationsEntry::matrix ( void  ) const

Retrieve the correlation matrix in a CLHEP matrix representation;.

Definition at line 53 of file AlignmentExtendedCorrelationsEntry.cc.

References i, j, query::result, theData, theNCols, and theNRows.

{
  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;
}
const short unsigned int AlignmentExtendedCorrelationsEntry::numCol ( void  ) const [inline]
const short unsigned int AlignmentExtendedCorrelationsEntry::numRow ( void  ) const [inline]
const float AlignmentExtendedCorrelationsEntry::operator() ( short unsigned int  iRow,
short unsigned int  jCol 
) const [inline]

Read or write an element of the correlations matrix. NOTE: Indexing starts from [0,0].

Definition at line 37 of file AlignmentExtendedCorrelationsEntry.h.

References theData, and theNCols.

{ return theData[iRow*theNCols+jCol]; }
float& AlignmentExtendedCorrelationsEntry::operator() ( short unsigned int  iRow,
short unsigned int  jCol 
) [inline]

Read or write an element of the correlations matrix. NOTE: Indexing starts from [0,0].

Definition at line 34 of file AlignmentExtendedCorrelationsEntry.h.

References theData, and theNCols.

{ return theData[iRow*theNCols+jCol]; }
void AlignmentExtendedCorrelationsEntry::operator*= ( const float  multiply)

Multiply all elements of the correlations matrix with a given number.

Definition at line 47 of file AlignmentExtendedCorrelationsEntry.cc.

References theData.

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

Member Data Documentation

std::vector< float > AlignmentExtendedCorrelationsEntry::theData [private]
short unsigned int AlignmentExtendedCorrelationsEntry::theNCols [private]
short unsigned int AlignmentExtendedCorrelationsEntry::theNRows [private]

Definition at line 64 of file AlignmentExtendedCorrelationsEntry.h.

Referenced by matrix(), and numRow().