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

Eigen column vector. More...

#include <Eigen_Array.hpp>

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

Public Member Functions

 Eigen_Array ()
 
 Eigen_Array (const Eigen_ArrayType &vector)
 
 Eigen_Array (Eigen_ArrayType &&vector)
 
 ~Eigen_Array ()
 
 operator Eigen_ArrayType & ()
 
 operator const Eigen_ArrayType & () const
 
Eigen_ArrayTypeCast (IArray &v)
 
const Eigen_ArrayTypeCast (const IArray &v) const
 
void Create ()
 Matrix create call. Last call to complete the matrix structure.
 
void Destroy ()
 
void SetSize (const unsigned int &numCols)
 Set the size the Array. Resize a Array for Eigen application.
 
void SetSizes (const unsigned int &numCols, const unsigned int &=0)
 Set the size the Array. Resize a Array for Eigen application.
 
unsigned int Size () const
 
const doubleData () const
 
doubleData ()
 
void SetValue (const int &i, const double &val)
 Set the Array Value.
 
void SetValues (const std::vector< int > &indices, const std::vector< double > &values)
 Set the Array Values.
 
void AddValue (const int &i, const double &val)
 Add value to the Array.
 
void AddValues (const std::vector< int > &indices, const std::vector< double > &values)
 Add values in the indices to the Array.
 
std::vector< doubleGetValues (const std::vector< int > &indices={}) const
 
double GetValue (const int &i) const
 
void Zeros ()
 Put zero-values in the Array.
 
void Ones ()
 Put one-values in the Array.
 
void Constant (const double &c)
 
void SumMultiplication (const ISparseArray &A, const IArray &w)
 Multiplication of matrix and vector, equivalent to v += A * w.
 
void SubtractionMultiplication (const ISparseArray &A, const IArray &w)
 Multiplication of matrix and vector and sum to local vector, equivalent to v -= A * w.
 
doubleoperator[] (const int &i)
 operator []
 
const doubleoperator[] (const int &i) const
 const operator []
 
void Concatenate (const IArray &v, const IArray &w)
 Concatenate vectors, equivalent u<< v, w.
 
std::ostream & Print (std::ostream &output) const
 Print the array.
 
IArrayoperator+= (const IArray &v)
 
IArrayoperator-= (const IArray &v)
 
IArrayoperator*= (const double &c)
 
IArrayoperator/= (const double &c)
 
Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayTypeoperator+ (const Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType > &other) const
 
Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayTypeoperator- (const Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType > &other) const
 
Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayTypeoperator* (const double &other) const
 
Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType > & operator= (Eigen_ArrayType &&vector)
 
void ToBinaryFile (const std::string &filePath, const unsigned int &dataSizeToWrite=0, const unsigned int &dataStartingPositionToWrite=0, const bool &append=false) const
 Write array to binary file.
 
double Norm () const
 
double Dot (const IArray &v) const
 
void Copy (const IArray &v)
 Copy the content of vector v inside this.
 
Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayTypeSegment (const unsigned int starter, const unsigned int numElements) const
 
- Public Member Functions inherited from Gedim::IArray
virtual ~IArray ()
 

Detailed Description

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

Eigen column vector.

Constructor & Destructor Documentation

◆ Eigen_Array() [1/3]

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

◆ Eigen_Array() [2/3]

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

◆ Eigen_Array() [3/3]

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

◆ ~Eigen_Array()

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

Member Function Documentation

◆ AddValue()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::AddValue ( const int i,
const double val 
)
inlinevirtual

Add value to the Array.

Parameters
ithe i_th global position starting from 0
valelement to add

Implements Gedim::IArray.

◆ AddValues()

void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::AddValues ( const std::vector< int > &  indices,
const std::vector< double > &  values 
)
virtual

Add values in the indices to the Array.

Parameters
indicesthe indices
valuesthe values

Implements Gedim::IArray.

◆ Cast() [1/2]

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

◆ Cast() [2/2]

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

◆ Concatenate()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::Concatenate ( const IArray v,
const IArray w 
)
inlinevirtual

Concatenate vectors, equivalent u<< v, w.

Implements Gedim::IArray.

◆ Constant()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::Constant ( const double c)
inlinevirtual

Implements Gedim::IArray.

◆ Copy()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::Copy ( const IArray v)
inlinevirtual

Copy the content of vector v inside this.

Implements Gedim::IArray.

◆ Create()

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

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

