44 #ifndef ROL_AUGMENTEDLAGRANGIANSTEP_H 45 #define ROL_AUGMENTEDLAGRANGIANSTEP_H 58 #include "Teuchos_ParameterList.hpp" 71 Teuchos::RCP<Algorithm<Real> >
algo_;
72 Teuchos::RCP<Vector<Real> >
x_;
105 Real gnorm = 0., tol = std::sqrt(ROL_EPSILON<Real>());
135 Real one(1), p1(0.1), p9(0.9), ten(1.e1), oe8(1.e8), oem8(1.e-8);
136 Teuchos::ParameterList& sublist = parlist.sublist(
"Step").sublist(
"Augmented Lagrangian");
142 penaltyUpdate_ = sublist.get(
"Penalty Parameter Growth Factor", ten);
153 print_ = sublist.get(
"Print Intermediate Optimization History",
false);
154 maxit_ = sublist.get(
"Subproblem Iteration Limit", 1000);
155 subStep_ = sublist.get(
"Subproblem Step Type",
"Trust Region");
172 state->descentVec = x.
clone();
173 state->gradientVec = g.
clone();
174 state->constraintVec = c.
clone();
178 algo_state.
nfval = 0;
179 algo_state.
ncval = 0;
180 algo_state.
ngrad = 0;
191 algo_state.
cnorm = (state->constraintVec)->norm();
197 Real one(1), TOL(1.e-2);
234 Real one(1), oem2(1.e-2);
241 state->descentVec->set(s);
248 algo_state.
cnorm = (state->constraintVec)->norm();
261 l.
axpy(state->searchSize,(state->constraintVec)->dual());
267 algo_state.
snorm += state->searchSize*algo_state.
cnorm;
277 augLag.
reset(l,state->searchSize);
283 std::stringstream hist;
285 hist << std::setw(6) << std::left <<
"iter";
286 hist << std::setw(15) << std::left <<
"fval";
287 hist << std::setw(15) << std::left <<
"cnorm";
288 hist << std::setw(15) << std::left <<
"gLnorm";
289 hist << std::setw(15) << std::left <<
"snorm";
290 hist << std::setw(10) << std::left <<
"penalty";
291 hist << std::setw(10) << std::left <<
"feasTol";
292 hist << std::setw(10) << std::left <<
"optTol";
293 hist << std::setw(8) << std::left <<
"#fval";
294 hist << std::setw(8) << std::left <<
"#grad";
295 hist << std::setw(8) << std::left <<
"#cval";
296 hist << std::setw(8) << std::left <<
"subIter";
304 std::stringstream hist;
305 hist <<
"\n" <<
" Augmented Lagrangian solver";
313 std::stringstream hist;
314 hist << std::scientific << std::setprecision(6);
315 if ( algo_state.
iter == 0 ) {
321 if ( algo_state.
iter == 0 ) {
323 hist << std::setw(6) << std::left << algo_state.
iter;
324 hist << std::setw(15) << std::left << algo_state.
value;
325 hist << std::setw(15) << std::left << algo_state.
cnorm;
326 hist << std::setw(15) << std::left << algo_state.
gnorm;
327 hist << std::setw(15) << std::left <<
" ";
328 hist << std::scientific << std::setprecision(2);
329 hist << std::setw(10) << std::left << Step<Real>::getStepState()->searchSize;
336 hist << std::setw(6) << std::left << algo_state.
iter;
337 hist << std::setw(15) << std::left << algo_state.
value;
338 hist << std::setw(15) << std::left << algo_state.
cnorm;
339 hist << std::setw(15) << std::left << algo_state.
gnorm;
340 hist << std::setw(15) << std::left << algo_state.
snorm;
341 hist << std::scientific << std::setprecision(2);
342 hist << std::setw(10) << std::left << Step<Real>::getStepState()->searchSize;
345 hist << std::scientific << std::setprecision(6);
346 hist << std::setw(8) << std::left << algo_state.
nfval;
347 hist << std::setw(8) << std::left << algo_state.
ngrad;
348 hist << std::setw(8) << std::left << algo_state.
ncval;
Real feasDecreaseExponent_
void initialize(Vector< Real > &x, const Vector< Real > &g, Vector< Real > &l, const Vector< Real > &c, Objective< Real > &obj, EqualityConstraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Initialize step with equality constraint.
Provides the interface to evaluate objective functions.
Provides the interface to evaluate the augmented Lagrangian.
virtual void scale(const Real alpha)=0
Compute where .
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Provides the interface to compute optimization steps.
Real feasIncreaseExponent_
Real feasToleranceInitial_
Teuchos::RCP< StepState< Real > > getState(void)
Contains definitions of custom data types in ROL.
Teuchos::RCP< Algorithm< Real > > algo_
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update bounds.
std::string printName(void) const
Print step name.
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual Real getObjectiveValue(const Vector< Real > &x)
Defines the linear algebra or vector space interface.
~AugmentedLagrangianStep()
Provides the interface to compute augmented Lagrangian steps.
Real computeGradient(Vector< Real > &g, const Vector< Real > &x, const Real mu, Objective< Real > &obj, BoundConstraint< Real > &bnd)
Real optIncreaseExponent_
virtual void reset(const Vector< Real > &multiplier, const Real penaltyParameter)
State for algorithm class. Will be used for restarts.
Teuchos::RCP< Vector< Real > > x_
bool isActivated(void)
Check if bounds are on.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Defines the equality constraint operator interface.
Real minPenaltyLowerBound_
virtual int getNumberFunctionEvaluations(void) const
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Provides an interface to run optimization algorithms.
AugmentedLagrangianStep(Teuchos::ParameterList &parlist)
Real optDecreaseExponent_
Real minPenaltyReciprocal_
virtual void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
void compute(Vector< Real > &s, const Vector< Real > &x, const Vector< Real > &l, Objective< Real > &obj, EqualityConstraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Compute step (equality and bound constraints).
Real optToleranceInitial_
Provides the interface to apply upper and lower bound constraints.
virtual int getNumberConstraintEvaluations(void) const
Teuchos::RCP< Vector< Real > > lagmultVec
std::string printHeader(void) const
Print iterate header.
virtual int getNumberGradientEvaluations(void) const
Teuchos::RCP< Vector< Real > > iterateVec
virtual void set(const Vector &x)
Set where .
virtual Real norm() const =0
Returns where .
virtual void getConstraintVec(Vector< Real > &c, const Vector< Real > &x)
void update(Vector< Real > &x, Vector< Real > &l, const Vector< Real > &s, Objective< Real > &obj, EqualityConstraint< Real > &con, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Update step, if successful (equality and bound constraints).
void update(Vector< Real > &x, const Vector< Real > &s, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Update step, for bound constraints; here only to satisfy the interface requirements, does nothing, needs refactoring.
virtual void project(Vector< Real > &x)
Project optimization variables onto the bounds.
Teuchos::ParameterList parlist_
void compute(Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &con, AlgorithmState< Real > &algo_state)
Compute step for bound constraints; here only to satisfy the interface requirements, does nothing, needs refactoring.
std::string print(AlgorithmState< Real > &algo_state, bool pHeader=false) const
Print iterate status.