10 #ifndef ROL_FLETCHEROBJECTIVEEDEF_H
11 #define ROL_FLETCHEROBJECTIVEEDEF_H
15 template<
typename Real>
22 ROL::ParameterList &parlist)
35 template<
typename Real>
39 bool isComputed = fPhi_->get(val,key);
40 if( isComputed && multSolverError_*cnorm_ <= tol) {
41 tol = multSolverError_*cnorm_;
49 multSolverError_ = origTol / (
static_cast<Real
>(2) * std::max(static_cast<Real>(1), cnorm_));
51 tol = multSolverError_*cnorm_;
53 val = fval - cprim_->apply(*cdual_);
54 if( quadPenaltyParameter_ > static_cast<Real>(0) )
55 val +=
static_cast<Real
>(0.5)*quadPenaltyParameter_*(cprim_->dot(*cprim_));
62 template<
typename Real>
65 bool isComputed = gPhi_->get(g,key);
66 if( isComputed && gradSolveError_ <= tol) {
67 tol = gradSolveError_;
74 gradSolveError_ = origTol /
static_cast<Real
>(2);
76 gL_->set(gLdual_->dual());
77 bool refine = isComputed;
79 solveAugmentedSystem( *wdual_, *vg_, *xzeros_, *cprim_, x, gradSolveError_, refine );
80 gradSolveError_ += multSolverError_;
81 tol = gradSolveError_;
82 wg_->set(wdual_->dual());
83 con_->applyAdjointHessian( g, *cdual_, *wdual_, x, tol2 ); tol2 = origTol;
84 g.
axpy( sigma_, *wg_ );
85 obj_->hessVec( *Tv_, *wdual_, x, tol2 ); tol2 = origTol;
86 g.
axpy( static_cast<Real>(-1), *Tv_ );
87 con_->applyAdjointHessian( *Tv_, *vg_, *gLdual_, x, tol2 ); tol2 = origTol;
90 if( quadPenaltyParameter_ > static_cast<Real>(0) ) {
91 con_->applyAdjointJacobian( *Tv_, *cprim_, x, tol2 ); tol2 = origTol;
92 g.
axpy( quadPenaltyParameter_, *Tv_ );
98 template<
typename Real>
104 bool isComputed = y_->get(*cdual_,key);
105 if( !isComputed || !useInexact_) {
114 obj_->hessVec( hv, v, x, tol2 ); tol2 = origTol;
115 con_->applyAdjointHessian( *Tv_, *cdual_, v, x, tol2 ); tol2 = origTol;
116 hv.
axpy(static_cast<Real>(-1), *Tv_ );
119 solveAugmentedSystem( *w_, *v_, hv, *czeros_, x, tol2 ); tol2 = origTol;
120 hv.
scale( static_cast<Real>(-1) );
125 solveAugmentedSystem( *w_, *v_, *Tv_, *czeros_, x, tol2 ); tol2 = origTol;
126 hv.
axpy(static_cast<Real>(-2)*sigma_, *w_);
128 wdual_->set(w_->dual());
130 obj_->hessVec( *Tv_, *wdual_, x, tol2 ); tol2 = origTol;
132 con_->applyAdjointHessian( *Tv_, *cdual_, *wdual_, x, tol2 ); tol2 = origTol;
133 hv.
axpy( static_cast<Real>(-1), *Tv_ );
135 hv.
axpy( static_cast<Real>(2)*sigma_, v );
137 if( quadPenaltyParameter_ > static_cast<Real>(0) ) {
138 con_->applyJacobian( *b2_, v, x, tol2 ); tol2 = origTol;
139 con_->applyAdjointJacobian( *Tv_, *b2_, x, tol2 ); tol2 = origTol;
140 hv.
axpy( quadPenaltyParameter_, *Tv_ );
141 con_->applyAdjointHessian( *Tv_, *cprim_, v, x, tol2); tol2 = origTol;
142 hv.
axpy( -quadPenaltyParameter_, *Tv_ );
146 template<
typename Real>
155 ROL::Ptr<LinearOperator<Real>>
156 K = ROL::makePtr<AugSystem>(con_, makePtrFromRef(x), delta_);
157 ROL::Ptr<LinearOperator<Real>>
158 P = ROL::makePtr<AugSystemPrecond>(con_, makePtrFromRef(x), makePtrFromRef(b1));
167 K->apply(*bb_, *ww_, tol); tol = origTol;
168 bb_->scale(static_cast<Real>(-1));
174 if( useInexact_ ) krylov_->resetAbsoluteTolerance(tol);
178 tol = krylov_->run(*vv_,*K,*bb_,*P,iterKrylov_,flagKrylov_);
Provides the interface to evaluate objective functions.
void solveAugmentedSystem(Vector< Real > &v1, Vector< Real > &v2, const Vector< Real > &b1, const Vector< Real > &b2, const Vector< Real > &x, Real &tol, bool refine=false) override
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
virtual void scale(const Real alpha)=0
Compute where .
void computeMultipliers(Vector< Real > &y, Vector< Real > &gL, const Vector< Real > &x, Vector< Real > &g, Vector< Real > &c, Real tol)
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Real objValue(const Vector< Real > &x, Real &tol)
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Ptr< Vector< Real > > wg_
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol) override
Compute gradient.
Defines the linear algebra or vector space interface.
Ptr< Vector< Real > > czeros_
FletcherObjectiveE(const ROL::Ptr< Objective< Real >> &obj, const ROL::Ptr< Constraint< Real >> &con, const Vector< Real > &xprim, const Vector< Real > &xdual, const Vector< Real > &cprim, const Vector< Real > &cdual, ROL::ParameterList &parlist)
Ptr< Vector< Real > > vg_
Ptr< Vector< Real > > Tv_
Ptr< Vector< Real > > xzeros_
Real value(const Vector< Real > &x, Real &tol) override
Compute value.
Ptr< Vector< Real > > wdual_
virtual void set(const Vector &x)
Set where .
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol) override
Apply Hessian approximation to vector.
Defines the general constraint operator interface.