44 #ifndef ROL_CAUCHYPOINT_H 45 #define ROL_CAUCHYPOINT_H 55 #include "Teuchos_ParameterList.hpp" 63 Teuchos::RCP<Vector<Real> >
g_;
64 Teuchos::RCP<Vector<Real> >
p_;
65 Teuchos::RCP<Vector<Real> >
Hp_;
77 :
TrustRegion<Real>(parlist), pRed_(0.0), alpha_(-1.0), useCGTCP_(false) {
79 Real TRsafe = parlist.sublist(
"Step").sublist(
"Trust Region").get(
"Safeguard Size",100.0);
99 cauchypoint_M( s, snorm, del, iflag, iter, x, grad, gnorm, pObj );
120 Real gBg = Hp_->dot(grad);
121 Real gg = gnorm*gnorm;
122 Real alpha = del/gnorm;
124 alpha = std::min(gg/gBg, del/gnorm);
132 pRed_ = alpha*(gg - 0.5*alpha*gBg);
149 if ( alpha_ > 0.0 ) {
153 Real alphamax = 1.e4*alpha;
162 Real val = gs + 0.5*s.
dot(Hp_->dual());
166 if ( val > mu0 * gs || snorm > mu1 * del ) {
181 alpha *= (beta1+beta2)*0.5;
190 val = gs + 0.5*s.
dot(Hp_->dual());
194 stat = ( val > mu0 * gs || snorm > mu1 * del );
195 if ( std::abs(val) < eps_ && std::abs(mu0 *gs) <
eps_ ) {
196 stat = (snorm > mu1 * del);
200 stat = !( val > mu0 * gs || snorm > mu1 * del );
201 if ( std::abs(val) < eps_ && std::abs(mu0 *gs) <
eps_ ) {
202 stat = !(snorm > mu1 * del);
204 if ( alpha > alphamax ) {
224 bool tmax_flag =
true;
235 for (
int i = 0; i < maxit; i++ ) {
238 p_->axpy(-t,grad.
dual());
247 pRed_ = -gs - 0.5*s.
dot(Hp_->dual());
253 if ( snorm > del || pRed_ < -c2*gs ) {
257 else if ( snorm < c3*del && pRed_ > -c1*gs && pgnorm > c4*std::abs(gs)/del ) {
269 t = 0.5*(tmax + tmin);
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
bool isConActivated(void)
virtual void scale(const Real alpha)=0
Compute where .
CauchyPoint(Teuchos::ParameterList &parlist)
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)
Teuchos::RCP< Vector< Real > > p_
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 .
void cauchypoint_CGT(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)
void cauchypoint_unc(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)
void setPredictedReduction(const Real pRed)
void cauchypoint_M(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)
Teuchos::RCP< Vector< Real > > Hp_
void initialize(const Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &g)
Teuchos::RCP< Vector< Real > > g_
Provides interface for the Cauchy point trust-region subproblem solver.
virtual void set(const Vector &x)
Set where .
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)
virtual Real norm() const =0
Returns where .
void computeProjectedStep(Vector< Real > &v, const Vector< Real > &x)
void project(Vector< Real > &x)
static const double ROL_EPSILON
Platform-dependent machine epsilon.