44 #ifndef ROL_MOREAUYOSIDAPENALTY_H
45 #define ROL_MOREAUYOSIDAPENALTY_H
51 #include "ROL_Ptr.hpp"
67 const ROL::Ptr<Objective<Real> >
obj_;
68 const ROL::Ptr<BoundConstraint<Real> >
bnd_;
70 ROL::Ptr<Vector<Real> >
g_;
71 ROL::Ptr<Vector<Real> >
l_;
72 ROL::Ptr<Vector<Real> >
u_;
73 ROL::Ptr<Vector<Real> >
l1_;
74 ROL::Ptr<Vector<Real> >
u1_;
75 ROL::Ptr<Vector<Real> >
dl1_;
76 ROL::Ptr<Vector<Real> >
du1_;
78 ROL::Ptr<Vector<Real> >
v_;
79 ROL::Ptr<Vector<Real> >
dv_;
80 ROL::Ptr<Vector<Real> >
dv2_;
81 ROL::Ptr<Vector<Real> >
lam_;
82 ROL::Ptr<Vector<Real> >
tmp_;
93 if (
bnd_->isActivated() ) {
148 l_->set(*
bnd_->getLowerBound());
149 u_->set(*
bnd_->getUpperBound());
164 const bool updateMultiplier =
true,
165 const bool updatePenalty =
true)
175 ROL::ParameterList &parlist)
179 ROL::ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
182 mu_ = list.get(
"Initial Penalty Parameter",1e1);
189 ROL::ParameterList &parlist)
194 ROL::ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
197 mu_ = list.get(
"Initial Penalty Parameter",1e1);
201 if (
bnd_->isActivated() ) {
226 if (
bnd_->isActivated()) {
230 tmp_->axpy(static_cast<Real>(-1), *
l_);
234 tmp_->axpy(static_cast<Real>(-1), *
u_);
239 tmp_->axpy(static_cast<Real>(-1), x);
240 Real xnorm =
tmp_->norm();
242 val = std::max(xnorm,std::max(lower,upper));
271 obj_->update(x,flag,iter);
288 if (
bnd_->isActivated() ) {
304 obj_->gradient(*
g_,x,tol);
308 if (
bnd_->isActivated() ) {
325 obj_->hessVec(hv,v,x,tol);
327 if (
bnd_->isActivated() ) {
335 dv_->set(
v_->dual());
346 dv_->set(
v_->dual());
359 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