ROL
ROL::Bounds< Real > Class Template Reference

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

#include <ROL_Bounds.hpp>

Inheritance diagram for ROL::Bounds< Real >:

Classes

class  Active
class  UpperBinding
class  LowerBinding
class  PruneBinding
class  BuildC
class  SetZeroEntry

Public Member Functions

 Bounds (const Vector< Real > &x, bool isLower=true, Real scale=1, Real feasTol=std::sqrt(ROL_EPSILON< Real >()))
 Bounds (const Ptr< Vector< Real > > &x_lo, const Ptr< Vector< Real > > &x_up, const Real scale=1, const Real feasTol=std::sqrt(ROL_EPSILON< Real >()))
void project (Vector< Real > &x) override
void projectInterior (Vector< Real > &x) override
void pruneUpperActive (Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0)) override
void pruneUpperActive (Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0)) override
void pruneLowerActive (Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0)) override
void pruneLowerActive (Vector< Real > &v, const Vector< Real > &g, const Vector< Real > &x, Real xeps=Real(0), Real geps=Real(0)) override
bool isFeasible (const Vector< Real > &v) override
void applyInverseScalingFunction (Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const override
void applyScalingFunctionJacobian (Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const override
Public Member Functions inherited from ROL::ROL::BoundConstraint< Real >
virtual ~BoundConstraint ()
 BoundConstraint (void)
 BoundConstraint (const Vector< Real > &x)
virtual void project (Vector< Real > &x)
 Project optimization variables onto the bounds.
virtual void projectInterior (Vector< Real > &x)
 Project optimization variables into the interior of the feasible set.
virtual void pruneUpperActive (Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
 Set variables to zero if they correspond to the upper \(\epsilon\)-active set.
virtual 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 \(\epsilon\)-binding set.
virtual void pruneLowerActive (Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
 Set variables to zero if they correspond to the lower \(\epsilon\)-active set.
virtual 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 \(\epsilon\)-binding set.
virtual const Ptr< const Vector< Real > > getLowerBound (void) const
 Return the ref count pointer to the lower bound vector.
virtual const Ptr< const Vector< Real > > getUpperBound (void) const
 Return the ref count pointer to the upper bound vector.
virtual bool isFeasible (const Vector< Real > &v)
 Check if the vector, v, is feasible.
virtual void applyInverseScalingFunction (Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const
 Apply inverse scaling function.
virtual void applyScalingFunctionJacobian (Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const
 Apply scaling function Jacobian.
void activateLower (void)
 Turn on lower bound.
void activateUpper (void)
 Turn on upper bound.
void activate (void)
 Turn on bounds.
void deactivateLower (void)
 Turn off lower bound.
void deactivateUpper (void)
 Turn off upper bound.
void deactivate (void)
 Turn off bounds.
bool isLowerActivated (void) const
 Check if lower bound are on.
bool isUpperActivated (void) const
 Check if upper bound are on.
bool isActivated (void) const
 Check if bounds are on.
void pruneActive (Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
 Set variables to zero if they correspond to the \(\epsilon\)-active set.
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 \(\epsilon\)-binding set.
void pruneLowerInactive (Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
 Set variables to zero if they correspond to the \(\epsilon\)-inactive set.
void pruneUpperInactive (Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
 Set variables to zero if they correspond to the \(\epsilon\)-inactive set.
void pruneLowerInactive (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 \(\epsilon\)-nonbinding set.
void pruneUpperInactive (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 \(\epsilon\)-nonbinding set.
void pruneInactive (Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
 Set variables to zero if they correspond to the \(\epsilon\)-inactive set.
void pruneInactive (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 \(\epsilon\)-nonbinding set.
void computeProjectedGradient (Vector< Real > &g, const Vector< Real > &x)
 Compute projected gradient.
void computeProjectedStep (Vector< Real > &v, const Vector< Real > &x)
 Compute projected step.

Private Member Functions

void buildScalingFunction (Vector< Real > &d, const Vector< Real > &x, const Vector< Real > &g) const

Private Attributes

const Real scale_
const Real feasTol_
Ptr< Vector< Real > > mask_
Real min_diff_
Elementwise::ReductionMin< Real > minimum_
ROL::Bounds::PruneBinding prune_
ROL::Bounds::BuildC buildC_
ROL::Bounds::SetZeroEntry setZeroEntry_

Additional Inherited Members

Protected Member Functions inherited from ROL::ROL::BoundConstraint< Real >
Real computeInf (const Vector< Real > &x) const
Protected Attributes inherited from ROL::ROL::BoundConstraint< Real >
Ptr< Vector< Real > > lower_
Ptr< Vector< Real > > upper_

Detailed Description

template<typename Real>
class ROL::Bounds< Real >

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

Definition at line 59 of file ROL_Bounds.hpp.

Constructor & Destructor Documentation

◆ Bounds() [1/2]

◆ Bounds() [2/2]

template<typename Real>
Bounds::Bounds ( const Ptr< Vector< Real > > & x_lo,
const Ptr< Vector< Real > > & x_up,
const Real scale = 1,
const Real feasTol = std::sqrt(ROL_EPSILON<Real>()) )

Member Function Documentation

◆ buildScalingFunction()

◆ project()

◆ projectInterior()

◆ pruneUpperActive() [1/2]

template<typename Real>
void Bounds::pruneUpperActive ( Vector< Real > & v,
const Vector< Real > & x,
Real eps = Real(0) )
override

◆ pruneUpperActive() [2/2]

template<typename Real>
void Bounds::pruneUpperActive ( Vector< Real > & v,
const Vector< Real > & g,
const Vector< Real > & x,
Real xeps = Real(0),
Real geps = Real(0) )
override

◆ pruneLowerActive() [1/2]

template<typename Real>
void Bounds::pruneLowerActive ( Vector< Real > & v,
const Vector< Real > & x,
Real eps = Real(0) )
override

◆ pruneLowerActive() [2/2]

template<typename Real>
void Bounds::pruneLowerActive ( Vector< Real > & v,
const Vector< Real > & g,
const Vector< Real > & x,
Real xeps = Real(0),
Real geps = Real(0) )
override

◆ isFeasible()

◆ applyInverseScalingFunction()

template<typename Real>
void Bounds::applyInverseScalingFunction ( Vector< Real > & dv,
const Vector< Real > & v,
const Vector< Real > & x,
const Vector< Real > & g ) const
override

Definition at line 292 of file ROL_Bounds_Def.hpp.

References ROL::Vector< Real >::applyBinary(), and buildScalingFunction().

Referenced by testCases(), and testRandomInputs().

◆ applyScalingFunctionJacobian()

template<typename Real>
void Bounds::applyScalingFunctionJacobian ( Vector< Real > & dv,
const Vector< Real > & v,
const Vector< Real > & x,
const Vector< Real > & g ) const
override

Member Data Documentation

◆ scale_

template<typename Real>
const Real ROL::Bounds< Real >::scale_
private

◆ feasTol_

template<typename Real>
const Real ROL::Bounds< Real >::feasTol_
private

Definition at line 62 of file ROL_Bounds.hpp.

Referenced by Bounds(), Bounds(), and projectInterior().

◆ mask_

template<typename Real>
Ptr<Vector<Real> > ROL::Bounds< Real >::mask_
private

◆ min_diff_

template<typename Real>
Real ROL::Bounds< Real >::min_diff_
private

◆ minimum_

template<typename Real>
Elementwise::ReductionMin<Real> ROL::Bounds< Real >::minimum_
private

Definition at line 71 of file ROL_Bounds.hpp.

Referenced by Bounds(), and isFeasible().

◆ prune_

template<typename Real>
ROL::Bounds::PruneBinding ROL::Bounds< Real >::prune_
private

◆ buildC_

template<typename Real>
ROL::Bounds::BuildC ROL::Bounds< Real >::buildC_
private

◆ setZeroEntry_

template<typename Real>
ROL::Bounds::SetZeroEntry ROL::Bounds< Real >::setZeroEntry_
private

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