ROL
ROL_TypeG_StabilizedLCLAlgorithm_Def.hpp
Go to the documentation of this file.
1 // @HEADER
2 // ************************************************************************
3 //
4 // Rapid Optimization Library (ROL) Package
5 // Copyright (2014) Sandia Corporation
6 //
7 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8 // license for use of this work by or on behalf of the U.S. Government.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are
12 // met:
13 //
14 // 1. Redistributions of source code must retain the above copyright
15 // notice, this list of conditions and the following disclaimer.
16 //
17 // 2. Redistributions in binary form must reproduce the above copyright
18 // notice, this list of conditions and the following disclaimer in the
19 // documentation and/or other materials provided with the distribution.
20 //
21 // 3. Neither the name of the Corporation nor the names of the
22 // contributors may be used to endorse or promote products derived from
23 // this software without specific prior written permission.
24 //
25 // THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30 // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31 // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32 // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33 // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34 // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35 // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 //
37 // Questions? Contact lead developers:
38 // Drew Kouri (dpkouri@sandia.gov) and
39 // Denis Ridzal (dridzal@sandia.gov)
40 //
41 // ************************************************************************
42 // @HEADER
43 
44 #ifndef ROL_TYPEG_STABILIZEDLCLALGORITHM_DEF_H
45 #define ROL_TYPEG_STABILIZEDLCLALGORITHM_DEF_H
46 
48 #include "ROL_Bounds.hpp"
49 
50 namespace ROL {
51 namespace TypeG {
52 
53 template<typename Real>
55  : TypeG::Algorithm<Real>::Algorithm(), list_(list), subproblemIter_(0) {
56  // Set status test
57  status_->reset();
58  status_->add(makePtr<ConstraintStatusTest<Real>>(list));
59 
60  Real one(1), p1(0.1), p9(0.9), ten(1.e1), oe8(1.e8), oem8(1.e-8);
61  ParameterList& sublist = list.sublist("Step").sublist("Stabilized LCL");
62  useDefaultInitPen_ = sublist.get("Use Default Initial Penalty Parameter", true);
63  state_->searchSize = sublist.get("Initial Penalty Parameter", ten);
64  sigma_ = sublist.get("Initial Elastic Penalty Parameter", ten*ten);
65  // Multiplier update parameters
66  scaleLagrangian_ = sublist.get("Use Scaled Stabilized LCL", false);
67  penaltyUpdate_ = sublist.get("Penalty Parameter Growth Factor", ten);
68  maxPenaltyParam_ = sublist.get("Maximum Penalty Parameter", oe8);
69  sigmaMax_ = sublist.get("Maximum Elastic Penalty Parameter", oe8);
70  sigmaUpdate_ = sublist.get("Elastic Penalty Parameter Growth Rate", ten);
71  // Optimality tolerance update
72  optIncreaseExponent_ = sublist.get("Optimality Tolerance Increase Exponent", one);
73  optDecreaseExponent_ = sublist.get("Optimality Tolerance Decrease Exponent", one);
74  optToleranceInitial_ = sublist.get("Initial Optimality Tolerance", one);
75  // Feasibility tolerance update
76  feasIncreaseExponent_ = sublist.get("Feasibility Tolerance Increase Exponent", p9);
77  feasDecreaseExponent_ = sublist.get("Feasibility Tolerance Decrease Exponent", p1);
78  feasToleranceInitial_ = sublist.get("Initial Feasibility Tolerance", one);
79  // Subproblem information
80  maxit_ = sublist.get("Subproblem Iteration Limit", 1000);
81  subStep_ = sublist.get("Subproblem Step Type", "Trust Region");
82  HessianApprox_ = sublist.get("Level of Hessian Approximation", 0);
83  list_.sublist("Step").set("Type",subStep_);
84  list_.sublist("Status Test").set("Iteration Limit",maxit_);
85  // Verbosity setting
86  verbosity_ = list.sublist("General").get("Output Level", 0);
88  bool print = verbosity_ > 2;
89  list_.sublist("General").set("Output Level",(print ? verbosity_ : 0));
90  // Outer iteration tolerances
91  outerFeasTolerance_ = list.sublist("Status Test").get("Constraint Tolerance", oem8);
92  outerOptTolerance_ = list.sublist("Status Test").get("Gradient Tolerance", oem8);
93  outerStepTolerance_ = list.sublist("Status Test").get("Step Tolerance", oem8);
94  // Scaling
95  useDefaultScaling_ = sublist.get("Use Default Problem Scaling", true);
96  fscale_ = sublist.get("Objective Scaling", one);
97  cscale_ = sublist.get("Constraint Scaling", one);
98 }
99 
100 template<typename Real>
102  const Vector<Real> &g,
103  const Vector<Real> &l,
104  const Vector<Real> &c,
105  ElasticObjective<Real> &alobj,
107  Constraint<Real> &con,
108  std::ostream &outStream ) {
109  hasPolyProj_ = true;
110  if (proj_ == nullPtr) {
111  proj_ = makePtr<PolyhedralProjection<Real>>(makePtrFromRef(bnd));
112  hasPolyProj_ = false;
113  }
114  proj_->project(x,outStream);
115 
116  const Real one(1), TOL(1.e-2);
117  Real tol = std::sqrt(ROL_EPSILON<Real>());
119 
120  // Initialize the algorithm state
121  state_->nfval = 0;
122  state_->ncval = 0;
123  state_->ngrad = 0;
124 
125  // Compute objective value
126  alobj.getAugmentedLagrangian()->update(x,UpdateType::Initial,state_->iter);
127  state_->value = alobj.getObjectiveValue(x,tol);
128  alobj.getAugmentedLagrangian()->gradient(*state_->gradientVec,x,tol);
129 
130  // Compute constraint violation
131  state_->constraintVec->set(*alobj.getConstraintVec(x,tol));
132  state_->cnorm = state_->constraintVec->norm();
133 
134  // Update evaluation counters
135  state_->ncval += alobj.getNumberConstraintEvaluations();
136  state_->nfval += alobj.getNumberFunctionEvaluations();
137  state_->ngrad += alobj.getNumberGradientEvaluations();
138 
139  // Compute problem scaling
140  if (useDefaultScaling_) {
141  fscale_ = one/std::max(one,alobj.getObjectiveGradient(x,tol)->norm());
142  try {
143  Ptr<Vector<Real>> ji = x.clone();
144  Real maxji(0), normji(0);
145  for (int i = 0; i < c.dimension(); ++i) {
146  con.applyAdjointJacobian(*ji,*c.basis(i),x,tol);
147  normji = ji->norm();
148  maxji = std::max(normji,maxji);
149  }
150  cscale_ = one/std::max(one,maxji);
151  }
152  catch (std::exception &e) {
153  cscale_ = one;
154  }
155  }
156  alobj.setScaling(fscale_,cscale_);
157 
158  // Compute gradient of the lagrangian
159  x.axpy(-one,state_->gradientVec->dual());
160  proj_->project(x,outStream);
161  x.axpy(-one/std::min(fscale_,cscale_),*state_->iterateVec);
162  state_->gnorm = x.norm();
163  x.set(*state_->iterateVec);
164 
165  // Compute initial penalty parameter
166  if (useDefaultInitPen_) {
167  const Real oem8(1e-8), oem2(1e-2), two(2), ten(10);
168  state_->searchSize = std::max(oem8,
169  std::min(ten*std::max(one,std::abs(fscale_*state_->value))
170  / std::max(one,std::pow(cscale_*state_->cnorm,two)),oem2*maxPenaltyParam_));
171  }
172  // Initialize intermediate stopping tolerances
173  optTolerance_ = std::max<Real>(TOL*outerOptTolerance_,
174  optToleranceInitial_);
175  //optTolerance_ = std::min<Real>(optTolerance_,TOL*state_->gnorm);
176  feasTolerance_ = std::max<Real>(TOL*outerFeasTolerance_,
177  feasToleranceInitial_);
178 
179  // Set data
180  alobj.reset(l,state_->searchSize,sigma_);
181 
182  if (verbosity_ > 1) {
183  outStream << std::endl;
184  outStream << "Stabilized LCL Initialize" << std::endl;
185  outStream << "Objective Scaling: " << fscale_ << std::endl;
186  outStream << "Constraint Scaling: " << cscale_ << std::endl;
187  outStream << "Penalty Parameter: " << state_->searchSize << std::endl;
188  outStream << std::endl;
189  }
190 }
191 
192 template<typename Real>
194  std::ostream &outStream ) {
195  if (problem.getProblemType() == TYPE_EB) {
196  problem.edit();
197  problem.finalize(true,verbosity_>3,outStream); // Lump linear and nonlinear constraints
198  run(*problem.getPrimalOptimizationVector(),
199  *problem.getDualOptimizationVector(),
200  *problem.getObjective(),
201  *problem.getBoundConstraint(),
202  *problem.getConstraint(),
203  *problem.getMultiplierVector(),
204  *problem.getResidualVector(),
205  outStream);
206  problem.finalizeIteration();
207  }
208  else {
209  throw Exception::NotImplemented(">>> ROL::TypeG::Algorithm::run : Optimization problem is not Type G!");
210  }
211 }
212 
213 template<typename Real>
215  const Vector<Real> &g,
216  Objective<Real> &obj,
218  Constraint<Real> &econ,
219  Vector<Real> &emul,
220  const Vector<Real> &eres,
221  std::ostream &outStream ) {
222  const Real one(1), oem2(1e-2);
223  Real tol(std::sqrt(ROL_EPSILON<Real>())), cnorm(0), lnorm;;
224  // Initialize augmented Lagrangian data
225  ElasticObjective<Real> alobj(makePtrFromRef(obj),makePtrFromRef(econ),
226  state_->searchSize,sigma_,g,eres,emul,
227  scaleLagrangian_,HessianApprox_);
228  initialize(x,g,emul,eres,alobj,bnd,econ,outStream);
229  // Define Elastic Subproblem
230  Ptr<Vector<Real>> u = eres.clone(), v = eres.clone(), c = eres.clone();
231  Ptr<Vector<Real>> gu = emul.clone(), gv = emul.clone(), l = emul.clone();
232  Ptr<Vector<Real>> s = x.clone(), gs = g.clone(), cvec = eres.clone();
233  Ptr<ElasticLinearConstraint<Real>> lcon
234  = makePtr<ElasticLinearConstraint<Real>>(makePtrFromRef(x),
235  makePtrFromRef(econ),
236  makePtrFromRef(eres));
237  std::vector<Ptr<Vector<Real>>> vecList = {s,u,v};
238  Ptr<PartitionedVector<Real>> xp = makePtr<PartitionedVector<Real>>(vecList);
239  Ptr<PartitionedVector<Real>> gxp = makePtr<PartitionedVector<Real>>({gs,gu,gv});
240  Ptr<Vector<Real>> lb = u->clone(); lb->zero();
241  std::vector<Ptr<BoundConstraint<Real>>> bndList(3);
242  bndList[0] = makePtrFromRef(bnd);
243  bndList[1] = makePtr<Bounds<Real>>(*lb,true);
244  bndList[2] = makePtr<Bounds<Real>>(*lb,true);
245  Ptr<BoundConstraint<Real>> xbnd
246  = makePtr<BoundConstraint_Partitioned<Real>>(bndList,vecList);
247  ParameterList ppa_list;
248  if (c->dimension() == 1)
249  ppa_list.sublist("General").sublist("Polyhedral Projection").set("Type","Dai-Fletcher");
250  else
251  ppa_list.sublist("General").sublist("Polyhedral Projection").set("Type","Semismooth Newton");
252  Problem<Real> elc(makePtrFromRef(alobj),xp,gxp);
253  elc.addBoundConstraint(xbnd);
254  elc.addLinearConstraint("ElasticLinearConstraint",lcon,l,c);
255  elc.setProjectionAlgorithm(ppa_list);
256  elc.finalize(false,verbosity_>2,outStream);
257 
258  // Initialize subproblem algorithm
259  Ptr<TypeB::Algorithm<Real>> algo;
260 
261  // Output
262  if (verbosity_ > 0) writeOutput(outStream,true);
263 
264  while (status_->check(*state_)) {
265  lcon->setAnchor(state_->iterateVec);
266  if (verbosity_ > 3) elc.check(true,outStream);
267 
268  // Solve linearly constrained augmented Lagrangian subproblem
269  list_.sublist("Status Test").set("Gradient Tolerance",optTolerance_);
270  list_.sublist("Status Test").set("Step Tolerance",1.e-6*optTolerance_);
271  algo = TypeB::AlgorithmFactory<Real>(list_);
272  algo->run(elc,outStream);
273  x.set(*xp->get(0));
274 
275  // Update evaluation counters
276  subproblemIter_ = algo->getState()->iter;
277  state_->nfval += alobj.getNumberFunctionEvaluations();
278  state_->ngrad += alobj.getNumberGradientEvaluations();
279  state_->ncval += alobj.getNumberConstraintEvaluations();
280 
281  // Compute step
282  state_->stepVec->set(x);
283  state_->stepVec->axpy(-one,*state_->iterateVec);
284  state_->snorm = state_->stepVec->norm();
285 
286  // Update iteration information
287  state_->iter++;
288  cvec->set(*alobj.getConstraintVec(x,tol));
289  cnorm = cvec->norm();
290  if ( cscale_*cnorm < feasTolerance_ ) {
291  // Update iteration information
292  state_->iterateVec->set(x);
293  state_->value = alobj.getObjectiveValue(x,tol);
294  state_->constraintVec->set(*cvec);
295  state_->cnorm = cnorm;
296 
297  // Update multipliers
298  emul.axpy(static_cast<Real>(-1),*elc.getPolyhedralProjection()->getMultiplier());
299  emul.axpy(state_->searchSize*cscale_,state_->constraintVec->dual());
300 
301  alobj.getAugmentedLagrangian()->gradient(*state_->gradientVec,x,tol);
302  if (scaleLagrangian_) state_->gradientVec->scale(state_->searchSize);
303  econ.applyAdjointJacobian(*gs,*elc.getPolyhedralProjection()->getMultiplier(),x,tol);
304  state_->gradientVec->axpy(-cscale_,*gs);
305  x.axpy(-one/std::min(fscale_,cscale_),state_->gradientVec->dual());
306  proj_->project(x,outStream);
307  x.axpy(-one,*state_->iterateVec);
308  state_->gnorm = x.norm();
309  x.set(*state_->iterateVec);
310 
311  // Update subproblem information
312  lnorm = elc.getPolyhedralProjection()->getMultiplier()->norm();
313  sigma_ = std::min(one+lnorm,sigmaMax_)/(one+state_->searchSize);
314  if ( algo->getState()->statusFlag == EXITSTATUS_CONVERGED ) {
315  optTolerance_ = std::max(oem2*outerOptTolerance_,
316  optTolerance_/(one + std::pow(state_->searchSize,optIncreaseExponent_)));
317  }
318  feasTolerance_ = std::max(oem2*outerFeasTolerance_,
319  feasTolerance_/(one + std::pow(state_->searchSize,feasIncreaseExponent_)));
320 
321  // Update Algorithm State
322  state_->snorm += lnorm + state_->searchSize*cscale_*state_->cnorm;
323  state_->lagmultVec->set(emul);
324  }
325  else {
326  // Update subproblem information
327  state_->searchSize = std::min(penaltyUpdate_*state_->searchSize,maxPenaltyParam_);
328  sigma_ /= sigmaUpdate_;
329  optTolerance_ = std::max(oem2*outerOptTolerance_,
330  optToleranceInitial_/(one + std::pow(state_->searchSize,optDecreaseExponent_)));
331  feasTolerance_ = std::max(oem2*outerFeasTolerance_,
332  feasToleranceInitial_/(one + std::pow(state_->searchSize,feasDecreaseExponent_)));
333  }
334  alobj.reset(emul,state_->searchSize,sigma_);
335 
336  // Update Output
337  if (verbosity_ > 0) writeOutput(outStream,printHeader_);
338  }
339  if (verbosity_ > 0) TypeG::Algorithm<Real>::writeExitStatus(outStream);
340 }
341 
342 template<typename Real>
343 void StabilizedLCLAlgorithm<Real>::writeHeader( std::ostream& os ) const {
344  std::stringstream hist;
345  if(verbosity_>1) {
346  hist << std::string(114,'-') << std::endl;
347  hist << "Stabilized LCL status output definitions" << std::endl << std::endl;
348  hist << " iter - Number of iterates (steps taken)" << std::endl;
349  hist << " fval - Objective function value" << std::endl;
350  hist << " cnorm - Norm of the constraint violation" << std::endl;
351  hist << " gLnorm - Norm of the gradient of the Lagrangian" << std::endl;
352  hist << " snorm - Norm of the step" << std::endl;
353  hist << " penalty - Penalty parameter" << std::endl;
354  hist << " sigma - Elastic Penalty parameter" << std::endl;
355  hist << " feasTol - Feasibility tolerance" << std::endl;
356  hist << " optTol - Optimality tolerance" << std::endl;
357  hist << " #fval - Number of times the objective was computed" << std::endl;
358  hist << " #grad - Number of times the gradient was computed" << std::endl;
359  hist << " #cval - Number of times the constraint was computed" << std::endl;
360  hist << " subIter - Number of iterations to solve subproblem" << std::endl;
361  hist << std::string(114,'-') << std::endl;
362  }
363  hist << " ";
364  hist << std::setw(6) << std::left << "iter";
365  hist << std::setw(15) << std::left << "fval";
366  hist << std::setw(15) << std::left << "cnorm";
367  hist << std::setw(15) << std::left << "gLnorm";
368  hist << std::setw(15) << std::left << "snorm";
369  hist << std::setw(10) << std::left << "penalty";
370  hist << std::setw(10) << std::left << "sigma";
371  hist << std::setw(10) << std::left << "feasTol";
372  hist << std::setw(10) << std::left << "optTol";
373  hist << std::setw(8) << std::left << "#fval";
374  hist << std::setw(8) << std::left << "#grad";
375  hist << std::setw(8) << std::left << "#cval";
376  hist << std::setw(8) << std::left << "subIter";
377  hist << std::endl;
378  os << hist.str();
379 }
380 
381 template<typename Real>
382 void StabilizedLCLAlgorithm<Real>::writeName( std::ostream& os ) const {
383  std::stringstream hist;
384  hist << std::endl << "Stabilized LCL Solver (Type G, General Constraints)";
385  hist << std::endl;
386  hist << "Subproblem Solver: " << subStep_ << std::endl;
387  os << hist.str();
388 }
389 
390 template<typename Real>
391 void StabilizedLCLAlgorithm<Real>::writeOutput( std::ostream& os, const bool print_header ) const {
392  std::stringstream hist;
393  hist << std::scientific << std::setprecision(6);
394  if ( state_->iter == 0 ) writeName(os);
395  if ( print_header ) writeHeader(os);
396  if ( state_->iter == 0 ) {
397  hist << " ";
398  hist << std::setw(6) << std::left << state_->iter;
399  hist << std::setw(15) << std::left << state_->value;
400  hist << std::setw(15) << std::left << state_->cnorm;
401  hist << std::setw(15) << std::left << state_->gnorm;
402  hist << std::setw(15) << std::left << "---";
403  hist << std::scientific << std::setprecision(2);
404  hist << std::setw(10) << std::left << state_->searchSize;
405  hist << std::setw(10) << std::left << sigma_;
406  hist << std::setw(10) << std::left << std::max(feasTolerance_,outerFeasTolerance_);
407  hist << std::setw(10) << std::left << std::max(optTolerance_,outerOptTolerance_);
408  hist << std::scientific << std::setprecision(6);
409  hist << std::setw(8) << std::left << state_->nfval;
410  hist << std::setw(8) << std::left << state_->ngrad;
411  hist << std::setw(8) << std::left << state_->ncval;
412  hist << std::setw(8) << std::left << "---";
413  hist << std::endl;
414  }
415  else {
416  hist << " ";
417  hist << std::setw(6) << std::left << state_->iter;
418  hist << std::setw(15) << std::left << state_->value;
419  hist << std::setw(15) << std::left << state_->cnorm;
420  hist << std::setw(15) << std::left << state_->gnorm;
421  hist << std::setw(15) << std::left << state_->snorm;
422  hist << std::scientific << std::setprecision(2);
423  hist << std::setw(10) << std::left << state_->searchSize;
424  hist << std::setw(10) << std::left << sigma_;
425  hist << std::setw(10) << std::left << feasTolerance_;
426  hist << std::setw(10) << std::left << optTolerance_;
427  hist << std::scientific << std::setprecision(6);
428  hist << std::setw(8) << std::left << state_->nfval;
429  hist << std::setw(8) << std::left << state_->ngrad;
430  hist << std::setw(8) << std::left << state_->ncval;
431  hist << std::setw(8) << std::left << subproblemIter_;
432  hist << std::endl;
433  }
434  os << hist.str();
435 }
436 
437 } // namespace TypeG
438 } // namespace ROL
439 
440 #endif
Provides the interface to apply upper and lower bound constraints.
Provides an interface to check status of optimization algorithms for problems with equality constrain...
Defines the general constraint operator interface.
virtual void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the adjoint of the the constraint Jacobian at , , to vector .
Provides the interface to evaluate the elastic augmented Lagrangian.
void reset(const Vector< Real > &multiplier, Real penaltyParameter, Real sigma)
const Ptr< const Vector< Real > > getConstraintVec(const Vector< Real > &x, Real &tol)
const Ptr< const Vector< Real > > getObjectiveGradient(const Vector< Real > &x, Real &tol)
const Ptr< AugmentedLagrangianObjective< Real > > getAugmentedLagrangian(void) const
int getNumberConstraintEvaluations(void) const
Real getObjectiveValue(const Vector< Real > &x, Real &tol)
void setScaling(const Real fscale=1.0, const Real cscale=1.0)
int getNumberFunctionEvaluations(void) const
int getNumberGradientEvaluations(void) const
Provides the interface to evaluate objective functions.
const Ptr< PolyhedralProjection< Real > > & getPolyhedralProjection()
Get the polyhedral projection object. This is a null pointer if no linear constraints and/or bounds a...
const Ptr< Vector< Real > > & getPrimalOptimizationVector()
Get the primal optimization space vector.
const Ptr< Vector< Real > > & getDualOptimizationVector()
Get the dual optimization space vector.
const Ptr< Vector< Real > > & getMultiplierVector()
Get the dual constraint space vector.
const Ptr< Constraint< Real > > & getConstraint()
Get the equality constraint.
EProblem getProblemType()
Get the optimization problem type (U, B, E, or G).
void setProjectionAlgorithm(ParameterList &parlist)
Set polyhedral projection algorithm.
void finalizeIteration()
Transform the optimization variables to the native parameterization after an optimization algorithm h...
void addLinearConstraint(std::string name, const Ptr< Constraint< Real >> &linear_econ, const Ptr< Vector< Real >> &linear_emul, const Ptr< Vector< Real >> &linear_eres=nullPtr, bool reset=false)
Add a linear equality constraint.
void check(bool printToStream=false, std::ostream &outStream=std::cout) const
Run vector, linearity and derivative checks for user-supplied vectors, objective function and constra...
const Ptr< Objective< Real > > & getObjective()
Get the objective function.
const Ptr< BoundConstraint< Real > > & getBoundConstraint()
Get the bound constraint.
const Ptr< Vector< Real > > & getResidualVector()
Get the primal constraint space vector.
virtual void finalize(bool lumpConstraints=false, bool printToStream=false, std::ostream &outStream=std::cout)
Tranform user-supplied constraints to consist of only bounds and equalities. Optimization problem can...
virtual void edit()
Resume editting optimization problem after finalize has been called.
void addBoundConstraint(const Ptr< BoundConstraint< Real >> &bnd)
Add a bound constraint.
Provides an interface to run general constrained optimization algorithms.
void initialize(const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &mul, const Vector< Real > &c)
virtual void writeExitStatus(std::ostream &os) const
const Ptr< CombinedStatusTest< Real > > status_
const Ptr< AlgorithmState< Real > > state_
virtual void run(Problem< Real > &problem, std::ostream &outStream=std::cout) override
Run algorithm on general constrained problems (Type-G). This is the primary Type-G interface.
void initialize(Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &l, const Vector< Real > &c, ElasticObjective< Real > &alobj, BoundConstraint< Real > &bnd, Constraint< Real > &con, std::ostream &outStream=std::cout)
virtual void writeName(std::ostream &os) const override
Print step name.
virtual void writeHeader(std::ostream &os) const override
Print iterate header.
virtual void writeOutput(std::ostream &os, const bool print_header=false) const override
Print iterate status.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:84
virtual Real norm() const =0
Returns where .
virtual void set(const Vector &x)
Set where .
Definition: ROL_Vector.hpp:209
virtual ROL::Ptr< Vector > basis(const int i) const
Return i-th basis vector.
Definition: ROL_Vector.hpp:182
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual int dimension() const
Return dimension of the vector space.
Definition: ROL_Vector.hpp:196
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Definition: ROL_Vector.hpp:153
@ TYPE_EB
Definition: ROL_Types.hpp:259
@ EXITSTATUS_CONVERGED
Definition: ROL_Types.hpp:118