SOFA API  56988ca1
Open source framework for multi-physics simuation
sofa::type::MatNoInit< L, C, real > Class Template Reference

#include <Mat.h>

Same as Mat except the values are not initialized by default. More...

Inheritance diagram for sofa::type::MatNoInit< L, C, real >:

Detailed Description

template<sofa::Size L, sofa::Size C, typename real>
class sofa::type::MatNoInit< L, C, real >

Same as Mat except the values are not initialized by default.

Public Member Functions

constexpr MatNoInit () noexcept
 
constexpr void operator= (const real *p) noexcept
 Assignment from an array of elements (stored per line). More...
 
template<sofa::Size L2, sofa::Size C2, typename real2 >
constexpr void operator= (const Mat< L2, C2, real2 > &m) noexcept
 Assignment from another matrix. More...
 
- Public Member Functions inherited from sofa::type::Mat< L, C, real >
constexpr Mat () noexcept=default
 
constexpr Mat (NoInit) noexcept
 
template<sofa::Size TL = L, sofa::Size TC = C, typename = std::enable_if_t<(TL == 1 && TC != 1) || (TC == 1 && TL != 1)>>
constexpr Mat (std::initializer_list< Real > &&scalars) noexcept
 
constexpr Mat (std::initializer_list< std::initializer_list< Real >> &&rows) noexcept
 
template<typename... ArgsT, typename = std::enable_if_t< (std::is_convertible_v<ArgsT, Line> && ...) >, typename = std::enable_if_t< (sizeof...(ArgsT) == L && sizeof...(ArgsT) > 1) >>
constexpr Mat (ArgsT &&... r) noexcept
 
constexpr Mat (const real &v) noexcept
 Constructor from an element. More...
 
template<typename real2 >
constexpr Mat (const Mat< L, C, real2 > &m) noexcept
 Constructor from another matrix. More...
 
template<Size L2, Size C2, typename real2 >
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...
 
template<typename real2 >
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...
 
template<typename real2 >
constexpr void operator= (const Mat< L, C, real2 > &m) noexcept
 Assignment from another matrix. More...
 
template<Size L2, Size C2>
constexpr void operator= (const Mat< L2, C2, real > &m) noexcept
 Assignment from a matrix of different size. More...
 
template<Size L2, Size C2>
constexpr void getsub (Size L0, Size C0, Mat< L2, C2, real > &m) const noexcept
 
template<Size C2>
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
 
template<Size L2, Size C2>
constexpr void setsub (Size L0, Size C0, const Mat< L2, C2, real > &m) noexcept
 
template<Size L2>
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 real & operator() (Size i, Size j) noexcept
 Write access to element (i,j). More...
 
