Loading...
Searching...
No Matches
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > Class Template Reference

This template class is used to represent spatial matrices. More...

Useful functions

SBDTypePhysicalMatrix33< Quantity00 > m00
 The top left 3x3 matrix.
 
SBDTypePhysicalMatrix33< Quantity01 > m01
 The top right 3x3 matrix.
 
SBDTypePhysicalMatrix33< Quantity10 > m10
 The bottom left 3x3 matrix.
 
SBDTypePhysicalMatrix33< Quantity11 > m11
 The bottom right 3x3 matrix.
 
static const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > zero
 The zero physical matrix.
 
static const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > identity
 The identity physical matrix.
 
void print () const
 Prints the spatial matrix.
 
void setZero ()
 Sets the matrix to zero.
 
void symmetrize ()
 Makes the matrix symmetric.
 
void setIdentity ()
 Sets the matrix to identity.
 
SBDTypePhysicalMatrix66< Quantity00, Quantity10, Quantity01, Quantity11 > transpose () const
 Returns the transpose.
 
void transpose (SBDTypePhysicalMatrix66< Quantity00, Quantity10, Quantity01, Quantity11 > &result) const
 Sets result to the transpose of the matrix.
 
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > doubleSymmetricPart () const
 Returns twice the symmetric part of the matrix.
 

Constructors

 SBDTypePhysicalMatrix66 ()
 he default constructor initializes all components to zero
 
 SBDTypePhysicalMatrix66 (const SBDTypePhysicalMatrix33< Quantity00 > &mat00, const SBDTypePhysicalMatrix33< Quantity01 > &mat01, const SBDTypePhysicalMatrix33< Quantity10 > &mat10, const SBDTypePhysicalMatrix33< Quantity11 > &mat11)
 Constructs a spatial matrix from four 3x3 matrices.
 
 SBDTypePhysicalMatrix66 (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &mat)
 Copy constructor.
 

Serialization

virtual void serialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
 Serializes the matrix using the provided serializer.
 
virtual void unserialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER)
 Unserializes the matrix using the provided serializer.
 

Accessors

SBDTypePhysicalVector6< Quantity00, Quantity10 > getE1 () const
 Returns the first column of the spatial matrix.
 
SBDTypePhysicalVector6< Quantity00, Quantity10 > getE2 () const
 Returns the second column of the spatial matrix.
 
SBDTypePhysicalVector6< Quantity00, Quantity10 > getE3 () const
 Returns the third column of the spatial matrix.
 
SBDTypePhysicalVector6< Quantity01, Quantity11 > getE4 () const
 Returns the fourth column of the spatial matrix.
 
SBDTypePhysicalVector6< Quantity01, Quantity11 > getE5 () const
 Returns the fifth column of the spatial matrix.
 
SBDTypePhysicalVector6< Quantity01, Quantity11 > getE6 () const
 Returns the sixth column of the spatial matrix.
 
SBDTypePhysicalMatrix66< SBQuantity::dimensionless, SBQuantity::dimensionless, SBQuantity::dimensionless, SBQuantity::dimensionlessgetValue () const
 Returns a dimensionless physical matrix whose components are equal to those of this physical matrix.
 
void setValue (const SBDTypePhysicalMatrix66< SBQuantity::dimensionless, SBQuantity::dimensionless, SBQuantity::dimensionless, SBQuantity::dimensionless > &u)
 Sets the components of this physical matrix equal to those of the dimensionless physical matrix u.
 

Operators

SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & operator= (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &mat)
 Copy assignment.
 
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > operator+ (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &mat) const
 Returns the sum of the spatial matrix with the mat spatial matrix.
 
void operator+= (const SBDTypePhysicalMatrix66 &mat)
 Adds the mat spatial matrix to this spatial matrix.
 
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > operator- (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &mat) const
 Returns the subtraction of the spatial matrix from the mat spatial matrix.
 
void operator-= (const SBDTypePhysicalMatrix66 &mat)
 Subtracts the mat spatial matrix from this spatial matrix.
 
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > operator- () const
 Returns the opposite of the spatial matrix.
 
template<typename QuantityA , typename QuantityL >
SBDTypePhysicalVector6< typename SBQuantityProduct2< Quantity00, QuantityA >::Type, typename SBQuantityProduct2< Quantity10, QuantityA >::Type > operator* (const SBDTypePhysicalVector6< QuantityA, QuantityL > &v) const
 Returns the product of this spatial matrix with the spatial vector v.
 
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > operator* (double d) const
 Returns the product of this spatial matrix with double d.
 
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > operator/ (double d) const
 Returns the division of this spatial matrix by double d.
 
template<typename Quantity >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & operator*= (Quantity d) const
 Multiplies this spatial matrix with physical quantity d.
 
template<typename Quantity >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & operator/= (Quantity d) const
 Divides this spatial matrix by physical quantity d.
 
