FastUIDraw
|
A generic matrix class. The operator() is overloaded to access elements of the matrix as follows: More...
#include <matrix.hpp>
Public Types | |
enum | { number_rows = N, number_cols = M } |
typedef vecN< T, N *M > | raw_data_type |
Typedef to underlying vecN that holds the matrix data. | |
Public Member Functions | |
matrixNxM (const matrixNxM &obj) | |
matrixNxM (void) | |
T * | c_ptr (void) |
const T * | c_ptr (void) const |
T & | col_row (unsigned int col, unsigned row) |
const T & | col_row (unsigned int col, unsigned row) const |
T & | operator() (unsigned int row, unsigned int col) |
const T & | operator() (unsigned int row, unsigned int col) const |
matrixNxM | operator* (T value) const |
template<size_t K> | |
matrixNxM< N, K, T > | operator* (const matrixNxM< M, K, T > &matrix) const |
vecN< T, N > | operator* (const vecN< T, M > &in) const |
matrixNxM | operator+ (const matrixNxM &matrix) const |
matrixNxM | operator- (const matrixNxM &matrix) const |
vecN< T, N *M > & | raw_data (void) |
const vecN< T, N *M > & | raw_data (void) const |
void | reset (void) |
void | swap (matrixNxM &obj) |
void | transpose (matrixNxM< M, N, T > &retval) const |
matrixNxM< M, N, T > | transpose (void) const |
Friends | |
matrixNxM | operator* (T value, const matrixNxM &matrix) |
vecN< T, M > | operator* (const vecN< T, N > &in, const matrixNxM &matrix) |
A generic matrix class. The operator() is overloaded to access elements of the matrix as follows:
* matrix(0 , 0) matrix(0 , 1) matrix(0 , 2) ... matrix(0 , M - 1) * matrix(1 , 0) matrix(1 , 1) matrix(1 , 2) ... matrix(1 , M - 1) * . * . * . * matrix(N - 2, 0) matrix(N - 2, 1) matrix(N - 1, 2) ... matrix(N - 2, M - 1) * matrix(N - 1, 0) matrix(N - 1, 1) matrix(N - 1, 2) ... matrix(N - 1, M - 1) *
The data is represented internally with a 1-dimensional array with the packing order
N | height of matrix |
M | width of matrix |
T | matrix entry type |
Definition at line 59 of file matrix.hpp.
anonymous enum |
Enumerator | |
---|---|
number_rows | Enumeration value for size of the matrix. |
number_cols | Enumeration value for size of the matrix. |
Definition at line 72 of file matrix.hpp.
|
inline |
Copy-constructor for a NxN matrix.
obj | matrix to copy |
Definition at line 89 of file matrix.hpp.
|
inline |
Ctor. Initializes an NxN matrix as diagnols are 1 and other values are 0, for square matrices, that is the identity matrix.
Definition at line 99 of file matrix.hpp.
|
inline |
Returns a c-style pointer to the data.
Definition at line 133 of file matrix.hpp.
|
inline |
Returns a constant c-style pointer to the data.
Definition at line 139 of file matrix.hpp.
|
inline |
Returns the named entry of the matrix; provided as a conveniance to interface with systems where access of elements is column then row or to more easily access the transpose of the matrix.
col | column(horizontal coordinate) in the matrix |
row | row(vertical coordinate) in the matrix |
Definition at line 188 of file matrix.hpp.
|
inline |
Returns the named entry of the matrix; provided as a conveniance to interface with systems where access of elements is column then row or to more easily access the transpose of the matrix.
col | column(horizontal coordinate) in the matrix |
row | row(vertical coordinate) in the matrix |
Definition at line 204 of file matrix.hpp.
|
inline |
Returns the named entry of the matrix
row | row(vertical coordinate) in the matrix |
col | column(horizontal coordinate) in the matrix |
Definition at line 159 of file matrix.hpp.
|
inline |
Returns the named entry of the matrix
row | row(vertical coordinate) in the matrix |
col | column(horizontal coordinate) in the matrix |
Definition at line 172 of file matrix.hpp.
|
inline |
Multiplies the matrix with a given scalar.
value | scalar to multiply with |
Definition at line 267 of file matrix.hpp.
|
inline |
Multiplies this matrix with the given matrix.
matrix | target matrix |
Definition at line 295 of file matrix.hpp.
|
inline |
Computes the value of matrixNxM * vecN
in | right operand of multiply |
Definition at line 319 of file matrix.hpp.
|
inline |
Operator for adding matrices together.
matrix | target matrix |
Definition at line 243 of file matrix.hpp.
|
inline |
Operator for substracting matrices from each other.
matrix | target matrix |
Definition at line 255 of file matrix.hpp.
|
inline |
Returns a reference to raw data vector in the matrix.
Definition at line 145 of file matrix.hpp.
|
inline |
Returns a const reference to the raw data vectors in the matrix.
Definition at line 151 of file matrix.hpp.
|
inline |
Set matrix as identity.
Definition at line 108 of file matrix.hpp.
|
inline |
Swaps the values between this and the parameter matrix.
obj | matrix to swap values with |
Definition at line 124 of file matrix.hpp.
|
inline |
Compute the transpose of the matrix
retval | location to which to write the transpose |
Definition at line 216 of file matrix.hpp.
|
inline |
Returns a transpose of the matrix.
Definition at line 231 of file matrix.hpp.
|
friend |
Multiplies the given matrix with the given scalar and returns the resulting matrix.
value | scalar to multiply with |
matrix | target matrix to multiply |
Definition at line 282 of file matrix.hpp.
|
friend |
Computes the value of vecN * matrixNxM
in | left operand of multiply |
matrix | right operand of multiply |
Definition at line 342 of file matrix.hpp.