EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
gbl::VSymMatrix Class Reference

Simple symmetric Matrix based on std::vector<double> More...

#include <fun4all_GenFit/blob/master/GBL/include/VMatrix.h>

+ Collaboration diagram for gbl::VSymMatrix:

Public Member Functions

 VSymMatrix (const unsigned int nRows=0)
 
virtual ~VSymMatrix ()
 
void resize (const unsigned int nRows)
 Resize symmetric matrix.
 
unsigned int invert ()
 Matrix inversion.
 
double & operator() (unsigned int i, unsigned int j)
 access element (i,j) assuming i>=j
 
double operator() (unsigned int i, unsigned int j) const
 access element (i,j) assuming i>=j
 
unsigned int getNumRows () const
 Get number of rows (= number of colums).
 
void print () const
 Print matrix.
 
VSymMatrix operator- (const VMatrix &aMatrix) const
 Subtraction SymMatrix-(sym)Matrix.
 
VVector operator* (const VVector &aVector) const
 Multiplication SymMatrix*Vector.
 
VMatrix operator* (const VMatrix &aMatrix) const
 Multiplication SymMatrix*Matrix.
 

Private Attributes

unsigned int numRows
 Number of rows.
 
std::vector< double > theVec
 Data (symmetric storage)
 

Detailed Description

Simple symmetric Matrix based on std::vector<double>

Definition at line 86 of file VMatrix.h.

View newest version in sPHENIX GitHub at line 86 of file VMatrix.h

Constructor & Destructor Documentation

gbl::VSymMatrix::VSymMatrix ( const unsigned int  nRows = 0)

Definition at line 164 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 164 of file VMatrix.cc

gbl::VSymMatrix::~VSymMatrix ( )
virtual

Definition at line 168 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 168 of file VMatrix.cc

Member Function Documentation

unsigned int gbl::VSymMatrix::getNumRows ( ) const

Get number of rows (= number of colums).

Returns
Number of rows.

Definition at line 184 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 184 of file VMatrix.cc

References numRows.

unsigned int gbl::VSymMatrix::invert ( void  )

Matrix inversion.

Invert symmetric N-by-N matrix V in symmetric storage mode V(1) = V11, V(2) = V12, V(3) = V22, V(4) = V13, . . . replaced by inverse matrix

Method of solution is by elimination selecting the pivot on the diagonal each stage. The rank of the matrix is returned in NRANK. For NRANK ne N, all remaining rows and cols of the resulting matrix V are set to zero.

Exceptions
1: matrix is singular.
Returns
Rank of matrix.

Definition at line 348 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 348 of file VMatrix.cc

References eps, k, max, numRows, and theVec.

Referenced by gbl::BorderedBandMatrix::solveAndInvertBorderedBand().

+ Here is the caller graph for this function:

double & gbl::VSymMatrix::operator() ( unsigned int  i,
unsigned int  j 
)
inline

access element (i,j) assuming i>=j

Definition at line 125 of file VMatrix.h.

View newest version in sPHENIX GitHub at line 125 of file VMatrix.h

References theVec.

double gbl::VSymMatrix::operator() ( unsigned int  i,
unsigned int  j 
) const
inline

access element (i,j) assuming i>=j

Definition at line 130 of file VMatrix.h.

View newest version in sPHENIX GitHub at line 130 of file VMatrix.h

References theVec.

VVector gbl::VSymMatrix::operator* ( const VVector aVector) const

Multiplication SymMatrix*Vector.

Definition at line 216 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 216 of file VMatrix.cc

References numRows, and theVec.

VMatrix gbl::VSymMatrix::operator* ( const VMatrix aMatrix) const

Multiplication SymMatrix*Matrix.

Definition at line 229 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 229 of file VMatrix.cc

References gbl::VMatrix::getNumCols(), numRows, and theVec.

+ Here is the call graph for this function:

VSymMatrix gbl::VSymMatrix::operator- ( const VMatrix aMatrix) const

Subtraction SymMatrix-(sym)Matrix.

Definition at line 205 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 205 of file VMatrix.cc

References numRows, and theVec.

void gbl::VSymMatrix::print ( void  ) const

Print matrix.

Definition at line 189 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 189 of file VMatrix.cc

References min, numRows, and theVec.

Referenced by gbl::BorderedBandMatrix::printMatrix().

+ Here is the caller graph for this function:

void gbl::VSymMatrix::resize ( const unsigned int  nRows)

Resize symmetric matrix.

Parameters
[in]nRowsNumber of rows.

Definition at line 175 of file VMatrix.cc.

View newest version in sPHENIX GitHub at line 175 of file VMatrix.cc

References numRows, and theVec.

Referenced by gbl::BorderedBandMatrix::resize().

+ Here is the caller graph for this function:

Member Data Documentation

unsigned int gbl::VSymMatrix::numRows
private

Number of rows.

Definition at line 100 of file VMatrix.h.

View newest version in sPHENIX GitHub at line 100 of file VMatrix.h

Referenced by getNumRows(), invert(), operator*(), operator-(), print(), and resize().

std::vector<double> gbl::VSymMatrix::theVec
private

Data (symmetric storage)

Definition at line 101 of file VMatrix.h.

View newest version in sPHENIX GitHub at line 101 of file VMatrix.h

Referenced by invert(), operator()(), operator*(), operator-(), print(), and resize().


The documentation for this class was generated from the following files: