Go to the documentation of this file.
7 #include <boost/math/special_functions/gamma.hpp>
8 #include <boost/multiprecision/cpp_dec_float.hpp>
9 #include <boost/test/unit_test.hpp>
10 #include <boost/utility/binary.hpp>
23 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
27 using namespace boost::multiprecision;
31 std::cout << std::numeric_limits<mpfr_float_100>::digits << std::endl;
32 std::cout << std::numeric_limits<mpfr_float_100>::digits10 << std::endl;
34 std::cout << std::setprecision(std::numeric_limits<mpfr_float_100>::max_digits10) <<
log(
b)
37 std::cout << boost::math::tgamma(
b) << std::endl;
39 std::cout << boost::math::tgamma(
b *
b) << std::endl;
42 std::cout << boost::math::tgamma(mpfr_float_100(1000)) << std::endl;
47 using namespace boost::multiprecision;
48 typedef mpfr_float_100 heap_float_100;
49 typedef number<mpfr_float_backend<100, allocate_stack>> stack_float_100;
56 BOOST_CHECK(s == sin(
x));
57 BOOST_CHECK(
c == cos(
x));
65 BOOST_CHECK(s == sin(
x));
66 BOOST_CHECK(
c == cos(
x));
72 typedef boost::multiprecision::mpfr_float_100 float_100;
75 double initial_value = boost::math::constants::pi<double>();
76 float_100 value_100(initial_value);
77 double value_cast = value_100.convert_to<
double>();
78 BOOST_CHECK(initial_value == value_cast);
80 typedef Eigen::Matrix<float_100, Eigen::Dynamic, 1> VectorFloat100;
81 static const Eigen::DenseIndex
dim = 100;
82 Eigen::VectorXd initial_vec = Eigen::VectorXd::Random(
dim);
83 VectorFloat100 vec_float_100 = initial_vec.cast<float_100>();
84 Eigen::VectorXd
vec = vec_float_100.cast<
double>();
86 BOOST_CHECK(
vec == initial_vec);
89 #define BOOST_CHECK_IS_APPROX(double_field, multires_field, Scalar) \
90 BOOST_CHECK(double_field.isApprox(multires_field.cast<Scalar>()))
100 model.lowerPositionLimit.head<3>().
fill(-1.);
101 model.upperPositionLimit.head<3>().
fill(1.);
103 typedef boost::multiprecision::mpfr_float_100 float_100;
107 ModelMulti model_multi =
model.cast<float_100>();
108 DataMulti data_multi(model_multi);
111 ModelMulti::TangentVectorType v_multi = ModelMulti::TangentVectorType::Random(model_multi.nv);
112 ModelMulti::TangentVectorType a_multi = ModelMulti::TangentVectorType::Random(model_multi.nv);
113 ModelMulti::TangentVectorType tau_multi = ModelMulti::TangentVectorType::Random(model_multi.nv);
142 rnea(model_multi, data_multi, q_multi, v_multi, a_multi);
155 data_multi.M.triangularView<Eigen::StrictlyLower>() =
156 data_multi.M.transpose().triangularView<Eigen::StrictlyLower>();
159 data.M.triangularView<Eigen::StrictlyLower>() =
160 data.M.transpose().triangularView<Eigen::StrictlyLower>();
165 BOOST_AUTO_TEST_SUITE_END()
void forwardKinematics(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q)
Update the joint placements according to the current joint configuration.
void humanoidRandom(ModelTpl< Scalar, Options, JointCollectionTpl > &model, bool usingFF=true)
Create a humanoid kinematic tree with 6-DOF limbs and random joint placements.
const DataTpl< Scalar, Options, JointCollectionTpl >::MatrixXs & crba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Convention convention=Convention::LOCAL)
Computes the upper triangular part of the joint space inertia matrix M by using the Composite Rigid B...
const DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & aba(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType1 > &v, const Eigen::MatrixBase< TangentVectorType2 > &tau, const Convention convention=Convention::LOCAL)
The Articulated-Body algorithm. It computes the forward dynamics, aka the joint accelerations given t...
const DataTpl< Scalar, Options, JointCollectionTpl >::Matrix6x & computeJointJacobians(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q)
Computes the full model Jacobian, i.e. the stack of all motion subspace expressed in the world frame....
void SINCOS(const S1 &a, S2 *sa, S3 *ca)
Computes sin/cos values of a given input scalar.
void randomConfiguration(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, const Eigen::MatrixBase< ConfigVectorIn1 > &lowerLimits, const Eigen::MatrixBase< ConfigVectorIn2 > &upperLimits, const Eigen::MatrixBase< ReturnType > &qout)
Generate a configuration vector uniformly sampled among provided limits.
#define BOOST_CHECK_IS_APPROX(double_field, multires_field, Scalar)
VectorXs TangentVectorType
Dense vectorized version of a joint tangent vector (e.g. velocity, acceleration, etc)....
BOOST_AUTO_TEST_CASE(test_basic)
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > & q
JointCollectionTpl const Eigen::MatrixBase< ConfigVectorType > const Eigen::MatrixBase< TangentVectorType > & v
const DataTpl< Scalar, Options, JointCollectionTpl >::TangentVectorType & rnea(const ModelTpl< Scalar, Options, JointCollectionTpl > &model, DataTpl< Scalar, Options, JointCollectionTpl > &data, const Eigen::MatrixBase< ConfigVectorType > &q, const Eigen::MatrixBase< TangentVectorType1 > &v, const Eigen::MatrixBase< TangentVectorType2 > &a)
The Recursive Newton-Euler algorithm. It computes the inverse dynamics, aka the joint torques accordi...
VectorXs ConfigVectorType
Dense vectorized version of a joint configuration vector.
JointCollectionTpl & model
Main pinocchio namespace.
pinocchio
Author(s):
autogenerated on Sun Dec 22 2024 03:41:12