44 #ifndef ROL_BPOE_BOUND_CONSTRAINT_H 45 #define ROL_BPOE_BOUND_CONSTRAINT_H 55 Teuchos::RCP<BoundConstraint<Real> >
bc_;
63 if ( bc_ != Teuchos::null ) {
64 Teuchos::RCP<const Vector<Real> > xv
66 bc_->update(*xv,flag,iter);
72 xvar = ((xvar > 0.0) ? xvar : 0.0);
73 (Teuchos::dyn_cast<CVaRVector<Real> >(x)).setVaR(xvar);
74 if ( bc_ != Teuchos::null ) {
75 Teuchos::RCP<Vector<Real> > xvec = Teuchos::rcp_const_cast<
Vector<Real> >(
76 (Teuchos::dyn_cast<CVaRVector<Real> >(x)).getVector());
78 (Teuchos::dyn_cast<CVaRVector<Real> >(x)).setVector(*xvec);
83 if ( bc_ != Teuchos::null ) {
84 Teuchos::RCP<Vector<Real> > vvec = Teuchos::rcp_const_cast<
Vector<Real> >(
86 Teuchos::RCP<const Vector<Real> > xvec =
88 bc_->pruneUpperActive(*vvec,*xvec,eps);
93 if ( bc_ != Teuchos::null ) {
94 Teuchos::RCP<Vector<Real> > vvec = Teuchos::rcp_const_cast<
Vector<Real> >(
96 Teuchos::RCP<const Vector<Real> > gvec =
98 Teuchos::RCP<const Vector<Real> > xvec =
100 bc_->pruneUpperActive(*vvec,*gvec,*xvec,eps);
109 if ( bc_ != Teuchos::null ) {
110 Teuchos::RCP<Vector<Real> > vvec = Teuchos::rcp_const_cast<
Vector<Real> >(
112 Teuchos::RCP<const Vector<Real> > xvec
114 bc_->pruneLowerActive(*vvec,*xvec,eps);
121 if ( xvar <= eps && gvar > 0.0 ) {
124 if ( bc_ != Teuchos::null ) {
125 Teuchos::RCP<Vector<Real> > vvec = Teuchos::rcp_const_cast<
Vector<Real> >(
127 Teuchos::RCP<const Vector<Real> > gvec
129 Teuchos::RCP<const Vector<Real> > xvec
131 bc_->pruneLowerActive(*vvec,*gvec,*xvec,eps);
138 if ( bc_ != Teuchos::null ) {
139 Teuchos::RCP<Vector<Real> > uvec = Teuchos::rcp_const_cast<
Vector<Real> >(
141 bc_->setVectorToUpperBound(*uvec);
147 if ( bc_ != Teuchos::null ) {
148 Teuchos::RCP<Vector<Real> > lvec = Teuchos::rcp_const_cast<
Vector<Real> >(
150 bc_->setVectorToLowerBound(*lvec);
159 if ( bc_ != Teuchos::null ) {
160 Teuchos::RCP<Vector<Real> > vvec = Teuchos::rcp_const_cast<
Vector<Real> >(
162 Teuchos::RCP<const Vector<Real> > xvec =
164 bc_->pruneActive(*vvec,*xvec,eps);
171 if ( xvar <= eps && gvar > 0.0 ) {
174 if ( bc_ != Teuchos::null ) {
175 Teuchos::RCP<Vector<Real> > vvec = Teuchos::rcp_const_cast<
Vector<Real> >(
177 Teuchos::RCP<const Vector<Real> > gvec =
179 Teuchos::RCP<const Vector<Real> > xvec =
181 bc_->pruneActive(*vvec,*gvec,*xvec,eps);
188 if ( bc_ != Teuchos::null ) {
189 Teuchos::RCP<const Vector<Real> > vvec
191 if ( bc_->isActivated() ) {
192 flag = ((bc_->isFeasible(*vvec)) && (vvar >= 0.0));
196 if ( bc_->isActivated() ) {
197 flag = (vvar >= 0.0);
void pruneActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real eps=0.0)
Set variables to zero if they correspond to the -binding set.
void pruneLowerActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real eps=0.0)
Set variables to zero if they correspond to the lower -binding set.
BPOEBoundConstraint(Teuchos::RCP< BoundConstraint< Real > > &bc)
void pruneUpperActive(Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
Set variables to zero if they correspond to the upper -active set.
void pruneActive(Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
Set variables to zero if they correspond to the -active set.
void setVectorToUpperBound(Vector< Real > &u)
Set the input vector to the upper bound.
Defines the linear algebra or vector space interface.
const Real getVaR() const
void pruneUpperActive(Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real eps=0.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.
void setVectorToLowerBound(Vector< Real > &l)
Set the input vector to the lower bound.
bool isFeasible(const Vector< Real > &v)
Check if the vector, v, is feasible.
BPOEBoundConstraint(void)
void project(Vector< Real > &x)
Project optimization variables onto the bounds.
Provides the interface to apply upper and lower bound constraints.
void pruneLowerActive(Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
Set variables to zero if they correspond to the lower -active set.
static const double ROL_OVERFLOW
Platform-dependent maximum double.
Teuchos::RCP< BoundConstraint< Real > > bc_