Commit 9a624678 authored by Justin Carpentier's avatar Justin Carpentier

all: move cppad{,cg} and casadi to the right directories

parent caf7dad8
......@@ -237,6 +237,8 @@ MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/serialization")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/algorithm")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/container")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/codegen")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff")
SET(HEADERS_)
FOREACH(header ${HEADERS})
STRING(REGEX REPLACE "${PROJECT_SOURCE_DIR}/src/" "" header ${header})
......
......@@ -6,7 +6,7 @@
#define __pinocchio_aba_hxx__
#ifdef PINOCCHIO_WITH_CPPAD_SUPPORT
#include "pinocchio/math/cppad.hpp"
#include "pinocchio/autodiff/cppad.hpp"
#endif
#include "pinocchio/spatial/act-on-set.hpp"
......
This diff is collapsed.
//
// Copyright (c) 2018-2019 CNRS INRIA
//
#ifndef __pinocchio_autodiff_ccpad_hpp__
#define __pinocchio_autodiff_ccpad_hpp__
#include "pinocchio/math/fwd.hpp"
// Do not include this file directly.
// Copy and use directly the intructions from <cppad/example/cppad_eigen.hpp>
// to avoid redifinition of EIGEN_MATRIXBASE_PLUGIN for Eigen 3.3.0 and later
//#include <cppad/example/cppad_eigen.hpp>
#ifdef PINOCCHIO_CPPAD_REQUIRES_MATRIX_BASE_PLUGIN
#define EIGEN_MATRIXBASE_PLUGIN <cppad/example/eigen_plugin.hpp>
#endif
#include <cppad/cppad.hpp>
#include <Eigen/Dense>
namespace boost
{
namespace math
{
namespace constants
{
namespace detail
{
template<typename Scalar>
struct constant_pi< CppAD::AD<Scalar> > : constant_pi<Scalar> {};
}
}
}
}
namespace Eigen
{
namespace internal
{
// Specialization of Eigen::internal::cast_impl for CppAD input types
template<typename Scalar>
struct cast_impl<CppAD::AD<Scalar>,Scalar>
{
#if EIGEN_VERSION_AT_LEAST(3,2,90)
EIGEN_DEVICE_FUNC
#endif
static inline Scalar run(const CppAD::AD<Scalar> & x)
{
return CppAD::Value(x);
}
};
}
} //namespace Eigen
/// Source from #include <cppad/example/cppad_eigen.hpp>
namespace Eigen
{
template <class Base> struct NumTraits< CppAD::AD<Base> >
{ // type that corresponds to the real part of an AD<Base> value
typedef CppAD::AD<Base> Real;
// type for AD<Base> operations that result in non-integer values
typedef CppAD::AD<Base> NonInteger;
// type to use for numeric literals such as "2" or "0.5".
typedef CppAD::AD<Base> Literal;
// type for nested value inside an AD<Base> expression tree
typedef CppAD::AD<Base> Nested;
enum {
// does not support complex Base types
IsComplex = 0 ,
// does not support integer Base types
IsInteger = 0 ,
// only support signed Base types
IsSigned = 1 ,
// must initialize an AD<Base> object
RequireInitialization = 1 ,
// computational cost of the corresponding operations
ReadCost = 1 ,
AddCost = 2 ,
MulCost = 2
};
// machine epsilon with type of real part of x
// (use assumption that Base is not complex)
static CppAD::AD<Base> epsilon(void)
{ return CppAD::numeric_limits< CppAD::AD<Base> >::epsilon(); }
// relaxed version of machine epsilon for comparison of different
// operations that should result in the same value
static CppAD::AD<Base> dummy_precision(void)
{ return 100. *
CppAD::numeric_limits< CppAD::AD<Base> >::epsilon();
}
// minimum normalized positive value
static CppAD::AD<Base> lowest(void)
{ return CppAD::numeric_limits< CppAD::AD<Base> >::min(); }
// maximum finite value
static CppAD::AD<Base> highest(void)
{ return CppAD::numeric_limits< CppAD::AD<Base> >::max(); }
// number of decimal digits that can be represented without change.
static int digits10(void)
{ return CppAD::numeric_limits< CppAD::AD<Base> >::digits10; }
};
} // namespace Eigen
/// Source from #include <cppad/example/cppad_eigen.hpp>
namespace CppAD
{
// functions that return references
template <class Base> const AD<Base>& conj(const AD<Base>& x)
{ return x; }
template <class Base> const AD<Base>& real(const AD<Base>& x)
{ return x; }
// functions that return values (note abs is defined by cppad.hpp)
template <class Base> AD<Base> imag(const AD<Base>& /*x*/)
{ return CppAD::AD<Base>(0.); }
template <class Base> AD<Base> abs2(const AD<Base>& x)
{ return x * x; }
} // namespace CppAD
namespace pinocchio
{
template<typename Scalar>
struct TaylorSeriesExpansion< CppAD::AD<Scalar> > : TaylorSeriesExpansion<Scalar>
{
typedef TaylorSeriesExpansion<Scalar> Base;
using Base::precision;
};
} // namespace pinocchio
#endif // #ifndef __pinocchio_autodiff_ccpad_hpp__
//
// Copyright (c) 2018-2019 CNRS INRIA
//
#ifndef __pinocchio_codegen_ccpadcg_hpp__
#define __pinocchio_codegen_ccpadcg_hpp__
#include "pinocchio/math/fwd.hpp"
#include <cmath>
#include <cppad/cg/support/cppadcg_eigen.hpp>
#include "pinocchio/autodiff/cppad.hpp"
#ifndef PINOCCHIO_WITH_CXX11_SUPPORT
#error CppADCodeGen requires C++11 or more
#endif
namespace boost
{
namespace math
{
namespace constants
{
namespace detail
{
template<typename Scalar>
struct constant_pi< CppAD::cg::CG<Scalar> > : constant_pi<Scalar> {};
}
}
}
}
namespace Eigen
{
namespace internal
{
// Specialization of Eigen::internal::cast_impl for CppAD input types
template<typename Scalar>
struct cast_impl<CppAD::cg::CG<Scalar>,Scalar>
{
#if EIGEN_VERSION_AT_LEAST(3,2,90)
EIGEN_DEVICE_FUNC
#endif
static inline Scalar run(const CppAD::cg::CG<Scalar> & x)
{
return x.getValue();
}
};
}
} // namespace Eigen
namespace pinocchio
{
template<typename Scalar>
struct TaylorSeriesExpansion< CppAD::cg::CG<Scalar> > : TaylorSeriesExpansion<Scalar>
{
typedef TaylorSeriesExpansion<Scalar> Base;
using Base::precision;
};
} // namespace pinocchio
#endif // #ifndef __pinocchio_codegen_ccpadcg_hpp__
This diff is collapsed.
//
// Copyright (c) 2018-2019 CNRS INRIA
// Copyright (c) 2019 INRIA
//
#ifndef __pinocchio_math_ccpad_hpp__
#define __pinocchio_math_ccpad_hpp__
#include "pinocchio/math/fwd.hpp"
#include "pinocchio/macros.hpp"
// Do not include this file directly.
// Copy and use directly the intructions from <cppad/example/cppad_eigen.hpp>
// to avoid redifinition of EIGEN_MATRIXBASE_PLUGIN for Eigen 3.3.0 and later
//#include <cppad/example/cppad_eigen.hpp>
PINOCCHIO_PRAGMA_DEPRECATED_HEADER(pinocchio/math/cppad.hpp,pinocchio/autodiff/cppad.hpp)
#ifdef PINOCCHIO_CPPAD_REQUIRES_MATRIX_BASE_PLUGIN
#define EIGEN_MATRIXBASE_PLUGIN <cppad/example/eigen_plugin.hpp>
#endif
#include <cppad/cppad.hpp>
#include <Eigen/Dense>
namespace boost
{
namespace math
{
namespace constants
{
namespace detail
{
template<typename Scalar>
struct constant_pi< CppAD::AD<Scalar> > : constant_pi<Scalar> {};
}
}
}
}
namespace Eigen
{
namespace internal
{
// Specialization of Eigen::internal::cast_impl for CppAD input types
template<typename Scalar>
struct cast_impl<CppAD::AD<Scalar>,Scalar>
{
#if EIGEN_VERSION_AT_LEAST(3,2,90)
EIGEN_DEVICE_FUNC
#endif
static inline Scalar run(const CppAD::AD<Scalar> & x)
{
return CppAD::Value(x);
}
};
}
} //namespace Eigen
/// Source from #include <cppad/example/cppad_eigen.hpp>
namespace Eigen
{
template <class Base> struct NumTraits< CppAD::AD<Base> >
{ // type that corresponds to the real part of an AD<Base> value
typedef CppAD::AD<Base> Real;
// type for AD<Base> operations that result in non-integer values
typedef CppAD::AD<Base> NonInteger;
// type to use for numeric literals such as "2" or "0.5".
typedef CppAD::AD<Base> Literal;
// type for nested value inside an AD<Base> expression tree
typedef CppAD::AD<Base> Nested;
enum {
// does not support complex Base types
IsComplex = 0 ,
// does not support integer Base types
IsInteger = 0 ,
// only support signed Base types
IsSigned = 1 ,
// must initialize an AD<Base> object
RequireInitialization = 1 ,
// computational cost of the corresponding operations
ReadCost = 1 ,
AddCost = 2 ,
MulCost = 2
};
// machine epsilon with type of real part of x
// (use assumption that Base is not complex)
static CppAD::AD<Base> epsilon(void)
{ return CppAD::numeric_limits< CppAD::AD<Base> >::epsilon(); }
// relaxed version of machine epsilon for comparison of different
// operations that should result in the same value
static CppAD::AD<Base> dummy_precision(void)
{ return 100. *
CppAD::numeric_limits< CppAD::AD<Base> >::epsilon();
}
// minimum normalized positive value
static CppAD::AD<Base> lowest(void)
{ return CppAD::numeric_limits< CppAD::AD<Base> >::min(); }
// maximum finite value
static CppAD::AD<Base> highest(void)
{ return CppAD::numeric_limits< CppAD::AD<Base> >::max(); }
// number of decimal digits that can be represented without change.
static int digits10(void)
{ return CppAD::numeric_limits< CppAD::AD<Base> >::digits10; }
};
} // namespace Eigen
/// Source from #include <cppad/example/cppad_eigen.hpp>
namespace CppAD
{
// functions that return references
template <class Base> const AD<Base>& conj(const AD<Base>& x)
{ return x; }
template <class Base> const AD<Base>& real(const AD<Base>& x)
{ return x; }
// functions that return values (note abs is defined by cppad.hpp)
template <class Base> AD<Base> imag(const AD<Base>& /*x*/)
{ return CppAD::AD<Base>(0.); }
template <class Base> AD<Base> abs2(const AD<Base>& x)
{ return x * x; }
} // namespace CppAD
namespace pinocchio
{
template<typename Scalar>
struct TaylorSeriesExpansion< CppAD::AD<Scalar> > : TaylorSeriesExpansion<Scalar>
{
typedef TaylorSeriesExpansion<Scalar> Base;
using Base::precision;
};
} // namespace pinocchio
#include "pinocchio/autodiff/cppad.hpp"
#endif // #ifndef __pinocchio_math_ccpad_hpp__
//
// Copyright (c) 2018-2019 CNRS INRIA
// Copyright (c) 2019 INRIA
//
#ifndef __pinocchio_math_ccpadcg_hpp__
#define __pinocchio_math_ccpadcg_hpp__
#include "pinocchio/math/fwd.hpp"
#include "pinocchio/macros.hpp"
#include <cmath>
#include <cppad/cg/support/cppadcg_eigen.hpp>
PINOCCHIO_PRAGMA_DEPRECATED_HEADER(pinocchio/math/cppadcg.hpp,pinocchio/codegen/cppadcg.hpp)
#include "pinocchio/math/cppad.hpp"
#ifndef PINOCCHIO_WITH_CXX11_SUPPORT
#error CppADCodeGen requires C++11 or more
#endif
namespace boost
{
namespace math
{
namespace constants
{
namespace detail
{
template<typename Scalar>
struct constant_pi< CppAD::cg::CG<Scalar> > : constant_pi<Scalar> {};
}
}
}
}
namespace Eigen
{
namespace internal
{
// Specialization of Eigen::internal::cast_impl for CppAD input types
template<typename Scalar>
struct cast_impl<CppAD::cg::CG<Scalar>,Scalar>
{
#if EIGEN_VERSION_AT_LEAST(3,2,90)
EIGEN_DEVICE_FUNC
#endif
static inline Scalar run(const CppAD::cg::CG<Scalar> & x)
{
return x.getValue();
}
};
}
} // namespace Eigen
namespace pinocchio
{
template<typename Scalar>
struct TaylorSeriesExpansion< CppAD::cg::CG<Scalar> > : TaylorSeriesExpansion<Scalar>
{
typedef TaylorSeriesExpansion<Scalar> Base;
using Base::precision;
};
} // namespace pinocchio
#include "pinocchio/codegen/cppadcg.hpp"
#endif // #ifndef __pinocchio_math_ccpadcg_hpp__
......@@ -2,7 +2,7 @@
// Copyright (c) 2019 INRIA
//
#include "pinocchio/math/casadi.hpp"
#include "pinocchio/autodiff/casadi.hpp"
#include "pinocchio/algorithm/rnea.hpp"
#include "pinocchio/algorithm/rnea-derivatives.hpp"
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2019 INRIA
//
#include "pinocchio/math/casadi.hpp"
#include "pinocchio/autodiff/casadi.hpp"
#include "pinocchio/algorithm/kinematics.hpp"
#include "pinocchio/algorithm/frames.hpp"
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2019 INRIA
//
#include <pinocchio/math/casadi.hpp>
#include <pinocchio/autodiff/casadi.hpp>
#include <Eigen/Dense>
#include <boost/variant.hpp> // to avoid C99 warnings
......
......@@ -3,7 +3,7 @@
//
#include <pinocchio/math/casadi.hpp>
#include <pinocchio/autodiff/casadi.hpp>
#include <pinocchio/math/quaternion.hpp>
#include <pinocchio/spatial/se3.hpp>
#include <pinocchio/spatial/motion.hpp>
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2018-2019 CNRS INRIA
//
#include "pinocchio/math/cppad.hpp"
#include "pinocchio/autodiff/cppad.hpp"
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/data.hpp"
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2018-2019 CNRS INRIA
//
#include "pinocchio/math/cppad.hpp"
#include "pinocchio/autodiff/cppad.hpp"
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/data.hpp"
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2018-2019 CNRS INRIA
//
#include "pinocchio/math/cppad.hpp"
#include "pinocchio/autodiff/cppad.hpp"
#include <cppad/speed/det_by_minor.hpp>
#include <boost/variant.hpp> // to avoid C99 warnings
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2018-2019 CNRS INRIA
//
#include "pinocchio/math/cppad.hpp"
#include "pinocchio/autodiff/cppad.hpp"
#include "pinocchio/multibody/joint/joint-generic.hpp"
#include "pinocchio/multibody/liegroup/liegroup.hpp"
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2018-2019 CNRS INRIA
//
#include "pinocchio/math/cppad.hpp"
#include "pinocchio/autodiff/cppad.hpp"
#include "pinocchio/spatial/se3.hpp"
#include "pinocchio/spatial/motion.hpp"
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2018-2019 CNRS INRIA
//
#include "pinocchio/math/cppadcg.hpp"
#include "pinocchio/codegen/cppadcg.hpp"
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/multibody/data.hpp"
......
......@@ -2,7 +2,7 @@
// Copyright (c) 2018-2019 CNRS INRIA
//
#include "pinocchio/math/cppadcg.hpp"
#include "pinocchio/codegen/cppadcg.hpp"
#include "pinocchio/multibody/model.hpp"
#include "pinocchio/parsers/sample-models.hpp"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment