|
gstlearn
0.2.1
Geostatistics & Machine Learning toolbox
|
#include <MatrixSquareSymmetric.hpp>
Public Member Functions | |
| MatrixSquareSymmetric (int nrow=0, bool sparse=false) | |
| MatrixSquareSymmetric (const MatrixSquareSymmetric &m) | |
| MatrixSquareSymmetric (const AMatrix &m) | |
| MatrixSquareSymmetric & | operator= (const MatrixSquareSymmetric &r) |
| virtual | ~MatrixSquareSymmetric () |
| virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
| ICloneable interface. More... | |
| bool | mustBeSymmetric () const final |
| virtual bool | mustBeDiagonal () const override |
| virtual bool | mustBeDiagCst () const override |
| bool | isSymmetric (bool printWhyNot=false) const final |
| TODO : isPositiveDefinite. More... | |
| void | initMatTri (int nsize, double *tab) |
| void | normSingleMatrix (const AMatrix &x) |
| void | normTSingleMatrix (const AMatrix &x) |
| MatrixSquareSymmetric * | reduce (const VectorInt &validRows) const |
Public Member Functions inherited from AMatrixSquare | |
| virtual | ~AMatrixSquare () |
| int | getNSize () const |
| void | normMatrix (const AMatrixSquare &x, const AMatrix &y) |
| void | normTMatrix (const AMatrixSquare &x, const AMatrix &y) |
| double | trace () const |
| void | innerMatrix (const AMatrixSquare &x, const AMatrix &r1, const AMatrix &r2) |
| void | prodDiagByVector (const VectorDouble &diag) |
| void | divideDiagByVector (const VectorDouble &diag) |
| virtual double | determinant (void) const |
Public Member Functions inherited from AMatrix | |
| virtual | ~AMatrix () |
| void | init (int nrows, int ncols, bool sparse=false) |
| int | getNRows () const |
| int | getNCols () const |
| int | getNTotal () const |
| virtual double | getValue (int irow, int icol) const |
| virtual double | getValue (int rank) const |
| virtual double & | getValueRef (int irow, int icol) |
| VectorDouble | getValues () const |
| void | getValuesAsTriplets (VectorInt &irows, VectorInt &icols, VectorDouble &values) const |
| VectorDouble | getDiagonal (int shift=0) const |
| VectorDouble | getRow (int irow) const |
| VectorDouble | getColumn (int icol) const |
| void | add (int irow, int icol, double value) |
| void | add (const AMatrix &tab, double value=1.) |
| void | subtract (const AMatrix &tab, double value=1.) |
| virtual void | setColumn (int icol, const VectorDouble &tab) |
| virtual void | setRow (int irow, const VectorDouble &tab) |
| virtual void | setDiagonal (const VectorDouble &tab) |
| virtual void | setDiagonal (double value=1.) |
| const cs * | getCs () const |
| Triplet | getCsToTriplet (bool flag_from_1=false) const |
| bool | isSameSize (const AMatrix &m) const |
| bool | isSparse () const |
| bool | isEmpty () const |
| virtual bool | isSquare (bool printWhyNot=false) const |
| virtual bool | isValid (int irow, int icol, bool printWhyNot=false) const |
| virtual bool | isIdentity (bool printWhyNot=false) const |
| virtual bool | isDiagonal (bool printWhyNot=false) const |
| virtual bool | isDiagCst (bool printWhyNot=false) const |
| bool | isSame (const AMatrix &m, double eps=EPSILON10) |
| void | reset (int nrows, int ncols, bool sparse=false) |
| void | reset (int nrows, int ncols, double value, bool sparse=false) |
| void | reset (int nrows, int ncols, const double *tab, bool sparse=false) |
| void | reset (int nrows, int ncols, const VectorDouble &tab, bool sparse=false, bool flagByRow=true) |
| void | reset (const VectorVectorDouble &tab, bool flagByRow=true) |
| double | compare (const AMatrix &mat) const |
| void | toSparseInPlace () |
| AMatrix * | toSparse () const |
| virtual void | transposeInPlace () |
| virtual AMatrix * | transpose () const |
| virtual void | addScalar (double v) |
| virtual void | addScalarDiag (double v) |
| virtual void | prodScalar (double v) |
| void | prodVector (const double *inv, double *outv) const |
| void | prodVector (const VectorDouble &inv, VectorDouble &outv) const |
| void | multiplyRow (const VectorDouble &vec) |
| void | multiplyColumn (const VectorDouble &vec) |
| void | divideRow (const VectorDouble &vec) |
| void | divideColumn (const VectorDouble &vec) |
| virtual void | addMatrix (const AMatrix &y) |
| virtual void | prodMatrix (const AMatrix &x, const AMatrix &y) |
| virtual void | linearCombination (double cx, double cy, const AMatrix &y) |
| int | invert () |
| int | solve (const VectorDouble &b, VectorDouble &x) const |
| void | dumpElements (const String &title, int ifrom, int ito) const |
| virtual void | setValue (int irow, int icol, double value) |
| virtual void | setValue (int rank, double value) |
| void | setIdentity (double value=1.) |
| void | fill (double value) |
| void | fillRandom (int seed=432432, double zeroPercent=0.1) |
| void | setValuesOldStyle (const double *values, bool byCol=true) |
| void | setValues (const VectorDouble &values, bool byCol=true) |
| void | setValuesByArrays (const VectorInt &irows, const VectorInt &icols, const VectorDouble &values) |
| double | getMeanByColumn (int icol) const |
| double | getMinimum () const |
| double | getMaximum () const |
| void | copyReduce (const AMatrix *x, const VectorInt &validRows, const VectorInt &validCols) |
| double | operator() (int row, int col) const |
| double & | operator() (int row, int col) |
Public Member Functions inherited from AStringable | |
| AStringable () | |
| AStringable (const AStringable &r) | |
| AStringable & | operator= (const AStringable &r) |
| virtual | ~AStringable () |
| virtual void | display (const AStringFormat *strfmt=nullptr) const final |
| virtual void | display (int level) const final |
Public Member Functions inherited from ICloneable | |
| ICloneable () | |
| virtual | ~ICloneable () |
| virtual ICloneable * | clone () const =0 |
Public Attributes | |
| DECLARE_TOTL | |
| Has a specific implementation in the Target language. More... | |
Protected Member Functions | |
| virtual double & | _getValueRef (int irow, int icol) override |
Protected Member Functions inherited from AMatrixSquare | |
| AMatrixSquare (int nrow=0, bool sparse=false) | |
| AMatrixSquare (const AMatrixSquare &m) | |
| AMatrixSquare & | operator= (const AMatrixSquare &r) |
| void | _setNSize (int nval) |
| bool | _isNumberValid (int nrows, int ncols) const |
Protected Member Functions inherited from AMatrix | |
| AMatrix (int nrow=0, int ncol=0, bool sparse=false) | |
| AMatrix (const cs *A) | |
| AMatrix (const AMatrix &m) | |
| AMatrix & | operator= (const AMatrix &m) |
| virtual void | _clearContents () |
| void | _setNCols (int ncols) |
| void | _setNRows (int nrows) |
| bool | _isNumbersValid (int nrows, int ncols) const |
| bool | _isColumnValid (int icol) const |
| bool | _isRowValid (int irow) const |
| bool | _isIndexValid (int irow, int icol) const |
| bool | _isRowVectorConsistent (const VectorDouble &tab) |
| bool | _isColVectorConsistent (const VectorDouble &tab) |
| bool | _isVectorSizeConsistent (int nrows, int ncols, const VectorDouble &tab) |
| bool | _isRankValid (int rank) const |
| void | _clear () |
Private Member Functions | |
| virtual bool | _isCompatible (const AMatrix &m) const override |
| virtual bool | _isPhysicallyPresent (int irow, int icol) const override |
| virtual double | _getValue (int irow, int icol) const override |
| virtual double | _getValue (int irank) const override |
| virtual void | _setValue (int irow, int icol, double value) override |
| virtual void | _setValue (int irank, double value) override |
| virtual void | _transposeInPlace () override |
| virtual void | _setValues (const double *values, bool byCol=true) override |
| virtual int | _getMatrixSize () const override |
| virtual void | _allocate () override |
| virtual void | _deallocate () override |
| virtual void | _prodVector (const double *inv, double *outv) const override |
| virtual int | _invert () override |
| virtual int | _solve (const VectorDouble &b, VectorDouble &x) const override |
| void | _recopy (const MatrixSquareSymmetric &r) |
| int | _getIndexToRank (int irow, int icol) const |
Private Attributes | |
| VectorDouble | _squareSymMatrix |
Square Symmetric matrices are stored as Lower Triangular matrices stored by column
| MatrixSquareSymmetric::MatrixSquareSymmetric | ( | int | nrow = 0, |
| bool | sparse = false |
||
| ) |
| MatrixSquareSymmetric::MatrixSquareSymmetric | ( | const MatrixSquareSymmetric & | m | ) |
| MatrixSquareSymmetric::MatrixSquareSymmetric | ( | const AMatrix & | m | ) |
|
virtual |
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
private |
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprotectedvirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonalCst, and MatrixSquareDiagonal.
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
inlineoverrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Say if (irow, icol) is stored physically or not
Reimplemented from AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
private |
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
inlineoverrideprivatevirtual |
Implements AMatrix.
Reimplemented in MatrixSquareDiagonal.
| void MatrixSquareSymmetric::initMatTri | ( | int | nsize, |
| double * | tab | ||
| ) |
Loading values from an Upper Triangular matrix
| nsize | |
| tab |
|
inlinefinalvirtual |
|
inlineoverridevirtual |
Say if the matrix must be diagonal constant
Reimplemented from AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
inlineoverridevirtual |
Say if the matrix must be diagonal
Reimplemented from AMatrix.
Reimplemented in MatrixSquareDiagonal.
|
inlinefinalvirtual |
Say if the matrix must be symmetric
Reimplemented from AMatrix.
| void MatrixSquareSymmetric::normSingleMatrix | ( | const AMatrix & | x | ) |
Perform the product: this = t(X) %*% X
| x | Matrix [nrow, ncol] where ncol = this->getNSize() |
| void MatrixSquareSymmetric::normTSingleMatrix | ( | const AMatrix & | x | ) |
Perform the product: this = X %*% t(X)
| x | Matrix [nrow, ncol] where nrow = this->getNSize() |
| MatrixSquareSymmetric & MatrixSquareSymmetric::operator= | ( | const MatrixSquareSymmetric & | r | ) |
| MatrixSquareSymmetric * MatrixSquareSymmetric::reduce | ( | const VectorInt & | validRows | ) | const |
|
overridevirtual |
ICloneable interface.
AStringable Interface
Reimplemented from AMatrix.
Reimplemented in MatrixSquareDiagonal, and MatrixSquareDiagonalCst.
|
private |
| MatrixSquareSymmetric::DECLARE_TOTL |
Has a specific implementation in the Target language.