SOFA API  7352f41a
Open source framework for multi-physics simuation
sofa::linearalgebra::BlockFullMatrix< N, T >::Block Class Reference

#include <BlockFullMatrix.h>

Inheritance diagram for sofa::linearalgebra::BlockFullMatrix< N, T >::Block:

Public Member Functions

Index Nrows () const
 
Index Ncols () const
 
void resize (Index, Index)
 
const T & element (Index i, Index j) const
 
void set (Index i, Index j, const T &v)
 
void add (Index i, Index j, const T &v)
 
void operator= (const type::Mat< BSIZE, BSIZE, Real > &v)
 
type::Mat< BSIZE, BSIZE, Realoperator- () const
 
type::Mat< BSIZE, BSIZE, Realoperator- (const type::Mat< BSIZE, BSIZE, Real > &m) const
 
type::Vec< BSIZE, Realoperator* (const type::Vec< BSIZE, Real > &v)
 
type::Mat< BSIZE, BSIZE, Realoperator* (const type::Mat< BSIZE, BSIZE, Real > &m)
 
type::Mat< BSIZE, BSIZE, Realoperator* (const Block &m)
 
type::Mat< BSIZE, BSIZE, Realoperator* (const TransposedBlock &mt)
 
TransposedBlock t () const
 
Block i () const
 
- Public Member Functions inherited from sofa::type::Mat< BSIZE, BSIZE, Real >
constexpr Mat () noexcept=default
 
constexpr Mat (NoInit) noexcept
 
constexpr Mat (std::initializer_list< Real > &&scalars) noexcept
 
constexpr Mat (std::initializer_list< std::initializer_list< Real >> &&rows) noexcept
 
constexpr Mat (ArgsT &&... r) noexcept
 
constexpr Mat (const Real &v) noexcept
 Constructor from an element. More...
 
constexpr Mat (const Mat< L, C, real2 > &m) noexcept
 Constructor from another matrix. More...
 
constexpr Mat (const Mat< L2, C2, real2 > &m) noexcept
 Constructor from another matrix with different size (with null default entries and ignoring outside entries) More...
 
constexpr Mat (const real2 *p) noexcept
 Constructor from an array of elements (stored per line). More...
 
constexpr Size getNbLines () const
 number of lines More...
 
constexpr Size getNbCols () const
 number of colums More...
 
constexpr void operator= (const Real *p) noexcept
 Assignment from an array of elements (stored per line). More...
 
constexpr void operator= (const Mat< L, C, real2 > &m) noexcept
 Assignment from another matrix. More...
 
constexpr void operator= (const Mat< L2, C2, Real > &m) noexcept
 Assignment from a matrix of different size. More...
 
constexpr void getsub (Size L0, Size C0, Mat< L2, C2, Real > &m) const noexcept
 
constexpr void getsub (const Size L0, const Size C0, Vec< C2, Real > &m) const noexcept
 
constexpr void getsub (Size L0, Size C0, Real &m) const noexcept
 
constexpr void setsub (Size L0, Size C0, const Mat< L2, C2, Real > &m) noexcept
 
constexpr void setsub (Size L0, Size C0, const Vec< L2, Real > &v) noexcept
 
constexpr void clear () noexcept
 Sets each element to 0. More...
 
constexpr void fill (Real r) noexcept
 Sets each element to r. More...
 
constexpr const Lineline (Size i) const noexcept
 Read-only access to line i. More...
 
constexpr Col col (Size j) const noexcept
 Copy of column j. More...
 
constexpr LineNoInitoperator[] (Size i) noexcept
 Write acess to line i. More...
 
constexpr const LineNoInitoperator[] (Size i) const noexcept
 Read-only access to line i. More...
 
constexpr LineNoInitoperator() (Size i) noexcept
 Write acess to line i. More...
 
constexpr const LineNoInitoperator() (Size i) const noexcept
 Read-only access to line i. More...
 
constexpr Realoperator() (Size i, Size j) noexcept
 Write access to element (i,j). More...
 
constexpr const Realoperator() (Size i, Size j) const noexcept
 Read-only access to element (i,j). More...
 
constexpr const Linelptr () const noexcept
 Cast into a standard C array of lines (read-only). More...
 
constexpr Linelptr () noexcept
 Cast into a standard C array of lines. More...
 
constexpr const Realptr () const noexcept
 Cast into a standard C array of elements (stored per line) (read-only). More...
 
constexpr Realptr () noexcept
 Cast into a standard C array of elements (stored per line). More...
 
