added 306

finished chapter 3 of the tutorial
warning: there is a memory leak in 305 that happens rarely, it requires debugging

Former-commit-id: b25ed574a2
This commit is contained in:
Daniele Panozzo
2015-09-13 23:04:14 +02:00
parent 0cd2dc884b
commit b57ee21b85
4 changed files with 95 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
py::enum_<igl::EigsType>(m, "EigsType")
.value("EIGS_TYPE_SM", igl::EIGS_TYPE_SM)
.value("EIGS_TYPE_LM", igl::EIGS_TYPE_LM)
.value("NUM_EIGS_TYPES", igl::NUM_EIGS_TYPES)
.export_values();
m.def("eigs", []
(
const Eigen::SparseMatrix<double>& A,
const Eigen::SparseMatrix<double>& B,
const size_t k,
const igl::EigsType type,
Eigen::MatrixXd& sU,
Eigen::MatrixXd& sS
)
{
Eigen::VectorXd sSt;
bool ret = igl::eigs(A,B,k,type,sU,sSt);
sS = sSt;
return ret;
}, __doc_igl_eigs,
py::arg("A"), py::arg("B"), py::arg("k"), py::arg("type"), py::arg("sU"), py::arg("sS"));