Image Component Library (ICL)
|
Powerful and highly flexible matrix class implementation. More...
#include <FixedMatrix.h>
Classes | |
struct | col_iterator |
internal struct for row-wise iteration with stride=COLS More... | |
Public Types | |
typedef T * | iterator |
iterator type | |
typedef const T * | const_iterator |
const iterator type | |
typedef T * | row_iterator |
row_iterator | |
typedef const T * | const_row_iterator |
const row_iterator | |
typedef const col_iterator | const_col_iterator |
Public Member Functions | |
DynMatrix< T > | dyn () |
creates a shallow copied DynMatrix instance wrapping this' data | |
const DynMatrix< T > | dyn () const |
creates a shallow copied DynMatrix instance wrapping this' data (const) | |
FixedMatrix () | |
Default constructor. | |
FixedMatrix (const T &initValue) | |
Create Matrix and initialize elements with given value. | |
FixedMatrix (const T *srcdata) | |
Create matrix with given data pointer (const version) | |
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) | |
template<class OtherIterator > | |
FixedMatrix (OtherIterator begin, OtherIterator end) | |
Range based constructor for STL compatiblitiy. | |
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) | |
template<class otherT , class Iterator > | |
FixedMatrix (const FixedMatrixPart< otherT, DIM, Iterator > &r) | |
Create matrix of a sub-part of another matrix (compatible types) | |
FixedMatrix & | operator= (const FixedMatrix &other) |
Assignment operator (with compatible data type) (deep copy) | |
template<class otherT > | |
FixedMatrix & | operator= (const FixedMatrix< otherT, COLS, ROWS > &other) |
Assignment operator (with compatible data type) (deep copy) | |
FixedMatrix & | operator= (const T &t) |
Assign all elements with given value. | |
template<class Iterator > | |
FixedMatrix & | operator= (const FixedMatrixPart< T, DIM, Iterator > &r) |
Assign matrix elements with sup-part of another matrix (identical types) | |
template<class otherT , class Iterator > | |
FixedMatrix & | operator= (const FixedMatrixPart< otherT, DIM, Iterator > &r) |
Assign matrix elements with sup-part of another matrix (compatible types) | |
FixedMatrix | operator/ (const FixedMatrix &m) const throw (IncompatibleMatrixDimensionException, InvalidMatrixDimensionException, SingularMatrixException) |
Matrix devision. | |
FixedMatrix & | operator/= (const FixedMatrix &m) const throw (IncompatibleMatrixDimensionException, InvalidMatrixDimensionException, SingularMatrixException) |
Matrix devision (inplace) | |
FixedMatrix | operator* (T f) const |
Multiply all elements by a scalar. | |
FixedMatrix & | operator*= (T f) |
moved outside the class Multiply all elements by a scalar (inplace) | |
FixedMatrix | operator/ (T f) const |
Divide all elements by a scalar. | |
FixedMatrix & | operator/= (T f) |
Divide all elements by a scalar. | |
FixedMatrix | operator+ (const T &t) const |
Add a scalar to each element. | |
FixedMatrix & | operator+= (const T &t) |
Add a scalar to each element (inplace) | |
FixedMatrix | operator- (const T &t) const |
Substract a scalar from each element. | |
FixedMatrix & | operator-= (const T &t) |
Substract a scalar from each element (inplace) | |
FixedMatrix | operator+ (const FixedMatrix &m) const |
Element-wise matrix addition. | |
FixedMatrix & | operator+= (const FixedMatrix &m) |
Element-wise matrix addition (inplace) | |
FixedMatrix | operator- (const FixedMatrix &m) const |
Element-wise matrix subtraction. | |
FixedMatrix & | operator-= (const FixedMatrix &m) |
Element-wise matrix subtraction (inplace) | |
FixedMatrix | operator- () const |
Prefix - operator. | |
T & | operator() (unsigned int col, unsigned int row) |
Element access operator. | |
const T & | operator() (unsigned int col, unsigned int row) const |
Element access operator (const) | |
T & | at (unsigned int col, unsigned int row) throw (InvalidIndexException) |
Element access index save (with exception if index is invalid) | |
const T & | at (unsigned int col, unsigned int row) const throw (InvalidIndexException) |
Element access index save (with exception if index is invalid) (const) | |
T & | operator[] (unsigned int idx) |
linear data view element access | |
const T & | operator[] (unsigned int idx) const |
linear data view element access (const) | |
T * | data () |
return internal data pointer | |
const T * | data () const |
return internal data pointer (const) | |
iterator | begin () |
returns an iterator to first element iterating over each element (row-major order) | |
iterator | end () |
returns an iterator after the last element | |
const_iterator | begin () const |
returns an iterator to first element iterating over each element (row-major order) (const) | |
const_iterator | end () const |
returns an iterator after the last element (const) | |
col_iterator | col_begin (unsigned int col) |
returns an iterator iterating over a certain column | |
col_iterator | col_end (unsigned int col) |
row end iterator | |
const_col_iterator | col_begin (unsigned int col) const |
returns an iterator iterating over a certain column (const) | |
const_col_iterator | col_end (unsigned int col) const |
row end iterator const | |
row_iterator | row_begin (unsigned int row) |
returns an iterator iterating over a certain row | |
row_iterator | row_end (unsigned int row) |
row end iterator | |
const_row_iterator | row_begin (unsigned int row) const |
returns an iterator iterating over a certain row (const) | |
const_row_iterator | row_end (unsigned int row) const |
row end iterator (const) | |
template<unsigned int MCOLS> | |
void | mult (const FixedMatrix< T, MCOLS, COLS > &m, FixedMatrix< T, MCOLS, ROWS > &dst) const |
inplace matrix multiplication (dst = (*this)*m) | |
template<unsigned int MCOLS> | |
FixedMatrix< T, MCOLS, ROWS > | operator* (const FixedMatrix< T, MCOLS, COLS > &m) const |
Matrix multiplication (essential) | |
FixedMatrix | inv () const throw (InvalidMatrixDimensionException,SingularMatrixException) |
invert the matrix (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f) | |
T | det () const throw (InvalidMatrixDimensionException) |
calculate matrix determinant (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f) | |
FixedMatrix< T, ROWS, COLS > | transp () const |
returns matrix's transposed | |
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) | |
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) | |
double | cond (const double p=2) const |
computes the condition of a fixed matrix | |
T | trace () const |
computes the sum of all diagonal elements | |
FixedMatrixPart< T, COLS, row_iterator > | row (unsigned int idx) |
returns a matrix row-reference iterator pair | |
FixedMatrixPart< T, COLS, const_row_iterator > | row (unsigned int idx) const |
returns a matrix row-reference iterator pair (const) | |
FixedMatrixPart< T, ROWS, col_iterator > | col (unsigned int idx) |
returns a matrix col-reference iterator pair | |
FixedMatrixPart< T, ROWS, const_col_iterator > | col (unsigned int idx) const |
returns a matrix col-reference iterator pair (const) | |
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 | |
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) | |
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) | |
double | length (T norm=2) const |
Calculates the length of the matrix data vector. | |
void | normalize (T norm=2) |
inplace normalization | |
FixedMatrix< T, COLS, ROWS > | normalized (T norm=2) const |
create a normalized version of this matrix | |
template<class otherT > | |
bool | operator== (const FixedMatrix< otherT, COLS, ROWS > &m) const |
Element-wise comparison with other matrix. | |
template<class otherT > | |
bool | operator!= (const FixedMatrix< otherT, COLS, ROWS > &m) const |
Element-wise comparison with other matrix. | |
FixedMatrix< T, 1, ROWS > | diag () const throw (InvalidMatrixDimensionException) |
returns a vector of the diagonal elements (only for squared matrices) | |
void | decompose_QR (FixedMatrix< T, COLS, ROWS > &Q, FixedMatrix< T, COLS, COLS > &R) const |
computes the QR decomposition of a matrix | |
void | decompose_RQ (FixedMatrix< T, ROWS, ROWS > &R, FixedMatrix< T, ROWS, ROWS > &Q) const |
computes the RQ decomposition of a matrix | |
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' | |
FixedMatrix< T, ROWS, COLS > | pinv (bool useSVD=0, float zeroThreshold=0.00000000000000001) const |
Computes the Matrix's pseudo-inverse. | |
void | eigen (FixedMatrix &eigenvectors, FixedMatrix< T, 1, COLS > &eigenvalues) const |
Extracts the matrix's eigenvalues and eigenvectors. | |
Static Public Member Functions | |
static const FixedMatrix & | null () |
returning a reference to a null matrix | |
static unsigned int | rows () |
compatibility-function returns template parameter ROWS | |
static unsigned int | cols () |
compatibility-function returns template parameter COLS | |
static unsigned int | dim () |
return static member variable DIM (COLS*ROWS) | |
static FixedMatrix< T, ROWS, COLS > | id () |
create identity matrix | |
Static Public Attributes | |
static const unsigned int | DIM = COLS*ROWS |
count of matrix elements (COLS x 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.
Here are some benchmark results (measured on a 2GHz Core2Duo). All results are means of 10000 measurements using float matrices.
typedef const col_iterator icl::math::FixedMatrix< T, COLS, ROWS >::const_col_iterator |
typedef const T* icl::math::FixedMatrix< T, COLS, ROWS >::const_iterator |
const iterator type
typedef const T* icl::math::FixedMatrix< T, COLS, ROWS >::const_row_iterator |
const row_iterator
typedef T* icl::math::FixedMatrix< T, COLS, ROWS >::iterator |
iterator type
typedef T* icl::math::FixedMatrix< T, COLS, ROWS >::row_iterator |
row_iterator
icl::math::FixedMatrix< T, COLS, ROWS >::FixedMatrix | ( | ) | [inline] |
Default constructor.
New data is created internally but elements are not initialized
icl::math::FixedMatrix< T, COLS, ROWS >::FixedMatrix | ( | const T & | initValue | ) | [inline] |
Create Matrix and initialize elements with given value.
icl::math::FixedMatrix< T, COLS, ROWS >::FixedMatrix | ( | const T * | srcdata | ) | [inline] |
Create matrix with given data pointer (const version)
As given data pointer is const, no shallow pointer copies are allowed here
srcdata | const source data pointer copied deeply |
icl::math::FixedMatrix< T, COLS, ROWS >::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 |
||
) | [inline] |
Create matrix with given initializer elements (16 values max)
default parameters for unnecessary parameters are not created when compiled with -O4
icl::math::FixedMatrix< T, COLS, ROWS >::FixedMatrix | ( | OtherIterator | begin, |
OtherIterator | end | ||
) | [inline] |
Range based constructor for STL compatiblitiy.
Range size must be compatible to the new matrix's dimension
icl::math::FixedMatrix< T, COLS, ROWS >::FixedMatrix | ( | const FixedMatrix< T, COLS, ROWS > & | other | ) | [inline] |
icl::math::FixedMatrix< T, COLS, ROWS >::FixedMatrix | ( | const FixedMatrix< otherT, COLS, ROWS > & | other | ) | [inline] |
icl::math::FixedMatrix< T, COLS, ROWS >::FixedMatrix | ( | const FixedMatrixPart< T, DIM, Iterator > & | r | ) | [inline] |
Create matrix of a sub-part of another matrix (identical types)
icl::math::FixedMatrix< T, COLS, ROWS >::FixedMatrix | ( | const FixedMatrixPart< otherT, DIM, Iterator > & | r | ) | [inline] |
Create matrix of a sub-part of another matrix (compatible types)
T& icl::math::FixedMatrix< T, COLS, ROWS >::at | ( | unsigned int | col, |
unsigned int | row | ||
) | throw (InvalidIndexException) [inline] |
Element access index save (with exception if index is invalid)
const T& icl::math::FixedMatrix< T, COLS, ROWS >::at | ( | unsigned int | col, |
unsigned int | row | ||
) | const throw (InvalidIndexException) [inline] |
Element access index save (with exception if index is invalid) (const)
iterator icl::math::FixedMatrix< T, COLS, ROWS >::begin | ( | ) | [inline] |
returns an iterator to first element iterating over each element (row-major order)
const_iterator icl::math::FixedMatrix< T, COLS, ROWS >::begin | ( | ) | const [inline] |
returns an iterator to first element iterating over each element (row-major order) (const)
FixedMatrixPart<T,ROWS,col_iterator> icl::math::FixedMatrix< T, COLS, ROWS >::col | ( | unsigned int | idx | ) | [inline] |
returns a matrix col-reference iterator pair
FixedMatrixPart<T,ROWS,const_col_iterator> icl::math::FixedMatrix< T, COLS, ROWS >::col | ( | unsigned int | idx | ) | const [inline] |
returns a matrix col-reference iterator pair (const)
col_iterator icl::math::FixedMatrix< T, COLS, ROWS >::col_begin | ( | unsigned int | col | ) | [inline] |
returns an iterator iterating over a certain column
const_col_iterator icl::math::FixedMatrix< T, COLS, ROWS >::col_begin | ( | unsigned int | col | ) | const [inline] |
returns an iterator iterating over a certain column (const)
col_iterator icl::math::FixedMatrix< T, COLS, ROWS >::col_end | ( | unsigned int | col | ) | [inline] |
row end iterator
const_col_iterator icl::math::FixedMatrix< T, COLS, ROWS >::col_end | ( | unsigned int | col | ) | const [inline] |
row end iterator const
static unsigned int icl::math::FixedMatrix< T, COLS, ROWS >::cols | ( | ) | [inline, static] |
compatibility-function returns template parameter COLS
double icl::math::FixedMatrix< T, COLS, ROWS >::cond | ( | const double | p = 2 | ) | const [inline] |
computes the condition of a fixed matrix
T* icl::math::FixedMatrix< T, COLS, ROWS >::data | ( | ) | [inline] |
return internal data pointer
const T* icl::math::FixedMatrix< T, COLS, ROWS >::data | ( | ) | const [inline] |
return internal data pointer (const)
void icl::math::FixedMatrix< T, COLS, ROWS >::decompose_QR | ( | FixedMatrix< T, COLS, ROWS > & | Q, |
FixedMatrix< T, COLS, COLS > & | R | ||
) | const [inline] |
computes the QR decomposition of a matrix
implements the stabilized Gram-Schmidt orthonormalization. (Internally using DynMatrix wrappers
void icl::math::FixedMatrix< T, COLS, ROWS >::decompose_RQ | ( | FixedMatrix< T, ROWS, ROWS > & | R, |
FixedMatrix< T, ROWS, ROWS > & | Q | ||
) | const [inline] |
computes the RQ decomposition of a matrix
implements the stabilized Gram-Schmidt orthonormalization. (Internally using DynMatrix wrappers
T icl::math::FixedMatrix< T, COLS, ROWS >::det | ( | ) | const throw (InvalidMatrixDimensionException) [inline] |
calculate matrix determinant (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f)
This function internally uses an instance of DynMatrix<T> Additionally implemented (in closed form) for float and double for 2x2 3x3 and 4x4 matrices
FixedMatrix<T,1,ROWS> icl::math::FixedMatrix< T, COLS, ROWS >::diag | ( | ) | const throw (InvalidMatrixDimensionException) [inline] |
returns a vector of the diagonal elements (only for squared matrices)
static unsigned int icl::math::FixedMatrix< T, COLS, ROWS >::dim | ( | ) | [inline, static] |
return static member variable DIM (COLS*ROWS)
FixedMatrix<T,OTHER_COLS,COLS> icl::math::FixedMatrix< T, COLS, ROWS >::dot | ( | const FixedMatrix< T, OTHER_COLS, ROWS > & | M | ) | const [inline] |
returns the inner product of two matrices (i.e. dot-product)
A.dot(B) is equivalent to A.transp() * B TODO: optimize implementation (current implementation _is_ A.transp() * B)
DynMatrix<T> icl::math::FixedMatrix< T, COLS, ROWS >::dyn | ( | ) | [inline] |
const DynMatrix<T> icl::math::FixedMatrix< T, COLS, ROWS >::dyn | ( | ) | const [inline] |
creates a shallow copied DynMatrix instance wrapping this' data (const)
void icl::math::FixedMatrix< T, COLS, ROWS >::eigen | ( | FixedMatrix< T, COLS, ROWS > & | eigenvectors, |
FixedMatrix< T, 1, COLS > & | eigenvalues | ||
) | const [inline] |
Extracts the matrix's eigenvalues and eigenvectors.
Internally, a DynMatrix wrapper is used. This function only works on squared symmetric matrices. Resulting eigenvalues are ordered in descending order. The destination matrices' sizes are adapted automatically.
The function is only available for icl32f and icl64f and it is IPP-accelerated in case of having Intel-IPP-Support. The Fallback implementation was basically taken from the Visualization Toolkit VTK (Version 5.6.0)
Note: There is no internal check if the matrix is really symmetric. If it is not symmetric, the behaviour of this function is not predictable
eigenvectors | contains the resulting eigenvectors in it's columns |
eigenvalues | becomes a N-dimensional column vector which ith element is the eigenvalue that corresponds to the ith column of eigenvectors |
T icl::math::FixedMatrix< T, COLS, ROWS >::element_wise_inner_product | ( | const FixedMatrix< T, OTHER_COLS, DIM/OTHER_COLS > & | other | ) | const [inline] |
inner product of data pointers (not matrix-mulitiplication)
computes the inner-product of internal data vectors
iterator icl::math::FixedMatrix< T, COLS, ROWS >::end | ( | ) | [inline] |
returns an iterator after the last element
const_iterator icl::math::FixedMatrix< T, COLS, ROWS >::end | ( | ) | const [inline] |
returns an iterator after the last element (const)
static FixedMatrix<T,ROWS,COLS> icl::math::FixedMatrix< T, COLS, ROWS >::id | ( | ) | [inline, static] |
create identity matrix
if matrix is not a spare one, upper left square matrix is initialized with the fitting identity matrix and other elements are initialized with 0
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::inv | ( | ) | const throw (InvalidMatrixDimensionException,SingularMatrixException) [inline] |
invert the matrix (only implemented with IPP_OPTIMIZATION and only for icl32f and icl64f)
This function internally uses an instance of DynMatrix<T> Additionally implemented (in closed form) for float and double for 2x2 3x3 and 4x4 matrices
Note: Inv will not compute a pseudo inverse matrix. Include iclFixedMatrixUtils.h instead and use the non-member template function pinv() instead for pseudo-inverse calculation
double icl::math::FixedMatrix< T, COLS, ROWS >::length | ( | T | norm = 2 | ) | const [inline] |
Calculates the length of the matrix data vector.
void icl::math::FixedMatrix< T, COLS, ROWS >::mult | ( | const FixedMatrix< T, MCOLS, COLS > & | m, |
FixedMatrix< T, MCOLS, ROWS > & | dst | ||
) | const [inline] |
inplace matrix multiplication (dst = (*this)*m)
Inplace matrix multiplication for 4x4-float-matrices (using ipp-optimization) is approximately twice as fast as D=A*B operator based multiplication
1.000.000 Multiplications of 4x4-float matrices (using ipp-optimization) on a 2GHz Core-2-Duo take about 145ms using inplace multiplication and about 290ms using not-inplace multiplication.
TODO: These results differ from the general matrix benchmarks ??
m | right matrix multiplication operand |
dst | destination of matrix multiplication |
void icl::math::FixedMatrix< T, COLS, ROWS >::normalize | ( | T | norm = 2 | ) | [inline] |
inplace normalization
FixedMatrix<T,COLS,ROWS> icl::math::FixedMatrix< T, COLS, ROWS >::normalized | ( | T | norm = 2 | ) | const [inline] |
create a normalized version of this matrix
static const FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::null | ( | ) | [inline, static] |
returning a reference to a null matrix
bool icl::math::FixedMatrix< T, COLS, ROWS >::operator!= | ( | const FixedMatrix< otherT, COLS, ROWS > & | m | ) | const [inline] |
Element-wise comparison with other matrix.
T& icl::math::FixedMatrix< T, COLS, ROWS >::operator() | ( | unsigned int | col, |
unsigned int | row | ||
) | [inline] |
Element access operator.
const T& icl::math::FixedMatrix< T, COLS, ROWS >::operator() | ( | unsigned int | col, |
unsigned int | row | ||
) | const [inline] |
Element access operator (const)
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::operator* | ( | T | f | ) | const [inline] |
Multiply all elements by a scalar.
FixedMatrix<T,MCOLS,ROWS> icl::math::FixedMatrix< T, COLS, ROWS >::operator* | ( | const FixedMatrix< T, MCOLS, COLS > & | m | ) | const [inline] |
Matrix multiplication (essential)
matrices multiplication A*B is only valid if cols(A) is equal to rows(B). Resulting matrix has dimensions cols(B) x rows(A). Matrix mutliplication is ipp-optimized for float and double and for (2x2-, 3x3- and 4x4- matrices)
m | right operator in matrix multiplication |
multiplication sceme
__MCOLS__ | c | | c | COLS c | = right operand | c | |______c__|
_COLS__ __________ | | | /\ | | | | | | = result ROWS | | | | |rrrrrr| |<-----x | x is inner product <r,c> |______| |_________|
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator*= | ( | T | f | ) | [inline] |
moved outside the class Multiply all elements by a scalar (inplace)
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::operator+ | ( | const T & | t | ) | const [inline] |
Add a scalar to each element.
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::operator+ | ( | const FixedMatrix< T, COLS, ROWS > & | m | ) | const [inline] |
Element-wise matrix addition.
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator+= | ( | const T & | t | ) | [inline] |
Add a scalar to each element (inplace)
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator+= | ( | const FixedMatrix< T, COLS, ROWS > & | m | ) | [inline] |
Element-wise matrix addition (inplace)
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::operator- | ( | const T & | t | ) | const [inline] |
Substract a scalar from each element.
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::operator- | ( | const FixedMatrix< T, COLS, ROWS > & | m | ) | const [inline] |
Element-wise matrix subtraction.
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::operator- | ( | ) | const [inline] |
Prefix - operator.
M + (-M) = 0;
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator-= | ( | const T & | t | ) | [inline] |
Substract a scalar from each element (inplace)
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator-= | ( | const FixedMatrix< T, COLS, ROWS > & | m | ) | [inline] |
Element-wise matrix subtraction (inplace)
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::operator/ | ( | const FixedMatrix< T, COLS, ROWS > & | m | ) | const throw (IncompatibleMatrixDimensionException, InvalidMatrixDimensionException, SingularMatrixException) [inline] |
Matrix devision.
A/B is equal to A*inv(B) Only allowed form square matrices B
m | denominator for division expression |
FixedMatrix icl::math::FixedMatrix< T, COLS, ROWS >::operator/ | ( | T | f | ) | const [inline] |
Divide all elements by a scalar.
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator/= | ( | const FixedMatrix< T, COLS, ROWS > & | m | ) | const throw (IncompatibleMatrixDimensionException, InvalidMatrixDimensionException, SingularMatrixException) [inline] |
Matrix devision (inplace)
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator/= | ( | T | f | ) | [inline] |
Divide all elements by a scalar.
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator= | ( | const FixedMatrix< T, COLS, ROWS > & | other | ) | [inline] |
Assignment operator (with compatible data type) (deep copy)
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator= | ( | const FixedMatrix< otherT, COLS, ROWS > & | other | ) | [inline] |
Assignment operator (with compatible data type) (deep copy)
Internally using std::transform with icl::clipped_cast<otherT,T>
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator= | ( | const T & | t | ) | [inline] |
Assign all elements with given value.
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator= | ( | const FixedMatrixPart< T, DIM, Iterator > & | r | ) | [inline] |
Assign matrix elements with sup-part of another matrix (identical types)
FixedMatrix& icl::math::FixedMatrix< T, COLS, ROWS >::operator= | ( | const FixedMatrixPart< otherT, DIM, Iterator > & | r | ) | [inline] |
Assign matrix elements with sup-part of another matrix (compatible types)
bool icl::math::FixedMatrix< T, COLS, ROWS >::operator== | ( | const FixedMatrix< otherT, COLS, ROWS > & | m | ) | const [inline] |
Element-wise comparison with other matrix.
T& icl::math::FixedMatrix< T, COLS, ROWS >::operator[] | ( | unsigned int | idx | ) | [inline] |
linear data view element access
This function is very useful e.g. for derived classes FixedRowVector and FixedColVector
Reimplemented from icl::utils::FixedArray< T, COLS *ROWS >.
const T& icl::math::FixedMatrix< T, COLS, ROWS >::operator[] | ( | unsigned int | idx | ) | const [inline] |
linear data view element access (const)
This function is very useful e.g. for derived classes FixedRowVector and FixedColVector
Reimplemented from icl::utils::FixedArray< T, COLS *ROWS >.
FixedMatrixPart<T,WIDTH*HEIGHT,MatrixSubRectIterator<T> > icl::math::FixedMatrix< T, COLS, ROWS >::part | ( | ) | [inline] |
extracts a rectangular matrix sub region
const FixedMatrixPart<T,WIDTH*HEIGHT,MatrixSubRectIterator<T> > icl::math::FixedMatrix< T, COLS, ROWS >::part | ( | ) | const [inline] |
extracts a rectangular matrix sub region (const)
FixedMatrix<T,ROWS,COLS> icl::math::FixedMatrix< T, COLS, ROWS >::pinv | ( | bool | useSVD = 0 , |
float | zeroThreshold = 0.00000000000000001 |
||
) | const [inline] |
Computes the Matrix's pseudo-inverse.
internally a DynMatrix wrapper is used. If useSVD is false, a QR-decomposition based approach is used
FixedMatrix<T,NEW_WIDTH,NEW_HEIGHT> icl::math::FixedMatrix< T, COLS, ROWS >::resize | ( | const T & | init = T(0) | ) | const [inline] |
extends/shrinks matrix dimensions while preserving content on remaining elements (without scaling)
This is resizing operation, which preserves contents for all remaining matrix elements. If new dimension is smaller than the current dimension, values are deleted. If otherwise new dimension gets larger, new allocated value are initialized with given init value.
FixedMatrixPart<T,COLS,row_iterator> icl::math::FixedMatrix< T, COLS, ROWS >::row | ( | unsigned int | idx | ) | [inline] |
returns a matrix row-reference iterator pair
FixedMatrixPart<T,COLS,const_row_iterator> icl::math::FixedMatrix< T, COLS, ROWS >::row | ( | unsigned int | idx | ) | const [inline] |
returns a matrix row-reference iterator pair (const)
row_iterator icl::math::FixedMatrix< T, COLS, ROWS >::row_begin | ( | unsigned int | row | ) | [inline] |
returns an iterator iterating over a certain row
const_row_iterator icl::math::FixedMatrix< T, COLS, ROWS >::row_begin | ( | unsigned int | row | ) | const [inline] |
returns an iterator iterating over a certain row (const)
row_iterator icl::math::FixedMatrix< T, COLS, ROWS >::row_end | ( | unsigned int | row | ) | [inline] |
row end iterator
const_row_iterator icl::math::FixedMatrix< T, COLS, ROWS >::row_end | ( | unsigned int | row | ) | const [inline] |
row end iterator (const)
static unsigned int icl::math::FixedMatrix< T, COLS, ROWS >::rows | ( | ) | [inline, static] |
compatibility-function returns template parameter ROWS
void icl::math::FixedMatrix< T, COLS, ROWS >::svd | ( | FixedMatrix< T, COLS, ROWS > & | U, |
FixedMatrix< T, 1, COLS > & | s, | ||
FixedMatrix< T, COLS, COLS > & | V | ||
) | const [inline] |
computes Singular Value Decomposition of this Matrix A = U diag(s) V'
internally a DynMatrix wrapper is used
T icl::math::FixedMatrix< T, COLS, ROWS >::trace | ( | ) | const [inline] |
computes the sum of all diagonal elements
FixedMatrix<T,ROWS,COLS> icl::math::FixedMatrix< T, COLS, ROWS >::transp | ( | ) | const [inline] |
returns matrix's transposed
const unsigned int icl::math::FixedMatrix< T, COLS, ROWS >::DIM = COLS*ROWS [static] |
count of matrix elements (COLS x ROWS)