gstlearn
0.3.3
CCC
|
#include <MatrixSquareDiagonal.hpp>
Public Member Functions | |
MatrixSquareDiagonal (int nrow=0) | |
MatrixSquareDiagonal (const MatrixSquareDiagonal &m) | |
MatrixSquareDiagonal & | operator= (const MatrixSquareDiagonal &r) |
virtual | ~MatrixSquareDiagonal () |
virtual String | toString (const AStringFormat *strfmt=nullptr) const override |
ICloneable interface. More... | |
void | transposeInPlace () override |
bool | isValid (int irow, int icol, bool printWhyNot=false) const override |
bool | isDiagonal (bool printWhyNot=false) const final |
void | addScalar (double v) override |
void | setColumn (int icol, const VectorDouble &tab) override |
void | setRow (int irow, const VectorDouble &tab) override |
![]() | |
MatrixSquareSymmetric (int nrow=0) | |
MatrixSquareSymmetric (const MatrixSquareSymmetric &m) | |
MatrixSquareSymmetric (const AMatrix &m) | |
MatrixSquareSymmetric & | operator= (const MatrixSquareSymmetric &r) |
virtual | ~MatrixSquareSymmetric () |
bool | mustBeSymmetric () const final |
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 |
![]() | |
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 | ~AMatrix () |
void | init (int nrows, int ncols) |
void | reset (int nrows, int ncols, double value=0.) |
void | resetFromArray (int nrows, int ncols, const double *tab, bool byCol=true) |
void | resetFromVD (int nrows, int ncols, const VectorDouble &tab, bool byCol=true) |
void | resetFromVVD (const VectorVectorDouble &tab, bool byCol=true) |
virtual void | setDiagonal (const VectorDouble &tab) |
virtual void | setDiagonal (double value=1.) |
virtual bool | isSparse () const |
virtual bool | isSquare (bool printWhyNot=false) const |
virtual bool | isIdentity (bool printWhyNot=false) const |
virtual bool | isDiagCst (bool printWhyNot=false) const |
virtual AMatrix * | transpose () const |
virtual void | addScalarDiag (double v) |
virtual void | prodScalar (double v) |
virtual double | getValue (int irow, int icol) const |
virtual double & | getValueRef (int irow, int icol) |
virtual void | setValue (int irow, int icol, double value) |
virtual void | setValuesByArrays (const VectorInt &irows, const VectorInt &icols, const VectorDouble &values) |
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) |
bool | isSame (const AMatrix &m, double eps=EPSILON10) |
bool | isSameSize (const AMatrix &m) const |
bool | isEmpty () const |
double | compare (const AMatrix &mat) const |
int | getNRows () const |
int | getNCols () const |
int | getNTotal () const |
VectorDouble | getValues (bool byCol=true) 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.) |
void | getValuesAsTriplets (VectorInt &irows, VectorInt &icols, VectorDouble &values) const |
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) |
double | quadraticMatrix (const VectorDouble &x, const VectorDouble &y) |
int | invert () |
int | solve (const VectorDouble &b, VectorDouble &x) const |
void | dumpElements (const String &title, int ifrom, int ito) const |
void | setIdentity (double value=1.) |
void | fill (double value) |
void | fillRandom (int seed=432432, double zeroPercent=0.1) |
void | setValues (const VectorDouble &values, bool byCol=true) |
double | getMeanByColumn (int icol) const |
double | getMinimum () const |
double | getMaximum () const |
void | copyReduce (const AMatrix *x, const VectorInt &activeRows, const VectorInt &activeCols) |
void | setFlagCheckAddress (bool flagCheckAddress) |
double | operator() (int row, int col) const |
double & | operator() (int row, int col) |
![]() | |
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 |
![]() | |
ICloneable () | |
virtual | ~ICloneable () |
virtual ICloneable * | clone () const =0 |
Static Public Member Functions | |
static MatrixSquareDiagonal * | createFromVVD (const VectorVectorDouble &X) |
![]() | |
static MatrixSquareSymmetric * | createFromVVD (const VectorVectorDouble &X) |
Public Attributes | |
DECLARE_TOTL | |
Has a specific implementation in the Target language. More... | |
![]() | |
DECLARE_TOTL | |
Has a specific implementation in the Target language. More... | |
Protected Member Functions | |
virtual double & | _getValueRef (int irow, int icol) override |
bool | mustBeDiagonal () const override |
bool | mustBeDiagCst () const override |
double | determinant () const override |
![]() | |
AMatrixSquare (int nrow=0) | |
AMatrixSquare (const AMatrixSquare &m) | |
AMatrixSquare & | operator= (const AMatrixSquare &r) |
void | _setNSize (int nval) |
bool | _isNumberValid (int nrows, int ncols) const |
![]() | |
AMatrix (int nrow=0, int ncol=0) | |
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 () |
void | _fillFromVVD (const VectorVectorDouble &X) |
bool | _getFlagCheckAddress () const |
Private Member Functions | |
bool | _isCompatible (const AMatrix &m) const override |
int | _getIndexToRank (int irow, int icol) const override |
double | _getValue (int irow, int icol) const override |
double | _getValue (int irank) const override |
void | _setValue (int irow, int icol, double value) override |
void | _setValue (int irank, double value) override |
void | _transposeInPlace () final |
void | _setValues (const double *values, bool byCol=true) override |
int | _getMatrixSize () const override |
void | _allocate () override |
void | _deallocate () override |
void | _prodVector (const double *inv, double *outv) const override |
int | _invert () override |
int | _solve (const VectorDouble &b, VectorDouble &x) const override |
void | _recopy (const MatrixSquareDiagonal &r) |
bool | _isIndexValid (int irow, int icol) const |
bool | _isPhysicallyPresent (int irow, int icol) const override |
Private Attributes | |
VectorDouble | _diagMatrix |
Square Diagonal matrices
MatrixSquareDiagonal::MatrixSquareDiagonal | ( | int | nrow = 0 | ) |
MatrixSquareDiagonal::MatrixSquareDiagonal | ( | const MatrixSquareDiagonal & | m | ) |
|
virtual |
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Returns the number of elements actually stored as members in subsequent classes
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprotectedvirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
inlineoverrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
private |
|
overrideprivatevirtual |
Say if (irow, icol) is stored physically or not
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
private |
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Fill 'this' with the contents of 'values'. Note that 'values' is dimensioned to 'nrows' by 'ncols'
values | Input array |
byCol | True is the values are sorted by Column |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overrideprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
inlinefinalprivatevirtual |
Reimplemented from MatrixSquareSymmetric.
|
overridevirtual |
Add a value to each matrix component
Reimplemented from AMatrix.
Reimplemented in MatrixSquareDiagonalCst.
|
static |
Converts a VectorVectorDouble into a Matrix Note: the input argument is stored by row (if coming from [] specification)
X | Input VectorVectorDouble argument |
|
overrideprotectedvirtual |
Returns the Determinant value
Reimplemented from AMatrixSquare.
Reimplemented in MatrixSquareDiagonalCst.
|
inlinefinalvirtual |
Check if the (non empty) matrix is diagonal
Reimplemented from AMatrix.
|
overridevirtual |
Indicate if the given indices are valid for the current matrix size
Reimplemented from AMatrix.
Reimplemented in MatrixSquareDiagonalCst.
|
inlineoverrideprotectedvirtual |
Say if the matrix must be diagonal constant
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
inlineoverrideprotectedvirtual |
Say if the matrix must be diagonal
Reimplemented from MatrixSquareSymmetric.
MatrixSquareDiagonal & MatrixSquareDiagonal::operator= | ( | const MatrixSquareDiagonal & | r | ) |
|
overridevirtual |
|
overridevirtual |
|
overridevirtual |
ICloneable interface.
AStringable Interface
Reimplemented from MatrixSquareSymmetric.
Reimplemented in MatrixSquareDiagonalCst.
|
overridevirtual |
|
private |
MatrixSquareDiagonal::DECLARE_TOTL |
Has a specific implementation in the Target language.