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

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

#include <VMatrix.h>

Public Member Functions

 VMatrix (const unsigned int nRows=0, const unsigned int nCols=0)
 
 VMatrix (const VMatrix &aMatrix)
 
virtual ~VMatrix ()
 
void resize (const unsigned int nRows, const unsigned int nCols)
 Resize Matrix. More...
 
void setZero ()
 Set content to 0. More...
 
VMatrix transpose () const
 Get transposed matrix. More...
 
double & operator() (unsigned int i, unsigned int j)
 access element (i,j) More...
 
double operator() (unsigned int i, unsigned int j) const
 access element (i,j) More...
 
unsigned int getNumRows () const
 Get number of rows. More...
 
unsigned int getNumCols () const
 Get number of columns. More...
 
void print () const
 Print matrix. More...
 
VVector operator* (const VVector &aVector) const
 Multiplication Matrix*Vector. More...
 
VMatrix operator* (const VMatrix &aMatrix) const
 Multiplication Matrix*Matrix. More...
 
VMatrix operator+ (const VMatrix &aMatrix) const
 Addition Matrix+Matrix. More...
 
VMatrixoperator= (const VMatrix &aMatrix)
 Assignment Matrix=Matrix. More...
 

Private Attributes

unsigned int numRows
 Number of rows. More...
 
unsigned int numCols
 Number of columns. More...
 
std::vector< double > theVec
 Data. More...
 

Detailed Description

Simple Matrix based on std::vector<double>

Definition at line 64 of file VMatrix.h.

Constructor & Destructor Documentation

◆ VMatrix() [1/2]

gbl::VMatrix::VMatrix ( const unsigned int  nRows = 0,
const unsigned int  nCols = 0 
)

Definition at line 37 of file VMatrix.cpp.

◆ VMatrix() [2/2]

gbl::VMatrix::VMatrix ( const VMatrix aMatrix)

Definition at line 41 of file VMatrix.cpp.

◆ ~VMatrix()

gbl::VMatrix::~VMatrix ( )
virtual

Definition at line 47 of file VMatrix.cpp.

Member Function Documentation

◆ getNumCols()

unsigned int gbl::VMatrix::getNumCols ( ) const

Get number of columns.

Returns
Number of columns.

Definition at line 92 of file VMatrix.cpp.

References numCols.

Referenced by gbl::VSymMatrix::operator*(), operator=(), and gbl::BorderedBandMatrix::solveBand().

◆ getNumRows()

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

Get number of rows.

Returns
Number of rows.

Definition at line 84 of file VMatrix.cpp.

References numRows.

Referenced by operator=(), and gbl::BorderedBandMatrix::solveBand().

◆ operator()() [1/2]

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

access element (i,j)

Definition at line 108 of file VMatrix.h.

References numCols, and theVec.

◆ operator()() [2/2]

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

access element (i,j)

Definition at line 113 of file VMatrix.h.

References numCols, and theVec.

◆ operator*() [1/2]

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

Multiplication Matrix*Matrix.

Definition at line 126 of file VMatrix.cpp.

References numCols, numRows, and theVec.

◆ operator*() [2/2]

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

Multiplication Matrix*Vector.

Definition at line 113 of file VMatrix.cpp.

References numCols, numRows, and theVec.

◆ operator+()

VMatrix gbl::VMatrix::operator+ ( const VMatrix aMatrix) const

Addition Matrix+Matrix.

Definition at line 142 of file VMatrix.cpp.

References numCols, numRows, and theVec.

◆ operator=()

VMatrix & gbl::VMatrix::operator= ( const VMatrix aMatrix)

Assignment Matrix=Matrix.

Definition at line 153 of file VMatrix.cpp.

References getNumCols(), getNumRows(), numCols, numRows, and theVec.

◆ print()

void gbl::VMatrix::print ( ) const

Print matrix.

Definition at line 97 of file VMatrix.cpp.

References numCols, numRows, and theVec.

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

◆ resize()

void gbl::VMatrix::resize ( const unsigned int  nRows,
const unsigned int  nCols 
)

Resize Matrix.

Parameters
[in]nRowsNumber of rows.
[in]nColsNumber of columns.

Definition at line 55 of file VMatrix.cpp.

References numCols, numRows, and theVec.

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

◆ setZero()

void gbl::VMatrix::setZero ( )

Set content to 0.

Definition at line 62 of file VMatrix.cpp.

References theVec.

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

◆ transpose()

VMatrix gbl::VMatrix::transpose ( ) const

Get transposed matrix.

Returns
Transposed matrix.

Definition at line 70 of file VMatrix.cpp.

References numCols, numRows, and theVec.

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

Member Data Documentation

◆ numCols

unsigned int gbl::VMatrix::numCols
private

Number of columns.

Definition at line 83 of file VMatrix.h.

Referenced by getNumCols(), operator()(), operator*(), operator+(), operator=(), print(), resize(), and transpose().

◆ numRows

unsigned int gbl::VMatrix::numRows
private

Number of rows.

Definition at line 82 of file VMatrix.h.

Referenced by getNumRows(), operator*(), operator+(), operator=(), print(), resize(), and transpose().

◆ theVec

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

Data.

Definition at line 84 of file VMatrix.h.

Referenced by operator()(), operator*(), operator+(), operator=(), print(), resize(), setZero(), and transpose().


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