pinocchio  2.1.3
math/fwd.hpp
1 //
2 // Copyright (c) 2016-2019 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 "pinocchio/math/sincos.hpp"
12 
13 #ifdef PINOCCHIO_WITH_CPPAD_SUPPORT
14 namespace boost
15 {
16  namespace math
17  {
18  namespace constants
19  {
20  namespace detail
21  {
22  template<typename Scalar>
23  struct constant_pi< CppAD::AD<Scalar> > : constant_pi<Scalar> {};
24 
25 #if defined(PINOCCHIO_WITH_CPPADCG_SUPPORT) && defined(PINOCCHIO_WITH_CXX11_SUPPORT)
26  template<typename Scalar>
27  struct constant_pi< CppAD::cg::CG<Scalar> > : constant_pi<Scalar> {};
28 #endif
29  }
30  }
31  }
32 }
33 #endif
34 
35 namespace pinocchio
36 {
42  template<typename Scalar>
43  const Scalar PI()
44  { return boost::math::constants::pi<Scalar>(); }
45 
46  namespace math
47  {
48  using std::fabs;
49  using std::sqrt;
50  using std::atan;
51  using std::acos;
52  using std::asin;
53  using std::pow;
54  using std::cos;
55  using std::sin;
56 
57 #ifdef PINOCCHIO_WITH_CPPAD_SUPPORT
58  using CppAD::fabs;
59  using CppAD::sqrt;
60  using CppAD::atan;
61  using CppAD::acos;
62  using CppAD::asin;
63  using CppAD::atan2;
64  using CppAD::pow;
65  using CppAD::cos;
66  using CppAD::sin;
67 #else
68  using std::atan2;
69 #endif
70  }
71 }
72 
73 #endif //#ifndef __pinocchio_math_fwd_hpp__
const Scalar PI()
Returns the value of PI according to the template parameters Scalar.
Definition: math/fwd.hpp:43
Source from #include <cppad/example/cppad_eigen.hpp>
Definition: cppad.hpp:98
Main pinocchio namespace.
Definition: treeview.dox:24