queso-0.52.0
|
Class for matrix operations using GSL library. More...
#include <GslMatrix.h>
Public Member Functions | |
Constructor/Destructor methods | |
GslMatrix () | |
Default Constructor. More... | |
GslMatrix (const BaseEnvironment &env, const Map &map, unsigned int numCols) | |
Shaped Constructor: creates a shaped matrix with numCols columns. More... | |
GslMatrix (const BaseEnvironment &env, const Map &map, double diagValue) | |
Shaped Constructor: creates a square matrix with size map.NumGlobalElements() and diagonal values all equal to diagValue . More... | |
GslMatrix (const GslVector &v, double diagValue) | |
Shaped Constructor: creates a square matrix with size v.sizeLocal() and diagonal values all equal to diagValue . More... | |
GslMatrix (const GslVector &v) | |
Shaped Constructor: creates a square matrix with size v.sizeLocal() . More... | |
GslMatrix (const GslMatrix &B) | |
Shaped Constructor: creates a matrix with B.numCols() columns and B.numRowsLocal() rows. More... | |
~GslMatrix () | |
Destructor. More... | |
Set methods | |
GslMatrix & | operator= (const GslMatrix &rhs) |
Copies values from matrix rhs to this . More... | |
GslMatrix & | operator*= (double a) |
Stores in this the coordinate-wise multiplication of this and a . More... | |
GslMatrix & | operator/= (double a) |
Stores in this the coordinate-wise division of this by a . More... | |
GslMatrix & | operator+= (const GslMatrix &rhs) |
Stores in this the coordinate-wise addition of this and rhs . More... | |
GslMatrix & | operator-= (const GslMatrix &rhs) |
Stores in this the coordinate-wise subtraction of this by rhs . More... | |
Accessor methods | |
double & | operator() (unsigned int i, unsigned int j) |
Element access method (non-const). More... | |
const double & | operator() (unsigned int i, unsigned int j) const |
Element access method (const). More... | |
Attribute methods | |
unsigned int | numRowsLocal () const |
Returns the local row dimension of this matrix. More... | |
unsigned int | numRowsGlobal () const |
Returns the global row dimension of this matrix. More... | |
unsigned int | numCols () const |
Returns the column dimension of this matrix. More... | |
double | max () const |
Returns the maximum element value of the matrix. More... | |
unsigned int | rank (double absoluteZeroThreshold, double relativeZeroThreshold) const |
This function returns the number of singular values of this matrix (rank). More... | |
GslMatrix | transpose () const |
This function calculated the transpose of this matrix (square). More... | |
GslMatrix | inverse () const |
This function calculated the inverse of this matrix (square). More... | |
double | determinant () const |
Calculates the determinant of this matrix. More... | |
double | lnDeterminant () const |
Calculates the ln(determinant) of this matrix. More... | |
Norm methods | |
double | normFrob () const |
Returns the Frobenius norm of this matrix. More... | |
double | normMax () const |
Returns the Frobenius norm of this matrix. More... | |
Mathematical methods | |
int | chol () |
Computes Cholesky factorization of a real symmetric positive definite matrix this . More... | |
int | svd (GslMatrix &matU, GslVector &vecS, GslMatrix &matVt) const |
Checks for the dimension of this matrix, matU , VecS and matVt , and calls the protected routine internalSvd to compute the singular values of this . More... | |
const GslMatrix & | svdMatU () const |
This function calls private member GslMatrix::internalSvd() to set a M-by-N orthogonal matrix U of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. More... | |
const GslMatrix & | svdMatV () const |
This function calls private member GslMatrix::internalSvd() to set a N-by-N orthogonal square matrix V of the singular value decomposition (svd) of a general rectangular M-by-N matrix A. More... | |
int | svdSolve (const GslVector &rhsVec, GslVector &solVec) const |
This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with GslMatrix::svd (x=solVec, b=rhsVec). More... | |
int | svdSolve (const GslMatrix &rhsMat, GslMatrix &solMat) const |
This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with GslMatrix::svd (x=solMat, b=rhsMat). More... | |
GslVector | multiply (const GslVector &x) const |
This function multiplies this matrix by vector x and returns the resulting vector. More... | |
GslVector | invertMultiply (const GslVector &b) const |
This function calculates the inverse of this matrix and multiplies it with vector b . 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... | |
GslMatrix | invertMultiply (const GslMatrix &B) const |
This function calculates the inverse of this matrix and multiplies it with matrix B . More... | |
void | invertMultiply (const GslMatrix &B, GslMatrix &X) const |
This function calculates the inverse of this matrix, multiplies it with matrix B and stores the result in matrix X . More... | |
GslVector | invertMultiplyForceLU (const GslVector &b) const |
This function calculates the inverse of this matrix and multiplies it with vector b . More... | |
void | invertMultiplyForceLU (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... | |
void | getColumn (const unsigned int column_num, GslVector &column) const |
This function gets the column_num-th column of this matrix and stores it into vector column . More... | |
GslVector | getColumn (const unsigned int column_num) const |
This function gets the column_num-th column of this matrix. More... | |
void | setColumn (const unsigned int column_num, const GslVector &column) |
This function copies vector column into the column_num-th column of this matrix. More... | |
void | getRow (const unsigned int row_num, GslVector &row) const |
This function gets the row_num-th column of this matrix and stores it into vector row . More... | |
GslVector | getRow (const unsigned int row_num) const |
This function gets the row_num-th column of this matrix. More... | |
void | setRow (const unsigned int row_num, const GslVector &row) |
This function copies vector row into the row_num-th column of this matrix. More... | |
void | eigen (GslVector &eigenValues, GslMatrix *eigenVectors) const |
This function computes the eigenvalues of a real symmetric matrix. More... | |
void | largestEigen (double &eigenValue, GslVector &eigenVector) const |
This function finds largest eigenvalue, namely eigenValue , of this matrix and its corresponding eigenvector, namely eigenVector . More... | |
void | smallestEigen (double &eigenValue, GslVector &eigenVector) const |
This function finds smallest eigenvalue, namely eigenValue , of this matrix and its corresponding eigenvector, namely eigenVector . More... | |
Get/Set methods | |
void | cwSet (double value) |
Component-wise set all values to this with value. More... | |
void | cwSet (unsigned int rowId, unsigned int colId, const GslMatrix &mat) |
Set the components of which positions are greater than (rowId,colId) with the value of mat(rowId,colId). More... | |
void | cwExtract (unsigned int rowId, unsigned int colId, GslMatrix &mat) const |
void | zeroLower (bool includeDiagonal=false) |
This function sets all the entries bellow the main diagonal of this matrix to zero. More... | |
void | zeroUpper (bool includeDiagonal=false) |
This function sets all the entries above the main diagonal of this matrix to zero. More... | |
void | filterSmallValues (double thresholdValue) |
This function sets to zero (filters) all entries of this matrix which are smaller than thresholdValue . More... | |
void | filterLargeValues (double thresholdValue) |
This function sets to zero (filters) all entries of this matrix which are greater than thresholdValue . More... | |
void | fillWithTranspose (unsigned int rowId, unsigned int colId, const GslMatrix &mat, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function stores the transpose of this matrix into this matrix. More... | |
void | fillWithBlocksDiagonally (unsigned int rowId, unsigned int colId, const std::vector< const GslMatrix * > &matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function fills this matrix diagonally with const block matrices. More... | |
void | fillWithBlocksDiagonally (unsigned int rowId, unsigned int colId, const std::vector< GslMatrix * > &matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function fills this matrix diagonally with block matrices. More... | |
void | fillWithBlocksHorizontally (unsigned int rowId, unsigned int colId, const std::vector< const GslMatrix * > &matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function fills this matrix horizontally with const block matrices. More... | |
void | fillWithBlocksHorizontally (unsigned int rowId, unsigned int colId, const std::vector< GslMatrix * > &matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function fills this matrix horizontally with const block. More... | |
void | fillWithBlocksVertically (unsigned int rowId, unsigned int colId, const std::vector< const GslMatrix * > &matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function fills this matrix vertically with const block matrices. More... | |
void | fillWithBlocksVertically (unsigned int rowId, unsigned int colId, const std::vector< GslMatrix * > &matrices, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function fills this matrix vertically with block matrices. More... | |
void | fillWithTensorProduct (unsigned int rowId, unsigned int colId, const GslMatrix &mat1, const GslMatrix &mat2, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function calculates the tensor product of matrices mat1 and mat2 and stores it in this matrix. More... | |
void | fillWithTensorProduct (unsigned int rowId, unsigned int colId, const GslMatrix &mat1, const GslVector &vec2, bool checkForExactNumRowsMatching, bool checkForExactNumColsMatching) |
This function calculates the tensor product of matrix mat1 and vector vec2 and stores it in this matrix. More... | |
Miscellaneous methods | |
gsl_matrix * | data () |
Returns this matrix. More... | |
void | mpiSum (const MpiComm &comm, GslMatrix &M_global) const |
void | matlabLinearInterpExtrap (const GslVector &x1Vec, const GslMatrix &y1Mat, const GslVector &x2Vec) |
I/O methods | |
void | print (std::ostream &os) const |
Print method. Defines the behavior of the ostream << operator inherited from the Object class. More... | |
void | subWriteContents (const std::string &varNamePrefix, const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) const |
Write contents of subenvironment in file fileName . More... | |
void | subReadContents (const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) |
Read contents of subenvironment from file fileName . More... | |
Public Member Functions inherited from QUESO::Matrix | |
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... | |
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... | |
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... | |
Private Member Functions | |
void | copy (const GslMatrix &src) |
In this function this matrix receives a copy of matrix src . More... | |
void | resetLU () |
In this function resets the LU decomposition of this matrix, as well as deletes the private member pointers, if existing. More... | |
void | multiply (const GslVector &x, GslVector &y) const |
This function multiplies this matrix by vector x and stores the resulting vector in y . More... | |
int | internalSvd () const |
This function factorizes the M-by-N matrix A into the singular value decomposition A = U S V^T for M >= N. On output the matrix A is replaced by U. More... | |
Private Attributes | |
gsl_matrix * | m_mat |
GSL matrix, also referred to as this matrix. More... | |
gsl_matrix * | m_LU |
GSL matrix for the LU decomposition of m_mat. More... | |
GslMatrix * | m_inverse |
Inverse matrix of this . More... | |
Map * | m_svdColMap |
Mapping for matrices involved in the singular value decomposition (svd) routine. More... | |
GslMatrix * | m_svdUmat |
m_svdUmat stores the M-by-N orthogonal matrix U after the singular value decomposition of a matrix. More... | |
GslVector * | m_svdSvec |
m_svdSvec stores the diagonal of the N-by-N diagonal matrix of singular values S after the singular value decomposition of a matrix. More... | |
GslMatrix * | m_svdVmat |
m_svdVmat stores the N-by-N orthogonal square matrix V after the singular value decomposition of a matrix. More... | |
GslMatrix * | m_svdVTmat |
m_svdVmatT stores the transpose of N-by-N orthogonal square matrix V, namely V^T, after the singular value decomposition of a matrix. More... | |
double | m_determinant |
The determinant of this matrix. More... | |
double | m_lnDeterminant |
The natural logarithm of the determinant of this matrix. More... | |
gsl_permutation * | m_permutation |
The permutation matrix of a LU decomposition. More... | |
int | m_signum |
m_signum stores the sign of the permutation of the LU decomposition PA = LU. More... | |
bool | m_isSingular |
Indicates whether or not this matrix is singular. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from QUESO::Matrix | |
virtual void | copy (const Matrix &src) |
Copies matrix src to this matrix. More... | |
Protected Attributes inherited from QUESO::Matrix | |
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 using GSL library.
This class creates and provides basic support for matrices of templated type as a specialization of Matrix using GSL matrices, which are defined by an encapsulated gsl_matrix structure.
Definition at line 47 of file GslMatrix.h.
QUESO::GslMatrix::GslMatrix | ( | ) |
Default Constructor.
Creates an empty matrix vector of no dimension. It should not be used by user.
Definition at line 36 of file GslMatrix.C.
References QUESO::Matrix::m_env, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
Referenced by internalSvd(), and inverse().
QUESO::GslMatrix::GslMatrix | ( | const BaseEnvironment & | env, |
const Map & | map, | ||
unsigned int | numCols | ||
) |
Shaped Constructor: creates a shaped matrix with numCols
columns.
Definition at line 46 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
QUESO::GslMatrix::GslMatrix | ( | const BaseEnvironment & | env, |
const Map & | map, | ||
double | diagValue | ||
) |
Shaped Constructor: creates a square matrix with size map.NumGlobalElements()
and diagonal values all equal to diagValue
.
Definition at line 73 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
QUESO::GslMatrix::GslMatrix | ( | const GslVector & | v, |
double | diagValue | ||
) |
Shaped Constructor: creates a square matrix with size v.sizeLocal()
and diagonal values all equal to diagValue
.
Definition at line 103 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
QUESO::GslMatrix::GslMatrix | ( | const GslVector & | v | ) |
Shaped Constructor: creates a square matrix with size v.sizeLocal()
.
The diagonal values of this matrix are the elements in vector v
.
Definition at line 132 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, QUESO::GslVector::sizeLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
QUESO::GslMatrix::GslMatrix | ( | const GslMatrix & | B | ) |
Shaped Constructor: creates a matrix with B.numCols()
columns and B.numRowsLocal()
rows.
This
matrix is a copy of matrix B
.
Definition at line 161 of file GslMatrix.C.
References QUESO::Matrix::copy(), copy(), QUESO::Matrix::m_env, m_mat, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
QUESO::GslMatrix::~GslMatrix | ( | ) |
Destructor.
Definition at line 187 of file GslMatrix.C.
References m_mat, and resetLU().
|
virtual |
Computes Cholesky factorization of a real symmetric positive definite matrix this
.
In case fails to be symmetric and positive definite, an error will be returned.
Implements QUESO::Matrix.
Definition at line 506 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, QUESO::UQ_MATRIX_IS_NOT_POS_DEFINITE_RC, UQ_RC_MACRO, and QUESO::BaseEnvironment::worldRank().
|
private |
In this function this
matrix receives a copy of matrix src
.
Definition at line 292 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, resetLU(), UQ_FATAL_RC_MACRO, and QUESO::BaseEnvironment::worldRank().
Referenced by GslMatrix(), and operator=().
void QUESO::GslMatrix::cwExtract | ( | unsigned int | rowId, |
unsigned int | colId, | ||
GslMatrix & | mat | ||
) | const |
Definition at line 471 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::cwSet | ( | double | value | ) |
Component-wise set all values to this
with value.
Definition at line 421 of file GslMatrix.C.
References m_mat, numCols(), and numRowsLocal().
void QUESO::GslMatrix::cwSet | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const GslMatrix & | mat | ||
) |
Set the components of which
positions are greater than (rowId,colId) with the value of mat(rowId,colId).
Definition at line 436 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
gsl_matrix * QUESO::GslMatrix::data | ( | ) |
Returns this
matrix.
Definition at line 2108 of file GslMatrix.C.
References m_mat.
Referenced by internalSvd(), and svdSolve().
double QUESO::GslMatrix::determinant | ( | ) | const |
Calculates the determinant of this
matrix.
Definition at line 1281 of file GslMatrix.C.
References QUESO::BaseEnvironment::displayVerbosity(), invertMultiply(), m_determinant, QUESO::Matrix::m_env, m_lnDeterminant, m_LU, QUESO::Matrix::m_map, m_signum, and QUESO::BaseEnvironment::subDisplayFile().
This function computes the eigenvalues of a real symmetric matrix.
Definition at line 1696 of file GslMatrix.C.
References QUESO::GslVector::data(), QUESO::Matrix::env(), QUESO::BaseEnvironment::fullRank(), m_mat, numRowsLocal(), QUESO::GslVector::sizeLocal(), and UQ_FATAL_TEST_MACRO.
void QUESO::GslMatrix::fillWithBlocksDiagonally | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const std::vector< const GslMatrix * > & | matrices, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function fills this
matrix diagonally with const block matrices.
Definition at line 888 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::fillWithBlocksDiagonally | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const std::vector< GslMatrix * > & | matrices, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function fills this
matrix diagonally with block matrices.
Definition at line 936 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::fillWithBlocksHorizontally | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const std::vector< const GslMatrix * > & | matrices, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function fills this
matrix horizontally with const block matrices.
Definition at line 984 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::fillWithBlocksHorizontally | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const std::vector< GslMatrix * > & | matrices, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function fills this
matrix horizontally with const block.
Definition at line 1028 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::fillWithBlocksVertically | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const std::vector< const GslMatrix * > & | matrices, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function fills this
matrix vertically with const block matrices.
Definition at line 1072 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::fillWithBlocksVertically | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const std::vector< GslMatrix * > & | matrices, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function fills this
matrix vertically with block matrices.
Definition at line 1116 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::fillWithTensorProduct | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const GslMatrix & | mat1, | ||
const GslMatrix & | mat2, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function calculates the tensor product of matrices mat1
and mat2
and stores it in this
matrix.
Definition at line 1160 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::fillWithTensorProduct | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const GslMatrix & | mat1, | ||
const GslVector & | vec2, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function calculates the tensor product of matrix mat1
and vector vec2
and stores it in this
matrix.
Definition at line 1202 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::fillWithTranspose | ( | unsigned int | rowId, |
unsigned int | colId, | ||
const GslMatrix & | mat, | ||
bool | checkForExactNumRowsMatching, | ||
bool | checkForExactNumColsMatching | ||
) |
This function stores the transpose of this
matrix into this
matrix.
Definition at line 1245 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::filterLargeValues | ( | double | thresholdValue | ) |
This function sets to zero (filters) all entries of this
matrix which are greater than thresholdValue
.
If thresholdValue
< 0 then no values will be filtered.
Definition at line 801 of file GslMatrix.C.
References numCols(), and numRowsLocal().
void QUESO::GslMatrix::filterSmallValues | ( | double | thresholdValue | ) |
This function sets to zero (filters) all entries of this
matrix which are smaller than thresholdValue
.
If thresholdValue
< 0 then no values will be filtered.
Definition at line 778 of file GslMatrix.C.
References numCols(), and numRowsLocal().
void QUESO::GslMatrix::getColumn | ( | const unsigned int | column_num, |
GslVector & | column | ||
) | const |
This function gets the column_num-th column of this
matrix and stores it into vector column
.
Definition at line 1880 of file GslMatrix.C.
References QUESO::Matrix::env(), QUESO::BaseEnvironment::fullRank(), m_mat, numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), UQ_FATAL_RC_MACRO, and UQ_FATAL_TEST_MACRO.
Referenced by getColumn(), invertMultiply(), matlabLinearInterpExtrap(), and svdSolve().
GslVector QUESO::GslMatrix::getColumn | ( | const unsigned int | column_num | ) | const |
This function gets the column_num-th column of this
matrix.
Definition at line 1963 of file GslMatrix.C.
References getColumn(), QUESO::Matrix::m_env, and QUESO::Matrix::m_map.
void QUESO::GslMatrix::getRow | ( | const unsigned int | row_num, |
GslVector & | row | ||
) | const |
This function gets the row_num-th column of this
matrix and stores it into vector row
.
Definition at line 1915 of file GslMatrix.C.
References QUESO::Matrix::env(), QUESO::BaseEnvironment::fullRank(), m_mat, numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), UQ_FATAL_RC_MACRO, and UQ_FATAL_TEST_MACRO.
Referenced by getRow().
GslVector QUESO::GslMatrix::getRow | ( | const unsigned int | row_num | ) | const |
This function gets the row_num-th column of this
matrix.
Definition at line 1950 of file GslMatrix.C.
References getRow(), QUESO::Matrix::m_env, and QUESO::Matrix::m_map.
|
private |
This function factorizes the M-by-N matrix A into the singular value decomposition A = U S V^T for M >= N. On output the matrix A is replaced by U.
Definition at line 654 of file GslMatrix.C.
References QUESO::GslVector::data(), data(), GslMatrix(), QUESO::Matrix::m_env, m_svdColMap, m_svdSvec, m_svdUmat, m_svdVmat, m_svdVTmat, QUESO::Matrix::map(), numCols(), numRowsLocal(), transpose(), UQ_FATAL_TEST_MACRO, QUESO::UQ_MATRIX_SVD_FAILED_RC, UQ_RC_MACRO, and QUESO::BaseEnvironment::worldRank().
Referenced by rank(), svd(), svdMatU(), svdMatV(), and svdSolve().
GslMatrix QUESO::GslMatrix::inverse | ( | ) | const |
This function calculated the inverse of this
matrix (square).
Definition at line 845 of file GslMatrix.C.
References QUESO::BaseEnvironment::checkingLevel(), QUESO::GslVector::cwSet(), QUESO::BaseEnvironment::displayVerbosity(), GslMatrix(), invertMultiply(), lnDeterminant(), QUESO::Matrix::m_env, m_inverse, QUESO::Matrix::m_map, numCols(), numRowsLocal(), QUESO::BaseEnvironment::subDisplayFile(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
This function calculates the inverse of this
matrix and multiplies it with vector b
.
It calls void GslMatrix::invertMultiply(const GslVector& b, GslVector& x) internally.
Definition at line 1441 of file GslMatrix.C.
References QUESO::Matrix::m_env, QUESO::Matrix::m_map, numCols(), QUESO::GslVector::sizeLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
Referenced by determinant(), inverse(), invertMultiply(), and lnDeterminant().
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 this
matrix and does not recompute it if m_MU != NULL .
Definition at line 1456 of file GslMatrix.C.
References QUESO::GslVector::data(), QUESO::BaseEnvironment::displayVerbosity(), QUESO::Matrix::m_env, QUESO::Matrix::m_inDebugMode, m_isSingular, m_LU, m_mat, m_permutation, m_signum, QUESO::GslVector::norm2(), numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), QUESO::BaseEnvironment::subDisplayFile(), UQ_FATAL_RC_MACRO, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
This function calculates the inverse of this
matrix and multiplies it with matrix B
.
It calls void GslMatrix::invertMultiply(const GslMatrix& B, GslMatrix& X) const internally.
Definition at line 1578 of file GslMatrix.C.
References invertMultiply(), QUESO::Matrix::m_env, QUESO::Matrix::m_map, and numCols().
This function calculates the inverse of this
matrix, multiplies it with matrix B
and stores the result in matrix X
.
It checks for a previous LU decomposition of this
matrix and does not recompute it if m_MU != NULL .
Definition at line 1587 of file GslMatrix.C.
References getColumn(), invertMultiply(), QUESO::Matrix::m_env, QUESO::Matrix::m_map, numCols(), numRowsLocal(), setColumn(), UQ_FATAL_RC_MACRO, and QUESO::BaseEnvironment::worldRank().
This function calculates the inverse of this
matrix and multiplies it with vector b
.
It calls void GslMatrix::InvertMultiplyForceLU(const GslVector& b, GslVector& x) const;(const GslVector& b,
GslVector& x) internally.
Definition at line 1622 of file GslMatrix.C.
References QUESO::Matrix::m_env, QUESO::Matrix::m_map, numCols(), QUESO::GslVector::sizeLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
This function calculates the inverse of this
matrix, multiplies it with vector b
and stores the result in vector x
.
It recalculates the LU decomposition of this
matrix.
Definition at line 1637 of file GslMatrix.C.
References QUESO::GslVector::data(), QUESO::Matrix::m_env, m_isSingular, m_LU, m_mat, m_permutation, m_signum, numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), UQ_FATAL_RC_MACRO, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::largestEigen | ( | double & | eigenValue, |
GslVector & | eigenVector | ||
) | const |
This function finds largest eigenvalue, namely eigenValue
, of this
matrix and its corresponding eigenvector, namely eigenVector
.
Definition at line 1728 of file GslMatrix.C.
References QUESO::GslVector::abs(), QUESO::Matrix::env(), QUESO::Matrix::m_env, QUESO::Matrix::m_map, QUESO::GslVector::sizeLocal(), and UQ_FATAL_TEST_MACRO.
double QUESO::GslMatrix::lnDeterminant | ( | ) | const |
Calculates the ln(determinant) of this
matrix.
Definition at line 1322 of file GslMatrix.C.
References QUESO::BaseEnvironment::displayVerbosity(), invertMultiply(), m_determinant, QUESO::Matrix::m_env, m_lnDeterminant, m_LU, QUESO::Matrix::m_map, m_signum, and QUESO::BaseEnvironment::subDisplayFile().
Referenced by inverse().
void QUESO::GslMatrix::matlabLinearInterpExtrap | ( | const GslVector & | x1Vec, |
const GslMatrix & | y1Mat, | ||
const GslVector & | x2Vec | ||
) |
Definition at line 2071 of file GslMatrix.C.
References getColumn(), QUESO::Matrix::m_env, QUESO::GslVector::matlabLinearInterpExtrap(), numCols(), numRowsLocal(), setColumn(), QUESO::GslVector::sizeLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
double QUESO::GslMatrix::max | ( | ) | const |
Returns the maximum element value of the matrix.
Definition at line 403 of file GslMatrix.C.
References numCols(), and numRowsLocal().
Definition at line 2028 of file GslMatrix.C.
References QUESO::MpiComm::Allreduce(), QUESO::Matrix::env(), QUESO::BaseEnvironment::fullRank(), numCols(), numRowsLocal(), RawValue_MPI_DOUBLE, RawValue_MPI_SUM, and UQ_FATAL_RC_MACRO.
This function multiplies this
matrix by vector x
and returns the resulting vector.
Definition at line 1398 of file GslMatrix.C.
References QUESO::Matrix::m_env, QUESO::Matrix::m_map, numCols(), QUESO::GslVector::sizeLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
Referenced by QUESO::operator*().
This function multiplies this
matrix by vector x
and stores the resulting vector in y
.
Definition at line 1413 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
double QUESO::GslMatrix::normFrob | ( | ) | const |
Returns the Frobenius norm of this
matrix.
Definition at line 367 of file GslMatrix.C.
References numCols(), and numRowsLocal().
double QUESO::GslMatrix::normMax | ( | ) | const |
Returns the Frobenius norm of this
matrix.
Definition at line 385 of file GslMatrix.C.
References numCols(), and numRowsLocal().
|
virtual |
Returns the column dimension of this
matrix.
Implements QUESO::Matrix.
Definition at line 361 of file GslMatrix.C.
References m_mat.
Referenced by cwExtract(), cwSet(), fillWithBlocksDiagonally(), fillWithBlocksHorizontally(), fillWithBlocksVertically(), fillWithTensorProduct(), fillWithTranspose(), filterLargeValues(), filterSmallValues(), getColumn(), getRow(), internalSvd(), inverse(), invertMultiply(), invertMultiplyForceLU(), QUESO::leftDiagScaling(), matlabLinearInterpExtrap(), max(), mpiSum(), multiply(), normFrob(), normMax(), QUESO::operator*(), print(), rank(), QUESO::rightDiagScaling(), setColumn(), setRow(), subReadContents(), subWriteContents(), svd(), svdSolve(), transpose(), zeroLower(), and zeroUpper().
|
virtual |
Returns the global row dimension of this
matrix.
Implements QUESO::Matrix.
Definition at line 355 of file GslMatrix.C.
References m_mat.
|
virtual |
Returns the local row dimension of this
matrix.
Implements QUESO::Matrix.
Definition at line 349 of file GslMatrix.C.
References m_mat.
Referenced by cwExtract(), cwSet(), eigen(), fillWithBlocksDiagonally(), fillWithBlocksHorizontally(), fillWithBlocksVertically(), fillWithTensorProduct(), fillWithTranspose(), filterLargeValues(), filterSmallValues(), QUESO::GaussianLikelihoodBlockDiagonalCovariance< V, M >::GaussianLikelihoodBlockDiagonalCovariance(), QUESO::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients< V, M >::GaussianLikelihoodBlockDiagonalCovarianceRandomCoefficients(), getColumn(), getRow(), internalSvd(), inverse(), invertMultiply(), invertMultiplyForceLU(), QUESO::leftDiagScaling(), matlabLinearInterpExtrap(), max(), mpiSum(), multiply(), normFrob(), normMax(), QUESO::operator*(), print(), rank(), QUESO::rightDiagScaling(), setColumn(), setRow(), subReadContents(), subWriteContents(), svd(), svdSolve(), transpose(), zeroLower(), and zeroUpper().
double & QUESO::GslMatrix::operator() | ( | unsigned int | i, |
unsigned int | j | ||
) |
Element access method (non-const).
Definition at line 254 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, resetLU(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
const double & QUESO::GslMatrix::operator() | ( | unsigned int | i, |
unsigned int | j | ||
) | const |
Element access method (const).
Definition at line 278 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
GslMatrix & QUESO::GslMatrix::operator*= | ( | double | a | ) |
Stores in this
the coordinate-wise multiplication of this
and a
.
Definition at line 203 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, resetLU(), UQ_FATAL_RC_MACRO, and QUESO::BaseEnvironment::worldRank().
Stores in this
the coordinate-wise addition of this
and rhs
.
Definition at line 225 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, resetLU(), UQ_FATAL_RC_MACRO, and QUESO::BaseEnvironment::worldRank().
Stores in this
the coordinate-wise subtraction of this
by rhs
.
Definition at line 239 of file GslMatrix.C.
References QUESO::Matrix::m_env, m_mat, resetLU(), UQ_FATAL_RC_MACRO, and QUESO::BaseEnvironment::worldRank().
GslMatrix & QUESO::GslMatrix::operator/= | ( | double | a | ) |
Stores in this
the coordinate-wise division of this
by a
.
Definition at line 216 of file GslMatrix.C.
References resetLU().
Copies values from matrix rhs
to this
.
Definition at line 195 of file GslMatrix.C.
References copy(), and resetLU().
|
virtual |
Print method. Defines the behavior of the ostream << operator inherited from the Object class.
Implements QUESO::Matrix.
Definition at line 2114 of file GslMatrix.C.
References QUESO::Matrix::m_printHorizontally, numCols(), and numRowsLocal().
Referenced by QUESO::operator<<(), and QUESO::GslBlockMatrix::print().
unsigned int QUESO::GslMatrix::rank | ( | double | absoluteZeroThreshold, |
double | relativeZeroThreshold | ||
) | const |
This function returns the number of singular values of this
matrix (rank).
The rank function provides an estimate of the number of linearly independent rows or columns of a full matrix.
Definition at line 1363 of file GslMatrix.C.
References QUESO::BaseEnvironment::displayVerbosity(), internalSvd(), QUESO::Matrix::m_env, m_svdSvec, numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), and QUESO::BaseEnvironment::subDisplayFile().
|
private |
In this function resets the LU decomposition of this
matrix, as well as deletes the private member pointers, if existing.
Definition at line 306 of file GslMatrix.C.
References m_determinant, m_inverse, m_isSingular, m_lnDeterminant, m_LU, m_permutation, m_signum, m_svdColMap, m_svdSvec, m_svdUmat, m_svdVmat, and m_svdVTmat.
Referenced by copy(), operator()(), operator*=(), operator+=(), operator-=(), operator/=(), operator=(), setColumn(), setRow(), zeroLower(), zeroUpper(), and ~GslMatrix().
void QUESO::GslMatrix::setColumn | ( | const unsigned int | column_num, |
const GslVector & | column | ||
) |
This function copies vector column
into the column_num-th column of this
matrix.
Definition at line 2002 of file GslMatrix.C.
References QUESO::GslVector::data(), QUESO::Matrix::env(), QUESO::BaseEnvironment::fullRank(), m_mat, numCols(), numRowsLocal(), resetLU(), QUESO::GslVector::sizeLocal(), UQ_FATAL_RC_MACRO, and UQ_FATAL_TEST_MACRO.
Referenced by invertMultiply(), matlabLinearInterpExtrap(), and svdSolve().
void QUESO::GslMatrix::setRow | ( | const unsigned int | row_num, |
const GslVector & | row | ||
) |
This function copies vector row
into the row_num-th column of this
matrix.
Definition at line 1976 of file GslMatrix.C.
References QUESO::GslVector::data(), QUESO::Matrix::env(), QUESO::BaseEnvironment::fullRank(), m_mat, numCols(), numRowsLocal(), resetLU(), QUESO::GslVector::sizeLocal(), UQ_FATAL_RC_MACRO, and UQ_FATAL_TEST_MACRO.
void QUESO::GslMatrix::smallestEigen | ( | double & | eigenValue, |
GslVector & | eigenVector | ||
) | const |
This function finds smallest eigenvalue, namely eigenValue
, of this
matrix and its corresponding eigenvector, namely eigenVector
.
Definition at line 1803 of file GslMatrix.C.
References QUESO::GslVector::abs(), QUESO::Matrix::env(), QUESO::Matrix::m_env, QUESO::Matrix::m_map, QUESO::GslVector::sizeLocal(), and UQ_FATAL_TEST_MACRO.
void QUESO::GslMatrix::subReadContents | ( | const std::string & | fileName, |
const std::string & | fileType, | ||
const std::set< unsigned int > & | allowedSubEnvIds | ||
) |
Read contents of subenvironment from file fileName
.
Definition at line 2189 of file GslMatrix.C.
References QUESO::BaseEnvironment::closeFile(), QUESO::BaseEnvironment::fullRank(), QUESO::Matrix::m_env, numCols(), QUESO::Matrix::numOfProcsForStorage(), numRowsLocal(), QUESO::BaseEnvironment::openInputFile(), QUESO::BaseEnvironment::subDisplayFile(), QUESO::BaseEnvironment::subRank(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
void QUESO::GslMatrix::subWriteContents | ( | const std::string & | varNamePrefix, |
const std::string & | fileName, | ||
const std::string & | fileType, | ||
const std::set< unsigned int > & | allowedSubEnvIds | ||
) | const |
Write contents of subenvironment in file fileName
.
Definition at line 2143 of file GslMatrix.C.
References QUESO::BaseEnvironment::closeFile(), QUESO::Matrix::m_env, numCols(), QUESO::Matrix::numOfProcsForStorage(), numRowsLocal(), QUESO::BaseEnvironment::openOutputFile(), QUESO::BaseEnvironment::subIdString(), QUESO::BaseEnvironment::subRank(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
Checks for the dimension of this
matrix, matU
, VecS
and matVt
, and calls the protected routine internalSvd
to compute the singular values of this
.
Definition at line 533 of file GslMatrix.C.
References internalSvd(), QUESO::Matrix::m_env, m_svdSvec, m_svdUmat, m_svdVTmat, numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
const GslMatrix & QUESO::GslMatrix::svdMatU | ( | ) | const |
This function calls private member GslMatrix::internalSvd() to set a M-by-N orthogonal matrix U of the singular value decomposition (svd) of a general rectangular M-by-N matrix A.
A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T.
Definition at line 634 of file GslMatrix.C.
References internalSvd(), and m_svdUmat.
const GslMatrix & QUESO::GslMatrix::svdMatV | ( | ) | const |
This function calls private member GslMatrix::internalSvd() to set a N-by-N orthogonal square matrix V of the singular value decomposition (svd) of a general rectangular M-by-N matrix A.
A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T.
Definition at line 644 of file GslMatrix.C.
References internalSvd(), and m_svdVmat.
This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with GslMatrix::svd (x=solVec, b=rhsVec).
Definition at line 563 of file GslMatrix.C.
References QUESO::GslVector::data(), data(), QUESO::BaseEnvironment::displayVerbosity(), internalSvd(), QUESO::Matrix::m_env, m_svdSvec, m_svdUmat, m_svdVmat, numCols(), numRowsLocal(), QUESO::GslVector::sizeLocal(), QUESO::BaseEnvironment::subDisplayFile(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
Referenced by svdSolve().
This function solves the system A x = b using the singular value decomposition (U, S, V) of A which must have been computed previously with GslMatrix::svd (x=solMat, b=rhsMat).
Definition at line 600 of file GslMatrix.C.
References getColumn(), QUESO::Matrix::m_env, QUESO::Matrix::map(), numCols(), numRowsLocal(), setColumn(), svdSolve(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
GslMatrix QUESO::GslMatrix::transpose | ( | ) | const |
This function calculated the transpose of this
matrix (square).
Definition at line 824 of file GslMatrix.C.
References QUESO::Matrix::m_env, QUESO::Matrix::m_map, numCols(), numRowsLocal(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
Referenced by internalSvd().
|
virtual |
This function sets all the entries bellow the main diagonal of this
matrix to zero.
If \c includeDiagonal = false, then only the entries bellow the main diagonal are set to zero;
if includeDiagonal
= true, then the elements of the matrix diagonal are also set to zero.
Implements QUESO::Matrix.
Definition at line 716 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), resetLU(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
|
virtual |
This function sets all the entries above the main diagonal of this
matrix to zero.
If \c includeDiagonal = false, then only the entries above the main diagonal are set to zero;
if includeDiagonal
= true, then the elements of the matrix diagonal are also set to zero.
Implements QUESO::Matrix.
Definition at line 747 of file GslMatrix.C.
References QUESO::Matrix::m_env, numCols(), numRowsLocal(), resetLU(), UQ_FATAL_TEST_MACRO, and QUESO::BaseEnvironment::worldRank().
|
mutableprivate |
The determinant of this
matrix.
Definition at line 423 of file GslMatrix.h.
Referenced by determinant(), lnDeterminant(), and resetLU().
|
mutableprivate |
Inverse matrix of this
.
Definition at line 392 of file GslMatrix.h.
|
mutableprivate |
Indicates whether or not this
matrix is singular.
Definition at line 441 of file GslMatrix.h.
Referenced by invertMultiply(), invertMultiplyForceLU(), and resetLU().
|
mutableprivate |
The natural logarithm of the determinant of this
matrix.
Definition at line 426 of file GslMatrix.h.
Referenced by determinant(), lnDeterminant(), and resetLU().
|
mutableprivate |
GSL matrix for the LU decomposition of m_mat.
Definition at line 389 of file GslMatrix.h.
Referenced by determinant(), invertMultiply(), invertMultiplyForceLU(), lnDeterminant(), and resetLU().
|
private |
GSL matrix, also referred to as this
matrix.
Definition at line 386 of file GslMatrix.h.
Referenced by chol(), copy(), cwSet(), data(), eigen(), getColumn(), getRow(), GslMatrix(), invertMultiply(), invertMultiplyForceLU(), numCols(), numRowsGlobal(), numRowsLocal(), operator()(), operator*=(), operator+=(), operator-=(), setColumn(), setRow(), and ~GslMatrix().
|
mutableprivate |
The permutation matrix of a LU decomposition.
In the LU decomposition PA = LU, the j-th column of the matrix P is given by the k-th column of the identity matrix, where k = p_j the j-th element of the permutation vector. A is the square matrix of interest and P is the permutation matrix.
Definition at line 432 of file GslMatrix.h.
Referenced by invertMultiply(), invertMultiplyForceLU(), and resetLU().
|
mutableprivate |
m_signum stores the sign of the permutation of the LU decomposition PA = LU.
In the LU decomposition PA = LU, where A is the square matrix of interest and P is the permutation matrix, m_signum has the value (-1)^n, where n is the number of interchanges in the permutation.
Definition at line 438 of file GslMatrix.h.
Referenced by determinant(), invertMultiply(), invertMultiplyForceLU(), lnDeterminant(), and resetLU().
|
mutableprivate |
Mapping for matrices involved in the singular value decomposition (svd) routine.
Definition at line 395 of file GslMatrix.h.
Referenced by internalSvd(), and resetLU().
|
mutableprivate |
m_svdSvec stores the diagonal of the N-by-N diagonal matrix of singular values S after the singular value decomposition of a matrix.
A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T.
Definition at line 408 of file GslMatrix.h.
Referenced by internalSvd(), rank(), resetLU(), svd(), and svdSolve().
|
mutableprivate |
m_svdUmat stores the M-by-N orthogonal matrix U after the singular value decomposition of a matrix.
A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T.
Definition at line 401 of file GslMatrix.h.
Referenced by internalSvd(), resetLU(), svd(), svdMatU(), and svdSolve().
|
mutableprivate |
m_svdVmat stores the N-by-N orthogonal square matrix V after the singular value decomposition of a matrix.
A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T.
Definition at line 414 of file GslMatrix.h.
Referenced by internalSvd(), resetLU(), svdMatV(), and svdSolve().
|
mutableprivate |
m_svdVmatT stores the transpose of N-by-N orthogonal square matrix V, namely V^T, after the singular value decomposition of a matrix.
A general rectangular M-by-N matrix A has a singular value decomposition (svd) into the product of an M-by-N orthogonal matrix U, an N-by-N diagonal matrix of singular values S and the transpose of an N-by-N orthogonal square matrix V, A = U S V^T.
Definition at line 420 of file GslMatrix.h.
Referenced by internalSvd(), resetLU(), and svd().