Implements Gedim::IArray.

◆ Data() [1/2]

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
double * Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::Data ( )
inlinevirtual
Returns
the pointer of the array

Implements Gedim::IArray.

◆ Data() [2/2]

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
const double * Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::Data ( ) const
inlinevirtual
Returns
the const pointer of the array

Implements Gedim::IArray.

◆ Destroy()

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

Implements Gedim::IArray.

◆ Dot()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
double Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::Dot ( const IArray v) const
inlinevirtual
Returns
the dot product

Implements Gedim::IArray.

◆ GetValue()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
double Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::GetValue ( const int i) const
inlinevirtual

Implements Gedim::IArray.

◆ GetValues()

std::vector< double > Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::GetValues ( const std::vector< int > &  indices = {}) const
virtual

Implements Gedim::IArray.

◆ Norm()

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

Implements Gedim::IArray.

◆ Ones()

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

Put one-values in the Array.

Implements Gedim::IArray.

◆ operator const Eigen_ArrayType &()

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

◆ operator Eigen_ArrayType &()

◆ operator*()

◆ operator*=()

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

Implements Gedim::IArray.

◆ operator+()

◆ operator+=()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
IArray & Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::operator+= ( const IArray v)
inlinevirtual

Implements Gedim::IArray.

◆ operator-()

◆ operator-=()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
IArray & Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::operator-= ( const IArray v)
inlinevirtual

Implements Gedim::IArray.

◆ operator/=()

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

Implements Gedim::IArray.

◆ operator=()

◆ operator[]() [1/2]

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
double & Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::operator[] ( const int i)
inlinevirtual

operator []

Parameters
ithe i_th position starting from 0
Returns
the reference to i_th element

Implements Gedim::IArray.

◆ operator[]() [2/2]

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
const double & Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::operator[] ( const int i) const
inlinevirtual

const operator []

Parameters
ithe i_th position starting from 0
Returns
the const reference to i_th element

Implements Gedim::IArray.

◆ Print()

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

Print the array.

Implements Gedim::IArray.

◆ Segment()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType > Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::Segment ( const unsigned int  starter,
const unsigned int  numElements 
) const
inline

◆ SetSize()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::SetSize ( const unsigned int numCols)
inlinevirtual

Set the size the Array. Resize a Array for Eigen application.

Parameters
numColsthe number of cols

Implements Gedim::IArray.

◆ SetSizes()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::SetSizes ( const unsigned int numCols,
const unsigned int numLocalCols = 0 
)
inlinevirtual

Set the size the Array. Resize a Array for Eigen application.

Parameters
numColsthe number of cols
numLocalColsthe local size for the Array (It can be set for each process. For PETSC applciation when not specified is set to PETSC_DECIDE)

Implements Gedim::IArray.

◆ SetValue()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::SetValue ( const int i,
const double val 
)
inlinevirtual

Set the Array Value.

Parameters
ithe i_th global position starting from 0
valelement to set

Implements Gedim::IArray.

◆ SetValues()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::SetValues ( const std::vector< int > &  indices,
const std::vector< double > &  values 
)
virtual

Set the Array Values.

Parameters
indicesthe indices
valuesthe values

Implements Gedim::IArray.

◆ Size()

template<typename Eigen_ArrayType = Eigen::VectorXd, typename Eigen_SparseArrayType = Eigen::SparseMatrix<double>>
unsigned int Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::Size ( ) const
inlinevirtual
Returns
the size of the array

Implements Gedim::IArray.

◆ SubtractionMultiplication()

Multiplication of matrix and vector and sum to local vector, equivalent to v -= A * w.

Implements Gedim::IArray.

◆ SumMultiplication()

Multiplication of matrix and vector, equivalent to v += A * w.

Implements Gedim::IArray.

◆ ToBinaryFile()

void Gedim::Eigen_Array< Eigen_ArrayType, Eigen_SparseArrayType >::ToBinaryFile ( const std::string &  filePath,
const unsigned int dataSizeToWrite = 0,
const unsigned int dataStartingPositionToWrite = 0,
const bool append = false 
) const
virtual

Write array to binary file.

Parameters
filePaththe file Path
dataSizeToWritethe size of data to write, default 0 means all the vector
dataStartingPositionToWritethe file starting position, default 0
appendtrue if append operation, default false

Implements Gedim::IArray.

◆ Zeros()

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

Put zero-values in the Array.

Implements Gedim::IArray.


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