SOFA API  1c8b807d
Open source framework for multi-physics simuation
sofa::linearalgebra::EigenVector< TReal, TBlockSize > Class Template Reference

#include <EigenVector.h>

Inheritance diagram for sofa::linearalgebra::EigenVector< TReal, TBlockSize >:

Detailed Description

template<class TReal, std::size_t TBlockSize = 1>
class sofa::linearalgebra::EigenVector< TReal, TBlockSize >

Container of a vector of the Eigen library. Not an eigenvector of a matrix.

Protected Attributes

VectorEigen eigenVector
 the data More...
 

Public Member Functions

VectorEigengetVectorEigen ()
 
const VectorEigengetVectorEigen () const
 
 EigenVector (Index nbRow=0)
 
Index size () const override
 Number of elements. More...
 
void resize (Index nbRow) override
 Resize the matrix without preserving the data (the matrix is set to zero) More...
 
void resizeBlocks (Index nbBlocks)
 Resize the matrix without preserving the data (the matrix is set to zero), with the size given in number of blocks. More...
 
SReal element (Index i) const override
 Read the value of element i. More...
 
void set (Index i, SReal v) override
 Write the value of element i. More...
 
void setBlock (Index i, const Block &v)
 
void add (Index i, SReal v) override
 Add v to the existing value of element i. More...
 
void clear (Index i) override
 Reset the value of element i to 0. More...
 
void clear () override
 Set all values to 0, by resizing to the same size. More...
 
const std::string Name ()
 
- Public Member Functions inherited from sofa::linearalgebra::BaseVector
virtual ~BaseVector ()
 
virtual const floatelements (Index i0, Index n, float *src) const
 Get the values of n elements, starting at element i0, into given float buffer, or return the pointer to the data if the in-memory format is compatible. More...
 
virtual const double * elements (Index i0, Index n, double *src) const
 Get the values of n elements, starting at element i0, into given double buffer, or return the pointer to the data if the in-memory format is compatible. More...
 
virtual const int * elements (Index i0, Index n, int *src) const
 Get the values of n elements, starting at element i0, into given int buffer, or return the pointer to the data if the in-memory format is compatible. More...
 
virtual void set (Index i0, Index n, const float *src)
 Write the values of n float elements, starting at element i0. More...
 
virtual void set (Index i0, Index n, const double *src)
 Write the values of n double elements, starting at element i0. More...
 
virtual void set (Index i0, Index n, const int *src)
 Write the values of n int elements, starting at element i0. More...
 
virtual void add (Index i0, Index n, const float *src)
 Add to the values of n float elements, starting at element i0. More...
 
virtual void add (Index i0, Index n, const double *src)
 Add to the values of n double elements, starting at element i0. More...
 
virtual void add (Index i0, Index n, const int *src)
 Add to the values of n int elements, starting at element i0. More...
 
virtual ElementType getElementType () const
 
virtual std::size_t getElementSize () const
 
virtual bool isFull () const
 Return true if this vector is full, i.a. all elements are stored in memory. More...
 
bool isSparse () const
 

Static Public Member Functions

static const std::string Name ()
 

Friends

std::ostream & operator<< (std::ostream &out, const EigenVector< TReal, TBlockSize > &v)
 

Additional Inherited Members

- Protected Member Functions inherited from sofa::linearalgebra::BaseVector
template<class T >
const T * elementsDefaultImpl (Index i0, Index n, T *buffer) const
 
template<class T >
void setDefaultImpl (Index i0, Index n, const T *src)
 
template<class T >
void addDefaultImpl (Index i0, Index n, const T *src)
 

Attribute details

◆ eigenVector

template<class TReal , std::size_t TBlockSize = 1>
VectorEigen sofa::linearalgebra::EigenVector< TReal, TBlockSize >::eigenVector
protected

the data

Constructor details

◆ EigenVector()

