Fixed-size math matrix. Stores matrix data inline and performs dimension checks at compile time where possible.
More...
|
|
| PIMathMatrixT (const Type &new_value=Type()) |
| | Constructs PIMathMatrixT that is filled by new_value.
|
|
| PIMathMatrixT (const PIVector< Type > &val) |
| | Contructs PIMathMatrixT from PIVector.
|
|
| PIMathMatrixT (std::initializer_list< Type > init_list) |
| | Contructs PIMathMatrixT from C++11 initializer list.
|
| constexpr uint | cols () const |
| | Method which returns number of columns in matrix.
|
| constexpr uint | rows () const |
| | Method which returns number of rows in matrix.
|
| PIMathVectorT< Rows, Type > | col (uint index) |
| | Method which returns the selected column in PIMathVectorT format.
|
| PIMathVectorT< Cols, Type > | row (uint index) |
| | Method which returns the selected row in PIMathVectorT format.
|
| PIMathMatrixT< Rows, Cols, Type > & | setCol (uint index, const PIMathVectorT< Rows, Type > &v) |
| | Set the selected column in matrix.
|
| PIMathMatrixT< Rows, Cols, Type > & | setRow (uint index, const PIMathVectorT< Cols, Type > &v) |
| | Set the selected row in matrix.
|
| PIMathMatrixT< Rows, Cols, Type > & | swapRows (uint rf, uint rs) |
| | Method which swaps the selected rows in a matrix.
|
| PIMathMatrixT< Rows, Cols, Type > & | swapCols (uint cf, uint cs) |
| | Method which swaps the selected columns in a matrix.
|
| PIMathMatrixT< Rows, Cols, Type > & | fill (const Type &v) |
| | Method which fills the matrix with selected value.
|
| constexpr bool | isSquare () const |
| | Method which checks if matrix is square.
|
| bool | isIdentity () const |
| | Method which checks if main diagonal of matrix consists of ones and another elements are zeros.
|
| bool | isNull () const |
| | Method which checks if every elements of matrix are zeros.
|
| Type | at (uint row, uint col) const |
| | Read-only access to element by row number and col number.
|
| Type & | element (uint row, uint col) |
| | Full access to element by row number and col number.
|
| const Type & | element (uint row, uint col) const |
| | Read-only access to element by row number and col number.
|
| Type * | operator[] (uint row) |
| | Full access to the matrix row pointer.
|
| const Type * | operator[] (uint row) const |
| | Read-only access to the matrix row pointer.
|
| bool | operator== (const PIMathMatrixT< Rows, Cols, Type > &sm) const |
| | Matrix compare.
|
| bool | operator!= (const PIMathMatrixT< Rows, Cols, Type > &sm) const |
| | Matrix negative compare.
|
| void | operator+= (const PIMathMatrixT< Rows, Cols, Type > &sm) |
| | Addition assignment with matrix sm.
|
| void | operator-= (const PIMathMatrixT< Rows, Cols, Type > &sm) |
| | Subtraction assignment with matrix sm.
|
| void | operator*= (const Type &v) |
| | Multiplication assignment with value v.
|
| void | operator/= (const Type &v) |
| | Division assignment with value v.
|
| PIMathMatrixT< Rows, Cols, Type > | operator- () const |
| | Negation operation.
|
| PIMathMatrixT< Rows, Cols, Type > | operator+ (const PIMathMatrixT< Rows, Cols, Type > &sm) const |
| | Matrix addition.
|
| PIMathMatrixT< Rows, Cols, Type > | operator- (const PIMathMatrixT< Rows, Cols, Type > &sm) const |
| | Matrix substraction.
|
| PIMathMatrixT< Rows, Cols, Type > | operator* (const Type &v) const |
| | Matrix multiplication by a constant.
|
| PIMathMatrixT< Rows, Cols, Type > | operator/ (const Type &v) const |
| | Division a matrix by a constant.
|
| Type | determinant (bool *ok=0) const |
| | Calculate Determinant of the matrix.
|
| Type | trace () const |
| | Calculate the trace of a matrix.
|
| PIMathMatrixT< Rows, Cols, Type > & | toUpperTriangular (bool *ok=0) |
| | Transforming matrix to upper triangular.
|
| PIMathMatrixT< Rows, Cols, Type > & | invert (bool *ok=0) |
| | Matrix inversion operation.
|
| PIMathMatrixT< Rows, Cols, Type > | inverted (bool *ok=0) const |
| | Matrix inversion operation.
|
| PIMathMatrixT< Cols, Rows, Type > | transposed () const |
| | Matrix transposition operation.
|
| PIMathMatrixT< Rows, Cols, Type > & | rotate (Type angle) |
| | Matrix rotation operation.
|
| PIMathMatrixT< Rows, Cols, Type > | rotated (Type angle) |
| | Matrix rotation operation.
|
|
template<typename T> |
| PIMathMatrixT< Rows, Cols, T > | toType () const |
| | Returns this matrix with another element type.
|
|
template<uint SubRows, uint SubCols = SubRows> |
| PIMathMatrixT< SubRows, SubCols, Type > | submatrix (int row_offset=0, int col_offset=0) const |
| | Returns the submatrix with size SubRows x SubCols. Elements takes from coordinates "row_offset" and "col_offset".
|
|
template<uint SubRows, uint SubCols = SubRows> |
| PIMathMatrixT< Rows, Cols, Type > & | setSubmatrix (int row_index, int col_index, const PIMathMatrixT< SubRows, SubCols, Type > &m) |
| | Set the submatrix "m" in coordinates "row_index" and "col_index".
|
template<uint Rows, uint Cols = Rows, typename Type = double>
class PIMathMatrixT< Rows, Cols, Type >
Fixed-size math matrix. Stores matrix data inline and performs dimension checks at compile time where possible.
A class for fixed size and type matrix.
- Template Parameters
-
| `Rows` | rows number of matrix. |
| `Сols` | columns number of matrix. |
| `Type` | is the data type of the matrix. There are can be basic C++ language data and different classes where the arithmetic operators(=, +=, -=, *=, /=, ==, !=, +, -, *, /) of the C++ language are implemented |