![]() |
PIP 5.5.3
Platform-Independent Primitives
|
A class for fixed size and type matrix. More...
#include <pimathmatrix.h>
Public Member Functions | |
| 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. More... | |
| constexpr uint | rows () const |
| Method which returns number of rows in matrix. More... | |
| PIMathVectorT< Rows, Type > | col (uint index) |
| Method which returns the selected column in PIMathVectorT format. More... | |
| PIMathVectorT< Cols, Type > | row (uint index) |
| Method which returns the selected row in PIMathVectorT format. More... | |
| PIMathMatrixT< Rows, Cols, Type > & | setCol (uint index, const PIMathVectorT< Rows, Type > &v) |
| Set the selected column in matrix. More... | |
| PIMathMatrixT< Rows, Cols, Type > & | setRow (uint index, const PIMathVectorT< Cols, Type > &v) |
| Set the selected row in matrix. More... | |
| PIMathMatrixT< Rows, Cols, Type > & | swapRows (uint rf, uint rs) |
| Method which swaps the selected rows in a matrix. More... | |
| PIMathMatrixT< Rows, Cols, Type > & | swapCols (uint cf, uint cs) |
| Method which swaps the selected columns in a matrix. More... | |
| PIMathMatrixT< Rows, Cols, Type > & | fill (const Type &v) |
| Method which fills the matrix with selected value. More... | |
| constexpr bool | isSquare () const |
| Method which checks if matrix is square. More... | |
| bool | isIdentity () const |
| Method which checks if main diagonal of matrix consists of ones and another elements are zeros. More... | |
| bool | isNull () const |
| Method which checks if every elements of matrix are zeros. More... | |
| Type | at (uint row, uint col) const |
Read-only access to element by row number and col number. More... | |
| Type & | element (uint row, uint col) |
Full access to element by row number and col number. More... | |
| const Type & | element (uint row, uint col) const |
Read-only access to element by row number and col number. More... | |
| Type * | operator[] (uint row) |
| Full access to the matrix row pointer. More... | |
| const Type * | operator[] (uint row) const |
| Read-only access to the matrix row pointer. More... | |
| bool | operator== (const PIMathMatrixT< Rows, Cols, Type > &sm) const |
| Matrix compare. More... | |
| bool | operator!= (const PIMathMatrixT< Rows, Cols, Type > &sm) const |
| Matrix negative compare. More... | |
| void | operator+= (const PIMathMatrixT< Rows, Cols, Type > &sm) |
Addition assignment with matrix sm. More... | |
| void | operator-= (const PIMathMatrixT< Rows, Cols, Type > &sm) |
Subtraction assignment with matrix sm. More... | |
| void | operator*= (const Type &v) |
Multiplication assignment with value v. More... | |
| void | operator/= (const Type &v) |
Division assignment with value v. More... | |
| PIMathMatrixT< Rows, Cols, Type > | operator- () const |
| Negation operation. More... | |
| PIMathMatrixT< Rows, Cols, Type > | operator+ (const PIMathMatrixT< Rows, Cols, Type > &sm) const |
| Matrix addition. More... | |
| PIMathMatrixT< Rows, Cols, Type > | operator- (const PIMathMatrixT< Rows, Cols, Type > &sm) const |
| Matrix substraction. More... | |
| PIMathMatrixT< Rows, Cols, Type > | operator* (const Type &v) const |
| Matrix multiplication by a constant. More... | |
| PIMathMatrixT< Rows, Cols, Type > | operator/ (const Type &v) const |
| Division a matrix by a constant. More... | |
| Type | determinant (bool *ok=0) const |
| Calculate Determinant of the matrix. More... | |
| Type | trace () const |
| Calculate the trace of a matrix. More... | |
| PIMathMatrixT< Rows, Cols, Type > & | toUpperTriangular (bool *ok=0) |
| Transforming matrix to upper triangular. More... | |
| PIMathMatrixT< Rows, Cols, Type > & | invert (bool *ok=0) |
| Matrix inversion operation. More... | |
| PIMathMatrixT< Rows, Cols, Type > | inverted (bool *ok=0) const |
| Matrix inversion operation. More... | |
| PIMathMatrixT< Cols, Rows, Type > | transposed () const |
| Matrix transposition operation. More... | |
| PIMathMatrixT< Rows, Cols, Type > & | rotate (Type angle) |
| Matrix rotation operation. More... | |
| PIMathMatrixT< Rows, Cols, Type > | rotated (Type angle) |
| Matrix rotation operation. More... | |
| 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". | |
Static Public Member Functions | |
| static PIMathMatrixT< Rows, Cols, Type > | identity () |
| Сreates a matrix whose main diagonal is filled with ones and the remaining elements are zeros. More... | |
A class for fixed size and type matrix.
| `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 |
|
inlinestatic |
Сreates a matrix whose main diagonal is filled with ones and the remaining elements are zeros.
|
inlineconstexpr |
Method which returns number of columns in matrix.
|
inlineconstexpr |
Method which returns number of rows in matrix.
|
inline |
Method which returns the selected column in PIMathVectorT format.
If you enter an index out of the border of the matrix there will be "undefined behavior".
| index | is the number of the selected column. |
|
inline |
Method which returns the selected row in PIMathVectorT format.
If you enter an index out of the border of the matrix there will be "undefined behavior".
| index | is the number of the selected row. |
|
inline |
Set the selected column in matrix.
If you enter an index out of the border of the matrix there will be "undefined behavior".
| index | is the number of the selected column. |
| v | is a vector of the type PIMathVectorT<Rows, Type> that needs to fill the column. |
|
inline |
Set the selected row in matrix.
If you enter an index out of the border of the matrix there will be "undefined behavior".
| index | is the number of the selected row. |
| v | is a vector of the type PIMathVectorT<Cols, Type> that needs to fill the row. |
|
inline |
Method which swaps the selected rows in a matrix.
If you enter an index out of the border of the matrix there will be "undefined behavior"
| rf | is the number of the first selected row |
| rs | is the number of the second selected row |
|
inline |
Method which swaps the selected columns in a matrix.
If you enter an index out of the border of the matrix there will be "undefined behavior"
| cf | is the number of the first selected column |
| cs | is the number of the second selected column |
|
inline |
Method which fills the matrix with selected value.
| v | is a parameter the type and value of which is selected and later filled into the matrix. |
|
inlineconstexpr |
Method which checks if matrix is square.
|
inline |
Method which checks if main diagonal of matrix consists of ones and another elements are zeros.
|
inline |
Method which checks if every elements of matrix are zeros.
|
inline |
Read-only access to element by row number and col number.
If you enter an index out of the border of the matrix there will be "undefined behavior".
| row | matrix row number. |
| col | matrix column number. |
|
inline |
Full access to element by row number and col number.
If you enter an index out of the border of the matrix there will be "undefined behavior"
| row | matrix row number. |
| col | matrix column number. |
|
inline |
Read-only access to element by row number and col number.
If you enter an index out of the border of the matrix there will be "undefined behavior".
| row | matrix row number. |
| col | matrix column number. |
|
inline |
Full access to the matrix row pointer.
If you enter an index out of the border of the matrix there will be "undefined behavior".
| row | matrix row number. |
|
inline |
Read-only access to the matrix row pointer.
If you enter an index out of the border of the matrix there will be "undefined behavior".
| row | matrix row number. |
|
inline |
Matrix compare.
| sm | matrix for compare. |
|
inline |
Matrix negative compare.
| sm | matrix for compare. |
|
inline |
Addition assignment with matrix sm.
| sm | matrix for the addition assigment. |
|
inline |
Subtraction assignment with matrix sm.
| sm | matrix for the subtraction assigment. |
|
inline |
Multiplication assignment with value v.
| v | value for the multiplication assigment. |
|
inline |
Division assignment with value v.
| v | value for the division assigment. |
|
inline |
Negation operation.
|
inline |
Matrix addition.
| sm | is matrix term. |
|
inline |
Matrix substraction.
| sm | is matrix subtrahend. |
|
inline |
Matrix multiplication by a constant.
| v | is value factor. |
|
inline |
Division a matrix by a constant.
| v | is value divider. |
|
inline |
Calculate Determinant of the matrix.
Works only with square matrix, nonzero matrices and invertible matrix.
| ok | is a parameter with which we can find out if the method worked correctly. |
|
inline |
Calculate the trace of a matrix.
Works only with square matrix.
|
inline |
Transforming matrix to upper triangular.
Works only with square matrix, nonzero matrices and invertible matrix.
| ok | is a parameter with which we can find out if the method worked correctly. |
|
inline |
Matrix inversion operation.
Works only with square matrix, nonzero matrices and invertible matrix.
| ok | is a parameter with which we can find out if the method worked correctly. |
|
inline |
Matrix inversion operation.
Works only with square matrix, nonzero matrices and invertible matrix.
| ok | is a parameter with which we can find out if the method worked correctly. |
|
inline |
Matrix transposition operation.
Works only with square matrix.
|
inline |
Matrix rotation operation.
Works only with 2x2 matrix.
|
inline |
Matrix rotation operation.
Works only with 2x2 matrix.