10 #ifndef ROL_DOGLEG_U_H
11 #define ROL_DOGLEG_U_H
45 Real tol = std::sqrt(ROL_EPSILON<Real>());
46 const Real
zero(0), half(0.5), one(1), two(2);
58 Real gnorm = s.
norm();
59 Real gnorm2 = gnorm*gnorm;
61 Real gBg =
dual_->apply(s);
62 Real alpha = gnorm2/gBg;
63 if ( alpha*gnorm >= del || gBg <=
zero ) {
69 pRed = alpha*(gnorm2 - half*alpha*gBg);
84 Real gnorm = s.
norm();
85 Real gnorm2 = gnorm*gnorm;
87 Real gBg =
dual_->apply(s);
88 Real gamma = gnorm2/gBg;
89 if ( gamma*gnorm >= del || gBg <=
zero ) {
99 Real a = sNnorm*sNnorm + two*gamma*gsN + gamma*gamma*gnorm2;
100 Real b = -gamma*gsN - gamma*gamma*gnorm2;
101 Real c = gamma*gamma*gnorm2 - del*del;
102 alpha = (-b + std::sqrt(b*b - a*c))/a;
103 beta = gamma*(one-alpha);
109 pRed = (alpha*(half*alpha-one)*gsN - half*beta*beta*gBg + beta*(one-alpha)*gnorm2);
virtual void scale(const Real alpha)=0
Compute where .
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void invHessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &s, Real &tol) override
Apply inverse Hessian approximation to vector.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Provides interface for dog leg trust-region subproblem solver.
Contains definitions of custom data types in ROL.
Defines the linear algebra or vector space interface.
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
void solve(Vector< Real > &s, Real &snorm, Real &pRed, int &iflag, int &iter, const Real del, TrustRegionModel_U< Real > &model)
virtual void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &s, Real &tol) override
Apply Hessian approximation to vector.
Provides the interface to evaluate trust-region model functions.
virtual const Ptr< const Vector< Real > > getGradient(void) const
void initialize(const Vector< Real > &x, const Vector< Real > &g)
Provides interface for and implements trust-region subproblem solvers.
virtual void set(const Vector &x)
Set where .
virtual Real norm() const =0
Returns where .
Ptr< Vector< Real > > primal_
Ptr< Vector< Real > > dual_