Enumerations | Functions
UMath.h File Reference

Basic mathematics functions. More...

#include "rtabmap/utilite/UtiLiteExp.h"
#include <cmath>
#include <list>
#include <vector>
Include dependency graph for UMath.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  UXMatchMethod {
  UXCorrRaw, UXCorrBiased, UXCorrUnbiased, UXCorrCoeff,
  UXCovRaw, UXCovBiased, UXCovUnbiased, UXCovCoeff
}

Functions

std::vector< float > uHamming (unsigned int L)
template<class T >
bool uIsFinite (const T &value)
template<typename T >
bool uIsInBounds (const T &value, const T &low, const T &high)
template<class T >
bool uIsNan (const T &value)
template<class T >
std::list< unsigned int > uLocalMaxima (const T *v, unsigned int size)
template<class T >
std::list< unsigned int > uLocalMaxima (const std::vector< T > &v)
template<class T >
uMax (const T *v, unsigned int size, unsigned int &index)
template<class T >
uMax (const std::vector< T > &v, unsigned int &index)
template<class T >
uMax (const T *v, unsigned int size)
template<class T >
uMax (const std::vector< T > &v)
template<class T >
uMean (const T *v, unsigned int size)
template<class T >
uMean (const std::list< T > &list)
template<class T >
uMean (const std::vector< T > &v)
template<class T >
uMeanSquaredError (const T *x, unsigned int sizeX, const T *y, unsigned int sizeY)
template<class T >
uMeanSquaredError (const std::vector< T > &x, const std::vector< T > &y)
template<class T >
uMin (const T *v, unsigned int size, unsigned int &index)
template<class T >
uMin (const std::vector< T > &v, unsigned int &index)
template<class T >
uMin (const T *v, unsigned int size)
template<class T >
uMin (const std::vector< T > &v)
template<class T >
void uMinMax (const T *v, unsigned int size, T &min, T &max, unsigned int &indexMin, unsigned int &indexMax)
template<class T >
void uMinMax (const std::vector< T > &v, T &min, T &max, unsigned int &indexMin, unsigned int &indexMax)
template<class T >
void uMinMax (const T *v, unsigned int size, T &min, T &max)
template<class T >
void uMinMax (const std::vector< T > &v, T &min, T &max)
template<class T >
uNorm (const std::vector< T > &v)
template<class T >
uNorm (const T &x1, const T &x2)
template<class T >
uNorm (const T &x1, const T &x2, const T &x3)
template<class T >
std::vector< T > uNormalize (const std::vector< T > &v)
template<class T >
uNormSquared (const std::vector< T > &v)
template<class T >
uNormSquared (const T &x1, const T &x2)
template<class T >
uNormSquared (const T &x1, const T &x2, const T &x3)
template<class T >
int uSign (const T &v)
template<class T >
uSum (const std::list< T > &list)
template<class T >
uSum (const T *v, unsigned int size)
template<class T >
uSum (const std::vector< T > &v)
template<class T >
uSumSquared (const T *v, unsigned int size, T subtract=T())
template<class T >
uSumSquared (const std::vector< T > &v, T subtract=T())
template<class T >
uVariance (const T *v, unsigned int size, T meanV)
template<class T >
uVariance (const std::list< T > &list, const T &m)
template<class T >
uVariance (const T *v, unsigned int size)
template<class T >
uVariance (const std::vector< T > &v, const T &m)
template<class T >
std::vector< T > uXMatch (const T *vA, const T *vB, unsigned int sizeA, unsigned int sizeB, UXMatchMethod method)
template<class T >
std::vector< T > uXMatch (const std::vector< T > &vA, const std::vector< T > &vB, UXMatchMethod method)
template<class T >
uXMatch (const T *vA, const T *vB, unsigned int sizeA, unsigned int sizeB, unsigned int index, UXMatchMethod method)
template<class T >
uXMatch (const std::vector< T > &vA, const std::vector< T > &vB, unsigned int index, UXMatchMethod method)

Detailed Description

Basic mathematics functions.

Definition in file UMath.h.


Enumeration Type Documentation

Enum of cross matching methods (cross-correlation, cross-covariance) : UXCorrRaw, UXCorrBiased, UXCorrUnbiased, UXCorrCoeff, UXCovRaw, UXCovBiased, UXCovUnbiased, UXCovCoeff.

Enumerator:
UXCorrRaw 
UXCorrBiased 
UXCorrUnbiased 
UXCorrCoeff 
UXCovRaw 
UXCovBiased 
UXCovUnbiased 
UXCovCoeff 

Definition at line 678 of file UMath.h.


Function Documentation

std::vector<float> uHamming ( unsigned int  L) [inline]

Return Hamming window of length L.

Parameters:
Lthe window length
Returns:
the Hamming window (values are between 0 and 1)

Definition at line 901 of file UMath.h.

template<class T >
bool uIsFinite ( const T &  value) [inline]

Return true if the number is finite.

Definition at line 57 of file UMath.h.

template<typename T >
bool uIsInBounds ( const T &  value,
const T &  low,
const T &  high 
)

Definition at line 914 of file UMath.h.

template<class T >
bool uIsNan ( const T &  value) [inline]

Return true if the number is NAN.

Definition at line 42 of file UMath.h.

template<class T >
std::list<unsigned int> uLocalMaxima ( const T *  v,
unsigned int  size 
) [inline]

Find all local maxima.

Definition at line 627 of file UMath.h.

template<class T >
std::list<unsigned int> uLocalMaxima ( const std::vector< T > &  v) [inline]

Find all local maxima.

Definition at line 669 of file UMath.h.

template<class T >
T uMax ( const T *  v,
unsigned int  size,
unsigned int &  index 
) [inline]

Get the maximum of a vector.

Parameters:
vthe array
sizethe size of the array
indexthe index of the maximum value in the vector.
Returns:
the maximum value of the array

Definition at line 74 of file UMath.h.

template<class T >
T uMax ( const std::vector< T > &  v,
unsigned int &  index 
) [inline]

Get the maximum of a vector.

Parameters:
vthe array
indexthe index of the maximum value in the vector.
Returns:
the maximum value of the array

Definition at line 102 of file UMath.h.

template<class T >
T uMax ( const T *  v,
unsigned int  size 
) [inline]

Get the maximum of a vector.

Parameters:
vthe array
sizethe size of the array
Returns:
the maximum value of the array

Definition at line 114 of file UMath.h.

template<class T >
T uMax ( const std::vector< T > &  v) [inline]

Get the maximum of a vector.

Parameters:
vthe array
Returns:
the maximum value of the array

Definition at line 126 of file UMath.h.

template<class T >
T uMean ( const T *  v,
unsigned int  size 
) [inline]

Compute the mean of an array.

Parameters:
vthe array
sizethe size of the array
Returns:
the mean

Definition at line 381 of file UMath.h.

template<class T >
T uMean ( const std::list< T > &  list) [inline]

Get the mean of a list. Provided for convenience.

Parameters:
listthe list
Returns:
the mean

Definition at line 401 of file UMath.h.

template<class T >
T uMean ( const std::vector< T > &  v) [inline]

Get the mean of a vector. Provided for convenience.

Parameters:
vthe vector
Returns:
the mean

Definition at line 421 of file UMath.h.

template<class T >
T uMeanSquaredError ( const T *  x,
unsigned int  sizeX,
const T *  y,
unsigned int  sizeY 
) [inline]

Compute mean squared error between two arrays: mean((x-y).^2).

Parameters:
xthe first array
sizeXthe size of the array x
ythe second array
sizeYthe size of the array y (must be same size as x)
Returns:
the mean squared error (return -1 if error cannot be computed)

Definition at line 435 of file UMath.h.

template<class T >
T uMeanSquaredError ( const std::vector< T > &  x,
const std::vector< T > &  y 
) [inline]

Compute mean squared error between two arrays: mean((x-y).^2).

Parameters:
xthe first array
ythe second array (must be same size as x)
Returns:
the mean squared error (return -1 if error cannot be computed)

Definition at line 457 of file UMath.h.

template<class T >
T uMin ( const T *  v,
unsigned int  size,
unsigned int &  index 
) [inline]

Get the minimum of a vector.

Parameters:
vthe array
sizethe size of the array
indexthe index of the minimum value in the vector.
Returns:
the minimum value of the array

Definition at line 139 of file UMath.h.

template<class T >
T uMin ( const std::vector< T > &  v,
unsigned int &  index 
) [inline]

Get the minimum of a vector.

