Main MRPT website > C++ reference for MRPT 1.5.3
Classes | Namespaces | Macros | Functions
bits.h File Reference
#include <mrpt/config.h>
#include <cmath>
#include <string>
#include <mrpt/base/link_pragmas.h>
#include <mrpt/utils/mrpt_macros.h>
#include <mrpt/utils/mrpt_stdint.h>

Go to the source code of this file.

Classes

struct  mrpt::utils::CProfilerProxy
 

Namespaces

 mrpt
 This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
 
 mrpt::math
 This base provides a set of functions for maths stuff.
 
 mrpt::utils
 Classes for serialization, sockets, ini-file manipulation, streams, list of properties-values, timewatch, extensions to STL.
 

Macros

#define _USE_MATH_DEFINES
 
#define M_PI   3.14159265358979323846
 
#define DEG2RAD   DEG2RAD
 
#define RAD2DEG   RAD2DEG
 
#define SELBYTE0(v)   (v & 0xff)
 
#define SELBYTE1(v)   ((v>>8) & 0xff)
 
#define SELBYTE2(v)   ((v>>16) & 0xff)
 
#define SELBYTE3(v)   ((v>>24) & 0xff)
 
#define MAKEWORD16B(__LOBYTE, __HILOBYTE)   ((__LOBYTE) | ((__HILOBYTE)<<8))
 
#define MAKEWORD32B(__LOWORD16, __HIWORD16)   ((__LOWORD16) | ((__HIWORD16)<<16))
 
#define MAKEWORD64B(__LOWORD32, __HIWORD32)   ((__LOWORD32) | ((__HIWORD32)<<32))
 
#define _USE_MATH_DEFINES
 
#define DEG2RAD   DEG2RAD
 
#define RAD2DEG   RAD2DEG
 
#define SELBYTE0(v)   (v & 0xff)
 
#define SELBYTE1(v)   ((v>>8) & 0xff)
 
#define SELBYTE2(v)   ((v>>16) & 0xff)
 
#define SELBYTE3(v)   ((v>>24) & 0xff)
 
#define MAKEWORD16B(__LOBYTE, __HILOBYTE)   ((__LOBYTE) | ((__HILOBYTE)<<8))
 
#define MAKEWORD32B(__LOWORD16, __HIWORD16)   ((__LOWORD16) | ((__HIWORD16)<<16))
 
#define MAKEWORD64B(__LOWORD32, __HIWORD32)   ((__LOWORD32) | ((__HIWORD32)<<32))
 

Functions

