py_eigs.cpp 988 B

1234567891011121314151617181920212223242526272829
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. py::enum_<igl::EigsType>(m, "EigsType")
  9. .value("EIGS_TYPE_SM", igl::EIGS_TYPE_SM)
  10. .value("EIGS_TYPE_LM", igl::EIGS_TYPE_LM)
  11. .value("NUM_EIGS_TYPES", igl::NUM_EIGS_TYPES)
  12. .export_values();
  13. m.def("eigs", []
  14. (
  15. const Eigen::SparseMatrix<double>& A,
  16. const Eigen::SparseMatrix<double>& B,
  17. const size_t k,
  18. const igl::EigsType type,
  19. Eigen::MatrixXd& sU,
  20. Eigen::MatrixXd& sS
  21. )
  22. {
  23. Eigen::VectorXd sSt;
  24. bool ret = igl::eigs(A,B,k,type,sU,sSt);
  25. sS = sSt;
  26. return ret;
  27. }, __doc_igl_eigs,
  28. py::arg("A"), py::arg("B"), py::arg("k"), py::arg("type"), py::arg("sU"), py::arg("sS"));