Parameters:
vthe array
indexthe index of the minimum value in the vector.
Returns:
the minimum value of the array

Definition at line 167 of file UMath.h.

template<class T >
T uMin ( const T *  v,
unsigned int  size 
) [inline]

Get the minimum of a vector.

Parameters:
vthe array
sizethe size of the array
Returns:
the minimum value of the array

Definition at line 179 of file UMath.h.

template<class T >
T uMin ( const std::vector< T > &  v) [inline]

Get the minimum of a vector.

Parameters:
vthe array
Returns:
the minimum value of the array

Definition at line 191 of file UMath.h.

template<class T >
void uMinMax ( const T *  v,
unsigned int  size,
T &  min,
T &  max,
unsigned int &  indexMin,
unsigned int &  indexMax 
) [inline]

Get the minimum and maximum of a vector.

Parameters:
vthe array
sizethe size of the array
minreference to output minimum
maxreference to output maximum
minreference to output minimum index
maxreference to output maximum index

Definition at line 206 of file UMath.h.

template<class T >
void uMinMax ( const std::vector< T > &  v,
T &  min,
T &  max,
unsigned int &  indexMin,
unsigned int &  indexMax 
) [inline]

Get the minimum and maximum of a vector.

Parameters:
vthe array
minreference to output minimum
maxreference to output maximum
minreference to output minimum index
maxreference to output maximum index

Definition at line 244 of file UMath.h.

template<class T >
void uMinMax ( const T *  v,
unsigned int  size,
T &  min,
T &  max 
) [inline]

Get the minimum and maximum of a vector.

Parameters:
vthe array
sizethe size of the array
minreference to output minimum
maxreference to output maximum

Definition at line 257 of file UMath.h.

template<class T >
void uMinMax ( const std::vector< T > &  v,
T &  min,
T &  max 
) [inline]

Get the minimum and maximum of a vector.

Parameters:
vthe array
minreference to output minimum
maxreference to output maximum

Definition at line 271 of file UMath.h.

template<class T >
T uNorm ( const std::vector< T > &  v) [inline]

Get the norm of the vector : return sqrt(x1*x1 + x2*x2 + x3*x3 + ...)

Returns:
the norm of the vector

Definition at line 555 of file UMath.h.

template<class T >
T uNorm ( const T &  x1,
const T &  x2 
) [inline]

Get the norm of the vector : return sqrt(x1*x1 + x2*x2 + x3*x3)

Returns:
the norm of the vector

Definition at line 575 of file UMath.h.

template<class T >
T uNorm ( const T &  x1,
const T &  x2,
const T &  x3 
) [inline]

Get the norm of the vector : return sqrt(x1*x1 + x2*x2 + x3*x3)

Returns:
the norm of the vector

Definition at line 595 of file UMath.h.

template<class T >
std::vector<T> uNormalize ( const std::vector< T > &  v) [inline]

Normalize the vector : [x1 x2 x3 ...] ./ uNorm([x1 x2 x3 ...])

Returns:
the vector normalized

Definition at line 605 of file UMath.h.

template<class T >
T uNormSquared ( const std::vector< T > &  v) [inline]

Get the squared norm of the vector : return x1*x1 + x2*x2 + x3*x3 + ...

Returns:
the squared norm of the vector

Definition at line 540 of file UMath.h.

template<class T >
T uNormSquared ( const T &  x1,
const T &  x2 
) [inline]

Get the squared norm of the vector : return x1*x1 + x2*x2

Returns:
the squared norm of the vector

Definition at line 565 of file UMath.h.

template<class T >
T uNormSquared ( const T &  x1,
const T &  x2,
const T &  x3 
) [inline]

Get the squared norm of the vector : return x1*x1 + x2*x2 + x3*x3

Returns:
the squared norm of the vector

Definition at line 585 of file UMath.h.

template<class T >
int uSign ( const T &  v) [inline]

Get the sign of value.

Parameters:
vthe value
Returns:
-1 if v<0, otherwise 1

Definition at line 282 of file UMath.h.

template<class T >
T uSum ( const std::list< T > &  list) [inline]

Get the sum of all values contained in a list. Provided for convenience.

Parameters:
listthe list
Returns:
the sum of values of the list

Definition at line 300 of file UMath.h.

template<class T >
T uSum ( const T *  v,
unsigned int  size 
) [inline]

