#include <plFloatMatrix.h>
Inheritance diagram for plFloatMatrix:
Public Member Functions | |
plFloatMatrix () | |
Default void constructor. | |
plFloatMatrix (unsigned int r, unsigned int c, bool init_to_zero=false) | |
Constructs a matrix having {r x c} elements. | |
plFloatMatrix (unsigned int d, bool init_to_zero=false) | |
Constructs a matrix having {d x d} elements. | |
plFloatMatrix (unsigned int d, const float *float_vector) | |
Constructs a matrix having {d x d} elements and fills it using the {float_vector} C array of {float} values so that {m[i][j] = float_vector[i*d+j] } for i, j = 0...d-1. | |
plFloatMatrix (unsigned int d, const double *double_vector) | |
Constructs a matrix having {d x d} elements and fills it using the {double_vector} C array of {double} values so that {m[i][j] = double_vector[i*d+j] } for i, j = 0...d-1. | |
plFloatMatrix (unsigned int d, const long double *long_double_vector) | |
Constructs a matrix having {d x d} elements and fills it using the {long_double_vector} C array of {long double} values so that {m[i][j] = long_double_vector[i*d+j] } for i, j = 0...d-1. | |
plFloatMatrix (const vector< float > &float_vector) | |
Constructs a matrix having {d x d} elements and fills it using the {float_vector} STL vector of {float} values so that {m[i][j] = float_vector[i*d+j] } for i, j = 0...d-1. | |
plFloatMatrix (const vector< double > &double_vector) | |
Constructs a matrix having {d x d} elements and fills it using the {double_vector} STL vector of {double} values so that {m[i][j] = double_vector[i*d+j] } for i, j = 0...d-1. | |
plFloatMatrix (const vector< long double > &long_double_vector) | |
Constructs a matrix having {d x d} elements and fills it using the {long_double_vector} STL vector of {long double} values so that {m[i][j] = long_double_vector[i*d+j] } for i, j = 0...d-1. | |
plFloatMatrix (const vector< vector< float > > &stl_matrix) | |
Conversion from an STL float matrix. | |
plFloatMatrix (const vector< vector< double > > &stl_matrix) | |
Conversion from an STL double matrix. | |
plFloatMatrix (const vector< vector< long double > > &stl_matrix) | |
Conversion from an STL floatlong double matrix. | |
plFloatMatrix (const plFloatMatrix &) | |
Copy constructor. | |
plFloatMatrix (const plFloatVector &diag_vector) | |
Constructs a diagonal square matrix having {diag_vector} as diagonal. | |
void | resize (unsigned int nr, unsigned int nc, bool init_to_zero=false) |
Sets the size of the matrix to {nr x nc}. | |
void | resize (unsigned int nr, bool init_to_zero=false) |
Sets the size of the matrix to {nr x nr}. | |
virtual | ~plFloatMatrix () |
Destructor. | |
unsigned int | rows () const |
Returns the number of rows. | |
unsigned int | cols () const |
Returns the number of columns. | |
plFloat | operator() (unsigned int r, unsigned int c) const |
Returns the (r, c) element of the matrix if {r} and {c} are not out of range. | |
plFloat & | operator() (unsigned int r, unsigned int c) |
Returns a reference to the (r, c) element of the matrix if {r} and {c} are not out of range. | |
plFloat * | operator[] (unsigned int i) const |
Returns a C array containing the ith row of the matrix. | |
plFloat * | operator[] (unsigned int i) |
Returns a C array containing the ith row of the matrix. | |
plFloatVector | row (unsigned int i) const |
Returns a plFloatVector containing the ith row of the matrix. | |
plFloatVector | column (unsigned int j) const |
Returns a plFloatVector containing the jth column of the matrix. | |
plFloatMatrix & | operator= (const plFloatMatrix &) |
Assignment operator. | |
plFloatMatrix | operator+ (const plFloatMatrix &) const |
Addition operator. | |
plFloatMatrix & | operator+= (const plFloatMatrix &) |
Addition operator. | |
plFloatMatrix | operator- (const plFloatMatrix &) const |
Subtraction operator. | |
plFloatMatrix & | operator-= (const plFloatMatrix &) |
Subtraction operator. | |
plFloatMatrix | operator * (const plFloatMatrix &) const |
Multiplication with an other matrix operator. | |
plFloatVector | operator * (const plFloatVector &) const |
Multiplication with a vector operator. | |
bool | operator== (const plFloatMatrix &) const |
Equality test operator. | |
plFloatMatrix | transpose () const |
Returns the transpose of the matrix. | |
void | transpose (plFloatMatrix &result) const |
Returns the transpose of the matrix in the {result} matrix. | |
plFloat | trace () const |
Returns the trace of the matrix. | |
plFloat | inverse (plFloatMatrix &inverse, plFloat threshold=PL_ONE) const |
Inverses the matrix (returns the pseudo-inverse if the matrix is not a square one), returns the result in the {inverse} matrix and returns the determinant of the matrix. | |
void | diagonalize (plFloatMatrix &Eigen_Matrix, plFloatVector &Eigen_Vector) const |
Digonalizes the matrix and returns: - Eigen vectors in the result matrix {Eigen_Matrix} - Eigen values in the result vector {Eigen_Vector} IMPORTANT: The algorithm used for diagonalization is ONLY valid for SYMMETRIC matrices (such as variance/covariance matrices for Normal distributions). | |
void | reset () |
Resets the matrix to 0. | |
void | reset (float val) |
Resets the matrix to val. | |
void | reset (double val) |
Resets the matrix to val. | |
void | reset (long double val) |
Resets the matrix to val. | |
Protected Member Functions | |
void | Output (ostream &out) const |
Output. | |
Friends | |
plFloatMatrix | operator * (const long double &, const plFloatMatrix &) |
Multiplication with a scalar operator. | |
plFloatMatrix | operator * (const double &, const plFloatMatrix &) |
Multiplication with a scalar operator. | |
plFloatMatrix | operator * (const float &, const plFloatMatrix &) |
Multiplication with a scalar operator. | |
plFloatMatrix | operator * (const int &, const plFloatMatrix &) |
Multiplication with a scalar operator. | |
plFloatMatrix | operator * (const unsigned int &, const plFloatMatrix &) |
Multiplication with a scalar operator. |
Definition at line 36 of file plFloatMatrix.h.
|
Inverses the matrix (returns the pseudo-inverse if the matrix is not a square one), returns the result in the {inverse} matrix and returns the determinant of the matrix. The optional parameter {threshold} is used for Greville's algorithm we use for inversion. |