template<class TReal , std::size_t TBlockSize = 1>
sofa::linearalgebra::EigenVector< TReal, TBlockSize >::EigenVector ( Index  nbRow = 0)
inline

Function details

◆ add()

template<class TReal , std::size_t TBlockSize = 1>
void sofa::linearalgebra::EigenVector< TReal, TBlockSize >::add ( Index  i,
SReal  v 
)
inlineoverridevirtual

Add v to the existing value of element i.

Implements sofa::linearalgebra::BaseVector.

◆ clear() [1/2]

template<class TReal , std::size_t TBlockSize = 1>
void sofa::linearalgebra::EigenVector< TReal, TBlockSize >::clear ( )
inlineoverridevirtual

Set all values to 0, by resizing to the same size.

Implements sofa::linearalgebra::BaseVector.

◆ clear() [2/2]

template<class TReal , std::size_t TBlockSize = 1>
void sofa::linearalgebra::EigenVector< TReal, TBlockSize >::clear ( Index  i)
inlineoverridevirtual

Reset the value of element i to 0.

Reimplemented from sofa::linearalgebra::BaseVector.

◆ element()

template<class TReal , std::size_t TBlockSize = 1>
SReal sofa::linearalgebra::EigenVector< TReal, TBlockSize >::element ( Index  i) const
inlineoverridevirtual

Read the value of element i.

Implements sofa::linearalgebra::BaseVector.

◆ getVectorEigen() [1/2]

template<class TReal , std::size_t TBlockSize = 1>
VectorEigen& sofa::linearalgebra::EigenVector< TReal, TBlockSize >::getVectorEigen ( )
inline

◆ getVectorEigen() [2/2]

template<class TReal , std::size_t TBlockSize = 1>
const VectorEigen& sofa::linearalgebra::EigenVector< TReal, TBlockSize >::getVectorEigen ( ) const
inline

◆ Name() [1/2]

const std::string sofa::linearalgebra::EigenVector< double >::Name ( )

◆ Name() [2/2]

template<class TReal , std::size_t TBlockSize = 1>
static const std::string sofa::linearalgebra::EigenVector< TReal, TBlockSize >::Name ( )
inlinestatic

◆ resize()

template<class TReal , std::size_t TBlockSize = 1>
void sofa::linearalgebra::EigenVector< TReal, TBlockSize >::resize ( Index  nbRow)
inlineoverridevirtual

Resize the matrix without preserving the data (the matrix is set to zero)

Implements sofa::linearalgebra::BaseVector.

◆ resizeBlocks()

template<class TReal , std::size_t TBlockSize = 1>
void sofa::linearalgebra::EigenVector< TReal, TBlockSize >::resizeBlocks ( Index  nbBlocks)
inline

Resize the matrix without preserving the data (the matrix is set to zero), with the size given in number of blocks.

◆ set()

template<class TReal , std::size_t TBlockSize = 1>
void sofa::linearalgebra::EigenVector< TReal, TBlockSize >::set ( Index  i,
SReal  v 
)
inlineoverridevirtual

Write the value of element i.

Implements sofa::linearalgebra::BaseVector.

◆ setBlock()

template<class TReal , std::size_t TBlockSize = 1>
void sofa::linearalgebra::EigenVector< TReal, TBlockSize >::setBlock ( Index  i,
const Block v 
)
inline

◆ size()

template<class TReal , std::size_t TBlockSize = 1>
Index sofa::linearalgebra::EigenVector< TReal, TBlockSize >::size ( ) const
inlineoverridevirtual

Number of elements.

Implements sofa::linearalgebra::BaseVector.

Enum details

◆ anonymous enum

template<class TReal , std::size_t TBlockSize = 1>
anonymous enum
Enumerator
Nin 

Related details

◆ operator<<

template<class TReal , std::size_t TBlockSize = 1>
std::ostream& operator<< ( std::ostream &  out,
const EigenVector< TReal, TBlockSize > &  v 
)
friend