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. More... | |
Matrix6 (const Matrix6< T > &_m)=default | |
Copy constructor. More... | |
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. More... | |
bool | Equal (const Matrix6 &_m, const T &_tol) const |
Equality test with tolerance. More... | |
bool | operator!= (const Matrix6< T > &_m) const |
Inequality test operator. More... | |
T & | operator() (const size_t _row, const size_t _col) |
Get a mutable version of the value at the specified row, column index. More... | |
const T & | operator() (const size_t _row, const size_t _col) const |
Get the value at the specified row, column index. More... | |
Matrix6< T > | operator* (const Matrix6< T > &_m2) const |
Multiplication operator. More... | |
Matrix6< T > | operator*= (const Matrix6< T > &_m2) |
Multiplication assignment operator. This matrix will become equal to this * _m2. More... | |
Matrix6< T > | operator+ (const Matrix6< T > &_m2) const |
Addition operator. More... | |
Matrix6< T > | operator+= (const Matrix6< T > &_m2) |
Addition assignment operator. This matrix will become equal to this + _m2. More... | |
Matrix6< T > & | operator= (const Matrix6< T > &_mat)=default |
Assignment operator. this = _mat. More... | |
bool | operator== (const Matrix6< T > &_m) const |
Equality operator. More... | |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
void | Transpose () |
Transpose this matrix. More... | |
Matrix6< T > | Transposed () const |
Return the transpose of this matrix. More... | |
Static Public Attributes | |
static const Matrix6< T > & | Identity = detail::gMatrix6Identity<T> |
Identity matrix. More... | |
static constexpr std::size_t | MatrixSize {6} |
Size of matrix is fixed to 6x6. More... | |
static const Matrix6< T > & | Zero = detail::gMatrix6Zero<T> |
Zero matrix. More... | |
Detailed Description
template<typename T>
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/3]
|
inline |
Constructor.
References Matrix6< T >::MatrixSize.
◆ Matrix6() [2/3]
◆ Matrix6() [3/3]
|
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
Member Function Documentation
◆ Equal()
|
inline |
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.
◆ operator!=()
|
inline |
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]
|
inline |
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]
|
inline |
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=()
Assignment operator. this = _mat.
- Parameters
-
_mat Incoming matrix
- Returns
- itself
◆ operator==()
|
inline |
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
◆ 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()
|
inline |
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()
|
inline |
Transpose this matrix.
References std::swap().
◆ Transposed()
|
inline |
Return the transpose of this matrix.
- Returns
- Transpose of this matrix.
Referenced by Inertial< T >::BodyMatrix().
Member Data Documentation
◆ Identity
|
static |
Identity matrix.
◆ MatrixSize
|
staticconstexpr |
Size of matrix is fixed to 6x6.
Referenced by Matrix6< T >::Matrix6().
◆ Zero
|
static |
Zero matrix.
The documentation for this class was generated from the following file: