diff --git a/bindings/pylibROM/algo/pyAdaptiveDMD.cpp b/bindings/pylibROM/algo/pyAdaptiveDMD.cpp new file mode 100644 index 0000000..dc957a2 --- /dev/null +++ b/bindings/pylibROM/algo/pyAdaptiveDMD.cpp @@ -0,0 +1,31 @@ +#include +#include +#include "algo/AdaptiveDMD.h" +#include "linalg/Vector.h" +#include "linalg/Matrix.h" + +namespace py = pybind11; +using namespace CAROM; + +PYBIND11_MODULE(adaptivedmd, m) { + py::class_(m, "AdaptiveDMD") + .def(py::init(), + py::arg("dim"), + py::arg("desired_dt") = -1.0, + py::arg("rbf") = "G", + py::arg("interp_method") = "LS", + py::arg("closest_rbf_val") = 0.9, + py::arg("alt_output_basis") = false, + py::arg("state_offset") = nullptr) + .def("train", (void (AdaptiveDMD::*)(double, const Matrix*, double)) &AdaptiveDMD::train, + py::arg("energy_fraction"), + py::arg("W0") = nullptr, + py::arg("linearity_tol") = 0.0) + .def("train", (void (AdaptiveDMD::*)(int, const Matrix*, double)) &AdaptiveDMD::train, + py::arg("k"), + py::arg("W0") = nullptr, + py::arg("linearity_tol") = 0.0) + .def("getTrueDt", &AdaptiveDMD::getTrueDt) + .def("getInterpolatedSnapshots", &AdaptiveDMD::getInterpolatedSnapshots); +} +