constexpr Linex () noexcept
 Special access to first line. More...
 
constexpr const Linex () const noexcept
 Special access to first line (read-only). More...
 
constexpr Liney () noexcept
 Special access to second line. More...
 
constexpr const Liney () const noexcept
 Special access to second line (read-only). More...
 
constexpr Linez () noexcept
 Special access to third line. More...
 
constexpr const Linez () const noexcept
 Special access to thrid line (read-only). More...
 
constexpr Linew () noexcept
 Special access to fourth line. More...
 
constexpr const Linew () const noexcept
 Special access to fourth line (read-only). More...
 
constexpr Real toReal () const
 
constexpr operator Real () const
 
constexpr void identity () noexcept
 Set matrix to identity. More...
 
constexpr void transpose (const Mat< C, L, Real > &m) noexcept
 Set matrix as the transpose of m. More...
 
constexpr void transpose () noexcept
 Transpose the square matrix. More...
 
constexpr Mat< C, L, Realtransposed () const noexcept
 Return the transpose of m. More...
 
constexpr Mat< L, C, Realoperator+ (const Mat< L, C, Real > &m) const noexcept
 Matrix addition operator. More...
 
constexpr Mat< L, C, Realoperator- (const Mat< L, C, Real > &m) const noexcept
 Matrix subtraction operator. More...
 
constexpr Mat< L, C, Realoperator- () const noexcept
 Matrix negation operator. More...
 
constexpr Col operator* (const Line &v) const noexcept
 Multiplication operator Matrix * Line. More...
 
constexpr Mat< L, C, Realoperator* (Real f) const noexcept
 Scalar multiplication operator. More...
 
constexpr Mat< L, C, RealmultDiagonal (const Line &d) const noexcept
 Multiplication with a diagonal Matrix CxC represented as a vector of size C. More...
 
constexpr Line multTranspose (const Col &v) const noexcept
 Multiplication of the transposed Matrix * Column. More...
 
constexpr Mat< C, P, RealmultTranspose (const Mat< L, P, Real > &m) const noexcept
 
constexpr Mat< L, P, RealmultTransposed (const Mat< P, C, Real > &m) const noexcept
 Multiplication with the transposed of the given matrix operator. More...
 
constexpr Mat< L, C, RealplusTransposed (const Mat< C, L, Real > &m) const noexcept
 Addition with the transposed of the given matrix operator. More...
 
constexpr Mat< L, C, RealminusTransposed (const Mat< C, L, Real > &m) const noexcept
 Substraction with the transposed of the given matrix operator. More...
 
constexpr Mat< L, C, Realoperator/ (Real f) const
 Scalar division operator. More...
 
constexpr void operator*= (Real r) noexcept
 Scalar multiplication assignment operator. More...
 
constexpr void operator/= (Real r)
 Scalar division assignment operator. More...
 
constexpr void operator+= (const Mat< L, C, Real > &m) noexcept
 Addition assignment operator. More...
 
constexpr void addTransposed (const Mat< C, L, Real > &m) noexcept
 Addition of the transposed of m. More...
 
constexpr void subTransposed (const Mat< C, L, Real > &m) noexcept
 Substraction of the transposed of m. More...
 
constexpr void operator-= (const Mat< L, C, Real > &m) noexcept
 Substraction assignment operator. More...
 
constexpr Mat< L, C, Realinverted () const
 invert this More...
 
constexpr bool invert (const Mat< L, C, Real > &m)
 Invert square matrix m. More...
 
constexpr bool isTransform () const
 
constexpr Vec< C-1, Realtransform (const Vec< C-1, Real > &v) const noexcept
 Multiplication operator Matrix * Vector considering the matrix as a transformation. More...
 
constexpr bool transformInvert (const Mat< L, C, Real > &m)
 Invert transformation matrix m. More...
 
constexpr void symmetrize () noexcept
 
constexpr const Realdata () const noexcept
 
constexpr ArrayLineType::iterator begin () noexcept
 
constexpr ArrayLineType::const_iterator begin () const noexcept
 
constexpr ArrayLineType::iterator end () noexcept
 
constexpr ArrayLineType::const_iterator end () const noexcept
 
constexpr reference front ()
 
constexpr const_reference front () const
 
constexpr reference back ()
 
constexpr const_reference back () const
 
constexpr bool operator== (const Mat< L, C, Real > &b) const noexcept
 
constexpr bool operator!= (const Mat< L, C, Real > &b) const noexcept
 
bool isSymmetric () const
 
