1.2.1
CCC
 
AMatrixDense Class Reference

#include <AMatrixDense.hpp>

Inheritance diagram for AMatrixDense:
AMatrix AStringable ICloneable MatrixRectangular AMatrixSquare Table MatrixSquareGeneral MatrixSquareSymmetric

Public Member Functions

 AMatrixDense (int nrow=0, int ncol=0, int opt_eigen=-1)
 
 AMatrixDense (const AMatrixDense &m)
 
 AMatrixDense (const AMatrix &m)
 
AMatrixDenseoperator= (const AMatrixDense &r)
 
virtual ~AMatrixDense ()
 
virtual bool isDense () const
 Interface for AMatrix. More...
 
virtual bool isSparse () const
 
virtual void setColumn (int icol, const VectorDouble &tab) override
 
virtual void setRow (int irow, const VectorDouble &tab) override
 
virtual void setDiagonal (const VectorDouble &tab) override
 
virtual void setDiagonalToConstant (double value=1.) override
 
virtual void addScalar (double v) override
 
virtual void addScalarDiag (double v) override
 
virtual void prodScalar (double v) override
 
virtual void fill (double value) override
 
virtual void multiplyRow (const VectorDouble &vec) override
 
virtual void multiplyColumn (const VectorDouble &vec) override
 
virtual void divideRow (const VectorDouble &vec) override
 
virtual void divideColumn (const VectorDouble &vec) override
 
virtual VectorDouble prodVecMat (const VectorDouble &x, bool transpose=false) const override
 
virtual VectorDouble prodMatVec (const VectorDouble &x, bool transpose=false) const override
 
virtual VectorDouble getRow (int irow) const override
 
virtual VectorDouble getColumn (int icol) const override
 
virtual void prodMatMatInPlace (const AMatrix *x, const AMatrix *y, bool transposeX=false, bool transposeY=false) override
 
void addMatInPlace (const AMatrixDense &y, double cx=1., double cy=1.)
 The next functions use specific definition of matrix (to avoid dynamic_cast) rather than manipulating AMatrix. They are not generic of AMatrix anymore. WARNING: output matrix should not match any of input matrices (speed up). More...
 
virtual void prodNormMatMatInPlace (const AMatrixDense &a, const AMatrixDense &m, bool transpose=false)
 
virtual void prodNormMatInPlace (const AMatrixDense &a, const VectorDouble &vec=VectorDouble(), bool transpose=false)
 
VectorDouble getEigenValues () const
 
const MatrixSquareGeneralgetEigenVectors () const
 
- Public Member Functions inherited from AMatrix
 AMatrix (int nrow=0, int ncol=0, int opt_eigen=-1)
 
 AMatrix (const AMatrix &m)
 
AMatrixoperator= (const AMatrix &m)
 
virtual ~AMatrix ()
 
void init (int nrows, int ncols, int opt_eigen=-1)
 
void reset (int nrows, int ncols, double value=0., int opt_eigen=-1)
 
void resetFromArray (int nrows, int ncols, const double *tab, bool byCol=true, int opt_eigen=-1)
 
void resetFromVD (int nrows, int ncols, const VectorDouble &tab, bool byCol=true, int opt_eigen=-1)
 
void resetFromVVD (const VectorVectorDouble &tab, bool byCol=true, int opt_eigen=-1)
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 Interface to AStringable. More...
 
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 isSymmetric (bool printWhyNot=false, double eps=EPSILON10) const
 
virtual bool isDiagonal (bool printWhyNot=false) const
 
virtual bool isDiagCst (bool printWhyNot=false) const
 
virtual bool mustBeSymmetric () const
 
virtual bool mustBeDiagonal () const
 
virtual bool mustBeDiagCst () const
 
virtual void transposeInPlace ()
 
virtual AMatrixtranspose () const
 
virtual NF_Triplet getMatrixToTriplet (int shiftRow=0, int shiftCol=0) const
 
void addMatInPlace (const AMatrix &y, double cx=1., double cy=1.)
 
void prodMatInPlace (const AMatrix *matY, bool transposeY=false)
 
void prodNormMatMatInPlace (const AMatrix &a, const AMatrix &m, bool transpose=false)
 
void prodNormMatInPlace (const AMatrix &a, const VectorDouble &vec=VectorDouble(), bool transpose=false)
 
void resize (int nrows, int ncols)
 
double getValue (int irow, int icol) const
 
void setValue (int irow, int icol, double value)
 
void updValue (int irow, int icol, const EOperator &oper, double value)
 
void setValue_ (int irow, int icol, double value)
 
void updValue_ (int irow, int icol, const EOperator &oper, double value)
 
double getValue_ (int irow, int icol) const
 
void addValue (int irow, int icol, double value)
 
bool isSame (const AMatrix &m, double eps=EPSILON4, bool printWhyNot=false)
 
bool isSameSize (const AMatrix &m) const
 
bool empty () const
 
double compare (const AMatrix &mat) const
 
int getNRows () const
 
int getNCols () const
 
int size () const
 
VectorDouble getValues (bool byCol=true) const
 
VectorDouble getDiagonal (int shift=0) const
 
bool isColumnDefined (int icol) const
 
bool isRowDefined (int irow) const
 
int getNumberColumnDefined () const
 
int getNumberRowDefined () const
 
bool isFlagEigen () const
 
bool isNonNegative (bool verbose=false)
 
void prodMatVecInPlace (const VectorDouble &x, VectorDouble &y, bool transpose=false) const
 
void prodMatVecInPlacePtr (const double *x, double *y, bool transpose=false) const
 
