30 template <
typename PyClass>
void visit(PyClass &obj)
const {
31 using proxsuite::nlp::deprecation_warning_policy;
32 using proxsuite::nlp::DeprecationType;
33 obj.def_readwrite(
"verbose", &SolverType::verbose_,
34 "Verbosity level of the solver.")
35 .def_readwrite(
"max_iters", &SolverType::max_iters,
36 "Maximum number of iterations.")
37 .def_readwrite(
"ls_params", &SolverType::ls_params,
38 "Linesearch parameters.")
39 .def_readwrite(
"target_tol", &SolverType::target_tol_,
41 .def_readwrite(
"reg_init", &SolverType::reg_init)
42 .def_readwrite(
"force_initial_condition",
43 &SolverType::force_initial_condition_,
44 "Set x0 to be fixed to the initial condition.")
45 .add_property(
"num_threads", &SolverType::getNumThreads)
46 .def(
"setNumThreads", &SolverType::setNumThreads,
47 (
"self"_a,
"num_threads"))
48 .def(
"getResults", &SolverType::getResults, (
"self"_a),
49 deprecation_warning_policy<DeprecationType::DEPRECATION,
50 bp::return_internal_reference<>>(
51 "This getter is deprecated. Access the results using "
52 "`solver.results` instead."),
53 "Get the results instance.")
54 .def(
"getWorkspace", &SolverType::getWorkspace, (
"self"_a),
55 deprecation_warning_policy<DeprecationType::DEPRECATION,
56 bp::return_internal_reference<>>(
57 "This getter is deprecated. Access the workspace using "
58 "`solver.workspace` instead."),
59 "Get the workspace instance.")
60 .def_readonly(
"results", &SolverType::results_,
"Solver results.")
61 .def_readonly(
"workspace", &SolverType::workspace_,
"Solver workspace.")
62 .def(
"setup", &SolverType::setup, (
"self"_a,
"problem"),
63 "Allocate solver workspace and results data for the problem.")
64 .def(
"registerCallback", &SolverType::registerCallback,
65 (
"self"_a,
"name",
"cb"),
"Add a callback to the solver.")
66 .def(
"removeCallback", &SolverType::removeCallback, (
"self"_a,
"key"),
69 .def(
"clearCallbacks", &SolverType::clearCallbacks, (
"self"_a),