SOFA plugin: SofaNewmat  master
Open source framework for multi-physics simuation
sofa::component::linearsolver::TNewMatMatrix< Mat > Class Template Reference

#include <NewMatMatrix.h>

Inheritance diagram for sofa::component::linearsolver::TNewMatMatrix< Mat >:

Public Attributes

Index bandWidth
 
- Public Attributes inherited from sofa::linearalgebra::BaseMatrix
 ELEMENT_UNKNOWN
 
 ELEMENT_FLOAT
 
 ELEMENT_INT
 
 MATRIX_UNKNOWN
 
 MATRIX_IDENTITY
 
 MATRIX_DIAGONAL
 
 MATRIX_BAND
 
 MATRIX_SPARSE
 
 MATRIX_FULL
 

Public Member Functions

 TNewMatMatrix (Index defaultBandWidth=11)
 
void resize (Index nbRow, Index nbCol) override
 
Index rowSize (void) const override
 
Index colSize (void) const override
 
SReal element (Index i, Index j) const override
 
void set (Index i, Index j, double v) override
 
void add (Index i, Index j, double v) override
 
void clear (Index i, Index j) override
 
void clearRow (Index i) override
 
void clearCol (Index j) override
 
void clearRowCol (Index i) override
 
NEWMAT::GetSubMatrix sub (Index i, Index j, Index nrow, Index ncol)
 
template<class T >
void getSubMatrix (Index i, Index j, Index nrow, Index ncol, T &m)
 
template<class T >
void setSubMatrix (Index i, Index j, Index nrow, Index ncol, const T &m)
 
NEWMAT::GetSubMatrix asub (Index bi, Index bj, Index nrow, Index ncol)
 
template<class T >
void getAlignedSubMatrix (Index bi, Index bj, Index nrow, Index ncol, T &m)
 
template<class T >
void setAlignedSubMatrix (Index bi, Index bj, Index nrow, Index ncol, const T &m)
 
void solve (NewMatVector *rv, NewMatVector *ov)
 
virtual void solve (linearalgebra::BaseVector *op, linearalgebra::BaseVector *res)
 
LUSolvermakeLUSolver ()
 
void solve (NewMatVector *rv, NewMatVector *ov, LUSolver *solver)
 
template<class T >
void operator= (const T &m)
 
void clear () override
 
const char * Name ()
 
const char * Name ()
 
const char * Name ()
 
const char * Name ()
 
void resize (Index nbRow, Index nbCol)
 
void resize (Index nbRow, Index nbCol)
 
void resize (Index nbRow, Index nbCol)
 
void set (Index i, Index j, double v)
 
void add (Index i, Index j, double v)
 
SReal element (Index i, Index j) const
 
void set (Index i, Index j, double v)
 
void add (Index i, Index j, double v)
 
SReal element (Index i, Index j) const
 
void set (Index i, Index j, double v)
 
void add (Index i, Index j, double v)
 
- Public Member Functions inherited from sofa::linearalgebra::BaseMatrix
 BaseMatrix ()
 
virtual ~BaseMatrix ()
 
Index rows (void) const
 
Index cols (void) const
 
SReal operator() (Index i, Index j) const
 
virtual void add (Index row, Index col, const type::Mat3x3d &_M)
 
virtual void add (Index row, Index col, const type::Mat3x3f &_M)
 
virtual void add (Index row, Index col, const type::Mat2x2d &_M)
 
virtual void add (Index row, Index col, const type::Mat2x2f &_M)
 
virtual void add (Index row, Index col, const type::Mat6x6d &_M)
 
virtual void add (Index row, Index col, const type::Mat6x6f &_M)
 
virtual void clearRows (Index imin, Index imax)
 
virtual void clearCols (Index imin, Index imax)
 
virtual void clearRowsCols (Index imin, Index imax)
 
virtual void compress ()
 
virtual void opMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opMulV (float *result, const float *v) const
 
virtual void opMulV (double *result, const double *v) const
 
virtual void opPMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opPMulV (float *result, const float *v) const
 
virtual void opPMulV (double *result, const double *v) const
 
virtual void opMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opMulTV (float *result, const float *v) const
 
virtual void opMulTV (double *result, const double *v) const
 
virtual void opPMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opPMulTV (float *result, const float *v) const
 
virtual void opPMulTV (double *result, const double *v) const
 
virtual void opMulTM (BaseMatrix *result, BaseMatrix *m) const
 
virtual void opAddM (linearalgebra::BaseMatrix *m, double fact) const
 
virtual void opAddMT (linearalgebra::BaseMatrix *m, double fact) const
 
virtual ElementType getElementType () const
 
virtual std::size_t getElementSize () const
 
virtual MatrixCategory getCategory () const
 
virtual Index getBlockRows () const
 
virtual Index getBlockCols () const
 
virtual Index bRowSize () const
 
virtual Index bColSize () const
 
virtual Index getBandWidth () const
 
bool isDiagonal () const
 
bool isBlockDiagonal () const
 
bool isBand () const
 
bool isSparse () const
 
virtual BlockConstAccessor blocGet (Index i, Index j) const
 
virtual BlockAccessor blocGetW (Index i, Index j)
 
virtual BlockAccessor blocCreate (Index i, Index j)
 
const T * blocElements (Index i, Index j, T *buffer) const
 
void blocSet (Index i, Index j, const T *buffer)
 
void blocAdd (Index i, Index j, const T *buffer)
 
virtual ColBlockConstIterator bRowBegin (Index ib) const
 
virtual ColBlockConstIterator bRowEnd (Index ib) const
 
virtual std::pair< ColBlockConstIterator, ColBlockConstIteratorbRowRange (Index ib) const
 
virtual RowBlockConstIterator bRowsBegin () const
 
virtual RowBlockConstIterator bRowsEnd () const
 
virtual std::pair< RowBlockConstIterator, RowBlockConstIteratorbRowsRange () const
 
virtual void opMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opMulV (float *result, const float *v) const
 
virtual void opMulV (double *result, const double *v) const
 
virtual void opPMulV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opPMulV (float *result, const float *v) const
 
virtual void opPMulV (double *result, const double *v) const
 
virtual void opMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opMulTV (float *result, const float *v) const
 
virtual void opMulTV (double *result, const double *v) const
 
virtual void opPMulTV (linearalgebra::BaseVector *result, const linearalgebra::BaseVector *v) const
 
virtual void opPMulTV (float *result, const float *v) const
 
virtual void opPMulTV (double *result, const double *v) const
 
virtual void opMulTM (BaseMatrix *result, BaseMatrix *m) const
 
virtual void opAddM (linearalgebra::BaseMatrix *m, double fact) const
 
virtual void opAddMT (linearalgebra::BaseMatrix *m, double fact) const
 

Static Public Member Functions

static Index getSubMatrixDim (Index n)
 
static const char * Name ()
 

Friends

std::ostream & operator<< (std::ostream &out, const TNewMatMatrix &v)
 

Additional Inherited Members

- Protected Member Functions inherited from sofa::linearalgebra::BaseMatrix
virtual void bAccessorDelete (const InternalBlockAccessor *) const
 
virtual void bAccessorCopy (InternalBlockAccessor *) const
 
virtual SReal bAccessorElement (const InternalBlockAccessor *b, Index i, Index j) const
 
virtual void bAccessorSet (InternalBlockAccessor *b, Index i, Index j, double v)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, Index i, Index j, double v)
 
const T * bAccessorElementsDefaultImpl (const InternalBlockAccessor *b, T *buffer) const
 
virtual const float * bAccessorElements (const InternalBlockAccessor *b, float *buffer) const
 
virtual const double * bAccessorElements (const InternalBlockAccessor *b, double *buffer) const
 
virtual const int * bAccessorElements (const InternalBlockAccessor *b, int *buffer) const
 
void bAccessorSetDefaultImpl (InternalBlockAccessor *b, const T *buffer)
 
virtual void bAccessorSet (InternalBlockAccessor *b, const float *buffer)
 
virtual void bAccessorSet (InternalBlockAccessor *b, const double *buffer)
 
virtual void bAccessorSet (InternalBlockAccessor *b, const int *buffer)
 
void bAccessorAddDefaultImpl (InternalBlockAccessor *b, const T *buffer)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const float *buffer)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const double *buffer)
 
virtual void bAccessorAdd (InternalBlockAccessor *b, const int *buffer)
 
T * bAccessorPrepareAddDefaultImpl (InternalBlockAccessor *, T *buffer)
 
virtual float * bAccessorPrepareAdd (InternalBlockAccessor *b, float *buffer)
 
virtual double * bAccessorPrepareAdd (InternalBlockAccessor *b, double *buffer)
 
virtual int * bAccessorPrepareAdd (InternalBlockAccessor *b, int *buffer)
 
virtual void bAccessorFinishAdd (InternalBlockAccessor *b, const float *buffer)
 
virtual void bAccessorFinishAdd (InternalBlockAccessor *b, const double *buffer)
 
virtual void bAccessorFinishAdd (InternalBlockAccessor *b, const int *buffer)
 
BlockAccessor createBlockAccessor (Index row, Index col, void *internalPtr=nullptr)
 
BlockAccessor createBlockAccessor (Index row, Index col, Index internalData)
 
