Main MRPT website > C++ reference for MRPT 1.5.9
Namespaces | Classes | Typedefs | Functions
mrpt::mrpt::utils Namespace Reference

Namespaces

 detail
 

Classes

struct  CProfilerProxy
 
class  PointCloudAdapter
 An adapter to different kinds of point cloud object. More...
 

Typedefs

typedef unsigned long POINTER_TYPE
 For performing type casting from a pointer to its numeric value. More...
 
typedef uint64_t TNodeID
 The type for node IDs in graphs of different types. More...
 
typedef std::pair< TNodeID, TNodeIDTPairNodeIDs
 A pair of node IDs. More...
 

Functions

void BASE_IMPEXP global_profiler_enter (const char *func_name) MRPT_NO_THROWS
 
void BASE_IMPEXP global_profiler_leave (const char *func_name) MRPT_NO_THROWS
 
double DEG2RAD (const double x)
 Degrees to radians. More...
 
float DEG2RAD (const float x)
 Degrees to radians. More...
 
float DEG2RAD (const int x)
 Degrees to radians. More...
 
double RAD2DEG (const double x)
 Radians to degrees. More...
 
float RAD2DEG (const float x)
 Radians to degrees. More...
 
template<typename T >
int sign (T x)
 Returns the sign of X as "1" or "-1". More...
 
template<typename T >
int signWithZero (T x)
 Returns the sign of X as "0", "1" or "-1". More...
 
template<typename T >
lowestPositive (const T a, const T b)
 Returns the lowest, possitive among two numbers. More...
 
template<typename T >
abs_diff (const T a, const T b)
 Efficient and portable evaluation of the absolute difference of two unsigned integer values (but will also work for signed and floating point types) More...
 
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<typename T >
int fix (T x)
 Rounds toward zero. More...
 
template<class R , class SMART_PTR >
RgetAs (SMART_PTR &o)
 < Allow square() to be available under mrpt::math and mrpt::utils More...
 
template<class R , class SMART_PTR >
const RgetAs (const SMART_PTR &o)
 Utility to get a cast'ed pointer from a smart pointer. More...
 
void BASE_IMPEXP reverseBytesInPlace (bool &v_in_out)
 Reverse the order of the bytes of a given type (useful for transforming btw little/big endian) More...
 
