2#include <structmember.h>
6#include <boost/python.hpp>
19namespace py = boost::python;
23 boost::python::list values,
26 int gLength = py::len(values);
27 std::vector<std::vector<double> > valuesVec(gLength);
28 for (
int i = 0; i < gLength; ++i) {
29 int lineLength = py::len(values[i]);
30 valuesVec[i] = std::vector<double>(lineLength);
31 for (
int j = 0; j < lineLength; ++j) {
32 valuesVec[i][j] = py::extract<double>(values[i][j]);
40 polyPatchOrder).
solve();
47 if (py::len(point) != pointDim) {
50 std::vector<double> pointVec(pointDim);
51 for (
int i = 0; i < pointDim; ++i) {
52 pointVec[i] = py::extract<double>(point[i]);
54 std::vector<double> valueVec(valueDim);
55 patch->
function(&pointVec[0], &valueVec[0]);
56 py::list value = py::list();
57 for (
int i = 0; i < valueDim; ++i) {
58 value.append(valueVec[i]);
68 py::class_<PolynomialPatch, boost::noncopyable>(
"PolynomialPatch")
70 py::return_value_policy<py::manage_new_object>())
71 .staticmethod(
"initialise_from_solve_factory")
void registerExceptions()
const char * module_docstring
BOOST_PYTHON_MODULE(polynomial_patch)
PolynomialPatch * initialiseFromSolveFactory(NDGrid *points, boost::python::list values, int polyPatchOrder, int smoothingOrder)
py::list function(PolynomialPatch *patch, py::list point)
Base class for meshing routines.
Patches together many SquarePolynomialVectors to make a multidimensional polynomial spline.
unsigned int getPointDimension() const
virtual void function(const double *point, double *value) const
unsigned int getValueDimension() const
PPSolveFactory solves the system of linear equations to interpolate from a grid of points using highe...
PolynomialPatch * solve()