Go to the documentation of this file.
10 #include <gtest/gtest.h>
101 EXPECT_DOUBLE_EQ(
mrpt::min3(-1., -2., -3.), -3.);
110 EXPECT_DOUBLE_EQ(
mrpt::max3(-1., -2., -3.), -1.);
133 EXPECT_DOUBLE_EQ(v, 10.0);
135 EXPECT_DOUBLE_EQ(v, 10.0);
137 EXPECT_DOUBLE_EQ(v, 1.0);
const T min3(const T &A, const T &B, const T &C)
int sign(T x)
Returns the sign of X as "1" or "-1".
const T max3(const T &A, const T &B, const T &C)
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
T abs_diff(const T a, const T b)
Efficient and portable evaluation of the absolute difference of two unsigned integer values (but will...
T 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.
EXPECT_NEAR(out.cam_params.rightCameraPose.x, 0.1194, 0.005)
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.
constexpr double RAD2DEG(const double x)
Radians to degrees.
T round2up(T val)
Round up to the nearest power of two of a given number.
float d2f(const double d)
shortcut for static_cast<float>(double)
EXPECT_EQ(out.image_pair_was_used.size(), NUM_IMGS)
int fix(T x)
Rounds toward zero
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.
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.
constexpr double DEG2RAD(const double x)
Degrees to radians
int signWithZero(T x)
Returns the sign of X as "0", "1" or "-1".
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,...
T lowestPositive(const T a, const T b)
Returns the smallest positive number among a and b.
Page generated by Doxygen 1.8.17 for MRPT 2.0.3 at Fri May 15 15:49:54 UTC 2020 | |