py_colon.cpp 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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. m.def("colon", []
  9. (
  10. const double low,
  11. const double step,
  12. const double high,
  13. Eigen::MatrixXd& I
  14. )
  15. {
  16. Eigen::Matrix<double,Eigen::Dynamic,1> temp;
  17. igl::colon<double>(low,step,high,temp);
  18. I = temp;
  19. }, __doc_igl_colon,
  20. py::arg("low"), py::arg("step"), py::arg("high"), py::arg("I"));
  21. m.def("colon", []
  22. (
  23. const double low,
  24. const double high,
  25. Eigen::MatrixXd& I
  26. )
  27. {
  28. Eigen::Matrix<double,Eigen::Dynamic,1> temp;
  29. igl::colon<double>(low,high,temp);
  30. I = temp;
  31. }, __doc_igl_colon,
  32. py::arg("low"), py::arg("high"), py::arg("I"));
  33. m.def("colon", []
  34. (
  35. const double& low,
  36. const double& high
  37. )
  38. {
  39. return Eigen::MatrixXd(igl::colon<double>(low,high));
  40. }, __doc_igl_colon,
  41. py::arg("low"), py::arg("high"));
  42. m.def("coloni", []
  43. (
  44. const int low,
  45. const int step,
  46. const int high,
  47. Eigen::MatrixXi& I
  48. )
  49. {
  50. Eigen::Matrix<int,Eigen::Dynamic,1> temp;
  51. igl::colon<int>(low,step,high,temp);
  52. I = temp;
  53. }, __doc_igl_colon,
  54. py::arg("low"), py::arg("step"), py::arg("high"), py::arg("I"));
  55. m.def("coloni", []
  56. (
  57. const int low,
  58. const int high,
  59. Eigen::MatrixXi& I
  60. )
  61. {
  62. Eigen::Matrix<int,Eigen::Dynamic,1> temp;
  63. igl::colon<int>(low,high,temp);
  64. I = temp;
  65. }, __doc_igl_colon,
  66. py::arg("low"), py::arg("high"), py::arg("I"));
  67. m.def("coloni", []
  68. (
  69. const int& low,
  70. const int& high
  71. )
  72. {
  73. return Eigen::MatrixXi(igl::colon<int>(low,high));
  74. }, __doc_igl_colon,
  75. py::arg("low"), py::arg("high"));