41 #ifndef ROL_INTERIORPOINT_H 42 #define ROL_INTERIORPOINT_H 50 namespace InteriorPoint {
67 Teuchos::RCP<Objective<Real> >
obj_;
90 x_(Teuchos::null),
g_(Teuchos::null),
scratch_(Teuchos::null),
94 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
96 x_ = Teuchos::rcp_static_cast<
PV>(xpv.
clone());
108 x_(Teuchos::null),
g_(Teuchos::null),
scratch_(Teuchos::null),
112 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
114 x_ = Teuchos::rcp_static_cast<
PV>(xpv.
clone());
149 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
151 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
152 Teuchos::RCP<const V> xs = xpv.
get(
SLACK);
154 obj_->update(*xo,flag,iter);
171 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
173 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
174 Teuchos::RCP<const V> xs = xpv.
get(
SLACK);
209 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
210 PV &gpv = Teuchos::dyn_cast<
PV>(g);
212 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
213 Teuchos::RCP<const V> xs = xpv.
get(
SLACK);
215 Teuchos::RCP<V> go = gpv.get(
OPT);
216 Teuchos::RCP<V> gs = gpv.get(
SLACK);
218 obj_->gradient(*go,*xo,tol);
258 using Teuchos::RCP;
using Teuchos::dyn_cast;
260 const PV &xpv = dyn_cast<
const PV>(x);
261 const PV &vpv = dyn_cast<
const PV>(v);
262 PV &hvpv = dyn_cast<
PV>(hv);
264 RCP<const V> xo = xpv.
get(
OPT);
267 RCP<const V> vo = vpv.get(
OPT);
268 RCP<const V> vs = vpv.get(
SLACK);
270 RCP<V> hvo = hvpv.get(
OPT);
271 RCP<V> hvs = hvpv.get(
SLACK);
273 obj_->hessVec(*hvo, *vo, *xo, tol);
311 Teuchos::RCP<InequalityConstraint<Real> >
incon_;
312 Teuchos::RCP<EqualityConstraint<Real> >
eqcon_;
338 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
340 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
341 Teuchos::RCP<const V> xs = xpv.
get(
SLACK);
343 incon_->update(*xo,flag,iter);
346 eqcon_->update(*xo,flag,iter);
353 PV &cpv = Teuchos::dyn_cast<
PV>(c);
354 const PV &xpv = Teuchos::dyn_cast<
const PV>(x);
356 Teuchos::RCP<const V> xo = xpv.
get(
OPT);
357 Teuchos::RCP<const V> xs = xpv.get(
SLACK);
359 Teuchos::RCP<V> ci = cpv.
get(
INEQ);
362 incon_->value(*ci, *xo, tol);
367 eqcon_->value(*ce, *xo, tol);
379 using Teuchos::RCP;
using Teuchos::dyn_cast;
382 const PV &xpv = dyn_cast<
const PV>(x);
383 const PV &vpv = dyn_cast<
const PV>(v);
385 RCP<const V> xo = xpv.
get(
OPT);
388 RCP<const V> vo = vpv.get(
OPT);
389 RCP<const V> vs = vpv.get(
SLACK);
391 PV &jvpv = dyn_cast<
PV>(jv);
394 incon_->applyJacobian(*jvi, *vo, *xo, tol);
399 eqcon_->applyJacobian(*jve, *vo, *xo, tol);
409 using Teuchos::RCP;
using Teuchos::dyn_cast;
412 const PV &xpv = dyn_cast<
const PV>(x);
413 PV &ajvpv = dyn_cast<
PV>(ajv);
415 RCP<const V> xo = xpv.
get(
OPT);
418 RCP<V> ajvo = ajvpv.get(
OPT);
419 RCP<V> ajvs = ajvpv.get(
SLACK);
421 const PV &vpv = dyn_cast<
const PV>(v);
423 RCP<const V> vi = vpv.
get(
INEQ);
425 incon_->applyAdjointJacobian(*ajvo,*vi,*xo,tol);
433 RCP<V> temp = ajvo->clone();
434 eqcon_->applyAdjointJacobian(*temp,*ve,*xo,tol);
447 using Teuchos::RCP;
using Teuchos::dyn_cast;
449 const PV &xpv = dyn_cast<
const PV>(x);
450 const PV &vpv = dyn_cast<
const PV>(v);
451 PV &ahuvpv = dyn_cast<
PV>(ahuv);
453 RCP<const V> xo = xpv.
get(
OPT);
456 RCP<const V> vo = vpv.get(
OPT);
458 RCP<V> ahuvo = ahuvpv.get(
OPT);
459 RCP<V> ahuvs = ahuvpv.get(
SLACK);
461 RCP<V> temp = ahuvo->clone();
463 const PV &upv = dyn_cast<
const PV>(u);
465 RCP<const V> ui = upv.
get(
INEQ);
467 incon_->applyAdjointHessian(*ahuvo,*ui,*vo,*xo,tol);
472 eqcon_->applyAdjointHessian(*temp,*ue,*vo,*xo,tol);
Provides the interface to evaluate objective functions.
int getNumberFunctionEvaluations(void)
static const size_type SLACK
void applyAdjointHessian(Vector< Real > &ahuv, const Vector< Real > &u, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the derivative of the adjoint of the constraint Jacobian at to vector in direction ...
void gradient(Vector< Real > &g, const Vector< Real > &x, Real &tol)
Compute gradient.
PartitionedVector< Real > PV
CompositeConstraint(const Teuchos::RCP< InequalityConstraint< Real > > &incon, const Teuchos::RCP< EqualityConstraint< Real > > &eqcon)
void applyAdjointJacobian(Vector< Real > &ajv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the adjoint of the the constraint Jacobian at , , to vector .
void getObjectiveGradient(Vector< Real > &g)
Defines the linear algebra of vector space on a generic partitioned vector.
Has both inequality and equality constraints. Treat inequality constraint as equality with slack vari...
PartitionedVector< Real > PV
Teuchos::RCP< V > scratch_
Teuchos::RCP< const Vector< Real > > get(size_type i) const
int getNumberConstraintEvaluations(void)
int getNumberGradientEvaluations(void)
virtual Teuchos::RCP< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
const V & dual(void) const
Return dual representation of , for example, the result of applying a Riesz map, or change of basis...
static const size_type OPT
Defines the linear algebra or vector space interface.
PenalizedObjective(const Teuchos::RCP< Objective< Real > > &obj, const Teuchos::RCP< Objective< Real > > &slack_barrier, const Vector< Real > &x, Real mu)
Real value(const Vector< Real > &x, Real &tol)
Compute value.
Defines the equality constraint operator interface.
static const size_type SLACK
PenalizedObjective(const Teuchos::RCP< Objective< Real > > &obj, const Teuchos::RCP< Objective< Real > > &slack_barrier, const Teuchos::RCP< Objective< Real > > &bc_barrier, const Vector< Real > &x, Real mu)
CompositeConstraint(const Teuchos::RCP< InequalityConstraint< Real > > &incon)
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update barrier penalized objective function.
Teuchos::RCP< InequalityConstraint< Real > > incon_
Teuchos::RCP< Objective< Real > > slack_barrier_
void updatePenalty(Real mu)
void applyJacobian(Vector< Real > &jv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply the constraint Jacobian at , , to vector .
void hessVec(Vector< Real > &hv, const Vector< Real > &v, const Vector< Real > &x, Real &tol)
Apply Hessian approximation to vector.
std::vector< PV >::size_type size_type
RCPV clone() const
Clone to make a new (uninitialized) vector.
Teuchos::RCP< Objective< Real > > obj_
Provides a unique argument for inequality constraints, which otherwise behave exactly as equality con...
virtual Real norm() const =0
Returns where .
Teuchos::RCP< Objective< Real > > bc_barrier_
static const size_type OPT
static const size_type EQUAL
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update constraint functions. x is the optimization variable, flag = true if optimization variable i...
void value(Vector< Real > &c, const Vector< Real > &x, Real &tol)
Evaluate the constraint operator at .
static const size_type INEQ
Teuchos::RCP< EqualityConstraint< Real > > eqcon_