Class BoundedConstraint
- java.lang.Object
-
- org.hipparchus.optim.nonlinear.vector.constrained.BoundedConstraint
-
- All Implemented Interfaces:
MultivariateVectorFunction,Constraint,VectorDifferentiableFunction,OptimizationData
- Direct Known Subclasses:
EqualityConstraint,InequalityConstraint,LinearBoundedConstraint
public abstract class BoundedConstraint extends Object implements Constraint
Constraint with lower and upper bounds: \(l \le f(x) \le u\).- Since:
- 3.1
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBoundedConstraint(RealVector lower, RealVector upper)Simple constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intdimY()Returns the dimensionality of the function eval.RealVectorgetLowerBound()Get Lower Bound forvalue(x).RealVectorgetUpperBound()Get Upper Bound forvalue(x).doubleovershoot(RealVector y)Check how much a point overshoots the constraint.
-
-
-
Constructor Detail
-
BoundedConstraint
protected BoundedConstraint(RealVector lower, RealVector upper)
Simple constructor.At least one of the bounds must be non-null.
- Parameters:
lower- lower bound (null if no lower bound)upper- upper bound (null if no upper bound)
-
-
Method Detail
-
dimY
public int dimY()
Returns the dimensionality of the function eval.- Specified by:
dimYin interfaceVectorDifferentiableFunction- Returns:
- the expected dimension of the function's eval
-
getLowerBound
public RealVector getLowerBound()
Get Lower Bound forvalue(x).- Specified by:
getLowerBoundin interfaceConstraint- Returns:
- Lower Bound for
value(x)
-
getUpperBound
public RealVector getUpperBound()
Get Upper Bound forvalue(x).- Specified by:
getUpperBoundin interfaceConstraint- Returns:
- Upper Bound for
value(x)
-
overshoot
public double overshoot(RealVector y)
Check how much a point overshoots the constraint.The overshoots is zero if the point fulfills the constraint, and positive if the
valueof the constraint is on the wrong side oflowerorupperboundaries.- Specified by:
overshootin interfaceConstraint- Parameters:
y- constraint value (y =value(x))- Returns:
- L¹-norm of constraint overshoot
-
-