2323
2424namespace gtsam {
2525
26- // / Parameters for Augmented Lagrangian method
26+ // / Parameters for the bound-constrained augmented Lagrangian outer loop.
2727class GTSAM_EXPORT BoundConstrainedLagrangianParams
2828 : public AugmentedLagrangianParams {
2929 public:
3030 using Base = AugmentedLagrangianParams;
3131 using This = BoundConstrainedLagrangianParams;
3232 using shared_ptr = std::shared_ptr<BoundConstrainedLagrangianParams>;
3333
34- double k = 2 ; // mu increase rate factor
34+ // / Multiplicative factor used to increase the equality penalty `muEq`
35+ // / when the iterate is not yet feasible enough for a multiplier update.
36+ double k = 2 ;
37+
38+ // / Exponent used in the BCL threshold update
39+ // / `eta_{k+1} = eta_k / mu_k^alpha` after an accepted multiplier step.
3540 double alpha = 0.5 ;
41+
42+ // / Initial feasibility threshold for the equality-constraint violation.
3643 double eta0 = 1.0 ;
44+
45+ // / Initial stationarity threshold for the cost-gradient infinity norm.
3746 double omega0 = 1.0 ;
47+
48+ // / Stop when feasibility threshold `eta` has been reduced below this value.
3849 double eta_threshold = 1e-3 ;
50+
51+ // / Stop when threshold `omega` has been reduced below this value.
3952 double omega_threshold = 1e-3 ;
4053
4154 BoundConstrainedLagrangianParams () {
@@ -57,6 +70,9 @@ class GTSAM_EXPORT BoundConstrainedLagrangianState
5770 using Base::Base;
5871};
5972
73+ /* *
74+ * Augmented Lagrangian method with BCL globalization strategy
75+ */
6076class GTSAM_EXPORT BoundConstrainedLagrangian : public ConstrainedOptimizer {
6177 public:
6278 using Base = ConstrainedOptimizer;
@@ -72,42 +88,40 @@ class GTSAM_EXPORT BoundConstrainedLagrangian : public ConstrainedOptimizer {
7288 mutable Progress progress_;
7389
7490 public:
75- /* * Constructor. */
91+ // / Constructor.
7692 BoundConstrainedLagrangian (const ConstrainedOptProblem& problem,
7793 const Values& initialValues,
7894 Params::shared_ptr p = std::make_shared<Params>())
7995 : Base(problem, initialValues), p_(p) {}
8096
81- /* * Solve one step of optimization, updating multipliers and parameters. */
97+ // / Solve one step of optimization, updating multipliers and parameters.
8298 State iterate(const State& state) const ;
8399
84- /* * Run optimization for the bound-constrained problem and return the result. */
100+ // / Run optimization for the bound-constrained problem and return the result.
85101 Values optimize () const override ;
86102
87- /* * Return progress of iterations as a read-only sequence of states. */
103+ // / Return progress of iterations as a read-only sequence of states.
88104 const Progress& progress () const { return progress_; }
89105
90106 protected:
91- /* * Create an unconstrained optimizer that solves the augmented Lagrangian. */
107+ // / Create an unconstrained optimizer that solves the augmented Lagrangian.
92108 SharedOptimizer createUnconstrainedOptimizer (
93109 const NonlinearFactorGraph& graph, const Values& values) const ;
94110
95- /* * Update the Lagrange multipliers using dual ascent. */
111+ // / Update the Lagrange multipliers using dual ascent.
96112 void updateMultipliers (const State& prev_state, State* state) const ;
97113
98- /* * Build the augmented Lagrangian factor graph for the given state. */
114+ // / Build the augmented Lagrangian factor graph for the given state.
99115 NonlinearFactorGraph augmentedLagrangianFunction (
100116 const State& state, const double epsilon = 1.0 ) const ;
101117
102- /* * Store and log the initial state of the optimization. */
118+ // / Store and log the initial state of the optimization.
103119 void logInitialState (const State& state) const ;
104120
105- /* * Store and log the state after an iteration of the optimization. */
121+ // / Store and log the state after an iteration of the optimization.
106122 void logIteration (const State& state) const ;
107123
108- /* *
109- * Customized convergence check for bound-constrained optimization.
110- */
124+ // / Customized convergence check for bound-constrained optimization.
111125 bool checkConvergenceBC (const State& state, const State& previousState,
112126 const Params& params) const ;
113127};
0 commit comments