PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType > Class Template Referencefinal

Eigen sparse array. More...

#include <Eigen_SparseArray.hpp>

Inheritance diagram for Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >:
[legend]

Public Member Functions

 Eigen_SparseArray ()
 
 ~Eigen_SparseArray ()
 
 Eigen_SparseArray (const Eigen_SparseArrayType &matrix, const SparseArrayTypes &type=SparseArrayTypes::None)
 
 operator Eigen_SparseArrayType & ()
 
 operator const Eigen_SparseArrayType & () const
 
Eigen_SparseArrayTypeCast (ISparseArray &v)
 
const Eigen_SparseArrayTypeCast (const ISparseArray &v)
 
const Eigen_SparseArrayTypeCast (const ISparseArray &v) const
 
void SetSize (const unsigned int &numRows, const unsigned int &numCols, const SparseArrayTypes &type=SparseArrayTypes::None)
 Resize the Matrix.
 
SparseArrayTypes Type () const
 
void Create ()
 Matrix Allocation is implemented in child classes.
 
void Destroy ()
 
void Flush ()
 Intermediate flush of the Matrix during creation.
 
void Reset ()
 Put zero-values in the Matrix.
 
void Triplet (const unsigned int &i, const unsigned int &j, const double &value)
 Given the row index i and the column index j the value val is put into the Matrix in ADD or INSERT mode.
 
void Triplets (const std::vector< unsigned int > &i, const std::vector< unsigned int > &j, const std::vector< double > &values)
 Given the row indices i and the column indices j the values val are put into the Matrix in ADD or INSERT mode.
 
std::ostream & Print (std::ostream &output) const
 Print the array.
 
ISparseArrayoperator+= (const ISparseArray &A)
 
ISparseArrayoperator-= (const ISparseArray &A)
 
ISparseArrayoperator*= (const double &c)
 
ISparseArrayoperator/= (const double &c)
 
void Copy (const ISparseArray &A)
 
unsigned int rows () const
 
unsigned int cols () const
 
Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType > & operator= (Eigen_SparseArrayType &&matrix)
 
void ToBinaryFile (const std::string &filePath, const bool &append=false) const
 Write sparse array to binary file.
 
double Norm () const
 
double Cond (const ISparseArray::ConditionNumberAlgorithm &algorithm=ISparseArray::ConditionNumberAlgorithm::SVDLapack) const
 
unsigned int NonZeros () const
 
- Public Member Functions inherited from Gedim::ISparseArray
virtual ~ISparseArray ()
 

Additional Inherited Members

- Public Types inherited from Gedim::ISparseArray
enum class  SparseArrayTypes {
  None = 0 , Lower = 1 , Upper = 2 , Symmetric = 3 ,
  Diagonal = 4
}
 
enum class  ConditionNumberAlgorithm { SVDLapack = 0 , CondestLapack = 1 , CondestSuiteSparse = 2 }
 

Detailed Description

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
class Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >

Eigen sparse array.

Constructor & Destructor Documentation

◆ Eigen_SparseArray() [1/2]

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Eigen_SparseArray ( )
inline

◆ ~Eigen_SparseArray()

◆ Eigen_SparseArray() [2/2]

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Eigen_SparseArray ( const Eigen_SparseArrayType matrix,
const SparseArrayTypes type = SparseArrayTypes::None 
)
inline

Member Function Documentation

◆ Cast() [1/3]

◆ Cast() [2/3]

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
const Eigen_SparseArrayType & Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Cast ( const ISparseArray v) const
inline

◆ Cast() [3/3]

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
Eigen_SparseArrayType & Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Cast ( ISparseArray v)
inline

◆ cols()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
unsigned int Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::cols ( ) const
inline

◆ Cond()

Returns
the condition number of the sparse array computed with an algorithm of type ISparseArray::ConditionNumberAlgorithm

Implements Gedim::ISparseArray.

◆ Copy()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Copy ( const ISparseArray A)
inline

◆ Create()

Matrix Allocation is implemented in child classes.

Matrix create call. Last call to complete the Array structure.

Implements Gedim::ISparseArray.

◆ Destroy()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Destroy ( )
inlinevirtual

Implements Gedim::ISparseArray.

◆ Flush()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Flush ( )
inlinevirtual

Intermediate flush of the Matrix during creation.

Implements Gedim::ISparseArray.

◆ NonZeros()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
unsigned int Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::NonZeros ( ) const
inlinevirtual
Returns
the number of non-zeros element

Implements Gedim::ISparseArray.

◆ Norm()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
double Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Norm ( ) const
inlinevirtual
Returns
The Frobenius norm of the sparse array

Implements Gedim::ISparseArray.

◆ operator const Eigen_SparseArrayType &()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::operator const Eigen_SparseArrayType & ( ) const
inline

◆ operator Eigen_SparseArrayType &()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::operator Eigen_SparseArrayType & ( )
inline

◆ operator*=()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
ISparseArray & Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::operator*= ( const double c)
inlinevirtual

Implements Gedim::ISparseArray.

◆ operator+=()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
ISparseArray & Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::operator+= ( const ISparseArray A)
inlinevirtual

Implements Gedim::ISparseArray.

◆ operator-=()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
ISparseArray & Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::operator-= ( const ISparseArray A)
inlinevirtual

Implements Gedim::ISparseArray.

◆ operator/=()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
ISparseArray & Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::operator/= ( const double c)
inlinevirtual

Implements Gedim::ISparseArray.

◆ operator=()

◆ Print()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
std::ostream & Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Print ( std::ostream &  output) const
inlinevirtual

Print the array.

Implements Gedim::ISparseArray.

◆ Reset()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Reset ( )
inlinevirtual

Put zero-values in the Matrix.

Implements Gedim::ISparseArray.

◆ rows()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
unsigned int Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::rows ( ) const
inline

◆ SetSize()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::SetSize ( const unsigned int numRows,
const unsigned int numCols,
const SparseArrayTypes type = SparseArrayTypes::None 
)
inlinevirtual

Resize the Matrix.

Parameters
numRowsthe number of rows
numColsthe number of cols
typethe type of the matrix, default none

Implements Gedim::ISparseArray.

◆ ToBinaryFile()

void Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::ToBinaryFile ( const std::string &  filePath,
const bool append = false 
) const
virtual

Write sparse array to binary file.

Parameters
filePaththe file Path
appendtrue if append operation, default false

Implements Gedim::ISparseArray.

◆ Triplet()

Given the row index i and the column index j the value val is put into the Matrix in ADD or INSERT mode.

Implements Gedim::ISparseArray.

◆ Triplets()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Triplets ( const std::vector< unsigned int > &  i,
const std::vector< unsigned int > &  j,
const std::vector< double > &  val 
)
virtual

Given the row indices i and the column indices j the values val are put into the Matrix in ADD or INSERT mode.

Implements Gedim::ISparseArray.

◆ Type()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
SparseArrayTypes Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >::Type ( ) const
inlinevirtual
Returns
The matrix type

Implements Gedim::ISparseArray.


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