Get the sum of all values contained in an array: sum(x).

Parameters:
vthe array
sizethe size of the array
Returns:
the sum of values of the array

Definition at line 317 of file UMath.h.

template<class T >
T uSum ( const std::vector< T > &  v) [inline]

Get the sum of all values contained in a vector. Provided for convenience.

Parameters:
vthe vector
Returns:
the sum of values of the vector

Definition at line 336 of file UMath.h.

template<class T >
T uSumSquared ( const T *  v,
unsigned int  size,
subtract = T() 
) [inline]

Get the sum of all squared values contained in an array: sum(x.^2).

Parameters:
vthe array
sizethe size of the array
subtractan optional value to remove to v before squaring v: sum((x-sub).^2)
Returns:
the sum of values of the array

Definition at line 349 of file UMath.h.

template<class T >
T uSumSquared ( const std::vector< T > &  v,
subtract = T() 
) [inline]

Get the sum of all squared values contained in an array: sum(x.^2).

Parameters:
vthe array
subtractan optional value to remove to v before squaring v: sum((x-sub).^2)
Returns:
the sum of values of the array

Definition at line 369 of file UMath.h.

template<class T >
T uVariance ( const T *  v,
unsigned int  size,
meanV 
) [inline]

Compute the variance of an array.

Parameters:
vthe array
sizethe size of the array
meanVthe mean of the array
Returns:
the variance
See also:
mean()

Definition at line 471 of file UMath.h.

template<class T >
T uVariance ( const std::list< T > &  list,
const T &  m 
) [inline]

Get the variance of a list. Provided for convenience.

Parameters:
listthe list
mthe mean of the list
Returns:
the variance
See also:
mean()

Definition at line 494 of file UMath.h.

template<class T >
T uVariance ( const T *  v,
unsigned int  size 
) [inline]

Compute the variance of an array.

Parameters:
vthe array
sizethe size of the array
Returns:
the variance

Definition at line 516 of file UMath.h.

template<class T >
T uVariance ( const std::vector< T > &  v,
const T &  m 
) [inline]

Get the variance of a vector. Provided for convenience.

Parameters:
vthe vector
mthe mean of the vector
Returns:
the variance
See also:
mean()

Definition at line 530 of file UMath.h.

template<class T >
std::vector<T> uXMatch ( const T *  vA,
const T *  vB,
unsigned int  sizeA,
unsigned int  sizeB,
UXMatchMethod  method 
) [inline]

Do a full cross-correlation or cross-covariance between 2 arrays.

Parameters:
vAthe first array
vBthe second array
sizeAthe size of the first array
sizeBthe size of the second array
methodsee UXMatchMethod
Returns:
the resulting correlation/covariance vector of size = sizeA + sizeB - 1

Definition at line 690 of file UMath.h.

template<class T >
std::vector<T> uXMatch ( const std::vector< T > &  vA,
const std::vector< T > &  vB,
UXMatchMethod  method 
) [inline]

Do a full cross-correlation or cross-covariance between 2 arrays.

Parameters:
vAthe first array
vBthe second array
methodsee UXMatchMethod
Returns:
the resulting correlation/covariance vector of size = sizeA + sizeB - 1

Definition at line 802 of file UMath.h.

template<class T >
T uXMatch ( const T *  vA,
const T *  vB,
unsigned int  sizeA,
unsigned int  sizeB,
unsigned int  index,
UXMatchMethod  method 
) [inline]

Do a cross correlation between 2 arrays at a specified index.

Parameters:
vAthe first array
vBthe second array
sizeAthe size of the first array
sizeBthe size of the second array
indexthe index to correlate
methodsee UXMatchMethod
Returns:
the resulting correlation value

Definition at line 818 of file UMath.h.

template<class T >
T uXMatch ( const std::vector< T > &  vA,
const std::vector< T > &  vB,
unsigned int  index,
UXMatchMethod  method 
) [inline]

Do a cross correlation between 2 arrays at a specified index.

Parameters:
vAthe first array
vBthe second array
sizeAthe size of the first array
sizeBthe size of the second array
indexthe index to correlate
methodsee UXMatchMethod
Returns:
the resulting correlation value

Definition at line 891 of file UMath.h.



rtabmap
Author(s): Mathieu Labbe
autogenerated on Fri Aug 28 2015 12:51:43