Geophysical Inversion and Modelling Library
v1.5.2-5-g042d7f36
|
Simple row-based dense matrix based on Vector. More...
Public Member Functions | |
Matrix () | |
Matrix (Index rows) | |
Matrix (Index rows, Index cols) | |
Matrix (Index rows, Index cols, ValueType *src) | |
Matrix (const std::vector< Vector< ValueType > > &mat) | |
Matrix (const std::string &filename) | |
Matrix (const Matrix< ValueType > &mat) | |
Matrix< ValueType > & | operator= (const Matrix< ValueType > &mat) |
virtual | ~Matrix () |
void | copy (const Matrix< ValueType > &mat) |
virtual uint | rtti () const |
Vector< ValueType > & | operator[] (Index i) |
const Vector< ValueType > & | operator[] (Index i) const |
template<class T > | |
operator Matrix< T > () | |
virtual void | resize (Index rows, Index cols) |
void | clear () |
void | clean () |
Index | rows () const |
Index | cols () const |
void | setRow (Index i, const Vector< ValueType > &val) |
void | setVal (Index i, const Vector< ValueType > &val) |
void | setVal (Index i, Index j, const ValueType &val) |
void | addVal (Index i, Index j, const ValueType &val) |
const Vector< ValueType > & | row (Index i) const |
Vector< ValueType > & | rowRef (Index i) |
virtual const Vector< ValueType > | col (Index i) const |
void | push_back (const Vector< ValueType > &vec) |
Vector< ValueType > & | back () |
void | setCol (Index col, const Vector< ValueType > &v) |
void | addCol (Index col, const Vector< ValueType > &v) |
BVector & | rowFlag () |
Matrix< ValueType > & | add (const Matrix< ValueType > &a) |
Matrix< ValueType > & | transAdd (const Matrix< ValueType > &a) |
Vector< ValueType > | mult (const Vector< ValueType > &b) const |
Vector< ValueType > | mult (const Vector< ValueType > &b, Index startI, Index endI) const |
Vector< ValueType > | transMult (const Vector< ValueType > &b) const |
virtual void | save (const std::string &filename) const |
void | round (const ValueType &tolerance) |
void | dumpData (ValueType *target) const |
void | fromData (ValueType *src, Index m, Index n) |
Vector< double > | mult (const Vector< double > &b) const |
Vector< Complex > | mult (const Vector< Complex > &b) const |
Vector< double > | mult (const Vector< double > &b, Index startI, Index endI) const |
Vector< Complex > | mult (const Vector< Complex > &b, Index startI, Index endI) const |
Vector< double > | transMult (const Vector< double > &b) const |
Vector< Complex > | transMult (const Vector< Complex > &b) const |
Matrix< double > & | transAdd (const Matrix< double > &a) |
Matrix< Complex > & | transAdd (const Matrix< Complex > &a) |
DLLEXPORT Vector< double > | mult (const Vector< double > &b, Index startI, Index endI) const |
DLLEXPORT Vector< Complex > | mult (const Vector< Complex > &b, Index startI, Index endI) const |
DLLEXPORT Vector< double > | mult (const Vector< double > &b) const |
DLLEXPORT Vector< Complex > | mult (const Vector< Complex > &b) const |
DLLEXPORT Vector< double > | transMult (const Vector< double > &b) const |
DLLEXPORT Vector< Complex > | transMult (const Vector< Complex > &b) const |
DLLEXPORT Matrix< double > & | transAdd (const Matrix< double > &a) |
DLLEXPORT Matrix< Complex > & | transAdd (const Matrix< Complex > &a) |
Public Member Functions inherited from GIMLI::MatrixBase | |
MatrixBase (bool verbose=false) | |
virtual | ~MatrixBase () |
void | setVerbose (bool verbose) |
bool | verbose () const |
Index | size () const |
virtual RVector | dot (const RVector &a) const |
virtual CVector | mult (const CVector &a) const |
virtual CVector | mult (const CVector &b, Index startI, Index endI) const |
virtual CVector | transMult (const CVector &a) const |
Public Attributes | |
std::vector< Vector< ValueType > > | mat_ |
Protected Member Functions | |
void | allocate_ (Index rows, Index cols) |
void | copy_ (const Matrix< ValueType > &mat) |
Protected Attributes | |
BVector | rowFlag_ |
Protected Attributes inherited from GIMLI::MatrixBase | |
bool | verbose_ |
Simple row-based dense matrix based on Vector.
Simple row-based dense matrix based on Vector
|
inline |
Constructs an empty matrix with the dimension rows x cols. Content of the matrix is zero.
|
inline |
Copy constructor
|
inline |
Constructor, read matrix from file see load(Matrix < ValueType > & A, const std::string & filename).
References GIMLI::load().
|
inline |
Copyconstructor
|
inlinevirtual |
Destruct matrix and free memory.
|
inline |
A += a
|
inline |
Add one specific column
|
inline |
Return last row vector.
|
inlinevirtual |
Fill Vector with 0.0. Don't change size.
Reimplemented from GIMLI::MatrixBase.
|
inlinevirtual |
Clear the matrix and free memory.
Reimplemented from GIMLI::MatrixBase.
Referenced by GIMLI::DataMap::collect(), and GIMLI::HarmonicModelling::HarmonicModelling().
|
inlinevirtual |
Readonly column entry of matrix, with boundary check. Probably slow.
|
inlinevirtual |
Return number of colums.
Reimplemented from GIMLI::MatrixBase.
Referenced by GIMLI::DataMap::collect(), GIMLI::DataMap::data(), GIMLI::inv(), GIMLI::matMult(), GIMLI::matMultABA(), GIMLI::matTransMult(), GIMLI::ElementMatrixMap::mult(), GIMLI::saveMatrix(), GIMLI::saveMatrixCol(), and GIMLI::saveMatrixRow().
|
inline |
Force the copy of the matrix entries.
|
virtual |
Return this * a
Reimplemented from GIMLI::MatrixBase.
|
virtual |
Return this * a
Reimplemented from GIMLI::MatrixBase.
Vector< ValueType > GIMLI::Matrix< ValueType >::mult | ( | const Vector< ValueType > & | b | ) | const |
Multiplication (A*b) with a vector of the same value type.
Vector< ValueType > GIMLI::Matrix< ValueType >::mult | ( | const Vector< ValueType > & | b, |
Index | startI, | ||
Index | endI | ||
) | const |
Multiplication (A*b) with a part of a vector between two defined indices.
|
inline |
Implicite type converter.
|
inline |
Assignment operator
|
inline |
Index operator for write operations without boundary check.
|
inline |
Read only C style index operator, without boundary check.
|
inline |
Add another row vector add the end.
Referenced by GIMLI::DataMap::collect(), GIMLI::MeshEntity::dNdL(), GIMLI::Mesh::exportMidCellValue(), GIMLI::MeshEntity::grad(), GIMLI::HarmonicModelling::HarmonicModelling(), GIMLI::interpolate(), GIMLI::DataMap::load(), and GIMLI::RInversion::modelResolutionMatrix().
|
inlinevirtual |
Resize the matrix to rows x cols.
Reimplemented from GIMLI::MatrixBase.
Referenced by GIMLI::ModellingBase::createJacobian(), GIMLI::ModellingBase::createJacobian_mt(), GIMLI::interpolate(), GIMLI::loadMatrixCol(), GIMLI::loadMatrixRow(), GIMLI::loadMatrixSingleBin_T(), GIMLI::matMult(), GIMLI::matMultABA(), and GIMLI::matTransMult().
|
inline |
Round each matrix element to a given tolerance.
|
inline |
Readonly getter.
|
inline |
Return reference to row flag vector. Maybee you can check if the rows are valid. Size is set automatic to the amount of rows.
Referenced by GIMLI::loadMatrixSingleBin_T().
|
inline |
Return reference to row. Used for pygimli.
|
inlinevirtual |
Return number of rows.
Reimplemented from GIMLI::MatrixBase.
Referenced by GIMLI::DataMap::collect(), GIMLI::MRSModelling::createJacobian(), GIMLI::ModellingBase::createJacobian(), GIMLI::ModellingBase::createJacobian_mt(), GIMLI::DataMap::data(), GIMLI::det(), GIMLI::interpolate(), GIMLI::inv(), GIMLI::matMult(), GIMLI::matMultABA(), GIMLI::matTransMult(), GIMLI::mult(), GIMLI::ElementMatrixMap::mult(), GIMLI::DCMultiElectrodeModelling::prepareJacobianT_(), GIMLI::DataMap::save(), GIMLI::saveMatrix(), GIMLI::saveMatrixCol(), and GIMLI::saveMatrixRow().
|
inlinevirtual |
Return entity rtti value.
Reimplemented from GIMLI::MatrixBase.
|
inlinevirtual |
|
inline |
Set one specific column
Referenced by GIMLI::ModellingBase::createJacobian().
|
inline |
Set a value. Throws out of range exception if index check fails.
|
inline |
Set a value. Throws out of range exception if index check fails.
Matrix< ValueType >& GIMLI::Matrix< ValueType >::transAdd | ( | const Matrix< ValueType > & | a | ) |
A += a.T
|
virtual |
Return this.T * a
Reimplemented from GIMLI::MatrixBase.
|
virtual |
Return this.T * a
Reimplemented from GIMLI::MatrixBase.
Vector< ValueType > GIMLI::Matrix< ValueType >::transMult | ( | const Vector< ValueType > & | b | ) | const |
Transpose multiplication (A^T*b) with a vector of the same value type.
Referenced by GIMLI::MeshEntity::grad().
|
protected |
BVector flag(rows) for free use, e.g., check if rows are set valid.