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> >
con_;
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 (
con_->isActivated() ) {
148 l_->set(*
con_->getLowerBound());
149 u_->set(*
con_->getUpperBound());
173 ROL::ParameterList &parlist)
177 ROL::ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
180 mu_ = list.get(
"Initial Penalty Parameter",1e1);
187 ROL::ParameterList &parlist)
192 ROL::ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
195 mu_ = list.get(
"Initial Penalty Parameter",1e1);
199 if (
con_->isActivated() ) {
224 if (
con_->isActivated()) {
228 tmp_->axpy(static_cast<Real>(-1), *
l_);
232 tmp_->axpy(static_cast<Real>(-1), *
u_);
237 tmp_->axpy(static_cast<Real>(-1), x);
238 Real xnorm =
tmp_->norm();
240 val = std::max(xnorm,std::max(lower,upper));
269 obj_->update(x,flag,iter);
270 con_->update(x,flag,iter);
287 if (
con_->isActivated() ) {
303 obj_->gradient(*
g_,x,tol);
307 if (
con_->isActivated() ) {
324 obj_->hessVec(hv,v,x,tol);
326 if (
con_->isActivated() ) {
334 dv_->set(
v_->dual());
345 dv_->set(
v_->dual());
358 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 initialize(const ROL::Vector< Real > &x, const ROL::Ptr< ROL::BoundConstraint< Real > > &con)
void computePenalty(const Vector< Real > &x)
ROL::Ptr< Vector< Real > > dl1_
const ROL::Ptr< BoundConstraint< Real > > con_
ROL::Ptr< Vector< Real > > tmp_
MoreauYosidaPenalty(const ROL::Ptr< Objective< Real > > &obj, const ROL::Ptr< BoundConstraint< Real > > &con, const ROL::Vector< Real > &x, const ROL::Vector< Real > &lam, ROL::ParameterList &parlist)
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 > > &con, const ROL::Vector< Real > &x, 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_
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 .
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.
ROL::Ptr< Vector< Real > > u1_
Real testComplementarity(const ROL::Vector< Real > &x)
ROL::Ptr< Vector< Real > > getGradient(void) const
MoreauYosidaPenalty(const ROL::Ptr< Objective< Real > > &obj, const ROL::Ptr< BoundConstraint< Real > > &con, const ROL::Vector< Real > &x, const Real mu=1e1)