GeneralBrokenLines V03-01-01
using EIGEN
Public Member Functions | Private Attributes | List of all members
gbl::VSymMatrix Class Reference

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

#include <VMatrix.h>

Public Member Functions

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

Private Attributes

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

Detailed Description

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

Definition at line 88 of file VMatrix.h.

Constructor & Destructor Documentation

◆ VSymMatrix()

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

Definition at line 169 of file VMatrix.cpp.

◆ ~VSymMatrix()

gbl::VSymMatrix::~VSymMatrix ( )
virtual

Definition at line 173 of file VMatrix.cpp.

Member Function Documentation

◆ getNumRows()

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

Get number of rows (= number of colums).

Returns
Number of rows.

Definition at line 194 of file VMatrix.cpp.

References numRows.

◆ invert()

unsigned int gbl::VSymMatrix::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 363 of file VMatrix.cpp.

References numRows, and theVec.

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

◆ operator()() [1/2]

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

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

Definition at line 128 of file VMatrix.h.

References theVec.

◆ operator()() [2/2]

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

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

Definition at line 133 of file VMatrix.h.

References theVec.

◆ operator*() [1/2]

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

Multiplication SymMatrix*Matrix.

Definition at line 239 of file VMatrix.cpp.

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

◆ operator*() [2/2]

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

Multiplication SymMatrix*Vector.

Definition at line 226 of file VMatrix.cpp.

References numRows, and theVec.

◆ operator-()

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

Subtraction SymMatrix-(sym)Matrix.

Definition at line 215 of file VMatrix.cpp.

References numRows, and theVec.

◆ print()

void gbl::VSymMatrix::print ( ) const

Print matrix.

Definition at line 199 of file VMatrix.cpp.

References numRows, and theVec.

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

◆ resize()

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

Resize symmetric matrix.

Parameters
[in]nRowsNumber of rows.

Definition at line 180 of file VMatrix.cpp.

References numRows, and theVec.

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

◆ setZero()

void gbl::VSymMatrix::setZero ( )

Set content to 0.

Definition at line 186 of file VMatrix.cpp.

References theVec.

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

Member Data Documentation

◆ numRows

unsigned int gbl::VSymMatrix::numRows
private

Number of rows.

Definition at line 103 of file VMatrix.h.

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

◆ theVec

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

Data (symmetric storage)

Definition at line 104 of file VMatrix.h.

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


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