ROL
ROL_TrustRegionStep.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_TRUSTREGIONSTEP_H
11 #define ROL_TRUSTREGIONSTEP_H
12 
13 #include "ROL_Step.hpp"
14 #include "ROL_Types.hpp"
15 #include "ROL_Secant.hpp"
16 #include "ROL_TrustRegion.hpp"
17 #include <sstream>
18 #include <iomanip>
19 
92 namespace ROL {
93 
94 template <class Real>
95 class TrustRegionStep : public Step<Real> {
96 private:
97 
98  // ADDITIONAL VECTOR STORAGE
99  Ptr<Vector<Real>> xnew_;
100  Ptr<Vector<Real>> xold_;
101  Ptr<Vector<Real>> gp_;
102 
103  // TRUST REGION INFORMATION
104  Ptr<TrustRegion<Real>> trustRegion_;
105  Ptr<TrustRegionModel<Real>> model_;
108  Real delMax_;
110  int SPflag_;
111  int SPiter_;
112  bool bndActive_;
113 
114  // SECANT INFORMATION
115  Ptr<Secant<Real>> secant_;
119 
120  // BOUND CONSTRAINED PARAMETERS
121  Real scaleEps_;
123 
124  // POST SMOOTHING PARAMETERS
125  Real alpha_init_;
126  int max_fval_;
127  Real mu_;
128  Real beta_;
129 
130  // COLEMAN-LI PARAMETERS
134 
135  // INEXACT COMPUTATION PARAMETERS
136  std::vector<bool> useInexact_;
137  Real scale0_;
138  Real scale1_;
139 
140  // VERBOSITY SETTING
142 
149  void parseParameterList(ROL::ParameterList &parlist) {
150  ROL::Ptr<StepState<Real>> step_state = Step<Real>::getState();
151  // Trust-Region Parameters
152  ROL::ParameterList &slist = parlist.sublist("Step");
153  ROL::ParameterList &list = slist.sublist("Trust Region");
154  step_state->searchSize = list.get("Initial Radius", static_cast<Real>(-1));
155  delMax_ = list.get("Maximum Radius", static_cast<Real>(1.e8));
156  // Inexactness Information
157  ROL::ParameterList &glist = parlist.sublist("General");
158  useInexact_.clear();
159  useInexact_.push_back(glist.get("Inexact Objective Function", false));
160  useInexact_.push_back(glist.get("Inexact Gradient", false));
161  useInexact_.push_back(glist.get("Inexact Hessian-Times-A-Vector", false));
162  // Trust-Region Inexactness Parameters
163  ROL::ParameterList &ilist = list.sublist("Inexact").sublist("Gradient");
164  scale0_ = ilist.get("Tolerance Scaling", static_cast<Real>(0.1));
165  scale1_ = ilist.get("Relative Tolerance", static_cast<Real>(2));
166  // Initialize Trust Region Subproblem Solver Object
167  etr_ = StringToETrustRegion(list.get("Subproblem Solver", "Dogleg"));
168  TRmodel_ = StringToETrustRegionModel(list.get("Subproblem Model", "Kelley-Sachs"));
169  useProjectedGrad_ = glist.get("Projected Gradient Criticality Measure", false);
170  trustRegion_ = TrustRegionFactory<Real>(parlist);
171  // Scale for epsilon active sets
172  scaleEps_ = glist.get("Scale for Epsilon Active Sets", static_cast<Real>(1));
173  verbosity_ = glist.get("Print Verbosity", 0);
174  // Post-smoothing parameters
175  max_fval_ = list.sublist("Post-Smoothing").get("Function Evaluation Limit", 20);
176  alpha_init_ = list.sublist("Post-Smoothing").get("Initial Step Size", static_cast<Real>(1));
177  mu_ = list.sublist("Post-Smoothing").get("Tolerance", static_cast<Real>(0.9999));
178  beta_ = list.sublist("Post-Smoothing").get("Rate", static_cast<Real>(0.01));
179  // Coleman-Li parameters
180  stepBackMax_ = list.sublist("Coleman-Li").get("Maximum Step Back", static_cast<Real>(0.9999));
181  stepBackScale_ = list.sublist("Coleman-Li").get("Maximum Step Scale", static_cast<Real>(1));
182  singleReflect_ = list.sublist("Coleman-Li").get("Single Reflection", true);
183  }
184 
200  AlgorithmState<Real> &algo_state ) {
201  Ptr<StepState<Real>> state = Step<Real>::getState();
202  if ( useInexact_[1] ) {
203  const Real one(1);
204  //const Real oem2(1.e-2), oe4(1.e4);
205  //Real c = scale0_*std::max(oem2,std::min(one,oe4*algo_state.gnorm));
206  //Real gtol1 = c*std::min(algo_state.gnorm,state->searchSize);
207  //Real gtol0 = scale1_*gtol1 + one;
208  //while ( gtol0 > gtol1*scale1_ ) {
209  // obj.gradient(*(state->gradientVec),x,gtol1);
210  // algo_state.gnorm = computeCriticalityMeasure(*(state->gradientVec),x,bnd);
211  // gtol0 = gtol1;
212  // c = scale0_*std::max(oem2,std::min(one,oe4*algo_state.gnorm));
213  // gtol1 = c*std::min(algo_state.gnorm,state->searchSize);
214  //}
215  //algo_state.ngrad++;
216  Real gtol1 = scale0_*state->searchSize;
217  //Real gtol1 = scale0_*std::min(algo_state.gnorm,state->searchSize);
218  Real gtol0 = gtol1 + one;
219  while ( gtol0 > gtol1 ) {
220  obj.gradient(*(state->gradientVec),x,gtol1);
221  algo_state.gnorm = computeCriticalityMeasure(*(state->gradientVec),x,bnd);
222  gtol0 = gtol1;
223  gtol1 = scale0_*std::min(algo_state.gnorm,state->searchSize);
224  }
225  algo_state.ngrad++;
226  }
227  else {
228  Real gtol = std::sqrt(ROL_EPSILON<Real>());
229  obj.gradient(*(state->gradientVec),x,gtol);
230  algo_state.ngrad++;
231  algo_state.gnorm = computeCriticalityMeasure(*(state->gradientVec),x,bnd);
232  }
233  }
234 
244  if ( bnd.isActivated() ) {
245  if ( useProjectedGrad_ ) {
246  gp_->set(g);
247  bnd.computeProjectedGradient( *gp_, x );
248  return gp_->norm();
249  }
250  else {
251  Real one(1);
252  xnew_->set(x);
253  xnew_->axpy(-one,g.dual());
254  bnd.project(*xnew_);
255  xnew_->axpy(-one,x);
256  return xnew_->norm();
257  }
258  }
259  else {
260  return g.norm();
261  }
262  }
263 
264 public:
265 
267  using Step<Real>::compute;
268  using Step<Real>::update;
269 
270  virtual ~TrustRegionStep() {}
271 
279  TrustRegionStep( ROL::ParameterList & parlist )
280  : Step<Real>(),
281  xnew_(nullPtr), xold_(nullPtr), gp_(nullPtr),
282  trustRegion_(nullPtr), model_(nullPtr),
285  SPflag_(0), SPiter_(0), bndActive_(false),
286  secant_(nullPtr), esec_(SECANT_LBFGS),
287  useSecantHessVec_(false), useSecantPrecond_(false),
288  scaleEps_(1), useProjectedGrad_(false),
289  alpha_init_(1), max_fval_(20), mu_(0.9999), beta_(0.01),
290  stepBackMax_(0.9999), stepBackScale_(1), singleReflect_(true),
291  scale0_(1), scale1_(1),
292  verbosity_(0) {
293  // Parse input parameterlist
294  parseParameterList(parlist);
295  // Create secant object
296  ROL::ParameterList &glist = parlist.sublist("General");
297  esec_ = StringToESecant(glist.sublist("Secant").get("Type","Limited-Memory BFGS"));
298  useSecantPrecond_ = glist.sublist("Secant").get("Use as Preconditioner", false);
299  useSecantHessVec_ = glist.sublist("Secant").get("Use as Hessian", false);
300  secant_ = SecantFactory<Real>(parlist);
301  }
302 
312  TrustRegionStep( ROL::Ptr<Secant<Real> > &secant, ROL::ParameterList &parlist )
313  : Step<Real>(),
314  xnew_(nullPtr), xold_(nullPtr), gp_(nullPtr),
315  trustRegion_(nullPtr), model_(nullPtr),
318  SPflag_(0), SPiter_(0), bndActive_(false),
319  secant_(nullPtr), esec_(SECANT_LBFGS),
320  useSecantHessVec_(false), useSecantPrecond_(false),
321  scaleEps_(1), useProjectedGrad_(false),
322  alpha_init_(1), max_fval_(20), mu_(0.9999), beta_(0.01),
323  stepBackMax_(0.9999), stepBackScale_(1), singleReflect_(true),
324  scale0_(1), scale1_(1),
325  verbosity_(0) {
326  // Parse input parameterlist
327  parseParameterList(parlist);
328  // Create secant object
329  ROL::ParameterList &glist = parlist.sublist("General");
330  useSecantPrecond_ = glist.sublist("Secant").get("Use as Preconditioner", false);
331  useSecantHessVec_ = glist.sublist("Secant").get("Use as Hessian", false);
332  if ( ROL::is_nullPtr(secant_) ) {
333  ROL::ParameterList Slist;
334  Slist.sublist("General").sublist("Secant").set("Type","Limited-Memory BFGS");
335  Slist.sublist("General").sublist("Secant").set("Maximum Storage",10);
336  secant_ = SecantFactory<Real>(Slist);
337  }
338  }
339 
348  void initialize( Vector<Real> &x, const Vector<Real> &s, const Vector<Real> &g,
350  AlgorithmState<Real> &algo_state ) {
352  throw Exception::NotImplemented(">>> ROL::TrustRegionStep : Invalid Trust Region Solver and Model pair!");
353  }
354  Real p1(0.1), oe10(1.e10), zero(0), one(1), half(0.5), three(3), two(2), six(6);
355  Ptr<StepState<Real>> step_state = Step<Real>::getState();
356  bndActive_ = bnd.isActivated();
357 
358  trustRegion_->initialize(x,s,g);
359 
360  Real htol = std::sqrt(ROL_EPSILON<Real>());
361  Real ftol = p1*ROL_OVERFLOW<Real>();
362 
363  step_state->descentVec = s.clone();
364  step_state->gradientVec = g.clone();
365 
366  if ( bnd.isActivated() ) {
367  // Make initial guess feasible
369  bnd.projectInterior(x);
370  }
371  else {
372  bnd.project(x);
373  }
374  xnew_ = x.clone();
375  xold_ = x.clone();
376  }
377  gp_ = g.clone();
378 
379  // Update approximate gradient and approximate objective function.
380  obj.update(x,true,algo_state.iter);
381  algo_state.snorm = oe10;
382  algo_state.value = obj.value(x,ftol);
383  algo_state.nfval++;
384  algo_state.gnorm = ROL_INF<Real>();
385  updateGradient(x,obj,bnd,algo_state);
386 
387  // Try to apply inverse Hessian
388  if ( !useSecantHessVec_ &&
390  try {
391  Ptr<Vector<Real>> v = g.clone();
392  Ptr<Vector<Real>> hv = x.clone();
393  obj.invHessVec(*hv,*v,x,htol);
394  }
395  catch (std::exception &e) {
396  useSecantHessVec_ = true;
397  }
398  }
399 
400  // Evaluate Objective Function at Cauchy Point
401  bool autoRad = false;
402  if ( step_state->searchSize <= zero ) {
403  autoRad = true;
404  Ptr<Vector<Real>> Bg = g.clone();
405  if ( useSecantHessVec_ ) {
406  secant_->applyB(*Bg,(step_state->gradientVec)->dual());
407  }
408  else {
409  obj.hessVec(*Bg,(step_state->gradientVec)->dual(),x,htol);
410  }
411  Real gBg = Bg->dot(*(step_state->gradientVec));
412  Real alpha = one;
413  if ( gBg > ROL_EPSILON<Real>() ) {
414  alpha = algo_state.gnorm*algo_state.gnorm/gBg;
415  }
416  // Evaluate the objective function at the Cauchy point
417  Ptr<Vector<Real>> cp = s.clone();
418  cp->set((step_state->gradientVec)->dual());
419  cp->scale(-alpha);
420  Ptr<Vector<Real>> xcp = x.clone();
421  xcp->set(x);
422  xcp->plus(*cp);
423  if ( bnd.isActivated() ) {
424  bnd.project(*xcp);
425  }
426  obj.update(*xcp);
427  Real fnew = obj.value(*xcp,ftol); // MUST DO SOMETHING HERE WITH FTOL
428  algo_state.nfval++;
429  // Perform cubic interpolation to determine initial trust region radius
430  Real gs = cp->dot((step_state->gradientVec)->dual());
431  Real a = fnew - algo_state.value - gs - half*alpha*alpha*gBg;
432  if ( std::abs(a) < ROL_EPSILON<Real>() ) {
433  // a = 0 implies the objective is quadratic in the negative gradient direction
434  step_state->searchSize = std::min(alpha*algo_state.gnorm,delMax_);
435  }
436  else {
437  Real b = half*alpha*alpha*gBg;
438  Real c = gs;
439  if ( b*b-three*a*c > ROL_EPSILON<Real>() ) {
440  // There is at least one critical point
441  Real t1 = (-b-std::sqrt(b*b-three*a*c))/(three*a);
442  Real t2 = (-b+std::sqrt(b*b-three*a*c))/(three*a);
443  if ( six*a*t1 + two*b > zero ) {
444  // t1 is the minimizer
445  step_state->searchSize = std::min(t1*alpha*algo_state.gnorm,delMax_);
446  }
447  else {
448  // t2 is the minimizer
449  step_state->searchSize = std::min(t2*alpha*algo_state.gnorm,delMax_);
450  }
451  }
452  else {
453  step_state->searchSize = std::min(alpha*algo_state.gnorm,delMax_);
454  }
455  }
456  if (step_state->searchSize <= ROL_EPSILON<Real>()*algo_state.gnorm && autoRad) {
457  step_state->searchSize = one;
458  }
459  obj.update(x,true,algo_state.iter);
460  }
461  // Build trust-region model
462  if (bnd.isActivated()) {
464  model_ = makePtr<KelleySachsModel<Real>>(obj,
465  bnd,
466  x,
467  *(step_state->gradientVec),
468  secant_,
471  }
472  else if ( TRmodel_ == TRUSTREGION_MODEL_COLEMANLI ) {
473  model_ = makePtr<ColemanLiModel<Real>>(obj,
474  bnd,
475  x,
476  *(step_state->gradientVec),
477  stepBackMax_,
480  secant_,
483  }
484  else if ( TRmodel_ == TRUSTREGION_MODEL_LINMORE ) {
485  model_ = makePtr<LinMoreModel<Real>>(obj,
486  bnd,
487  x,
488  *(step_state->gradientVec),
489  secant_,
492  }
493  else {
494  ROL_TEST_FOR_EXCEPTION( true, std::invalid_argument,
495  ">>> ERROR (TrustRegionStep): Invalid trust-region model!");
496  }
497  }
498  else {
499  model_ = makePtr<TrustRegionModel<Real>>(obj,
500  bnd,
501  x,
502  *(step_state->gradientVec),
503  secant_,
506  }
507  }
508 
519  void compute( Vector<Real> &s, const Vector<Real> &x,
521  AlgorithmState<Real> &algo_state ) {
522  // Get step state
523  Ptr<StepState<Real>> step_state = Step<Real>::getState();
524  // Build trust-region model
525  model_->update(obj,bnd,x,*step_state->gradientVec,secant_);
526  if (bnd.isActivated()) {
528 // Real eps = scaleEps_*algo_state.gnorm;
529  Real eps = scaleEps_ * std::min(std::pow(algo_state.gnorm,static_cast<Real>(0.75)),
530  static_cast<Real>(0.001));
531  dynamicPtrCast<KelleySachsModel<Real>>(model_)->setEpsilon(eps);
532  }
533  else if ( TRmodel_ == TRUSTREGION_MODEL_COLEMANLI ) {
534  dynamicPtrCast<ColemanLiModel<Real>>(model_)->setRadius(step_state->searchSize);
535  }
536  }
537  // Minimize trust-region model over trust-region constraint
538  SPflag_ = 0; SPiter_ = 0;
539  trustRegion_->run(s,algo_state.snorm,SPflag_,SPiter_,step_state->searchSize,*model_);
540  }
541 
554  const Vector<Real> &s,
555  Objective<Real> &obj,
557  AlgorithmState<Real> &algo_state ) {
558  // Get step state
559  Ptr<StepState<Real>> state = Step<Real>::getState();
560  // Store previous step for constraint computations
561  if ( bnd.isActivated() ) {
562  xold_->set(x);
563  }
564  // Update trust-region information;
565  // Performs a hard update on the objective function
567  state->nfval = 0;
568  state->ngrad = 0;
569  Real fold = algo_state.value;
570  Real fnew(0);
571  algo_state.iter++;
572  trustRegion_->update(x,fnew,state->searchSize,state->nfval,state->ngrad,TRflag_,
573  s,algo_state.snorm,fold,*(state->gradientVec),algo_state.iter,
574  obj,bnd,*model_);
575  algo_state.nfval += state->nfval;
576  algo_state.ngrad += state->ngrad;
577  state->flag = static_cast<int>(TRflag_);
578  state->SPiter = SPiter_;
579  state->SPflag = SPflag_;
580  // If step is accepted ...
581  // Compute new gradient and update secant storage
584  // Store previous gradient for secant update
586  gp_->set(*(state->gradientVec));
587  }
588  // Update objective function and approximate model
589  updateGradient(x,obj,bnd,algo_state);
590  // Update secant information
592  if ( bnd.isActivated() ) { // Compute new constrained step
593  xnew_->set(x);
594  xnew_->axpy(-static_cast<Real>(1),*xold_);
595  secant_->updateStorage(x,*(state->gradientVec),*gp_,*xnew_,algo_state.snorm,algo_state.iter+1);
596  }
597  else {
598  secant_->updateStorage(x,*(state->gradientVec),*gp_,s,algo_state.snorm,algo_state.iter+1);
599  }
600  }
601  // Update algorithm state
602  (algo_state.iterateVec)->set(x);
603  }
604  else {
605  if ( useInexact_[1] ) {
606  // Update objective function and approximate model
607  updateGradient(x,obj,bnd,algo_state);
608  }
609  }
610  // Update algorithm state
611  algo_state.value = fnew;
612  }
613 
618  std::string printHeader( void ) const {
619  std::stringstream hist;
620 
621  if(verbosity_>0) {
622  hist << std::string(114,'-') << "\n";
623 
624  hist << "Trust-Region status output definitions\n\n";
625 
626  hist << " iter - Number of iterates (steps taken) \n";
627  hist << " value - Objective function value \n";
628  hist << " gnorm - Norm of the gradient\n";
629  hist << " snorm - Norm of the step (update to optimization vector)\n";
630  hist << " delta - Trust-Region radius\n";
631  hist << " #fval - Number of times the objective function was evaluated\n";
632  hist << " #grad - Number of times the gradient was computed\n";
633 
634 
635 
636  hist << "\n";
637  hist << " tr_flag - Trust-Region flag" << "\n";
638  for( int flag = TRUSTREGION_FLAG_SUCCESS; flag != TRUSTREGION_FLAG_UNDEFINED; ++flag ) {
639  hist << " " << NumberToString(flag) << " - "
640  << ETrustRegionFlagToString(static_cast<ETrustRegionFlag>(flag)) << "\n";
641 
642  }
643 
644  if( etr_ == TRUSTREGION_TRUNCATEDCG ) {
645  hist << "\n";
646  hist << " iterCG - Number of Truncated CG iterations\n\n";
647  hist << " flagGC - Trust-Region Truncated CG flag" << "\n";
648  for( int flag = CG_FLAG_SUCCESS; flag != CG_FLAG_UNDEFINED; ++flag ) {
649  hist << " " << NumberToString(flag) << " - "
650  << ECGFlagToString(static_cast<ECGFlag>(flag)) << "\n";
651  }
652  }
653 
654  hist << std::string(114,'-') << "\n";
655  }
656 
657  hist << " ";
658  hist << std::setw(6) << std::left << "iter";
659  hist << std::setw(15) << std::left << "value";
660  hist << std::setw(15) << std::left << "gnorm";
661  hist << std::setw(15) << std::left << "snorm";
662  hist << std::setw(15) << std::left << "delta";
663  hist << std::setw(10) << std::left << "#fval";
664  hist << std::setw(10) << std::left << "#grad";
665  hist << std::setw(10) << std::left << "tr_flag";
667  hist << std::setw(10) << std::left << "iterCG";
668  hist << std::setw(10) << std::left << "flagCG";
669  }
670  hist << "\n";
671  return hist.str();
672  }
673 
678  std::string printName( void ) const {
679  std::stringstream hist;
680  hist << "\n" << ETrustRegionToString(etr_) << " Trust-Region Solver";
683  hist << " with " << ESecantToString(esec_) << " Preconditioning\n";
684  }
685  else if ( !useSecantPrecond_ && useSecantHessVec_ ) {
686  hist << " with " << ESecantToString(esec_) << " Hessian Approximation\n";
687  }
688  else {
689  hist << " with " << ESecantToString(esec_) << " Preconditioning and Hessian Approximation\n";
690  }
691  }
692  else {
693  hist << "\n";
694  }
695  if ( bndActive_ ) {
696  hist << "Trust-Region Model: " << ETrustRegionModelToString(TRmodel_) << "\n";
697  }
698  return hist.str();
699  }
700 
708  std::string print( AlgorithmState<Real> & algo_state, bool print_header = false ) const {
709  const Ptr<const StepState<Real>>& step_state = Step<Real>::getStepState();
710 
711  std::stringstream hist;
712  hist << std::scientific << std::setprecision(6);
713  if ( algo_state.iter == 0 ) {
714  hist << printName();
715  }
716  if ( print_header ) {
717  hist << printHeader();
718  }
719  if ( algo_state.iter == 0 ) {
720  hist << " ";
721  hist << std::setw(6) << std::left << algo_state.iter;
722  hist << std::setw(15) << std::left << algo_state.value;
723  hist << std::setw(15) << std::left << algo_state.gnorm;
724  hist << std::setw(15) << std::left << " ";
725  hist << std::setw(15) << std::left << step_state->searchSize;
726  hist << "\n";
727  }
728  else {
729  hist << " ";
730  hist << std::setw(6) << std::left << algo_state.iter;
731  hist << std::setw(15) << std::left << algo_state.value;
732  hist << std::setw(15) << std::left << algo_state.gnorm;
733  hist << std::setw(15) << std::left << algo_state.snorm;
734  hist << std::setw(15) << std::left << step_state->searchSize;
735  hist << std::setw(10) << std::left << algo_state.nfval;
736  hist << std::setw(10) << std::left << algo_state.ngrad;
737  hist << std::setw(10) << std::left << TRflag_;
739  hist << std::setw(10) << std::left << SPiter_;
740  hist << std::setw(10) << std::left << SPflag_;
741  }
742  hist << "\n";
743  }
744  return hist.str();
745  }
746 
747 }; // class Step
748 
749 } // namespace ROL
750 
751 #endif
std::string ECGFlagToString(ECGFlag cgf)
Definition: ROL_Types.hpp:797
Provides the interface to evaluate objective functions.
ESecant esec_
Secant type.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Definition: ROL_Vector.hpp:192
bool bndActive_
Flag whether bound is activated.
std::string ETrustRegionModelToString(ETrustRegionModel tr)
Real mu_
Post-Smoothing tolerance for projected methods.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void projectInterior(Vector< Real > &x)
Project optimization variables into the interior of the feasible set.
bool useSecantPrecond_
Flag whether to use a secant preconditioner.
bool isActivated(void) const
Check if bounds are on.
virtual Real value(const Vector< Real > &x, Real &tol)=0
Compute value.
Provides the interface to compute optimization steps.
Definition: ROL_Step.hpp:34
TrustRegionStep(ROL::Ptr< Secant< Real > > &secant, ROL::ParameterList &parlist)
Constructor.
void initialize(Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &g, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Initialize step.
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Contains definitions of custom data types in ROL.
bool isValidTrustRegionSubproblem(ETrustRegion etr, ETrustRegionModel etrm, bool isBnd)
Real alpha_init_
Initial line-search parameter for projected methods.
ESecant StringToESecant(std::string s)
Definition: ROL_Types.hpp:509
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
virtual void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update objective function.
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
std::string printName(void) const
Print step name.
TrustRegionStep(ROL::ParameterList &parlist)
Constructor.
Real computeCriticalityMeasure(const Vector< Real > &g, const Vector< Real > &x, BoundConstraint< Real > &bnd)
Compute the criticality measure.
ETrustRegionModel TRmodel_
Trust-region subproblem model type.
State for algorithm class. Will be used for restarts.
Definition: ROL_Types.hpp:109
Real scaleEps_
Scaling for epsilon-active sets.
virtual void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
std::string NumberToString(T Number)
Definition: ROL_Types.hpp:47
ETrustRegion etr_
Trust-region subproblem solver type.
std::string printHeader(void) const
Print iterate header.
void compute(Vector< Real > &s, const Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Compute step.
ESecant
Enumeration of secant update algorithms.
Definition: ROL_Types.hpp:452
ETrustRegionModel StringToETrustRegionModel(std::string s)
int SPflag_
Subproblem solver termination flag.
ROL::Ptr< StepState< Real > > getState(void)
Definition: ROL_Step.hpp:39
ETrustRegionFlag TRflag_
Trust-region exit flag.
bool useSecantHessVec_
Flag whether to use a secant Hessian.
int SPiter_
Subproblem solver iteration count.
std::vector< bool > useInexact_
Flags for inexact (0) objective function, (1) gradient, (2) Hessian.
Provides interface for and implements limited-memory secant operators.
Definition: ROL_Secant.hpp:45
Real scale0_
Scale for inexact gradient computation.
Ptr< TrustRegionModel< Real > > model_
Container for trust-region model.
ROL::Ptr< Vector< Real > > iterateVec
Definition: ROL_Types.hpp:123
Real delMax_
Maximum trust-region radius.
virtual void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply inverse Hessian approximation to vector.
Ptr< Vector< Real > > xnew_
Container for updated iteration vector.
virtual void project(Vector< Real > &x)
Project optimization variables onto the bounds.
std::string print(AlgorithmState< Real > &algo_state, bool print_header=false) const
Print iterate status.
ETrustRegionModel
Enumeration of trust-region model types.
Provides the interface to apply upper and lower bound constraints.
void computeProjectedGradient(Vector< Real > &g, const Vector< Real > &x)
Compute projected gradient.
int verbosity_
Print additional information to screen if &gt; 0.
Ptr< TrustRegion< Real > > trustRegion_
Container for trust-region solver object.
ETrustRegion StringToETrustRegion(std::string s)
Ptr< Vector< Real > > xold_
Container for previous iteration vector.
void update(Vector< Real > &x, const Vector< Real > &s, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Update step, if successful.
virtual Real norm() const =0
Returns where .
int max_fval_
Maximum function evaluations in line-search for projected methods.
Ptr< Secant< Real > > secant_
Container for secant approximation.
ETrustRegion
Enumeration of trust-region solver types.
std::string ETrustRegionFlagToString(ETrustRegionFlag trf)
ETrustRegionFlag
Enumation of flags used by trust-region solvers.
std::string ETrustRegionToString(ETrustRegion tr)
std::string ESecantToString(ESecant tr)
Definition: ROL_Types.hpp:461
bool useProjectedGrad_
Flag whether to use the projected gradient criticality measure.
Real beta_
Post-Smoothing rate for projected methods.
Real scale1_
Scale for inexact gradient computation.
void parseParameterList(ROL::ParameterList &parlist)
Parse input ParameterList.
void updateGradient(Vector< Real > &x, Objective< Real > &obj, BoundConstraint< Real > &bnd, AlgorithmState< Real > &algo_state)
Update gradient to iteratively satisfy inexactness condition.
Provides the interface to compute optimization steps with trust regions.
const ROL::Ptr< const StepState< Real > > getStepState(void) const
Get state for step object.
Definition: ROL_Step.hpp:177
Ptr< Vector< Real > > gp_
Container for previous gradient vector.