void prodVecMatInPlace (const VectorDouble &x, VectorDouble &y, bool transpose=false) const
 
void prodVecMatInPlacePtr (const double *x, double *y, bool transpose=false) const
 
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 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
 
double getNormInf () const
 
void copyReduce (const AMatrix *x, const VectorInt &activeRows, const VectorInt &activeCols)
 
void copyElements (const AMatrix &m, double factor=1.)
 
void setFlagCheckAddress (bool flagCheckAddress)
 
void makePositiveColumn ()
 
void linearCombination (double val1, const AMatrix *mat1, double val2=1., const AMatrix *mat2=nullptr)
 
double operator() (int row, int col) const
 
double & operator() (int row, int col)
 
- Public Member Functions inherited from AStringable
 AStringable ()
 
 AStringable (const AStringable &r)
 
AStringableoperator= (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 ICloneableclone () const =0
 

Detailed Description

Square Matrix

Constructor & Destructor Documentation

AMatrixDense::AMatrixDense ( int  nrow = 0,
int  ncol = 0,
int  opt_eigen = -1 
)
AMatrixDense::AMatrixDense ( const AMatrixDense m)
AMatrixDense::AMatrixDense ( const AMatrix m)
AMatrixDense::~AMatrixDense ( )
virtual

Member Function Documentation

void AMatrixDense::addMatInPlace ( const AMatrixDense y,
double  cx = 1.,
double  cy = 1. 
)

The next functions use specific definition of matrix (to avoid dynamic_cast) rather than manipulating AMatrix. They are not generic of AMatrix anymore. WARNING: output matrix should not match any of input matrices (speed up).

Add a matrix (multiplied by a constant)

void AMatrixDense::addScalar ( double  v)
overridevirtual

Add a value to each matrix component

Reimplemented from AMatrix.

void AMatrixDense::addScalarDiag ( double  v)
overridevirtual

Add value to matrix diagonal

Reimplemented from AMatrix.

void AMatrixDense::divideColumn ( const VectorDouble vec)
overridevirtual

Divide a Matrix column-wise

Reimplemented from AMatrix.

void AMatrixDense::divideRow ( const VectorDouble vec)
overridevirtual

Divide a Matrix row-wise

Reimplemented from AMatrix.

void AMatrixDense::fill ( double  value)
overridevirtual

Set all the values of the Matrix at once

Reimplemented from AMatrix.

VectorDouble AMatrixDense::getColumn ( int  icol) const
overridevirtual

Extract a Column

Reimplemented from AMatrix.

VectorDouble AMatrixDense::getEigenValues ( ) const
inline
const MatrixSquareGeneral* AMatrixDense::getEigenVectors ( ) const
inline
VectorDouble AMatrixDense::getRow ( int  irow) const
overridevirtual

Extract a Row

Reimplemented from AMatrix.

virtual bool AMatrixDense::isDense ( ) const
inlinevirtual

Interface for AMatrix.

Returns if the matrix belongs to the MatrixSparse class (avoids dynamic_cast)

Implements AMatrix.

virtual bool AMatrixDense::isSparse ( ) const
inlinevirtual

Returns if the current matrix is Sparse

Implements AMatrix.

void AMatrixDense::multiplyColumn ( const VectorDouble vec)
overridevirtual

Multiply a Matrix column-wise

Reimplemented from AMatrix.

void AMatrixDense::multiplyRow ( const VectorDouble vec)
overridevirtual

Multiply a Matrix row-wise

Reimplemented from AMatrix.

AMatrixDense & AMatrixDense::operator= ( const AMatrixDense r)
void AMatrixDense::prodMatMatInPlace ( const AMatrix x,
const AMatrix y,
bool  transposeX = false,
bool  transposeY = false 
)
overridevirtual

Multiply a matrix by another and stored in 'this'

Reimplemented from AMatrix.

VectorDouble AMatrixDense::prodMatVec ( const VectorDouble x,
bool  transpose = false 
) const
overridevirtual

Perform 'this' * 'vec'

Reimplemented from AMatrix.

void AMatrixDense::prodNormMatInPlace ( const AMatrixDense a,
const VectorDouble vec = VectorDouble(),
bool  transpose = false 
)
virtual

Product 't(A)' %*% ['vec'] %*% 'A' or 'A' %*% ['vec'] %*% 't(A)' stored in 'this'

void AMatrixDense::prodNormMatMatInPlace ( const AMatrixDense a,
const AMatrixDense m,
bool  transpose = false 
)
virtual

Product 't(A)' %*% 'M' %*% 'A' or 'A' %*% 'M' %*% 't(A)' stored in 'this'

void AMatrixDense::prodScalar ( double  v)
overridevirtual

Multiply each matrix component by a value

Reimplemented from AMatrix.

VectorDouble AMatrixDense::prodVecMat ( const VectorDouble x,
bool  transpose = false 
) const
overridevirtual

Perform 'vec' * 'this'

Reimplemented from AMatrix.

void AMatrixDense::setColumn ( int  icol,
const VectorDouble tab 
)
overridevirtual

Set the contents of a Column

Reimplemented from AMatrix.

void AMatrixDense::setDiagonal ( const VectorDouble tab)
overridevirtual

Set the contents of the (main) Diagonal

Reimplemented from AMatrix.

void AMatrixDense::setDiagonalToConstant ( double  value = 1.)
overridevirtual

Set the contents of the (main) Diagonal to a constant value

Reimplemented from AMatrix.

void AMatrixDense::setRow ( int  irow,
const VectorDouble tab 
)
overridevirtual

Set the contents of a Row

Reimplemented from AMatrix.


The documentation for this class was generated from the following files: