MRPT logo
Namespaces | Defines | Enumerations | Functions | Variables

math_frwds.h File Reference

#include <mrpt/config.h>
#include <cmath>
#include <cstdlib>
#include <algorithm>
Include dependency graph for math_frwds.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  mrpt
 

This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.


namespace  mrpt::utils
 

Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.


namespace  mrpt::poses
 

Classes for 2D/3D geometry representation, both of single values and probability density distributions (PDFs) in many forms.


namespace  mrpt::math
 

This base provides a set of functions for maths stuff.


namespace  mrpt::math::detail

Defines

#define UNINITIALIZED_MATRIX   false,false,false
 For usage in one of the constructors of CMatrixFixedNumeric, if it's not required to fill it with zeros at the constructor to save time.
#define DECLARE_COMMON_CONTAINERS_MEMBERS(NUMTYPE)
#define DECLARE_COMMON_MATRIX_MEMBERS(NUMTYPE)

Enumerations

enum  mrpt::math::TMatrixTextFileFormat { mrpt::math::MATRIX_FORMAT_ENG = 0, mrpt::math::MATRIX_FORMAT_FIXED = 1, mrpt::math::MATRIX_FORMAT_INT = 2 }

Functions

template<class T >
T mrpt::utils::square (const T &x)
 Inline function for the square of a number.
template<class MATRIX1 , class MATRIX2 >
bool mrpt::math::detail::chol (const MATRIX1 &in, MATRIX2 &out)
 Cholesky factorization: in = out' · out (Upper triangular version: M=U'*U ) Given a positive-definite symmetric matrix, this routine constructs its Cholesky decomposition.
template<class MATRIX1 >
MATRIX1::value_type mrpt::math::detail::trace (const MATRIX1 &m)
 The trace of a matrix (the sum of its diagonal).
template<class MATRIX1 , class MATRIX2 , class MATRIXRES >
void mrpt::math::detail::multiply_AB (const MATRIX1 &m1, const MATRIX2 &m2, MATRIXRES &RESULT)
 Multiply 2 matrices: RESULT = A * B.
template<class MATRIX1 , class OTHERVECTOR1 , class OTHERVECTOR2 >
void mrpt::math::detail::multiply_Ab (const MATRIX1 &m, const OTHERVECTOR1 &vIn, OTHERVECTOR2 &vOut, bool accumToOutput)
 Computes the vector v = A * a, where "a" is a column vector of the appropriate length.
template<class MATRIX1 , class OTHERVECTOR1 , class OTHERVECTOR2 >
void mrpt::math::detail::multiply_Atb (const MATRIX1 &m, const OTHERVECTOR1 &vIn, OTHERVECTOR2 &vOut, bool accumToOutput)
 Computes the vector v = AT * a, where "a" is a column vector of the appropriate length.
template<class MATRIX1 , class MATRIX2 >
void mrpt::math::detail::multiply_AAt (const MATRIX1 &m1, MATRIX2 &RESULT)
 RESULT = A * A^t.
template<class MATRIX1 , class MATRIX2 >
void mrpt::math::detail::multiply_AtA (const MATRIX1 &m1, MATRIX2 &RESULT)
 RESULT = A^t * A.
template<typename MAT_H , typename MAT_C , typename MAT_R >
void mrpt::math::detail::multiply_HCHt (const MAT_H &H, const MAT_C &C, MAT_R &R, bool accumResultInOutput, bool allow_submatrix_mult)
 R = H * C * H^t (with C symmetric).
template<typename MAT_H , typename MAT_C , typename MAT_R >
void mrpt::math::detail::multiply_HtCH (const MAT_H &H, const MAT_C &C, MAT_R &R, bool accumResultInOutput, bool allow_submatrix_mult)
 R = H^t * C * H (with C symmetric).
template<typename VECTOR_H , typename MAT_C >
MAT_C::value_type mrpt::math::detail::multiply_HCHt_scalar (const VECTOR_H &H, const MAT_C &C)
 r (a scalar) = H * C * H^t (with a vector H and a symmetric matrix C)
template<class MAT_X , class MAT_A , class MAT_OUT >
void mrpt::math::detail::multiply_subMatrix (const MAT_X &X, const MAT_A &A, MAT_OUT &outResult, const size_t A_cols_offset, const size_t A_rows_offset, const size_t A_col_count)
 Matrix multiplication of this matrix with a submatrix of 'A', saving the result in a third matrix.
template<class MAT_A , class MAT_B , class MAT_C , class MAT_OUT >
void mrpt::math::detail::multiply_ABC (const MAT_A &A, const MAT_B &B, const MAT_C &C, MAT_OUT &RES)
 RES = A*B*C.
template<class MAT_A , class MAT_B , class MAT_C , class MAT_OUT >
void mrpt::math::detail::multiply_ABCt (const MAT_A &A, const MAT_B &B, const MAT_C &C, MAT_OUT &RES)
 RES = A*B*(C^t).
