SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::defaulttype::BaseMatrix::BlockAccessor Class Reference

#include <BaseMatrix.h>

Protected Attributes

BaseMatrixmatrix
 
InternalBlockAccessor internal
 

Public Member Functions

 ~BlockAccessor ()
 
 BlockAccessor (const BlockAccessor &b)
 
void operator= (const BlockAccessor &b)
 
Index getRow () const
 
Index getCol () const
 
const BaseMatrixgetMatrix () const
 
BaseMatrixgetMatrix ()
 
bool isValid () const
 
SReal element (Index i, Index j) const
 Read the value of the element at row i, column j within this block (using 0-based indices) More...
 
void set (Index i, Index j, double v)
 Write the value of the element at row i, column j within this block (using 0-based indices) More...
 
void add (Index i, Index j, double v)
 Add v to the existing value of the element at row i, column j within this block (using 0-based indices) More...
 
const floatelements (float *dest) const
 Read all values from this bloc into given float buffer, or return the pointer to the data if the in-memory format is compatible. More...
 
const doubleelements (double *dest) const
 Read all values from this bloc into given double buffer, or return the pointer to the data if the in-memory format is compatible. More...
 
const intelements (int *dest) const
 Read all values from this bloc into given int buffer, or return the pointer to the data if the in-memory format is compatible. More...
 
void set (const float *src)
 Set all values of this bloc from the given float buffer. More...
 
void set (const double *src)
 Set all values of this bloc from the given double buffer. More...
 
void set (const int *src)
 Set all values of this bloc from the given int buffer. More...
 
void add (const float *src)
 Add to all values of this bloc from the given float buffer. More...
 
void add (const double *src)
 Add to all values of this bloc from the given double buffer. More...
 
void add (const int *src)
 Add to all values of this bloc from the given int buffer. More...
 
const floatprepareAdd (float *buffer)
 
void finishAdd (const float *buffer)
 
const doubleprepareAdd (double *buffer)
 
void finishAdd (const double *buffer)
 
const intprepareAdd (int *buffer)
 
void finishAdd (const int *buffer)
 

Protected Member Functions

 BlockAccessor ()
 
 BlockAccessor (BaseMatrix *matrix, Index row, Index col, void *internalPtr)
 
 BlockAccessor (BaseMatrix *matrix, Index row, Index col, Index internalData)
 

Friends

class BaseMatrix
 
class BlockConstAccessor
 
class ColBlockConstIterator
 

Attribute details

InternalBlockAccessor sofa::defaulttype::BaseMatrix::BlockAccessor::internal
protected
BaseMatrix* sofa::defaulttype::BaseMatrix::BlockAccessor::matrix
protected

Constructor details

sofa::defaulttype::BaseMatrix::BlockAccessor::BlockAccessor ( )
inlineprotected
sofa::defaulttype::BaseMatrix::BlockAccessor::BlockAccessor ( BaseMatrix matrix,
Index  row,
Index  col,
void *  internalPtr 
)
inlineprotected
sofa::defaulttype::BaseMatrix::BlockAccessor::BlockAccessor ( BaseMatrix matrix,
Index  row,
Index  col,
Index  internalData 
)
inlineprotected
sofa::defaulttype::BaseMatrix::BlockAccessor::~BlockAccessor ( )
inline
sofa::defaulttype::BaseMatrix::BlockAccessor::BlockAccessor ( const BlockAccessor b)
inline

Function details

void sofa::defaulttype::BaseMatrix::BlockAccessor::add ( Index  i,
Index  j,
double  v 
)
inline

Add v to the existing value of the element at row i, column j within this block (using 0-based indices)

void sofa::defaulttype::BaseMatrix::BlockAccessor::add ( const float src)
inline

Add to all values of this bloc from the given float buffer.

void sofa::defaulttype::BaseMatrix::BlockAccessor::add ( const double src)
inline

Add to all values of this bloc from the given double buffer.

