45 #ifndef ROL_MERITFUNCTION_H 46 #define ROL_MERITFUNCTION_H 64 namespace InteriorPoint {
75 typedef Teuchos::ParameterList
PLIST;
80 const static uint
OPT = 0;
94 Teuchos::RCP<OBJ>
obj_;
95 Teuchos::RCP<EQCON>
eqcon_;
96 Teuchos::RCP<INCON>
incon_;
119 static const Elementwise::Logarithm<Real>
LOG_;
120 static const Elementwise::Reciprocal<Real>
RECIP_;
121 static const Elementwise::ReductionSum<Real>
SUM_;
127 Teuchos::RCP<EQCON> &eqcon,
128 Teuchos::RCP<INCON> &incon,
133 obj_(obj), eqcon_(eqcon), incon_(incon) {
135 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
136 xopt_ = xpv.
get(OPT);
137 slack_ = xpv.
get(SLACK);
138 sfun_ = slack_->clone();
140 gopt_ = xopt_->dual().clone();
142 PLIST &iplist = parlist.sublist(
"Step").sublist(
"Primal-Dual Interior Point");
143 mu_ = iplist.get(
"Initial Slack Penalty");
144 nu_ = iplist.get(
"Initial Constraint Norm Penalty");
149 Real
value(
const V &x, Real &tol ) {
151 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
152 xopt_ = xpv.
get(OPT);
153 slack_ = xpv.
get(SLACK);
157 sfun_->applyUnary(LOG_);
159 Real val = obj_->value(*xopt_,tol);
161 val += mu_*logs_->reduce(SUM_);
163 eqcon_->value(*ce_,*xopt_,tol);
164 incon_->value(*ci_,*xopt_,tol);
166 cenorm_ = ce_->norm();
167 cinorm_ = ci_->norm();
169 val += nu_*(cenorm_ +
cinorm_);
175 Real
dirDeriv(
const V &x,
const V &d, Real tol ) {
177 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
178 xopt_ = xpv.
get(OPT);
179 slack_ = xpv.
get(SLACK);
181 const PV &dpv = Teuchos::dyn_cast<
const PV>(d);
182 Teuchos::RCP<V> dopt = dpv.
get(OPT);
183 Teuchos::RCP<V> dslack = dpv.
get(SLACK);
186 sfun_->applyUnary(RECIP_);
188 ce_->applyJacobian(*jced_,*dopt,*xopt,tol);
189 ci_->applyJacobian(*jcid_,*dopt,*xopt,tol);
191 obj_->gradient(*gopt_,*xopt,tol);
195 Real ddopt = gopt_->dot(*dopt);
197 Real ddslack = sfun_->dot(*dslack);
199 Real ddce = ce_->dot(*jced_)/
cenorm_;
201 Real ddci = ci_->dot(*jcid_)/
cinorm_;
203 Real ddsn = slack_->dot(*dslack)/slack->norm();
205 return ddopt - mu_*ddslack + nu_*(ddce + ddci + ddsn);
222 #endif // ROL_MERITFUNCTION_H Provides the interface to evaluate objective functions.
Teuchos::RCP< V > eqmult_
EqualityConstraint< Real > EQCON
Defines the linear algebra of vector space on a generic partitioned vector.
Teuchos::RCP< const Vector< Real > > get(size_type i) const
Teuchos::RCP< EQCON > eqcon_
static const Elementwise::Reciprocal< Real > RECIP_
Defines the linear algebra or vector space interface.
static const Elementwise::Logarithm< Real > LOG_
Teuchos::RCP< V > inmult_
Teuchos::RCP< INCON > incon_
static const Elementwise::ReductionSum< Real > SUM_
Defines the equality constraint operator interface.
Teuchos::ParameterList PLIST
std::vector< PV >::size_type size_type
Provides a unique argument for inequality constraints, which otherwise behave exactly as equality con...
Real dirDeriv(const V &x, const V &d, Real tol)
MeritFunction(Teuchos::RCP< OBJ > &obj, Teuchos::RCP< EQCON > &eqcon, Teuchos::RCP< INCON > &incon, const V &x, const V &eqmult, const V &inmult, PLIST &parlist)
PartitionedVector< Real > PV
Real value(const V &x, Real &tol)
Compute value.
void updateBarrier(Real mu)
InequalityConstraint< Real > INCON