template<class MAT_A , class MAT_B , class MAT_OUT >
void mrpt::math::detail::multiply_ABt (const MAT_A &A, const MAT_B &B, MAT_OUT &out)
template<class MAT_A , class MAT_OUT >
void mrpt::math::detail::multiply_AAt (const MAT_A &A, MAT_OUT &out)
template<class MAT_A , class MAT_B , class MAT_OUT >
void mrpt::math::detail::multiply_result_is_symmetric (const MAT_A &A, const MAT_B &B, MAT_OUT &out)
template<typename MatrixType >
size_t mrpt::math::detail::rank (const MatrixType &m, typename MatrixType::value_type eps=1e-7)
template<>
void mrpt::math::detail::eigenVectorsMatrix< CMatrixFixedNumeric< float, 2, 2 >, CMatrixFixedNumeric< float, 2, 2 >, CArrayNumeric< float, 2 > > (const CMatrixFixedNumeric< float, 2, 2 > &M, CMatrixFixedNumeric< float, 2, 2 > *eVecs, CArrayNumeric< float, 2 > &eVals)
template<>
void mrpt::math::detail::eigenVectorsMatrix< CMatrixFixedNumeric< double, 2, 2 >, CMatrixFixedNumeric< double, 2, 2 >, CArrayNumeric< double, 2 > > (const CMatrixFixedNumeric< double, 2, 2 > &M, CMatrixFixedNumeric< double, 2, 2 > *eVecs, CArrayNumeric< double, 2 > &eVals)
template<class MAT >
void mrpt::math::detail::saveMatrixToTextFile (const MAT &theMatrix, const std::string &file, TMatrixTextFileFormat fileFormat, bool appendMRPTHeader, const std::string &userHeader)
 Save matrix to a text file, compatible with MATLAB text format (see also the methods of matrix classes themselves).
template<typename T , size_t NROWS, size_t NCOLS>
void mrpt::math::detail::fixedToDynMatrix (const CMatrixFixedNumeric< T, NROWS, NCOLS > &SRC, CMatrixTemplateNumeric< T > &DST)
 Auxiliary function used in the constructor of dyn.
template<typename T , size_t NROWS, size_t NCOLS>
void mrpt::math::detail::insertMatrixFixTransposeIntoDyn (CMatrixTemplate< T > &M, const size_t nRow, const size_t nCol, const CMatrixFixedNumeric< T, NROWS, NCOLS > &in)
 Auxiliary function used in CMatrixTemplate.
template<typename T , size_t NROWS, size_t NCOLS>
void mrpt::math::detail::insertMatrixFixIntoDyn (CMatrixTemplate< T > &M, const size_t nRow, const size_t nCol, const CMatrixFixedNumeric< T, NROWS, NCOLS > &in)
 Auxiliary function used in CMatrixTemplate.
template<typename T , size_t NROWS, size_t NCOLS>
void mrpt::math::detail::extractFixMatrixFromDynMatrix (const CMatrixTemplate< T > &M, const size_t nRow, const size_t nCol, CMatrixFixedNumeric< T, NROWS, NCOLS > &outMat)
 Used from CMatrixTemplate::extractMatrix.
template<class MATRIX >
int mrpt::math::detail::matrix_pivot (MATRIX &M, const size_t row)
 Matrix pivoting - used for detMatrix, etc.
template<typename MAT1 , typename MAT2 , typename MAT3 >
void mrpt::math::detail::leftDivideSquare (const MAT1 &C, const MAT2 &A, MAT3 &RES)
template<typename MAT1 , typename MAT2 , typename MAT3 >
void mrpt::math::detail::rightDivideSquare (const MAT1 &C, const MAT2 &B, MAT3 &RES)
template<typename MAT1 , typename MAT2 >
void mrpt::math::detail::fastLeftDivideSquare (MAT1 &inout_CB, MAT2 &willBeDestroyed_A)
template<typename MAT1 , typename MAT2 >
void mrpt::math::detail::fastRightDivideSquare (MAT1 &inout_CA, MAT2 &willBeDestroyed_B)
template<class MATRIX >
bool mrpt::math::detail::isMatrixTypeResizable (const MATRIX &)
template<class CONTAINER >
size_t mrpt::math::countNonZero (const CONTAINER &a)
template<class CONTAINER >
CONTAINER::value_type mrpt::math::maximum (const CONTAINER &v, size_t *maxIndex=NULL)
template<class CONTAINER >
CONTAINER::value_type mrpt::math::minimum (const CONTAINER &v, size_t *minIndex=NULL)
template<class CONTAINER >
void mrpt::math::minimum_maximum (const CONTAINER &v, typename CONTAINER::mrpt_autotype::value_type &out_min, typename CONTAINER::mrpt_autotype::value_type &out_max, size_t *minIndex=static_cast< size_t * >(NULL), size_t *maxIndex=static_cast< size_t * >(NULL))
template<class CONTAINER >
CONTAINER::value_type mrpt::math::norm_inf (const CONTAINER &v, size_t *maxIndex=NULL)
template<class CONTAINER >
CONTAINER::value_type mrpt::math::squareNorm (const CONTAINER &v)
template<class CONTAINER >
CONTAINER::value_type mrpt::math::norm (const CONTAINER &v)
template<class CONTAINER >
double mrpt::math::mean (const CONTAINER &v)
template<class CONTAINER >
CONTAINER::value_type mrpt::math::sum (const CONTAINER &v)
template<class CONTAINER >
void mrpt::math::adjustRange (CONTAINER &m, const typename CONTAINER::value_type minVal, const typename CONTAINER::value_type maxVal)
template<class CONTAINER1 , class CONTAINER2 >
void mrpt::math::cumsum (const CONTAINER1 &in_data, CONTAINER2 &out_cumsum)
template<class CONTAINER1 , class CONTAINER2 >
size_t mrpt::math::countCommonElements (const CONTAINER1 &a, const CONTAINER2 &b)
template<class CONTAINER >
std::vector< double > mrpt::math::histogram (const CONTAINER &v, double limit_min, double limit_max, size_t number_bins, bool do_normalization=false)
template<class VECTORLIKE >
double mrpt::math::stddev (const VECTORLIKE &v, bool unbiased=true)
template<class VECTORLIKE >
void mrpt::math::meanAndStd (const VECTORLIKE &v, double &out_mean, double &out_std, bool unbiased=true)
Matrix inverses - Implementation

