MRPT logo
Classes | Namespaces | Defines | Functions

utils_defs.h File Reference

#include <mrpt/config.h>
#include <mrpt/system/os.h>
#include <mrpt/utils/utils_impexp.h>
#include <cstddef>
#include <stdlib.h>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>
#include <algorithm>
#include <iterator>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <cstring>
#include <exception>
#include <stdexcept>
#include <limits>
#include <sstream>
#include <mrpt/otherlibs/stlplus/smart_ptr.hpp>
#include <mrpt/utils/types.h>
Include dependency graph for utils_defs.h:

Go to the source code of this file.

Classes

struct  mrpt::utils::CProfilerProxy

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::system
 

This namespace provides a OS-independent interface to many useful functions: filenames manipulation, time and date, string parsing, file I/O, threading, memory allocation, etc.


namespace  mrpt::math
 

This base provides a set of functions for maths stuff.


Defines

#define _IAMINUTILSDEFS_H
#define BOOST_JOIN(X, Y)   BOOST_DO_JOIN( X, Y )
#define BOOST_DO_JOIN(X, Y)   BOOST_DO_JOIN2(X,Y)
#define BOOST_DO_JOIN2(X, Y)   X##Y
#define MRPT_DEPRECATED_PRE(_MSG)
#define MRPT_DEPRECATED_POST(_MSG)
#define MRPT_DECLARE_DEPRECATED_FUNCTION(__MSG, __FUNC)   MRPT_DEPRECATED_PRE(__MSG) __FUNC MRPT_DEPRECATED_POST(__MSG)
 Usage: MRPT_DECLARE_DEPRECATED_FUNCTION("Use XX instead", void myFunc(double));.
#define MRPT_DO_PRAGMA(x)
 Declare MRPT_TODO(message).
#define MRPT_TODO(x)   MRPT_DO_PRAGMA(message ("TODO: " #x))
#define MRPT_printf_format_check(_FMT_, _VARARGS_)
#define MRPT_scanf_format_check(_FMT_, _VARARGS_)
#define MRPT_NO_THROWS   throw()
 Used after member declarations.
#define MRPT_ALIGN16
#define MRPT_ALIGN32
#define __CURRENT_FUNCTION_NAME__   __PRETTY_FUNCTION__
 A macro for obtaining the name of the current function:
#define THROW_EXCEPTION(msg)
#define THROW_EXCEPTION_CUSTOM_MSG1(msg, param1)
#define THROW_TYPED_EXCEPTION(msg, exceptionClass)
 Defines a unified way of reporting exceptions of type different from "std::exception".
#define THROW_TYPED_EXCEPTION_CUSTOM_MSG1(msg, param1, exceptionClass)
#define THROW_STACKED_EXCEPTION(e)
#define THROW_STACKED_EXCEPTION_CUSTOM_MSG1(e, msg)
#define THROW_STACKED_EXCEPTION_CUSTOM_MSG2(e, stuff, param1)
#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION(V)   THROW_EXCEPTION(mrpt::format("Cannot parse object: unknown serialization version number: '%i'",static_cast<int>(version)))
 For use in CSerializable implementations.
#define ASSERTMSG_(f, __ERROR_MSG)   { }
#define ASSERT_(f)   { }
#define MRPT_CHECK_NORMAL_NUMBER(val)   { }
#define MRPT_COMPILE_TIME_ASSERT(f)   { }
#define ASSERTDEB_(f)   { }
 Defines an assertion mechanism - only when compiled in debug.
#define MRPT_UNUSED_PARAM(a)   (void)(a)
 Can be used to avoid "not used parameters" warnings from the compiler.
#define MRPT_TRY_START
#define MRPT_TRY_END
#define MRPT_TRY_END_WITH_CLEAN_UP(stuff)
#define MRPT_PROFILE_FUNC_START
#define MRPT_START
#define MRPT_END   MRPT_TRY_END
#define MRPT_END_WITH_CLEAN_UP(stuff)   MRPT_TRY_END_WITH_CLEAN_UP(stuff)
#define M_PI   3.14159265358979323846264338327950288
 The PI constant.
#define M_2PI   6.283185307179586476925286766559
 The 2*PI constant.
#define M_PIf   3.14159265358979f
#define M_2PIf   6.28318530717959f

Functions

