SOFA API  6a688117
Open source framework for multi-physics simuation
sofa::defaulttype::MatSym< D, real > Class Template Reference

#include <MatSym.h>

Inheritance diagram for sofa::defaulttype::MatSym< D, real >:

Public Member Functions

 MatSym ()
 
 MatSym (NoInit)
 
 MatSym (const real &v1, const real &v2, const real &v3, const real &v4, const real &v5, const real &v6)
 Constructor from 6 elements. More...
 
 MatSym (const int sizeM, const real &v)
 Constructor from an element. More...
 
template<typename real2 >
 MatSym (const MatSym< D, real2 > &m)
 Constructor from another matrix. More...
 
template<typename real2 >
void operator= (const MatSym< D, real2 > &m)
 Assignment from another matrix. More...
 
void clear ()
 Sets each element to 0. More...
 
void fill (real r)
 Sets each element to r. More...
 
real & operator() (int i, int j)
 Write access to element (i,j). More...
 
const real & operator() (int i, int j) const
 Read-only access to element (i,j). More...
 
void Mat2Sym (const Mat< D, D, real > &M, MatSym< D, real > &W)
 
Vec< D *(D+1)/2,real > getVoigt ()
 
void identity ()
 Set matrix to identity. More...
 
Mat< D, D, real > SymSymMultiply (const MatSym< D, real > &m) const
 Matrix multiplication operator: product of two symmetric matrices. More...
 
Mat< D, D, real > SymMatMultiply (const Mat< D, D, real > &m) const
 
Mat< D, D, real > MatSymMultiply (const Mat< D, D, real > &m) const
 
MatSym< D, real > operator+ (const MatSym< D, real > &m) const
 Matrix addition operator with a symmetric matrix. More...
 
Mat< D, D, real > operator+ (const Mat< D, D, real > &m) const
 Matrix addition operator with a non-symmetric matrix. More...
 
MatSym< D, real > operator- (const MatSym< D, real > &m) const
 Matrix substractor operator with a symmetric matrix. More...
 
Mat< D, D, real > operator- (const Mat< D, D, real > &m) const
 Matrix substractor operator with a non-symmetric matrix. More...
 
Coord operator* (const Coord &v) const
 Multiplication operator Matrix * Vector. More...
 
MatSym< D, real > operator* (real f) const
 Scalar multiplication operator. More...
 
MatSym< D, real > operator/ (real f) const
 Scalar division operator. More...
 
void operator*= (real r)
 Scalar multiplication assignment operator. More...
 
void operator/= (real r)
 Scalar division assignment operator. More...
 
void operator+= (const MatSym< D, real > &m)
 Addition assignment operator. More...
 
void operator-= (const MatSym< D, real > &m)
 Substraction assignment operator. More...
 
bool invert (const MatSym< D, real > &m)
 Invert matrix m. More...
 
Tests operators
bool operator== (const MatSym< D, real > &b) const
 
bool operator!= (const MatSym< D, real > &b) const
 

Friends

MatSym< D, real > operator* (real r, const MatSym< D, real > &m)
 Scalar matrix multiplication operator. More...
 

Constructor details

template<int D, class real = float>
sofa::defaulttype::MatSym< D, real >::MatSym ( )
inline
template<int D, class real = float>
sofa::defaulttype::MatSym< D, real >::MatSym ( NoInit  )
inlineexplicit
template<int D, class real = float>
sofa::defaulttype::MatSym< D, real >::MatSym ( const real &  v1,
const real &  v2,
const real &  v3,
const real &  v4,
const real &  v5,
const real &  v6 
)
inlineexplicit

Constructor from 6 elements.

template<int D, class real = float>
sofa::defaulttype::MatSym< D, real >::MatSym ( const int  sizeM,
const real &  v 
)
inlineexplicit

Constructor from an element.

template<int D, class real = float>
template<typename real2 >
sofa::defaulttype::MatSym< D, real >::MatSym ( const MatSym< D, real2 > &  m)
inline

Constructor from another matrix.

Function details

template<int D, class real = float>
void sofa::defaulttype::MatSym< D, real >::clear ( )
inline

Sets each element to 0.

template<int D, class real = float>
void sofa::defaulttype::MatSym< D, real >::fill ( real  r)
inline

