44 #ifndef ROL_MOREAUYOSIDAOBJECTIVE_H
45 #define ROL_MOREAUYOSIDAOBJECTIVE_H
51 #include "ROL_Ptr.hpp"
53 #include "ROL_ParameterList.hpp"
69 const Ptr<Objective<Real>>
obj_;
70 const Ptr<BoundConstraint<Real>>
bnd_;
74 Ptr<Vector<Real>>
l1_;
75 Ptr<Vector<Real>>
u1_;
80 Ptr<Vector<Real>>
dv_;
85 Ptr<ScalarController<Real,int>>
fval_;
96 if (
bnd_->isActivated() ) {
137 fval_ = makePtr<ScalarController<Real,int>>();
138 gradient_ = makePtr<VectorController<Real,int>>();
153 l_->set(*
bnd_->getLowerBound());
154 u_->set(*
bnd_->getUpperBound());
168 const bool updateMultiplier =
true,
169 const bool updatePenalty =
true)
182 const bool updateMultiplier =
true,
183 const bool updatePenalty =
true)
192 ParameterList &parlist)
196 ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
199 mu_ = list.get(
"Initial Penalty Parameter",1e1);
207 ParameterList &parlist)
213 if (
bnd_->isActivated() ) {
238 if (
bnd_->isActivated()) {
242 tmp_->axpy(static_cast<Real>(-1), *
l_);
246 tmp_->axpy(static_cast<Real>(-1), *
u_);
251 tmp_->axpy(static_cast<Real>(-1), x);
252 Real xnorm =
tmp_->norm();
254 val = std::max(xnorm,std::max(lower,upper));
262 bool isComputed =
fval_->get(val,key);
295 obj_->update(x,type,iter);
296 fval_->objectiveUpdate(type);
312 if (
bnd_->isActivated() ) {
313 const Real half(0.5);
331 if (
bnd_->isActivated() ) {
348 obj_->hessVec(hv,v,x,tol);
350 if (
bnd_->isActivated() ) {
358 dv_->set(
v_->dual());
369 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_
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 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)