Base template for Matrix. More...
#include </home/chochlik/devel/oglplus/include/oglplus/math/matrix.hpp>
Public Member Functions | |
Matrix (void) | |
Default construction (identity matrix) | |
Matrix (const T *data, std::size_t n) | |
Constructuion from raw data. | |
Matrix (const T(&data)[Rows *Cols]) | |
Constructuion from static array. | |
template<typename... P> | |
Matrix (P...p) | |
Initializing constructor. More... | |
template<typename... C> | |
Matrix (const Vector< T, C >...row) | |
Initialization from row vectors. More... | |
const T * | Data (void) const |
Returns a pointer to the matrix elements in row major order. | |
std::size_t | Size (void) const |
Returns the number of elements of the matrix. | |
T | At (std::size_t i, std::size_t j) const |
Returns the value of the element at position i, j. More... | |
void | Set (std::size_t i, std::size_t j, T v) |
Sets the value of the element at position i, j. More... | |
Vector< T, Cols > | Row (std::size_t i) const |
Returns the i-th row of this matrix. More... | |
Vector< T, Rows > | Col (std::size_t j) const |
Return the j-th column of this matrix. More... | |
template<std::size_t I, std::size_t J, std::size_t R, std::size_t C> | |
Matrix< T, R, C > | Submatrix (void) const |
Submatrix extraction. | |
Friends | |
const T * | Data (const Matrix &matrix) |
Returns apointer to the matrix elements in row major order. | |
std::size_t | Size (const Matrix &matrix) |
Returns the number of elements of the matrix. | |
std::size_t | Rows (const Matrix &matrix) |
Returns the number of rows of the matrix. | |
std::size_t | Cols (const Matrix &matrix) |
Returns the number of columns of the matrix. | |
bool | Equal (const Matrix &a, const Matrix &b) |
Equality comparison function. | |
bool | operator== (const Matrix &a, const Matrix &b) |
Equality comparison operator. | |
bool | operator!= (const Matrix &a, const Matrix &b) |
Unequality comparison operator. | |
Matrix | Negated (const Matrix &a) |
Element negation function. | |
Matrix | operator- (const Matrix &a) |
Element negation operator. | |
Matrix | Added (const Matrix &a, const Matrix &b) |
Matrix addition. | |
Matrix | operator+ (const Matrix &a, const Matrix &b) |
Matrix addition operator. | |
Matrix | Subtracted (const Matrix &a, const Matrix &b) |
Matrix subtraction. | |
Matrix | operator- (const Matrix &a, const Matrix &b) |
Matrix subtraction operator. | |
template<std::size_t N> | |
Matrix | Multiplied (const Matrix< T, Rows, N > &a, const Matrix< T, N, Cols > &b) |
Matrix multiplication. | |
template<std::size_t N> | |
Matrix | operator* (const Matrix< T, Rows, N > &a, const Matrix< T, N, Cols > &b) |
Matrix multiplication operator. | |
Matrix | Multiplied (const Matrix &a, T m) |
Multiplication by scalar value. | |
Matrix | operator* (const Matrix &a, T m) |
Multiplication by scalar value operator. | |
Matrix | operator* (T m, const Matrix &a) |
Multiplication by scalar value operator. | |
Matrix | Transposed (const Matrix< T, Cols, Rows > &a) |
Matrix transposition. | |
Matrix< T, 2, 2 > | Sub2x2 (const Matrix &a) |
2x2 submatrix extraction | |
Matrix< T, 3, 3 > | Sub3x3 (const Matrix &a) |
3x3 submatrix extraction | |
void | RowSwap (Matrix &m, std::size_t a, std::size_t b) |
Swaps two rows of the Matrix. | |
void | RowMultiply (Matrix &m, std::size_t i, T k) |
Multiplies row i with coeficient k. | |
void | RowAdd (Matrix &m, std::size_t a, std::size_t b, T k) |
Adds row b multipled by coeficient k to row a. | |
template<std::size_t C> | |
bool | Gauss (Matrix &a, Matrix< T, Rows, C > &b) |
The gaussian matrix elimination. | |
template<std::size_t C> | |
bool | GaussJordan (Matrix &a, Matrix< T, Rows, C > &b) |
The Gauss-Jordan matrix elimination. | |
Base template for Matrix.
|
explicit |
Initializing constructor.
Allows to explicitly initialize all elements of the matrix. The number of parameters of this constructor must be Rows * Cols.
|
explicit |
Initialization from row vectors.
Allows to initialize the matrix from row vectors The number of vectors must be Rows, each vector must have Cols components.
T oglplus::Matrix< T, Rows, Cols >::At | ( | std::size_t | i, |
std::size_t | j | ||
) | const |
Returns the value of the element at position i, j.
Vector<T, Rows> oglplus::Matrix< T, Rows, Cols >::Col | ( | std::size_t | j | ) | const |
Return the j-th column of this matrix.
Vector<T, Cols> oglplus::Matrix< T, Rows, Cols >::Row | ( | std::size_t | i | ) | const |
Returns the i-th row of this matrix.
void oglplus::Matrix< T, Rows, Cols >::Set | ( | std::size_t | i, |
std::size_t | j, | ||
T | v | ||
) |
Sets the value of the element at position i, j.