12 template<
typename MatType>
15 if(MatType::IsVectorAtCompileTime)
16 std::cout <<
"isVector" << std::endl;
17 std::cout <<
"size: cols " << mat.cols() <<
" rows " << mat.rows() << std::endl;
18 std::cout << mat << std::endl;
21 template<
typename VecType>
24 EIGEN_STATIC_ASSERT_VECTOR_ONLY(VecType);
28 template<
typename MatType>
34 template<
typename MatType>
35 void fill(Eigen::Ref<MatType>
mat,
const typename MatType::Scalar &
value)
40 template<
typename MatType>
43 static MatType
mat(rows,cols);
44 std::cout <<
"mat:\n" << mat << std::endl;
53 bp::def(
"printMatrix", printMatrix<Vector3d>);
54 bp::def(
"printMatrix", printMatrix<VectorXd>);
55 bp::def(
"printMatrix", printMatrix<MatrixXd>);
57 bp::def(
"printVector", printVector<VectorXd>);
58 bp::def(
"printRowVector", printVector<RowVectorXd>);
60 bp::def(
"setOnes", setOnes<Vector3d>);
61 bp::def(
"setOnes", setOnes<VectorXd>);
62 bp::def(
"setOnes", setOnes<MatrixXd>);
64 bp::def(
"fillVec3", fill<Vector3d>);
65 bp::def(
"fillVec", fill<VectorXd>);
66 bp::def(
"fill", fill<MatrixXd>);
68 bp::def(
"asRef", asRef<MatrixXd>);
Eigen::Ref< MatType > asRef(const int rows, const int cols)
BOOST_PYTHON_MODULE(eigen_ref)
void EIGENPY_DLLAPI enableEigenPy()
void printMatrix(const Eigen::Ref< const MatType > mat)
void setOnes(Eigen::Ref< MatType > mat)
void printVector(const Eigen::Ref< const VecType > &vec)
void fill(Eigen::Ref< MatType > mat, const typename MatType::Scalar &value)