Package org.ojalgo.optimisation
Class Variable
- All Implemented Interfaces:
Comparable<Variable>
,Optimisation
,Optimisation.Constraint
,Optimisation.Objective
Variable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ojalgo.optimisation.Optimisation
Optimisation.Constraint, Optimisation.ConstraintType, Optimisation.Integration<M extends Optimisation.Model,
S extends Optimisation.Solver>, Optimisation.Model, Optimisation.Objective, Optimisation.Options, Optimisation.ProblemStructure, Optimisation.Result, Optimisation.Sense, Optimisation.Solver, Optimisation.State -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Structure1D.IntIndex
private boolean
private boolean
private BigDecimal
Fields inherited from class org.ojalgo.optimisation.ModelEntity
PRINT, RANGE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addTo
(Expression target, BigDecimal scale) protected void
appendMiddlePart
(StringBuilder builder, NumberContext display) private void
binary()
SeeisBinary()
.int
(package private) Variable
copy()
Internal copy that includes the index(package private) int
protected void
destroy()
(package private) void
If necessary this method should first determine if thisModelEntity
is "integer" or not.(package private) Structure1D.IntIndex
getIndex()
getValue()
integer()
integer
(boolean integer) SeeisInteger()
.boolean
isBinary()
Variable can only be 0 or 1.(package private) boolean
isFixed()
boolean
Is this entity (all involved variables) integer?boolean
The range includes something invalid input: '<' 0.0boolean
The range includes something > 0.0(package private) boolean
boolean
lower
(Comparable<?> lower) Extremely large (absolute value) values are treated as "no limit" (null) and extremely small values are treated as exactly 0.0, unless the input number type isBigDecimal
.relax()
(package private) void
setFixed
(BigDecimal value) void
setInteger
(boolean integer) (package private) void
setUnbounded
(boolean uncorrelated) void
setValue
(Comparable<?> value) upper
(Comparable<?> upper) Extremely large (absolute value) values are treated as "no limit" (null) and extremely small values are treated as exactly 0.0, unless the input number type isBigDecimal
.protected boolean
validate
(BigDecimal value, NumberContext context, BasicLogger appender) (package private) boolean
validate
(BigDecimal value, NumberContext context, BasicLogger appender, boolean relaxed) value
(BigDecimal value) Methods inherited from class org.ojalgo.optimisation.ModelEntity
adjust, appendLeftPart, appendRightPart, appendToString, deriveAdjustmentExponent, equals, getAdjustmentExponent, getAdjustmentExponentValue, getAdjustmentFactor, getCompensatedLowerLimit, getCompensatedLowerLimit, getCompensatedUpperLimit, getCompensatedUpperLimit, getContributionWeight, getLowerLimit, getLowerLimit, getLowerLimit, getName, getUpperLimit, getUpperLimit, getUpperLimit, hashCode, isClosedRange, isConstraint, isContributionWeightSet, isEqualityConstraint, isInfeasible, isInfeasible, isLowerConstraint, isLowerLimitSet, isObjective, isUpperConstraint, isUpperLimitSet, level, level, level, lower, lower, reverseAdjustment, shift, toAdjusted, toBigDecimal, toString, toUnadjusted, upper, upper, validate, weight, weight, weight
-
Field Details
-
myIndex
-
myInteger
private boolean myInteger -
myUnbounded
private transient boolean myUnbounded -
myValue
-
-
Constructor Details
-
Method Details
-
addTo
Description copied from class:ModelEntity
- Specified by:
addTo
in classModelEntity<Variable>
- Parameters:
target
- The targetExpression
scale
- The scaling factor
-
binary
SeeisBinary()
.- See Also:
-
compareTo
-
getLowerSlack
-
getUpperSlack
-
getValue
-
integer
-
integer
SeeisInteger()
. -
isBinary
public boolean isBinary()Variable can only be 0 or 1. -
isInteger
public boolean isInteger()Description copied from class:ModelEntity
Is this entity (all involved variables) integer?- Specified by:
isInteger
in classModelEntity<Variable>
- Returns:
- true if this is an integer variable, otherwise false
-
isNegative
public boolean isNegative()The range includes something invalid input: '<' 0.0 -
isPositive
public boolean isPositive()The range includes something > 0.0 -
isValueSet
public boolean isValueSet() -
lower
Description copied from class:ModelEntity
Extremely large (absolute value) values are treated as "no limit" (null) and extremely small values are treated as exactly 0.0, unless the input number type isBigDecimal
.BigDecimal
values are always used as they are.- Overrides:
lower
in classModelEntity<Variable>
-
quantifyContribution
-
relax
-
setInteger
public void setInteger(boolean integer) -
setValue
-
upper
Description copied from class:ModelEntity
Extremely large (absolute value) values are treated as "no limit" (null) and extremely small values are treated as exactly 0.0, unless the input number type isBigDecimal
.BigDecimal
values are always used as they are.- Overrides:
upper
in classModelEntity<Variable>
-
value
-
assertFixedValue
private void assertFixedValue() -
appendMiddlePart
- Overrides:
appendMiddlePart
in classModelEntity<Variable>
-
destroy
protected void destroy()- Overrides:
destroy
in classModelEntity<Variable>
-
validate
- Overrides:
validate
in classModelEntity<Variable>
-
copy
Variable copy()Internal copy that includes the index -
deriveAdjustmentExponent
int deriveAdjustmentExponent()- Specified by:
deriveAdjustmentExponent
in classModelEntity<Variable>
-
doIntegerRounding
void doIntegerRounding()Description copied from class:ModelEntity
If necessary this method should first determine if thisModelEntity
is "integer" or not.If it is, then verify if all variable factors are integers or if there exists a simple scalar that will make it so. If so, the lower/upper limits are "integer rounded".
- Specified by:
doIntegerRounding
in classModelEntity<Variable>
-
getIndex
Structure1D.IntIndex getIndex() -
isFixed
boolean isFixed() -
isUnbounded
boolean isUnbounded() -
setFixed
-
setUnbounded
void setUnbounded(boolean uncorrelated) -
validate
-