diff --git a/src/pymatlib/core/cpp/module.cpp b/src/pymatlib/core/cpp/module.cpp new file mode 100644 index 0000000000000000000000000000000000000000..3c80f2921a90a69ff2c4c906bcc5d3f75f23d2fb --- /dev/null +++ b/src/pymatlib/core/cpp/module.cpp @@ -0,0 +1,26 @@ +#include <pybind11/pybind11.h> +#include <pybind11/numpy.h> +#include "include/binary_search_interpolation.h" +#include "include/double_lookup_interpolation.h" + +namespace py = pybind11; + +PYBIND11_MODULE(fast_interpolation, m) { + m.doc() = "Fast interpolation methods implementation"; + + m.def("interpolate_binary_search", + &interpolate_binary_search, + "Find temperature using binary search and linear interpolation", + py::arg("temperature_array"), + py::arg("h_in"), + py::arg("energy_density_array")); + + m.def("interpolate_double_lookup", + &interpolate_double_lookup, + "Fast interpolation using double lookup method and linear interpolation", + py::arg("E_target"), + py::arg("T_eq"), + py::arg("E_neq"), + py::arg("E_eq"), + py::arg("idx_map")); +}