eigen-basic-op.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019 INRIA
3 //
4 
5 #include "pinocchio/multibody/model.hpp"
6 
7 #include <Eigen/Core>
8 #include "pinocchio/math/matrix.hpp"
9 
10 #include <boost/test/unit_test.hpp>
11 #include <boost/utility/binary.hpp>
12 
13 BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
14 
15 BOOST_AUTO_TEST_CASE(test_matrix_matrix_product)
16 {
17  using namespace pinocchio;
18  using namespace Eigen;
19  const Eigen::DenseIndex m = 20, n = 100;
20  MatrixXd M1(MatrixXd::Ones(m,n)), M2(MatrixXd::Ones(n,m));
22  BOOST_CHECK(!res.eval().isZero());
23 }
24 
25 BOOST_AUTO_TEST_CASE(test_scalar_matrix_product)
26 {
27  using namespace pinocchio;
28  using namespace Eigen;
29  const Eigen::DenseIndex m = 20, n = 100;
30  MatrixXd M(MatrixXd::Ones(m,n));
31  const double alpha = 0.;
33  BOOST_CHECK(res.eval().isZero());
34 }
35 
36 BOOST_AUTO_TEST_CASE(test_matrix_scalar_product)
37 {
38  using namespace pinocchio;
39  using namespace Eigen;
40  const Eigen::DenseIndex m = 20, n = 100;
41  MatrixXd M(MatrixXd::Ones(m,n));
42  const double alpha = 1.;
44  BOOST_CHECK(res.eval() == M);
45 }
46 
47 BOOST_AUTO_TEST_SUITE_END()
48 
BOOST_AUTO_TEST_CASE(test_matrix_matrix_product)
Main pinocchio namespace.
Definition: timings.cpp:30
res
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_multiple_op< Scalar >, const Matrix > type
Definition: math/matrix.hpp:95
const Eigen::CwiseUnaryOp< Eigen::internal::scalar_multiple_op< Scalar >, const Matrix > type
Definition: math/matrix.hpp:82
Eigen::ProductReturnType< M1, M2 >::Type type
Definition: math/matrix.hpp:69
M


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