#include <proxsuite-nlp/prox-solver.hpp>
Public Types | |
| using | Scalar = _Scalar |
| using | Problem = ProblemTpl<Scalar> |
| using | Workspace = WorkspaceTpl<Scalar> |
| using | Results = ResultsTpl<Scalar> |
| using | Manifold = ManifoldAbstractTpl<Scalar> |
| using | LinesearchOptions = typename Linesearch<Scalar>::Options |
| using | CallbackPtr = shared_ptr<helpers::base_callback<Scalar>> |
| using | ConstraintSet = ConstraintSetTpl<Scalar> |
| using | ConstraintObject = ConstraintObjectTpl<Scalar> |
| using | BFGS = BFGSStrategy<Scalar, BFGSType::Hessian> |
Public Member Functions | |
| ProxNLPSolverTpl (Problem &prob, const Scalar tol=1e-6, const Scalar mu_eq_init=1e-2, const Scalar rho_init=0., const VerboseLevel verbose=QUIET, const Scalar mu_lower=1e-9, const Scalar prim_alpha=0.1, const Scalar prim_beta=0.9, const Scalar dual_alpha=1., const Scalar dual_beta=1., LDLTChoice ldlt_blocked=LDLTChoice::BUNCHKAUFMAN, const LinesearchOptions ls_options=LinesearchOptions()) | |
| const Problem & | problem () const |
| const Manifold & | manifold () const |
| void | setup () |
| ConvergenceFlag | solve (const ConstVectorRef &x0, const std::vector< VectorRef > &lams0) |
| Solve the problem. | |
| PROXSUITE_NLP_DEPRECATED const Workspace & | getWorkspace () const |
| PROXSUITE_NLP_DEPRECATED const Results & | getResults () const |
| ConvergenceFlag | solve (const ConstVectorRef &x0, const ConstVectorRef &lams0=VectorXs(0)) |
| Solve the problem. | |
| void | innerLoop (Workspace &workspace, Results &results) |
| void | assembleKktMatrix (Workspace &workspace) |
| PROXSUITE_NLP_INLINE bool | iterativeRefinement (Workspace &workspace) const |
| Iterative refinement of the KKT linear system. | |
| void | updatePenalty () |
| void | setDualPenalty (const Scalar beta) |
| Set the dual penalty weight for the merit function. | |
| void | setPenalty (const Scalar &new_mu) noexcept |
| Set penalty parameter, its inverse and update the merit function. | |
| void | setProxParameter (const Scalar &new_rho) noexcept |
| Set proximal penalty parameter. | |
| void | registerCallback (const CallbackPtr &cb) noexcept |
| Add a callback to the solver instance. | |
| void | clearCallbacks () noexcept |
| Remove all callbacks from the instance. | |
| void | updateToleranceFailure () noexcept |
| Update primal-dual subproblem tolerances upon failure (insufficient primal feasibility) | |
| void | updateToleranceSuccess () noexcept |
| Update primal-dual subproblem tolerances upon successful outer-loop iterate (good primal feasibility) | |
| void | tolerancePostUpdate () noexcept |
| void | acceptMultipliers (Results &results, Workspace &workspace) const |
| Accept Lagrange multiplier estimates. | |
| void | computeMultipliers (const ConstVectorRef &inner_lams_data, Workspace &workspace) const |
| void | computeProblemDerivatives (const ConstVectorRef &x, Workspace &workspace, boost::mpl::false_) const |
| void | computeProblemDerivatives (const ConstVectorRef &x, Workspace &workspace, boost::mpl::true_) const |
| void | computePrimalResiduals (Workspace &workspace, Results &results) const |
| void | tryStep (Workspace &workspace, const Results &results, Scalar alpha) |
| void | invokeCallbacks (Workspace &workspace, Results &results) |
Public Attributes | |
| Scalar | |
| ALMeritFunctionTpl< Scalar > | merit_fun |
| Merit function. | |
| QuadraticDistanceCostTpl< Scalar > | prox_penalty |
| Proximal regularization penalty. | |
| VerboseLevel | verbose = QUIET |
| Level of verbosity of the solver. | |
| HessianApprox | hess_approx = HessianApprox::GAUSS_NEWTON |
| Use a Gauss-Newton approximation for the Lagrangian Hessian. | |
| LinesearchStrategy | ls_strat = LinesearchStrategy::ARMIJO |
| Linesearch strategy. | |
| MultiplierUpdateMode | mul_update_mode = MultiplierUpdateMode::NEWTON |
| BFGS | bfgs_strategy_ |
| std::size_t | max_refinement_steps_ = 5 |
| linear algebra opts | |
| Scalar | kkt_tolerance_ = 1e-13 |
| LDLTChoice | ldlt_choice_ |
| KktSystem | kkt_system_ = KKT_CLASSIC |
| Scalar | inner_tol0 = 1. |
| Scalar | prim_tol0 = 1. |
| Scalar | inner_tol_ = inner_tol0 |
| Scalar | prim_tol_ = prim_tol0 |
| Scalar | rho_init_ |
| Scalar | mu_init_ |
| Scalar | inner_tol_min = 1e-9 |
| Scalar | mu_upper_ = 1. |
| Scalar | mu_lower_ = 1e-9 |
| Scalar | pdal_beta_ = 0.5 |
| BCLParamsTpl< Scalar > | bcl_params |
| BCL strategy parameters. | |
| LinesearchOptions | ls_options |
| Linesearch options. | |
| Scalar | target_tol |
| Target tolerance for the problem. | |
| BaseLogger | logger {} |
| Logger. | |
| Scalar | del_inc_k = 8. |
| Scalar | del_inc_big = 100. |
| Scalar | del_dec_k = 1. / 3. |
| Scalar | DELTA_MIN = 1e-14 |
| Scalar | DELTA_MAX = 1e6 |
| Scalar | DELTA_NONZERO_INIT = 1e-4 |
| Scalar | DELTA_INIT = 0. |
| std::size_t | max_iters = 100 |
| std::size_t | max_al_iters = 1000 |
| std::vector< CallbackPtr > | callbacks_ |
| Callbacks. | |
| unique_ptr< Workspace > | workspace_ |
| unique_ptr< Results > | results_ |
Protected Attributes | |
| Problem * | problem_ |
| General nonlinear program to solve. | |
Semi-smooth Newton-based solver for nonlinear optimization using a primal-dual method of multipliers. This solver works by approximately solving the proximal subproblems in the method of multipliers.
Definition at line 45 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::Scalar = _Scalar |
Definition at line 47 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::Problem = ProblemTpl<Scalar> |
Definition at line 49 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::Workspace = WorkspaceTpl<Scalar> |
Definition at line 50 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::Results = ResultsTpl<Scalar> |
Definition at line 51 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::Manifold = ManifoldAbstractTpl<Scalar> |
Definition at line 52 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::LinesearchOptions = typename Linesearch<Scalar>::Options |
Definition at line 53 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::CallbackPtr = shared_ptr<helpers::base_callback<Scalar>> |
Definition at line 54 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::ConstraintSet = ConstraintSetTpl<Scalar> |
Definition at line 55 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::ConstraintObject = ConstraintObjectTpl<Scalar> |
Definition at line 56 of file prox-solver.hpp.
| using proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::BFGS = BFGSStrategy<Scalar, BFGSType::Hessian> |
Definition at line 57 of file prox-solver.hpp.
| proxsuite::nlp::ProxNLPSolverTpl< Scalar >::ProxNLPSolverTpl | ( | Problem & | prob, |
| const Scalar | tol = 1e-6, | ||
| const Scalar | mu_eq_init = 1e-2, | ||
| const Scalar | rho_init = 0., | ||
| const VerboseLevel | verbose = QUIET, | ||
| const Scalar | mu_lower = 1e-9, | ||
| const Scalar | prim_alpha = 0.1, | ||
| const Scalar | prim_beta = 0.9, | ||
| const Scalar | dual_alpha = 1., | ||
| const Scalar | dual_beta = 1., | ||
| LDLTChoice | ldlt_blocked = LDLTChoice::BUNCHKAUFMAN, | ||
| const LinesearchOptions | ls_options = LinesearchOptions() ) |
Definition at line 16 of file prox-solver.hxx.
|
inline |
Definition at line 143 of file prox-solver.hpp.
|
inline |
Definition at line 145 of file prox-solver.hpp.
|
inline |
Definition at line 147 of file prox-solver.hpp.
| ConvergenceFlag proxsuite::nlp::ProxNLPSolverTpl< Scalar >::solve | ( | const ConstVectorRef & | x0, |
| const std::vector< VectorRef > & | lams0 ) |
Solve the problem.
| x0 | Initial guess. |
| lams0 | Initial Lagrange multipliers given separately for each constraint. |
Definition at line 33 of file prox-solver.hxx.
|
inline |
Definition at line 177 of file prox-solver.hpp.
|
inline |
Definition at line 179 of file prox-solver.hpp.
| ConvergenceFlag proxsuite::nlp::ProxNLPSolverTpl< Scalar >::solve | ( | const ConstVectorRef & | x0, |
| const ConstVectorRef & | lams0 = VectorXs(0) ) |
Solve the problem.
| x0 | Initial guess. |
| lams0 | Initial Lagrange multipliers given separately for each constraint. |
Definition at line 52 of file prox-solver.hxx.
| void proxsuite::nlp::ProxNLPSolverTpl< Scalar >::innerLoop | ( | Workspace & | workspace, |
| Results & | results ) |
Definition at line 279 of file prox-solver.hxx.
| void proxsuite::nlp::ProxNLPSolverTpl< Scalar >::assembleKktMatrix | ( | Workspace & | workspace | ) |
Definition at line 491 of file prox-solver.hxx.
| bool proxsuite::nlp::ProxNLPSolverTpl< Scalar >::iterativeRefinement | ( | Workspace & | workspace | ) | const |
Iterative refinement of the KKT linear system.
Definition at line 529 of file prox-solver.hxx.
|
inline |
Update penalty parameter using the provided factor (with a safeguard ProxNLPSolverTpl::mu_lower).
Definition at line 270 of file prox-solver.hxx.
|
inline |
Set the dual penalty weight for the merit function.
Definition at line 204 of file prox-solver.hpp.
|
noexcept |
Set penalty parameter, its inverse and update the merit function.
| new_mu | The new penalty parameter. |
Definition at line 547 of file prox-solver.hxx.
|
noexcept |
Set proximal penalty parameter.
Definition at line 557 of file prox-solver.hxx.
|
inlinenoexcept |
Add a callback to the solver instance.
Definition at line 214 of file prox-solver.hpp.
|
inlinenoexcept |
Remove all callbacks from the instance.
Definition at line 219 of file prox-solver.hpp.
|
noexcept |
Update primal-dual subproblem tolerances upon failure (insufficient primal feasibility)
This is called upon initialization of the solver.
Definition at line 565 of file prox-solver.hxx.
|
noexcept |
Update primal-dual subproblem tolerances upon successful outer-loop iterate (good primal feasibility)
Definition at line 572 of file prox-solver.hxx.
|
inlinenoexcept |
Definition at line 579 of file prox-solver.hxx.
| void proxsuite::nlp::ProxNLPSolverTpl< Scalar >::acceptMultipliers | ( | Results & | results, |
| Workspace & | workspace ) const |
Accept Lagrange multiplier estimates.
Definition at line 151 of file prox-solver.hxx.
| void proxsuite::nlp::ProxNLPSolverTpl< Scalar >::computeMultipliers | ( | const ConstVectorRef & | inner_lams_data, |
| Workspace & | workspace ) const |
Evaluate the problem data, as well as the proximal/projection operators, and the first-order & primal-dual multiplier estimates.
| inner_lams_data | Inner (SQP) dual variables |
| workspace | Problem workspace. |
Definition at line 170 of file prox-solver.hxx.
| void proxsuite::nlp::ProxNLPSolverTpl< Scalar >::computeProblemDerivatives | ( | const ConstVectorRef & | x, |
| Workspace & | workspace, | ||
| boost::mpl::false_ | ) const |
Evaluate the derivatives (cost gradient, Hessian, constraint Jacobians, vector-Hessian products) of the problem data.
| x | Primal variable |
| workspace | Problem workspace. |
| second_order | Whether to compute the second-order information; set to false for e.g. linesearch. |
Definition at line 208 of file prox-solver.hxx.
| void proxsuite::nlp::ProxNLPSolverTpl< Scalar >::computeProblemDerivatives | ( | const ConstVectorRef & | x, |
| Workspace & | workspace, | ||
| boost::mpl::true_ | ) const |
Evaluate the derivatives (cost gradient, Hessian, constraint Jacobians, vector-Hessian products) of the problem data.
| x | Primal variable |
| workspace | Problem workspace. |
| second_order | Whether to compute the second-order information; set to false for e.g. linesearch. |
Definition at line 229 of file prox-solver.hxx.
| void proxsuite::nlp::ProxNLPSolverTpl< Scalar >::computePrimalResiduals | ( | Workspace & | workspace, |
| Results & | results ) const |
Compute the primal residuals at the current primal-dual pair \((x, \lambda^+)\), where the multipliers are chosen to be the predicted next ALM iterate.
Definition at line 251 of file prox-solver.hxx.
| void proxsuite::nlp::ProxNLPSolverTpl< Scalar >::tryStep | ( | Workspace & | workspace, |
| const Results & | results, | ||
| Scalar | alpha ) |
Take a trial step.
| workspace | Workspace |
| results | Contains the previous primal-dual point |
| alpha | Step size |
Definition at line 585 of file prox-solver.hxx.
|
inline |
Definition at line 282 of file prox-solver.hpp.
| proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::Scalar |
Definition at line 48 of file prox-solver.hpp.
|
protected |
General nonlinear program to solve.
Definition at line 61 of file prox-solver.hpp.
| ALMeritFunctionTpl<Scalar> proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::merit_fun |
Merit function.
Definition at line 65 of file prox-solver.hpp.
| QuadraticDistanceCostTpl<Scalar> proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::prox_penalty |
Proximal regularization penalty.
Definition at line 67 of file prox-solver.hpp.
| VerboseLevel proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::verbose = QUIET |
Level of verbosity of the solver.
Definition at line 70 of file prox-solver.hpp.
| HessianApprox proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::hess_approx = HessianApprox::GAUSS_NEWTON |
Use a Gauss-Newton approximation for the Lagrangian Hessian.
Definition at line 72 of file prox-solver.hpp.
| LinesearchStrategy proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::ls_strat = LinesearchStrategy::ARMIJO |
Linesearch strategy.
Definition at line 74 of file prox-solver.hpp.
| MultiplierUpdateMode proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::mul_update_mode = MultiplierUpdateMode::NEWTON |
Definition at line 75 of file prox-solver.hpp.
|
mutable |
Definition at line 77 of file prox-solver.hpp.
| std::size_t proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::max_refinement_steps_ = 5 |
linear algebra opts
Definition at line 80 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::kkt_tolerance_ = 1e-13 |
Definition at line 81 of file prox-solver.hpp.
| LDLTChoice proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::ldlt_choice_ |
Definition at line 82 of file prox-solver.hpp.
| KktSystem proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::kkt_system_ = KKT_CLASSIC |
Definition at line 83 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::inner_tol0 = 1. |
Definition at line 87 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::prim_tol0 = 1. |
Definition at line 88 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::inner_tol_ = inner_tol0 |
Definition at line 89 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::prim_tol_ = prim_tol0 |
Definition at line 90 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::rho_init_ |
Definition at line 91 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::mu_init_ |
Definition at line 92 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::inner_tol_min = 1e-9 |
Definition at line 98 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::mu_upper_ = 1. |
Definition at line 99 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::mu_lower_ = 1e-9 |
Definition at line 100 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::pdal_beta_ = 0.5 |
Definition at line 101 of file prox-solver.hpp.
| BCLParamsTpl<Scalar> proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::bcl_params |
BCL strategy parameters.
Definition at line 104 of file prox-solver.hpp.
| LinesearchOptions proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::ls_options |
Linesearch options.
Definition at line 107 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::target_tol |
Target tolerance for the problem.
Definition at line 110 of file prox-solver.hpp.
| BaseLogger proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::logger {} |
Logger.
Definition at line 113 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::del_inc_k = 8. |
Definition at line 117 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::del_inc_big = 100. |
Definition at line 118 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::del_dec_k = 1. / 3. |
Definition at line 119 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::DELTA_MIN = 1e-14 |
Definition at line 120 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::DELTA_MAX = 1e6 |
Definition at line 121 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::DELTA_NONZERO_INIT = 1e-4 |
Definition at line 122 of file prox-solver.hpp.
| Scalar proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::DELTA_INIT = 0. |
Definition at line 123 of file prox-solver.hpp.
| std::size_t proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::max_iters = 100 |
Definition at line 125 of file prox-solver.hpp.
| std::size_t proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::max_al_iters = 1000 |
Definition at line 126 of file prox-solver.hpp.
| std::vector<CallbackPtr> proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::callbacks_ |
Callbacks.
Definition at line 129 of file prox-solver.hpp.
| unique_ptr<Workspace> proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::workspace_ |
Definition at line 131 of file prox-solver.hpp.
| unique_ptr<Results> proxsuite::nlp::ProxNLPSolverTpl< _Scalar >::results_ |
Definition at line 132 of file prox-solver.hpp.