Open CASCADE Technology Reference Manual 8.0.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions
NCollection_Mat3< Element_t > Class Template Reference

3x3 Matrix class. Warning, empty constructor returns an identity matrix. More...

#include <NCollection_Mat3.hxx>

Public Member Functions

constexpr NCollection_Mat3 ()
 Empty constructor for identity matrix.
 
template<typename OtherElement_t >
constexpr NCollection_Mat3 (const NCollection_Mat3< OtherElement_t > &theOtherMat3) noexcept
 Conversion constructor (explicitly converts some 3x3 matrix with other element type to a new 3x3 matrix with the element type Element_t, whose elements are static_cast'ed corresponding elements of theOtherMat3 matrix)
 
constexpr Element_t GetValue (const size_t theRow, const size_t theCol) const noexcept
 Get element at the specified row and column.
 
constexpr Element_tChangeValue (const size_t theRow, const size_t theCol) noexcept
 Access element at the specified row and column.
 
constexpr void SetValue (const size_t theRow, const size_t theCol, const Element_t theValue) noexcept
 Set value for the element specified by row and columns.
 
constexpr Element_toperator() (const size_t theRow, const size_t theCol) noexcept
 Return value.
 
constexpr Element_t operator() (const size_t theRow, const size_t theCol) const noexcept
 Return value.
 
constexpr NCollection_Vec3< Element_tGetRow (const size_t theRow) const noexcept
 Return the row.
 
constexpr void SetRow (const size_t theRow, const NCollection_Vec3< Element_t > &theVec) noexcept
 Change first 3 row values by the passed vector.
 
constexpr NCollection_Vec3< Element_tGetColumn (const size_t theCol) const noexcept
 Return the column.
 
constexpr void SetColumn (const size_t theCol, const NCollection_Vec3< Element_t > &theVec) noexcept
 Change first 3 column values by the passed vector.
 
constexpr NCollection_Vec3< Element_tGetDiagonal () const noexcept
 Get vector of diagonal elements.
 
constexpr void SetDiagonal (const NCollection_Vec3< Element_t > &theVec) noexcept
 Change first 3 elements of the diagonal matrix.
 
constexpr void InitZero () noexcept
 Initialize the zero matrix.
 
constexpr bool IsZero () const noexcept
 Checks the matrix for zero (without tolerance).
 
constexpr void InitIdentity () noexcept
 Initialize the identity matrix.
 
constexpr bool IsIdentity () const noexcept
 Checks the matrix for identity (without tolerance).
 
constexpr bool IsEqual (const NCollection_Mat3 &theOther) const noexcept
 Check this matrix for equality with another matrix (without tolerance!).
 
constexpr bool operator== (const NCollection_Mat3 &theMat) const noexcept
 Comparison operator.
 
constexpr bool operator!= (const NCollection_Mat3 &theOther) const noexcept
 Check this vector with another vector for non-equality (without tolerance!).
 
constexpr const Element_tGetData () const noexcept
 Raw access to the data (for OpenGL exchange). the data is returned in column-major order.
 
constexpr Element_tChangeData () noexcept
 
constexpr NCollection_Vec3< Element_toperator* (const NCollection_Vec3< Element_t > &theVec) const noexcept
 Multiply by the vector (M * V).
 
constexpr void Multiply (const NCollection_Mat3 &theMat) noexcept
 Compute matrix multiplication.
 
constexpr NCollection_Mat3operator*= (const NCollection_Mat3 &theMat) noexcept
 Multiply by the another matrix.
 
constexpr NCollection_Mat3 operator* (const NCollection_Mat3 &theMat) const noexcept
 Compute matrix multiplication product.
 
constexpr NCollection_Mat3 Multiplied (const NCollection_Mat3 &theMat) const noexcept
 Compute matrix multiplication product.
 
constexpr void Multiply (const Element_t theFactor) noexcept
 Compute per-component multiplication.
 
constexpr NCollection_Mat3operator*= (const Element_t theFactor) noexcept
 Compute per-element multiplication.
 
constexpr NCollection_Mat3 operator* (const Element_t theFactor) const noexcept
 Compute per-element multiplication.
 
constexpr NCollection_Mat3 Multiplied (const Element_t theFactor) const noexcept
 Compute per-element multiplication.
 
constexpr void Divide (const Element_t theFactor)
 Compute per-component division.
 
constexpr NCollection_Mat3operator/= (const Element_t theScalar)
 Per-component division.
 
constexpr NCollection_Mat3 Divided (const Element_t theScalar) const
 Divides all the coefficients of the matrix by scalar.
 
constexpr NCollection_Mat3 operator/ (const Element_t theScalar) const
 Divides all the coefficients of the matrix by scalar.
 
constexpr void Add (const NCollection_Mat3 &theMat) noexcept
 Per-component addition of another matrix.
 
constexpr NCollection_Mat3operator+= (const NCollection_Mat3 &theMat) noexcept
 Per-component addition of another matrix.
 
constexpr void Subtract (const NCollection_Mat3 &theMat) noexcept
 Per-component subtraction of another matrix.
 
constexpr NCollection_Mat3operator-= (const NCollection_Mat3 &theMat) noexcept
 Per-component subtraction of another matrix.
 
constexpr NCollection_Mat3 Added (const NCollection_Mat3 &theMat) const noexcept
 Per-component addition of another matrix.
 
constexpr NCollection_Mat3 operator+ (const NCollection_Mat3 &theMat) const noexcept
 Per-component addition of another matrix.
 
constexpr NCollection_Mat3 Subtracted (const NCollection_Mat3 &theMat) const noexcept
 Per-component subtraction of another matrix.
 
constexpr NCollection_Mat3 operator- (const NCollection_Mat3 &theMat) const noexcept
 Per-component subtraction of another matrix.
 
constexpr NCollection_Mat3 Negated () const noexcept
 Returns matrix with all components negated.
 
constexpr NCollection_Mat3 operator- () const noexcept
 Returns matrix with all components negated.
 
constexpr NCollection_Mat3 Transposed () const noexcept
 Transpose the matrix.
 
constexpr void Transpose () noexcept
 Transpose the matrix.
 
constexpr Element_t Determinant () const noexcept
 Return determinant of the matrix.
 
constexpr NCollection_Mat3 Adjoint () const noexcept
 Return adjoint (adjugate matrix, e.g. conjugate transpose).
 
bool Inverted (NCollection_Mat3 &theInv, Element_t &theDet) const
 Compute inverted matrix.
 
bool Inverted (NCollection_Mat3 &theInv) const
 Compute inverted matrix.
 
NCollection_Mat3 Inverted () const
 Return inverted matrix.
 
template<typename Other_t >
constexpr void ConvertFrom (const NCollection_Mat3< Other_t > &theFrom) noexcept
 Take values from NCollection_Mat3 with a different element type with type conversion.
 
void DumpJson (Standard_OStream &theOStream, int) const
 Dumps the content of me into the stream.
 

Static Public Member Functions

static constexpr NCollection_Mat3 Identity ()
 Return identity matrix.
 
static constexpr NCollection_Mat3 Zero ()
 Return zero matrix.
 
static constexpr NCollection_Mat3 Multiply (const NCollection_Mat3 &theMatA, const NCollection_Mat3 &theMatB) noexcept
 Compute matrix multiplication product: A * B.
 
static NCollection_Mat3< Element_t > & Map (Element_t *theData) noexcept
 Maps plain C array to matrix type.
 
static const NCollection_Mat3< Element_t > & Map (const Element_t *theData) noexcept
 Maps plain C array to matrix type.
 

Detailed Description

template<typename Element_t>
class NCollection_Mat3< Element_t >

3x3 Matrix class. Warning, empty constructor returns an identity matrix.

Constructor & Destructor Documentation

◆ NCollection_Mat3() [1/2]

Empty constructor for identity matrix.

◆ NCollection_Mat3() [2/2]

template<typename Element_t >
constexpr NCollection_Mat3< Element_t >::NCollection_Mat3 ( const NCollection_Mat3< OtherElement_t > & theOtherMat3)
inlineexplicitconstexprnoexcept

Conversion constructor (explicitly converts some 3x3 matrix with other element type to a new 3x3 matrix with the element type Element_t, whose elements are static_cast'ed corresponding elements of theOtherMat3 matrix)

Template Parameters
OtherElement_tthe element type of the other 3x3 matrix theOtherVec3
Parameters
theOtherMat3the 3x3 matrix that needs to be converted

Member Function Documentation

◆ Add()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::Add ( const NCollection_Mat3< Element_t > & theMat)
inlineconstexprnoexcept

Per-component addition of another matrix.

◆ Added()

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Added ( const NCollection_Mat3< Element_t > & theMat) const
inlineconstexprnoexcept

Per-component addition of another matrix.

◆ Adjoint()

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Adjoint ( ) const
inlineconstexprnoexcept

Return adjoint (adjugate matrix, e.g. conjugate transpose).

◆ ChangeData()

template<typename Element_t >
constexpr Element_t * NCollection_Mat3< Element_t >::ChangeData ( )
inlineconstexprnoexcept

◆ ChangeValue()

template<typename Element_t >
constexpr Element_t & NCollection_Mat3< Element_t >::ChangeValue ( const size_t theRow,
const size_t theCol )
inlineconstexprnoexcept

Access element at the specified row and column.

Parameters
[in]theRowthe row.to access.
[in]theColthe column to access.
Returns
reference on the matrix element.

◆ ConvertFrom()

template<typename Element_t >
template<typename Other_t >
constexpr void NCollection_Mat3< Element_t >::ConvertFrom ( const NCollection_Mat3< Other_t > & theFrom)
inlineconstexprnoexcept

Take values from NCollection_Mat3 with a different element type with type conversion.

◆ Determinant()

template<typename Element_t >
constexpr Element_t NCollection_Mat3< Element_t >::Determinant ( ) const
inlineconstexprnoexcept

Return determinant of the matrix.

◆ Divide()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::Divide ( const Element_t theFactor)
inlineconstexpr

Compute per-component division.

Parameters
[in]theFactorthe scale factor.

◆ Divided()

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Divided ( const Element_t theScalar) const
inlineconstexpr

Divides all the coefficients of the matrix by scalar.

◆ DumpJson()

template<typename Element_t >
void NCollection_Mat3< Element_t >::DumpJson ( Standard_OStream & theOStream,
int  ) const
inline

Dumps the content of me into the stream.

◆ GetColumn()

template<typename Element_t >
constexpr NCollection_Vec3< Element_t > NCollection_Mat3< Element_t >::GetColumn ( const size_t theCol) const
inlineconstexprnoexcept

Return the column.

◆ GetData()

template<typename Element_t >
constexpr const Element_t * NCollection_Mat3< Element_t >::GetData ( ) const
inlineconstexprnoexcept

Raw access to the data (for OpenGL exchange). the data is returned in column-major order.

◆ GetDiagonal()

template<typename Element_t >
constexpr NCollection_Vec3< Element_t > NCollection_Mat3< Element_t >::GetDiagonal ( ) const
inlineconstexprnoexcept

Get vector of diagonal elements.

Returns
vector of diagonal elements.

◆ GetRow()

template<typename Element_t >
constexpr NCollection_Vec3< Element_t > NCollection_Mat3< Element_t >::GetRow ( const size_t theRow) const
inlineconstexprnoexcept

Return the row.

◆ GetValue()

template<typename Element_t >
constexpr Element_t NCollection_Mat3< Element_t >::GetValue ( const size_t theRow,
const size_t theCol ) const
inlineconstexprnoexcept

Get element at the specified row and column.

Parameters
[in]theRowthe row.to address.
[in]theColthe column to address.
Returns
the value of the addressed element.

◆ Identity()

template<typename Element_t >
static constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Identity ( )
inlinestaticconstexpr

Return identity matrix.

◆ InitIdentity()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::InitIdentity ( )
inlineconstexprnoexcept

Initialize the identity matrix.

◆ InitZero()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::InitZero ( )
inlineconstexprnoexcept

Initialize the zero matrix.

◆ Inverted() [1/3]

template<typename Element_t >
NCollection_Mat3 NCollection_Mat3< Element_t >::Inverted ( ) const
inline

Return inverted matrix.

◆ Inverted() [2/3]

template<typename Element_t >
bool NCollection_Mat3< Element_t >::Inverted ( NCollection_Mat3< Element_t > & theInv) const
inline

Compute inverted matrix.

Parameters
[out]theInvthe inverted matrix
Returns
true if reversion success

◆ Inverted() [3/3]

template<typename Element_t >
bool NCollection_Mat3< Element_t >::Inverted ( NCollection_Mat3< Element_t > & theInv,
Element_t & theDet ) const
inline

Compute inverted matrix.

Parameters
[out]theInvthe inverted matrix
[out]theDetdeterminant of matrix
Returns
true if reversion success

◆ IsEqual()

template<typename Element_t >
constexpr bool NCollection_Mat3< Element_t >::IsEqual ( const NCollection_Mat3< Element_t > & theOther) const
inlineconstexprnoexcept

Check this matrix for equality with another matrix (without tolerance!).

◆ IsIdentity()

template<typename Element_t >
constexpr bool NCollection_Mat3< Element_t >::IsIdentity ( ) const
inlineconstexprnoexcept

Checks the matrix for identity (without tolerance).

◆ IsZero()

template<typename Element_t >
constexpr bool NCollection_Mat3< Element_t >::IsZero ( ) const
inlineconstexprnoexcept

Checks the matrix for zero (without tolerance).

◆ Map() [1/2]

template<typename Element_t >
static const NCollection_Mat3< Element_t > & NCollection_Mat3< Element_t >::Map ( const Element_t * theData)
inlinestaticnoexcept

Maps plain C array to matrix type.

◆ Map() [2/2]

template<typename Element_t >
static NCollection_Mat3< Element_t > & NCollection_Mat3< Element_t >::Map ( Element_t * theData)
inlinestaticnoexcept

Maps plain C array to matrix type.

◆ Multiplied() [1/2]

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Multiplied ( const Element_t theFactor) const
inlineconstexprnoexcept

Compute per-element multiplication.

Parameters
[in]theFactorthe scale factor.
Returns
the result of multiplication.

◆ Multiplied() [2/2]

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Multiplied ( const NCollection_Mat3< Element_t > & theMat) const
inlineconstexprnoexcept

Compute matrix multiplication product.

Parameters
[in]theMatthe other matrix.
Returns
result of multiplication.

◆ Multiply() [1/3]

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::Multiply ( const Element_t theFactor)
inlineconstexprnoexcept

Compute per-component multiplication.

Parameters
[in]theFactorthe scale factor.

◆ Multiply() [2/3]

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::Multiply ( const NCollection_Mat3< Element_t > & theMat)
inlineconstexprnoexcept

Compute matrix multiplication.

Parameters
[in]theMatthe matrix to multiply.

◆ Multiply() [3/3]

template<typename Element_t >
static constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Multiply ( const NCollection_Mat3< Element_t > & theMatA,
const NCollection_Mat3< Element_t > & theMatB )
inlinestaticconstexprnoexcept

Compute matrix multiplication product: A * B.

Parameters
[in]theMatAthe matrix "A".
[in]theMatBthe matrix "B".

◆ Negated()

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Negated ( ) const
inlineconstexprnoexcept

Returns matrix with all components negated.

◆ operator!=()

template<typename Element_t >
constexpr bool NCollection_Mat3< Element_t >::operator!= ( const NCollection_Mat3< Element_t > & theOther) const
inlineconstexprnoexcept

Check this vector with another vector for non-equality (without tolerance!).

◆ operator()() [1/2]

template<typename Element_t >
constexpr Element_t NCollection_Mat3< Element_t >::operator() ( const size_t theRow,
const size_t theCol ) const
inlineconstexprnoexcept

Return value.

◆ operator()() [2/2]

template<typename Element_t >
constexpr Element_t & NCollection_Mat3< Element_t >::operator() ( const size_t theRow,
const size_t theCol )
inlineconstexprnoexcept

Return value.

◆ operator*() [1/3]

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::operator* ( const Element_t theFactor) const
inlineconstexprnoexcept

Compute per-element multiplication.

Parameters
[in]theFactorthe scale factor.
Returns
the result of multiplication.

◆ operator*() [2/3]

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::operator* ( const NCollection_Mat3< Element_t > & theMat) const
inlineconstexprnoexcept

Compute matrix multiplication product.

Parameters
[in]theMatthe other matrix.
Returns
result of multiplication.

◆ operator*() [3/3]

template<typename Element_t >
constexpr NCollection_Vec3< Element_t > NCollection_Mat3< Element_t >::operator* ( const NCollection_Vec3< Element_t > & theVec) const
inlineconstexprnoexcept

Multiply by the vector (M * V).

Parameters
[in]theVecthe vector to multiply.

◆ operator*=() [1/2]

template<typename Element_t >
constexpr NCollection_Mat3 & NCollection_Mat3< Element_t >::operator*= ( const Element_t theFactor)
inlineconstexprnoexcept

Compute per-element multiplication.

Parameters
[in]theFactorthe scale factor.

◆ operator*=() [2/2]

template<typename Element_t >
constexpr NCollection_Mat3 & NCollection_Mat3< Element_t >::operator*= ( const NCollection_Mat3< Element_t > & theMat)
inlineconstexprnoexcept

Multiply by the another matrix.

Parameters
[in]theMatthe other matrix.

◆ operator+()

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::operator+ ( const NCollection_Mat3< Element_t > & theMat) const
inlineconstexprnoexcept

Per-component addition of another matrix.

◆ operator+=()

template<typename Element_t >
constexpr NCollection_Mat3 & NCollection_Mat3< Element_t >::operator+= ( const NCollection_Mat3< Element_t > & theMat)
inlineconstexprnoexcept

Per-component addition of another matrix.

◆ operator-() [1/2]

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::operator- ( ) const
inlineconstexprnoexcept

Returns matrix with all components negated.

◆ operator-() [2/2]

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::operator- ( const NCollection_Mat3< Element_t > & theMat) const
inlineconstexprnoexcept

Per-component subtraction of another matrix.

◆ operator-=()

template<typename Element_t >
constexpr NCollection_Mat3 & NCollection_Mat3< Element_t >::operator-= ( const NCollection_Mat3< Element_t > & theMat)
inlineconstexprnoexcept

Per-component subtraction of another matrix.

◆ operator/()

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::operator/ ( const Element_t theScalar) const
inlineconstexpr

Divides all the coefficients of the matrix by scalar.

◆ operator/=()

template<typename Element_t >
constexpr NCollection_Mat3 & NCollection_Mat3< Element_t >::operator/= ( const Element_t theScalar)
inlineconstexpr

Per-component division.

Parameters
[in]theScalarthe scale factor.

◆ operator==()

template<typename Element_t >
constexpr bool NCollection_Mat3< Element_t >::operator== ( const NCollection_Mat3< Element_t > & theMat) const
inlineconstexprnoexcept

Comparison operator.

◆ SetColumn()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::SetColumn ( const size_t theCol,
const NCollection_Vec3< Element_t > & theVec )
inlineconstexprnoexcept

Change first 3 column values by the passed vector.

Parameters
[in]theColthe column to change.
[in]theVecthe vector of values.

◆ SetDiagonal()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::SetDiagonal ( const NCollection_Vec3< Element_t > & theVec)
inlineconstexprnoexcept

Change first 3 elements of the diagonal matrix.

Parameters
theVecthe vector of values.

◆ SetRow()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::SetRow ( const size_t theRow,
const NCollection_Vec3< Element_t > & theVec )
inlineconstexprnoexcept

Change first 3 row values by the passed vector.

Parameters
[in]theRowthe row to change.
[in]theVecthe vector of values.

◆ SetValue()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::SetValue ( const size_t theRow,
const size_t theCol,
const Element_t theValue )
inlineconstexprnoexcept

Set value for the element specified by row and columns.

Parameters
[in]theRowthe row to change.
[in]theColthe column to change.
[in]theValuethe value to set.s

◆ Subtract()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::Subtract ( const NCollection_Mat3< Element_t > & theMat)
inlineconstexprnoexcept

Per-component subtraction of another matrix.

◆ Subtracted()

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Subtracted ( const NCollection_Mat3< Element_t > & theMat) const
inlineconstexprnoexcept

Per-component subtraction of another matrix.

◆ Transpose()

template<typename Element_t >
constexpr void NCollection_Mat3< Element_t >::Transpose ( )
inlineconstexprnoexcept

Transpose the matrix.

◆ Transposed()

template<typename Element_t >
constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Transposed ( ) const
inlineconstexprnoexcept

Transpose the matrix.

Returns
transposed copy of the matrix.

◆ Zero()

template<typename Element_t >
static constexpr NCollection_Mat3 NCollection_Mat3< Element_t >::Zero ( )
inlinestaticconstexpr

Return zero matrix.


The documentation for this class was generated from the following file: