11 #ifndef ROL_SEMISMOOTHNEWTONDUALMODEL_HPP
12 #define ROL_SEMISMOOTHNEWTONDUALMODEL_HPP
36 class SemismoothNewtonDualModel :
public TrustRegionModel<Real> {
38 using V = Vector<Real>;
39 using VPrim = InactiveSet_PrimalVector<Real>;
40 using VDual = InactiveSet_DualVector<Real>;
42 using Obj = Objective<Real>;
43 using Sec = Secant<Real>;
44 using Bnd = BoundConstraint<Real>;
48 class ProjectedObjective :
public Objective<Real> {
55 ProjectedObjective(
Obj& objPrimal, Bnd& bnd,
const Ptr<V>& primalVec ) :
56 objPrimal_(objPrimal), bnd_(bnd), primalVec_( primalVec ) {}
58 Real
value(
const V& p, Real& tol )
override {
60 bnd_.project(*primalVec_);
61 return objPrimal_->
value(*primalVec_, tol);
64 void gradient(
V& g,
const V& p, Real& tol )
override {
66 bnd_.project(*primalVec_);
67 objPrimal_->gradient(g,*primalVec_, tol);
70 void hessVec(
V& hv,
const V& v,
const V& p, Real& tol )
override {
72 bnd_.project(*primalVec_);
73 objPrimal_->hessVec(hv,v,*primalVec_, tol);
78 ProjectedObjective projObj_;
91 SemismoothNewtonDualModel(
Obj& obj, Bnd& bnd,
const V& p,
const V& g,
const Real alpha ) :
92 TrustRegionModel( obj, p, g,
false ), bnd_( bnd ),
93 p_( p.clone() ), g_( p.dual().clone() ), x_( p.clone() ), ones_( p.clone() ),
94 s_( p.clone(), ones_, p_, bnd_ ), projObj_( obj, bnd, p_ ), alpha_(alpha) {
96 ones_->setScalar( Real(1.0) );
100 Real
value(
const V& s, Real& tol ) {
105 hessVec(*hs,s,s,tol);
112 void gradient(
V& g,
const V& s, Real& tol ) {
113 projObj_->gradient(g,*p_,tol);
117 void hessVec(
V& hv,
const V& v,
const V& s, Real& tol ) {
119 bnd_->pruneActive( *vprune_, *p_ );
120 projObj_->hessVec( hv, *vprune_, *p_, tol );
124 void update(
const V& p,
bool flag =
true,
int iter = -1 ) {
126 auto x = this->getIterate();
VectorWorkspace< Real > workspace_
virtual void update(const Vector< Real > &u, const Vector< Real > &z, bool flag=true, int iter=-1) override
ROL::Objective_SimOpt value
Objective_TimeSimOpt< Real > Obj
virtual Real value(const Vector< Real > &u, const Vector< Real > &z, Real &tol)=0
Compute value.