44 #ifndef ROL_BOUND_CONSTRAINT_SIMOPT_H 45 #define ROL_BOUND_CONSTRAINT_SIMOPT_H 75 Ptr<BoundConstraint<Real>>
bnd1_;
76 Ptr<BoundConstraint<Real>>
bnd2_;
88 if (
bnd1_->isActivated() ||
bnd2_->isActivated() ) {
106 if (
bnd1_->isActivated() ) {
109 if (
bnd2_->isActivated() ) {
125 if (
bnd1_->isActivated() ) {
126 Ptr<Vector<Real>> x1 = xs.
get_1()->clone(); x1->set(*(xs.
get_1()));
130 if (
bnd2_->isActivated() ) {
131 Ptr<Vector<Real>> x2 = xs.
get_2()->clone(); x2->set(*(xs.
get_2()));
150 if (
bnd1_->isActivated() ) {
151 Ptr<Vector<Real>> x1 = xs.
get_1()->clone(); x1->set(*(xs.
get_1()));
152 bnd1_->projectInterior(*x1);
155 if (
bnd2_->isActivated() ) {
156 Ptr<Vector<Real>> x2 = xs.
get_2()->clone(); x2->set(*(xs.
get_2()));
157 bnd2_->projectInterior(*x2);
174 if (
bnd1_->isActivated() ) {
178 if (
bnd2_->isActivated() ) {
200 if (
bnd1_->isActivated() ) {
201 Ptr<Vector<Real>> v1 = vs.
get_1()->clone(); v1->set(*(vs.
get_1()));
202 bnd1_->pruneUpperActive(*v1,*(xs.
get_1()),eps);
205 if (
bnd2_->isActivated() ) {
206 Ptr<Vector<Real>> v2 = vs.
get_2()->clone(); v2->set(*(vs.
get_2()));
207 bnd2_->pruneUpperActive(*v2,*(xs.
get_2()),eps);
232 if (
bnd1_->isActivated() ) {
233 Ptr<Vector<Real>> v1 = vs.
get_1()->clone(); v1->set(*(vs.
get_1()));
237 if (
bnd2_->isActivated() ) {
238 Ptr<Vector<Real>> v2 = vs.
get_2()->clone(); v2->set(*(vs.
get_2()));
260 if (
bnd1_->isActivated() ) {
261 Ptr<Vector<Real>> v1 = vs.
get_1()->clone(); v1->set(*(vs.
get_1()));
262 bnd1_->pruneLowerActive(*v1,*(xs.
get_1()),eps);
265 if (
bnd2_->isActivated() ) {
266 Ptr<Vector<Real>> v2 = vs.
get_2()->clone(); v2->set(*(vs.
get_2()));
267 bnd2_->pruneLowerActive(*v2,*(xs.
get_2()),eps);
292 if (
bnd1_->isActivated() ) {
293 Ptr<Vector<Real>> v1 = vs.
get_1()->clone(); v1->set(*(vs.
get_1()));
297 if (
bnd2_->isActivated() ) {
298 Ptr<Vector<Real>> v2 = vs.
get_2()->clone(); v2->set(*(vs.
get_2()));
305 const Ptr<const Vector<Real>> l1 =
bnd1_->getLowerBound();
306 const Ptr<const Vector<Real>> l2 =
bnd2_->getLowerBound();
307 return makePtr<Vector_SimOpt<Real>>( constPtrCast<Vector<Real>>(l1),
312 const Ptr<const Vector<Real>> u1 =
bnd1_->getUpperBound();
313 const Ptr<const Vector<Real>> u2 =
bnd2_->getUpperBound();
314 return makePtr<Vector_SimOpt<Real>>( constPtrCast<Vector<Real>>(u1),
334 if (
bnd1_->isActivated() ) {
335 Ptr<Vector<Real>> v1 = vs.
get_1()->clone(); v1->set(*(vs.
get_1()));
339 if (
bnd2_->isActivated() ) {
340 Ptr<Vector<Real>> v2 = vs.
get_2()->clone(); v2->set(*(vs.
get_2()));
362 if (
bnd1_->isActivated() ) {
363 Ptr<Vector<Real>> v1 = vs.
get_1()->clone(); v1->set(*(vs.
get_1()));
367 if (
bnd2_->isActivated() ) {
368 Ptr<Vector<Real>> v2 = vs.
get_2()->clone(); v2->set(*(vs.
get_2()));
void pruneActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the -active set.
~BoundConstraint_SimOpt()
bool isFeasible(const Vector< Real > &v)
Check if the vector, v, is feasible.
void pruneUpperActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the upper -active set.
void pruneLowerActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the lower -active set.
Defines the linear algebra or vector space interface for simulation-based optimization.
void activate(void)
Turn on bounds.
Contains definitions of custom data types in ROL.
void set_1(const Vector< Real > &vec)
BoundConstraint_SimOpt(const Ptr< BoundConstraint< Real >> &bnd1, const Ptr< BoundConstraint< Real >> &bnd2)
Default constructor.
Defines the linear algebra or vector space interface.
ROL::Ptr< const Vector< Real > > get_2() const
Ptr< BoundConstraint< Real > > bnd1_
void pruneActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0))
Set variables to zero if they correspond to the -binding set.
bool checkMultipliers(const Vector< Real > &l, const Vector< Real > &x)
Determine if a vector of Lagrange multipliers is nonnegative components.
ROL::Ptr< const Vector< Real > > get_1() const
void projectInterior(Vector< Real > &x)
Project optimization variables into the interior of the feasible set.
const Ptr< const Vector< Real > > getLowerBound(void) const
Return the ref count pointer to the lower bound vector.
const Ptr< const Vector< Real > > getUpperBound(void) const
Return the ref count pointer to the upper bound vector.
void pruneUpperActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0))
Set variables to zero if they correspond to the upper -binding set.
void update(const Vector< Real > &x, bool flag=true, int iter=-1)
Update bounds.
Provides the interface to apply upper and lower bound constraints.
Ptr< BoundConstraint< Real > > bnd2_
void pruneLowerActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0))
Set variables to zero if they correspond to the lower -binding set.
void deactivate(void)
Turn off bounds.
void project(Vector< Real > &x)
Project optimization variables onto the bounds.
void set_2(const Vector< Real > &vec)