44 #ifndef ROL_INTERIORPOINTOBJECTIVE_H
45 #define ROL_INTERIORPOINTOBJECTIVE_H
49 #include "ROL_ParameterList.hpp"
70 const Ptr<Objective<Real>>
obj_;
71 const Ptr<BoundConstraint<Real>>
bnd_;
72 const Ptr<const Vector<Real>>
lo_;
73 const Ptr<const Vector<Real>>
up_;
87 Ptr<ScalarController<Real,int>>
fval_;
97 Real
apply(
const Real &x )
const {
98 const Real
zero(0), NINF(ROL_NINF<Real>());
99 return (x>
zero) ? std::log(x) : NINF;
109 const Real
zero(0), one(1);
120 Real
apply(
const Real &x,
const Real &y )
const {
122 return (x>zero) ? y/x :
zero;
131 class Mask :
public Elementwise::BinaryFunction<Real> {
136 Real
apply(
const Real &x,
const Real &y )
const {
143 const Real
zero(0), one(1);
145 fval_ = makePtr<ScalarController<Real,int>>();
146 gradient_ = makePtr<VectorController<Real,int>>();
149 ValueSet isBoundedBelow( ROL_NINF<Real>(), ValueSet::GREATER_THAN, one,
zero );
150 ValueSet isBoundedAbove( ROL_INF<Real>(), ValueSet::LESS_THAN, one,
zero );
177 const bool useLinearDamping,
180 :
obj_(obj),
bnd_(bnd),
lo_(bnd->getLowerBound()),
up_(bnd->getUpperBound()),
190 ParameterList &parlist )
191 :
obj_(obj),
bnd_(bnd),
lo_(bnd->getLowerBound()),
up_(bnd->getUpperBound()),
193 ParameterList &iplist = parlist.sublist(
"Step").sublist(
"Primal Dual Interior Point");
194 ParameterList &lblist = iplist.sublist(
"Barrier Objective");
197 kappaD_ = lblist.get(
"Linear Damping Coefficient", 1.e-4);
198 mu_ = lblist.get(
"Initial Barrier Parameter", 0.1);
206 bool isComputed =
fval_->get(val,key);
236 obj_->update(x,type,iter);
237 fval_->objectiveUpdate(type);
242 const Real
zero(0), one(1);
243 Real linearTerm =
zero;
248 Elementwise::ReductionSum<Real> sum;
249 Elementwise::Multiply<Real> mult;
257 pwa_->applyUnary(mlog);
266 pwa_->applyUnary(mlog);
269 fval -=
mu_*(aval+bval);
284 pwa_->applyUnary(mrec);
293 pwa_->applyUnary(mrec);
302 const Real one(1), two(2);
304 obj_->hessVec(hv,v,x,tol);
308 Elementwise::Multiply<Real> mult;
309 Elementwise::Power<Real> square(two);
313 pwa_->applyUnary(mrec);
315 pwa_->applyUnary(square);
317 pwa_->applyBinary(mult,v);
322 pwa_->applyUnary(mrec);
324 pwa_->applyUnary(square);
326 pwa_->applyBinary(mult,v);
334 #endif // ROL_INTERIORPOINTOBJECTIVE_H
Provides the interface to evaluate objective functions.
InteriorPointObjective(const Ptr< Objective< Real >> &obj, const Ptr< BoundConstraint< Real >> &bnd, const Vector< Real > &x, const Vector< Real > &g, ParameterList &parlist)
virtual const Vector & dual() const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
const Ptr< const Vector< Real > > lo_
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
Ptr< Vector< Real > > maskL0_
Defines the linear algebra or vector space interface.
void initialize(const Vector< Real > &x, const Vector< Real > &g)
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
void updatePenalty(const Real mu)
Ptr< ScalarController< Real, int > > fval_
Real apply(const Real &x) const
Ptr< Vector< Real > > maskL_
Real apply(const Real &x, const Real &y) const
int getNumberGradientEvaluations(void) const
Ptr< Vector< Real > > maskU0_
void update(const Vector< Real > &x, UpdateType type, int iter=-1)
Update objective function.
const Ptr< Objective< Real > > obj_
Ptr< Vector< Real > > pwa_
Provides the interface to apply upper and lower bound constraints.
Real apply(const Real &x) const
Ptr< Vector< Real > > maskU_
Elementwise::ValueSet< Real > ValueSet
const Ptr< BoundConstraint< Real > > bnd_
Real value(const Vector< Real > &x, Real &tol)
Compute value.
const Ptr< const Vector< Real > > getObjectiveGradient(const Vector< Real > &x, Real &tol)
const Ptr< const Vector< Real > > up_
int getNumberFunctionEvaluations(void) const
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
virtual void set(const Vector &x)
Set where .
Ptr< VectorController< Real, int > > gradient_
InteriorPointObjective(const Ptr< Objective< Real >> &obj, const Ptr< BoundConstraint< Real >> &bnd, const Vector< Real > &x, const Vector< Real > &g, const bool useLinearDamping, const Real kappaD, const Real mu)
Real apply(const Real &x, const Real &y) const
Real getObjectiveValue(const Vector< Real > &x, Real &tol)