44 #ifndef ROL_EXPLICIT_LINEAR_CONSTRAINT_H
45 #define ROL_EXPLICIT_LINEAR_CONSTRAINT_H
65 const Ptr<Constraint<Real>>
lcon_;
66 const Ptr<Objective<Real>>
obj_;
67 const Ptr<Vector<Real>>
x_;
68 std::vector<Ptr<Constraint<Real>>>
con_;
72 Ptr<NullSpaceOperator<Real>>
nsop_;
73 Ptr<AffineTransformObjective<Real>>
aobj_;
74 std::vector<Ptr<AffineTransformConstraint<Real>>>
acon_;
77 Real tol = std::sqrt(ROL_EPSILON<Real>());
78 Ptr<Vector<Real>> ran = c->clone();
80 Real cnorm = ran->norm();
81 if ( cnorm > static_cast<Real>(1e-4)*tol ) {
83 Ptr<Vector<Real>> xzero =
x_->clone(); xzero->zero();
84 lcon_->value(*ran,*xzero,tol);
85 ran->scale(static_cast<Real>(-1));
100 storage_ = makePtr<SimController<Real>>();
101 nsop_ = makePtr<NullSpaceOperator<Real>>(lcon,
x_,c);
113 nsop_ = makePtr<NullSpaceOperator<Real>>(lcon,
x_,c);
126 storage_ = makePtr<SimController<Real>>();
127 nsop_ = makePtr<NullSpaceOperator<Real>>(lcon,
x_,c);
130 int size =
con_.size();
131 for (
int i = 0; i < size; ++i) {
145 if (ind < 0 || ind >= static_cast<int>(
con_.size())) {
160 if (ind < 0 || ind >= static_cast<int>(
acon_.size())) {
168 Real tol = std::sqrt(ROL_EPSILON<Real>());
169 nsop_->apply(*x,*y,tol);
const Ptr< Objective< Real > > obj_
const ROL::Ptr< Constraint< Real > > getTransformedConstraint(const int ind=0) const
Provides the interface to evaluate objective functions.
const ROL::Ptr< Objective< Real > > getTransformedObjective(void) const
const Ptr< Vector< Real > > x_
Projects on to the null space of a linear constraint.
std::vector< Ptr< Constraint< Real > > > con_
ExplicitLinearConstraint(const Ptr< Constraint< Real >> &lcon, const Ptr< Objective< Real >> &obj, const std::vector< Ptr< Constraint< Real >>> &con, const Ptr< Vector< Real >> &x, const Ptr< Vector< Real >> &c)
ExplicitLinearConstraint(const Ptr< Constraint< Real >> &lcon, const Ptr< Objective< Real >> &obj, const Ptr< Constraint< Real >> &con, const Ptr< Vector< Real >> &x, const Ptr< Vector< Real >> &c)
const ROL::Ptr< Vector< Real > > getFeasibleVector(void) const
Ptr< SimController< Real > > storage_
virtual ~ExplicitLinearConstraint(void)
Defines the linear algebra or vector space interface.
Ptr< AffineTransformObjective< Real > > aobj_
Performs null-space transformation for explicit linear equality constraints.
ExplicitLinearConstraint(const Ptr< Constraint< Real >> &lcon, const Ptr< Objective< Real >> &obj, const Ptr< Vector< Real >> &x, const Ptr< Vector< Real >> &c)
const Ptr< Constraint< Real > > lcon_
void feasible(const Ptr< Vector< Real >> &c)
Ptr< NullSpaceOperator< Real > > nsop_
std::vector< Ptr< AffineTransformConstraint< Real > > > acon_
const ROL::Ptr< Constraint< Real > > getExplicitConstraint(void) const
virtual void apply(Vector< Real > &Hv, const Vector< Real > &v, Real &tol) const
Apply linear operator.
const ROL::Ptr< Constraint< Real > > getConstraint(const int ind=0) const
Defines the general constraint operator interface.
virtual void project(Ptr< Vector< Real >> &x, const Ptr< Vector< Real >> &y) const
const ROL::Ptr< Objective< Real > > getObjective(void) const