From c592fa5aecf81a58c7eb8138827b069220d314ff Mon Sep 17 00:00:00 2001 From: Henry Yu Date: Thu, 24 Aug 2023 14:35:27 -0700 Subject: [PATCH] initial commit --- bindings/pylibROM/algo/pyAdaptiveDMD.cpp | 31 ++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 bindings/pylibROM/algo/pyAdaptiveDMD.cpp 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); +} +