44 #ifndef ROL_TRUSTREGION_H
45 #define ROL_TRUSTREGION_H
61 Teuchos::RCP<Vector<Real> >
Hs_;
107 delmax_ = parlist.get(
"Maximum Trust-Region Radius", 5000.0);
108 eta0_ = parlist.get(
"Step Acceptance Parameter", 0.05);
109 eta1_ = parlist.get(
"Radius Shrinking Threshold", 0.05);
110 eta2_ = parlist.get(
"Radius Growing Threshold", 0.9);
111 gamma0_ = parlist.get(
"Radius Shrinking Rate (Negative rho)", 0.0625);
112 gamma1_ = parlist.get(
"Radius Shrinking Rate (Positive rho)", 0.25);
113 gamma2_ = parlist.get(
"Radius Growing Rate", 2.5);
114 TRsafe_ = parlist.get(
"Trust-Region Safeguard", 100.0);
119 useInexact_.push_back(parlist.get(
"Use Inexact Objective Function",
false));
120 useInexact_.push_back(parlist.get(
"Use Inexact Gradient",
false));
121 useInexact_.push_back(parlist.get(
"Use Inexact Hessian-Times-A-Vector",
false));
122 scale_ = parlist.get(
"Value Update Tolerance Scaling",1.e-1);
123 omega_ = parlist.get(
"Value Update Exponent",0.9);
124 force_ = parlist.get(
"Value Update Forcing Sequence Initial Value",1.0);
125 updateIter_ = parlist.get(
"Value Update Forcing Sequence Update Frequency",10);
126 forceFactor_ = parlist.get(
"Value Update Forcing Sequence Reduction Factor",0.1);
129 softUp_ = parlist.get(
"Variable Objective Function",
false);
138 int &nfval,
int &ngrad,
int &flagTR,
156 Real ftol = c*std::pow(std::min(
eta1_,1.0-
eta2_)
173 Real aRed = fold1 - fnew;
194 aRed -=
eps_*((1.0 < std::abs(fold1)) ? 1.0 : std::abs(fold1));
195 pRed_ -=
eps_*((1.0 < std::abs(fold1)) ? 1.0 : std::abs(fold1));
197 if ((std::abs(aRed) <
eps_) && (std::abs(pRed_) <
eps_)) {
203 if (pRed_ < 0 && aRed > 0) {
206 else if (aRed <= 0 && pRed_ > 0) {
209 else if (aRed <= 0 && pRed_ < 0) {
230 Real lam = std::min(1.0, del/
xupdate_->norm());
238 decr = ( aRed >= 0.1*
eta0_*pgnorm );
239 flagTR = (!decr ? 4 : flagTR);
243 if ((rho <
eta0_ && flagTR == 0) || flagTR >= 2 || !decr ) {
250 Real modelVal = s.
dot(
Hs_->dual());
252 modelVal += gs + fold1;
253 Real theta = (1.0-
eta2_)*gs/((1.0-
eta2_)*(fold1+gs)+
eta2_*modelVal-fnew);
260 else if ((rho >=
eta0_ && flagTR != 3) || flagTR == 1) {
282 Teuchos::RCP<Vector<Real> > stmp = x.clone();
285 pObj.computeProjectedStep(*stmp,x);
286 Teuchos::RCP<Vector<Real> > xtmp = x.clone();
288 xtmp->axpy(1.0,*stmp);
291 Teuchos::RCP<Vector<Real> > Bs = x.clone();
292 pObj.hessVec(*Bs,*stmp,x,tol);
293 Real sBs = Bs->dot(*stmp);
294 Real gs = grad.dot(*stmp);
295 Real val = gs + 0.5*sBs;
300 while ( val > val0 || !pObj.isFeasible(*xtmp) ) {
306 pObj.computeProjectedStep(*stmp,x);
308 xtmp->axpy(1.0,*stmp);
311 pObj.hessVec(*Bs,*stmp,x,tol);
312 sBs = Bs->dot(*stmp);
313 gs = grad.dot(*stmp);
317 if ( cnt >= maxit ) {
break; }
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Real value(const Vector< Real > &x, Real &tol)
Compute value.
bool isConActivated(void)
TrustRegion(Teuchos::ParameterList &parlist)
Teuchos::RCP< Vector< Real > > xupdate_
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
virtual void initialize(const Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &g)
void reducedHessVec(Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &p, const Vector< Real > &d, const Vector< Real > &x, Real &tol)
Apply the reduced Hessian to a vector, v. The reduced Hessian first removes elements of v correspondi...
Contains definitions of custom data types in ROL.
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Provides interface for and implements trust-region subproblem solvers.
void pruneActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x)
Contains definitions for helper functions in ROL.
Defines the linear algebra or vector space interface.
void hessVec(Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
virtual Real dot(const Vector &x) const =0
Compute where .
virtual void run(Vector< Real > &s, Real &snorm, Real &del, int &iflag, int &iter, const Vector< Real > &x, const Vector< Real > &grad, const Real &gnorm, ProjectedObjective< Real > &pObj)=0
Real getPredictedReduction(void) const
Teuchos::RCP< Vector< Real > > Hs_
void updateObj(Vector< Real > &x, int iter, ProjectedObjective< Real > &pObj)
virtual void update(Vector< Real > &x, Real &fnew, Real &del, int &nfval, int &ngrad, int &flagTR, const Vector< Real > &s, const Real snorm, const Real fold, const Vector< Real > &g, int iter, ProjectedObjective< Real > &pObj)
void setPredictedReduction(const Real pRed)
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update objective function.
void project(Vector< Real > &x)
static const double ROL_OVERFLOW
Platform-dependent maximum double.
std::vector< bool > useInexact_
static const double ROL_EPSILON
Platform-dependent machine epsilon.