10 #ifndef ROL_TRUSTREGIONFACTORY_H
14 #ifndef ROL_CAUCHYPOINT_H
15 #define ROL_CAUCHYPOINT_H
24 #include "ROL_ParameterList.hpp"
29 class CauchyPoint :
public TrustRegion<Real> {
32 ROL::Ptr<Vector<Real> > g_;
33 ROL::Ptr<Vector<Real> > p_;
34 ROL::Ptr<Vector<Real> > Hp_;
45 CauchyPoint( ROL::ParameterList &parlist )
46 : TrustRegion<Real>(parlist), pRed_(0), alpha_(-1), useCGTCP_(false) {
49 Real TRsafe = parlist.sublist(
"Step").sublist(
"Trust Region").get(
"Safeguard Size",oe2);
50 eps_ = TRsafe*ROL_EPSILON<Real>();
53 void initialize(
const Vector<Real> &x,
const Vector<Real> &s,
const Vector<Real> &g) {
63 void run( Vector<Real> &s,
68 TrustRegionModel<Real> &model) {
80 cauchypoint_unc( s, snorm, iflag, iter, del, model );
85 void cauchypoint_unc( Vector<Real> &s,
90 TrustRegionModel<Real> &model) {
91 Real tol = std::sqrt(ROL_EPSILON<Real>());
93 model.dualTransform(*Hp_,*model.getGradient());
96 model.hessVec(*Hp_,s,s,tol);
97 Real gBg = Hp_->dot(s.dual());
98 Real gnorm = s.dual().norm();
99 Real gg = gnorm*gnorm;
100 Real alpha = del/gnorm;
101 if ( gBg > ROL_EPSILON<Real>() ) {
102 alpha = std::min(gg/gBg, del/gnorm);
106 model.primalTransform(*p_,s);
111 pRed_ = alpha*(gg -
static_cast<Real
>(0.5)*alpha*gBg);
virtual void initialize(const Vector< Real > &x, const Vector< Real > &s, const Vector< Real > &g)
Contains definitions of custom data types in ROL.
void setPredictedReduction(const Real pRed)