Class NonNegativeConstraint
java.lang.Object
org.apache.commons.math3.optim.linear.NonNegativeConstraint
- All Implemented Interfaces:
OptimizationData
A constraint for a linear optimization problem indicating whether all
variables must be restricted to non-negative values.
- Since:
- 3.1
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
Whether the variables are all positive. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates whether all the variables must be restricted to non-negative values.
-
Field Details
-
isRestricted
private final boolean isRestrictedWhether the variables are all positive.
-
-
Constructor Details
-
NonNegativeConstraint
public NonNegativeConstraint(boolean restricted) - Parameters:
restricted
- Iftrue
, all the variables must be positive.
-
-
Method Details
-
isRestrictedToNonNegative
public boolean isRestrictedToNonNegative()Indicates whether all the variables must be restricted to non-negative values.- Returns:
true
if all the variables must be positive.
-