bool isDiagonal () const noexcept
 

Additional Inherited Members

- Public Attributes inherited from sofa::type::Mat< BSIZE, BSIZE, Real >
ArrayLineType elems
 
- Static Public Attributes inherited from sofa::type::Mat< BSIZE, BSIZE, Real >
static constexpr sofa::Size N
 
static constexpr Size nbLines
 
static constexpr Size nbCols
 
static constexpr sofa::Size static_size
 
static constexpr sofa::Size total_size
 
- Static Public Member Functions inherited from sofa::type::Mat< BSIZE, BSIZE, Real >
static constexpr sofa::Size size ()
 
static const Mat< L, L, Real > & Identity () noexcept
 Returns the identity matrix. More...
 
static bool canSelfTranspose (const Mat< S, S, Real > &lhs, const Mat< S, S, Real > &rhs) noexcept
 
static bool canSelfTranspose (const Mat< I, J, Real > &, const Mat< J, I, Real > &) noexcept
 
static Mat< L, C, RealtransformTranslation (const Vec< C-1, Real > &t) noexcept
 
static Mat< L, C, RealtransformScale (Real s) noexcept
 
static Mat< L, C, RealtransformScale (const Vec< C-1, Real > &s) noexcept
 
static Mat< L, C, RealtransformRotation (const Quat &q) noexcept
 

Function details

◆ add()

template<std::size_t N, typename T >
void sofa::linearalgebra::BlockFullMatrix< N, T >::Block::add ( Index  i,
Index  j,
const T &  v 
)

◆ element()

template<std::size_t N, typename T >
const T & sofa::linearalgebra::BlockFullMatrix< N, T >::Block::element ( Index  i,
Index  j 
) const

◆ i()

template<std::size_t N, typename T >
BlockFullMatrix< N, T >::Block sofa::linearalgebra::BlockFullMatrix< N, T >::Block::i

◆ Ncols()

template<std::size_t N, typename T >
BlockFullMatrix< N, T >::Index sofa::linearalgebra::BlockFullMatrix< N, T >::Block::Ncols

◆ Nrows()

template<std::size_t N, typename T >
BlockFullMatrix< N, T >::Index sofa::linearalgebra::BlockFullMatrix< N, T >::Block::Nrows

◆ operator*() [1/4]

template<std::size_t N, typename T >
type::Mat<BSIZE,BSIZE,Real> sofa::linearalgebra::BlockFullMatrix< N, T >::Block::operator* ( const Block m)
inline

◆ operator*() [2/4]

template<std::size_t N, typename T >
type::Mat<BSIZE,BSIZE,Real> sofa::linearalgebra::BlockFullMatrix< N, T >::Block::operator* ( const TransposedBlock mt)
inline

◆ operator*() [3/4]

template<std::size_t N, typename T >
type::Mat<BSIZE,BSIZE,Real> sofa::linearalgebra::BlockFullMatrix< N, T >::Block::operator* ( const type::Mat< BSIZE, BSIZE, Real > &  m)
inline

◆ operator*() [4/4]

template<std::size_t N, typename T >
type::Vec<BSIZE,Real> sofa::linearalgebra::BlockFullMatrix< N, T >::Block::operator* ( const type::Vec< BSIZE, Real > &  v)
inline

◆ operator-() [1/2]

template<std::size_t N, typename T >
type::Mat<BSIZE,BSIZE,Real> sofa::linearalgebra::BlockFullMatrix< N, T >::Block::operator- ( ) const
inline

◆ operator-() [2/2]

template<std::size_t N, typename T >
type::Mat<BSIZE,BSIZE,Real> sofa::linearalgebra::BlockFullMatrix< N, T >::Block::operator- ( const type::Mat< BSIZE, BSIZE, Real > &  m) const
inline

◆ operator=()

template<std::size_t N, typename T >
void sofa::linearalgebra::BlockFullMatrix< N, T >::Block::operator= ( const type::Mat< BSIZE, BSIZE, Real > &  v)
inline

◆ resize()

template<std::size_t N, typename T >
void sofa::linearalgebra::BlockFullMatrix< N, T >::Block::resize ( Index  ,
Index   
)

◆ set()

template<std::size_t N, typename T >
void sofa::linearalgebra::BlockFullMatrix< N, T >::Block::set ( Index  i,
Index  j,
const T &  v 
)

◆ t()

template<std::size_t N, typename T >
BlockFullMatrix< N, T >::TransposedBlock sofa::linearalgebra::BlockFullMatrix< N, T >::Block::t