Skip to content
Snippets Groups Projects
Commit aac951c2 authored by Rahil Doshi's avatar Rahil Doshi
Browse files

Add module.cpp to expose C++ functions to Python

parent 97f62e61
No related branches found
No related tags found
No related merge requests found
#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"));
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment