44 #ifndef ROL_PROJECTEDHESSIAN_H 45 #define ROL_PROJECTEDHESSIAN_H 58 const Teuchos::RCP<Objective<Real> >
obj_;
59 const Teuchos::RCP<BoundConstraint<Real> >
con_;
60 const Teuchos::RCP<Vector<Real> >
x_;
61 const Teuchos::RCP<Vector<Real> >
g_;
62 Teuchos::RCP<Vector<Real> >
v_;
64 const Teuchos::RCP<Secant<Real> >
secant_;
74 : obj_(obj), con_(con), x_(x), g_(g), secant_(Teuchos::null), eps_(0.0) {
75 if ( con_->isActivated() ) {
84 bool useSecant =
true ) : obj_(obj), con_(con), x_(x), g_(g), secant_(secant), eps_(0.0) {
85 if ( con_->isActivated() ) {
88 useSecant_ = useSecant;
103 if ( con_->isActivated() ) {
105 con_->pruneActive(*v_,*g_,*x_,eps_);
106 if ( useSecant_ && secant_ != Teuchos::null ) {
107 secant_->applyB(Hv,*v_,*x_);
110 obj_->hessVec(Hv,*v_,*x_,tol);
112 con_->pruneActive(Hv,*g_,*x_,eps_);
114 con_->pruneInactive(*v_,*g_,*x_,eps_);
118 if ( useSecant_ && secant_ != Teuchos::null ) {
119 secant_->applyB(Hv,v,*x_);
122 obj_->hessVec(Hv,v,*x_,tol);
135 if ( con_->isActivated() ) {
137 con_->pruneActive(*v_,*g_,*x_,eps_);
138 if ( useSecant_ && secant_ != Teuchos::null ) {
139 secant_->applyH(Hv,*v_,*x_);
142 obj_->invHessVec(Hv,*v_,*x_,tol);
144 con_->pruneActive(Hv,*g_,*x_,eps_);
146 con_->pruneInactive(*v_,*g_,*x_,eps_);
150 if ( useSecant_ && secant_ != Teuchos::null ) {
151 secant_->applyH(Hv,v,*x_);
154 obj_->invHessVec(Hv,v,*x_,tol);
Provides the interface to evaluate objective functions.
Teuchos::RCP< Vector< Real > > v_
virtual void plus(const Vector &x)=0
Compute , where .
ProjectedHessian(const Teuchos::RCP< Secant< Real > > &secant, const Teuchos::RCP< Objective< Real > > &obj, const Teuchos::RCP< BoundConstraint< Real > > &con, const Teuchos::RCP< Vector< Real > > &x, const Teuchos::RCP< Vector< Real > > &g, bool useSecant=true)
Contains definitions of custom data types in ROL.
const Teuchos::RCP< Objective< Real > > obj_
void setData(Real eps=0.0)
Defines the linear algebra or vector space interface.
const Teuchos::RCP< Vector< Real > > g_
const Teuchos::RCP< Vector< Real > > x_
void applyInverse(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply inverse Hessian.
Provides interface for and implements limited-memory secant operators.
Provides the interface to apply a linear operator.
const Teuchos::RCP< Secant< Real > > secant_
Provides the interface to apply upper and lower bound constraints.
const Teuchos::RCP< BoundConstraint< Real > > con_
ProjectedHessian(const Teuchos::RCP< Objective< Real > > &obj, const Teuchos::RCP< BoundConstraint< Real > > &con, const Teuchos::RCP< Vector< Real > > &x, const Teuchos::RCP< Vector< Real > > &g)
void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply Hessian.