void sofa::defaulttype::BaseMatrix::BlockAccessor::add ( const int src)
inline

Add to all values of this bloc from the given int buffer.

SReal sofa::defaulttype::BaseMatrix::BlockAccessor::element ( Index  i,
Index  j 
) const
inline

Read the value of the element at row i, column j within this block (using 0-based indices)

const float* sofa::defaulttype::BaseMatrix::BlockAccessor::elements ( float dest) const
inline

Read all values from this bloc into given float buffer, or return the pointer to the data if the in-memory format is compatible.

const double* sofa::defaulttype::BaseMatrix::BlockAccessor::elements ( double dest) const
inline

Read all values from this bloc into given double buffer, or return the pointer to the data if the in-memory format is compatible.

const int* sofa::defaulttype::BaseMatrix::BlockAccessor::elements ( int dest) const
inline

Read all values from this bloc into given int buffer, or return the pointer to the data if the in-memory format is compatible.

void sofa::defaulttype::BaseMatrix::BlockAccessor::finishAdd ( const float buffer)
inline

Finalize an addition of float values to this bloc. The buffer must be the one returned by calling the prepareAdd method.

void sofa::defaulttype::BaseMatrix::BlockAccessor::finishAdd ( const double buffer)
inline

Finalize an addition of double values to this bloc. The buffer must be the one returned by calling the prepareAdd method.

void sofa::defaulttype::BaseMatrix::BlockAccessor::finishAdd ( const int buffer)
inline

Finalize an addition of int values to this bloc. The buffer must be the one returned by calling the prepareAdd method.

Index sofa::defaulttype::BaseMatrix::BlockAccessor::getCol ( ) const
inline
const BaseMatrix* sofa::defaulttype::BaseMatrix::BlockAccessor::getMatrix ( ) const
inline
BaseMatrix* sofa::defaulttype::BaseMatrix::BlockAccessor::getMatrix ( )
inline
Index sofa::defaulttype::BaseMatrix::BlockAccessor::getRow ( ) const
inline
bool sofa::defaulttype::BaseMatrix::BlockAccessor::isValid ( ) const
inline
void sofa::defaulttype::BaseMatrix::BlockAccessor::operator= ( const BlockAccessor b)
inline
const float* sofa::defaulttype::BaseMatrix::BlockAccessor::prepareAdd ( float buffer)
inline

Prepare the addition of float values to this bloc. Return a pointer to a float buffer where values can be added. If the in-memory format of the matrix is incompatible, the provided buffer can be used, but the method must clear it before returning.

const double* sofa::defaulttype::BaseMatrix::BlockAccessor::prepareAdd ( double buffer)
inline

Prepare the addition of double values to this bloc. Return a pointer to a double buffer where values can be added. If the in-memory format of the matrix is incompatible, the provided buffer can be used, but the method must clear it before returning.

const int* sofa::defaulttype::BaseMatrix::BlockAccessor::prepareAdd ( int buffer)
inline

Prepare the addition of int values to this bloc. Return a pointer to a int buffer where values can be added. If the in-memory format of the matrix is incompatible, the provided buffer can be used, but the method must clear it before returning.

void sofa::defaulttype::BaseMatrix::BlockAccessor::set ( Index  i,
Index  j,
double  v 
)
inline

Write the value of the element at row i, column j within this block (using 0-based indices)

void sofa::defaulttype::BaseMatrix::BlockAccessor::set ( const float src)
inline

Set all values of this bloc from the given float buffer.

void sofa::defaulttype::BaseMatrix::BlockAccessor::set ( const double src)
inline

Set all values of this bloc from the given double buffer.

void sofa::defaulttype::BaseMatrix::BlockAccessor::set ( const int src)
inline

Set all values of this bloc from the given int buffer.

Related details

friend class BaseMatrix
friend
friend class BlockConstAccessor
friend
friend class ColBlockConstIterator
friend