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());
134 const bool updateMultiplier =
true,
135 const bool updatePenalty =
true)
148 const bool updateMultiplier =
true,
149 const bool updatePenalty =
true)
158 ParameterList &parlist)
162 ParameterList &list = parlist.sublist(
"Step").sublist(
"Moreau-Yosida Penalty");
165 mu_ = list.get(
"Initial Penalty Parameter",1e1);
173 ParameterList &parlist)
179 if (
bnd_->isActivated() ) {
204 if (
bnd_->isActivated()) {
208 tmp_->axpy(static_cast<Real>(-1), *
l_);
212 tmp_->axpy(static_cast<Real>(-1), *
u_);
217 tmp_->axpy(static_cast<Real>(-1), x);
218 Real xnorm =
tmp_->norm();
220 val = std::max(xnorm,std::max(lower,upper));
228 bool isComputed =
fval_->get(val,key);
261 obj_->update(x,type,iter);
262 fval_->objectiveUpdate(type);
278 if (
bnd_->isActivated() ) {
279 const Real half(0.5);
297 if (
bnd_->isActivated() ) {
314 obj_->hessVec(hv,v,x,tol);
316 if (
bnd_->isActivated() ) {
324 dv_->set(
v_->dual());
335 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)