void BASE_IMPEXP reverseBytesInPlace (uint8_t &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (int8_t &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (uint16_t &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (int16_t &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (uint32_t &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (int32_t &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (uint64_t &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (int64_t &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (float &v_in_out)
 
void BASE_IMPEXP reverseBytesInPlace (double &v_in_out)
 
template<class T >
void 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) More...
 
template<typename T , typename K >
void 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. More...
 
template<typename T , typename K >
void 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. More...
 
template<typename T >
void saturate (T &var, const T sat_min, const T sat_max)
 Saturate the value of var (the variable gets modified) so it does not get out of [min,max]. More...
 
template<typename T >
saturate_val (const T &value, const T sat_min, const T sat_max)
 Like saturate() but it returns the value instead of modifying the variable. More...
 
template<class T >
void delete_safe (T *&ptr)
 Calls "delete" to free an object only if the pointer is not NULL, then set the pointer to NULL. More...
 
template<class VECTOR_T >
void vector_strong_clear (VECTOR_T &v)
 Like calling a std::vector<>'s clear() method, but really forcing deallocating the memory. More...
 
template<typename T >
length2length4N (T len)
 Returns the smaller number >=len such that it's a multiple of 4. More...
 

Function Documentation

◆ abs_diff()

template<typename T >
T mrpt::mrpt::utils::abs_diff ( const T  a,
const T  b 
)
inline

Efficient and portable evaluation of the absolute difference of two unsigned integer values (but will also work for signed and floating point types)

Definition at line 124 of file maps/CColouredPointsMap.h.

Referenced by mrpt::nav::CHolonomicND::calcRepresentativeSectorForGap(), mrpt::nav::CHolonomicFullEval::evalSingleTarget(), and mrpt::nav::CHolonomicND::evaluateGaps().

◆ DEG2RAD() [1/3]

double mrpt::mrpt::utils::DEG2RAD ( const double  x)
inline

◆ DEG2RAD() [2/3]

float mrpt::mrpt::utils::DEG2RAD ( const float  x)
inline

Degrees to radians.

Definition at line 84 of file maps/CColouredPointsMap.h.

◆ DEG2RAD() [3/3]

float mrpt::mrpt::utils::DEG2RAD ( const int  x)
inline

Degrees to radians.

Definition at line 86 of file maps/CColouredPointsMap.h.

References ASSERTDEB_.

◆ delete_safe()

template<class T >
void mrpt::mrpt::utils::delete_safe ( T *&  ptr)

◆ fix()

template<typename T >
int mrpt::mrpt::utils::fix ( x)
inline

Rounds toward zero.

Definition at line 133 of file maps/CColouredPointsMap.h.

◆ getAs() [1/2]

template<class R , class SMART_PTR >
R* mrpt::mrpt::utils::getAs ( SMART_PTR &  o)
inline

< Allow square() to be available under mrpt::math and mrpt::utils

Utility to get a cast'ed pointer from a smart pointer

Definition at line 139 of file maps/CColouredPointsMap.h.

◆ getAs() [2/2]

template<class R , class SMART_PTR >
const R* mrpt::mrpt::utils::getAs ( const SMART_PTR &  o)
inline

Utility to get a cast'ed pointer from a smart pointer.

Definition at line 143 of file maps/CColouredPointsMap.h.

◆ global_profiler_enter()

void BASE_IMPEXP mrpt::mrpt::utils::global_profiler_enter ( const char *  func_name)

◆ global_profiler_leave()

void BASE_IMPEXP mrpt::mrpt::utils::global_profiler_leave ( const char *  func_name)

◆ keep_max()

template<typename T , typename K >
void mrpt::mrpt::utils::keep_max ( T &  var,
const K  test_val 
)
inline

If the second argument is above the first one, set the first argument to this higher value.

Definition at line 176 of file maps/CColouredPointsMap.h.

Referenced by mrpt::nav::CMultiObjectiveMotionOptimizerBase::decide(), mrpt::utils::CTimeLogger::do_leave(), mrpt::nav::CPTG_RobotShape_Polygonal::evalClearanceToRobotShape(), mrpt::nav::CHolonomicFullEval::evalSingleTarget(), mrpt::math::MatrixBlockSparseCols< Scalar, NROWS, NCOLS, INFO, HAS_REMAP, INDEX_REMAP_MAP_IMPL >::findCurrentNumberOfRows(), mrpt::nav::CHolonomicND::gapsEstimator(), mrpt::math::TPolygon2D::getBoundingBox(), mrpt::vision::TSimpleFeatureList_templ< TSimpleFeature >::getMaxID(), mrpt::vision::CFeatureList::getMaxID(), mrpt::maps::CHeightGridMap2D_Base::getMinMaxHeight(), mrpt::nav::CPTG_DiffDrive_CollisionGridBased::internal_initialize(), mrpt::nav::CPTG_DiffDrive_CollisionGridBased::inverseMap_WS2TP(), mrpt::nav::CParameterizedTrajectoryGenerator::loadFromConfigFile(), mrpt::math::maximum(), mrpt::math::minimum_maximum(), mrpt::nav::CHolonomicFullEval::navigate(), mrpt::opengl::COctreePointRenderer< CPointCloudColoured >::octree_recursive_render(), mrpt::graphslam::optimize_graph_spa_levmarq(), mrpt::hwdrivers::CGPSInterface::parseBuffer(), mrpt::utils::CTimeLogger::registerUserMeasure(), mrpt::opengl::CGeneralizedEllipsoidTemplate< 3 >::render_dl(), mrpt::nav::PlannerTPS_VirtualBase::renderMoveTree(), mrpt::nav::CPTG_RobotShape_Polygonal::setRobotShape(), mrpt::nav::CPTG_DiffDrive_CollisionGridBased::simulateTrajectories(), mrpt::nav::PlannerRRT_SE2_TPS::solve(), mrpt::opengl::COctreePointRenderer< Derived >::TNode::update_bb(), mrpt::opengl::CMesh::updateColorsMatrix(), and mrpt::vision::CMatchedFeatureList::updateMaxID().

◆ keep_min()

template<typename T , typename K >
void mrpt::mrpt::utils::keep_min ( T &  var,
const K  test_val 
)
inline

◆ length2length4N()

template<typename T >
T mrpt::mrpt::utils::length2length4N ( len)

Returns the smaller number >=len such that it's a multiple of 4.

Definition at line 209 of file maps/CColouredPointsMap.h.

Referenced by mrpt::obs::CObservation2DRangeScan::resizeScan(), and mrpt::obs::CObservation2DRangeScan::resizeScanAndAssign().

◆ lowestPositive()

template<typename T >
T mrpt::mrpt::utils::lowestPositive ( const T  a,
const T  b 
)

Returns the lowest, possitive among two numbers.

If both are non-positive (<=0), the lowest one is returned.

Definition at line 112 of file maps/CColouredPointsMap.h.

◆ max3()

template<typename T >
const T mrpt::mrpt::utils::max3 ( const T &  A,
const T &  B,
const T &  C 
)
inline

Definition at line 129 of file maps/CColouredPointsMap.h.

◆ min3()

template<typename T >
const T mrpt::mrpt::utils::min3 ( const T &  A,
const T &  B,
const T &  C 
)
inline

Definition at line 128 of file maps/CColouredPointsMap.h.

◆ RAD2DEG() [1/2]

double mrpt::mrpt::utils::RAD2DEG ( const double  x)
inline

◆ RAD2DEG() [2/2]

float mrpt::mrpt::utils::RAD2DEG ( const float  x)
inline

Radians to degrees.

Definition at line 90 of file maps/CColouredPointsMap.h.

◆ reverseBytes()

template<class T >
void mrpt::mrpt::utils::reverseBytes ( const T &  v_in,
T &  v_out 
)
inline

Reverse the order of the bytes of a given type (useful for transforming btw little/big endian)

Definition at line 162 of file maps/CColouredPointsMap.h.

Referenced by TEST().

◆ reverseBytesInPlace() [1/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( bool &  v_in_out)

Reverse the order of the bytes of a given type (useful for transforming btw little/big endian)

Referenced by mrpt::utils::CStream::ReadBufferFixEndianness(), mrpt::hwdrivers::CVelodyneScanner::receivePackets(), and TEST().

◆ reverseBytesInPlace() [2/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( uint8_t v_in_out)

◆ reverseBytesInPlace() [3/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( int8_t v_in_out)

◆ reverseBytesInPlace() [4/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( uint16_t v_in_out)

◆ reverseBytesInPlace() [5/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( int16_t v_in_out)

◆ reverseBytesInPlace() [6/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( uint32_t v_in_out)

◆ reverseBytesInPlace() [7/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( int32_t v_in_out)

◆ reverseBytesInPlace() [8/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( uint64_t v_in_out)

◆ reverseBytesInPlace() [9/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( int64_t v_in_out)

◆ reverseBytesInPlace() [10/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( float &  v_in_out)

◆ reverseBytesInPlace() [11/11]

void BASE_IMPEXP mrpt::mrpt::utils::reverseBytesInPlace ( double &  v_in_out)

◆ saturate()

template<typename T >
void mrpt::mrpt::utils::saturate ( T &  var,
const T  sat_min,
const T  sat_max 
)
inline

Saturate the value of var (the variable gets modified) so it does not get out of [min,max].

Definition at line 181 of file maps/CColouredPointsMap.h.

Referenced by mrpt::maps::CRandomFieldGridMap2D::getAsMatrix(), and mrpt::maps::CRandomFieldGridMap2D::updateMapEstimation_GMRF().

◆ saturate_val()

template<typename T >
T mrpt::mrpt::utils::saturate_val ( const T &  value,
const T  sat_min,
const T  sat_max 
)
inline

Like saturate() but it returns the value instead of modifying the variable.

Definition at line 187 of file maps/CColouredPointsMap.h.

Referenced by mrpt::maps::CRandomFieldGridMap2D::getAs3DObject(), and mrpt::maps::CRandomFieldGridMap2D::saveAsMatlab3DGraph().

◆ sign()

template<typename T >
int mrpt::mrpt::utils::sign ( x)
inline

◆ signWithZero()

template<typename T >
int mrpt::mrpt::utils::signWithZero ( x)
inline

◆ vector_strong_clear()

template<class VECTOR_T >
void mrpt::mrpt::utils::vector_strong_clear ( VECTOR_T &  v)
inline

Like calling a std::vector<>'s clear() method, but really forcing deallocating the memory.

Definition at line 205 of file maps/CColouredPointsMap.h.




Page generated by Doxygen 1.8.14 for MRPT 1.5.9 Git: 690a4699f Wed Apr 15 19:29:53 2020 +0200 at miƩ abr 15 19:30:12 CEST 2020