py_min_quad_with_fixed.cpp 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. // Wrap the data class, no properties are exposed since it is not necessary
  9. py::class_<igl::min_quad_with_fixed_data<double> > min_quad_with_fixed_data(m, "min_quad_with_fixed_data");
  10. min_quad_with_fixed_data
  11. .def(py::init<>());
  12. m.def("min_quad_with_fixed_precompute", []
  13. (
  14. const Eigen::SparseMatrix<double>& A,
  15. const Eigen::MatrixXi& known,
  16. const Eigen::SparseMatrix<double>& Aeq,
  17. const bool pd,
  18. igl::min_quad_with_fixed_data<double> & data
  19. )
  20. {
  21. assert_is_VectorX("known",known);
  22. return igl::min_quad_with_fixed_precompute(A,known,Aeq,pd,data);
  23. }, __doc_igl_min_quad_with_fixed,
  24. py::arg("A"), py::arg("known"), py::arg("Aeq"), py::arg("pd"), py::arg("data"));
  25. m.def("min_quad_with_fixed_solve", []
  26. (
  27. const igl::min_quad_with_fixed_data<double> & data,
  28. const Eigen::MatrixXd& B,
  29. const Eigen::MatrixXd& Y,
  30. const Eigen::MatrixXd & Beq,
  31. Eigen::MatrixXd& Z,
  32. Eigen::MatrixXd& sol
  33. )
  34. {
  35. assert_is_VectorX("B",B);
  36. assert_is_VectorX("Y",Y);
  37. assert_is_VectorX("Beq",Beq);
  38. return igl::min_quad_with_fixed_solve(data,B,Y,Beq,Z,sol);
  39. }, __doc_igl_min_quad_with_fixed,
  40. py::arg("data"), py::arg("B"), py::arg("Y"), py::arg("Beq"), py::arg("Z"), py::arg("sol"));
  41. m.def("min_quad_with_fixed_solve", []
  42. (
  43. const igl::min_quad_with_fixed_data<double> & data,
  44. const Eigen::MatrixXd& B,
  45. const Eigen::MatrixXd& Y,
  46. const Eigen::MatrixXd & Beq,
  47. Eigen::MatrixXd& Z
  48. )
  49. {
  50. assert_is_VectorX("B",B);
  51. assert_is_VectorX("Y",Y);
  52. assert_is_VectorX("Beq",Beq);
  53. return igl::min_quad_with_fixed_solve(data,B,Y,Beq,Z);
  54. }, __doc_igl_min_quad_with_fixed,
  55. py::arg("data"), py::arg("B"), py::arg("Y"), py::arg("Beq"), py::arg("Z"));
  56. m.def("min_quad_with_fixed", []
  57. (
  58. const Eigen::SparseMatrix<double>& A,
  59. const Eigen::MatrixXd& B,
  60. const Eigen::MatrixXi& known,
  61. const Eigen::MatrixXd& Y,
  62. const Eigen::SparseMatrix<double>& Aeq,
  63. const Eigen::MatrixXd& Beq,
  64. const bool pd,
  65. Eigen::MatrixXd& Z
  66. )
  67. {
  68. assert_is_VectorX("B",B);
  69. assert_is_VectorX("known",known);
  70. assert_is_VectorX("Y",Y);
  71. assert_is_VectorX("Beq",Beq);
  72. return igl::min_quad_with_fixed(A,B,known,Y,Aeq,Beq,pd,Z);
  73. }, __doc_igl_min_quad_with_fixed,
  74. py::arg("A"), py::arg("B"), py::arg("known"), py::arg("Y"), py::arg("Aeq"), py::arg("Beq"), py::arg("pd"), py::arg("Z"));