A 6x6 matrix class. More...
#include <gz/math/Matrix6.hh>
Public Types | |
enum | Matrix6Corner { TOP_LEFT = 0 , TOP_RIGHT = 1 , BOTTOM_LEFT = 2 , BOTTOM_RIGHT = 3 } |
Identifiers for each of the 4 3x3 corners of the matrix. More... | |
Public Member Functions | |
Matrix6 () | |
Constructor. | |
constexpr | Matrix6 (T _v00, T _v01, T _v02, T _v03, T _v04, T _v05, T _v10, T _v11, T _v12, T _v13, T _v14, T _v15, T _v20, T _v21, T _v22, T _v23, T _v24, T _v25, T _v30, T _v31, T _v32, T _v33, T _v34, T _v35, T _v40, T _v41, T _v42, T _v43, T _v44, T _v45, T _v50, T _v51, T _v52, T _v53, T _v54, T _v55) |
Constructor. | |
bool | Equal (const Matrix6 &_m, const T &_tol) const |
Equality test with tolerance. | |
bool | operator!= (const Matrix6< T > &_m) const |
Inequality test operator. | |
T & | operator() (const size_t _row, const size_t _col) |
Get a mutable version of the value at the specified row, column index. | |
const T & | operator() (const size_t _row, const size_t _col) const |
Get the value at the specified row, column index. | |
Matrix6< T > | operator* (const Matrix6< T > &_m2) const |
Multiplication operator. | |
Matrix6< T > | operator*= (const Matrix6< T > &_m2) |
Multiplication assignment operator. This matrix will become equal to this * _m2. | |
Matrix6< T > | operator+ (const Matrix6< T > &_m2) const |
Addition operator. | |
Matrix6< T > | operator+= (const Matrix6< T > &_m2) |
Addition assignment operator. This matrix will become equal to this + _m2. | |
bool | operator== (const Matrix6< T > &_m) const |
Equality operator. | |
void | Set (T _v00, T _v01, T _v02, T _v03, T _v04, T _v05, T _v10, T _v11, T _v12, T _v13, T _v14, T _v15, T _v20, T _v21, T _v22, T _v23, T _v24, T _v25, T _v30, T _v31, T _v32, T _v33, T _v34, T _v35, T _v40, T _v41, T _v42, T _v43, T _v44, T _v45, T _v50, T _v51, T _v52, T _v53, T _v54, T _v55) |
Change the values. | |
void | SetSubmatrix (Matrix6Corner _corner, const Matrix3< T > &_mat) |
Set one of the four 3x3 submatrices that compose this matrix. These submatrices are formed by dividing the 6x6 matrix in 4 parts that do not overlap with each other. | |
bool | SetValue (size_t _row, size_t _col, T _v) |
Set a value in a specific row and col param[in] _row Row of the matrix param[in] _col Col of the matrix param[in] _v Value to assign. | |
Matrix3< T > | Submatrix (Matrix6Corner _corner) const |
Get one of the four 3x3 submatrices that compose this matrix. These submatrices are formed by dividing the 6x6 matrix in 4 parts that do not overlap with each other. | |
void | Transpose () |
Transpose this matrix. | |
Matrix6< T > | Transposed () const |
Return the transpose of this matrix. | |
Static Public Attributes | |
static const Matrix6< T > & | Identity = detail::gMatrix6Identity<T> |
Identity matrix. | |
static constexpr std::size_t | MatrixSize {6} |
Size of matrix is fixed to 6x6. | |
static const Matrix6< T > & | Zero = detail::gMatrix6Zero<T> |
Zero matrix. | |
Detailed Description
class gz::math::Matrix6< T >
A 6x6 matrix class.
Member Enumeration Documentation
◆ Matrix6Corner
enum Matrix6Corner |
Identifiers for each of the 4 3x3 corners of the matrix.
Constructor & Destructor Documentation
◆ Matrix6() [1/2]
◆ Matrix6() [2/2]
|
inlineconstexpr |
Constructor.
- Parameters
-
[in] _v00 Row 0, Col 0 value [in] _v01 Row 0, Col 1 value [in] _v02 Row 0, Col 2 value [in] _v03 Row 0, Col 3 value [in] _v04 Row 0, Col 4 value [in] _v05 Row 0, Col 5 value [in] _v10 Row 1, Col 0 value [in] _v11 Row 1, Col 1 value [in] _v12 Row 1, Col 2 value [in] _v13 Row 1, Col 3 value [in] _v14 Row 1, Col 4 value [in] _v15 Row 1, Col 5 value [in] _v20 Row 2, Col 0 value [in] _v21 Row 2, Col 1 value [in] _v22 Row 2, Col 2 value [in] _v23 Row 2, Col 3 value [in] _v24 Row 2, Col 4 value [in] _v25 Row 2, Col 5 value [in] _v30 Row 3, Col 0 value [in] _v31 Row 3, Col 1 value [in] _v32 Row 3, Col 2 value [in] _v33 Row 3, Col 3 value [in] _v34 Row 3, Col 4 value [in] _v35 Row 3, Col 5 value [in] _v40 Row 4, Col 0 value [in] _v41 Row 4, Col 1 value [in] _v42 Row 4, Col 2 value [in] _v43 Row 4, Col 3 value [in] _v44 Row 4, Col 4 value [in] _v45 Row 4, Col 5 value [in] _v50 Row 5, Col 0 value [in] _v51 Row 5, Col 1 value [in] _v52 Row 5, Col 2 value [in] _v53 Row 5, Col 3 value [in] _v54 Row 5, Col 4 value [in] _v55 Row 5, Col 5 value
References Matrix6< T >::Matrix6().
Member Function Documentation
◆ Equal()
Equality test with tolerance.
- Parameters
-
[in] _m the matrix to compare to [in] _tol equality tolerance.
- Returns
- true if the elements of the matrices are equal within the tolerence specified by _tol.
Referenced by Pose3< T >::Equal(), MassMatrix3< T >::PrincipalAxesOffset(), and MassMatrix3< T >::PrincipalMoments().
◆ operator!=()
Inequality test operator.
- Parameters
-
[in] _m Matrix6<T> to test
- Returns
- True if not equal (using the default tolerance of 1e-6)
◆ operator()() [1/2]
Get a mutable version of the value at the specified row, column index.
- Parameters
-
[in] _row the row index. Index values are clamped to a range of [0, 5]. [in] _col The column index. Index values are clamped to a range of [0, 5].
- Returns
- The value at the specified index
References gz::math::clamp(), gz::math::GZ_FIVE_SIZE_T, and gz::math::GZ_ZERO_SIZE_T.
◆ operator()() [2/2]
Get the value at the specified row, column index.
- Parameters
-
[in] _col The column index. Index values are clamped to a range of [0, 5]. [in] _row the row index. Index values are clamped to a range of [0, 5].
- Returns
- The value at the specified index
References gz::math::clamp(), gz::math::GZ_FIVE_SIZE_T, and gz::math::GZ_ZERO_SIZE_T.
◆ operator*()
Multiplication operator.
- Parameters
-
[in] _m2 Incoming matrix
- Returns
- This matrix * _m2
◆ operator*=()
Multiplication assignment operator. This matrix will become equal to this * _m2.
- Parameters
-
[in] _m2 Incoming matrix.
- Returns
- This matrix * _m2.
◆ operator+()
Addition operator.
- Parameters
-
[in] _m2 Incoming matrix
- Returns
- This matrix + _m2
◆ operator+=()
Addition assignment operator. This matrix will become equal to this + _m2.
- Parameters
-
[in] _m2 Incoming matrix.
- Returns
- This matrix + _m2.
◆ operator==()
Equality operator.
- Parameters
-
[in] _m Matrix6 to test
- Returns
- true if the 2 matrices are equal (using the tolerance 1e-6), false otherwise
◆ Set()
|
inline |
Change the values.
- Parameters
-
[in] _v00 Row 0, Col 0 value [in] _v01 Row 0, Col 1 value [in] _v02 Row 0, Col 2 value [in] _v03 Row 0, Col 3 value [in] _v04 Row 0, Col 4 value [in] _v05 Row 0, Col 5 value [in] _v10 Row 1, Col 0 value [in] _v11 Row 1, Col 1 value [in] _v12 Row 1, Col 2 value [in] _v13 Row 1, Col 3 value [in] _v14 Row 1, Col 4 value [in] _v15 Row 1, Col 5 value [in] _v20 Row 2, Col 0 value [in] _v21 Row 2, Col 1 value [in] _v22 Row 2, Col 2 value [in] _v23 Row 2, Col 3 value [in] _v24 Row 2, Col 4 value [in] _v25 Row 2, Col 5 value [in] _v30 Row 3, Col 0 value [in] _v31 Row 3, Col 1 value [in] _v32 Row 3, Col 2 value [in] _v33 Row 3, Col 3 value [in] _v34 Row 3, Col 4 value [in] _v35 Row 3, Col 5 value [in] _v40 Row 4, Col 0 value [in] _v41 Row 4, Col 1 value [in] _v42 Row 4, Col 2 value [in] _v43 Row 4, Col 3 value [in] _v44 Row 4, Col 4 value [in] _v45 Row 4, Col 5 value [in] _v50 Row 5, Col 0 value [in] _v51 Row 5, Col 1 value [in] _v52 Row 5, Col 2 value [in] _v53 Row 5, Col 3 value [in] _v54 Row 5, Col 4 value [in] _v55 Row 5, Col 5 value
Referenced by Quaternion< T >::AxisAngle(), Line3< T >::Distance(), MassMatrix3< T >::PrincipalAxesOffset(), Pose3< T >::Reset(), Line3< T >::Set(), Line3< T >::Set(), Line2< T >::Set(), Pose3< T >::Set(), Quaternion< T >::SetFrom2Axes(), MassMatrix3< T >::SetInertiaMatrix(), MassMatrix3< T >::SetMoi(), and Matrix4< T >::TransformAffine().
◆ SetSubmatrix()
|
inline |
Set one of the four 3x3 submatrices that compose this matrix. These submatrices are formed by dividing the 6x6 matrix in 4 parts that do not overlap with each other.
- Parameters
-
[in] _corner Which corner to set. [in] _mat The matrix to set.
Referenced by Inertial< T >::BodyMatrix().
◆ SetValue()
Set a value in a specific row and col param[in] _row Row of the matrix param[in] _col Col of the matrix param[in] _v Value to assign.
- Returns
- Tru if the value was setted, False otherwise
◆ Submatrix()
|
inline |
Get one of the four 3x3 submatrices that compose this matrix. These submatrices are formed by dividing the 6x6 matrix in 4 parts that do not overlap with each other.
- Parameters
-
[in] _corner Which corner to retrieve.
- Returns
- A new matrix containing the values of the submatrix.
◆ Transpose()
Transpose this matrix.
References std::swap().
◆ Transposed()
Return the transpose of this matrix.
- Returns
- Transpose of this matrix.
Referenced by Inertial< T >::BodyMatrix(), Inertial< T >::Moi(), MassMatrix3< T >::SetFromBox(), MassMatrix3< T >::SetFromConeZ(), MassMatrix3< T >::SetFromCylinderZ(), and Inertial< T >::SetMassMatrixRotation().
Member Data Documentation
◆ Identity
Identity matrix.
◆ MatrixSize
|
staticconstexpr |
Size of matrix is fixed to 6x6.
Referenced by Matrix6< T >::Matrix6().
◆ Zero
The documentation for this class was generated from the following file: