Package org.ojalgo.optimisation.linear
Class LinearStructure
java.lang.Object
org.ojalgo.optimisation.linear.LinearStructure
- All Implemented Interfaces:
ExpressionsBasedModel.EntityMap
,Optimisation
,Optimisation.ProblemStructure
LP (simplex tableau) meta data.
-
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 TypeFieldDescription(package private) final ConstraintsMetaData
(package private) final int
The number of artificial variables(package private) final int
The number of equality constraints(package private) final int
The number of slack variables that also form an identity sub-matrix (in the tableau).(package private) final int
The number of inequality constraints(package private) final int
The number of negated model variables(package private) final int
The number of slack variables (not known to be "identity")(package private) final int
The number of positive (as-is) model variables(package private) final int[]
(package private) final int[]
Fields inherited from interface org.ojalgo.optimisation.Optimisation.ProblemStructure
DEBUG
-
Constructor Summary
ConstructorsConstructorDescriptionLinearStructure
(boolean inclMap, int constrIn, int constrEq, int varsPos, int varsNeg, int varsSlk, int varsEye) LinearStructure
(int nbConstraints, int nbVariables) -
Method Summary
Modifier and TypeMethodDescriptionint
Not included inOptimisation.ProblemStructure.countConstraints()
(because they are not simple linear equality or inequality constraints),int
int
int
int
The number of variables, in the solver, that directly correspond to a model variable.int
The number of slack variables.int
(package private) int
boolean
getConstraint
(int idc) getSlack
(int ids) Returns which model entity, and constraint type, that corresponds to the slack variable at the supplied index.int
hashCode()
int
indexOf
(int j) Converts from a solver specific variable index to the corresponding index of the variable in the model.(package private) boolean
(package private) boolean
isArtificialVariable
(int variableIndex) boolean
isConstraintNegated
(int i) (package private) boolean
(package private) boolean
isModelVariable
(int variableIndex) boolean
isNegated
(int j) Is this solver variable negated relative to the corresponding model variable?boolean
negated
(int i, boolean negated) void
setConstraintMap
(int i, ModelEntity<?> entity, Optimisation.ConstraintType type) void
setConstraintMap
(int i, ModelEntity<?> entity, Optimisation.ConstraintType type, boolean negated) void
setConstraintNegated
(int i, boolean negated) (package private) void
setObjectiveAdjustmentFactor
(double multiplierScale) toString()
-
Field Details
-
constraints
-
nbArti
final int nbArtiThe number of artificial variables -
nbEqus
final int nbEqusThe number of equality constraints -
nbIdty
final int nbIdtyThe number of slack variables that also form an identity sub-matrix (in the tableau). -
nbInes
final int nbInesThe number of inequality constraints -
nbNegs
final int nbNegsThe number of negated model variables -
nbSlck
final int nbSlckThe number of slack variables (not known to be "identity") -
nbVars
final int nbVarsThe number of positive (as-is) model variables -
negativePartVariables
final int[] negativePartVariables -
positivePartVariables
final int[] positivePartVariables
-
-
Constructor Details
-
LinearStructure
LinearStructure(boolean inclMap, int constrIn, int constrEq, int varsPos, int varsNeg, int varsSlk, int varsEye) -
LinearStructure
LinearStructure(int nbConstraints, int nbVariables)
-
-
Method Details
-
countAdditionalConstraints
public int countAdditionalConstraints()Description copied from interface:Optimisation.ProblemStructure
Not included inOptimisation.ProblemStructure.countConstraints()
(because they are not simple linear equality or inequality constraints),- Specified by:
countAdditionalConstraints
in interfaceOptimisation.ProblemStructure
-
countConstraints
public int countConstraints()- Specified by:
countConstraints
in interfaceOptimisation.ProblemStructure
-
countEqualityConstraints
public int countEqualityConstraints()- Specified by:
countEqualityConstraints
in interfaceOptimisation.ProblemStructure
-
countInequalityConstraints
public int countInequalityConstraints()- Specified by:
countInequalityConstraints
in interfaceOptimisation.ProblemStructure
-
countModelVariables
public int countModelVariables()Description copied from interface:ExpressionsBasedModel.EntityMap
The number of variables, in the solver, that directly correspond to a model variable. (Not slack or artificial variables.)This defines the range of the indices that can be used with the
ExpressionsBasedModel.EntityMap.indexOf(int)
andExpressionsBasedModel.EntityMap.isNegated(int)
methods.- Specified by:
countModelVariables
in interfaceExpressionsBasedModel.EntityMap
-
countSlackVariables
public int countSlackVariables()Description copied from interface:ExpressionsBasedModel.EntityMap
The number of slack variables.This defines the range of the indices that can be used with the
ExpressionsBasedModel.EntityMap.getSlack(int)
method.- Specified by:
countSlackVariables
in interfaceExpressionsBasedModel.EntityMap
-
countVariables
public int countVariables()- Specified by:
countVariables
in interfaceOptimisation.ProblemStructure
-
getConstraint
- Specified by:
getConstraint
in interfaceExpressionsBasedModel.EntityMap
-
getSlack
Description copied from interface:ExpressionsBasedModel.EntityMap
Returns which model entity, and constraint type, that corresponds to the slack variable at the supplied index.- Specified by:
getSlack
in interfaceExpressionsBasedModel.EntityMap
- Parameters:
ids
- Index of solver slack variable (If there are 3 slack variables this input argument should be in the range [0.2].)
-
indexOf
public int indexOf(int j) Description copied from interface:ExpressionsBasedModel.EntityMap
Converts from a solver specific variable index to the corresponding index of the variable in the model. Note that not all model variables are necessarily represented in the solver, and a model variable may result in multiple solver variables. Further, slack variables, artificial variables and such are typically not represented in the model.- Specified by:
indexOf
in interfaceExpressionsBasedModel.EntityMap
- Parameters:
j
- Index of solver variable- Returns:
- Index of model variable (negative if no map)
-
isConstraintNegated
public boolean isConstraintNegated(int i) -
isNegated
public boolean isNegated(int j) Description copied from interface:ExpressionsBasedModel.EntityMap
Is this solver variable negated relative to the corresponding model variable?- Specified by:
isNegated
in interfaceExpressionsBasedModel.EntityMap
- Parameters:
j
- Index of solver variable- Returns:
- true if this solver variable represents a negated model variable
-
negated
public boolean negated(int i, boolean negated) -
setConstraintMap
-
setConstraintMap
public void setConstraintMap(int i, ModelEntity<?> entity, Optimisation.ConstraintType type, boolean negated) -
setConstraintNegated
public void setConstraintNegated(int i, boolean negated) -
countVariablesTotally
int countVariablesTotally() -
isAnyArtificials
boolean isAnyArtificials() -
isArtificialVariable
boolean isArtificialVariable(int variableIndex) -
isFullSetOfArtificials
boolean isFullSetOfArtificials() -
isModelVariable
boolean isModelVariable(int variableIndex) -
setObjectiveAdjustmentFactor
void setObjectiveAdjustmentFactor(double multiplierScale) -
hashCode
public int hashCode() -
equals
-
toString
-