Image Component Library (ICL)
Classes | Functions
Linear algebra classes and functions

Classes

struct  icl::math::InvalidMatrixDimensionException
 Special linear algebra exception type . More...
 
struct  icl::math::IncompatibleMatrixDimensionException
 Special linear algebra exception type . More...
 
struct  icl::math::InvalidIndexException
 Special linear algebra exception type . More...
 
struct  icl::math::SingularMatrixException
 Special linear algebra exception type . More...
 
struct  icl::math::DynMatrix< T >::col_iterator
 Internal column iterator struct (using height-stride) More...
 
struct  icl::math::DynMatrix< T >
 Highly flexible and optimized matrix class implementation. More...
 
struct  icl::math::FixedMatrixBase
 FixedMatrix base struct defining datamode enum. More...
 
class  icl::math::FixedMatrixPart< T, N, Iterator >
 Utility struct for FixedMatrix sub-parts. More...
 
struct  icl::math::FixedMatrix< T, COLS, ROWS >::col_iterator
 internal struct for row-wise iteration with stride=COLS More...
 
class  icl::math::FixedMatrix< T, COLS, ROWS >
 Powerful and highly flexible matrix class implementation. More...
 

Functions

template<class T >
ICLMath_IMP std::ostream & icl::math::operator<< (std::ostream &s, const DynMatrix< T > &m)
 ostream operator implemented for uchar, short, int, float and double matrices More...
 
template<class T >
ICLMath_IMP std::istream & icl::math::operator>> (std::istream &s, DynMatrix< T > &m)
 istream operator implemented for uchar, short, int, float and double matrices More...
 
