math/fwd.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2016-2024 CNRS INRIA
3 //
4 
5 #ifndef __pinocchio_math_fwd_hpp__
6 #define __pinocchio_math_fwd_hpp__
7 
8 #include "pinocchio/fwd.hpp"
9 #include <math.h>
10 #include <boost/math/constants/constants.hpp>
11 #include <boost/type_traits/is_floating_point.hpp>
12 
13 namespace pinocchio
14 {
15 
16  template<typename T>
17  struct is_floating_point : boost::is_floating_point<T>
18  {
19  };
20 
26  template<typename Scalar>
27  const Scalar PI()
28  {
29  return boost::math::constants::pi<Scalar>();
30  }
31 
33  template<typename Scalar>
35 
36  namespace math
37  {
38 
39 #define PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(name) \
40  template<typename Scalar> \
41  Scalar name(const Scalar & value) \
42  { \
43  using std::name; \
44  return name(value); \
45  }
46 
47 #define PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(name) \
48  namespace internal \
49  { \
50  template<typename T1, typename T2> \
51  struct return_type_##name \
52  { \
53  typedef T1 type; \
54  }; \
55  template<typename T1, typename T2> \
56  struct call_##name \
57  { \
58  static inline typename return_type_##name<T1, T2>::type run(const T1 & a, const T2 & b) \
59  { \
60  using std::name; \
61  return name(a, b); \
62  } \
63  }; \
64  } \
65  template<typename T1, typename T2> \
66  inline typename internal::return_type_##name<T1, T2>::type name(const T1 & a, const T2 & b) \
67  { \
68  return internal::call_##name<T1, T2>::run(a, b); \
69  }
70 
80 
85  } // namespace math
86 } // namespace pinocchio
87 
88 #endif // #ifndef __pinocchio_math_fwd_hpp__
PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR
#define PINOCCHIO_OVERLOAD_MATH_BINARY_OPERATOR(name)
Definition: math/fwd.hpp:47
pinocchio.explog.exp
def exp(x)
Definition: bindings/python/pinocchio/explog.py:13
pinocchio::PI
const Scalar PI()
Returns the value of PI according to the template parameters Scalar.
Definition: math/fwd.hpp:27
fwd.hpp
pinocchio::python::Scalar
context::Scalar Scalar
Definition: admm-solver.cpp:29
pinocchio::cholesky::min
JointCollectionTpl const DataTpl< Scalar, Options, JointCollectionTpl > const Eigen::MatrixBase< Mat > & min
Definition: cholesky.hpp:89
pinocchio::is_floating_point
Definition: math/fwd.hpp:17
pinocchio::TaylorSeriesExpansion
&#160;
Definition: math/fwd.hpp:34
PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR
#define PINOCCHIO_OVERLOAD_MATH_UNARY_OPERATOR(name)
Definition: math/fwd.hpp:39
pinocchio.explog.log
def log(x)
Definition: bindings/python/pinocchio/explog.py:29
CppAD::max
AD< Scalar > max(const AD< Scalar > &x, const AD< Scalar > &y)
Definition: autodiff/cppad.hpp:181
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:09