|
DynMatrix< T > | dyn () |
| creates a shallow copied DynMatrix instance wrapping this' data More...
|
|
const DynMatrix< T > | dyn () const |
| creates a shallow copied DynMatrix instance wrapping this' data (const) More...
|
|
| FixedMatrix () |
| Default constructor. More...
|
|
| FixedMatrix (const T &initValue) |
| Create Matrix and initialize elements with given value. More...
|
|
| FixedMatrix (const T *srcdata) |
| Create matrix with given data pointer (const version) More...
|
|
| FixedMatrix (const T &v0, const T &v1, const T &v2=0, const T &v3=0, const T &v4=0, const T &v5=0, const T &v6=0, const T &v7=0, const T &v8=0, const T &v9=0, const T &v10=0, const T &v11=0, const T &v12=0, const T &v13=0, const T &v14=0, const T &v15=0) |
| Create matrix with given initializer elements (16 values max) More...
|
|
template<class OtherIterator > |
| FixedMatrix (OtherIterator begin, OtherIterator end) |
| Range based constructor for STL compatiblitiy. More...
|
|
| FixedMatrix (const FixedMatrix &other) |
|
template<class otherT > |
| FixedMatrix (const FixedMatrix< otherT, COLS, ROWS > &other) |
|
template<class Iterator > |
| FixedMatrix (const FixedMatrixPart< T, DIM, Iterator > &r) |
| Create matrix of a sub-part of another matrix (identical types) More...
|
|
template<class otherT , class Iterator > |
| FixedMatrix (const FixedMatrixPart< otherT, DIM, Iterator > &r) |
| Create matrix of a sub-part of another matrix (compatible types) More...
|
|
FixedMatrix & | operator= (const FixedMatrix &other) |
| Assignment operator (with compatible data type) (deep copy) More...
|
|
template<class otherT > |
FixedMatrix & | operator= (const FixedMatrix< otherT, COLS, ROWS > &other) |
| Assignment operator (with compatible data type) (deep copy) More...
|
|
FixedMatrix & | operator= (const T &t) |
| Assign all elements with given value. More...
|
|
template<class Iterator > |
FixedMatrix & | operator= (const FixedMatrixPart< T, DIM, Iterator > &r) |
| Assign matrix elements with sup-part of another matrix (identical types) More...
|
|
template<class otherT , class Iterator > |
FixedMatrix & | operator= (const FixedMatrixPart< otherT, DIM, Iterator > &r) |
| Assign matrix elements with sup-part of another matrix (compatible types) More...
|
|
FixedMatrix | operator/ (const FixedMatrix &m) const |
| Matrix devision. More...
|
|
FixedMatrix & | operator/= (const FixedMatrix &m) |
| Matrix devision (inplace) More...
|
|
FixedMatrix | operator * (T f) const |
| Multiply all elements by a scalar. More...
|
|
FixedMatrix & | operator *= (T f) |
| moved outside the class Multiply all elements by a scalar (inplace) More...
|
|
FixedMatrix | operator/ (T f) const |
| Divide all elements by a scalar. More...
|
|
FixedMatrix & | operator/= (T f) |
| Divide all elements by a scalar. More...
|
|
FixedMatrix | operator+ (const T &t) const |
| Add a scalar to each element. More...
|
|
FixedMatrix & | operator+= (const T &t) |
| Add a scalar to each element (inplace) More...
|
|
FixedMatrix | operator- (const T &t) const |
| Substract a scalar from each element. More...
|
|
FixedMatrix & | operator-= (const T &t) |
| Substract a scalar from each element (inplace) More...
|
|
FixedMatrix | operator+ (const FixedMatrix &m) const |
| Element-wise matrix addition. More...
|
|
FixedMatrix & | operator+= (const FixedMatrix &m) |
| Element-wise matrix addition (inplace) More...
|
|
FixedMatrix | operator- (const FixedMatrix &m) const |
| Element-wise matrix subtraction. More...
|
|
FixedMatrix & | operator-= (const FixedMatrix &m) |
| Element-wise matrix subtraction (inplace) More...
|
|
FixedMatrix | operator- () const |
| Prefix - operator. More...
|
|
T & | operator() (unsigned int col, unsigned int row) |
| Element access operator. More...
|
|
const T & | operator() (unsigned int col, unsigned int row) const |
| Element access operator (const) More...
|
|
T & | at (unsigned int col, unsigned int row) |
| Element access index save (with exception if index is invalid) More...
|
|
const T & | at (unsigned int col, unsigned int row) const |
| Element access index save (with exception if index is invalid) (const) More...
|
|
T & | operator[] (unsigned int idx) |
| linear data view element access More...
|
|
const T & | operator[] (unsigned int idx) const |
| linear data view element access (const) More...
|
|
T * | data () |
| return internal data pointer More...
|
|
const T * | data () const |
| return internal data pointer (const) More...
|
|
iterator | begin () |
| returns an iterator to first element iterating over each element (row-major order) More...
|
|
iterator | end () |
| returns an iterator after the last element More...
|
|
const_iterator | begin () const |
| returns an iterator to first element iterating over each element (row-major order) (const) More...
|
|
const_iterator | end () const |
| returns an iterator after the last element (const) More...
|
|
col_iterator | col_begin (unsigned int col) |
| returns an iterator iterating over a certain column More...
|
|
col_iterator | col_end (unsigned int col) |
| row end iterator More...
|
|
const_col_iterator | col_begin (unsigned int col) const |
| returns an iterator iterating over a certain column (const) More...
|
|
const_col_iterator | col_end (unsigned int col) const |
| row end iterator const More...
|
|
row_iterator | row_begin (unsigned int row) |
| returns an iterator iterating over a certain row More...
|
|
row_iterator | row_end (unsigned int row) |
| row end iterator More...
|
|
const_row_iterator | row_begin (unsigned int row) const |
| returns an iterator iterating over a certain row (const) More...
|
|
const_row_iterator | row_end (unsigned int row) const |
| row end iterator (const) More...
|
|
template<unsigned int MCOLS> |
void | mult (const FixedMatrix< T, MCOLS, COLS > &m, FixedMatrix< T, MCOLS, ROWS > &dst) const |
| inplace matrix multiplication (dst = (*this)*m) More...
|
|
template<unsigned int MCOLS> |
FixedMatrix< T, MCOLS, ROWS > | operator * (const FixedMatrix< T, MCOLS, COLS > &m) const |
| Matrix multiplication (essential) More...
|
|
FixedMatrix | inv () const |
| invert the matrix (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f) More...
|
|
T | det () const |
| calculate matrix determinant (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f) More...
|
|
FixedMatrix< T, ROWS, COLS > | transp () const |
| returns matrix's transposed More...
|
|
template<unsigned int OTHER_COLS> |
T | element_wise_inner_product (const FixedMatrix< T, OTHER_COLS, DIM/OTHER_COLS > &other) const |
| inner product of data pointers (not matrix-mulitiplication) More...
|
|
template<unsigned int OTHER_COLS> |
FixedMatrix< T, OTHER_COLS, COLS > | dot (const FixedMatrix< T, OTHER_COLS, ROWS > &M) const |
| returns the inner product of two matrices (i.e. dot-product) More...
|
|
double | cond (const double p=2) const |
| computes the condition of a fixed matrix More...
|
|
T | trace () const |
| computes the sum of all diagonal elements More...
|
|
FixedMatrixPart< T, COLS, row_iterator > | row (unsigned int idx) |
| returns a matrix row-reference iterator pair More...
|
|
FixedMatrixPart< T, COLS, const_row_iterator > | row (unsigned int idx) const |
| returns a matrix row-reference iterator pair (const) More...
|
|
FixedMatrixPart< T, ROWS, col_iterator > | col (unsigned int idx) |
| returns a matrix col-reference iterator pair More...
|
|
FixedMatrixPart< T, ROWS, const_col_iterator > | col (unsigned int idx) const |
| returns a matrix col-reference iterator pair (const) More...
|
|
template<unsigned int X, unsigned int Y, unsigned int WIDTH, unsigned int HEIGHT> |
FixedMatrixPart< T, WIDTH *HEIGHT, MatrixSubRectIterator< T > > | part () |
| extracts a rectangular matrix sub region More...
|
|
template<unsigned int X, unsigned int Y, unsigned int WIDTH, unsigned int HEIGHT> |
const FixedMatrixPart< T, WIDTH *HEIGHT, MatrixSubRectIterator< T > > | part () const |
| extracts a rectangular matrix sub region (const) More...
|
|
template<unsigned int NEW_WIDTH, unsigned int NEW_HEIGHT> |
FixedMatrix< T, NEW_WIDTH, NEW_HEIGHT > | resize (const T &init=T(0)) const |
| extends/shrinks matrix dimensions while preserving content on remaining elements (without scaling) More...
|
|
double | length (T norm=2) const |
| Calculates the length of the matrix data vector. More...
|
|
void | normalize (T norm=2) |
| inplace normalization More...
|
|
FixedMatrix< T, COLS, ROWS > | normalized (T norm=2) const |
| create a normalized version of this matrix More...
|
|
template<class otherT > |
bool | operator== (const FixedMatrix< otherT, COLS, ROWS > &m) const |
| Element-wise comparison with other matrix. More...
|
|
template<class otherT > |
bool | operator!= (const FixedMatrix< otherT, COLS, ROWS > &m) const |
| Element-wise comparison with other matrix. More...
|
|
FixedMatrix< T, 1, ROWS > | diag () const |
| returns a vector of the diagonal elements (only for squared matrices) More...
|
|
void | decompose_QR (FixedMatrix< T, COLS, ROWS > &Q, FixedMatrix< T, COLS, COLS > &R) const |
| computes the QR decomposition of a matrix More...
|
|
void | decompose_RQ (FixedMatrix< T, ROWS, ROWS > &R, FixedMatrix< T, ROWS, ROWS > &Q) const |
| computes the RQ decomposition of a matrix More...
|
|
void | svd (FixedMatrix< T, COLS, ROWS > &U, FixedMatrix< T, 1, COLS > &s, FixedMatrix< T, COLS, COLS > &V) const |
| computes Singular Value Decomposition of this Matrix A = U diag(s) V' More...
|
|
FixedMatrix< T, ROWS, COLS > | pinv (bool useSVD=0, float zeroThreshold=0.00000000000000001) const |
| Computes the Matrix's pseudo-inverse. More...
|
|
void | eigen (FixedMatrix &eigenvectors, FixedMatrix< T, 1, COLS > &eigenvalues) const |
| Extracts the matrix's eigenvalues and eigenvectors. More...
|
|
T & | operator[] (unsigned int idx) |
| index access operator More...
|
|
const T & | operator[] (unsigned int idx) const |
| index access operator (const) More...
|
|
template<class T, unsigned int COLS, unsigned int ROWS>
class icl::math::FixedMatrix< T, COLS, ROWS >
Powerful and highly flexible matrix class implementation.
By using fixed template parameters as Matrix dimensions, specializations to e.g. row or column vectors, are also as performant as possible.
Performance
Here are some benchmark results (measured on a 2GHz Core2Duo). All results are means of 10000 measurements using float matrices.
- invert matrix: inv()
- 1000 x inv 2x2 matrix 74 ns [optimized C++]
- 1000 x inv 3x3 matrix 248 ns [optimized C++]
- 1000 x inv 4x4 matrix 721 ns [optimized C++]
- 1000 x inv 5x5 matrix 1.1 ms [IPP only]
- matrix determinant: det()
- 1000 x det 2x2 matrix 11 ns [optimized C++]
- 1000 x det 3x3 matrix 48 ns [optimized C++]
- 1000 x det 4x4 matrix 138 ns [optimized C++]
- 1000 x det 5x5 matrix 604 ns [IPP only]
- add two matrices using operator+: A+B
- 1000 x add 2x2 matrices 7 ns [STL's transform template ]
- 1000 x add 3x3 matrices 14 ns [STL's transform template ]
- 1000 x add 4x4 matrices 21 ns [STL's transform template ]
- 1000 x add 5x5 matrices 58 ns [STL's transform template ]
- multiply two matrices (matrix multiplication): A*B
- 1000 x multiply 2x2 matrices 55 ns [IPP if available]
- 1000 x multiply 3x3 matrices 63 ns [IPP if available]
- 1000 x multiply 4x4 matrices 79 ns [IPP if available]
- 1000 x multiply 5x5 matrices 238 ns [generic C++ implementation for A*B]