template<class T , class Init >
DynMatrix< T > & icl::math::matrix_init (DynMatrix< T > &m, Init init)
 Matrix initialization template. More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_abs (DynMatrix< T > &m)
 element-wise absolute value (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_abs (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise absolute value [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_log (DynMatrix< T > &m)
 element-wise logarith (basis E) (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_log (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise logarith (basis E) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_exp (DynMatrix< T > &m)
 element-wise exp-function (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_exp (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise exp-function [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_sqrt (DynMatrix< T > &m)
 element-wise square-root-function (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_sqrt (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise square-root-function [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_sqr (DynMatrix< T > &m)
 element-wise square-function (x*x) (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_sqr (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise square-function (x*x) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_sin (DynMatrix< T > &m)
 element-wise sinus-function (x*x) (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_sin (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise sinus-function (x*x) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_cos (DynMatrix< T > &m)
 element-wise cosinus-function (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_cos (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise cosinus-function More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_tan (DynMatrix< T > &m)
 element-wise tangent-function (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_tan (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise tangent-function More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_arcsin (DynMatrix< T > &m)
 element-wise arcus sinus-function (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_arcsin (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise arcus sinus-function More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_arccos (DynMatrix< T > &m)
 element-wise arcus cosinus-function (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_arccos (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise arcus cosinus-function More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_arctan (DynMatrix< T > &m)
 element-wise arcus tangent-function (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_arctan (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise arcus tangent-function More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_reciprocal (DynMatrix< T > &m)
 element-wise reciprocal-function (1/x) (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_reciprocal (const DynMatrix< T > &m, DynMatrix< T > &dst)
 element-wise reciprocal-function (1/x) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_powc (DynMatrix< T > &m, T exponent)
 element-wise power-function (x^exponent) (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_addc (DynMatrix< T > &m, T val)
 element-wise addition of constant value (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_addc (const DynMatrix< T > &m, T val, DynMatrix< T > &dst)
 element-wise addition of constant value [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_subc (DynMatrix< T > &m, T val)
 element-wise substraction of constant value (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_subc (const DynMatrix< T > &m, T val, DynMatrix< T > &dst)
 element-wise substraction of constant value [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_divc (DynMatrix< T > &m, T val)
 element-wise division by constant value (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_divc (const DynMatrix< T > &m, T val, DynMatrix< T > &dst)
 element-wise division by constant value [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_mulc (DynMatrix< T > &m, T val)
 element-wise multiplication with constant value (inplace) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_mulc (const DynMatrix< T > &m, T val, DynMatrix< T > &dst)
 element-wise multiplication with constant value [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_arctan2 (const DynMatrix< T > &my, const DynMatrix< T > &mx, DynMatrix< T > &dst)
 element-wise atan2 function atan2(y,x) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_add (const DynMatrix< T > &m1, const DynMatrix< T > &m2, DynMatrix< T > &dst)
 element-wise addition [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_sub (const DynMatrix< T > &m1, const DynMatrix< T > &m2, DynMatrix< T > &dst)
 element-wise substraction [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_mul (const DynMatrix< T > &m1, const DynMatrix< T > &m2, DynMatrix< T > &dst)
 element-wise multiplication [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_div (const DynMatrix< T > &m1, const DynMatrix< T > &m2, DynMatrix< T > &dst)
 element-wise division [IPP-optimized] More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_pow (const DynMatrix< T > &m1, const DynMatrix< T > &m2, DynMatrix< T > &dst)
 element-wise power More...
 
template<class T , unsigned int WIDTH, unsigned int HEIGHT, unsigned int HEIGHT2>
FixedMatrix< T, WIDTH, HEIGHT+HEIGHT2 > icl::math::operator% (const FixedMatrix< T, WIDTH, HEIGHT > &a, const FixedMatrix< T, WIDTH, HEIGHT2 > &b)
 Vertical Matrix concatenation. More...
 
template<class T , unsigned int WIDTH, unsigned int HEIGHT, unsigned int WIDTH2>
FixedMatrix< T, WIDTH+WIDTH2, HEIGHT > icl::math::operator, (const FixedMatrix< T, WIDTH, HEIGHT > &a, const FixedMatrix< T, WIDTH2, HEIGHT > &b)
 Horizontal Matrix concatenation. More...
 

matrix distance measurement

template<class T >
ICLMath_IMPicl::math::matrix_distance (const DynMatrix< T > &m1, const DynMatrix< T > &m2, T norm=2)
 computes norm between matrix vectors More...
 
template<class T >
ICLMath_IMPicl::math::matrix_divergence (const DynMatrix< T > &m1, const DynMatrix< T > &m2)
 computes generalized Kullback-Leibler-divergence between matrix vectors More...
 

statistical functions

template<class T >
ICLMath_IMPicl::math::matrix_min (const DynMatrix< T > &m, int *x=0, int *y=0)
 find minimum element of matrix (optionally find location too) [IPP-optimized] More...
 
template<class T >
ICLMath_IMPicl::math::matrix_max (const DynMatrix< T > &m, int *x=0, int *y=0)
 find maximum element of matrix (optionally find location too) [IPP-optimized] More...
 
template<class T >
ICLMath_IMP void icl::math::matrix_minmax (const DynMatrix< T > &m, T dst[2], int *minx=0, int *miny=0, int *maxx=0, int *maxy=0)
 find min- and maxinim element at once (optionally with locations) [IPP-optimized] More...
 
template<class T >
ICLMath_IMPicl::math::matrix_mean (const DynMatrix< T > &m)
 calculate matrix mean value [IPP-optimized] More...
 
template<class T >
ICLMath_IMPicl::math::matrix_var (const DynMatrix< T > &m)
 calculate matrix variance [IPP-optimized] More...
 
template<class T >
ICLMath_IMPicl::math::matrix_var (const DynMatrix< T > &m, T mean, bool empiricalMean=true)
 calculate matrix variance with given mean More...
 
template<class T >
ICLMath_IMP void icl::math::matrix_meanvar (const DynMatrix< T > &m, T *mean, T *var)
 computes matrix mean and variance at once [IPP-optimized] More...
 
template<class T >
ICLMath_IMPicl::math::matrix_stddev (const DynMatrix< T > &m)
 computes matrix standard deviation (sqrt(var)) [IPP-optimized] More...
 
template<class T >
ICLMath_IMPicl::math::matrix_stddev (const DynMatrix< T > &m, T mean, bool empiricalMean=true)
 calculate matrix standard deviation with given mean More...
 

other functions ...

template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_muladd (const DynMatrix< T > &a, T alpha, const DynMatrix< T > &b, T beta, T gamma, DynMatrix< T > &dst)
 computes alpha*a + beta*b + gamma More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_muladd (const DynMatrix< T > &a, T alpha, T gamma, DynMatrix< T > &dst)
 computes alpha*a + gamma More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_mask (const DynMatrix< unsigned char > &mask, DynMatrix< T > &m)
 applies masking operation (m(i,j) is set to 0 if mask(i,j) is 0) (inplace) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_mask (const DynMatrix< unsigned char > &mask, const DynMatrix< T > &m, DynMatrix< T > &dst)
 applies masking operation (m(i,j) is set to 0 if mask(i,j) is 0) More...
 

special functions for transposed matrices ...

enum  icl::math::transposedDef { icl::math::NONE_T =0, icl::math::SRC1_T =1<<0, icl::math::SRC2_T =1<<1, icl::math::BOTH_T =SRC1_T | SRC2_T }
 special utility type for definition of transposed states for matrices More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_mult_t (const DynMatrix< T > &src1, const DynMatrix< T > &src2, DynMatrix< T > &dst, int transpDef)
 applies matrix mutliplication on optionally transposed matrices More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::big_matrix_mult_t (const DynMatrix< T > &src1, const DynMatrix< T > &src2, DynMatrix< T > &dst, int transpDef)
 applies matrix mutliplication on optionally transposed matrices (specialized for big matrices) More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_add_t (const DynMatrix< T > &src1, const DynMatrix< T > &src2, DynMatrix< T > &dst, int transpDef)
 applies matrix addition on optionally transposed matrices More...
 
template<class T >
ICLMath_IMP DynMatrix< T > & icl::math::matrix_sub_t (const DynMatrix< T > &src1, const DynMatrix< T > &src2, DynMatrix< T > &dst, int transpDef)
 applies matrix substraction on optionally transposed matrices More...
 

Detailed Description

Enumeration Type Documentation

◆ transposedDef

special utility type for definition of transposed states for matrices

Enumerator
NONE_T 
SRC1_T 
SRC2_T 
BOTH_T 

Function Documentation

◆ big_matrix_mult_t()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::big_matrix_mult_t ( const DynMatrix< T > &  src1,
const DynMatrix< T > &  src2,
DynMatrix< T > &  dst,
int  transpDef 
)

applies matrix mutliplication on optionally transposed matrices (specialized for big matrices)

sometimes, it might be more efficient to call matrix multiplication on imaginary transposed source matrices, to avoid having to apply an additional transposing step.

This function is accelerated using Intel MKL. Please make sure, that libguide.so and libiomp5.so are linked to. Otherwise, wrong results might occure. This can be set using CMake or the ICL configure script. If Intel MKL is not available, function matrix_mult_t is used as fallback.

Parameters
src1left operand
src2right operand
dstdestination matrix (adapted on demand)
transpDefor-ed list of transposedDef values e.g. (SRC1_T | SRC2_T) mean both matrices are transposed.

◆ matrix_abs() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_abs ( DynMatrix< T > &  m)

element-wise absolute value (inplace) [IPP-optimized]

For float and double only

◆ matrix_abs() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_abs ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise absolute value [IPP-optimized]

For float and double only

◆ matrix_add()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_add ( const DynMatrix< T > &  m1,
const DynMatrix< T > &  m2,
DynMatrix< T > &  dst 
)

element-wise addition [IPP-optimized]

For float and double only

◆ matrix_add_t()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_add_t ( const DynMatrix< T > &  src1,
const DynMatrix< T > &  src2,
DynMatrix< T > &  dst,
int  transpDef 
)

applies matrix addition on optionally transposed matrices

◆ matrix_addc() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_addc ( DynMatrix< T > &  m,
val 
)

element-wise addition of constant value (inplace) [IPP-optimized]

For float and double only

◆ matrix_addc() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_addc ( const DynMatrix< T > &  m,
val,
DynMatrix< T > &  dst 
)

element-wise addition of constant value [IPP-optimized]

For float and double only

◆ matrix_arccos() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_arccos ( DynMatrix< T > &  m)

element-wise arcus cosinus-function (inplace)

For float and double only

◆ matrix_arccos() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_arccos ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise arcus cosinus-function

For float and double only

◆ matrix_arcsin() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_arcsin ( DynMatrix< T > &  m)

element-wise arcus sinus-function (inplace)

For float and double only

◆ matrix_arcsin() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_arcsin ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise arcus sinus-function

For float and double only

◆ matrix_arctan() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_arctan ( DynMatrix< T > &  m)

element-wise arcus tangent-function (inplace)

For float and double only

◆ matrix_arctan() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_arctan ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise arcus tangent-function

For float and double only

◆ matrix_arctan2()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_arctan2 ( const DynMatrix< T > &  my,
const DynMatrix< T > &  mx,
DynMatrix< T > &  dst 
)

element-wise atan2 function atan2(y,x)

For float and double only

◆ matrix_cos() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_cos ( DynMatrix< T > &  m)

element-wise cosinus-function (inplace)

For float and double only

◆ matrix_cos() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_cos ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise cosinus-function

For float and double only

◆ matrix_distance()

template<class T >
ICLMath_IMP T icl::math::matrix_distance ( const DynMatrix< T > &  m1,
const DynMatrix< T > &  m2,
norm = 2 
)

computes norm between matrix vectors

For float and double only

\[ D = \left(\sum\limits_{i,j} (A_{ij}-B_{ij})^n\right)^{\frac{1}{n}} \]

◆ matrix_div()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_div ( const DynMatrix< T > &  m1,
const DynMatrix< T > &  m2,
DynMatrix< T > &  dst 
)

element-wise division [IPP-optimized]

For float and double only

◆ matrix_divc() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_divc ( DynMatrix< T > &  m,
val 
)

element-wise division by constant value (inplace) [IPP-optimized]

For float and double only

◆ matrix_divc() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_divc ( const DynMatrix< T > &  m,
val,
DynMatrix< T > &  dst 
)

element-wise division by constant value [IPP-optimized]

For float and double only

◆ matrix_divergence()

template<class T >
ICLMath_IMP T icl::math::matrix_divergence ( const DynMatrix< T > &  m1,
const DynMatrix< T > &  m2 
)

computes generalized Kullback-Leibler-divergence between matrix vectors

For float and double only

\[ \mbox{div} = \sum\limits_{i,j} A_{ij} \cdot \log{\frac{A_{ij}}{B_{ij}}} - A_{ij} + B_{ij} \]

◆ matrix_exp() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_exp ( DynMatrix< T > &  m)

element-wise exp-function (inplace) [IPP-optimized]

For float and double only

◆ matrix_exp() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_exp ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise exp-function [IPP-optimized]

For float and double only

◆ matrix_init()

template<class T , class Init >
DynMatrix<T>& icl::math::matrix_init ( DynMatrix< T > &  m,
Init  init 
)
inline

Matrix initialization template.

This function can e.g. be used to initialize a matrix with random values

int main(){
// initialize all entries with a uniform random number
}
Parameters
mmatrix to initialize
initinitializer function value or functor
Returns
m

◆ matrix_log() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_log ( DynMatrix< T > &  m)

element-wise logarith (basis E) (inplace) [IPP-optimized]

For float and double only

◆ matrix_log() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_log ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise logarith (basis E) [IPP-optimized]

For float and double only

◆ matrix_mask() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_mask ( const DynMatrix< unsigned char > &  mask,
DynMatrix< T > &  m 
)

applies masking operation (m(i,j) is set to 0 if mask(i,j) is 0) (inplace)

For float and double only

◆ matrix_mask() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_mask ( const DynMatrix< unsigned char > &  mask,
const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

applies masking operation (m(i,j) is set to 0 if mask(i,j) is 0)

For float and double only

◆ matrix_max()

template<class T >
ICLMath_IMP T icl::math::matrix_max ( const DynMatrix< T > &  m,
int *  x = 0,
int *  y = 0 
)

find maximum element of matrix (optionally find location too) [IPP-optimized]

For float and double only

Parameters
msource matrix
xif no NULL, maximum x-location (column-index) is written to *x
yif no NULL, maximum y-location (row-index) is written to *y

◆ matrix_mean()

template<class T >
ICLMath_IMP T icl::math::matrix_mean ( const DynMatrix< T > &  m)

calculate matrix mean value [IPP-optimized]

For float and double only

◆ matrix_meanvar()

template<class T >
ICLMath_IMP void icl::math::matrix_meanvar ( const DynMatrix< T > &  m,
T *  mean,
T *  var 
)

computes matrix mean and variance at once [IPP-optimized]

For float and double only note thatn mean and var must not be null

◆ matrix_min()

template<class T >
ICLMath_IMP T icl::math::matrix_min ( const DynMatrix< T > &  m,
int *  x = 0,
int *  y = 0 
)

find minimum element of matrix (optionally find location too) [IPP-optimized]

For float and double only

Parameters
msource matrix
xif no NULL, minimum x-location (column-index) is written to *x
yif no NULL, minimum y-location (row-index) is written to *y

◆ matrix_minmax()

template<class T >
ICLMath_IMP void icl::math::matrix_minmax ( const DynMatrix< T > &  m,
dst[2],
int *  minx = 0,
int *  miny = 0,
int *  maxx = 0,
int *  maxy = 0 
)

find min- and maxinim element at once (optionally with locations) [IPP-optimized]

For float and double only

Parameters
msource matrix
dstfound min and max value are written to dst
(dst[0]<-min, dst[1]<-max)
minxif no NULL, minimum x-location (column-index) is written to *minx
minyif no NULL, minimum y-location (row-index) is written to *miny
maxxif no NULL, maximum x-location (column-index) is written to *maxx
maxyif no NULL, maximum y-location (row-index) is written to *maxy

◆ matrix_mul()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_mul ( const DynMatrix< T > &  m1,
const DynMatrix< T > &  m2,
DynMatrix< T > &  dst 
)

element-wise multiplication [IPP-optimized]

For float and double only

◆ matrix_muladd() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_muladd ( const DynMatrix< T > &  a,
alpha,
const DynMatrix< T > &  b,
beta,
gamma,
DynMatrix< T > &  dst 
)

computes alpha*a + beta*b + gamma

For float and double only

◆ matrix_muladd() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_muladd ( const DynMatrix< T > &  a,
alpha,
gamma,
DynMatrix< T > &  dst 
)

computes alpha*a + gamma

For float and double only

◆ matrix_mulc() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_mulc ( DynMatrix< T > &  m,
val 
)

element-wise multiplication with constant value (inplace) [IPP-optimized]

For float and double only

◆ matrix_mulc() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_mulc ( const DynMatrix< T > &  m,
val,
DynMatrix< T > &  dst 
)

element-wise multiplication with constant value [IPP-optimized]

For float and double only

◆ matrix_mult_t()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_mult_t ( const DynMatrix< T > &  src1,
const DynMatrix< T > &  src2,
DynMatrix< T > &  dst,
int  transpDef 
)

applies matrix mutliplication on optionally transposed matrices

sometimes, it might be more efficient to call matrix multiplication on imaginary transposed source matrices, to avoid having to apply an additional transposing step.

This function is IPP accelerated. In case of having no IPP support, a trivial fallback implementation is provided (something like

src1.transp().mult( src2.transp(),dst) )

in case of having transpDef == BOTH_T

Parameters
src1left operand
src2right operand
dstdestination matrix (adapted on demand)
transpDefor-ed list of transposedDef values e.g. (SRC1_T | SRC2_T) mean both matrices are transposed.

◆ matrix_pow()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_pow ( const DynMatrix< T > &  m1,
const DynMatrix< T > &  m2,
DynMatrix< T > &  dst 
)

element-wise power

For float and double only

◆ matrix_powc()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_powc ( DynMatrix< T > &  m,
exponent 
)

element-wise power-function (x^exponent) (inplace)

For float and double only

◆ matrix_reciprocal() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_reciprocal ( DynMatrix< T > &  m)

element-wise reciprocal-function (1/x) (inplace)

For float and double only

◆ matrix_reciprocal() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_reciprocal ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise reciprocal-function (1/x)

For float and double only

◆ matrix_sin() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_sin ( DynMatrix< T > &  m)

element-wise sinus-function (x*x) (inplace)

For float and double only

◆ matrix_sin() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_sin ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise sinus-function (x*x)

For float and double only

◆ matrix_sqr() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_sqr ( DynMatrix< T > &  m)

element-wise square-function (x*x) (inplace) [IPP-optimized]

For float and double only

◆ matrix_sqr() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_sqr ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise square-function (x*x) [IPP-optimized]

For float and double only

◆ matrix_sqrt() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_sqrt ( DynMatrix< T > &  m)

element-wise square-root-function (inplace) [IPP-optimized]

For float and double only

◆ matrix_sqrt() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_sqrt ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise square-root-function [IPP-optimized]

For float and double only

◆ matrix_stddev() [1/2]

template<class T >
ICLMath_IMP T icl::math::matrix_stddev ( const DynMatrix< T > &  m)

computes matrix standard deviation (sqrt(var)) [IPP-optimized]

For float and double only

◆ matrix_stddev() [2/2]

template<class T >
ICLMath_IMP T icl::math::matrix_stddev ( const DynMatrix< T > &  m,
mean,
bool  empiricalMean = true 
)

calculate matrix standard deviation with given mean

For float and double only

Parameters
msource matrix
meangiven sample mean
empiricalMeanif true, then the given mean was computed from the data, too, and therefore, the intermediate result 'sum of square distances' has to be normalized with m.dim()-1. The reason is that, the the empirical mean minimizes the variance 'per-definition', so we substract that degree of freedom here. If empiricalMean is false, intermediate sum-of-squares is normalized by m.dim() only.

◆ matrix_sub()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_sub ( const DynMatrix< T > &  m1,
const DynMatrix< T > &  m2,
DynMatrix< T > &  dst 
)

element-wise substraction [IPP-optimized]

For float and double only

◆ matrix_sub_t()

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_sub_t ( const DynMatrix< T > &  src1,
const DynMatrix< T > &  src2,
DynMatrix< T > &  dst,
int  transpDef 
)

applies matrix substraction on optionally transposed matrices

◆ matrix_subc() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_subc ( DynMatrix< T > &  m,
val 
)

element-wise substraction of constant value (inplace) [IPP-optimized]

For float and double only

◆ matrix_subc() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_subc ( const DynMatrix< T > &  m,
val,
DynMatrix< T > &  dst 
)

element-wise substraction of constant value [IPP-optimized]

For float and double only

◆ matrix_tan() [1/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_tan ( DynMatrix< T > &  m)

element-wise tangent-function (inplace)

For float and double only

◆ matrix_tan() [2/2]

template<class T >
ICLMath_IMP DynMatrix<T>& icl::math::matrix_tan ( const DynMatrix< T > &  m,
DynMatrix< T > &  dst 
)

element-wise tangent-function

For float and double only

◆ matrix_var() [1/2]

template<class T >
ICLMath_IMP T icl::math::matrix_var ( const DynMatrix< T > &  m)

calculate matrix variance [IPP-optimized]

For float and double only

◆ matrix_var() [2/2]

template<class T >
ICLMath_IMP T icl::math::matrix_var ( const DynMatrix< T > &  m,
mean,
bool  empiricalMean = true 
)

calculate matrix variance with given mean

For float and double only

Parameters
msource matrix
meangiven sample mean
empiricalMeanif true, then the given mean was computed from the data, too, and therefore, the intermediate result 'sum of square distances' has to be normalized with m.dim()-1. The reason is that, the the empirical mean minimizes the variance 'per-definition', so we substract that degree of freedom here. If empiricalMean is false, intermediate sum-of-squares is normalized by m.dim() only.

◆ operator%()

template<class T , unsigned int WIDTH, unsigned int HEIGHT, unsigned int HEIGHT2>
FixedMatrix<T, WIDTH, HEIGHT + HEIGHT2> icl::math::operator% ( const FixedMatrix< T, WIDTH, HEIGHT > &  a,
const FixedMatrix< T, WIDTH, HEIGHT2 > &  b 
)
inline

Vertical Matrix concatenation.

like ICLQuick image concatenation, dont forget the brackets sometimes

◆ operator,()

template<class T , unsigned int WIDTH, unsigned int HEIGHT, unsigned int WIDTH2>
FixedMatrix<T, WIDTH + WIDTH2, HEIGHT> icl::math::operator, ( const FixedMatrix< T, WIDTH, HEIGHT > &  a,
const FixedMatrix< T, WIDTH2, HEIGHT > &  b 
)
inline

Horizontal Matrix concatenation.

like ICLQuick image concatenation, dont forget the brackets sometimes

◆ operator<<()

template<class T >
ICLMath_IMP std::ostream& icl::math::operator<< ( std::ostream &  s,
const DynMatrix< T > &  m 
)

ostream operator implemented for uchar, short, int, float and double matrices

◆ operator>>()

template<class T >
ICLMath_IMP std::istream& icl::math::operator>> ( std::istream &  s,
DynMatrix< T > &  m 
)

istream operator implemented for uchar, short, int, float and double matrices