BlockConstAccessor createBlockConstAccessor (Index row, Index col, void *internalPtr=nullptr) const
 
BlockConstAccessor createBlockConstAccessor (Index row, Index col, Index internalData) const
 
void setMatrix (BlockAccessor *b)
 
void setMatrix (BlockConstAccessor *b) const
 
virtual void itCopyColBlock (InternalColBlockIterator *) const
 
virtual void itDeleteColBlock (const InternalColBlockIterator *) const
 
virtual void itAccessColBlock (InternalColBlockIterator *it, BlockConstAccessor *b) const
 
virtual void itIncColBlock (InternalColBlockIterator *it) const
 
virtual void itDecColBlock (InternalColBlockIterator *it) const
 
virtual bool itEqColBlock (const InternalColBlockIterator *it, const InternalColBlockIterator *it2) const
 
virtual bool itLessColBlock (const InternalColBlockIterator *it, const InternalColBlockIterator *it2) const
 
ColBlockConstIterator createColBlockConstIterator (Index row, void *internalPtr) const
 
ColBlockConstIterator createColBlockConstIterator (Index row, Index internalData) const
 
virtual void itCopyRowBlock (InternalRowBlockIterator *) const
 
virtual void itDeleteRowBlock (const InternalRowBlockIterator *) const
 
virtual Index itAccessRowBlock (InternalRowBlockIterator *it) const
 
virtual ColBlockConstIterator itBeginRowBlock (InternalRowBlockIterator *it) const
 
virtual ColBlockConstIterator itEndRowBlock (InternalRowBlockIterator *it) const
 
virtual std::pair< ColBlockConstIterator, ColBlockConstIteratoritRangeRowBlock (InternalRowBlockIterator *it) const
 
virtual void itIncRowBlock (InternalRowBlockIterator *it) const
 
virtual void itDecRowBlock (InternalRowBlockIterator *it) const
 
virtual bool itEqRowBlock (const InternalRowBlockIterator *it, const InternalRowBlockIterator *it2) const
 
virtual bool itLessRowBlock (const InternalRowBlockIterator *it, const InternalRowBlockIterator *it2) const
 
RowBlockConstIterator createRowBlockConstIterator (void *internalPtr) const
 
RowBlockConstIterator createRowBlockConstIterator (Index internalData0, Index internalData1) const
 
- Static Protected Member Functions inherited from sofa::linearalgebra::BaseMatrix
static InternalBlockAccessorgetInternal (BlockConstAccessor *b)
 
static const InternalBlockAccessorgetInternal (const BlockConstAccessor *b)
 
static InternalBlockAccessorgetInternal (BlockAccessor *b)
 
static const InternalBlockAccessorgetInternal (const BlockAccessor *b)
 
static InternalColBlockIteratorgetInternal (ColBlockConstIterator *b)
 
static const InternalColBlockIteratorgetInternal (const ColBlockConstIterator *b)
 
static InternalRowBlockIteratorgetInternal (RowBlockConstIterator *b)
 
static const InternalRowBlockIteratorgetInternal (const RowBlockConstIterator *b)
 

Attribute details

◆ bandWidth

template<class Mat >
Index sofa::component::linearsolver::TNewMatMatrix< Mat >::bandWidth

Constructor details

◆ TNewMatMatrix()

template<class Mat >
sofa::component::linearsolver::TNewMatMatrix< Mat >::TNewMatMatrix ( Index  defaultBandWidth = 11)
inlineexplicit

Function details

◆ add() [1/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricMatrix >::add ( Index  i,
Index  j,
double  v 
)
inlinevirtual

◆ add() [2/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::BandMatrix >::add ( Index  i,
Index  j,
double  v 
)
inlinevirtual

◆ add() [3/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricBandMatrix >::add ( Index  i,
Index  j,
double  v 
)
inlinevirtual

◆ add() [4/4]

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::add ( Index  i,
Index  j,
double  v 
)
inlineoverridevirtual

◆ asub()

template<class Mat >
NEWMAT::GetSubMatrix sofa::component::linearsolver::TNewMatMatrix< Mat >::asub ( Index  bi,
Index  bj,
Index  nrow,
Index  ncol 
)
inline

◆ clear() [1/2]

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::clear ( )
inlineoverridevirtual

◆ clear() [2/2]

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::clear ( Index  i,
Index  j 
)
inlineoverridevirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clearCol()

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::clearCol ( Index  j)
inlineoverridevirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clearRow()

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::clearRow ( Index  i)
inlineoverridevirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ clearRowCol()

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::clearRowCol ( Index  i)
inlineoverridevirtual

Reimplemented from sofa::linearalgebra::BaseMatrix.

◆ colSize()

template<class Mat >
Index sofa::component::linearsolver::TNewMatMatrix< Mat >::colSize ( void  ) const
inlineoverridevirtual

◆ element() [1/3]

SReal sofa::component::linearsolver::TNewMatMatrix< NEWMAT::BandMatrix >::element ( Index  i,
Index  j 
) const
inlinevirtual

◆ element() [2/3]

SReal sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricBandMatrix >::element ( Index  i,
Index  j 
) const
inlinevirtual

◆ element() [3/3]

template<class Mat >
SReal sofa::component::linearsolver::TNewMatMatrix< Mat >::element ( Index  i,
Index  j 
) const
inlineoverridevirtual

◆ getAlignedSubMatrix()

template<class Mat >
template<class T >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::getAlignedSubMatrix ( Index  bi,
Index  bj,
Index  nrow,
Index  ncol,
T &  m 
)
inline

◆ getSubMatrix()

template<class Mat >
template<class T >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::getSubMatrix ( Index  i,
Index  j,
Index  nrow,
Index  ncol,
T &  m 
)
inline

◆ getSubMatrixDim()

template<class Mat >
static Index sofa::component::linearsolver::TNewMatMatrix< Mat >::getSubMatrixDim ( Index  n)
inlinestatic

◆ makeLUSolver()

template<class Mat >
LUSolver* sofa::component::linearsolver::TNewMatMatrix< Mat >::makeLUSolver ( )
inline

◆ Name() [1/5]

template<class Mat >
static const char* sofa::component::linearsolver::TNewMatMatrix< Mat >::Name ( )
static

◆ Name() [2/5]

const char * sofa::component::linearsolver::TNewMatMatrix< NEWMAT::Matrix >::Name ( )
inline

◆ Name() [3/5]

const char * sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricMatrix >::Name ( )
inline

◆ Name() [4/5]

const char * sofa::component::linearsolver::TNewMatMatrix< NEWMAT::BandMatrix >::Name ( )
inline

◆ Name() [5/5]

const char * sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricBandMatrix >::Name ( )
inline

◆ operator=()

template<class Mat >
template<class T >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::operator= ( const T &  m)
inline

◆ resize() [1/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricMatrix >::resize ( Index  nbRow,
Index  nbCol 
)
inlinevirtual

◆ resize() [2/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::BandMatrix >::resize ( Index  nbRow,
Index  nbCol 
)
inlinevirtual

◆ resize() [3/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricBandMatrix >::resize ( Index  nbRow,
Index  nbCol 
)
inlinevirtual

◆ resize() [4/4]

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::resize ( Index  nbRow,
Index  nbCol 
)
inlineoverridevirtual

◆ rowSize()

template<class Mat >
Index sofa::component::linearsolver::TNewMatMatrix< Mat >::rowSize ( void  ) const
inlineoverridevirtual

◆ set() [1/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricMatrix >::set ( Index  i,
Index  j,
double  v 
)
inlinevirtual

◆ set() [2/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::BandMatrix >::set ( Index  i,
Index  j,
double  v 
)
inlinevirtual

◆ set() [3/4]

void sofa::component::linearsolver::TNewMatMatrix< NEWMAT::SymmetricBandMatrix >::set ( Index  i,
Index  j,
double  v 
)
inlinevirtual

◆ set() [4/4]

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::set ( Index  i,
Index  j,
double  v 
)
inlineoverridevirtual

◆ setAlignedSubMatrix()

template<class Mat >
template<class T >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::setAlignedSubMatrix ( Index  bi,
Index  bj,
Index  nrow,
Index  ncol,
const T &  m 
)
inline

◆ setSubMatrix()

template<class Mat >
template<class T >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::setSubMatrix ( Index  i,
Index  j,
Index  nrow,
Index  ncol,
const T &  m 
)
inline

◆ solve() [1/3]

template<class Mat >
virtual void sofa::component::linearsolver::TNewMatMatrix< Mat >::solve ( linearalgebra::BaseVector op,
linearalgebra::BaseVector res 
)
inlinevirtual

◆ solve() [2/3]

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::solve ( NewMatVector rv,
NewMatVector ov 
)
inline

◆ solve() [3/3]

template<class Mat >
void sofa::component::linearsolver::TNewMatMatrix< Mat >::solve ( NewMatVector rv,
NewMatVector ov,
LUSolver solver 
)
inline

◆ sub()

template<class Mat >
NEWMAT::GetSubMatrix sofa::component::linearsolver::TNewMatMatrix< Mat >::sub ( Index  i,
Index  j,
Index  nrow,
Index  ncol 
)
inline

Related details

◆ operator<<

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