- java.lang.Object
-
- org.ojalgo.optimisation.linear.LinearStructure
-
- All Implemented Interfaces:
ExpressionsBasedModel.EntityMap,Optimisation,Optimisation.ProblemStructure
final class LinearStructure extends java.lang.Object implements ExpressionsBasedModel.EntityMap
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
Fields Modifier and Type Field Description (package private) ConstraintsMetaDataconstraints(package private) intnbArtiThe number of artificial variables(package private) intnbEqusThe number of equality constraints(package private) intnbIdtyThe number of slack variables that also form an identity sub-matrix (in the tableau).(package private) intnbInesThe number of inequality constraints(package private) intnbNegsThe number of negated model variables(package private) intnbSlckThe number of slack variables (not known to be "identity")(package private) intnbVarsThe number of positive (as-is) model variables(package private) int[]negativePartVariables(package private) int[]positivePartVariables-
Fields inherited from interface org.ojalgo.optimisation.Optimisation.ProblemStructure
DEBUG
-
-
Constructor Summary
Constructors Constructor Description LinearStructure(boolean inclMap, int constrIn, int constrEq, int varsPos, int varsNeg, int varsSlk, int varsEye)LinearStructure(int nbConstraints, int nbVariables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcountAdditionalConstraints()Not included inOptimisation.ProblemStructure.countConstraints()(because they are not simple linear equality or inequality constraints),intcountConstraints()intcountEqualityConstraints()intcountInequalityConstraints()intcountModelVariables()The number of variables, in the solver, that directly correspond to a model variable.intcountSlackVariables()The number of slack variables.intcountVariables()(package private) intcountVariablesExcluded()The number of non-basic variables.(package private) intcountVariablesIncluded()The number of basic variables.(package private) intcountVariablesTotally()booleanequals(java.lang.Object obj)EntryPair<ModelEntity<?>,Optimisation.ConstraintType>getConstraint(int idc)(package private) doublegetProblemRatio()(package private) longgetProblemSize()EntryPair<ModelEntity<?>,Optimisation.ConstraintType>getSlack(int ids)Returns which model entity, and constraint type, that corresponds to the slack variable at the supplied index.inthashCode()intindexOf(int j)Converts from a solver specific variable index to the corresponding index of the variable in the model.(package private) booleanisAnyArtificials()(package private) booleanisArtificialVariable(int variableIndex)booleanisConstraintNegated(int i)(package private) booleanisFullSetOfArtificials()(package private) booleanisModelVariable(int variableIndex)booleanisNegated(int j)Is this solver variable negated relative to the corresponding model variable?booleannegated(int i, boolean negated)voidsetConstraintMap(int i, ModelEntity<?> entity, Optimisation.ConstraintType type)voidsetConstraintMap(int i, ModelEntity<?> entity, Optimisation.ConstraintType type, boolean negated)voidsetConstraintNegated(int i, boolean negated)(package private) voidsetObjectiveAdjustmentFactor(double multiplierScale)java.lang.StringtoString()
-
-
-
Field Detail
-
constraints
final ConstraintsMetaData constraints
-
nbArti
final int nbArti
The number of artificial variables
-
nbEqus
final int nbEqus
The number of equality constraints
-
nbIdty
final int nbIdty
The number of slack variables that also form an identity sub-matrix (in the tableau).
-
nbInes
final int nbInes
The number of inequality constraints
-
nbNegs
final int nbNegs
The number of negated model variables
-
nbSlck
final int nbSlck
The number of slack variables (not known to be "identity")
-
nbVars
final int nbVars
The number of positive (as-is) model variables
-
negativePartVariables
final int[] negativePartVariables
-
positivePartVariables
final int[] positivePartVariables
-
-
Method Detail
-
countAdditionalConstraints
public int countAdditionalConstraints()
Description copied from interface:Optimisation.ProblemStructureNot included inOptimisation.ProblemStructure.countConstraints()(because they are not simple linear equality or inequality constraints),- Specified by:
countAdditionalConstraintsin interfaceOptimisation.ProblemStructure
-
countConstraints
public int countConstraints()
- Specified by:
countConstraintsin interfaceOptimisation.ProblemStructure
-
countEqualityConstraints
public int countEqualityConstraints()
- Specified by:
countEqualityConstraintsin interfaceOptimisation.ProblemStructure
-
countInequalityConstraints
public int countInequalityConstraints()
- Specified by:
countInequalityConstraintsin interfaceOptimisation.ProblemStructure
-
countModelVariables
public int countModelVariables()
Description copied from interface:ExpressionsBasedModel.EntityMapThe 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:
countModelVariablesin interfaceExpressionsBasedModel.EntityMap
-
countSlackVariables
public int countSlackVariables()
Description copied from interface:ExpressionsBasedModel.EntityMapThe number of slack variables.This defines the range of the indices that can be used with the
ExpressionsBasedModel.EntityMap.getSlack(int)method.- Specified by:
countSlackVariablesin interfaceExpressionsBasedModel.EntityMap
-
countVariables
public int countVariables()
- Specified by:
countVariablesin interfaceOptimisation.ProblemStructure
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
getConstraint
public EntryPair<ModelEntity<?>,Optimisation.ConstraintType> getConstraint(int idc)
- Specified by:
getConstraintin interfaceExpressionsBasedModel.EntityMap
-
getSlack
public EntryPair<ModelEntity<?>,Optimisation.ConstraintType> getSlack(int ids)
Description copied from interface:ExpressionsBasedModel.EntityMapReturns which model entity, and constraint type, that corresponds to the slack variable at the supplied index.- Specified by:
getSlackin 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].)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
indexOf
public int indexOf(int j)
Description copied from interface:ExpressionsBasedModel.EntityMapConverts 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:
indexOfin 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.EntityMapIs this solver variable negated relative to the corresponding model variable?- Specified by:
isNegatedin 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
public void setConstraintMap(int i, ModelEntity<?> entity, Optimisation.ConstraintType type)
-
setConstraintMap
public void setConstraintMap(int i, ModelEntity<?> entity, Optimisation.ConstraintType type, boolean negated)
-
setConstraintNegated
public void setConstraintNegated(int i, boolean negated)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
countVariablesExcluded
int countVariablesExcluded()
The number of non-basic variables.
-
countVariablesIncluded
int countVariablesIncluded()
The number of basic variables.
-
countVariablesTotally
int countVariablesTotally()
-
getProblemRatio
double getProblemRatio()
-
getProblemSize
long getProblemSize()
-
isAnyArtificials
boolean isAnyArtificials()
-
isArtificialVariable
boolean isArtificialVariable(int variableIndex)
-
isFullSetOfArtificials
boolean isFullSetOfArtificials()
-
isModelVariable
boolean isModelVariable(int variableIndex)
-
setObjectiveAdjustmentFactor
void setObjectiveAdjustmentFactor(double multiplierScale)
-
-