queso-0.57.1
|
Class for representing block matrices using GSL library. More...
#include <GslBlockMatrix.h>
Public Member Functions | |
virtual unsigned int | numRowsLocal () const |
Not implemented yet. More... | |
virtual unsigned int | numRowsGlobal () const |
Not implemented yet. More... | |
virtual unsigned int | numCols () const |
Not implemented yet. More... | |
virtual int | chol () |
Not implemented yet. More... | |
virtual void | zeroLower (bool includeDiagonal=false) |
Not implemented yet. More... | |
virtual void | zeroUpper (bool includeDiagonal=false) |
Not implemented yet. More... | |
GslMatrix & | getBlock (unsigned int i) const |
Return block i in the block diagonal matrix. More... | |
unsigned int | numBlocks () const |
Return the number of blocks in the block diagonal matrix. More... | |
void | invertMultiply (const GslVector &b, GslVector &x) const |
This function calculates the inverse of this matrix, multiplies it with vector b and stores the result in vector x . More... | |
Constructor/Destructor methods | |
GslBlockMatrix (const std::vector< unsigned int > &blockSizes, const GslVector &v, double diagValue) | |
Creates a square matrix with size defined by v and diagonal values all equal to diagValue . More... | |
~GslBlockMatrix () | |
Destructor. More... | |
I/O methods | |
virtual void | print (std::ostream &os) const |
Print method. Defines the behavior of operator<< inherited from the Object class. More... | |
Private Attributes | |
std::vector< VectorSpace < GslVector, GslMatrix > * > | m_vectorSpaces |
std::vector< GslMatrix * > | m_blocks |
Private Attributes inherited from QUESO::Matrix | |
const BaseEnvironment & | m_env |
QUESO environment variable. More... | |
const Map | m_map |
Mapping variable. More... | |
const Map & | m_map |
Mapping variable. More... | |
bool | m_printHorizontally |
Flag for either or not print this matrix. More... | |
bool | m_inDebugMode |
Flag for either or not QUESO is in debug mode. More... | |
Additional Inherited Members | |
Private Member Functions inherited from QUESO::Matrix | |
Matrix (const BaseEnvironment &env, const Map &map) | |
Shaped constructor. More... | |
virtual | ~Matrix () |
Virtual Destructor. More... | |
const BaseEnvironment & | env () const |
const Map & | map () const |
unsigned int | numOfProcsForStorage () const |
void | setPrintHorizontally (bool value) const |
Determines whether the matrix should be printed horizontally. More... | |
bool | getPrintHorizontally () const |
Checks if matrix will be is printed horizontally. More... | |
void | setInDebugMode (bool value) const |
Determines whether QUESO will run through this class in debug mode. More... | |
bool | getInDebugMode () const |
Checks if QUESO will run through this class in debug mode. More... | |
virtual void | base_copy (const Matrix &src) |
Copies base data from matrix src to this matrix. More... | |
Class for representing block matrices using GSL library.
This class provides basic 'invertMultiply' support for matrices of block diagonal structure. Each block is implemented as a GslMatrix object.
Definition at line 50 of file GslBlockMatrix.h.
QUESO::GslBlockMatrix::GslBlockMatrix | ( | const std::vector< unsigned int > & | blockSizes, |
const GslVector & | v, | ||
double | diagValue | ||
) |
Creates a square matrix with size defined by v
and diagonal values all equal to diagValue
.
The blockSizes
array determines the sizes of each (square) block.
Definition at line 29 of file GslBlockMatrix.C.
References m_blocks, QUESO::Matrix::m_env, and m_vectorSpaces.
QUESO::GslBlockMatrix::~GslBlockMatrix | ( | ) |
Destructor.
Definition at line 43 of file GslBlockMatrix.C.
References m_blocks, and m_vectorSpaces.
|
virtual |
GslMatrix & QUESO::GslBlockMatrix::getBlock | ( | unsigned int | i | ) | const |
Return block i
in the block diagonal matrix.
Definition at line 93 of file GslBlockMatrix.C.
References m_blocks.
Referenced by QUESO::GaussianLikelihoodBlockDiagonalCovariance< V, M >::GaussianLikelihoodBlockDiagonalCovariance(), QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients< V, M >::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients(), and print().
This function calculates the inverse of this
matrix, multiplies it with vector b
and stores the result in vector x
.
It checks for a previous LU decomposition of each block matrix and does not recompute it if m_MU != NULL for each block.
Definition at line 105 of file GslBlockMatrix.C.
References m_blocks, m_vectorSpaces, and QUESO::GslVector::sizeLocal().
unsigned int QUESO::GslBlockMatrix::numBlocks | ( | ) | const |
Return the number of blocks in the block diagonal matrix.
Definition at line 99 of file GslBlockMatrix.C.
References m_blocks.
Referenced by QUESO::GaussianLikelihoodBlockDiagonalCovariance< V, M >::GaussianLikelihoodBlockDiagonalCovariance(), QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients< V, M >::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients(), and print().
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Print method. Defines the behavior of operator<< inherited from the Object class.
Implements QUESO::Matrix.
Definition at line 148 of file GslBlockMatrix.C.
References getBlock(), numBlocks(), and QUESO::GslMatrix::print().
Referenced by QUESO::operator<<().
|
virtual |
|
virtual |
|
private |
Definition at line 105 of file GslBlockMatrix.h.
Referenced by getBlock(), GslBlockMatrix(), invertMultiply(), numBlocks(), and ~GslBlockMatrix().
|
private |
Definition at line 104 of file GslBlockMatrix.h.
Referenced by GslBlockMatrix(), invertMultiply(), and ~GslBlockMatrix().