Implements a very rudimentary block sparse matrix class. More...
#include <block_matrix.hpp>
Implements a very rudimentary block sparse matrix class.
The class BlockMatrix is a very rudimentary block sparse matrix class. It is only intended to provide a convenient way to deal with linear algebra objects and to provide a wrapper for more efficient implementations. It should not be used for efficiency-critical operations.
Definition at line 52 of file block_matrix.hpp.
Default constructor.
Definition at line 43 of file block_matrix.cpp.
BlockMatrix::BlockMatrix | ( | uint | _nRows, |
uint | _nCols | ||
) |
Constructor which takes dimensions of the block matrix.
_nRows | Number of block rows. |
_nCols | Number of block columns. |
Definition at line 48 of file block_matrix.cpp.
BlockMatrix::BlockMatrix | ( | const DMatrix & | value | ) |
Constructor which takes ...
Definition at line 54 of file block_matrix.cpp.
BlockMatrix::~BlockMatrix | ( | ) | [virtual] |
Destructor.
Definition at line 62 of file block_matrix.cpp.
returnValue BlockMatrix::addDense | ( | uint | rowIdx, |
uint | colIdx, | ||
const DMatrix & | value | ||
) |
Add method that adds a matrix to a certain component.
rowIdx | Row index of the component. |
colIdx | Column index of the component. |
Definition at line 458 of file block_matrix.cpp.
returnValue BlockMatrix::addRegularisation | ( | uint | rowIdx, |
uint | colIdx, | ||
double | eps | ||
) | [inline] |
Sets all values to a given constant.
BlockMatrix BlockMatrix::addRegularisation | ( | double | eps | ) | [inline] |
Sets everyting to zero.
BlockMatrix BlockMatrix::getAbsolute | ( | ) | const |
Returns the a block matrix whose components are the absolute values of the components of this object.
Definition at line 363 of file block_matrix.cpp.
BlockMatrix BlockMatrix::getNegative | ( | ) | const |
Returns the a block matrix whose components are equal to the components of this object, if they are negative or zero, but zero otherwise.
Definition at line 403 of file block_matrix.cpp.
uint BlockMatrix::getNumCols | ( | ) | const [inline] |
Returns number of block columns of the block matrix object.
uint BlockMatrix::getNumCols | ( | uint | rowIdx, |
uint | colIdx | ||
) | const [inline] |
Returns number of block columns of a specified sub-matrix.
uint BlockMatrix::getNumRows | ( | ) | const [inline] |
Returns number of block rows of the block matrix object.
uint BlockMatrix::getNumRows | ( | uint | rowIdx, |
uint | colIdx | ||
) | const [inline] |
Returns the number of rows of a specified sub-matrix.
BlockMatrix BlockMatrix::getPositive | ( | ) | const |
Returns the a block matrix whose components are equal to the components of this object, if they are positive or zero, but zero otherwise.
Definition at line 383 of file block_matrix.cpp.
returnValue BlockMatrix::getSubBlock | ( | uint | rowIdx, |
uint | colIdx, | ||
DMatrix & | value | ||
) | const [inline] |
Access method that returns the value of a certain component.
rowIdx | Row index of the component. |
colIdx | Column index of the component. |
returnValue BlockMatrix::getSubBlock | ( | uint | rowIdx, |
uint | colIdx, | ||
DMatrix & | value, | ||
uint | nR, | ||
uint | nC | ||
) | const |
Access method that returns the value of a certain component and requiring a given dimension.
rowIdx | Row index of the component. |
colIdx | Column index of the component. |
Definition at line 473 of file block_matrix.cpp.
returnValue BlockMatrix::init | ( | uint | _nRows, |
uint | _nCols | ||
) |
Initializer
Definition at line 65 of file block_matrix.cpp.
bool BlockMatrix::isEmpty | ( | ) | const [inline] |
Returns whether the block matrix element is empty.
bool BlockMatrix::isSquare | ( | ) | const [inline] |
Tests if object is a block-square matrix.
bool BlockMatrix::isSquare | ( | uint | rowIdx, |
uint | colIdx | ||
) | const [inline] |
Tests if a specified sub-matrix is a square matrix.
BlockMatrix BlockMatrix::operator* | ( | const BlockMatrix & | arg | ) | const |
Multiplies a matrix from the right to the matrix object and stores the result to a temporary object.
arg | Block DMatrix Factor. |
Definition at line 192 of file block_matrix.cpp.
BlockMatrix BlockMatrix::operator*= | ( | double | scalar | ) |
Multiplies each component of the object with a given scalar.
scalar | Scalar factor. |
Definition at line 176 of file block_matrix.cpp.
BlockMatrix BlockMatrix::operator+ | ( | const BlockMatrix & | arg | ) | const |
Adds (element-wise) two matrices to a temporary object.
arg | Second summand. |
Definition at line 82 of file block_matrix.cpp.
BlockMatrix & BlockMatrix::operator+= | ( | const BlockMatrix & | arg | ) |
Adds (element-wise) a matrix to object.
arg | Second summand. |
Definition at line 112 of file block_matrix.cpp.
BlockMatrix BlockMatrix::operator- | ( | const BlockMatrix & | arg | ) | const |
Subtracts (element-wise) a matrix from the object and and stores the result to a temporary object.
arg | Subtrahend. |
Definition at line 139 of file block_matrix.cpp.
BlockMatrix BlockMatrix::operator^ | ( | const BlockMatrix & | arg | ) | const |
Multiplies a matrix from the right to the transposed matrix object and stores the result to a temporary object.
arg | Block DMatrix Factor. |
Definition at line 272 of file block_matrix.cpp.
returnValue BlockMatrix::print | ( | std::ostream & | stream = std::cout | ) | const |
Prints object to standard ouput stream.
Definition at line 420 of file block_matrix.cpp.
returnValue BlockMatrix::setDense | ( | uint | rowIdx, |
uint | colIdx, | ||
const DMatrix & | value | ||
) |
Set method that defines the value of a certain component.
rowIdx | Row index of the component. |
colIdx | Column index of the component. |
Definition at line 446 of file block_matrix.cpp.
returnValue BlockMatrix::setIdentity | ( | uint | rowIdx, |
uint | colIdx, | ||
uint | dim | ||
) | [inline] |
Sets a specified sub block to the (dim x dim)-identity matrix.
rowIdx | row index of the sub block |
colIdx | column index of the sub block |
dim | dimension of the sub block |
returnValue BlockMatrix::setZero | ( | uint | rowIdx, |
uint | colIdx | ||
) | [inline] |
Sets a specified sub block to the be a zero matrix.
returnValue BlockMatrix::setZero | ( | ) | [inline] |
Sets everyting to zero.
BlockMatrix BlockMatrix::transpose | ( | ) | const |
Returns the transpose of the object
Definition at line 346 of file block_matrix.cpp.
std::vector< std::vector< DMatrix > > BlockMatrix::elements [protected] |
Definition at line 214 of file block_matrix.hpp.
uint BlockMatrix::nCols [protected] |
Number of columns.
Definition at line 212 of file block_matrix.hpp.
uint BlockMatrix::nRows [protected] |
Number of rows.
Definition at line 211 of file block_matrix.hpp.
std::vector< std::vector< SubBlockMatrixType > > BlockMatrix::types [protected] |
Definition at line 215 of file block_matrix.hpp.