1.5.0
CCC
 
ProjMatrix Class Reference

#include <ProjMatrix.hpp>

Inheritance diagram for ProjMatrix:
IProjMatrix MatrixSparse AMatrix ALinearOp AStringable ICloneable

Public Member Functions

 ProjMatrix ()
 
 ProjMatrix (const Db *db, const AMesh *a_mesh, int rankZ=-1, bool verbose=false)
 
 ProjMatrix (const ProjMatrix &m)
 
 ProjMatrix (const MatrixSparse *m)
 
ProjMatrixoperator= (const ProjMatrix &m)
 
virtual ~ProjMatrix ()
 
virtual String toString (const AStringFormat *strfmt=nullptr) const override
 Cloneable interface. More...
 
int getApexNumber () const override
 
int getPointNumber () const override
 
void resetFromMeshAndDb (const Db *db, const AMesh *a_mesh, int rankZ=-1, bool verbose=false)
 
- Public Member Functions inherited from IProjMatrix
 IProjMatrix ()
 
virtual ~IProjMatrix ()
 
int point2mesh (const VectorDouble &inv, VectorDouble &outv) const
 
int mesh2point (const VectorDouble &inv, VectorDouble &outv) const
 
int point2mesh (const constvect inv, vect out) const
 
int mesh2point (const constvect inv, vect out) const
 
int addMesh2point (const constvect inv, vect outv) const
 
int addPoint2mesh (const constvect inv, vect outv) const
 
- Public Member Functions inherited from MatrixSparse
 MatrixSparse (int nrow=0, int ncol=0, int opt_eigen=-1)
 
 MatrixSparse (const cs *A)
 
 MatrixSparse (const MatrixSparse &m)
 
MatrixSparseoperator= (const MatrixSparse &m)
 
virtual ~MatrixSparse ()
 
int getSize () const override
 Cloneable interface. More...
 
bool isFlagEigen () const
 
bool isSparse () const override
 Interface for AMatrix. More...
 
bool isDense () const override
 
void setValue (int irow, int icol, double value, bool flagCheck=true) override
 
double getValue (int row, int col, bool flagCheck=true) const override
 
void updValue (int irow, int icol, const EOperator &oper, double value, bool flagCheck=true) override
 
int addVecInPlaceEigen (const Eigen::Map< const Eigen::VectorXd > &xm, Eigen::Map< Eigen::VectorXd > &ym) const
 
void addProdMatVecInPlaceToDest (const constvect in, vect out, bool transpose=false) const
 
virtual void setColumn (int icol, const VectorDouble &tab, bool flagCheck=true) override
 
virtual void setRow (int irow, const VectorDouble &tab, bool flagCheck=true) override
 
virtual void setDiagonal (const VectorDouble &tab, bool flagCheck=true) override
 
virtual void setDiagonalToConstant (double value=1.) override
 
virtual MatrixSparsetranspose () const 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 void prodMatMatInPlace (const AMatrix *x, const AMatrix *y, bool transposeX=false, bool transposeY=false) override
 
virtual NF_Triplet getMatrixToTriplet (int shiftRow=0, int shiftCol=0) const override
 
virtual void addMatInPlace (const MatrixSparse &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 no more generic of AMatrix. More...
 
virtual void prodNormMatMatInPlace (const MatrixSparse *a, const MatrixSparse *m, bool transpose=false)
 
virtual void prodNormMatVecInPlace (const MatrixSparse *a, const VectorDouble &vec=VectorDouble(), bool transpose=false)
 
const cs * getCS () const
 
void setCS (cs *cs)
 
void freeCS ()
 
cs * getCSUnprotected () const
 
virtual void resetFromValue (int nrows, int ncols, double value) override
 Reset the matrix to new dimensions and fill with a new value. More...
 
virtual void resetFromArray (int nrows, int ncols, const double *tab, bool byCol=true) override
 Reset the matrix from an array of double values. More...
 
virtual void resetFromVD (int nrows, int ncols, const VectorDouble &tab, bool byCol=true) override
 Reset the matrix from a vector of double values. More...
 
virtual void resetFromVVD (const VectorVectorDouble &tab, bool byCol=true) override
 Reset the matrix from an array of double values. More...
 
void resetFromTriplet (const NF_Triplet &NF_T)
 
void fillRandom (int seed=432432, double zeroPercent=0)
 
int addVecInPlace (const constvect x, vect y) const
 
void addValue (int row, int col, double value)
 
double L1Norm () const
 
void getStats (int *nrows, int *ncols, int *count, double *percent) const
 
int scaleByDiag ()
 
int addVecInPlaceVD (const VectorDouble &x, VectorDouble &y) const
 
void setConstant (double value)
 
VectorDouble extractDiag (int oper_choice=1) const
 
void prodNormDiagVecInPlace (const VectorDouble &vec, int oper=1)
 
const Eigen::SparseMatrix< double > & getEigenMatrix () const
 
void setEigenMatrix (const Eigen::SparseMatrix< double > &eigenMatrix)
 
MatrixSparseextractSubmatrixByRanks (const VectorInt &rank_rows, const VectorInt &rank_cols) const
 
MatrixSparseextractSubmatrixByColor (const VectorInt &colors, int ref_color, bool row_ok, bool col_ok)
 
VectorInt colorCoding () const
 
int getNonZeros () const
 
void gibbs (int iech, const VectorDouble &zcur, double *yk, double *sk)
 
void setDiagonal (const Eigen::Map< const Eigen::VectorXd > &tab)
 
void setDiagonal (const constvect tab)
 
- Public Member Functions inherited from AMatrix
 AMatrix (int nrow=0, int ncol=0)
 
 AMatrix (const AMatrix &m)
 
AMatrixoperator= (const AMatrix &m)
 
virtual ~AMatrix ()
 
virtual void reset (int nrows, int ncols)
 
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 (double eps=EPSILON10, bool printWhyNot=false) const
 
virtual bool mustBeSymmetric () const
 
virtual void transposeInPlace ()
 
virtual VectorDouble getRow (int irow) const
 
virtual VectorDouble getColumn (int icol) 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 prodNormMatVecInPlace (const AMatrix &a, const VectorDouble &vec=VectorDouble(), bool transpose=false)
 
void resize (int nrows, int ncols)
 Resize the matrix to new dimensions (this method doesn't change the storage type) More...
 
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 isNonNegative (bool verbose=false) const
 
void prodMatVecInPlace (const VectorDouble &x, VectorDouble &y, bool transpose=false) const
 
int prodMatVecInPlace (const constvect x, vect 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)
 
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 &validRows, const VectorInt &validCols)
 
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 val3=1., const AMatrix *mat3=nullptr)
 Perfom the algebraic equation this = val1 * mat1 + val2 * mat2 + val3 * mat3. More...
 
