Dirty and very incomplete Matrix Class. More...
#include <xmmMatrix.hpp>
Public Member Functions | |
Matrix (bool ownData_=true) | |
Default Constructor. More... | |
Matrix (unsigned int nrows_, bool ownData_=true) | |
Square Matrix Constructor. More... | |
Matrix (unsigned int nrows_, unsigned int ncols_, bool ownData_=true) | |
Constructor. More... | |
Matrix (unsigned int nrows_, unsigned int ncols_, typename std::vector< T >::iterator data_it) | |
Constructor from vector (shared data) More... | |
void | resize (unsigned int nrows_, unsigned int ncols_) |
Resize the matrix. More... | |
void | resize (unsigned int nrows_) |
Resize a Square Matrix. More... | |
float | sum () const |
Compute the Sum of the matrix. More... | |
void | print () const |
Print the matrix. More... | |
Matrix< T > * | transpose () const |
Compute the transpose matrix. More... | |
Matrix< T > * | product (Matrix const *mat) const |
Compute the product of matrices. More... | |
Matrix< T > * | pinv (double *det) const |
Compute the Pseudo-Inverse of a Matrix. More... | |
Matrix< T > * | gauss_jordan_inverse (double *det) const |
Compute the Gauss-Jordan Inverse of a Square Matrix. More... | |
void | swap_lines (unsigned int i, unsigned int j) |
Swap 2 lines of the matrix. More... | |
void | swap_columns (unsigned int i, unsigned int j) |
Swap 2 columns of the matrix. More... | |
Static Public Member Functions | |
static const double | kEpsilonPseudoInverse () |
Epsilon value for Matrix inversion. More... | |
Public Attributes | |
unsigned int | nrows |
number of rows of the matrix More... | |
unsigned int | ncols |
number of columns of the matrix More... | |
std::vector< T > | _data |
Matrix Data if not shared. More... | |
std::vector< T >::iterator | data |
Data iterator. More... | |
bool | ownData |
Defines if the matrix has its own data. More... | |
Dirty and very incomplete Matrix Class.
Contains few utilities for matrix operations, with possibility to share data with vectors
T | data type of the matrix (should be used with float/double) |
|
inline |
Default Constructor.
ownData_ | defines if the matrix stores the data itself (true by default) |
|
inline |
Square Matrix Constructor.
nrows_ | Number of rows (defines a square matrix) |
ownData_ | defines if the matrix stores the data itself (true by default) |
|
inline |
Constructor.
nrows_ | Number of rows |
ncols_ | Number of columns |
ownData_ | defines if the matrix stores the data itself (true by default) |
|
inline |
Constructor from vector (shared data)
nrows_ | Number of rows |
ncols_ | Number of columns |
data_it | iterator to the vector data |
|
inline |
Compute the Gauss-Jordan Inverse of a Square Matrix.
det | Determinant (computed with the inversion) |
runtime_error | if the matrix is not square |
runtime_error | if the matrix is not invertible |
|
inlinestatic |
Epsilon value for Matrix inversion.
defines
|
inline |
Compute the Pseudo-Inverse of a Matrix.
det | Determinant (computed with the inversion) |
|
inline |
Print the matrix.
|
inline |
Compute the product of matrices.
runtime_error | if the matrices have wrong dimensions |
|
inline |
Resize the matrix.
nrows_ | Number of rows |
ncols_ | Number of columns |
runtime_error | if the matrix is not square |
|
inline |
Resize a Square Matrix.
nrows_ | Number of rows |
|
inline |
Compute the Sum of the matrix.
|
inline |
Swap 2 columns of the matrix.
i | index of the first column |
j | index of the second column |
|
inline |
Swap 2 lines of the matrix.
i | index of the first line |
j | index of the second line |
|
inline |
Compute the transpose matrix.
std::vector<T> xmm::Matrix< T >::_data |
Matrix Data if not shared.
std::vector<T>::iterator xmm::Matrix< T >::data |
Data iterator.
Can point to own data vector, or can be shared with another container.
unsigned int xmm::Matrix< T >::ncols |
number of columns of the matrix
unsigned int xmm::Matrix< T >::nrows |
number of rows of the matrix
bool xmm::Matrix< T >::ownData |
Defines if the matrix has its own data.