44#ifndef ROL_BOUND_CONSTRAINT_DEF_H
45#define ROL_BOUND_CONSTRAINT_DEF_H
49template<
typename Real>
52 Real denom = (
dim > 0 ?
static_cast<Real
>(
dim) : 1e15);
56template<
typename Real>
60template<
typename Real>
67 catch(std::exception &e) {
73template<
typename Real>
80template<
typename Real>
87template<
typename Real>
94template<
typename Real>
101template<
typename Real>
108template<
typename Real>
115template<
typename Real>
123template<
typename Real>
131template<
typename Real>
134 Ptr<Vector<Real>> Pv = v.
clone();
137 Pv->axpy(
static_cast<Real
>(-1),v);
138 Real diff = Pv->norm();
144template<
typename Real>
146 throw Exception::NotImplemented(
">>> BoundConstraint::applyInverseScalingFunction : This function has not been implemeted!");
149template<
typename Real>
151 throw Exception::NotImplemented(
">>> BoundConstraint::applyScalingFunctionJacobian : This function has not been implemeted!");
154template<
typename Real>
159template<
typename Real>
164template<
typename Real>
170template<
typename Real>
175template<
typename Real>
180template<
typename Real>
186template<
typename Real>
191template<
typename Real>
196template<
typename Real>
201template<
typename Real>
209template<
typename Real>
217template<
typename Real>
221 Ptr<Vector<Real>> tmp = v.
clone();
228template<
typename Real>
232 Ptr<Vector<Real>> tmp = v.
clone();
239template<
typename Real>
243 Ptr<Vector<Real>> tmp = v.
clone();
250template<
typename Real>
254 Ptr<Vector<Real>> tmp = v.
clone();
261template<
typename Real>
265 Ptr<Vector<Real>> tmp = v.
clone();
272template<
typename Real>
276 Ptr<Vector<Real>> tmp = v.
clone();
283template<
typename Real>
286 Ptr<Vector<Real>> tmp = g.
clone();
292template<
typename Real>
void computeProjectedStep(Vector< Real > &v, const Vector< Real > &x)
Compute projected step.
void pruneLowerInactive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the -inactive set.
void pruneInactive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the -inactive set.
bool isLowerActivated(void) const
Check if lower bound are on.
virtual 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.
void pruneUpperInactive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the -inactive set.
virtual void applyInverseScalingFunction(Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const
Apply inverse scaling function.
void pruneActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the -active set.
bool isActivated(void) const
Check if bounds are on.
Real computeInf(const Vector< Real > &x) const
virtual void applyScalingFunctionJacobian(Vector< Real > &dv, const Vector< Real > &v, const Vector< Real > &x, const Vector< Real > &g) const
Apply scaling function Jacobian.
virtual bool isFeasible(const Vector< Real > &v)
Check if the vector, v, is feasible.
virtual 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 deactivateLower(void)
Turn off lower bound.
void activateLower(void)
Turn on lower bound.
virtual void projectInterior(Vector< Real > &x)
Project optimization variables into the interior of the feasible set.
void deactivateUpper(void)
Turn off upper bound.
virtual void project(Vector< Real > &x)
Project optimization variables onto the bounds.
virtual const Ptr< const Vector< Real > > getLowerBound(void) const
Return the ref count pointer to the lower bound vector.
void deactivate(void)
Turn off bounds.
void computeProjectedGradient(Vector< Real > &g, const Vector< Real > &x)
Compute projected gradient.
void activate(void)
Turn on bounds.
void activateUpper(void)
Turn on upper bound.
virtual const Ptr< const Vector< Real > > getUpperBound(void) const
Return the ref count pointer to the upper bound vector.
bool isUpperActivated(void) const
Check if upper bound are on.
void deactivateLower(void)
Turn off lower bound.
void deactivateUpper(void)
Turn off upper bound.
virtual 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.
bool isLowerActivated(void) const
Check if lower bound are on.
Ptr< Vector< Real > > lower_
void activateUpper(void)
Turn on upper bound.
void pruneActive(Vector< Real > &v, const Vector< Real > &x, Real eps=Real(0))
Set variables to zero if they correspond to the -active set.
bool Uactivated_
Flag that determines whether or not the upper bounds are being used.
bool isActivated(void) const
Check if bounds are on.
void activateLower(void)
Turn on lower bound.
Ptr< Vector< Real > > upper_
virtual void project(Vector< Real > &x)
Project optimization variables onto the bounds.
bool Lactivated_
Flag that determines whether or not the lower bounds are being used.
virtual 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.
bool isUpperActivated(void) const
Check if upper bound are on.
virtual ROL::Ptr< Vector > clone() const =0
Clone to make a new (uninitialized) vector.
virtual void plus(const Vector &x)=0
Compute , where .
virtual int dimension() const
Return dimension of the vector space.
virtual void axpy(const Real alpha, const Vector &x)
Compute where .
Real ROL_EPSILON(void)
Platform-dependent machine epsilon.