virtual int addProdMatVecInPlace (const constvect x, vect y, bool transpose=false) const
 
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
 
- Public Member Functions inherited from ALinearOp
virtual ~ALinearOp ()
 
int evalDirect (const VectorDouble &inv, VectorDouble &outv) const
 
VectorDouble evalDirect (const VectorDouble &in) const
 
int evalDirect (constvect inv, vect outv) const
 
int addToDest (const constvect inv, vect outv) const
 
int addToDest (const Eigen::VectorXd &inv, Eigen::VectorXd &outv) const
 

Static Public Member Functions

static ProjMatrixcreate (const Db *db, const AMesh *a_mesh, int rankZ=-1, bool verbose=false)
 
- Static Public Member Functions inherited from MatrixSparse
static MatrixSparsecreate (const MatrixSparse *mat)
 
static MatrixSparsecreate (int nrow, int ncol)
 
static MatrixSparsecreateFromTriplet (const NF_Triplet &NF_T, int nrow=0, int ncol=0, int opt_eigen=-1)
 
static MatrixSparseaddMatMat (const MatrixSparse *x, const MatrixSparse *y, double cx=1., double cy=1.)
 
static MatrixSparsediagVec (const VectorDouble &vec, int opt_eigen=-1)
 
static MatrixSparsediagConstant (int number, double value=1., int opt_eigen=-1)
 
static MatrixSparsediagMat (MatrixSparse *A, int oper_choice, int opt_eigen=-1)
 
static MatrixSparseglue (const MatrixSparse *A1, const MatrixSparse *A2, bool flagShiftRow, bool flagShiftCol)
 
static void glueInPlace (MatrixSparse *A1, const MatrixSparse *A2, bool flagShiftRow, bool flagShiftCol)
 
static void dumpElements (const String &title, int ifrom, int ito)
 

Public Attributes

 DECLARE_TOTL
 Has a specific implementation in the Target language. More...
 
- Public Attributes inherited from MatrixSparse
 DECLARE_TOTL
 Has a specific implementation in the Target language. More...
 

Constructor & Destructor Documentation

◆ ProjMatrix() [1/4]

ProjMatrix::ProjMatrix ( )

◆ ProjMatrix() [2/4]

ProjMatrix::ProjMatrix ( const Db db,
const AMesh a_mesh,
int  rankZ = -1,
bool  verbose = false 
)

◆ ProjMatrix() [3/4]

ProjMatrix::ProjMatrix ( const ProjMatrix m)

◆ ProjMatrix() [4/4]

ProjMatrix::ProjMatrix ( const MatrixSparse m)

◆ ~ProjMatrix()

ProjMatrix::~ProjMatrix ( )
virtual

Member Function Documentation

◆ create()

ProjMatrix * ProjMatrix::create ( const Db db,
const AMesh a_mesh,
int  rankZ = -1,
bool  verbose = false 
)
static

◆ getApexNumber()

int ProjMatrix::getApexNumber ( ) const
inlineoverridevirtual

Implements IProjMatrix.

◆ getPointNumber()

int ProjMatrix::getPointNumber ( ) const
inlineoverridevirtual

Implements IProjMatrix.

◆ operator=()

ProjMatrix & ProjMatrix::operator= ( const ProjMatrix m)

◆ resetFromMeshAndDb()

void ProjMatrix::resetFromMeshAndDb ( const Db db,
const AMesh a_mesh,
int  rankZ = -1,
bool  verbose = false 
)

◆ toString()

String ProjMatrix::toString ( const AStringFormat strfmt = nullptr) const
overridevirtual

Cloneable interface.

Interface for AStringable

Reimplemented from MatrixSparse.

Member Data Documentation

◆ DECLARE_TOTL

ProjMatrix::DECLARE_TOTL

Has a specific implementation in the Target language.


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