Skip to content
Snippets Groups Projects
Commit de508c69 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test/matrix: test case 1x1

parent 10ee2e5f
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,11 @@ Eigen::Matrix<Scalar, Eigen::Dynamic, Eigen::Dynamic> matrix1x1(
return ReturnType::Constant(1, 1, value);
}
template <typename Scalar>
void matrix1x1_input(const Eigen::Matrix<Scalar, 1, 1>& mat) {
std::cout << mat << std::endl;
}
Eigen::VectorXd emptyVector() {
Eigen::VectorXd vec;
vec.resize(0);
......@@ -146,6 +151,8 @@ BOOST_PYTHON_MODULE(matrix) {
bp::def("vector1x1", vector1x1<double>);
bp::def("matrix1x1", matrix1x1<double>);
bp::def("matrix1x1", matrix1x1_input<double>);
bp::def("matrix1x1_int", matrix1x1_input<int>);
bp::def("naturals", naturalsXX);
bp::def("naturalsX", naturalsX);
......
......@@ -15,6 +15,10 @@ if verbose:
v = eigenpy.emptyVector()
assert v.shape == (0,)
if verbose:
print("===> From Py to Matrix1")
eigenpy.matrix1x1(np.array([1]))
if verbose:
print("===> From MatrixXd to Py")
M = eigenpy.naturals(3, 3, verbose)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment