33#include <numpy/arrayobject.h>
44
55/* Include atom bindings */
6- #include "atoms/variable .h"
6+ #include "atoms/add .h"
77#include "atoms/constant.h"
8+ #include "atoms/exp.h"
89#include "atoms/linear.h"
910#include "atoms/log.h"
10- #include "atoms/exp.h"
11- #include "atoms/add.h"
12- #include "atoms/sum.h"
1311#include "atoms/neg.h"
1412#include "atoms/promote.h"
13+ #include "atoms/sum.h"
14+ #include "atoms/variable.h"
1515
1616/* Include problem bindings */
17- #include "problem/make_problem.h"
18- #include "problem/init_derivatives.h"
19- #include "problem/objective_forward.h"
2017#include "problem/constraint_forward.h"
2118#include "problem/gradient.h"
19+ #include "problem/init_derivatives.h"
2220#include "problem/jacobian.h"
21+ #include "problem/make_problem.h"
22+ #include "problem/objective_forward.h"
2323
2424static int numpy_initialized = 0 ;
2525
@@ -41,12 +41,18 @@ static PyMethodDef DNLPMethods[] = {
4141 {"make_sum" , py_make_sum , METH_VARARGS , "Create sum node" },
4242 {"make_neg" , py_make_neg , METH_VARARGS , "Create neg node" },
4343 {"make_promote" , py_make_promote , METH_VARARGS , "Create promote node" },
44- {"make_problem" , py_make_problem , METH_VARARGS , "Create problem from objective and constraints" },
45- {"problem_init_derivatives" , py_problem_init_derivatives , METH_VARARGS , "Initialize derivative structures" },
46- {"problem_objective_forward" , py_problem_objective_forward , METH_VARARGS , "Evaluate objective only" },
47- {"problem_constraint_forward" , py_problem_constraint_forward , METH_VARARGS , "Evaluate constraints only" },
48- {"problem_gradient" , py_problem_gradient , METH_VARARGS , "Compute objective gradient" },
49- {"problem_jacobian" , py_problem_jacobian , METH_VARARGS , "Compute constraint jacobian" },
44+ {"make_problem" , py_make_problem , METH_VARARGS ,
45+ "Create problem from objective and constraints" },
46+ {"problem_init_derivatives" , py_problem_init_derivatives , METH_VARARGS ,
47+ "Initialize derivative structures" },
48+ {"problem_objective_forward" , py_problem_objective_forward , METH_VARARGS ,
49+ "Evaluate objective only" },
50+ {"problem_constraint_forward" , py_problem_constraint_forward , METH_VARARGS ,
51+ "Evaluate constraints only" },
52+ {"problem_gradient" , py_problem_gradient , METH_VARARGS ,
53+ "Compute objective gradient" },
54+ {"problem_jacobian" , py_problem_jacobian , METH_VARARGS ,
55+ "Compute constraint jacobian" },
5056 {NULL , NULL , 0 , NULL }};
5157
5258static struct PyModuleDef dnlp_module = {PyModuleDef_HEAD_INIT , "DNLP_diff_engine" ,
0 commit comments