SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::component::linearsolver::EigenVectorWrapper< Real > Class Template Reference

#include <EigenVectorWrapper.h>

Inheritance diagram for sofa::component::linearsolver::EigenVectorWrapper< Real >:

Detailed Description

template<class Real>
class sofa::component::linearsolver::EigenVectorWrapper< Real >

Wrapper of an Eigen vector to provide it with a defaulttype::BaseVector interface.

Protected Attributes

VectorEigeneigenVector
 the data More...
 

Public Member Functions

VectorEigengetVectorEigen ()
 
const VectorEigengetVectorEigen () const
 
 EigenVectorWrapper (VectorEigen &ve)
 
Index size () const
 Number of elements. More...
 
void resize (Index nbRow)
 Resize the matrix without preserving the data (the matrix is set to zero) More...
 
SReal element (Index i) const
 Read the value of element i. More...
 
void set (Index i, double v)
 
void add (Index i, double v)
 
void clear (Index i)
 Reset the value of element i to 0. More...
 
void clear ()
 Set all values to 0, by resizing to the same size. More...
 
- Public Member Functions inherited from sofa::defaulttype::BaseVector
virtual ~BaseVector ()
 
virtual void set (Index i, SReal v)=0
 Write the value of element i. More...
 
virtual void add (Index i, SReal v)=0
 Add v to the existing value of element i. More...
 
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 doubleelements (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 intelements (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 char * Name ()
 

Friends

std::ostream & operator<< (std::ostream &out, const EigenVectorWrapper< Real > &v)
 

Additional Inherited Members

- Protected Member Functions inherited from sofa::defaulttype::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

template<class Real >
VectorEigen& sofa::component::linearsolver::EigenVectorWrapper< Real >::eigenVector
protected

the data

Constructor details

Function details

template<class Real >
void sofa::component::linearsolver::EigenVectorWrapper< Real >::add ( Index  i,
double  v 
)
inline
template<class Real >
void sofa::component::linearsolver::EigenVectorWrapper< Real >::clear ( Index  i)
inlinevirtual

Reset the value of element i to 0.

Reimplemented from sofa::defaulttype::BaseVector.

template<class Real >
void sofa::component::linearsolver::EigenVectorWrapper< Real >::clear ( )
inlinevirtual

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

Implements sofa::defaulttype::BaseVector.

template<class Real >
SReal sofa::component::linearsolver::EigenVectorWrapper< Real >::element ( Index  i) const
inlinevirtual

Read the value of element i.

Implements sofa::defaulttype::BaseVector.

template<class Real >
VectorEigen& sofa::component::linearsolver::EigenVectorWrapper< Real >::getVectorEigen ( )
inline
template<class Real >
const VectorEigen& sofa::component::linearsolver::EigenVectorWrapper< Real >::getVectorEigen ( ) const
inline
template<class Real >
static const char* sofa::component::linearsolver::EigenVectorWrapper< Real >::Name ( )
static
template<class Real >
void sofa::component::linearsolver::EigenVectorWrapper< Real >::resize ( Index  nbRow)
inlinevirtual

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

Implements sofa::defaulttype::BaseVector.

template<class Real >
void sofa::component::linearsolver::EigenVectorWrapper< Real >::set ( Index  i,
double  v 
)
inline
template<class Real >
Index sofa::component::linearsolver::EigenVectorWrapper< Real >::size ( ) const
inlinevirtual

Number of elements.

Implements sofa::defaulttype::BaseVector.

Related details

template<class Real >
std::ostream& operator<< ( std::ostream &  out,
const EigenVectorWrapper< Real > &  v 
)
friend