PolyDiM
C++ library for POLYtopal DIscretization Methods
Loading...
Searching...
No Matches
Gedim::ISparseArray Class Referenceabstract

Interface used for sparse Array of double. More...

#include <ISparseArray.hpp>

Inheritance diagram for Gedim::ISparseArray:
[legend]

Public Types

enum class  SparseArrayTypes {
  None = 0 , Lower = 1 , Upper = 2 , Symmetric = 3 ,
  Diagonal = 4
}
 
enum class  ConditionNumberAlgorithm { SVDLapack = 0 , CondestLapack = 1 , CondestSuiteSparse = 2 }
 

Public Member Functions

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

Friends

std::ostream & operator<< (std::ostream &output, const ISparseArray &b)
 operator <<
 

Detailed Description

Interface used for sparse Array of double.

Member Enumeration Documentation

◆ ConditionNumberAlgorithm

Enumerator
SVDLapack 
CondestLapack 
CondestSuiteSparse 

◆ SparseArrayTypes

Enumerator
None 
Lower 
Upper 
Symmetric 
Diagonal 

Constructor & Destructor Documentation

◆ ~ISparseArray()

virtual Gedim::ISparseArray::~ISparseArray ( )
inlinevirtual

Member Function Documentation

◆ Cond()

virtual double Gedim::ISparseArray::Cond ( const ISparseArray::ConditionNumberAlgorithm algorithm = ISparseArray::ConditionNumberAlgorithm::SVDLapack) const
pure virtual
Returns
the condition number of the sparse array computed with an algorithm of type ISparseArray::ConditionNumberAlgorithm

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ Create()

virtual void Gedim::ISparseArray::Create ( )
pure virtual

Matrix Allocation is implemented in child classes.

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

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ Destroy()

virtual void Gedim::ISparseArray::Destroy ( )
pure virtual

◆ Flush()

virtual void Gedim::ISparseArray::Flush ( )
pure virtual

Intermediate flush of the Matrix during creation.

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ NonZeros()

virtual unsigned int Gedim::ISparseArray::NonZeros ( ) const
pure virtual
Returns
the number of non-zeros element

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ Norm()

virtual double Gedim::ISparseArray::Norm ( ) const
pure virtual
Returns
The Frobenius norm of the sparse array

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ operator*=()

virtual ISparseArray & Gedim::ISparseArray::operator*= ( const double c)
pure virtual

◆ operator+=()

virtual ISparseArray & Gedim::ISparseArray::operator+= ( const ISparseArray A)
pure virtual

◆ operator-=()

virtual ISparseArray & Gedim::ISparseArray::operator-= ( const ISparseArray A)
pure virtual

◆ operator/=()

virtual ISparseArray & Gedim::ISparseArray::operator/= ( const double c)
pure virtual

◆ Print()

virtual std::ostream & Gedim::ISparseArray::Print ( std::ostream &  output) const
pure virtual

◆ Reset()

virtual void Gedim::ISparseArray::Reset ( )
pure virtual

Put zero-values in the Matrix.

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ SetSize()

virtual void Gedim::ISparseArray::SetSize ( const unsigned int numRows,
const unsigned int numCols,
const SparseArrayTypes type = SparseArrayTypes::None 
)
pure virtual

Resize the Matrix.

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

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ ToBinaryFile()

virtual void Gedim::ISparseArray::ToBinaryFile ( const std::string &  filePath,
const bool append = false 
) const
pure virtual

Write sparse array to binary file.

Parameters
filePaththe file Path
appendtrue if append operation, default false

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ Triplet()

virtual void Gedim::ISparseArray::Triplet ( const unsigned int i,
const unsigned int j,
const double val 
)
pure virtual

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

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ Triplets()

virtual void Gedim::ISparseArray::Triplets ( const std::vector< unsigned int > &  i,
const std::vector< unsigned int > &  j,
const std::vector< double > &  val 
)
pure virtual

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

Implemented in Gedim::Eigen_SparseArray< Eigen_ArrayType, Eigen_SparseArrayType >.

◆ Type()

virtual SparseArrayTypes Gedim::ISparseArray::Type ( ) const
pure virtual

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