/ concept-collection / benchcompress
Sign in
concept-collection / benchcompress
benchcompress / benchcompress / src / benchcompress / algorithms / ans / markov_predict.cpp
29 lines · 1.2 KBBlameHistoryRaw
1#include "markov_predict.hpp"
3namespace py = pybind11;
5// Explicit instantiation for int16_t
6std::tuple<py::array_t<float>, py::array_t<int16_t>, py::array_t<int16_t>>
7markov_predict_int16(py::array_t<int16_t> x, size_t M,
8 size_t num_training_samples) {
9 return markov_predict_impl<int16_t>(x, M, num_training_samples);
12// Explicit instantiation for int32_t
13std::tuple<py::array_t<float>, py::array_t<int32_t>, py::array_t<int32_t>>
14markov_predict_int32(py::array_t<int32_t> x, size_t M,
15 size_t num_training_samples) {
16 return markov_predict_impl<int32_t>(x, M, num_training_samples);
19PYBIND11_MODULE(markov_predict_cpp_ext, m) {
20 m.doc() = "C++ implementation of markov_predict using pybind11";
21 m.def("markov_predict_int16", &markov_predict_int16,
22 "Predict signal using Markov model and return coefficients, initial "
23 "values and residuals (int16)",
24 py::arg("x"), py::arg("M"), py::arg("num_training_samples") = 10000);
25 m.def("markov_predict_int32", &markov_predict_int32,
26 "Predict signal using Markov model and return coefficients, initial "
27 "values and residuals (int32)",
28 py::arg("x"), py::arg("M"), py::arg("num_training_samples") = 10000);
moveopenescclose