std::string BASE_IMPEXP mrpt::format (const char *fmt,...) MRPT_printf_format_check(1
 A std::string version of C sprintf. More...
 
bool BASE_IMPEXP mrpt::math::isNaN (float f) MRPT_NO_THROWS
 Returns true if the number is NaN. More...
 
bool BASE_IMPEXP mrpt::math::isNaN (double f) MRPT_NO_THROWS
 Returns true if the number is NaN. More...
 
bool BASE_IMPEXP mrpt::math::isFinite (float f) MRPT_NO_THROWS
 Returns true if the number is non infinity. More...
 
bool BASE_IMPEXP mrpt::math::isFinite (double f) MRPT_NO_THROWS
 Returns true if the number is non infinity. More...
 
template<class MATRIXLIKE >
size_t mrpt::math::size (const MATRIXLIKE &m, const int dim)
 
template<class T >
mrpt::math::square (const T x)
 Inline function for the square of a number. More...
 
template<class T >
mrpt::math::hypot_fast (const T x, const T y)
 Faster version of std::hypot(), to use when overflow is not an issue and we prefer fast code. More...
 
double mrpt::utils::DEG2RAD (const double x)
 Degrees to radians. More...
 
float mrpt::utils::DEG2RAD (const float x)
 Degrees to radians. More...
 
float mrpt::utils::DEG2RAD (const int x)
 Degrees to radians. More...
 
double mrpt::utils::RAD2DEG (const double x)
 Radians to degrees. More...
 
float mrpt::utils::RAD2DEG (const float x)
 Radians to degrees. More...
 
template<typename T >
int mrpt::utils::sign (T x)
 Returns the sign of X as "1" or "-1". More...
 
template<typename T >
int mrpt::utils::signWithZero (T x)
 Returns the sign of X as "0", "1" or "-1". More...
 
template<typename T >
mrpt::utils::lowestPositive (const T a, const T b)
 Returns the lowest, possitive among two numbers. More...
 
template<typename T >
mrpt::utils::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 mrpt::utils::min3 (const T &A, const T &B, const T &C)
 
template<typename T >
const T mrpt::utils::max3 (const T &A, const T &B, const T &C)
 
template<typename T >
int mrpt::utils::fix (T x)
 Rounds toward zero. More...
 
template<class R , class SMART_PTR >
R * mrpt::utils::getAs (SMART_PTR &o)
 < Allow square() to be available under mrpt::math and mrpt::utils More...
 
template<class R , class SMART_PTR >
const R * mrpt::utils::getAs (const SMART_PTR &o)
 Utility to get a cast'ed pointer from a smart pointer. More...
 
void BASE_IMPEXP mrpt::utils::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 mrpt::utils::reverseBytesInPlace (uint8_t &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (int8_t &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (uint16_t &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (int16_t &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (uint32_t &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (int32_t &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (uint64_t &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (int64_t &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (float &v_in_out)
 
void BASE_IMPEXP mrpt::utils::reverseBytesInPlace (double &v_in_out)
 
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) More...
 
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. More...
 
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. More...
 
template<typename T >
void mrpt::utils::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 >
mrpt::utils::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 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. More...
 
template<class VECTOR_T >
void mrpt::utils::vector_strong_clear (VECTOR_T &v)
 Like calling a std::vector<>'s clear() method, but really forcing deallocating the memory. More...
 
template<typename T >
mrpt::utils::length2length4N (T len)
 Returns the smaller number >=len such that it's a multiple of 4. More...
 
Auxiliary stuff for the global profiler used in MRPT_START / MRPT_END macros.
void BASE_IMPEXP mrpt::utils::global_profiler_enter (const char *func_name) MRPT_NO_THROWS
 
void BASE_IMPEXP mrpt::utils::global_profiler_leave (const char *func_name) MRPT_NO_THROWS
 

Macro Definition Documentation

◆ _USE_MATH_DEFINES [1/2]

#define _USE_MATH_DEFINES

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

◆ _USE_MATH_DEFINES [2/2]

#define _USE_MATH_DEFINES

◆ DEG2RAD [1/2]

#define DEG2RAD   DEG2RAD

◆ DEG2RAD [2/2]

#define DEG2RAD   DEG2RAD

◆ M_PI

#define M_PI   3.14159265358979323846

◆ MAKEWORD16B [1/2]

#define MAKEWORD16B (   __LOBYTE,
  __HILOBYTE 
)    ((__LOBYTE) | ((__HILOBYTE)<<8))

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

◆ MAKEWORD16B [2/2]

#define MAKEWORD16B (   __LOBYTE,
  __HILOBYTE 
)    ((__LOBYTE) | ((__HILOBYTE)<<8))

◆ MAKEWORD32B [1/2]

#define MAKEWORD32B (   __LOWORD16,
  __HIWORD16 
)    ((__LOWORD16) | ((__HIWORD16)<<16))

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

◆ MAKEWORD32B [2/2]

#define MAKEWORD32B (   __LOWORD16,
  __HIWORD16 
)    ((__LOWORD16) | ((__HIWORD16)<<16))

◆ MAKEWORD64B [1/2]

#define MAKEWORD64B (   __LOWORD32,
  __HIWORD32 
)    ((__LOWORD32) | ((__HIWORD32)<<32))

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

◆ MAKEWORD64B [2/2]

#define MAKEWORD64B (   __LOWORD32,
  __HIWORD32 
)    ((__LOWORD32) | ((__HIWORD32)<<32))

◆ RAD2DEG [1/2]

#define RAD2DEG   RAD2DEG

◆ RAD2DEG [2/2]

#define RAD2DEG   RAD2DEG

◆ SELBYTE0 [1/2]

#define SELBYTE0 (   v)    (v & 0xff)

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

◆ SELBYTE0 [2/2]

#define SELBYTE0 (   v)    (v & 0xff)

◆ SELBYTE1 [1/2]

#define SELBYTE1 (   v)    ((v>>8) & 0xff)

◆ SELBYTE1 [2/2]

#define SELBYTE1 (   v)    ((v>>8) & 0xff)

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

◆ SELBYTE2 [1/2]

#define SELBYTE2 (   v)    ((v>>16) & 0xff)

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

◆ SELBYTE2 [2/2]

#define SELBYTE2 (   v)    ((v>>16) & 0xff)

◆ SELBYTE3 [1/2]

#define SELBYTE3 (   v)    ((v>>24) & 0xff)

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

◆ SELBYTE3 [2/2]

#define SELBYTE3 (   v)    ((v>>24) & 0xff)



Page generated by Doxygen 1.8.13 for MRPT 1.5.3 at Tue Aug 22 01:03:35 UTC 2017