44 #ifndef ROL_KELLEYSACHSMODEL_HPP 45 #define ROL_KELLEYSACHSMODEL_HPP 63 Teuchos::RCP<BoundConstraint<Real> >
bnd_;
77 secant_(Teuchos::null), useSecantPrecond_(false), useSecantHessVec_(false), eps_(eps) {
78 bnd_ = Teuchos::rcpFromRef(bnd);
86 const bool useSecantPrecond,
const bool useSecantHessVec)
88 secant_(secant), useSecantPrecond_(useSecantPrecond), useSecantHessVec_(useSecantHessVec), eps_(eps) {
89 bnd_ = Teuchos::rcpFromRef(bnd);
98 dual_->scale(static_cast<Real>(0.5));
100 prim_->set(gc->dual());
101 bnd_->pruneActive(*prim_,*gc,*xc,eps_);
103 dual_->plus(prim_->dual());
104 return dual_->dot(s.
dual());
114 bnd_->pruneActive(*prim_,*gc,*xc,eps_);
116 g.
plus(prim_->dual());
125 bnd_->pruneActive(*prim_,*gc,*xc,eps_);
127 if ( useSecantHessVec_ ) {
128 secant_->applyB(Hv,*prim_);
134 bnd_->pruneActive(Hv,*gc,*xc,eps_);
138 bnd_->pruneInactive(*prim_,*gc,*xc,eps_);
139 dual_->set(prim_->dual());
140 bnd_->pruneInactive(*dual_,*gc,*xc,eps_);
151 bnd_->pruneActive(*dual_,*gc,*xc,eps_);
153 if ( useSecantHessVec_ ) {
154 secant_->applyH(Hv,*dual_);
160 bnd_->pruneActive(Hv,*gc,*xc,eps_);
164 bnd_->pruneInactive(*dual_,*gc,*xc,eps_);
165 prim_->set(dual_->dual());
166 bnd_->pruneInactive(*prim_,*gc,*xc,eps_);
177 bnd_->pruneActive(*dual_,*gc,*xc,eps_);
179 if ( useSecantPrecond_ ) {
180 secant_->applyH(Mv,*dual_);
186 bnd_->pruneActive(Mv,*gc,*xc,eps_);
190 bnd_->pruneInactive(*dual_,*gc,*xc,eps_);
191 prim_->set(dual_->dual());
192 bnd_->pruneInactive(*prim_,*gc,*xc,eps_);
202 bnd_->pruneActive(tv,*gc,*xc,eps_);
211 tv.
axpy(static_cast<Real>(-1),*xc);
Provides the interface to evaluate objective functions.
KelleySachsModel(Objective< Real > &obj, BoundConstraint< Real > &bnd, const Vector< Real > &x, const Vector< Real > &g, const Real eps, const Teuchos::RCP< Secant< Real > > &secant, const bool useSecantPrecond, const bool useSecantHessVec)
const bool useSecantPrecond_
virtual void plus(const Vector &x)=0
Compute , where .
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
void precond(Vector< Real > &Mv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply preconditioner to vector.
void gradient(Vector< Real > &g, const Vector< Real > &s, Real &tol)
Compute gradient.
const Teuchos::RCP< BoundConstraint< Real > > getBoundConstraint(void) const
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Provides the interface to evaluate trust-region model functions.
Defines the linear algebra or vector space interface.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
Teuchos::RCP< Vector< Real > > prim_
KelleySachsModel(Objective< Real > &obj, BoundConstraint< Real > &bnd, const Vector< Real > &x, const Vector< Real > &g, const Real eps)
Teuchos::RCP< BoundConstraint< Real > > bnd_
void dualTransform(Vector< Real > &tv, const Vector< Real > &v)
virtual const Teuchos::RCP< const Vector< Real > > getGradient(void) const
Provides interface for and implements limited-memory secant operators.
Provides the interface to apply upper and lower bound constraints.
void hessVec(Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &s, Real &tol)
Apply Hessian approximation to vector.
void invHessVec(Vector< Real > &Hv, const Vector< Real > &v, const Vector< Real > &s, Real &tol)
Apply inverse Hessian approximation to vector.
Provides the interface to evaluate projected trust-region model functions from the Kelley-Sachs bound...
Teuchos::RCP< Secant< Real > > secant_
virtual void set(const Vector &x)
Set where .
Real value(const Vector< Real > &s, Real &tol)
Compute value.
Teuchos::RCP< Vector< Real > > dual_
const bool useSecantHessVec_
void primalTransform(Vector< Real > &tv, const Vector< Real > &v)
virtual const Teuchos::RCP< Objective< Real > > getObjective(void) const
virtual const Teuchos::RCP< const Vector< Real > > getIterate(void) const