Belle II Software  release-08-01-10
VSymMatrix Class Reference

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

#include <VMatrix.h>

Collaboration diagram for VSymMatrix:

Public Member Functions

 VSymMatrix (const unsigned int nRows=0)
 
void resize (const unsigned int nRows)
 Resize symmetric matrix. More...
 
unsigned int invert ()
 Matrix inversion. More...
 
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). More...
 
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.

Member Function Documentation

◆ getNumRows()

unsigned int getNumRows ( ) const

Get number of rows (= number of colums).

Returns
Number of rows.

Definition at line 184 of file VMatrix.cc.

◆ invert()

unsigned int invert ( )

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.

◆ resize()

void resize ( const unsigned int  nRows)

Resize symmetric matrix.

Parameters
[in]nRowsNumber of rows.

Definition at line 175 of file VMatrix.cc.


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