autodiff/cppad/utils/static-if.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019-2020 INRIA
3 //
4 
5 #ifndef __pinocchio_autodiff_cppad_utils_static_if_hpp__
6 #define __pinocchio_autodiff_cppad_utils_static_if_hpp__
7 
9 
10 namespace pinocchio
11 {
12  namespace internal
13  {
14  template<typename Scalar, typename ThenType, typename ElseType>
15  struct if_then_else_impl<CppAD::AD<Scalar>, CppAD::AD<Scalar>, ThenType, ElseType>
16  {
18 
19  static inline ReturnType run(
20  const ComparisonOperators op,
21  const CppAD::AD<Scalar> & lhs_value,
22  const CppAD::AD<Scalar> & rhs_value,
23  const ThenType & then_value,
24  const ElseType & else_value)
25  {
26  switch (op)
27  {
28  case LT:
29  return ::CppAD::CondExpLt<Scalar>(lhs_value, rhs_value, then_value, else_value);
30  case LE:
31  return ::CppAD::CondExpLe<Scalar>(lhs_value, rhs_value, then_value, else_value);
32  case EQ:
33  return ::CppAD::CondExpEq<Scalar>(lhs_value, rhs_value, then_value, else_value);
34  case GE:
35  return ::CppAD::CondExpGe<Scalar>(lhs_value, rhs_value, then_value, else_value);
36  case GT:
37  return ::CppAD::CondExpGt<Scalar>(lhs_value, rhs_value, then_value, else_value);
38  }
39  }
40  };
41  } // namespace internal
42 } // namespace pinocchio
43 
44 #endif // ifndef __pinocchio_autodiff_cppad_utils_static_if_hpp__
static-if.hpp
pinocchio::internal::if_then_else_impl< CppAD::AD< Scalar >, CppAD::AD< Scalar >, ThenType, ElseType >::ReturnType
internal::traits< if_then_else_impl >::ReturnType ReturnType
Definition: autodiff/cppad/utils/static-if.hpp:17
pinocchio::internal::ComparisonOperators
ComparisonOperators
Definition: utils/static-if.hpp:15
pinocchio::internal::GT
@ GT
Definition: utils/static-if.hpp:21
pinocchio::internal::if_then_else_impl
Definition: utils/static-if.hpp:25
CppAD
Definition: autodiff/cppad.hpp:146
pinocchio::internal::EQ
@ EQ
Definition: utils/static-if.hpp:19
pinocchio::internal::traits
Definition: fwd.hpp:83
pinocchio::internal::LT
@ LT
Definition: utils/static-if.hpp:17
pinocchio::internal::GE
@ GE
Definition: utils/static-if.hpp:20
pinocchio::internal::if_then_else_impl< CppAD::AD< Scalar >, CppAD::AD< Scalar >, ThenType, ElseType >::run
static ReturnType run(const ComparisonOperators op, const CppAD::AD< Scalar > &lhs_value, const CppAD::AD< Scalar > &rhs_value, const ThenType &then_value, const ElseType &else_value)
Definition: autodiff/cppad/utils/static-if.hpp:19
pinocchio::internal::LE
@ LE
Definition: utils/static-if.hpp:18
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27


pinocchio
Author(s):
autogenerated on Fri Nov 1 2024 02:41:48