Class BoxConstraints
- java.lang.Object
-
- dev.nm.solver.multivariate.constrained.constraint.linear.BoxConstraints
-
public class BoxConstraints extends Object
This represents the lower and upper bounds for a variable.lb ≤ x ≤ ub
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BoxConstraints.Bound
A bound constraint for a variable.
-
Constructor Summary
Constructors Constructor Description BoxConstraints(int dim, BoxConstraints.Bound... bounds)
Construct a set of bound constraints.BoxConstraints(Vector lower, Vector upper)
Construct a set of bound constraints.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<BoxConstraints.Bound>
bounds()
Get a deep copy of the bounds.static boolean
isInBox(Vector x, Vector lower, Vector upper)
Check if a solution is within a box.LinearGreaterThanConstraints
lowerBoundConstraints()
Split the box constraints and get the greater-than-the-lower-bounds part.Vector
lowerBounds()
Gets the lower bounds.LinearGreaterThanConstraints
toGreaterThanConstraints()
LinearLessThanConstraints
toLessThanConstraints()
LinearLessThanConstraints
upperBoundConstraints()
Split the box constraints and get the less-than-the-upper-bounds part.Vector
upperBounds()
Gets the upper bounds.
-
-
-
Constructor Detail
-
BoxConstraints
public BoxConstraints(int dim, BoxConstraints.Bound... bounds)
Construct a set of bound constraints.- Parameters:
bounds
- the boundsdim
- the number of variables
-
-
Method Detail
-
bounds
public List<BoxConstraints.Bound> bounds()
Get a deep copy of the bounds.- Returns:
- a deep copy of the bounds
-
lowerBounds
public Vector lowerBounds()
Gets the lower bounds.- Returns:
- the lower bounds
-
upperBounds
public Vector upperBounds()
Gets the upper bounds.- Returns:
- the upper bounds
-
upperBoundConstraints
public LinearLessThanConstraints upperBoundConstraints()
Split the box constraints and get the less-than-the-upper-bounds part.- Returns:
- the upper bound constraints
-
lowerBoundConstraints
public LinearGreaterThanConstraints lowerBoundConstraints()
Split the box constraints and get the greater-than-the-lower-bounds part.- Returns:
- the lower bound constraints
-
toLessThanConstraints
public LinearLessThanConstraints toLessThanConstraints()
-
toGreaterThanConstraints
public LinearGreaterThanConstraints toGreaterThanConstraints()
-
-