46 #ifndef ROL_SEMISMOOTHNEWTONDUALMODEL_HPP
47 #define ROL_SEMISMOOTHNEWTONDUALMODEL_HPP
71 class SemismoothNewtonDualModel :
public TrustRegionModel<Real> {
73 using V = Vector<Real>;
74 using VPrim = InactiveSet_PrimalVector<Real>;
75 using VDual = InactiveSet_DualVector<Real>;
77 using Obj = Objective<Real>;
78 using Sec = Secant<Real>;
79 using Bnd = BoundConstraint<Real>;
83 class ProjectedObjective :
public Objective<Real> {
90 ProjectedObjective(
Obj& objPrimal, Bnd& bnd,
const Ptr<V>& primalVec ) :
91 objPrimal_(objPrimal), bnd_(bnd), primalVec_( primalVec ) {}
93 Real
value(
const V& p, Real& tol )
override {
95 bnd_.project(*primalVec_);
96 return objPrimal_->
value(*primalVec_, tol);
99 void gradient(
V& g,
const V& p, Real& tol )
override {
101 bnd_.project(*primalVec_);
102 objPrimal_->gradient(g,*primalVec_, tol);
105 void hessVec(
V& hv,
const V& v,
const V& p, Real& tol )
override {
107 bnd_.project(*primalVec_);
108 objPrimal_->hessVec(hv,v,*primalVec_, tol);
113 ProjectedObjective projObj_;
126 SemismoothNewtonDualModel(
Obj& obj, Bnd& bnd,
const V& p,
const V& g,
const Real alpha ) :
127 TrustRegionModel( obj, p, g,
false ), bnd_( bnd ),
128 p_( p.clone() ), g_( p.dual().clone() ), x_( p.clone() ), ones_( p.clone() ),
129 s_( p.clone(), ones_, p_, bnd_ ), projObj_( obj, bnd, p_ ), alpha_(alpha) {
131 ones_->setScalar( Real(1.0) );
135 Real
value(
const V& s, Real& tol ) {
140 hessVec(*hs,s,s,tol);
147 void gradient(
V& g,
const V& s, Real& tol ) {
148 projObj_->gradient(g,*p_,tol);
152 void hessVec(
V& hv,
const V& v,
const V& s, Real& tol ) {
154 bnd_->pruneActive( *vprune_, *p_ );
155 projObj_->hessVec( hv, *vprune_, *p_, tol );
159 void update(
const V& p,
bool flag =
true,
int iter = -1 ) {
161 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.