std::string MRPTDLLIMPEXP mrpt::format (const char *fmt,...) MRPT_printf_format_check(1
 A std::string version of C sprintf.
std::string MRPTDLLIMPEXP mrpt::system::stack_trace (bool calling_from_exception=false)
 Dumps the current program stack with detailed information of source files and lines.
bool MRPTDLLIMPEXP mrpt::math::isNaN (float f) MRPT_NO_THROWS
 Returns true if the number is NaN.
bool MRPTDLLIMPEXP mrpt::math::isNaN (double f) MRPT_NO_THROWS
 Returns true if the number is NaN.
bool MRPTDLLIMPEXP mrpt::math::isFinite (float f) MRPT_NO_THROWS
 Returns true if the number is non infinity.
bool MRPTDLLIMPEXP mrpt::math::isFinite (double f) MRPT_NO_THROWS
 Returns true if the number is non infinity.
template<typename T >
const T min3 (const T &A, const T &B, const T &C)
template<typename T >
const T max3 (const T &A, const T &B, const T &C)
template<class MATRIXLIKE >
size_t mrpt::math::size (const MATRIXLIKE &m, int dim)
double mrpt::utils::DEG2RAD (const double x)
 Degrees to radians.
float mrpt::utils::DEG2RAD (const float x)
 Degrees to radians.
float mrpt::utils::DEG2RAD (const int x)
 Degrees to radians.
double mrpt::utils::RAD2DEG (const double x)
 Radians to degrees.
float mrpt::utils::RAD2DEG (const float x)
 Radians to degrees.
template<typename T >
int mrpt::utils::sign (T x)
 Returns the sign of X as "1" or "-1".
template<typename T >
int mrpt::utils::signWithZero (T x)
 Returns the sign of X as "0", "1" or "-1".
template<typename T >
int mrpt::utils::round (const T value)
 Returns the closer integer (int) to x.
template<typename T >
long mrpt::utils::round_long (const T value)
 Returns the closer integer (long) to x.
template<typename T >
int mrpt::utils::fix (T x)
 Rounds toward zero.
template<class T >
T mrpt::utils::square (const T &x)
 Inline function for the square of a number.
template<class R , class P >
R * mrpt::utils::getAs (stlplus::smart_ptr_clone< P > &o)
 Utility to get a cast'ed pointer from a smart pointer.
template<class R , class P >
const R * mrpt::utils::getAs (const stlplus::smart_ptr_clone< P > &o)
 Utility to get a cast'ed pointer from a smart pointer.
template<class T >
void mrpt::utils::reverseBytes (const T &v_in, T &v_out)
 Reverse the order of the bytes of a given type (useful for transforming btw little/big endian).
template<typename T , typename K >
void mrpt::utils::keep_min (T &var, const K test_val)
 If the second argument is below the first one, set the first argument to this lower value.
template<typename T , typename K >
void mrpt::utils::keep_max (T &var, const K test_val)
 If the second argument is above the first one, set the first argument to this higher value.
template<class T >
void mrpt::utils::delete_safe (T *&ptr)
 Calls "delete" to free an object only if the pointer is not NULL, then set the pointer to NULL.
Auxiliary stuff for the global profiler used in MRPT_START / MRPT_END macros.

void MRPTDLLIMPEXP mrpt::utils::global_profiler_enter (const char *func_name) MRPT_NO_THROWS
void MRPTDLLIMPEXP mrpt::utils::global_profiler_leave (const char *func_name) MRPT_NO_THROWS
Directories, files, and file names

std::string MRPTDLLIMPEXP mrpt::system::extractFileName (const std::string &filePath)
 Extract just the name (without extension) of a filename from a complete path plus name plus extension.

Define Documentation

#define __CURRENT_FUNCTION_NAME__   __PRETTY_FUNCTION__

A macro for obtaining the name of the current function:

Definition at line 267 of file utils_defs.h.

#define _IAMINUTILSDEFS_H

Definition at line 70 of file utils_defs.h.

#define ASSERT_ (   f  )     { }

Definition at line 415 of file utils_defs.h.

Referenced by mrpt::math::CMatrixTemplate< TPoint3D >::appendCol(), mrpt::math::CMatrixTemplate< TPoint3D >::appendRow(), mrpt::math::CMatrixTemplate< TPoint3D >::ASSERT_ENOUGHROOM(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::ASSERT_ENOUGHROOM(), mrpt::math::CConstMatrixColumnAccessor< MAT >::CConstMatrixColumnAccessor(), mrpt::math::CConstMatrixColumnAccessorExtended< MAT >::CConstMatrixColumnAccessorExtended(), mrpt::math::CConstMatrixRowAccessor< MAT >::CConstMatrixRowAccessor(), mrpt::math::CConstMatrixRowAccessorExtended< MAT >::CConstMatrixRowAccessorExtended(), mrpt::math::CDijkstra< TYPE_EDGES >::CDijkstra(), mrpt::math::CMatrixColumnAccessor< MAT >::CMatrixColumnAccessor(), mrpt::math::CMatrixColumnAccessorExtended< MAT >::CMatrixColumnAccessorExtended(), mrpt::math::CMatrixRowAccessor< MAT >::CMatrixRowAccessor(), mrpt::math::CMatrixRowAccessorExtended< MAT >::CMatrixRowAccessorExtended(), mrpt::math::CMatrixTemplate< TPoint3D >::CMatrixTemplate(), mrpt::math::condidenceIntervals(), mrpt::math::CHistogram::createWithFixedWidth(), mrpt::math::crossProduct3D(), mrpt::math::CConstArbitrarySubmatrixView< MATRIXTYPE >::deleteColumn(), mrpt::math::CArbitrarySubmatrixView< MATRIXTYPE >::deleteColumn(), mrpt::math::CConstArbitrarySubmatrixView< MATRIXTYPE >::deleteRow(), mrpt::math::CArbitrarySubmatrixView< MATRIXTYPE >::deleteRow(), mrpt::random::CRandomGenerator::drawGaussianMultivariate(), mrpt::random::CRandomGenerator::drawGaussianMultivariateMany(), mrpt::math::detail::eigenVectorsMatrix(), mrpt::math::estimateJacobian(), mrpt::math::CLevenbergMarquardtTempl< VECTORTYPE, USERPARAM >::execute(), mrpt::math::CVectorTemplate< KFTYPE >::extract_array(), mrpt::math::CMatrixTemplate< TPoint3D >::extractSubmatrixSymmetrical(), mrpt::math::CMatrixTemplate< TPoint3D >::extractSubmatrixSymmetricalBlocks(), mrpt::poses::CPosePDFSOG::get(), mrpt::poses::CPointPDFSOG::get(), mrpt::slam::CBeaconMap::get(), mrpt::utils::CMHPropertiesValuesList::getAs(), mrpt::poses::CPose2DGridTemplate< double >::getAsMatrix(), mrpt::poses::CPose2DGridTemplate< double >::getByIndex(), mrpt::utils::CMessage::getContentAsStruct(), mrpt::utils::CMHPropertiesValuesList::getElemental(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getMostLikelyParticle(), mrpt::math::CConstArbitrarySubmatrixView< MATRIXTYPE >::getProxyCol(), mrpt::math::CArbitrarySubmatrixView< MATRIXTYPE >::getProxyCol(), mrpt::math::CConstArbitrarySubmatrixView< MATRIXTYPE >::getProxyRow(), mrpt::math::CArbitrarySubmatrixView< MATRIXTYPE >::getProxyRow(), mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationFrom(), mrpt::math::CBinaryRelation< T, U, UIsObject >::getRelationTo(), mrpt::math::CDijkstra< TYPE_EDGES >::getShortestPathTo(), mrpt::opengl::CSetOfTriangles::getTriangle(), mrpt::opengl::CSetOfTexturedTriangles::getTriangle(), mrpt::slam::CLandmark::getType(), mrpt::math::CPolygon::GetVertex_x(), mrpt::math::CPolygon::GetVertex_y(), mrpt::poses::CPose2DGridTemplate< double >::idx2phi(), mrpt::poses::CPose2DGridTemplate< double >::idx2x(), mrpt::poses::CPose2DGridTemplate< double >::idx2y(), mrpt::math::detail::VicinityTraits< CMatrixFixedNumeric< T, D, D > >::initialize(), mrpt::math::CVectorTemplate< KFTYPE >::insert_array(), mrpt::math::CMatrixTemplate< TPoint3D >::insertCol(), mrpt::math::CMatrixTemplate< TPoint3D >::insertRow(), mrpt::math::interpolate(), mrpt::math::JointHorizontalAccessor< M1, M2 >::JointHorizontalAccessor(), mrpt::math::JointVerticalAccessor< M1, M2 >::JointVerticalAccessor(), mrpt::math::KLD_Gaussians(), mrpt::math::leastSquareLinearFit(), mrpt::math::mahalanobisDistance2(), mrpt::math::detail::multiply_Ab(), mrpt::math::detail::multiply_ABC(), mrpt::math::detail::multiply_ABCt(), mrpt::math::detail::multiply_Atb(), mrpt::math::detail::multiply_HCHt(), mrpt::math::detail::multiply_HCHt_scalar(), mrpt::math::detail::multiply_HtCH(), mrpt::math::detail::multiply_subMatrix(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::multiplyColumnByScalar(), mrpt::slam::detail::TPathBin2D::lt_operator::operator()(), mrpt::math::CMatrixTemplate< TPoint3D >::operator()(), mrpt::utils::copiable_NULL_ptr< T >::operator*(), mrpt::utils::non_copiable_ptr< CMultiMetricMap >::operator*(), mrpt::utils::safe_ptr< TRuntimeClassId >::operator*(), mrpt::math::CVectorTemplate< KFTYPE >::operator*(), mrpt::math::operator*(), mrpt::math::CVectorTemplate< KFTYPE >::operator+(), mrpt::math::operator+(), mrpt::math::CVectorTemplate< KFTYPE >::operator+=(), mrpt::math::CVectorTemplate< KFTYPE >::operator-(), mrpt::math::operator-(), mrpt::utils::copiable_NULL_ptr_basic< T >::operator->(), mrpt::utils::non_copiable_ptr_basic< CMultiMetricMap >::operator->(), mrpt::utils::safe_ptr_basic< TRuntimeClassId >::operator->(), mrpt::math::CVectorTemplate< KFTYPE >::operator/(), mrpt::math::CArbitrarySubmatrixView< MATRIXTYPE >::operator=(), mrpt::math::CSubmatrixView< MATRIXTYPE, NR, NC >::operator=(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::operator=(), mrpt::utils::copiable_NULL_ptr< T >::operator[](), mrpt::utils::non_copiable_ptr< CMultiMetricMap >::operator[](), mrpt::utils::safe_ptr< TRuntimeClassId >::operator[](), mrpt::poses::CPosePDFSOG::operator[](), mrpt::poses::CPointPDFSOG::operator[](), mrpt::math::CBinaryRelation< T, U, UIsObject >::operator[](), mrpt::slam::CBeaconMap::operator[](), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_implementation_pfAuxiliaryPFStandardAndOptimal(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_particlesEvaluator_AuxPFOptimal(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_particlesEvaluator_AuxPFStandard(), mrpt::poses::CPose2DGridTemplate< double >::phi2idx(), mrpt::math::productIntegralAndMahalanobisTwoGaussians(), mrpt::math::productIntegralTwoGaussians(), mrpt::math::detail::rank(), mrpt::bayes::CRejectionSamplingCapable< poses::CPose2D >::rejectionSampling(), mrpt::math::CMatrixTemplate< TPoint3D >::removeColumns(), mrpt::math::CBinaryRelation< T, U, UIsObject >::removeElementAt(), mrpt::math::CMatrixTemplate< TPoint3D >::removeRowsAndCols(), mrpt::utils::CImage::resize(), mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::runOneKalmanIteration(), mrpt::utils::CMemoryStream::setAllocBlockSize(), mrpt::opengl::CAxis::setFrequency(), mrpt::opengl::CGridPlaneXZ::setGridFrequency(), mrpt::opengl::CGridPlaneXY::setGridFrequency(), mrpt::poses::CPose2DGridTemplate< double >::setSize(), mrpt::hwdrivers::CServoeNeck::setTruncateFactor(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::swapCols(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::swapRows(), mrpt::math::weightedHistogram(), mrpt::math::weightedHistogramLog(), mrpt::poses::CPose2DGridTemplate< double >::x2idx(), mrpt::poses::CPose2DGridTemplate< double >::y2idx(), and mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::zeros().

#define ASSERTDEB_ (   f  )     { }
#define ASSERTMSG_ (   f,
  __ERROR_MSG 
)    { }
#define BOOST_DO_JOIN (   X,
  Y 
)    BOOST_DO_JOIN2(X,Y)

Definition at line 86 of file utils_defs.h.

#define BOOST_DO_JOIN2 (   X,
  Y 
)    X##Y

Definition at line 87 of file utils_defs.h.

#define BOOST_JOIN (   X,
  Y 
)    BOOST_DO_JOIN( X, Y )

Definition at line 85 of file utils_defs.h.

#define M_2PI   6.283185307179586476925286766559
#define M_2PIf   6.28318530717959f

Definition at line 525 of file utils_defs.h.

#define M_PI   3.14159265358979323846264338327950288
#define M_PIf   3.14159265358979f

Definition at line 524 of file utils_defs.h.

Referenced by mrpt::utils::DEG2RAD().

#define MRPT_ALIGN16

Definition at line 176 of file utils_defs.h.

#define MRPT_ALIGN32

Definition at line 177 of file utils_defs.h.

#define MRPT_CHECK_NORMAL_NUMBER (   val  )     { }
#define MRPT_COMPILE_TIME_ASSERT (   f  )     { }
#define MRPT_DECLARE_DEPRECATED_FUNCTION (   __MSG,
  __FUNC 
)    MRPT_DEPRECATED_PRE(__MSG) __FUNC MRPT_DEPRECATED_POST(__MSG)

Usage: MRPT_DECLARE_DEPRECATED_FUNCTION("Use XX instead", void myFunc(double));.

Definition at line 138 of file utils_defs.h.

#define MRPT_DEPRECATED_POST (   _MSG  ) 

Definition at line 134 of file utils_defs.h.

#define MRPT_DEPRECATED_PRE (   _MSG  ) 

Definition at line 133 of file utils_defs.h.

#define MRPT_DO_PRAGMA (   x  ) 

Declare MRPT_TODO(message).

Definition at line 146 of file utils_defs.h.

#define MRPT_END   MRPT_TRY_END

Definition at line 503 of file utils_defs.h.

Referenced by mrpt::bayes::CParticleFilterData< CRBPFParticleData >::clearParticles(), mrpt::slam::CMetricMap::computeMatchingWith2D(), mrpt::slam::CMetricMap::computeMatchingWith3D(), mrpt::math::condidenceIntervals(), mrpt::math::estimateJacobian(), mrpt::utils::CMHPropertiesValuesList::getAs(), mrpt::poses::CPose2DGridTemplate< double >::getAsMatrix(), mrpt::utils::CMessage::getContentAsStruct(), mrpt::utils::CMHPropertiesValuesList::getElemental(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getMostLikelyParticle(), mrpt::hwdrivers::CSerialPort::getPosition(), mrpt::utils::CClientTCPSocket::getPosition(), mrpt::hwdrivers::CSerialPort::getTotalBytesCount(), mrpt::utils::CClientTCPSocket::getTotalBytesCount(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getWeights(), mrpt::math::interpolate(), mrpt::math::KLD_Gaussians(), mrpt::math::leastSquareLinearFit(), mrpt::math::mahalanobisDistance2(), mrpt::math::mahalanobisDistance2AndLogPDF(), mrpt::math::detail::multiply_AB(), mrpt::math::detail::multiply_Ab(), mrpt::math::detail::multiply_ABt(), mrpt::math::detail::multiply_Atb(), mrpt::math::detail::multiply_HCHt(), mrpt::math::detail::multiply_HCHt_scalar(), mrpt::math::detail::multiply_HtCH(), mrpt::math::detail::multiply_result_is_symmetric(), mrpt::math::detail::multiply_subMatrix(), mrpt::math::normalPDF(), mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::OnInverseObservationModel(), mrpt::math::CVectorTemplate< KFTYPE >::operator+=(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_implementation_pfAuxiliaryPFStandardAndOptimal(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_implementation_pfStandardProposal(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_particlesEvaluator_AuxPFOptimal(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_particlesEvaluator_AuxPFStandard(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream(), mrpt::math::CMatrixTemplate< TPoint3D >::removeColumns(), mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::runOneKalmanIteration(), mrpt::hwdrivers::CSerialPort::Seek(), mrpt::utils::CClientTCPSocket::Seek(), mrpt::slam::CMetricMap::squareDistanceToClosestCorrespondence(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::writeParticlesToStream(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::~CParticleFilterData().

#define MRPT_END_WITH_CLEAN_UP (   stuff  )     MRPT_TRY_END_WITH_CLEAN_UP(stuff)
#define MRPT_NO_THROWS   throw()

Used after member declarations.

Definition at line 165 of file utils_defs.h.

#define MRPT_printf_format_check (   _FMT_,
  _VARARGS_ 
)

Definition at line 155 of file utils_defs.h.

#define MRPT_PROFILE_FUNC_START

Definition at line 492 of file utils_defs.h.

#define MRPT_scanf_format_check (   _FMT_,
  _VARARGS_ 
)

Definition at line 161 of file utils_defs.h.

#define MRPT_START
Value:

Definition at line 499 of file utils_defs.h.

Referenced by mrpt::bayes::CParticleFilterData< CRBPFParticleData >::clearParticles(), mrpt::slam::CMetricMap::computeMatchingWith2D(), mrpt::slam::CMetricMap::computeMatchingWith3D(), mrpt::math::condidenceIntervals(), mrpt::math::detail::eigenVectorsMatrix(), mrpt::math::estimateJacobian(), mrpt::utils::CMHPropertiesValuesList::getAs(), mrpt::poses::CPose2DGridTemplate< double >::getAsMatrix(), mrpt::utils::CMessage::getContentAsStruct(), mrpt::utils::CMHPropertiesValuesList::getElemental(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getMostLikelyParticle(), mrpt::hwdrivers::CSerialPort::getPosition(), mrpt::utils::CClientTCPSocket::getPosition(), mrpt::hwdrivers::CSerialPort::getTotalBytesCount(), mrpt::utils::CClientTCPSocket::getTotalBytesCount(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::getWeights(), mrpt::math::interpolate(), mrpt::math::KLD_Gaussians(), mrpt::math::leastSquareLinearFit(), mrpt::math::mahalanobisDistance2(), mrpt::math::mahalanobisDistance2AndLogPDF(), mrpt::math::detail::multiply_AB(), mrpt::math::detail::multiply_Ab(), mrpt::math::detail::multiply_ABt(), mrpt::math::detail::multiply_Atb(), mrpt::math::detail::multiply_HCHt(), mrpt::math::detail::multiply_HCHt_scalar(), mrpt::math::detail::multiply_HtCH(), mrpt::math::detail::multiply_result_is_symmetric(), mrpt::math::detail::multiply_subMatrix(), mrpt::math::normalPDF(), mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::OnInverseObservationModel(), mrpt::math::CVectorTemplate< KFTYPE >::operator+=(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_implementation_pfAuxiliaryPFStandardAndOptimal(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_implementation_pfStandardProposal(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_particlesEvaluator_AuxPFOptimal(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_particlesEvaluator_AuxPFStandard(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::readParticlesFromStream(), mrpt::math::CMatrixTemplate< TPoint3D >::removeColumns(), mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::runOneKalmanIteration(), mrpt::hwdrivers::CSerialPort::Seek(), mrpt::utils::CClientTCPSocket::Seek(), mrpt::slam::CMetricMap::squareDistanceToClosestCorrespondence(), mrpt::bayes::CParticleFilterData< CRBPFParticleData >::writeParticlesToStream(), and mrpt::bayes::CParticleFilterData< CRBPFParticleData >::~CParticleFilterData().

#define MRPT_THROW_UNKNOWN_SERIALIZATION_VERSION (   V  )     THROW_EXCEPTION(mrpt::format("Cannot parse object: unknown serialization version number: '%i'",static_cast<int>(version)))

For use in CSerializable implementations.

Definition at line 371 of file utils_defs.h.

#define MRPT_TODO (   x  )     MRPT_DO_PRAGMA(message ("TODO: " #x))

Definition at line 149 of file utils_defs.h.

#define MRPT_TRY_END

Definition at line 485 of file utils_defs.h.

#define MRPT_TRY_END_WITH_CLEAN_UP (   stuff  ) 

Definition at line 486 of file utils_defs.h.

#define MRPT_TRY_START

Definition at line 484 of file utils_defs.h.

#define MRPT_UNUSED_PARAM (   a  )     (void)(a)

Can be used to avoid "not used parameters" warnings from the compiler.

Definition at line 434 of file utils_defs.h.

Referenced by mrpt::bayes::CParticleFilterCapable::defaultEvaluator(), mrpt::hwdrivers::CSerialPort::Seek(), and mrpt::utils::CClientTCPSocket::Seek().

#define THROW_EXCEPTION (   msg  ) 
Value:
{\
                std::ostringstream auxCompStr;\
                auxCompStr << "\n\n =============== MRPT EXCEPTION =============\n";\
                auxCompStr << __CURRENT_FUNCTION_NAME__ << ", line " << __LINE__ << ":\n";\
                auxCompStr << msg << std::endl; \
                auxCompStr << mrpt::system::stack_trace(); \
                throw std::logic_error( auxCompStr.str() );\
        }\
Parameters:
msg This can be a char*, a std::string, or a literal string. Defines a unified way of reporting exceptions
See also:
MRPT_TRY_START, MRPT_TRY_END, THROW_EXCEPTION_CUSTOM_MSG1

Definition at line 276 of file utils_defs.h.

Referenced by mrpt::slam::CGridMapAligner::Align3DPDF(), mrpt::math::CArrayPOD< float, N >::CArrayPOD(), mrpt::math::detail::CGenericMatrixConstIterator< MATRIXTYPE >::check_limits(), mrpt::math::detail::CGenericMatrixIterator< MATRIXTYPE >::check_limits(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::CMatrixFixedNumeric(), mrpt::math::CMatrixTemplate< TPoint3D >::CMatrixTemplate(), mrpt::slam::CMetricMap::computeMatchingWith2D(), mrpt::slam::CMetricMap::computeMatchingWith3D(), mrpt::math::correlate_matrix(), mrpt::utils::CTicTac::CTicTac(), mrpt::math::CVectorTemplate< KFTYPE >::deconcatenate(), mrpt::math::CMatrixTemplate< TPoint3D >::deleteColumn(), mrpt::math::CMatrixTemplate< TPoint3D >::deleteRow(), mrpt::utils::bimap< CLandmark::TLandmarkID, unsigned int >::direct(), mrpt::math::detail::eigenVectorsMatrix(), mrpt::math::CMatrixTemplate< TPoint3D >::exchangeColumns(), mrpt::math::CVectorTemplate< KFTYPE >::extract_vector(), mrpt::math::CMatrixTemplate< TPoint3D >::extractCol(), mrpt::math::CMatrixTemplate< TPoint3D >::extractMatrix(), mrpt::math::CMatrixTemplate< TPoint3D >::extractRow(), mrpt::math::CMatrixTemplate< TPoint3D >::extractSubmatrix(), mrpt::math::CMatrixTemplate< TPoint3D >::extractSubmatrixSymmetrical(), mrpt::math::CMatrixTemplate< TPoint3D >::extractSubmatrixSymmetricalBlocks(), mrpt::math::CVectorTemplate< KFTYPE >::find_max(), mrpt::math::CVectorTemplate< KFTYPE >::find_min(), mrpt::math::CVectorTemplate< KFTYPE >::find_min_max(), mrpt::math::CQuaternion< T >::fromRodriguesVector(), mrpt::poses::CPose3D::fromString(), mrpt::poses::CPose2D::fromString(), mrpt::poses::CPoint3D::fromString(), mrpt::poses::CPoint2D::fromString(), mrpt::math::generateAxisBaseFromDirection(), mrpt::math::CMatrixTemplate< TPoint3D >::get_unsafe(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::get_unsafe(), mrpt::math::CMatrixTemplate< TPoint3D >::get_unsafe_row(), mrpt::utils::CReferencedMemBlock::getAs(), mrpt::utils::CMHPropertiesValuesList::getAs(), mrpt::math::CDirectedGraph< CPOSE >::getEdge(), mrpt::utils::CMHPropertiesValuesList::getElemental(), mrpt::utils::CStdOutStream::getPosition(), mrpt::hwdrivers::CSerialPort::getPosition(), mrpt::utils::CClientTCPSocket::getPosition(), mrpt::utils::CStdOutStream::getTotalBytesCount(), mrpt::hwdrivers::CSerialPort::getTotalBytesCount(), mrpt::utils::CClientTCPSocket::getTotalBytesCount(), mrpt::math::CVectorTemplate< KFTYPE >::insert_vector(), mrpt::math::CMatrixTemplate< TPoint3D >::insertCol(), mrpt::math::CMatrixTemplate< TPoint3D >::insertMatrix(), mrpt::math::CMatrixTemplate< TPoint3D >::insertMatrixTranspose(), mrpt::slam::CMetricMap::insertObservationPtr(), mrpt::math::CMatrixTemplate< TPoint3D >::insertRow(), mrpt::utils::bimap< CLandmark::TLandmarkID, unsigned int >::inverse(), mrpt::math::detail::invMatrix_destroySrc(), mrpt::math::CMatrixTemplate< TPoint3D >::joinMatrix(), mrpt::math::CVectorTemplate< KFTYPE >::loadFromTextFile(), mrpt::math::CMatrixTemplate< TPoint3D >::loadFromTextFile(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::loadFromTextFile(), mrpt::math::matrixFromPoseOrPoint(), mrpt::utils::non_copiable_ptr_basic< CMultiMetricMap >::non_copiable_ptr_basic(), mrpt::math::detail::noncentralChi2CDF_exact(), mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::OnInverseObservationModel(), mrpt::hwdrivers::CSerialPort::open(), mrpt::math::CMatrixTemplate< TPoint3D >::operator()(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::operator()(), mrpt::math::CVectorTemplate< KFTYPE >::operator+=(), mrpt::utils::non_copiable_ptr< CMultiMetricMap >::operator=(), mrpt::utils::non_copiable_ptr_basic< CMultiMetricMap >::operator=(), mrpt::math::TObject3D::operator=(), mrpt::utils::CTicTac::operator=(), mrpt::math::CMatrixTemplate< TPoint3D >::operator=(), mrpt::utils::operator>>(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_implementation_gatherActionsCheckBothActObs(), mrpt::slam::PF_implementation< PARTICLE_TYPE >::PF_SLAM_implementation_pfStandardProposal(), mrpt::utils::CStdOutStream::Read(), mrpt::math::CMatrixTemplate< TPoint3D >::removeColumns(), mrpt::math::round2up(), mrpt::bayes::CKalmanFilterCapable< 6, 3, 3, 6 >::runOneKalmanIteration(), mrpt::math::detail::saveMatrixToTextFile(), mrpt::utils::CLoadableOptions::saveToConfigFile(), mrpt::utils::CStdOutStream::Seek(), mrpt::hwdrivers::CSerialPort::Seek(), mrpt::utils::CFileGZInputStream::Seek(), mrpt::utils::CClientTCPSocket::Seek(), mrpt::math::CMatrixTemplate< TPoint3D >::set_unsafe(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::set_unsafe(), mrpt::hwdrivers::CSerialPort::setSerialPortName(), mrpt::slam::CMetricMap::squareDistanceToClosestCorrespondence(), mrpt::math::CMatrixTemplate< TPoint3D >::swapCols(), mrpt::math::CMatrixTemplate< TPoint3D >::swapRows(), and mrpt::math::detail::tqli().

#define THROW_EXCEPTION_CUSTOM_MSG1 (   msg,
  param1 
)
Value:
{\
                std::ostringstream auxCompStr;\
                auxCompStr << "\n\n =============== MRPT EXCEPTION =============\n";\
                auxCompStr << __CURRENT_FUNCTION_NAME__ << ", line " << __LINE__ << ":\n";\
                auxCompStr << mrpt::format(msg,param1)<< std::endl; \
                auxCompStr << mrpt::system::stack_trace(); \
                throw std::logic_error( auxCompStr.str() );\
        }\
Parameters:
e The caught exception.
msg Is a char* or literal string.

Referenced by mrpt::utils::CConsoleRedirector::CConsoleRedirector(), mrpt::math::CDijkstra< TYPE_EDGES >::CDijkstra(), mrpt::utils::CMHPropertiesValuesList::getElemental(), mrpt::math::CMatrixTemplate< TPoint3D >::loadFromTextFile(), mrpt::math::CMatrixFixedNumeric< float, 4, 4 >::loadFromTextFile(), mrpt::math::CMatrixTemplate< TPoint3D >::operator()(), mrpt::math::detail::saveMatrixToTextFile(), and mrpt::math::size().

#define THROW_STACKED_EXCEPTION (   e  ) 
Value:
{\
                std::string str( e.what() );\
                if (str.find("MRPT stack trace")==std::string::npos) \
                { \
                        str+= __CURRENT_FUNCTION_NAME__;\
                        str+= mrpt::format(", line %i:\n", __LINE__ );\
                        if (str.size()>3000) { std::cerr << "TOO MANY STACKED EXCEPTIONS!: " << std::endl << str << std::endl; abort(); } \
                        throw std::logic_error( str );\
                } \
                else throw std::logic_error( e.what() );\
        }\
See also:
MRPT_TRY_START, MRPT_TRY_END

Definition at line 333 of file utils_defs.h.

#define THROW_STACKED_EXCEPTION_CUSTOM_MSG1 (   e,
  msg 
)
Value:
{\
                std::ostringstream auxCompStr;\
                auxCompStr << e.what() ;  \
                auxCompStr << msg << std::endl; \
                throw std::logic_error( auxCompStr.str() );\
        }\

Definition at line 350 of file utils_defs.h.

#define THROW_STACKED_EXCEPTION_CUSTOM_MSG2 (   e,
  stuff,
  param1 
)
Value:
{\
                std::ostringstream auxCompStr;\
                auxCompStr << e.what() ;  \
                auxCompStr << mrpt::format( stuff, param1 ) << std::endl; \
                throw std::logic_error( auxCompStr.str() );\
        }\

Definition at line 362 of file utils_defs.h.

#define THROW_TYPED_EXCEPTION (   msg,
  exceptionClass 
)
Value:
{\
                std::ostringstream auxCompStr;\
                auxCompStr << "\n\n =============== MRPT EXCEPTION =============\n";\
                auxCompStr << __CURRENT_FUNCTION_NAME__ << ", line " << __LINE__ << ":\n";\
                auxCompStr << msg << std::endl; \
                auxCompStr << mrpt::system::stack_trace(); \
                throw exceptionClass( auxCompStr.str() );\
        }\

Defines a unified way of reporting exceptions of type different from "std::exception".

See also:
MRPT_TRY_START, MRPT_TRY_END

Definition at line 305 of file utils_defs.h.

#define THROW_TYPED_EXCEPTION_CUSTOM_MSG1 (   msg,
  param1,
  exceptionClass 
)
Value:
{\
                std::ostringstream auxCompStr;\
                auxCompStr << "\n\n =============== MRPT EXCEPTION =============\n";\
                auxCompStr << __CURRENT_FUNCTION_NAME__ << ", line " << __LINE__ << ":\n";\
                auxCompStr << mrpt::format(msg,param1)<< std::endl; \
                auxCompStr << mrpt::system::stack_trace(); \
                throw exceptionClass( auxCompStr.str() );\
        }\

Definition at line 319 of file utils_defs.h.


Function Documentation

template<typename T >
const T max3 ( const T &  A,
const T &  B,
const T &  C 
) [inline]

Definition at line 555 of file utils_defs.h.

template<typename T >
const T min3 ( const T &  A,
const T &  B,
const T &  C 
) [inline]

Definition at line 554 of file utils_defs.h.




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