template<class MATRIXIN , class MATRIXOUT >
void mrpt::math::detail::invMatrix (const MATRIXIN &M, MATRIXOUT &out_inv)
template<class MATRIXIN , class MATRIXOUT >
void mrpt::math::detail::invMatrix_destroySrc (MATRIXIN &M, MATRIXOUT &out_inv)
template<class MATRIXIN , class MATRIXOUT >
void mrpt::math::detail::invMatrix_special_2x2 (const MATRIXIN &M, MATRIXOUT &out_inv)
template<class MATRIXIN , class MATRIXOUT >
void mrpt::math::detail::invMatrix_special_3x3 (const MATRIXIN &M, MATRIXOUT &out_inv)
Matrix determinants - implementation

template<class MATRIX >
 mrpt::math::detail::RET_ELEMENT_ASSERT_MRPTCONTAINER (MATRIX) detMatrix(const MATRIX &M)
template<class MATRIX >
MATRIX::value_type mrpt::math::detail::detMatrix_special_2x2 (const MATRIX &M)
template<class MATRIX >
MATRIX::value_type mrpt::math::detail::detMatrix_special_3x3 (const MATRIX &M)
template<class MATRIX >
MATRIX::value_type mrpt::math::detail::detMatrix_special_4x4 (const MATRIX &M)
Matrix eigenvectors

template<class MATRIX1 , class MATRIX2 , class VECTOR1 >
void mrpt::math::detail::eigenVectorsMatrix (const MATRIX1 &M, MATRIX2 *eVecs, VECTOR1 &eVals)
 eigenVectorsMatrix
template<class MATRIX1 , class MATRIX2 , class VECTOR1 >
void mrpt::math::detail::eigenVectorsMatrix_special_2x2 (const MATRIX1 &M, MATRIX2 *eVecs, VECTOR1 &eVals)

Variables

class MRPTDLLIMPEXP mrpt::utils::CStream
class MRPTDLLIMPEXP mrpt::math::CMatrixTemplateNumeric
class MRPTDLLIMPEXP mrpt::math::CMatrix
class MRPTDLLIMPEXP mrpt::math::CMatrixD

Detailed Description

Forward declarations of all mrpt::math classes related to vectors, arrays and matrices. Many of the function implementations are in ops_matrices.h, others in ops_containers.h

Definition in file math_frwds.h.


Define Documentation

#define DECLARE_COMMON_CONTAINERS_MEMBERS (   NUMTYPE  ) 

Definition at line 94 of file math_frwds.h.

#define DECLARE_COMMON_MATRIX_MEMBERS (   NUMTYPE  ) 

Definition at line 145 of file math_frwds.h.

#define UNINITIALIZED_MATRIX   false,false,false

For usage in one of the constructors of CMatrixFixedNumeric, if it's not required to fill it with zeros at the constructor to save time.

Definition at line 70 of file math_frwds.h.

Referenced by mrpt::poses::CPoseOrPoint::getHomogeneousMatrixVal(), mrpt::math::productIntegralTwoGaussians(), mrpt::math::RET_MAT_ASSERT_MRPTMATRIX(), mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::runOneKalmanIteration(), and mrpt::bayes::detail::runOneKalmanIteration_addNewLandmarks().




Page generated by Doxygen 1.7.1 for MRPT 0.8.1 SVN:exported at Sun Sep 19 14:53:45 UTC 2010