eigen-basic-op.cpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019 INRIA
3 //
4 
6 
7 #include <Eigen/Core>
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()
Eigen
test-cpp2pybind11.m
m
Definition: test-cpp2pybind11.py:22
pinocchio::MatrixScalarProduct
Definition: math/matrix.hpp:95
model.hpp
pinocchio::res
ReturnType res
Definition: spatial/classic-acceleration.hpp:57
matrix.hpp
reachable-workspace-with-collisions.alpha
float alpha
Definition: reachable-workspace-with-collisions.py:159
M
M
pinocchio::MatrixMatrixProduct::type
Eigen::ProductReturnType< M1, M2 >::Type type
Definition: math/matrix.hpp:73
pinocchio::ScalarMatrixProduct
Definition: math/matrix.hpp:78
BOOST_AUTO_TEST_CASE
BOOST_AUTO_TEST_CASE(test_matrix_matrix_product)
Definition: eigen-basic-op.cpp:15
n
Vec3f n
pinocchio
Main pinocchio namespace.
Definition: timings.cpp:27
BOOST_CHECK
#define BOOST_CHECK(check)
Definition: overview-urdf.cpp:34


pinocchio
Author(s):
autogenerated on Sat Jun 22 2024 02:41:46