Sets each element to r.

template<int D, class real = float>
Vec<D*(D+1)/2 ,real> sofa::defaulttype::MatSym< D, real >::getVoigt ( )
inline
template<int D, class real = float>
void sofa::defaulttype::MatSym< D, real >::identity ( )
inline

Set matrix to identity.

template<int D, class real = float>
bool sofa::defaulttype::MatSym< D, real >::invert ( const MatSym< D, real > &  m)
inline

Invert matrix m.

template<int D, class real = float>
void sofa::defaulttype::MatSym< D, real >::Mat2Sym ( const Mat< D, D, real > &  M,
MatSym< D, real > &  W 
)
inline
template<int D, class real = float>
Mat<D,D,real> sofa::defaulttype::MatSym< D, real >::MatSymMultiply ( const Mat< D, D, real > &  m) const
inline
template<int D, class real = float>
bool sofa::defaulttype::MatSym< D, real >::operator!= ( const MatSym< D, real > &  b) const
inline
template<int D, class real = float>
real& sofa::defaulttype::MatSym< D, real >::operator() ( int  i,
int  j 
)
inline

Write access to element (i,j).

template<int D, class real = float>
const real& sofa::defaulttype::MatSym< D, real >::operator() ( int  i,
int  j 
) const
inline

Read-only access to element (i,j).

template<int D, class real = float>
Coord sofa::defaulttype::MatSym< D, real >::operator* ( const Coord v) const
inline

Multiplication operator Matrix * Vector.

template<int D, class real = float>
MatSym<D,real> sofa::defaulttype::MatSym< D, real >::operator* ( real  f) const
inline

Scalar multiplication operator.

template<int D, class real = float>
void sofa::defaulttype::MatSym< D, real >::operator*= ( real  r)
inline

Scalar multiplication assignment operator.

template<int D, class real = float>
MatSym< D,real> sofa::defaulttype::MatSym< D, real >::operator+ ( const MatSym< D, real > &  m) const
inline

Matrix addition operator with a symmetric matrix.

template<int D, class real = float>
Mat<D,D,real> sofa::defaulttype::MatSym< D, real >::operator+ ( const Mat< D, D, real > &  m) const
inline

Matrix addition operator with a non-symmetric matrix.

template<int D, class real = float>
void sofa::defaulttype::MatSym< D, real >::operator+= ( const MatSym< D, real > &  m)
inline

Addition assignment operator.

template<int D, class real = float>
MatSym< D,real> sofa::defaulttype::MatSym< D, real >::operator- ( const MatSym< D, real > &  m) const
inline

Matrix substractor operator with a symmetric matrix.

template<int D, class real = float>
Mat<D,D,real> sofa::defaulttype::MatSym< D, real >::operator- ( const Mat< D, D, real > &  m) const
inline

Matrix substractor operator with a non-symmetric matrix.

template<int D, class real = float>
void sofa::defaulttype::MatSym< D, real >::operator-= ( const MatSym< D, real > &  m)
inline

Substraction assignment operator.

template<int D, class real = float>
MatSym< D,real> sofa::defaulttype::MatSym< D, real >::operator/ ( real  f) const
inline

Scalar division operator.

template<int D, class real = float>
void sofa::defaulttype::MatSym< D, real >::operator/= ( real  r)
inline

Scalar division assignment operator.

template<int D, class real = float>
template<typename real2 >
void sofa::defaulttype::MatSym< D, real >::operator= ( const MatSym< D, real2 > &  m)
inline

Assignment from another matrix.

template<int D, class real = float>
bool sofa::defaulttype::MatSym< D, real >::operator== ( const MatSym< D, real > &  b) const
inline
template<int D, class real = float>
Mat<D,D,real> sofa::defaulttype::MatSym< D, real >::SymMatMultiply ( const Mat< D, D, real > &  m) const
inline
template<int D, class real = float>
Mat<D,D,real> sofa::defaulttype::MatSym< D, real >::SymSymMultiply ( const MatSym< D, real > &  m) const
inline

Matrix multiplication operator: product of two symmetric matrices.

Related details

template<int D, class real = float>
MatSym<D,real> operator* ( real  r,
const MatSym< D, real > &  m 
)
friend

Scalar matrix multiplication operator.