17 #define M_PI 3.14159265358979323846 20 #define M_TWOPI (M_PI * 2.0) 25 #if !defined(FLT_EPSILON) 26 #define FLT_EPSILON __FLT_EPSILON__ 29 #if defined(__PX4_NUTTX) 33 #define MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(name) \ 34 inline float name(float x) { return ::name##f(x); } \ 35 inline double name(double x) { return ::name(x); } \ 36 inline long double name(long double x) { return ::name##l(x); } 38 #define MATRIX_NUTTX_WRAP_MATH_FUN_BINARY(name) \ 39 inline float name(float x, float y) { return ::name##f(x, y); } \ 40 inline double name(double x, double y) { return ::name(x, y); } \ 41 inline long double name(long double x, long double y) { return ::name##l(x, y); } 43 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(fabs)
44 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(log)
45 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(log10)
46 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(exp)
47 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
sqrt)
48 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
sin)
49 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
cos)
50 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
tan)
51 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
asin)
52 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
acos)
53 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
atan)
54 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(sinh)
55 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(cosh)
56 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(tanh)
57 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
ceil)
58 MATRIX_NUTTX_WRAP_MATH_FUN_UNARY(
floor)
60 MATRIX_NUTTX_WRAP_MATH_FUN_BINARY(pow)
61 MATRIX_NUTTX_WRAP_MATH_FUN_BINARY(
atan2)
63 #else // Not NuttX, using the C++ standard library 90 # if (__cplusplus >= 201103L) 116 using std::nearbyint;
121 using std::nextafter;
123 using std::fpclassify;
129 using std::isgreater;
130 using std::isgreaterequal;
132 using std::islessequal;
133 using std::islessgreater;
134 using std::isunordered;
Dual< Scalar, N > acos(const Dual< Scalar, N > &a)
Dual< Scalar, N > atan(const Dual< Scalar, N > &a)
Dual< Scalar, N > ceil(const Dual< Scalar, N > &a)
Dual< Scalar, N > asin(const Dual< Scalar, N > &a)
Dual< Scalar, N > cos(const Dual< Scalar, N > &a)
Dual< Scalar, N > tan(const Dual< Scalar, N > &a)
Dual< Scalar, N > fmod(const Dual< Scalar, N > &a, Scalar mod)
Dual< Scalar, N > abs(const Dual< Scalar, N > &a)
Dual< Scalar, N > sin(const Dual< Scalar, N > &a)
Dual< Scalar, N > floor(const Dual< Scalar, N > &a)
Dual< Scalar, N > sqrt(const Dual< Scalar, N > &a)
Dual< Scalar, N > atan2(const Dual< Scalar, N > &a, const Dual< Scalar, N > &b)