summaryrefslogtreecommitdiff
path: root/ts_cpp/ts_lib.cc
blob: cbe0a1935e9d9d10d528de05bc81f3445de40be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <pybind11/pybind11.h>
#include <pybind11/stl.h>
#include "ts_lib.h"

namespace py = pybind11;

PYBIND11_MODULE(ts_cpp, m) {
  py::class_<Triplet>(m, "Triplet")
    .def(py::init<Node, Node, Node>());

  py::class_<Structure>(m, "Structure")
    .def(py::init<>())
    .def("addFact", &Structure::AddFactPy)
    .def("removeFact", &Structure::RemoveFactPy)
    .def("lookup", &Structure::Lookup);

  py::class_<Solver>(m, "Solver")
    .def(py::init<
           const Structure&,
           const size_t,
           const std::vector<Triplet>&,
           const std::vector<std::set<size_t>>
         >())
    .def("isValid", &Solver::IsValid)
    .def("nextAssignment", &Solver::NextAssignment);
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback