Class SBDTypePhysicalMatrix66#
template <typename Quantity00, typename Quantity01, typename Quantity10, typename Quantity11>
ClassList > SBDTypePhysicalMatrix66
This template class is used to represent spatial matrices. More...
#include <SBDTypePhysicalMatrix66.hpp>
Public Attributes#
Type | Name |
---|---|
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. |
Public Static Attributes#
Type | Name |
---|---|
const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > | identity The identity physical matrix. |
const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > | zero The zero physical matrix. |
Public Functions#
Type | Name |
---|---|
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. |
|
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > | doubleSymmetricPart () const Returns twice the symmetric part of the matrix. |
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::dimensionless > | getValue () const Returns a dimensionless physical matrix whose components are equal to those of this physical matrix. |
bool | operator!= (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & mat) const Returns true if this spatial matrix is different from spatial matrix mat (component-wise) |
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*= (Quantity d) const Multiplies this spatial matrix with physical quantity d . |
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. |
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > | operator- () const Returns the opposite of the spatial matrix. |
void | operator-= (const SBDTypePhysicalMatrix66 & mat) Subtracts the mat spatial matrix from this spatial matrix. |
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > | operator/ (double d) const Returns the division of this spatial matrix by double d . |
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & | operator/= (Quantity d) const Divides this spatial matrix by physical quantity d . |
SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & | operator= (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & mat) Copy assignment. |
bool | operator== (const SBDTypePhysicalMatrix66< Quantity00, Quantity01, Quantity10, Quantity11 > & mat) const Returns true if this spatial matrix is equal to spatial matrix mat (component-wise) |
void | print () const Prints the spatial matrix. |
virtual void | serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const Serializes the matrix using the provided serializer . |
void | setIdentity () Sets the matrix to identity. |
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 . |
void | setZero () Sets the matrix to zero. |
void | symmetrize () Makes the matrix symmetric. |
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. |
virtual void | unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) Unserializes the matrix using the provided serializer . |
Detailed Description#
Template parameters:
Quantity00
The quantity type of the top left 3x3 blockQuantity01
The quantity type of the top right 3x3 blockQuantity10
The quantity type of the bottom left 3x3 blockQuantity11
The 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: SBDTypePhysicalMatrix33, SBDTypePhysicalVector6
See also: SAMSON's unit system
Public Attributes Documentation#
variable m00#
The top left 3x3 matrix.
variable m01#
The top right 3x3 matrix.
variable m10#
The bottom left 3x3 matrix.
variable m11#
The bottom right 3x3 matrix.
Public Static Attributes Documentation#
variable identity#
The identity physical matrix.
variable zero#
The zero physical matrix.
Public Functions Documentation#
function SBDTypePhysicalMatrix66 [1/3]#
he default constructor initializes all components to zero
function SBDTypePhysicalMatrix66 [2/3]#
Constructs a spatial matrix from four 3x3 matrices.
inline SBDTypePhysicalMatrix66::SBDTypePhysicalMatrix66 (
const SBDTypePhysicalMatrix33 < Quantity00 > & mat00,
const SBDTypePhysicalMatrix33 < Quantity01 > & mat01,
const SBDTypePhysicalMatrix33 < Quantity10 > & mat10,
const SBDTypePhysicalMatrix33 < Quantity11 > & mat11
)
Parameters:
mat00
The top left 3x3 blockmat01
The top right 3x3 blockmat10
The bottom left 3x3 blockmat11
The bottom right 3x3 block
This constructor initializes a spatial matrix from four 3x3 matrices
function SBDTypePhysicalMatrix66 [3/3]#
Copy constructor.
inline SBDTypePhysicalMatrix66::SBDTypePhysicalMatrix66 (
const SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & mat
)
function doubleSymmetricPart#
Returns twice the symmetric part of the matrix.
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66::doubleSymmetricPart () const
function getE1#
Returns the first column of the spatial matrix.
function getE2#
Returns the second column of the spatial matrix.
function getE3#
Returns the third column of the spatial matrix.
function getE4#
Returns the fourth column of the spatial matrix.
function getE5#
Returns the fifth column of the spatial matrix.
function getE6#
Returns the sixth column of the spatial matrix.
function getValue#
Returns a dimensionless physical matrix whose components are equal to those of this physical matrix.
inline SBDTypePhysicalMatrix66 < SBQuantity::dimensionless , SBQuantity::dimensionless , SBQuantity::dimensionless , SBQuantity::dimensionless > SBDTypePhysicalMatrix66::getValue () const
function operator!=#
Returns true if this spatial matrix is different from spatial matrix mat
(component-wise)
inline bool SBDTypePhysicalMatrix66::operator!= (
const SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & mat
) const
function operator*#
Returns the product of this spatial matrix with the spatial vector v
.
template<typename QuantityA, typename QuantityL>
inline SBDTypePhysicalVector6 < typename SBQuantityProduct2< Quantity00, QuantityA >::Type, typename SBQuantityProduct2< Quantity10, QuantityA >::Type > SBDTypePhysicalMatrix66::operator* (
const SBDTypePhysicalVector6 < QuantityA, QuantityL > & v
) const
Parameters:
v
A 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.
function operator*#
Returns the product of this spatial matrix with double d
.
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66::operator* (
double d
) const
Parameters:
d
A double
This function returns the product of this spatial matrix with double d
.
function operator*=#
Multiplies this spatial matrix with physical quantity d
.
template<typename Quantity>
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & SBDTypePhysicalMatrix66::operator*= (
Quantity d
) const
Parameters:
d
A dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)
function operator+#
Returns the sum of the spatial matrix with the mat
spatial matrix.
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66::operator+ (
const SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & mat
) const
Parameters:
mat
A spatial matrix
This function returns the sum of the spatial matrix with the mat
spatial matrix. Both spatial matrices must have identical units.
function operator+=#
Adds the mat
spatial matrix to this spatial matrix.
Parameters:
mat
A spatial matrix
This function adds the mat
spatial matrix to this spatial matrix. Both spatial matrices must have identical units.
function operator-#
Returns the subtraction of the spatial matrix from the mat
spatial matrix.
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66::operator- (
const SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & mat
) const
Parameters:
mat
A spatial matrix
This function returns the subtraction of the spatial matrix from the mat
spatial matrix. Both spatial matrices must have identical units.
function operator-#
Returns the opposite of the spatial matrix.
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66::operator- () const
This function returns the opposite of the spatial matrix.
function operator-=#
Subtracts the mat
spatial matrix from this spatial matrix.
Parameters:
mat
A spatial matrix
This function subtracts the mat
spatial matrix from this spatial matrix. Both spatial matrices must have identical units.
function operator/#
Returns the division of this spatial matrix by double d
.
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > SBDTypePhysicalMatrix66::operator/ (
double d
) const
Parameters:
d
A double
This function returns the division of this spatial matrix by double d
.
function operator/=#
Divides this spatial matrix by physical quantity d
.
template<typename Quantity>
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & SBDTypePhysicalMatrix66::operator/= (
Quantity d
) const
Parameters:
d
A dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)
function operator=#
Copy assignment.
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & SBDTypePhysicalMatrix66::operator= (
const SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & mat
)
function operator==#
Returns true if this spatial matrix is equal to spatial matrix mat
(component-wise)
inline bool SBDTypePhysicalMatrix66::operator== (
const SBDTypePhysicalMatrix66 < Quantity00, Quantity01, Quantity10, Quantity11 > & mat
) const
function print#
Prints the spatial matrix.
This function prints the spatial matrix.
function serialize#
Serializes the matrix using the provided serializer
.
inline virtual void SBDTypePhysicalMatrix66::serialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const
function setIdentity#
Sets the matrix to identity.
function setValue#
Sets the components of this physical matrix equal to those of the dimensionless physical matrix u
.
inline void SBDTypePhysicalMatrix66::setValue (
const SBDTypePhysicalMatrix66 < SBQuantity::dimensionless , SBQuantity::dimensionless , SBQuantity::dimensionless , SBQuantity::dimensionless > & u
)
function setZero#
Sets the matrix to zero.
function symmetrize#
Makes the matrix symmetric.
Makes the matrix symmetric by replacing it with the half-sum of itself and its transpose:
function transpose [1/2]#
Returns the transpose.
inline SBDTypePhysicalMatrix66 < Quantity00, Quantity10, Quantity01, Quantity11 > SBDTypePhysicalMatrix66::transpose () const
function transpose [2/2]#
Sets result
to the transpose of the matrix.
inline void SBDTypePhysicalMatrix66::transpose (
SBDTypePhysicalMatrix66 < Quantity00, Quantity10, Quantity01, Quantity11 > & result
) const
Parameters:
result
The 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.
function unserialize#
Unserializes the matrix using the provided serializer
.
inline virtual void SBDTypePhysicalMatrix66::unserialize (
SBCSerializer * serializer,
const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
)