constexpr const real & operator() (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 real * ptr () const noexcept
 Cast into a standard C array of elements (stored per line) (read-only). More...
 
constexpr real * ptr () noexcept
 Cast into a standard C array of elements (stored per line). More...
 
template<sofa::Size NbLine = L, typename = std::enable_if_t<NbLine >= 1>
constexpr Linex () noexcept
 Special access to first line. More...
 
template<sofa::Size NbLine = L, typename = std::enable_if_t<NbLine >= 2>
constexpr Liney () noexcept
 Special access to second line. More...
 
template<sofa::Size NbLine = L, typename = std::enable_if_t<NbLine >= 3>
constexpr Linez () noexcept
 Special access to third line. More...
 
template<sofa::Size NbLine = L, typename = std::enable_if_t<NbLine >= 4>
constexpr Linew () noexcept
 Special access to fourth line. More...
 
template<sofa::Size NbLine = L, typename = std::enable_if_t<NbLine >= 1>
constexpr const Linex () const noexcept
 Special access to first line (read-only). More...
 
template<sofa::Size NbLine = L, typename = std::enable_if_t<NbLine >= 2>
constexpr const Liney () const noexcept
 Special access to second line (read-only). More...
 
template<sofa::Size NbLine = L, typename = std::enable_if_t<NbLine >= 3>
constexpr const Linez () const noexcept
 Special access to thrid line (read-only). More...
 
template<sofa::Size NbLine = L, typename = std::enable_if_t<NbLine >= 4>
constexpr const Linew () const noexcept
 Special access to fourth line (read-only). More...
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == 1 && NbColumn == 1>>
constexpr real toReal () const
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == 1 && NbColumn == 1>>
constexpr operator real () const
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
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 Mat< C, L, real > transposed () const noexcept
 Return the transpose of m. More...
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
constexpr void transpose () noexcept
 Transpose the square matrix. More...
 
constexpr Mat< L, C, real > operator+ (const Mat< L, C, real > &m) const noexcept
 Matrix addition operator. More...
 
constexpr Mat< L, C, real > operator- (const Mat< L, C, real > &m) const noexcept
 Matrix subtraction operator. More...
 
constexpr Mat< L, C, real > operator- () const noexcept
 Matrix negation operator. More...
 
constexpr Col operator* (const Line &v) const noexcept
 Multiplication operator Matrix * Line. More...
 
constexpr Mat< L, C, real > multDiagonal (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...
 
template<Size P>
constexpr Mat< C, P, real > multTranspose (const Mat< L, P, real > &m) const noexcept
 
template<Size P>
constexpr Mat< L, P, real > multTransposed (const Mat< P, C, real > &m) const noexcept
 Multiplication with the transposed of the given matrix operator. More...
 
constexpr Mat< L, C, real > plusTransposed (const Mat< C, L, real > &m) const noexcept
 Addition with the transposed of the given matrix operator. More...
 
constexpr Mat< L, C, real > minusTransposed (const Mat< C, L, real > &m) const noexcept
 Substraction with the transposed of the given matrix operator. More...
 
constexpr Mat< L, C, real > operator* (real f) const noexcept
 Scalar multiplication operator. More...
 
constexpr Mat< L, C, real > operator/ (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...
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
constexpr Mat< L, C, real > inverted () const
 invert this More...
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
constexpr bool invert (const Mat< L, C, real > &m)
 Invert square matrix m. More...
 
constexpr bool isTransform () const
 
constexpr Vec< C-1, real > transform (const Vec< C-1, real > &v) const noexcept
 Multiplication operator Matrix * Vector considering the matrix as a transformation. More...
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
constexpr bool transformInvert (const Mat< L, C, real > &m)
 Invert transformation matrix m. More...
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
constexpr void symmetrize () noexcept
 
constexpr const real * data () 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< L, C, real >
ArrayLineType elems {}
 
- Static Public Attributes inherited from sofa::type::Mat< L, C, real >
static constexpr sofa::Size N = L * C
 
static constexpr Size nbLines = L
 
static constexpr Size nbCols = C
 
static constexpr sofa::Size static_size = L
 
static constexpr sofa::Size total_size = L
 
static const Mat< L, L, real > & s_identity = Mat<L, L, real>::Identity()
 precomputed identity matrix of size (L,L) More...
 
- Static Public Member Functions inherited from sofa::type::Mat< L, C, real >
static constexpr sofa::Size size ()
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
static const Mat< L, L, real > & Identity () noexcept
 Returns the identity matrix. More...
 
template<Size S>
static bool canSelfTranspose (const Mat< S, S, real > &lhs, const Mat< S, S, real > &rhs) noexcept
 
template<Size I, Size J>
static bool canSelfTranspose (const Mat< I, J, real > &, const Mat< J, I, real > &) noexcept
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
static Mat< L, C, real > transformTranslation (const Vec< C-1, real > &t) noexcept
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
static Mat< L, C, real > transformScale (real s) noexcept
 
template<sofa::Size NbLine = L, sofa::Size NbColumn = C, typename = std::enable_if_t<NbLine == NbColumn>>
static Mat< L, C, real > transformScale (const Vec< C-1, real > &s) noexcept
 
template<class Quat >
static Mat< L, C, real > transformRotation (const Quat &q) noexcept
 

Constructor details

◆ MatNoInit()

template<sofa::Size L, sofa::Size C, typename real >
constexpr sofa::type::MatNoInit< L, C, real >::MatNoInit ( )
inlineconstexprnoexcept

Function details

◆ operator=() [1/2]

template<sofa::Size L, sofa::Size C, typename real >
template<sofa::Size L2, sofa::Size C2, typename real2 >
constexpr void sofa::type::MatNoInit< L, C, real >::operator= ( const Mat< L2, C2, real2 > &  m)
inlineconstexprnoexcept

Assignment from another matrix.

◆ operator=() [2/2]

template<sofa::Size L, sofa::Size C, typename real >
constexpr void sofa::type::MatNoInit< L, C, real >::operator= ( const real *  p)
inlineconstexprnoexcept

Assignment from an array of elements (stored per line).