| Line |
Branch |
Exec |
Source |
| 1 |
|
|
// |
| 2 |
|
|
// Copyright (c) 2018-2024 CNRS INRIA |
| 3 |
|
|
// |
| 4 |
|
|
|
| 5 |
|
|
#ifndef __pinocchio_fwd_hpp__ |
| 6 |
|
|
#define __pinocchio_fwd_hpp__ |
| 7 |
|
|
|
| 8 |
|
|
// Forward declaration of the main pinocchio namespace |
| 9 |
|
|
namespace pinocchio |
| 10 |
|
|
{ |
| 11 |
|
|
} |
| 12 |
|
|
|
| 13 |
|
|
#ifdef _WIN32 |
| 14 |
|
|
#include <windows.h> |
| 15 |
|
|
#undef far |
| 16 |
|
|
#undef near |
| 17 |
|
|
#endif |
| 18 |
|
|
|
| 19 |
|
|
#include <cassert> |
| 20 |
|
|
|
| 21 |
|
|
#include "pinocchio/macros.hpp" |
| 22 |
|
|
#include "pinocchio/deprecation.hpp" |
| 23 |
|
|
#include "pinocchio/warning.hpp" |
| 24 |
|
|
#include "pinocchio/config.hpp" |
| 25 |
|
|
#include "pinocchio/unsupported.hpp" |
| 26 |
|
|
|
| 27 |
|
|
#include "pinocchio/utils/helpers.hpp" |
| 28 |
|
|
#include "pinocchio/utils/cast.hpp" |
| 29 |
|
|
#include "pinocchio/utils/check.hpp" |
| 30 |
|
|
|
| 31 |
|
|
#include "pinocchio/container/boost-container-limits.hpp" |
| 32 |
|
|
|
| 33 |
|
|
#ifdef PINOCCHIO_EIGEN_CHECK_MALLOC |
| 34 |
|
|
#ifndef EIGEN_RUNTIME_NO_MALLOC |
| 35 |
|
|
#define EIGEN_RUNTIME_NO_MALLOC_WAS_NOT_DEFINED |
| 36 |
|
|
#define EIGEN_RUNTIME_NO_MALLOC |
| 37 |
|
|
#endif |
| 38 |
|
|
#endif |
| 39 |
|
|
|
| 40 |
|
|
#include <Eigen/Core> |
| 41 |
|
|
#include <Eigen/Sparse> |
| 42 |
|
|
#include <Eigen/SparseCholesky> |
| 43 |
|
|
|
| 44 |
|
|
#ifdef PINOCCHIO_WITH_ACCELERATE_SUPPORT |
| 45 |
|
|
#include <Eigen/AccelerateSupport> |
| 46 |
|
|
#endif |
| 47 |
|
|
|
| 48 |
|
|
#ifdef PINOCCHIO_EIGEN_CHECK_MALLOC |
| 49 |
|
|
#ifdef EIGEN_RUNTIME_NO_MALLOC_WAS_NOT_DEFINED |
| 50 |
|
|
#undef EIGEN_RUNTIME_NO_MALLOC |
| 51 |
|
|
#undef EIGEN_RUNTIME_NO_MALLOC_WAS_NOT_DEFINED |
| 52 |
|
|
#endif |
| 53 |
|
|
#endif |
| 54 |
|
|
|
| 55 |
|
|
#include "pinocchio/eigen-macros.hpp" |
| 56 |
|
|
#ifdef PINOCCHIO_WITH_EIGEN_TENSOR_MODULE |
| 57 |
|
|
#include <unsupported/Eigen/CXX11/Tensor> |
| 58 |
|
|
#endif |
| 59 |
|
|
|
| 60 |
|
|
#include "pinocchio/core/binary-op.hpp" |
| 61 |
|
|
#include "pinocchio/core/unary-op.hpp" |
| 62 |
|
|
|
| 63 |
|
|
#include <cstddef> // std::size_t |
| 64 |
|
|
|
| 65 |
|
|
namespace pinocchio |
| 66 |
|
|
{ |
| 67 |
|
|
/// |
| 68 |
|
|
/// \brief Common traits structure to fully define base classes for CRTP. |
| 69 |
|
|
/// |
| 70 |
|
|
template<class C> |
| 71 |
|
|
struct traits |
| 72 |
|
|
{ |
| 73 |
|
|
}; |
| 74 |
|
|
|
| 75 |
|
|
/// \brief Blank type |
| 76 |
|
|
struct Blank |
| 77 |
|
|
{ |
| 78 |
|
|
}; |
| 79 |
|
|
|
| 80 |
|
|
namespace internal |
| 81 |
|
|
{ |
| 82 |
|
|
template<typename T> |
| 83 |
|
|
struct traits |
| 84 |
|
|
{ |
| 85 |
|
|
}; |
| 86 |
|
|
} // namespace internal |
| 87 |
|
|
|
| 88 |
|
|
template<class Derived> |
| 89 |
|
|
struct NumericalBase |
| 90 |
|
|
{ |
| 91 |
|
|
typedef typename traits<Derived>::Scalar Scalar; |
| 92 |
|
|
}; |
| 93 |
|
|
|
| 94 |
|
|
/// |
| 95 |
|
|
/// \brief Type of the cast of a class C templated by Scalar and Options, to a new NewScalar type. |
| 96 |
|
|
/// This class should be specialized for each types. |
| 97 |
|
|
/// |
| 98 |
|
|
template<typename NewScalar, class C> |
| 99 |
|
|
struct CastType; |
| 100 |
|
|
|
| 101 |
|
|
/// |
| 102 |
|
|
/// \brief Cast scalar type from type FROM to type TO. |
| 103 |
|
|
/// |
| 104 |
|
|
template<typename To, typename From> |
| 105 |
|
|
struct ScalarCast |
| 106 |
|
|
{ |
| 107 |
|
20 |
static To cast(const From & value) |
| 108 |
|
|
{ |
| 109 |
|
20 |
return static_cast<To>(value); |
| 110 |
|
|
} |
| 111 |
|
|
}; |
| 112 |
|
|
|
| 113 |
|
|
template<typename To, typename From> |
| 114 |
|
|
To scalar_cast(const From & value) |
| 115 |
|
|
{ |
| 116 |
|
|
return ScalarCast<To, From>::cast(value); |
| 117 |
|
|
} |
| 118 |
|
|
|
| 119 |
|
|
/// \brief Argument position. |
| 120 |
|
|
/// Used as template parameter to refer to an argument. |
| 121 |
|
|
enum ArgumentPosition |
| 122 |
|
|
{ |
| 123 |
|
|
ARG0 = 0, |
| 124 |
|
|
ARG1 = 1, |
| 125 |
|
|
ARG2 = 2, |
| 126 |
|
|
ARG3 = 3, |
| 127 |
|
|
ARG4 = 4 |
| 128 |
|
|
}; |
| 129 |
|
|
|
| 130 |
|
|
enum AssignmentOperatorType |
| 131 |
|
|
{ |
| 132 |
|
|
SETTO, |
| 133 |
|
|
ADDTO, |
| 134 |
|
|
RMTO |
| 135 |
|
|
}; |
| 136 |
|
|
|
| 137 |
|
|
/** This value means that a positive quantity (e.g., a size) is not known at compile-time, and |
| 138 |
|
|
* that instead the value is stored in some runtime variable. |
| 139 |
|
|
*/ |
| 140 |
|
|
const int Dynamic = -1; |
| 141 |
|
|
|
| 142 |
|
|
/// \brief Return type undefined |
| 143 |
|
|
/// This is an helper structure to help internal diagnosis. |
| 144 |
|
|
struct ReturnTypeNotDefined; |
| 145 |
|
|
|
| 146 |
|
|
typedef Eigen::Matrix<bool, Eigen::Dynamic, 1> VectorXb; |
| 147 |
|
|
} // namespace pinocchio |
| 148 |
|
|
|
| 149 |
|
|
#include "pinocchio/context.hpp" |
| 150 |
|
|
|
| 151 |
|
|
#endif // #ifndef __pinocchio_fwd_hpp__ |
| 152 |
|
|
|