autodiff/casadi/utils/static-if.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019-2020 INRIA
3 //
4 
5 #ifndef __pinocchio_autodiff_casadi_utils_static_if_hpp__
6 #define __pinocchio_autodiff_casadi_utils_static_if_hpp__
7 
8 #include "pinocchio/utils/static-if.hpp"
9 
10 namespace pinocchio
11 {
12  namespace internal
13  {
14 
15  template<typename Scalar, typename ThenType, typename ElseType>
16  struct if_then_else_impl<::casadi::Matrix<Scalar>,::casadi::Matrix<Scalar>,ThenType,ElseType>
17  {
19 
20  typedef ::casadi::Matrix<Scalar> CasadiType;
21 
22  static inline ReturnType run(const ComparisonOperators op,
23  const CasadiType & lhs_value,
24  const CasadiType & rhs_value,
25  const ThenType & then_value,
26  const ElseType & else_value)
27  {
28  switch(op)
29  {
30  case LT:
31  return ::casadi::Matrix<Scalar>::if_else(lhs_value < rhs_value,then_value,else_value);
32  break;
33  case LE:
34  return ::casadi::Matrix<Scalar>::if_else(lhs_value <= rhs_value,then_value,else_value);
35  break;
36  case EQ:
37  return ::casadi::Matrix<Scalar>::if_else(lhs_value == rhs_value,then_value,else_value);
38  break;
39  case GE:
40  return ::casadi::Matrix<Scalar>::if_else(lhs_value >= rhs_value,then_value,else_value);
41  break;
42  case GT:
43  return ::casadi::Matrix<Scalar>::if_else(lhs_value > rhs_value,then_value,else_value);
44  break;
45  }
46  }
47  };
48  } // namespace internal
49 } // namespace pinocchio
50 
51 #endif // ifndef __pinocchio_autodiff_casadi_utils_static_if_hpp__
static ReturnType run(const ComparisonOperators op, const CasadiType &lhs_value, const CasadiType &rhs_value, const ThenType &then_value, const ElseType &else_value)
Main pinocchio namespace.
Definition: timings.cpp:30


pinocchio
Author(s):
autogenerated on Tue Jun 1 2021 02:45:04