10 #ifndef ROL_MOREAUYOSIDAPENALTY_H
11 #define ROL_MOREAUYOSIDAPENALTY_H
17 #include "ROL_Ptr.hpp"
33 const ROL::Ptr<Objective<Real> >
obj_;
34 const ROL::Ptr<BoundConstraint<Real> >
bnd_;
36 ROL::Ptr<Vector<Real> >
g_;
37 ROL::Ptr<Vector<Real> >
l_;
38 ROL::Ptr<Vector<Real> >
u_;
39 ROL::Ptr<Vector<Real> >
l1_;
40 ROL::Ptr<Vector<Real> >
u1_;
41 ROL::Ptr<Vector<Real> >
dl1_;
42 ROL::Ptr<Vector<Real> >
du1_;
44 ROL::Ptr<Vector<Real> >
v_;
45 ROL::Ptr<Vector<Real> >
dv_;
46 ROL::Ptr<Vector<Real> >
dv2_;
47 ROL::Ptr<Vector<Real> >
lam_;
48 ROL::Ptr<Vector<Real> >
tmp_;
59 if (
bnd_->isActivated() ) {
114 l_->set(*
bnd_->getLowerBound());
115 u_->set(*
bnd_->getUpperBound());
130 const bool updateMultiplier =
true,
131 const bool updatePenalty =
true)
141 ROL::ParameterList &parlist)
145 ROL::ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
148 mu_ = list.get(
"Initial Penalty Parameter",1e1);
155 ROL::ParameterList &parlist)
160 ROL::ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
163 mu_ = list.get(
"Initial Penalty Parameter",1e1);
167 if (
bnd_->isActivated() ) {
192 if (
bnd_->isActivated()) {
196 tmp_->axpy(static_cast<Real>(-1), *
l_);
200 tmp_->axpy(static_cast<Real>(-1), *
u_);
205 tmp_->axpy(static_cast<Real>(-1), x);
206 Real xnorm =
tmp_->norm();
208 val = std::max(xnorm,std::max(lower,upper));
237 obj_->update(x,flag,iter);
254 if (
bnd_->isActivated() ) {
270 obj_->gradient(*
g_,x,tol);
274 if (
bnd_->isActivated() ) {
291 obj_->hessVec(hv,v,x,tol);
293 if (
bnd_->isActivated() ) {
301 dv_->set(
v_->dual());
312 dv_->set(
v_->dual());
325 obj_->setParameter(param);
Provides the interface to evaluate objective functions.
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
ROL::Ptr< Vector< Real > > g_
ROL::Ptr< Vector< Real > > l1_
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
ROL::Ptr< Vector< Real > > du1_
void setParameter(const std::vector< Real > ¶m)
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
int getNumberGradientEvaluations(void)
Contains definitions of custom data types in ROL.
Real value(const Vector< Real > &x, Real &tol)
Compute value.
ROL::Ptr< Vector< Real > > xlam_
void updateMultipliers(Real mu, const ROL::Vector< Real > &x)
ROL::Ptr< Vector< Real > > dv_
Defines the linear algebra or vector space interface.
void computePenalty(const Vector< Real > &x)
ROL::Ptr< Vector< Real > > dl1_
ROL::Ptr< Vector< Real > > tmp_
const ROL::Ptr< Objective< Real > > obj_
Provides the interface to evaluate the Moreau-Yosida penalty function.
Real getObjectiveValue(void) const
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
MoreauYosidaPenalty(const ROL::Ptr< Objective< Real > > &obj, const ROL::Ptr< BoundConstraint< Real > > &bnd, const ROL::Vector< Real > &x, const ROL::Vector< Real > &lam, ROL::ParameterList &parlist)
Provides the interface to apply upper and lower bound constraints.
ROL::Ptr< Vector< Real > > l_
int getNumberFunctionEvaluations(void)
ROL::Ptr< Vector< Real > > u_
virtual void setParameter(const std::vector< Real > ¶m)
ROL::Ptr< Vector< Real > > v_
MoreauYosidaPenalty(const ROL::Ptr< Objective< Real > > &obj, const ROL::Ptr< BoundConstraint< Real > > &bnd, const ROL::Vector< Real > &x, const Real mu=1e1, const bool updateMultiplier=true, const bool updatePenalty=true)
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update Moreau-Yosida penalty function.
virtual void set(const Vector &x)
Set where .
const ROL::Ptr< BoundConstraint< Real > > bnd_
void reset(const Real mu)
ROL::Ptr< Vector< Real > > lam_
ROL::Ptr< Vector< Real > > dv2_
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
void initialize(const ROL::Vector< Real > &x, const ROL::Ptr< ROL::BoundConstraint< Real > > &bnd)
ROL::Ptr< Vector< Real > > u1_
Real testComplementarity(const ROL::Vector< Real > &x)
MoreauYosidaPenalty(const ROL::Ptr< Objective< Real > > &obj, const ROL::Ptr< BoundConstraint< Real > > &bnd, const ROL::Vector< Real > &x, ROL::ParameterList &parlist)
ROL::Ptr< Vector< Real > > getGradient(void) const