Finalized tutorial 704

This commit is contained in:
Sebastian Koch
2016-06-03 17:38:38 +02:00
parent 706aa31449
commit a507397d12
2 changed files with 7 additions and 3 deletions
+2
View File
@@ -173,6 +173,7 @@ py::class_<Type> bind_eigen_2(py::module &m, const char *name,
.def("cwiseQuotient", [](const Type &m1, const Type &m2) -> Type { return m1.cwiseQuotient(m2); })
/* Row and column-wise operations */
.def("rowwiseSet", [](Type &m, const Type &m2) {return Type(m.rowwise() = Eigen::Matrix<Scalar, 1, Eigen::Dynamic>(m2));} )
.def("rowwiseSum", [](const Type &m) {return Type(m.rowwise().sum());} )
.def("rowwiseProd", [](const Type &m) {return Type(m.rowwise().prod());} )
.def("rowwiseMean", [](const Type &m) {return Type(m.rowwise().mean());} )
@@ -181,6 +182,7 @@ py::class_<Type> bind_eigen_2(py::module &m, const char *name,
.def("rowwiseMinCoeff", [](const Type &m) {return Type(m.rowwise().minCoeff());} )
.def("rowwiseMaxCoeff", [](const Type &m) {return Type(m.rowwise().maxCoeff());} )
.def("colwiseSet", [](Type &m, const Type &m2) {return Type(m.colwise() = Eigen::Matrix<Scalar, Eigen::Dynamic, 1>(m2));} )
.def("colwiseSum", [](const Type &m) {return Type(m.colwise().sum());} )
.def("colwiseProd", [](const Type &m) {return Type(m.colwise().prod());} )
.def("colwiseMean", [](const Type &m) {return Type(m.colwise().mean());} )