bool operator== (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &mat) const
 Returns true if this spatial matrix is equal to spatial matrix mat (component-wise)
 
bool operator!= (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &mat) const
 Returns true if this spatial matrix is different from spatial matrix mat (component-wise)
 

Detailed Description

template<typename Quantity00, typename Quantity01, typename Quantity10, typename Quantity11>
class SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >
Template Parameters
Quantity00The quantity type of the top left 3x3 block
Quantity01The quantity type of the top right 3x3 block
Quantity10The quantity type of the bottom left 3x3 block
Quantity11The quantity type of the bottom right 3x3 block

This template class represents spatial matrices, i.e. 6x6 matrices typically used to describe rigid or articulated inertias and inverse inertias. Spatial matrices are physical quantities, and thus use SAMSON's unit system. In a spatial matrix (e.g. an inertia matrix), the 3x3 blocks may have different units, so that spatial matrices are defined by four units, and the SBDTypePhysicalMatrix66 template class is parameterized by four types: Quantity00, Quantity01, Quantity10 and Quantity11.

Most of the time, developers of SAMSON Extensions do not have to use this template, but may directly use some predefined types, e.g. SBMatrix66 (dimensionless spatial matrix), SBInertia66 (spatial inertia) or SBInverseInertia66 (spatial inverse inertia).

Short name: SBPhysicalMatrix66

See also
SAMSON's unit system
SBDTypePhysicalMatrix33
SBDTypePhysicalVector6

Constructor & Destructor Documentation

◆ SBDTypePhysicalMatrix66()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::SBDTypePhysicalMatrix66 ( const SBDTypePhysicalMatrix33< Quantity00 > &  mat00,
const SBDTypePhysicalMatrix33< Quantity01 > &  mat01,
const SBDTypePhysicalMatrix33< Quantity10 > &  mat10,
const SBDTypePhysicalMatrix33< Quantity11 > &  mat11 
)
inline
Parameters
mat00The top left 3x3 block
mat01The top right 3x3 block
mat10The bottom left 3x3 block
mat11The bottom right 3x3 block

This constructor initializes a spatial matrix from four 3x3 matrices

Member Function Documentation

◆ operator*() [1/2]

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
template<typename QuantityA , typename QuantityL >
SBDTypePhysicalVector6< typename SBQuantityProduct2< Quantity00, QuantityA >::Type, typename SBQuantityProduct2< Quantity10, QuantityA >::Type > SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator* ( const SBDTypePhysicalVector6< QuantityA, QuantityL > &  v) const
inline
Parameters
vA spatial vector

This function returns the product of this spatial matrix with the spatial vector v. SAMSON's unit system checks that the units in the spatial matrix and the spatial vector are compatible.

◆ operator*() [2/2]

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator* ( double  d) const
inline
Parameters
dA double

This function returns the product of this spatial matrix with double d.

◆ operator*=()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
template<typename Quantity >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator*= ( Quantity  d) const
inline
Parameters
dA dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)

◆ operator+()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator+ ( const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &  mat) const
inline
Parameters
matA spatial matrix

This function returns the sum of the spatial matrix with the mat spatial matrix. Both spatial matrices must have identical units.

◆ operator+=()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
void SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator+= ( const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &  mat)
inline
Parameters
matA spatial matrix

This function adds the mat spatial matrix to this spatial matrix. Both spatial matrices must have identical units.

◆ operator-() [1/2]

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator- ( ) const
inline

This function returns the opposite of the spatial matrix.

◆ operator-() [2/2]

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator- ( const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &  mat) const
inline
Parameters
matA spatial matrix

This function returns the subtraction of the spatial matrix from the mat spatial matrix. Both spatial matrices must have identical units.

◆ operator-=()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
void SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator-= ( const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > &  mat)
inline
Parameters
matA spatial matrix

This function subtracts the mat spatial matrix from this spatial matrix. Both spatial matrices must have identical units.

◆ operator/()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator/ ( double  d) const
inline
Parameters
dA double

This function returns the division of this spatial matrix by double d.

◆ operator/=()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
template<typename Quantity >
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::operator/= ( Quantity  d) const
inline
Parameters
dA dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)

◆ print()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
void SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::print ( ) const
inline

This function prints the spatial matrix.

◆ symmetrize()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
void SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::symmetrize ( )
inline

Makes the matrix symmetric by replacing it with the half-sum of itself and its transpose: \(\mathbf{M}:=\frac{\mathbf{M}+\mathbf{M}^T}{2}\)

◆ transpose()

template<typename Quantity00 , typename Quantity01 , typename Quantity10 , typename Quantity11 >
void SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 >::transpose ( SBDTypePhysicalMatrix66< Quantity00, Quantity10, Quantity01, Quantity11 > &  result) const
inline
Parameters
resultThe spatial matrix which becomes equal to the transpose of this matrix This function exists for efficiency reasons, to avoid the cost of an object construction.