SOFA API  b3f2f2a4
Open source framework for multi-physics simuation
sofa::linearalgebra::BlockVector< N, T > Class Template Reference

#include <BlockVector.h>

Inheritance diagram for sofa::linearalgebra::BlockVector< N, T >:

Classes

class  Block
 

Public Member Functions

 BlockVector ()
 
 BlockVector (Index n)
 
virtual ~BlockVector ()
 
const Blocksub (Index i, Index) const
 
Blocksub (Index i, Index)
 
const Blockasub (Index bi, Index) const
 
Blockasub (Index bi, Index)
 
- Public Member Functions inherited from sofa::linearalgebra::FullVector< T >
 FullVector ()
 
 FullVector (const FullVector &vect)
 
 FullVector (Index n)
 
 FullVector (T *ptr, Index n)
 
 FullVector (T *ptr, Index n, Index nmax)
 
 ~FullVector () override
 
T * ptr ()
 
const T * ptr () const
 
void setptr (T *p)
 
Index capacity () const
 
Iterator begin ()
 
Iterator end ()
 
ConstIterator begin () const
 
ConstIterator end () const
 
void fastResize (Index dim)
 
void resize (Index dim) override
 Resize the vector, and reset all values to 0. More...
 
void clear () override
 Reset all values to 0. More...
 
void swap (FullVector< T > &v)
 
void clear (Index dim) override
 Reset the value of element i to 0. More...
 
T & operator[] (Index i)
 
const T & operator[] (Index i) const
 
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 add (Index i, SReal v) override
 Add v to the existing value of element i. More...
 
Index size () const override
 Number of elements. More...
 
FullVector< T > sub (Index i, Index n)
 
template<class TV >
void getsub (Index i, Index n, TV &v)
 
template<class TV >
void setsub (Index i, Index n, const TV &v)
 
void operator= (const FullVector< T > &a)
 v = a More...
 
void operator= (const T &a)
 
void operator+= (const FullVector< Real > &a)
 v += a More...
 
void operator-= (const FullVector< Real > &a)
 v -= a More...
 
void eq (const FullVector< Real > &a, Real f)
 v = a*f More...
 
void eq (const FullVector< Real > &a, const FullVector< Real > &b, Real f=1.0)
 v = a+b*f More...
 
void peq (const FullVector< Real > &a, Real f)
 v += a*f More...
 
void operator*= (Real f)
 v *= f More...
 
Real dot (const FullVector< Real > &a) const
 
double norm () const
 
- 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
 

Additional Inherited Members

- Protected Attributes inherited from sofa::linearalgebra::FullVector< T >
T * data
 
Index cursize
 
Index allocsize
 
- Static Public Member Functions inherited from sofa::linearalgebra::FullVector< T >
static const charName ()
 
- Protected Member Functions inherited from sofa::linearalgebra::FullVector< T >
void checkIndex (Index n) const
 
- 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)
 

Constructor details

◆ BlockVector() [1/2]

template<std::size_t N, typename T >
sofa::linearalgebra::BlockVector< N, T >::BlockVector

◆ BlockVector() [2/2]

template<std::size_t N, typename T >
sofa::linearalgebra::BlockVector< N, T >::BlockVector ( Index  n)
explicit

◆ ~BlockVector()

template<std::size_t N, typename T >
sofa::linearalgebra::BlockVector< N, T >::~BlockVector
virtual

Function details

◆ asub() [1/2]

template<std::size_t N, typename T >
BlockVector< N, T >::Block & sofa::linearalgebra::BlockVector< N, T >::asub ( Index  bi,
Index   
)

◆ asub() [2/2]

template<std::size_t N, typename T >
const BlockVector< N, T >::Block & sofa::linearalgebra::BlockVector< N, T >::asub ( Index  bi,
Index   
) const

◆ sub() [1/2]

template<std::size_t N, typename T >
BlockVector< N, T >::Block & sofa::linearalgebra::BlockVector< N, T >::sub ( Index  i,
Index   
)

◆ sub() [2/2]

template<std::size_t N, typename T >
const Block& sofa::linearalgebra::BlockVector< N, T >::sub ( Index  i,
Index   
) const
inline