1 #include "AllClassWrappers.h"
3 #include <pybind11/pybind11.h>
4 #include <pybind11/stl.h>
5 #include <pybind11/eigen.h>
6 #include <pybind11/iostream.h>
21 py::class_<CostFunction, ModPiece, std::shared_ptr<CostFunction> > cost(m,
"CostFunction");
23 .def(
"Cost", (
double (
CostFunction::*)()) &CostFunction::Cost)
24 .def(
"Cost", (
double (
CostFunction::*)(Eigen::VectorXd
const&)) &CostFunction::Cost)
25 .def(
"Gradient", (Eigen::VectorXd (
CostFunction::*)()) &CostFunction::Gradient)
26 .def(
"Gradient", (Eigen::VectorXd (
CostFunction::*)(Eigen::VectorXd
const&)) &CostFunction::Gradient)
27 .def(
"ApplyHessian", (Eigen::VectorXd (
CostFunction::*)(Eigen::VectorXd
const&)) &CostFunction::ApplyHessian)
28 .def(
"ApplyHessian", (Eigen::VectorXd (
CostFunction::*)(Eigen::VectorXd
const&, Eigen::VectorXd
const&)) &CostFunction::ApplyHessian)
29 .def(
"Hessian", (Eigen::MatrixXd (
CostFunction::*)()) &CostFunction::Hessian)
30 .def(
"Hessian", (Eigen::MatrixXd (
CostFunction::*)(Eigen::VectorXd
const&)) &CostFunction::Hessian);
32 py::class_<ModPieceCostFunction, CostFunction, std::shared_ptr<ModPieceCostFunction> > modCost(m,
"ModPieceCostFunction");
34 .def(py::init<std::shared_ptr<ModPiece>>())
35 .def(py::init<std::shared_ptr<ModPiece>,
double>());
The cost function for an optimization routine.
void CostFunctionWrapper(pybind11::module &m)