44 #ifndef ROL_MOREAUYOSIDAOBJECTIVE_H 45 #define ROL_MOREAUYOSIDAOBJECTIVE_H 51 #include "ROL_Ptr.hpp" 68 const Ptr<Objective<Real>>
obj_;
69 const Ptr<BoundConstraint<Real>>
bnd_;
73 Ptr<Vector<Real>>
l1_;
74 Ptr<Vector<Real>>
u1_;
79 Ptr<Vector<Real>>
dv_;
84 Ptr<ScalarController<Real,int>>
fval_;
95 if (
bnd_->isActivated() ) {
136 fval_ = makePtr<ScalarController<Real,int>>();
137 gradient_ = makePtr<VectorController<Real,int>>();
152 l_->set(*
bnd_->getLowerBound());
153 u_->set(*
bnd_->getUpperBound());
167 const bool updateMultiplier =
true,
168 const bool updatePenalty =
true)
181 const bool updateMultiplier =
true,
182 const bool updatePenalty =
true)
191 ParameterList &parlist)
195 ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
198 mu_ = list.get(
"Initial Penalty Parameter",1e1);
206 ParameterList &parlist)
212 if (
bnd_->isActivated() ) {
237 if (
bnd_->isActivated()) {
241 tmp_->axpy(static_cast<Real>(-1), *
l_);
245 tmp_->axpy(static_cast<Real>(-1), *
u_);
250 tmp_->axpy(static_cast<Real>(-1), x);
251 Real xnorm =
tmp_->norm();
253 val = std::max(xnorm,std::max(lower,upper));
261 bool isComputed =
fval_->get(val,key);
294 obj_->update(x,type,iter);
295 fval_->objectiveUpdate(type);
311 if (
bnd_->isActivated() ) {
312 const Real half(0.5);
330 if (
bnd_->isActivated() ) {
347 obj_->hessVec(hv,v,x,tol);
349 if (
bnd_->isActivated() ) {
357 dv_->set(
v_->dual());
368 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)