ROL
ROL_LinMoreModel.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Rapid Optimization Library (ROL) Package
4 //
5 // Copyright 2014 NTESS and the ROL contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef ROL_LINMOREMODEL_HPP
11 #define ROL_LINMOREMODEL_HPP
12 
13 #include "ROL_TrustRegionModel.hpp"
14 #include "ROL_BoundConstraint.hpp"
15 
24 namespace ROL {
25 
26 template<class Real>
27 class LinMoreModel : public TrustRegionModel<Real> {
28 private:
29  Ptr<Vector<Real>> pwa_, dwa_;
30 
31 public:
32 
34  const Vector<Real> &x, const Vector<Real> &g,
35  const Ptr<Secant<Real>> &secant = nullPtr,
36  const bool useSecantPrecond = false, const bool useSecantHessVec = false)
37  : TrustRegionModel<Real>::TrustRegionModel(obj,bnd,x,g,secant,useSecantPrecond,useSecantHessVec) {
38  pwa_ = x.clone();
39  dwa_ = g.clone();
40  }
41 
42  void applyFullHessian(Vector<Real> &hv, const Vector<Real> &v, Real &tol) {
44  }
45 
46  void applyFreeHessian(Vector<Real> &hv, const Vector<Real> &v, const Vector<Real> &x, Real &tol) {
47  const Real zero(0);
48  pwa_->set(v);
49  TrustRegionModel<Real>::getBoundConstraint()->pruneActive(*pwa_,x,zero);
50  applyFullHessian(hv,*pwa_,tol);
51  TrustRegionModel<Real>::getBoundConstraint()->pruneActive(hv,x,zero);
52  }
53 
54  void applyFullPrecond(Vector<Real> &pv, const Vector<Real> &v, Real &tol) {
56  }
57 
58  void applyFreePrecond(Vector<Real> &pv, const Vector<Real> &v, const Vector<Real> &x, Real &tol) {
59  const Real zero(0);
60  dwa_->set(v);
61  TrustRegionModel<Real>::getBoundConstraint()->pruneActive(*dwa_,x,zero);
62  applyFullPrecond(pv,*dwa_,tol);
63  TrustRegionModel<Real>::getBoundConstraint()->pruneActive(pv,x,zero);
64  }
65 
66 };
67 
68 } // namespace ROL
69 
70 #endif
Provides the interface to evaluate objective functions.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Provides the interface to evaluate projected trust-region model functions from the Kelley-Sachs bound...
Ptr< Vector< Real > > pwa_
Provides the interface to evaluate trust-region model functions.
Defines the linear algebra or vector space interface.
Definition: ROL_Vector.hpp:46
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
void applyPrecond(Vector< Real > &Pv, const Vector< Real > &v, Real &tol)
void applyHessian(Vector< Real > &hv, const Vector< Real > &v, Real &tol)
void applyFreePrecond(Vector< Real > &pv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Ptr< Vector< Real > > dwa_
Provides interface for and implements limited-memory secant operators.
Definition: ROL_Secant.hpp:45
void applyFreeHessian(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
void applyFullPrecond(Vector< Real > &pv, const Vector< Real > &v, Real &tol)
Provides the interface to apply upper and lower bound constraints.
LinMoreModel(Objective< Real > &obj, BoundConstraint< Real > &bnd, const Vector< Real > &x, const Vector< Real > &g, const Ptr< Secant< Real >> &secant=nullPtr, const bool useSecantPrecond=false, const bool useSecantHessVec=false)
virtual const Ptr< BoundConstraint< Real > > getBoundConstraint(void) const
void applyFullHessian(Vector< Real > &hv, const Vector< Real > &v, Real &tol)