10#ifndef ROL_TYPEBINDICATOROBJECTIVE_H
11#define ROL_TYPEBINDICATOROBJECTIVE_H
26template<
typename Real>
29 const Ptr<PolyhedralProjection<Real>>
proj_;
30 const Ptr<Vector<Real>>
res_;
55 auto xz = x.
clone(); xz->zero();
56 Real tol(std::sqrt(ROL_EPSILON<Real>()));
57 tol_ =
static_cast<Real
>(1e-2)*tol;
58 proj_->getLinearConstraint()->value(*
res_,*xz,tol);
59 Real rnorm =
res_->norm();
60 if (rnorm > ROL_EPSILON<Real>())
tol_ *= rnorm;
68 bool isBndFeasible =
proj_->getBoundConstraint()->isFeasible(x);
69 bool isConFeasible =
true;
70 if (
res_ != nullPtr) {
71 proj_->getLinearConstraint()->value(*
res_,x,tol);
72 if (
res_->norm() >
tol_) isConFeasible =
false;
74 return (isBndFeasible && isConFeasible) ?
zero : ROL_INF<Real>();
Objective_SerialSimOpt(const Ptr< Obj > &obj, const V &ui) z0_ zero()
Provides the interface to apply upper and lower bound constraints.
Defines the general constraint operator interface.
Provides the interface to evaluate objective functions.
Provides the interface to evaluate the indicator function of linear constraints.
const Ptr< Vector< Real > > res_
void prox(Vector< Real > &Pv, const Vector< Real > &v, Real t, Real &tol)
Compute the proximity operator.
TypeBIndicatorObjective(const Vector< Real > &xprim, const Vector< Real > &xdual, const Ptr< BoundConstraint< Real > > &bnd, const Ptr< Constraint< Real > > &con, const Vector< Real > &mul, const Vector< Real > &res, ParameterList &list)
const Ptr< PolyhedralProjection< Real > > proj_
Real value(const Vector< Real > &x, Real &tol)
Compute value.
TypeBIndicatorObjective(const Ptr< PolyhedralProjection< Real > > &proj)
void initialize(const Vector< Real > &x)
TypeBIndicatorObjective(const Ptr< BoundConstraint< Real > > &bnd)
Defines the linear algebra or vector space interface.
virtual void set(const Vector &x)
Set where .
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
Ptr< PolyhedralProjection< Real > > PolyhedralProjectionFactory(const Vector< Real > &xprim, const Vector< Real > &xdual, const Ptr< BoundConstraint< Real > > &bnd, const Ptr< Constraint< Real > > &con, const Vector< Real > &mul, const Vector< Real > &res, ParameterList &list)