queso-0.52.0
|
Class for matrix operations (virtual). More...
#include <Matrix.h>
Public Member Functions | |
Constructor/Destructor methods | |
Matrix () | |
Default constructor. More... | |
Matrix (const BaseEnvironment &env, const Map &map) | |
Shaped constructor. More... | |
Matrix (const Matrix &rhs) | |
Copy constructor. More... | |
virtual | ~Matrix () |
Virtual Destructor. More... | |
Set methods | |
Matrix & | operator= (const Matrix &rhs) |
Operator for copying a matrix. More... | |
Matrix & | operator*= (double a) |
Operator for multiplication of the matrix by a scalar. More... | |
Matrix & | operator+= (const Matrix &rhs) |
Operator for addition (element-wise) of two matrices. More... | |
Matrix & | operator-= (const Matrix &rhs) |
Operator for subtraction (element-wise) of two matrices. More... | |
Environment and Map methods | |
const BaseEnvironment & | env () const |
const Map & | map () const |
unsigned int | numOfProcsForStorage () const |
Attribute methods | |
virtual unsigned int | numRowsLocal () const =0 |
Returns the number of rows local of the matrix. More... | |
virtual unsigned int | numRowsGlobal () const =0 |
Returns the number of rows global of the matrix. More... | |
virtual unsigned int | numCols () const =0 |
Returns the number of columns local of the matrix. More... | |
Mathematical methods | |
virtual int | chol ()=0 |
Performs Cholesky factorization of the matrix. More... | |
Get/Set methods | |
virtual void | zeroLower (bool includeDiagonal=false)=0 |
Sets to zero all the elements bellow (including or not) the diagonal of the matrix. More... | |
virtual void | zeroUpper (bool includeDiagonal=false)=0 |
Sets to zero all the elements above (including or not) the diagonal of the matrix. More... | |
I/O and Miscellaneous methods | |
virtual void | print (std::ostream &os) const =0 |
Print this matrix. More... | |
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... | |
Protected Member Functions | |
virtual void | copy (const Matrix &src) |
Copies matrix src to this matrix. More... | |
Protected Attributes | |
const BaseEnvironment & | m_env |
QUESO environment 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... | |
Class for matrix operations (virtual).
Base matrix class. The matrix class is an abstract class designed to be used as a base class for different matrix implementations (all actual matrix classes in QUESO).
QUESO::Matrix::Matrix | ( | ) |
Default constructor.
Definition at line 31 of file Matrix.C.
References m_env, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
QUESO::Matrix::Matrix | ( | const BaseEnvironment & | env, |
const Map & | map | ||
) |
Shaped constructor.
Definition at line 43 of file Matrix.C.
QUESO::Matrix::Matrix | ( | const Matrix & | rhs | ) |
Copy constructor.
Definition at line 53 of file Matrix.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
|
virtual |
|
pure virtual |
Performs Cholesky factorization of the matrix.
Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.
|
protectedvirtual |
Copies matrix src
to this
matrix.
Definition at line 168 of file Matrix.C.
References m_inDebugMode, and m_printHorizontally.
Referenced by QUESO::GslMatrix::GslMatrix().
const BaseEnvironment & QUESO::Matrix::env | ( | ) | const |
Definition at line 116 of file Matrix.C.
References m_env.
Referenced by QUESO::GslMatrix::eigen(), QUESO::GslMatrix::getColumn(), QUESO::GslMatrix::getRow(), QUESO::GslMatrix::largestEigen(), QUESO::leftDiagScaling(), QUESO::GslMatrix::mpiSum(), QUESO::operator*(), QUESO::rightDiagScaling(), QUESO::GslMatrix::setColumn(), QUESO::GslMatrix::setRow(), and QUESO::GslMatrix::smallestEigen().
bool QUESO::Matrix::getInDebugMode | ( | ) | const |
Checks if QUESO will run through this class in debug mode.
Definition at line 161 of file Matrix.C.
References m_inDebugMode.
bool QUESO::Matrix::getPrintHorizontally | ( | ) | const |
Checks if matrix will be is printed horizontally.
Definition at line 146 of file Matrix.C.
References m_printHorizontally.
const Map & QUESO::Matrix::map | ( | ) | const |
Definition at line 123 of file Matrix.C.
References m_map.
Referenced by QUESO::GslMatrix::internalSvd(), QUESO::operator*(), and QUESO::GslMatrix::svdSolve().
|
pure virtual |
Returns the number of columns local of the matrix.
Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.
unsigned int QUESO::Matrix::numOfProcsForStorage | ( | ) | const |
Definition at line 131 of file Matrix.C.
References QUESO::Map::Comm(), m_map, and QUESO::MpiComm::NumProc().
Referenced by QUESO::GslMatrix::subReadContents(), and QUESO::GslMatrix::subWriteContents().
|
pure virtual |
Returns the number of rows global of the matrix.
Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.
|
pure virtual |
Returns the number of rows local of the matrix.
Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.
Matrix & QUESO::Matrix::operator*= | ( | double | a | ) |
Operator for multiplication of the matrix by a scalar.
Definition at line 82 of file Matrix.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
Operator for addition (element-wise) of two matrices.
Definition at line 94 of file Matrix.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
Operator for subtraction (element-wise) of two matrices.
Definition at line 105 of file Matrix.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
Operator for copying a matrix.
Definition at line 71 of file Matrix.C.
References m_env, UQ_FATAL_TEST_MACRO, QUESO::UQ_INVALID_INTERNAL_STATE_RC, and QUESO::BaseEnvironment::worldRank().
|
pure virtual |
Print this matrix.
Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.
void QUESO::Matrix::setInDebugMode | ( | bool | value | ) | const |
Determines whether QUESO will run through this class in debug mode.
Definition at line 153 of file Matrix.C.
References m_inDebugMode.
void QUESO::Matrix::setPrintHorizontally | ( | bool | value | ) | const |
Determines whether the matrix should be printed horizontally.
Definition at line 138 of file Matrix.C.
References m_printHorizontally.
|
pure virtual |
Sets to zero all the elements bellow (including or not) the diagonal of the matrix.
Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.
|
pure virtual |
Sets to zero all the elements above (including or not) the diagonal of the matrix.
Implemented in QUESO::GslMatrix, and QUESO::GslBlockMatrix.
|
protected |
QUESO environment variable.
Definition at line 137 of file Matrix.h.
Referenced by QUESO::GslMatrix::chol(), QUESO::GslMatrix::copy(), QUESO::GslMatrix::cwExtract(), QUESO::GslMatrix::cwSet(), QUESO::GslMatrix::determinant(), env(), QUESO::GslMatrix::fillWithBlocksDiagonally(), QUESO::GslMatrix::fillWithBlocksHorizontally(), QUESO::GslMatrix::fillWithBlocksVertically(), QUESO::GslMatrix::fillWithTensorProduct(), QUESO::GslMatrix::fillWithTranspose(), QUESO::GslMatrix::getColumn(), QUESO::GslMatrix::getRow(), QUESO::GslBlockMatrix::GslBlockMatrix(), QUESO::GslMatrix::GslMatrix(), QUESO::GslMatrix::internalSvd(), QUESO::GslMatrix::inverse(), QUESO::GslMatrix::invertMultiply(), QUESO::GslMatrix::invertMultiplyForceLU(), QUESO::GslMatrix::largestEigen(), QUESO::GslMatrix::lnDeterminant(), QUESO::GslMatrix::matlabLinearInterpExtrap(), Matrix(), QUESO::GslMatrix::multiply(), QUESO::GslMatrix::operator()(), operator*=(), QUESO::GslMatrix::operator*=(), operator+=(), QUESO::GslMatrix::operator+=(), operator-=(), QUESO::GslMatrix::operator-=(), operator=(), QUESO::GslMatrix::rank(), QUESO::GslMatrix::smallestEigen(), QUESO::GslMatrix::subReadContents(), QUESO::GslMatrix::subWriteContents(), QUESO::GslMatrix::svd(), QUESO::GslMatrix::svdSolve(), QUESO::GslMatrix::transpose(), QUESO::GslMatrix::zeroLower(), and QUESO::GslMatrix::zeroUpper().
|
mutableprotected |
Flag for either or not QUESO is in debug mode.
Definition at line 155 of file Matrix.h.
Referenced by copy(), getInDebugMode(), QUESO::GslMatrix::invertMultiply(), and setInDebugMode().
|
protected |
Mapping variable.
Definition at line 147 of file Matrix.h.
Referenced by QUESO::GslMatrix::determinant(), QUESO::GslMatrix::getColumn(), QUESO::GslMatrix::getRow(), QUESO::GslMatrix::inverse(), QUESO::GslMatrix::invertMultiply(), QUESO::GslMatrix::invertMultiplyForceLU(), QUESO::GslMatrix::largestEigen(), QUESO::GslMatrix::lnDeterminant(), map(), QUESO::GslMatrix::multiply(), numOfProcsForStorage(), QUESO::GslMatrix::smallestEigen(), and QUESO::GslMatrix::transpose().
|
mutableprotected |
Flag for either or not print this matrix.
Definition at line 152 of file Matrix.h.
Referenced by copy(), getPrintHorizontally(), QUESO::GslMatrix::print(), and setPrintHorizontally().