10 #ifndef ROL_MOREAUYOSIDAOBJECTIVE_H
11 #define ROL_MOREAUYOSIDAOBJECTIVE_H
17 #include "ROL_Ptr.hpp"
19 #include "ROL_ParameterList.hpp"
35 const Ptr<Objective<Real>>
obj_;
36 const Ptr<BoundConstraint<Real>>
bnd_;
40 Ptr<Vector<Real>>
l1_;
41 Ptr<Vector<Real>>
u1_;
46 Ptr<Vector<Real>>
dv_;
51 Ptr<ScalarController<Real,int>>
fval_;
62 if (
bnd_->isActivated() ) {
103 fval_ = makePtr<ScalarController<Real,int>>();
104 gradient_ = makePtr<VectorController<Real,int>>();
119 l_->set(*
bnd_->getLowerBound());
120 u_->set(*
bnd_->getUpperBound());
158 ParameterList &parlist)
162 ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
165 mu_ = list.get(
"Initial Penalty Parameter",1e1);
173 ParameterList &parlist)
181 lam_->axpy(static_cast<Real>(-1),*
l1_);
191 if (
bnd_->isActivated() ) {
218 if (
bnd_->isActivated()) {
222 tmp_->axpy(static_cast<Real>(-1), *
l_);
226 tmp_->axpy(static_cast<Real>(-1), *
u_);
231 tmp_->axpy(static_cast<Real>(-1), x);
232 Real xnorm =
tmp_->norm();
234 val = std::max(xnorm,std::max(lower,upper));
242 bool isComputed =
fval_->get(val,key);
275 obj_->update(x,type,iter);
276 fval_->objectiveUpdate(type);
292 if (
bnd_->isActivated() ) {
293 const Real half(0.5);
311 if (
bnd_->isActivated() ) {
328 obj_->hessVec(hv,v,x,tol);
330 if (
bnd_->isActivated() ) {
338 dv_->set(
v_->dual());
349 dv_->set(
v_->dual());
Provides the interface to evaluate objective functions.
void reset(const Real mu)
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Ptr< Vector< Real > > dl1_
Ptr< Vector< Real > > du1_
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Real getObjectiveValue(const Vector< Real > &x, Real &tol)
Contains definitions of custom data types in ROL.
Ptr< Vector< Real > > dv_
int getNumberGradientEvaluations(void)
Ptr< Vector< Real > > lam_
void updatePenalty(Real mu)
Ptr< Vector< Real > > dv2_
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Defines the linear algebra or vector space interface.
MoreauYosidaObjective(const Ptr< Objective< Real >> &obj, const Ptr< BoundConstraint< Real >> &bnd, const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &lam, ParameterList &parlist)
void updateMultiplier(const Vector< Real > &x)
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
int getNumberFunctionEvaluations(void)
Ptr< ScalarController< Real, int > > fval_
void updateMultipliers(Real mu, const Vector< Real > &x)
void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update Moreau-Yosida penalty function.
Ptr< Vector< Real > > l1_
Provides the interface to evaluate the Moreau-Yosida penalty function.
void computePenalty(const Vector< Real > &x)
Ptr< Vector< Real > > xlam_
Provides the interface to apply upper and lower bound constraints.
const Ptr< BoundConstraint< Real > > bnd_
MoreauYosidaObjective(const Ptr< Objective< Real >> &obj, const Ptr< BoundConstraint< Real >> &bnd, const Vector< Real > &x, const Vector< Real > &g, const Real mu=1e1, const bool updateMultiplier=true, const bool updatePenalty=true)
MoreauYosidaObjective(const Ptr< Objective< Real >> &obj, const Ptr< BoundConstraint< Real >> &bnd, const Vector< Real > &x, const Vector< Real > &g, ParameterList &parlist)
Ptr< Vector< Real > > u1_
void initialize(const Vector< Real > &x, const Vector< Real > &g)
void getObjectiveGradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
Ptr< Vector< Real > > tmp_
Real testComplementarity(const Vector< Real > &x)
const Ptr< Objective< Real > > obj_
Ptr< VectorController< Real, int > > gradient_
MoreauYosidaObjective(const Ptr< Objective< Real >> &obj, const Ptr< BoundConstraint< Real >> &bnd, const Vector< Real > &x, const Vector< Real > &g, const Vector< Real > &lam, const Real mu=1e1, const bool updateMultiplier=true, const bool updatePenalty=true)