ROL
Classes | Public Member Functions | Private Attributes | List of all members
ROL::BoundConstraint< Real > Class Template Reference

Provides the interface to apply upper and lower bound constraints. More...

#include <ROL_BoundConstraint.hpp>

+ Inheritance diagram for ROL::BoundConstraint< Real >:

Classes

class  LogicalOr
 
class  Product
 
class  Shift
 

Public Member Functions

virtual ~BoundConstraint ()
 
 BoundConstraint (void)
 
 BoundConstraint (const Teuchos::RCP< Vector< Real > > &x_lo, const Teuchos::RCP< Vector< Real > > &x_up, Real scale=1.0)
 Default constructor. More...
 
virtual void update (const Vector< Real > &x, bool flag=true, int iter=-1)
 Update bounds. More...
 
virtual void project (Vector< Real > &x)
 Project optimization variables onto the bounds. More...
 
virtual void pruneUpperActive (Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
 Set variables to zero if they correspond to the upper \(\epsilon\)-active set. More...
 
virtual 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 \(\epsilon\)-binding set. More...
 
virtual void pruneLowerActive (Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
 Set variables to zero if they correspond to the lower \(\epsilon\)-active set. More...
 
virtual 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 \(\epsilon\)-binding set. More...
 
virtual void setVectorToUpperBound (Vector< Real > &u)
 Set the input vector to the upper bound. More...
 
virtual void setVectorToLowerBound (Vector< Real > &l)
 Set the input vector to the lower bound. More...
 
virtual void pruneActive (Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
 Set variables to zero if they correspond to the \(\epsilon\)-active set. More...
 
virtual 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 \(\epsilon\)-binding set. More...
 
virtual bool isFeasible (const Vector< Real > &v)
 Check if the vector, v, is feasible. More...
 
void activate (void)
 Turn on bounds. More...
 
void deactivate (void)
 Turn off bounds. More...
 
bool isActivated (void)
 Check if bounds are on. More...
 
void pruneInactive (Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
 Set variables to zero if they correspond to the \(\epsilon\)-inactive set. More...
 
void pruneLowerInactive (Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
 
void pruneUpperInactive (Vector< Real > &v, const Vector< Real > &x, Real eps=0.0)
 
void pruneInactive (Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real eps=0.0)
 Set variables to zero if they correspond to the \(\epsilon\)-nonbinding set. More...
 
void pruneLowerInactive (Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real eps=0.0)
 
void pruneUpperInactive (Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real eps=0.0)
 
void computeProjectedGradient (Vector< Real > &g, const Vector< Real > &x)
 Compute projected gradient. More...
 
void computeProjectedStep (Vector< Real > &v, const Vector< Real > &x)
 Compute projected step. More...
 

Private Attributes

int dim_
 
Teuchos::RCP< Vector< Real > > x_lo_
 
Teuchos::RCP< Vector< Real > > x_up_
 
Real scale_
 
bool activated_
 Flag that determines whether or not the constraints are being used. More...
 
Real min_diff_
 
Elementwise::ReductionMin< Real > minimum_
 
ROL::BoundConstraint::Product product
 

Detailed Description

template<class Real>
class ROL::BoundConstraint< Real >

Provides the interface to apply upper and lower bound constraints.

ROL's bound constraint class is to designed to handle point wise bound constraints on optimization variables. That is, let \(\mathcal{X}\) be a Banach space of functions from \(\Xi\) into \(\mathbb{R}\) (for example, \(\Xi\subset\mathbb{R}^d\) for some positive integer \(d\) and \(\mathcal{X}=L^2(\Xi)\) or \(\Xi = \{1,\ldots,n\}\) and \(\mathcal{X}=\mathbb{R}^n\)). For any \(x\in\mathcal{X}\), we consider bounds of the form

\[ a(\xi) \le x(\xi) \le b(\xi) \quad \text{for almost every }\xi\in\Xi. \]

Here, \(a(\xi)\le b(\xi)\) for almost every \(\xi\in\Xi\) and \(a,b\in \mathcal{X}\).

Definition at line 72 of file ROL_BoundConstraint.hpp.

Constructor & Destructor Documentation

template<class Real>
virtual ROL::BoundConstraint< Real >::~BoundConstraint ( )
inlinevirtual

Definition at line 107 of file ROL_BoundConstraint.hpp.

template<class Real>
ROL::BoundConstraint< Real >::BoundConstraint ( void  )
inline

Definition at line 109 of file ROL_BoundConstraint.hpp.

template<class Real>
ROL::BoundConstraint< Real >::BoundConstraint ( const Teuchos::RCP< Vector< Real > > &  x_lo,
const Teuchos::RCP< Vector< Real > > &  x_up,
Real  scale = 1.0 
)
inline

Default constructor.

The default constructor automatically turns the constraints on.

Definition at line 115 of file ROL_BoundConstraint.hpp.

Member Function Documentation

template<class Real>
virtual void ROL::BoundConstraint< Real >::update ( const Vector< Real > &  x,
bool  flag = true,
int  iter = -1 
)
inlinevirtual

Update bounds.

The update function allows the user to update the bounds at each new iterations.

Parameters
[in]xis the optimization variable.
[in]flagis set to true if control is changed.
[in]iteris the outer algorithm iterations count.

Reimplemented in ROL::BoundConstraint_SimOpt< Real >, ROL::BPOEBoundConstraint< Real >, and ROL::CVaRBoundConstraint< Real >.

Definition at line 138 of file ROL_BoundConstraint.hpp.

Referenced by ROL::AugmentedLagrangianStep< Real >::initialize(), and ROL::AugmentedLagrangianStep< Real >::update().

template<class Real>
virtual void ROL::BoundConstraint< Real >::project ( Vector< Real > &  x)
inlinevirtual

Project optimization variables onto the bounds.

This function implements the projection of \(x\) onto the bounds, i.e.,

\[ (P_{[a,b]}(x))(\xi) = \min\{b(\xi),\max\{a(\xi),x(\xi)\}\} \quad \text{for almost every }\xi\in\Xi. \]

Parameters
[in,out]xis the optimization variable.

Reimplemented in H1BoundConstraint< Real >, H1BoundConstraint< Real >, H1BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, BoundConstraint_BurgersControl< Real >, ROL::InteriorPointBoundConstraint< Real >, ROL::BoundConstraint_SimOpt< Real >, ROL::SROMBoundConstraint< Real >, ROL::StdBoundConstraint< Real >, ROL::BPOEBoundConstraint< Real >, and ROL::CVaRBoundConstraint< Real >.

Definition at line 148 of file ROL_BoundConstraint.hpp.

References ROL::BoundConstraint< Real >::Shift::apply(), and ROL::Vector< Real >::applyBinary().

Referenced by ROL::PrimalDualActiveSetStep< Real >::compute(), ROL::TrustRegionStep< Real >::compute(), ROL::LineSearchStep< Real >::compute(), ROL::PrimalDualActiveSetStep< Real >::computeCriticalityMeasure(), ROL::TrustRegionStep< Real >::computeCriticalityMeasure(), ROL::AugmentedLagrangianStep< Real >::computeGradient(), ROL::BoundConstraint< Real >::computeProjectedStep(), ROL::Step< Real >::initialize(), ROL::AugmentedLagrangianStep< Real >::initialize(), ROL::MoreauYosidaPenaltyStep< Real >::initialize(), ROL::PrimalDualActiveSetStep< Real >::initialize(), ROL::TrustRegionStep< Real >::initialize(), ROL::TrustRegionStep< Real >::update(), ROL::LineSearchStep< Real >::update(), ROL::LineSearch< Real >::updateIterate(), and ROL::MoreauYosidaPenaltyStep< Real >::updateState().

template<class Real>
virtual void ROL::BoundConstraint< Real >::pruneUpperActive ( Vector< Real > &  v,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inlinevirtual

Set variables to zero if they correspond to the upper \(\epsilon\)-active set.

This function sets \(v(\xi)=0\) if \(\xi\in\mathcal{A}^+_\epsilon(x)\). Here, the upper \(\epsilon\)-active set is defined as

\[ \mathcal{A}^+_\epsilon(x) = \{\,\xi\in\Xi\,:\,x(\xi) = b(\xi)-\epsilon\,\}. \]

Parameters
[out]vis the variable to be pruned.
[in]xis the current optimization variable.
[in]epsis the active-set tolerance \(\epsilon\).

Reimplemented in H1BoundConstraint< Real >, H1BoundConstraint< Real >, H1BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, BoundConstraint_BurgersControl< Real >, ROL::InteriorPointBoundConstraint< Real >, ROL::BoundConstraint_SimOpt< Real >, ROL::SROMBoundConstraint< Real >, ROL::StdBoundConstraint< Real >, ROL::BPOEBoundConstraint< Real >, and ROL::CVaRBoundConstraint< Real >.

Definition at line 174 of file ROL_BoundConstraint.hpp.

References ROL::BoundConstraint< Real >::Shift::apply(), ROL::Vector< Real >::applyBinary(), ROL::Vector< Real >::clone(), and ROL::BoundConstraint< Real >::product.

Referenced by ROL::PrimalDualActiveSetStep< Real >::compute(), ROL::BoundConstraint< Real >::pruneActive(), and ROL::BoundConstraint< Real >::pruneUpperInactive().

template<class Real>
virtual void ROL::BoundConstraint< Real >::pruneUpperActive ( Vector< Real > &  v,
const Vector< Real > &  g,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inlinevirtual

Set variables to zero if they correspond to the upper \(\epsilon\)-binding set.

This function sets \(v(\xi)=0\) if \(\xi\in\mathcal{B}^+_\epsilon(x)\). Here, the upper \(\epsilon\)-binding set is defined as

\[ \mathcal{B}^+_\epsilon(x) = \{\,\xi\in\Xi\,:\,x(\xi) = b(\xi)-\epsilon,\; g(\xi) < 0 \,\}. \]

Parameters
[out]vis the variable to be pruned.
[in]xis the current optimization variable.
[in]gis the negative search direction.
[in]epsis the active-set tolerance \(\epsilon\).

Reimplemented in H1BoundConstraint< Real >, H1BoundConstraint< Real >, H1BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, BoundConstraint_BurgersControl< Real >, ROL::InteriorPointBoundConstraint< Real >, ROL::BoundConstraint_SimOpt< Real >, ROL::SROMBoundConstraint< Real >, ROL::StdBoundConstraint< Real >, ROL::BPOEBoundConstraint< Real >, and ROL::CVaRBoundConstraint< Real >.

Definition at line 211 of file ROL_BoundConstraint.hpp.

References ROL::BoundConstraint< Real >::Shift::apply(), ROL::Vector< Real >::applyBinary(), ROL::Vector< Real >::clone(), and ROL::BoundConstraint< Real >::product.

template<class Real>
virtual void ROL::BoundConstraint< Real >::pruneLowerActive ( Vector< Real > &  v,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inlinevirtual

Set variables to zero if they correspond to the lower \(\epsilon\)-active set.

This function sets \(v(\xi)=0\) if \(\xi\in\mathcal{A}^-_\epsilon(x)\). Here, the lower \(\epsilon\)-active set is defined as

\[ \mathcal{A}^-_\epsilon(x) = \{\,\xi\in\Xi\,:\,x(\xi) = a(\xi)+\epsilon\,\}. \]

Parameters
[out]vis the variable to be pruned.
[in]xis the current optimization variable.
[in]epsis the active-set tolerance \(\epsilon\).

Reimplemented in H1BoundConstraint< Real >, H1BoundConstraint< Real >, H1BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, BoundConstraint_BurgersControl< Real >, ROL::InteriorPointBoundConstraint< Real >, ROL::BoundConstraint_SimOpt< Real >, ROL::SROMBoundConstraint< Real >, ROL::BPOEBoundConstraint< Real >, ROL::StdBoundConstraint< Real >, and ROL::CVaRBoundConstraint< Real >.

Definition at line 262 of file ROL_BoundConstraint.hpp.

References ROL::BoundConstraint< Real >::Shift::apply(), ROL::Vector< Real >::applyBinary(), and ROL::BoundConstraint< Real >::product.

Referenced by ROL::PrimalDualActiveSetStep< Real >::compute(), ROL::BoundConstraint< Real >::pruneActive(), and ROL::BoundConstraint< Real >::pruneLowerInactive().

template<class Real>
virtual void ROL::BoundConstraint< Real >::pruneLowerActive ( Vector< Real > &  v,
const Vector< Real > &  g,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inlinevirtual

Set variables to zero if they correspond to the lower \(\epsilon\)-binding set.

This function sets \(v(\xi)=0\) if \(\xi\in\mathcal{B}^-_\epsilon(x)\). Here, the lower \(\epsilon\)-binding set is defined as

\[ \mathcal{B}^-_\epsilon(x) = \{\,\xi\in\Xi\,:\,x(\xi) = a(\xi)+\epsilon,\; g(\xi) > 0 \,\}. \]

Parameters
[out]vis the variable to be pruned.
[in]xis the current optimization variable.
[in]gis the negative search direction.
[in]epsis the active-set tolerance \(\epsilon\).

Reimplemented in H1BoundConstraint< Real >, H1BoundConstraint< Real >, H1BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, BoundConstraint_BurgersControl< Real >, ROL::InteriorPointBoundConstraint< Real >, ROL::BoundConstraint_SimOpt< Real >, ROL::SROMBoundConstraint< Real >, ROL::StdBoundConstraint< Real >, ROL::BPOEBoundConstraint< Real >, and ROL::CVaRBoundConstraint< Real >.

Definition at line 300 of file ROL_BoundConstraint.hpp.

References ROL::BoundConstraint< Real >::Shift::apply(), ROL::Vector< Real >::applyBinary(), ROL::Vector< Real >::clone(), and ROL::BoundConstraint< Real >::product.

template<class Real>
virtual void ROL::BoundConstraint< Real >::setVectorToUpperBound ( Vector< Real > &  u)
inlinevirtual
template<class Real>
virtual void ROL::BoundConstraint< Real >::setVectorToLowerBound ( Vector< Real > &  l)
inlinevirtual
template<class Real>
virtual void ROL::BoundConstraint< Real >::pruneActive ( Vector< Real > &  v,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inlinevirtual

Set variables to zero if they correspond to the \(\epsilon\)-active set.

This function sets \(v(\xi)=0\) if \(\xi\in\mathcal{A}_\epsilon(x)\). Here, the \(\epsilon\)-active set is defined as

\[ \mathcal{A}_\epsilon(x) = \mathcal{A}^+_\epsilon(x)\cap\mathcal{A}^-_\epsilon(x). \]

Parameters
[out]vis the variable to be pruned.
[in]xis the current optimization variable.
[in]epsis the active-set tolerance \(\epsilon\).

Reimplemented in H1BoundConstraint< Real >, H1BoundConstraint< Real >, H1BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, ROL::BoundConstraint_SimOpt< Real >, ROL::BPOEBoundConstraint< Real >, ROL::SROMBoundConstraint< Real >, ROL::StdBoundConstraint< Real >, and ROL::CVaRBoundConstraint< Real >.

Definition at line 369 of file ROL_BoundConstraint.hpp.

References ROL::BoundConstraint< Real >::pruneLowerActive(), and ROL::BoundConstraint< Real >::pruneUpperActive().

Referenced by ROL::PrimalDualActiveSetStep< Real >::compute(), ROL::LineSearchStep< Real >::compute(), ROL::BoundConstraint< Real >::computeProjectedGradient(), ROL::BoundConstraint< Real >::pruneInactive(), and ROL::LineSearch< Real >::status().

template<class Real>
virtual void ROL::BoundConstraint< Real >::pruneActive ( Vector< Real > &  v,
const Vector< Real > &  g,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inlinevirtual

Set variables to zero if they correspond to the \(\epsilon\)-binding set.

This function sets \(v(\xi)=0\) if \(\xi\in\mathcal{B}_\epsilon(x)\). Here, the \(\epsilon\)-binding set is defined as

\[ \mathcal{B}^+_\epsilon(x) = \mathcal{B}^+_\epsilon(x)\cap\mathcal{B}^-_\epsilon(x). \]

Parameters
[out]vis the variable to be pruned.
[in]xis the current optimization variable.
[in]gis the negative search direction.
[in]epsis the active-set tolerance \(\epsilon\).

Reimplemented in H1BoundConstraint< Real >, H1BoundConstraint< Real >, H1BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, L2BoundConstraint< Real >, ROL::BoundConstraint_SimOpt< Real >, ROL::SROMBoundConstraint< Real >, ROL::StdBoundConstraint< Real >, ROL::BPOEBoundConstraint< Real >, and ROL::CVaRBoundConstraint< Real >.

Definition at line 386 of file ROL_BoundConstraint.hpp.

References ROL::BoundConstraint< Real >::pruneLowerActive(), and ROL::BoundConstraint< Real >::pruneUpperActive().

template<class Real>
virtual bool ROL::BoundConstraint< Real >::isFeasible ( const Vector< Real > &  v)
inlinevirtual
template<class Real>
void ROL::BoundConstraint< Real >::activate ( void  )
inline

Turn on bounds.

This function turns the bounds on.

Definition at line 427 of file ROL_BoundConstraint.hpp.

Referenced by ROL::BoundConstraint_SimOpt< Real >::BoundConstraint_SimOpt().

template<class Real>
void ROL::BoundConstraint< Real >::deactivate ( void  )
inline

Turn off bounds.

This function turns the bounds off.

Definition at line 433 of file ROL_BoundConstraint.hpp.

Referenced by ROL::BoundConstraint_SimOpt< Real >::BoundConstraint_SimOpt(), main(), and ROL::Algorithm< Real >::run().

template<class Real>
bool ROL::BoundConstraint< Real >::isActivated ( void  )
inline
template<class Real>
void ROL::BoundConstraint< Real >::pruneInactive ( Vector< Real > &  v,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inline

Set variables to zero if they correspond to the \(\epsilon\)-inactive set.

This function sets \(v(\xi)=0\) if \(\xi\in\Xi\setminus\mathcal{A}_\epsilon(x)\). Here,

Parameters
[out]vis the variable to be pruned.
[in]xis the current optimization variable.
[in]epsis the active-set tolerance \(\epsilon\).

Definition at line 448 of file ROL_BoundConstraint.hpp.

References ROL::Vector< Real >::axpy(), ROL::Vector< Real >::clone(), and ROL::BoundConstraint< Real >::pruneActive().

Referenced by ROL::LineSearchStep< Real >::compute(), and ROL::LineSearch< Real >::status().

template<class Real>
void ROL::BoundConstraint< Real >::pruneLowerInactive ( Vector< Real > &  v,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inline
template<class Real>
void ROL::BoundConstraint< Real >::pruneUpperInactive ( Vector< Real > &  v,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inline
template<class Real>
void ROL::BoundConstraint< Real >::pruneInactive ( Vector< Real > &  v,
const Vector< Real > &  g,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inline

Set variables to zero if they correspond to the \(\epsilon\)-nonbinding set.

This function sets \(v(\xi)=0\) if \(\xi\in\Xi\setminus\mathcal{B}_\epsilon(x)\).

Parameters
[out]vis the variable to be pruned.
[in]xis the current optimization variable.
[in]gis the negative search direction.
[in]epsis the active-set tolerance \(\epsilon\).

Definition at line 476 of file ROL_BoundConstraint.hpp.

References ROL::Vector< Real >::axpy(), ROL::Vector< Real >::clone(), and ROL::BoundConstraint< Real >::pruneActive().

template<class Real>
void ROL::BoundConstraint< Real >::pruneLowerInactive ( Vector< Real > &  v,
const Vector< Real > &  g,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inline
template<class Real>
void ROL::BoundConstraint< Real >::pruneUpperInactive ( Vector< Real > &  v,
const Vector< Real > &  g,
const Vector< Real > &  x,
Real  eps = 0.0 
)
inline
template<class Real>
void ROL::BoundConstraint< Real >::computeProjectedGradient ( Vector< Real > &  g,
const Vector< Real > &  x 
)
inline

Compute projected gradient.

This function projects the gradient \(g\) onto the tangent cone.

Parameters
[in,out]gis the gradient of the objective function at x.
[in]xis the optimization variable

Definition at line 501 of file ROL_BoundConstraint.hpp.

References ROL::Vector< Real >::clone(), and ROL::BoundConstraint< Real >::pruneActive().

Referenced by ROL::TrustRegionStep< Real >::computeCriticalityMeasure(), and ROL::LineSearchStep< Real >::update().

template<class Real>
void ROL::BoundConstraint< Real >::computeProjectedStep ( Vector< Real > &  v,
const Vector< Real > &  x 
)
inline

Compute projected step.

This function computes the projected step \(P_{[a,b]}(x+v) - x\).

Parameters
[in,out]vis the step variable.
[in]xis the optimization variable.

Definition at line 513 of file ROL_BoundConstraint.hpp.

References ROL::Vector< Real >::axpy(), ROL::Vector< Real >::plus(), and ROL::BoundConstraint< Real >::project().

Member Data Documentation

template<class Real>
int ROL::BoundConstraint< Real >::dim_
private

Definition at line 74 of file ROL_BoundConstraint.hpp.

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::BoundConstraint< Real >::x_lo_
private

Definition at line 75 of file ROL_BoundConstraint.hpp.

template<class Real>
Teuchos::RCP<Vector<Real> > ROL::BoundConstraint< Real >::x_up_
private

Definition at line 76 of file ROL_BoundConstraint.hpp.

template<class Real>
Real ROL::BoundConstraint< Real >::scale_
private

Definition at line 77 of file ROL_BoundConstraint.hpp.

template<class Real>
bool ROL::BoundConstraint< Real >::activated_
private

Flag that determines whether or not the constraints are being used.

Definition at line 78 of file ROL_BoundConstraint.hpp.

Referenced by ROL::BoundConstraint< Real >::isActivated().

template<class Real>
Real ROL::BoundConstraint< Real >::min_diff_
private

Definition at line 79 of file ROL_BoundConstraint.hpp.

template<class Real>
Elementwise::ReductionMin<Real> ROL::BoundConstraint< Real >::minimum_
private

Definition at line 81 of file ROL_BoundConstraint.hpp.

template<class Real>
ROL::BoundConstraint::Product ROL::BoundConstraint< Real >::product
private

The documentation for this class was generated from the following file: