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. | |
VMatrix | transpose () const |
Get transposed matrix. | |
double & | operator() (unsigned int i, unsigned int j) |
access element (i,j) | |
double | operator() (unsigned int i, unsigned int j) const |
access element (i,j) | |
unsigned int | getNumRows () const |
Get number of rows. | |
unsigned int | getNumCols () const |
Get number of columns. | |
void | print () const |
Print matrix. | |
VVector | operator* (const VVector &aVector) const |
Multiplication Matrix*Vector. | |
VMatrix | operator* (const VMatrix &aMatrix) const |
Multiplication Matrix*Matrix. | |
VMatrix | operator+ (const VMatrix &aMatrix) const |
Addition Matrix+Matrix. |
Private Attributes | |
unsigned int | numRows |
Number of rows. | |
unsigned int | numCols |
Number of columns. | |
std::vector< double > | theVec |
Data. |
VMatrix::VMatrix | ( | const unsigned int | nRows = 0 , |
const unsigned int | nCols = 0 |
||
) |
Definition at line 12 of file VMatrix.cpp.
VMatrix::VMatrix | ( | const VMatrix & | aMatrix | ) |
Definition at line 16 of file VMatrix.cpp.
|
virtual |
Definition at line 22 of file VMatrix.cpp.
unsigned int VMatrix::getNumCols | ( | ) | const |
Get number of columns.
Definition at line 62 of file VMatrix.cpp.
References numCols.
Referenced by VSymMatrix::operator*(), and BorderedBandMatrix::solveBand().
unsigned int VMatrix::getNumRows | ( | ) | const |
Get number of rows.
Definition at line 54 of file VMatrix.cpp.
References numRows.
Referenced by BorderedBandMatrix::solveBand().
|
inline |
|
inline |
Multiplication Matrix*Vector.
Definition at line 83 of file VMatrix.cpp.
Multiplication Matrix*Matrix.
Definition at line 96 of file VMatrix.cpp.
Addition Matrix+Matrix.
Definition at line 112 of file VMatrix.cpp.
void VMatrix::print | ( | ) | const |
Print matrix.
Definition at line 67 of file VMatrix.cpp.
References numCols, numRows, and theVec.
Referenced by BorderedBandMatrix::printMatrix().
void VMatrix::resize | ( | const unsigned int | nRows, |
const unsigned int | nCols | ||
) |
Resize Matrix.
[in] | nRows | Number of rows. |
[in] | nCols | Number of columns. |
Definition at line 30 of file VMatrix.cpp.
References numCols, numRows, and theVec.
Referenced by BorderedBandMatrix::resize().
VMatrix VMatrix::transpose | ( | ) | const |
Get transposed matrix.
Definition at line 40 of file VMatrix.cpp.
References numCols, numRows, and theVec.
Referenced by BorderedBandMatrix::solveAndInvertBorderedBand().
|
private |
Number of columns.
Definition at line 54 of file VMatrix.h.
Referenced by getNumCols(), operator()(), operator*(), operator+(), print(), resize(), and transpose().
|
private |
Number of rows.
Definition at line 53 of file VMatrix.h.
Referenced by getNumRows(), operator*(), operator+(), print(), resize(), and transpose().
|
private |
Data.
Definition at line 55 of file VMatrix.h.
Referenced by operator()(), operator*(), operator+(), print(), resize(), and transpose().