Skip to content

Commit

Permalink
[pybind] split solvers_py_mathematicalprogram. (RobotLocomotion#19791)
Browse files Browse the repository at this point in the history
Put the Evaluator/Cost/Constraint/Binding into solvers_py_evaluator.cc
  • Loading branch information
hongkai-dai authored Jul 18, 2023
1 parent 0cb0137 commit 3a571a4
Show file tree
Hide file tree
Showing 7 changed files with 843 additions and 770 deletions.
9 changes: 9 additions & 0 deletions bindings/pydrake/solvers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ drake_pybind_library(
"solvers_py_branch_and_bound.cc",
"solvers_py_clp.cc",
"solvers_py_csdp.cc",
"solvers_py_evaluators.cc",
"solvers_py_gurobi.cc",
"solvers_py_ipopt.cc",
"solvers_py_mathematicalprogram.cc",
Expand Down Expand Up @@ -233,6 +234,14 @@ drake_py_unittest(
],
)

drake_py_unittest(
name = "evaluators_test",
deps = [
":solvers",
"//bindings/pydrake/common/test_utilities:scipy_stub_py",
],
)

drake_py_unittest(
name = "branch_and_bound_test",
deps = [
Expand Down
1 change: 1 addition & 0 deletions bindings/pydrake/solvers/solvers_py.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ top-level documentation for :py:mod:`pydrake.math`.
py::module::import("pydrake.symbolic");

// The order of these calls matters. Some modules rely on prior definitions.
internal::DefineSolversEvaluators(m);
internal::DefineSolversMathematicalProgram(m);
internal::DefineSolversAugmentedLagrangian(m);
internal::DefineSolversBranchAndBound(m);
Expand Down
3 changes: 3 additions & 0 deletions bindings/pydrake/solvers/solvers_py.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ void DefineSolversClp(py::module m);
/* Defines the CSDP bindings. See solvers_py_csdp.cc. */
void DefineSolversCsdp(py::module m);

/* Defines the evaluators. See solvers_py_evaluator.cc. */
void DefineSolversEvaluators(py::module m);

/* Defines the GUROBI bindings. See solvers_py_gurobi.cc. */
void DefineSolversGurobi(py::module m);

Expand Down
Loading

0 comments on commit 3a571a4

Please sign in to comment.