Geophysical Inversion and Modelling Library
v1.5.2-5-g042d7f36
|
based on: Ulrich Breymann, Addison Wesley Longman 2000 , revised edition ISBN 0-201-67488-2, Designing Components with the C++ STL More...
Classes | |
class | Aux |
Public Types | |
typedef std::pair< IndexType, IndexType > | IndexPair |
typedef std::map< IndexPair, ValueType, std::less< IndexPair > > | ContainerType |
typedef ContainerType::iterator | iterator |
typedef ContainerType::const_iterator | const_iterator |
typedef MatrixElement< ValueType, IndexType, ContainerType > | MatElement |
Public Member Functions | |
SparseMapMatrix (IndexType r=0, IndexType c=0, int stype=0) | |
SparseMapMatrix (const std::string &filename) | |
SparseMapMatrix (const SparseMapMatrix< ValueType, IndexType > &S) | |
SparseMapMatrix (const SparseMatrix< ValueType > &S) | |
SparseMapMatrix (const IndexArray &i, const IndexArray &j, const RVector &v) | |
SparseMapMatrix< ValueType, IndexType > & | operator= (const SparseMapMatrix< ValueType, IndexType > &S) |
SparseMapMatrix & | operator= (const SparseMatrix< ValueType > &S) |
virtual uint | rtti () const |
void | resize (Index rows, Index cols) |
void | copy_ (const SparseMatrix< double > &S) |
void | copy_ (const SparseMatrix< Complex > &S) |
void | add (const IndexArray &rows, const IndexArray &cols, const RVector &vals) |
virtual void | clear () |
void | cleanRow (IndexType row) |
void | cleanCol (IndexType col) |
int | stype () const |
void | setRows (IndexType r) |
virtual IndexType | rows () const |
virtual IndexType | nRows () const |
void | setCols (IndexType c) |
virtual IndexType | cols () const |
virtual IndexType | nCols () const |
IndexType | size () const |
IndexType | max_size () const |
IndexType | nVals () const |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
void | add (const ElementMatrix< double > &A, ValueType scale=1.0) |
void | add (const ElementMatrix< double > &A, const Pos &scale) |
void | add (const ElementMatrix< double > &A, const Matrix< ValueType > &scale) |
void | add (const ElementMatrix< double > &A, const Vector< ValueType > &scale) |
void | addToCol (Index id, const ElementMatrix< double > &A, ValueType scale=1.0, bool isDiag=false) |
void | addToRow (Index id, const ElementMatrix< double > &A, ValueType scale=1.0, bool isDiag=false) |
SparseMapMatrix< ValueType, IndexType > & | operator+= (const SparseMapMatrix< ValueType, IndexType > &A) |
SparseMapMatrix< ValueType, IndexType > & | operator-= (const SparseMapMatrix< ValueType, IndexType > &A) |
void | operator+= (const ElementMatrix< double > &A) |
Aux | operator[] (IndexType r) |
IndexType | idx1 (const const_iterator &I) const |
IndexType | idx2 (const const_iterator &I) const |
const ValueType & | val (const const_iterator &I) const |
ValueType & | val (const iterator &I) |
Vector< ValueType > | values () const |
ValueType | getVal (IndexType i, IndexType j) |
void | setVal (IndexType i, IndexType j, const ValueType &val) |
void | addVal (IndexType i, IndexType j, const ValueType &val) |
virtual Vector< ValueType > | mult (const Vector< ValueType > &a) const |
virtual Vector< ValueType > | transMult (const Vector< ValueType > &a) const |
virtual Vector< ValueType > | col (const Index i) |
virtual Vector< ValueType > | row (const Index i) |
void | save (const std::string &filename) const |
void | load (const std::string &filename) |
void | importCol (const std::string &filename, double dropTol, Index colOffset) |
void | importCol (const std::string &filename, double dropTol=1e-3) |
void | fillArrays (Vector< ValueType > &vals, IndexArray &rows, IndexArray &cols) |
void | copy_ (const SparseMatrix< double > &S) |
void | add (const ElementMatrix< double > &A, double scale) |
void | add (const ElementMatrix< double > &A, const Pos &scale) |
void | add (const ElementMatrix< double > &A, const RMatrix &scale) |
void | add (const ElementMatrix< double > &A, const Vector< double > &scale) |
void | add (const ElementMatrix< double > &A, Complex scale) |
void | add (const ElementMatrix< double > &A, const Vector< Complex > &scale) |
void | add (const ElementMatrix< double > &A, const CMatrix &scale) |
void | add (const ElementMatrix< double > &A, const Pos &scale) |
void | addToCol (Index id, const ElementMatrix< double > &A, double scale, bool isDiag) |
void | addToRow (Index id, const ElementMatrix< double > &A, double scale, bool isDiag) |
void | addToCol (Index id, const ElementMatrix< double > &A, Complex scale, bool isDiag) |
void | addToRow (Index id, const ElementMatrix< double > &A, Complex scale, bool isDiag) |
DLLEXPORT void | copy_ (const SparseMatrix< double > &S) |
DLLEXPORT void | add (const ElementMatrix< double > &A, double scale) |
DLLEXPORT void | add (const ElementMatrix< double > &A, const Pos &scale) |
DLLEXPORT void | add (const ElementMatrix< double > &A, const RMatrix &scale) |
DLLEXPORT void | add (const ElementMatrix< double > &A, const Vector< double > &scale) |
DLLEXPORT void | add (const ElementMatrix< double > &A, Complex scale) |
DLLEXPORT void | add (const ElementMatrix< double > &A, const Pos &scale) |
DLLEXPORT void | add (const ElementMatrix< double > &A, const Matrix< Complex > &scale) |
DLLEXPORT void | add (const ElementMatrix< double > &A, const Vector< Complex > &scale) |
DLLEXPORT void | addToCol (Index id, const ElementMatrix< double > &A, double scale, bool isDiag) |
DLLEXPORT void | addToRow (Index id, const ElementMatrix< double > &A, double scale, bool isDiag) |
DLLEXPORT void | addToCol (Index id, const ElementMatrix< double > &A, Complex scale, bool isDiag) |
DLLEXPORT void | addToRow (Index id, const ElementMatrix< double > &A, Complex scale, bool isDiag) |
Public Member Functions inherited from GIMLI::MatrixBase | |
MatrixBase (bool verbose=false) | |
virtual | ~MatrixBase () |
void | setVerbose (bool verbose) |
bool | verbose () const |
Index | size () const |
virtual void | clean () |
virtual RVector | dot (const RVector &a) const |
virtual RVector | mult (const RVector &a) const |
virtual CVector | mult (const CVector &a) const |
virtual RVector | mult (const RVector &b, Index startI, Index endI) const |
virtual CVector | mult (const CVector &b, Index startI, Index endI) const |
virtual RVector | transMult (const RVector &a) const |
virtual CVector | transMult (const CVector &a) const |
Protected Attributes | |
IndexType | rows_ |
IndexType | cols_ |
ContainerType | C_ |
int | stype_ |
Protected Attributes inherited from GIMLI::MatrixBase | |
bool | verbose_ |
based on: Ulrich Breymann, Addison Wesley Longman 2000 , revised edition ISBN 0-201-67488-2, Designing Components with the C++ STL
|
inline |
stype .. symmetric style. stype=0 (full), stype=1 (UpperRight), stype=2 (LowerLeft)
|
inline |
Contruct Map Matrix from 3 arrays of the same length. Number of colums are max(j)+1 and Number of rows are max(i)+1.
void GIMLI::SparseMapMatrix< ValueType, IndexType >::add | ( | const ElementMatrix< double > & | A, |
const Vector< ValueType > & | scale | ||
) |
Scale with values from vector scale. Take values from scale[A.ids()].
void GIMLI::SparseMapMatrix< ValueType, IndexType >::add | ( | const ElementMatrix< double > & | A, |
ValueType | scale = 1.0 |
||
) |
Scale with scale
|
inline |
Add this values to the matrix.
References GIMLI::SparseMapMatrix< ValueType, IndexType >::cols(), and GIMLI::SparseMapMatrix< ValueType, IndexType >::rows().
|
inlinevirtual |
Clear the data, set size to zero and frees memory.
Reimplemented from GIMLI::MatrixBase.
Referenced by GIMLI::RegionManager::fillConstraints().
|
inlinevirtual |
Return number of colums
Reimplemented from GIMLI::MatrixBase.
Referenced by GIMLI::SparseMapMatrix< ValueType, IndexType >::add(), GIMLI::SparseMapMatrix< ValueType, IndexType >::fillArrays(), GIMLI::SparseMapMatrix< ValueType, IndexType >::importCol(), GIMLI::SparseMapMatrix< ValueType, IndexType >::mult(), GIMLI::rank1Update(), GIMLI::SparseMapMatrix< ValueType, IndexType >::resize(), GIMLI::scaleMatrix(), and GIMLI::SparseMapMatrix< ValueType, IndexType >::transMult().
DLLEXPORT void GIMLI::SparseMapMatrix< double, Index >::copy_ | ( | const SparseMatrix< double > & | S | ) |
SparseMapMatrix specialized type traits in sparsematrix.cpp
|
inline |
Fill existing arrays with values, row and column indieces of this SparseMapMatrix
References GIMLI::SparseMapMatrix< ValueType, IndexType >::cols(), GIMLI::Vector< ValueType >::resize(), and GIMLI::SparseMapMatrix< ValueType, IndexType >::rows().
|
inline |
Import columnwise from bmat starting at offset
References GIMLI::SparseMapMatrix< ValueType, IndexType >::cols(), and GIMLI::SparseMapMatrix< ValueType, IndexType >::rows().
|
inlinevirtual |
Return SparseMapMatrix: this * a
References GIMLI::SparseMapMatrix< ValueType, IndexType >::cols(), and GIMLI::SparseMapMatrix< ValueType, IndexType >::rows().
|
inlinevirtual |
Resize this matrix to rows, cols
Reimplemented from GIMLI::MatrixBase.
References GIMLI::SparseMapMatrix< ValueType, IndexType >::cols(), and GIMLI::SparseMapMatrix< ValueType, IndexType >::rows().
Referenced by GIMLI::Mesh::interpolationMatrix().
|
inlinevirtual |
Return number of cols
Reimplemented from GIMLI::MatrixBase.
Referenced by GIMLI::SparseMapMatrix< ValueType, IndexType >::add(), GIMLI::SparseMapMatrix< ValueType, IndexType >::fillArrays(), GIMLI::SparseMapMatrix< ValueType, IndexType >::importCol(), GIMLI::SparseMapMatrix< ValueType, IndexType >::mult(), GIMLI::rank1Update(), GIMLI::SparseMapMatrix< ValueType, IndexType >::resize(), GIMLI::scaleMatrix(), and GIMLI::SparseMapMatrix< ValueType, IndexType >::transMult().
|
inlinevirtual |
Return entity rtti value.
Reimplemented from GIMLI::MatrixBase.
|
inlinevirtual |
Brute force column separation fallback .. should be overwriten if you need performance for your onw matrix type.
Brute force row separation fallback .. should be overwriten if you need performance for your onw matrix type. / template< class ValueType > const Vector < ValueType > row(Index r) const{ __M ASSERT_RANGE(r, 0, rows()) Vector < ValueType > b(rows(), 0.0); b[r] = 1.0; return this->transMult(b); } these template function above will not work until MatrixBase is a non template function /! Brute force column separation fallback .. should be overwriten if you need performance for your onw matrix type.
Brute force row separation fallback .. should be overwriten if you need performance for your onw matrix type. */ virtual const RVector row(Index r) const { __M ASSERT_RANGE(r, 0, rows()) RVector b(rows(), 0.0); b[r] = 1.0; return this->transMult(b); }
/*! Save this matrix into the file filename given.
Reimplemented from GIMLI::MatrixBase.
|
inline |
symmetric type. 0 = nonsymmetric, -1 symmetric lower part, 1 symmetric upper part.
|
inlinevirtual |
Return SparseMapMatrix: this.T * a
References GIMLI::SparseMapMatrix< ValueType, IndexType >::cols(), and GIMLI::SparseMapMatrix< ValueType, IndexType >::rows().