XpressProblem
- java.lang.Object
-
- com.dashoptimization.XPRSobject
-
- com.dashoptimization.XPRSprob
-
- com.dashoptimization.objects.XpressProblem
-
- All Implemented Interfaces:
-
java.lang.AutoCloseable
public class XpressProblem extends XPRSprob
Optimizer interface that allows modeling by objects.
-
-
Nested Class Summary
Modifier and Type Class Description static class
XpressProblem.BranchObject
Subclass ofXPRSbranchobject
that allows usingVariable
instances to specify bounds and constraints.static class
XpressProblem.CallbackAPI
API for adding and removing callbacks to this problem.-
Nested classes/interfaces inherited from class com.dashoptimization.XPRSprob
XPRSprob.AbstractUserFunction, XPRSprob.AttributeInfo, XPRSprob.Attributes, XPRSprob.BasisValue, XPRSprob.ControlInfo, XPRSprob.Controls, XPRSprob.GeneralConstraintInfo, XPRSprob.GlobalInfo, XPRSprob.IISData, XPRSprob.IISStatusInfo, XPRSprob.InfeasInfo, XPRSprob.MapDeltaFunction, XPRSprob.MapDeltaFunctor, XPRSprob.MapFunction, XPRSprob.MapFunctor, XPRSprob.MatrixInfo, XPRSprob.MatrixTriplets, XPRSprob.MIPEntityInfo, XPRSprob.MultiMapDeltaFunction, XPRSprob.MultiMapDeltaFunctor, XPRSprob.MultiMapFunction, XPRSprob.MultiMapFunctor, XPRSprob.PWLInfo, XPRSprob.RowInfo, XPRSprob.Solution, XPRSprob.SolVal, XPRSprob.StatusSolution, XPRSprob.VecMapDeltaFunction, XPRSprob.VecMapDeltaFunctor, XPRSprob.VecMapFunction, XPRSprob.VecMapFunctor
-
-
Field Summary
Modifier and Type Field Description XpressProblem.CallbackAPI
callbacks
Property through which callbacks for this instance can be accessed.static Variable
NULL_VARIABLE
Variable object that is used to indicate a constant term in expressions that are implemented as maps.
-
Constructor Summary
Constructor Description XpressProblem()
Create a new problem without internal name.XpressProblem(java.lang.String problemName)
Create a new problem with internal name.XpressProblem(java.lang.String problemName, java.lang.String licensePath)
Create a new problem with internal name and non-default license.
-
Method Summary
Modifier and Type Method Description <C extends Index>
CaddConstraint(ConstraintDefinition<C> def)
Add a single constraint to this problem.<C extends Index>
java.util.stream.Stream<C>addConstraints(int[] data, java.util.function.IntFunction<ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem.<C extends Index>
voidaddConstraints(int count1, int count2, int count3, int count4, int count5, Function5<java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<C extends Index>
voidaddConstraints(int count1, int count2, int count3, int count4, Function4<java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<C extends Index>
voidaddConstraints(int count1, int count2, int count3, Function3<java.lang.Integer,java.lang.Integer,java.lang.Integer,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<C extends Index>
voidaddConstraints(int count1, int count2, java.util.function.BiFunction<java.lang.Integer,java.lang.Integer,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<C extends Index>
java.util.stream.Stream<C>addConstraints(int count, java.util.function.IntFunction<ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem.<C extends Index>
java.util.stream.Stream<C>addConstraints(ConstraintDefinition<C>[] defs)
Add multiple of the same type constraints to the problem.<K1,K2,K3,C extends Index>
voidaddConstraints(java.lang.Iterable<K1> iterable1, java.lang.Iterable<K2> iterable2, java.lang.Iterable<K3> iterable3, Function3<K1,K2,K3,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<K1,K2,K3,K4,C extends Index>
voidaddConstraints(java.lang.Iterable<K1> iterable1, java.lang.Iterable<K2> iterable2, java.lang.Iterable<K3> iterable3, java.lang.Iterable<K4> iterable4, Function4<K1,K2,K3,K4,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<K1,K2,K3,K4,K5,C extends Index>
voidaddConstraints(java.lang.Iterable<K1> iterable1, java.lang.Iterable<K2> iterable2, java.lang.Iterable<K3> iterable3, java.lang.Iterable<K4> iterable4, java.lang.Iterable<K5> iterable5, Function5<K1,K2,K3,K4,K5,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<K1,K2,C extends Index>
voidaddConstraints(java.lang.Iterable<K1> iterable1, java.lang.Iterable<K2> iterable2, java.util.function.BiFunction<K1,K2,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<C extends Index,T extends ConstraintDefinition<C>>
java.util.stream.Stream<C>addConstraints(java.lang.Iterable<T> defs)
Add multiple constraints of the same type to the problem.<T,C extends Index>
java.util.stream.Stream<C>addConstraints(java.lang.Iterable<T> data, java.util.function.Function<T,ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem.<T,C extends Index>
java.util.stream.Stream<java.util.Map.Entry<T,C>>addConstraints(java.util.Iterator<T> data, java.util.function.Function<T,ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem.<C extends Index>
java.util.stream.Stream<C>addConstraints(java.util.stream.IntStream data, java.util.function.IntFunction<ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem.<C extends Index,T extends ConstraintDefinition<C>>
java.util.stream.Stream<C>addConstraints(java.util.stream.Stream<T> defs)
Add multiple constraints of the same type to the problem.<T,C extends Index>
java.util.stream.Stream<C>addConstraints(java.util.stream.Stream<T> data, java.util.function.Function<T,ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem.<K1,K2,C extends Index>
voidaddConstraints(K1[] array1, K2[] array2, java.util.function.BiFunction<K1,K2,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<K1,K2,K3,C extends Index>
voidaddConstraints(K1[] array1, K2[] array2, K3[] array3, Function3<K1,K2,K3,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<K1,K2,K3,K4,C extends Index>
voidaddConstraints(K1[] array1, K2[] array2, K3[] array3, K4[] array4, Function4<K1,K2,K3,K4,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<K1,K2,K3,K4,K5,C extends Index>
voidaddConstraints(K1[] array1, K2[] array2, K3[] array3, K4[] array4, K5[] array5, Function5<K1,K2,K3,K4,K5,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem.<T,C extends Index>
java.util.stream.Stream<C>addConstraints(T[] data, java.util.function.Function<T,ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem.int
addCut(int cuttype, Inequality.Definition cut)
Add a cut at the current node.void
addMipSol(double[] values, Variable[] variables, java.lang.String name)
Adds a new feasible, infeasible or partial MIP solution for the problem to the Optimizer.void
addObjective(Expression obj, int priority, double weight)
Add a new objective function.Variable
addVariable()
Add a single variable to this problem.Variable
addVariable(double lb, double ub, ColumnType type)
Add a single variable to this problem.Variable
addVariable(double lb, double ub, ColumnType type, double limit, java.lang.String name)
Add a single variable to this problem.Variable
addVariable(double lb, double ub, ColumnType type, java.lang.String name)
Add a single variable to this problem.Variable
addVariable(ColumnType type)
Add a single variable to this problem.Variable
addVariable(ColumnType type, java.lang.String name)
Add a single variable to this problem.Variable
addVariable(java.lang.String name)
Add a single variable to this problem.VariableBuilder.VariableArrayBuilder
addVariables(int dim)
Create an 1-dimensional array of variables.VariableBuilder.VariableArray2Builder
addVariables(int dim1, int dim2)
Create an 2-dimensional array of variables.VariableBuilder.VariableArray3Builder
addVariables(int dim1, int dim2, int dim3)
Create an 3-dimensional array of variables.VariableBuilder.VariableArray4Builder
addVariables(int dim1, int dim2, int dim3, int dim4)
Create an 4-dimensional array of variables.VariableBuilder.VariableArray5Builder
addVariables(int dim1, int dim2, int dim3, int dim4, int dim5)
Create an 5-dimensional array of variables.<K1> VariableBuilder.VariableMapBuilder<K1>
addVariables(java.util.Collection<K1> coll1)
Create an 1-dimensional map of variables.<K1,K2>
VariableBuilder.VariableMap2Builder<K1,K2>addVariables(java.util.Collection<K1> coll1, java.util.Collection<K2> coll2)
Create an 2-dimensional map of variables.<K1,K2,K3>
VariableBuilder.VariableMap3Builder<K1,K2,K3>addVariables(java.util.Collection<K1> coll1, java.util.Collection<K2> coll2, java.util.Collection<K3> coll3)
Create an 3-dimensional map of variables.<K1,K2,K3,K4>
VariableBuilder.VariableMap4Builder<K1,K2,K3,K4>addVariables(java.util.Collection<K1> coll1, java.util.Collection<K2> coll2, java.util.Collection<K3> coll3, java.util.Collection<K4> coll4)
Create an 4-dimensional map of variables.<K1,K2,K3,K4,K5>
VariableBuilder.VariableMap5Builder<K1,K2,K3,K4,K5>addVariables(java.util.Collection<K1> coll1, java.util.Collection<K2> coll2, java.util.Collection<K3> coll3, java.util.Collection<K4> coll4, java.util.Collection<K5> coll5)
Create an 5-dimensional map of variables.<K1> VariableBuilder.VariableMapBuilder<K1>
addVariables(java.util.stream.Stream<K1> strm)
Create an 1-dimensional map of variables.<K1> VariableBuilder.VariableMapBuilder<K1>
addVariables(K1[] arr1)
Create an 1-dimensional map of variables.<K1,K2>
VariableBuilder.VariableMap2Builder<K1,K2>addVariables(K1[] arr1, K2[] arr2)
Create an 2-dimensional map of variables.<K1,K2,K3>
VariableBuilder.VariableMap3Builder<K1,K2,K3>addVariables(K1[] arr1, K2[] arr2, K3[] arr3)
Create an 3-dimensional map of variables.<K1,K2,K3,K4>
VariableBuilder.VariableMap4Builder<K1,K2,K3,K4>addVariables(K1[] arr1, K2[] arr2, K3[] arr3, K4[] arr4)
Create an 4-dimensional map of variables.<K1,K2,K3,K4,K5>
VariableBuilder.VariableMap5Builder<K1,K2,K3,K4,K5>addVariables(K1[] arr1, K2[] arr2, K3[] arr3, K4[] arr4, K5[] arr5)
Create an 5-dimensional map of variables.void
bndSA(int len, Variable[] variables, double[] lblower, double[] lbupper, double[] ublower, double[] ubupper)
Returns upper and lower sensitivity ranges for specified variables' lower and upper bounds.void
bndSA(Variable[] variables, double[] lblower, double[] lbupper, double[] ublower, double[] ubupper)
Returns upper and lower sensitivity ranges for specified variables' lower and upper bounds.void
chgBounds(Variable[] variables, byte[] bndType, double[] bndValue)
Change bounds for multiple variables.XpressProblem
chgCoef(Inequality row, Variable variable, double coefficient)
Changes the coefficient forvariable
inrow
in the linear matrix.XpressProblem
chgCoefs(Inequality[] row, Variable[] variable, double[] coefficient)
Change coefficients in the linear matrix.void
chgColType(Variable[] variables, ColumnType[] colType)
Change types for multiple variables.XpressProblem
chgObj(Variable[] variables, double[] coefficients)
Change objective function coefficients.XpressProblem
chgObj(Variable variable, double coefficient)
Change objective function coefficient.XpressProblem
chgObjN(int objidx, Variable[] variables, double[] coefficients)
Change objective function coefficients for a multi-objective problem.XpressProblem
chgObjN(int objidx, Variable variable, double coefficient)
Change an objective function coefficient for a multi-objective problem.void
chgRHS(Inequality[] rows, double[] newRHS)
Change right-hand side for multiple rows.void
chgRHSrange(Inequality[] rows, double[] newRange)
Change right-hand side ranges for multiple rows.void
chgRowType(Inequality[] rows, RowType[] rowType)
Change types for multiple rows.XpressProblem.BranchObject
createBranchObject()
Create a new branch object.void
delCols(int ncols, int[] colind)
Delete columns from this problem.void
delGenCons(int nconstraints, int[] conind)
Delete constraints from this problem.void
delGeneralConstraints(GeneralConstraint[] constraints)
Delete general constraints from this problem.void
delIndicator(Inequality row)
Delete a single indicator constraint.void
delInequalities(Inequality[] rows)
Delete inequality constraints from this problem.void
delPwlCons(int npwls, int[] pwlind)
Delete piecewise linear constraints from this problem.void
delPwlConstraints(PWL[] pwls)
Delete PWL constraints from this problem.void
delRows(int nrows, int[] rowind)
Delete rows from this problem.void
delSets(int nsets, int[] sosind)
Delete sets from this problem.void
delSOS(SOS sos)
Delete a single SOS from the problem.void
delSOS(SOS[] soss)
Delete special ordered set constraints.void
delVariables(Variable[] vars)
Delete variables from this problem.GeneralConstraint
generalConstraintForIndex(int index)
Map a general constraint index to aGeneralConstraint
object.GeneralConstraint[]
generalConstraintForIndices(int first, int last)
Map a range of general constraint indices toGeneralConstraint
objects.double
getCallbackDual(Inequality r)
Get the dual associated with the current callback for a single row.double[]
getCallbackDuals(Inequality[] rows)
Get the duals associated with the current callback for an array of rows.double[]
getCallbackDuals(java.util.Collection<Inequality> rows)
Get the duals associated with the current callback for a collection of rows.double
getCallbackRedCost(Variable v)
Get the reduced cost associated with the current callbackfor a single variable.double[]
getCallbackRedCosts(Variable[] vars)
Get the reduced costs associated with the current callback for an array of variables.double[]
getCallbackRedCosts(java.util.Collection<Variable> vars)
Get the reduced costs associated with the current callback for a collection of variables.double
getCallbackSlack(Inequality r)
Get the slack associated with the current callback for a single row.double[]
getCallbackSlacks(Inequality[] rows)
Get the slacks associated with the current callback for an array of rows.double[]
getCallbackSlacks(java.util.Collection<Inequality> rows)
Get the slacks associated with the current callback for a collection of rows.double
getCallbackSolution(Variable v)
Get the solution associated with the current callback for a single variable.double[]
getCallbackSolution(Variable[] vars)
Get the solution associated with the current callback for an array of variables.double[]
getCallbackSolution(java.util.Collection<Variable> vars)
Get the solution associated with the current callback for a collection of variables.double
getCoef(Inequality row, Variable variable)
Query a single coefficient from the linear matrix.double
getDual(Inequality r)
Get the dual for a single row.double[]
getDuals(Inequality[] rows)
Get the duals for an array of rows.double[]
getDuals(java.util.Collection<Inequality> rows)
Get the duals for a collection of rows.GeneralConstraint[]
getGeneralConstraints()
Get all the general constraints currently defined in this problem.IIS
getIIS(int iis)
Get the specified IIS.IndicatorObjects
getIndicator(Inequality row)
Get indicator information for a single row.Inequality[]
getInequalities()
Get all the inequalities currently defined in this problem.LinTermList
getInequalityLinear(Inequality row)
Deprecated.since 44.00, Use getLhs() insteadLinExpression
getInequalityLinear(Inequality row, java.util.function.Supplier<LinExpression> expression)
Get the linear part of the left-hand side of a row.Expression
getLhsExpression(int row)
Get the left-hand side of a row as an expression.double
getObj(Variable variable)
Query an objective function coefficient.double
getObjN(int objidx, Variable variable)
Query an objective function coefficient.PWL[]
getPWLs()
Get all piecewise linear constraints currently defined in this problem.double
getRedCost(Variable v)
Get the reduced cost for a single variable.double[]
getRedCosts(Variable[] vars)
Get the reduced costs for an array of variables.double[]
getRedCosts(java.util.Collection<Variable> vars)
Get the reduced costs for a collection of variables.double
getSlack(Inequality r)
Get the current slack for a single row.double[]
getSlacks(Inequality[] rows)
Get the current slacks for an array of rows.double[]
getSlacks(java.util.Collection<Inequality> rows)
Get the current slacks for a collection of rows.double
getSolution(Variable v)
Get the current solution for a single variable.double[]
getSolution(Variable[] vars)
Get the current solution for an array of variables.double[]
getSolution(java.util.Collection<Variable> vars)
Get the current solution for a collection of variables.SOS[]
getSOSs()
Get all the special ordered set constraints currently defined in this problem.Variable[]
getVariables()
Get all the variables currently defined in this problem.Inequality[]
inequalitiesForIndices(int first, int last)
Map a range of inequality indices to inequality objects.Inequality
inequalityForIndex(int index)
Map an inequality index to an inequality object.static boolean
isNullVariable(Variable v)
Check whether a variable is the same asNULL_VARIABLE
.boolean
isOriginal()
Check whether this model instance is in the original state.void
loadDelayedRows(Inequality[] rows)
Marks a set of rows as delayed rows.void
loadModelCuts(Inequality[] rows)
Marks a set of rows as model cuts.void
nlpSetInitVal(Variable[] variables, double[] values)
Set initial values of variables for a non-linear solve.void
nlpSetInitVal(java.util.Map<Variable,java.lang.Double> values)
Set initial values of variables for a non-linear solve.void
objSA(int len, Variable[] variables, double[] lower, double[] upper)
Returns upper and lower sensitivity ranges for specified objective function coefficients.void
objSA(Variable[] variables, double[] lower, double[] upper)
Returns upper and lower sensitivity ranges for specified objective function coefficients.PWL
pwlForIndex(int index)
Map a PWL index to a PWL object.PWL[]
pwlsForIndices(int first, int last)
Map a range of PWL indices to PWL objects.int
repairWeightedInfeas(java.util.Map<Inequality,java.lang.Double> lepref, java.util.Map<Inequality,java.lang.Double> gepref, java.util.Map<Variable,java.lang.Double> lbpref, java.util.Map<Variable,java.lang.Double> ubpref, char phase2, double delta, java.lang.String flags)
Repair infeasibilities using weights.void
rhsSA(int len, Inequality[] rows, double[] lower, double[] upper)
Returns upper and lower sensitivity ranges for specified right hand side (RHS) function coefficients.void
rhsSA(Inequality[] rows, double[] lower, double[] upper)
Returns upper and lower sensitivity ranges for specified right hand side (RHS) function coefficients.void
setIndicator(Variable indicatorVariable, boolean indicatorValue, Inequality row)
Add an indicator constraint to this model.void
setIndicators(int[] data, java.util.function.IntFunction<Variable> indicatorVariable, java.util.function.IntFunction<java.lang.Boolean> indicatorValue, java.util.function.IntFunction<Inequality> row)
Add indicator constraints to this model.void
setIndicators(int count, java.util.function.Function<java.lang.Integer,Variable> indicatorVariable, java.util.function.Function<java.lang.Integer,java.lang.Boolean> indicatorValue, java.util.function.Function<java.lang.Integer,Inequality> row)
Add indicator constraints to this model.void
setIndicators(Variable[] indicatorVariable, boolean[] indicatorValue, Inequality[] row)
Add indicator constraints to this model.<T> void
setIndicators(java.lang.Iterable<T> data, java.util.function.Function<T,Variable> indicatorVariable, java.util.function.Function<T,java.lang.Boolean> indicatorValue, java.util.function.Function<T,Inequality> row)
Add indicator constraints to this model.<T> void
setIndicators(java.util.Collection<T> data, java.util.function.Function<T,Variable> indicatorVariable, java.util.function.Function<T,java.lang.Boolean> indicatorValue, java.util.function.Function<T,Inequality> row)
Add indicator constraints to this model.void
setIndicators(java.util.stream.IntStream data, java.util.function.IntFunction<Variable> indicatorVariable, java.util.function.IntFunction<java.lang.Boolean> indicatorValue, java.util.function.IntFunction<Inequality> row)
Add indicator constraints to this model.<T> void
setIndicators(java.util.stream.Stream<T> data, java.util.function.Function<T,Variable> indicatorVariable, java.util.function.Function<T,java.lang.Boolean> indicatorValue, java.util.function.Function<T,Inequality> row)
Add indicator constraints to this model.<T> void
setIndicators(T[] data, java.util.function.Function<T,Variable> indicatorVariable, java.util.function.Function<T,java.lang.Boolean> indicatorValue, java.util.function.Function<T,Inequality> row)
Add indicator constraints to this model.void
setObjective(int idx, Expression obj, int priority, double weight, double abstol, double reltol)
Set an objective function and its controls.void
setObjective(Expression obj)
Set the objective function to a new expression.void
setObjective(Expression obj, XPRSenumerations.ObjSense sense)
Set the objective function to a new expression.void
slpSetDetRow(Variable v, Inequality i)
Set the determining row of a variable.SOS
sosForIndex(int index)
Map an SOS index to an SOS object.SOS[]
sosForIndices(int first, int last)
Map a range of SOS indices to SOS objects.Variable
variableForIndex(int index)
Map a variable index to a variable object.Variable[]
variablesForIndices(int first, int last)
Map a range of variable indices to variable objects.-
Methods inherited from class com.dashoptimization.XPRSprob
addAfterObjectiveListener, addAfterObjectiveListener, addAfterObjectiveListener, addAfterObjectiveListener, addBarIterationListener, addBarIterationListener, addBarIterationListener, addBarIterationListener, addBarLogListener, addBarLogListener, addBarLogListener, addBarLogListener, addBeforeObjectiveListener, addBeforeObjectiveListener, addBeforeObjectiveListener, addBeforeObjectiveListener, addBeforeSolveListener, addBeforeSolveListener, addBeforeSolveListener, addBeforeSolveListener, addChangeBranchObjectListener, addChangeBranchObjectListener, addChangeBranchObjectListener, addChangeBranchObjectListener, addCheckTimeListener, addCheckTimeListener, addCheckTimeListener, addCheckTimeListener, addChgBranchListener, addChgBranchListener, addChgBranchListener, addChgBranchListener, addChgNodeListener, addChgNodeListener, addChgNodeListener, addChgNodeListener, addCol, addCol, addCol, addCol, addCol, addCol, addCols, addCols, addColumn, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addColumns, addComputeRestartListener, addComputeRestartListener, addComputeRestartListener, addComputeRestartListener, addCut, addCut, addCutLogListener, addCutLogListener, addCutLogListener, addCutLogListener, addCutMgrListener, addCutMgrListener, addCutMgrListener, addCutMgrListener, addCuts, addCuts, addDestroyMTListener, addDestroyMTListener, addDestroyMTListener, addDestroyMTListener, addGapNotifyListener, addGapNotifyListener, addGapNotifyListener, addGapNotifyListener, addGenCons, addGenCons, addInfNodeListener, addInfNodeListener, addInfNodeListener, addInfNodeListener, addIntSolListener, addIntSolListener, addIntSolListener, addIntSolListener, addLpLogListener, addLpLogListener, addLpLogListener, addLpLogListener, addMessageListener, addMessageListener, addMessageListener, addMessageListener, addMipLogListener, addMipLogListener, addMipLogListener, addMipLogListener, addMipSol, addMipSol, addMipSol, addMipThreadListener, addMipThreadListener, addMipThreadListener, addMipThreadListener, addMsgHandlerListener, addMsgHandlerListener, addMsgHandlerListener, addMsgHandlerListener, addMsJobEndListener, addMsJobEndListener, addMsJobEndListener, addMsJobEndListener, addMsJobStartListener, addMsJobStartListener, addMsJobStartListener, addMsJobStartListener, addMsWinnerListener, addMsWinnerListener, addMsWinnerListener, addMsWinnerListener, addNames, addNames, addNewnodeListener, addNewnodeListener, addNewnodeListener, addNewnodeListener, addNlpCoefEvalErrorListener, addNlpCoefEvalErrorListener, addNlpCoefEvalErrorListener, addNlpCoefEvalErrorListener, addNodeCutoffListener, addNodeCutoffListener, addNodeCutoffListener, addNodeCutoffListener, addNodeLPSolvedListener, addNodeLPSolvedListener, addNodeLPSolvedListener, addNodeLPSolvedListener, addObj, addOptNodeListener, addOptNodeListener, addOptNodeListener, addOptNodeListener, addPreIntsolListener, addPreIntsolListener, addPreIntsolListener, addPreIntsolListener, addPreNodeListener, addPreNodeListener, addPreNodeListener, addPreNodeListener, addPresolveListener, addPresolveListener, addPresolveListener, addPresolveListener, addPwlCons, addPwlCons, addQMatrix, addQMatrix, addRow, addRow, addRow, addRow, addRow, addRows, addRows, addRows, addRows, addSet, addSetNames, addSets, addSets, addSets, addSets, addSlpCascadeEndListener, addSlpCascadeEndListener, addSlpCascadeEndListener, addSlpCascadeEndListener, addSlpCascadeStartListener, addSlpCascadeStartListener, addSlpCascadeStartListener, addSlpCascadeStartListener, addSlpCascadeVarFailListener, addSlpCascadeVarFailListener, addSlpCascadeVarFailListener, addSlpCascadeVarFailListener, addSlpCascadeVarListener, addSlpCascadeVarListener, addSlpCascadeVarListener, addSlpCascadeVarListener, addSlpConstructListener, addSlpConstructListener, addSlpConstructListener, addSlpConstructListener, addSlpDrColListener, addSlpDrColListener, addSlpDrColListener, addSlpDrColListener, addSlpIntSolListener, addSlpIntSolListener, addSlpIntSolListener, addSlpIntSolListener, addSlpIterEndListener, addSlpIterEndListener, addSlpIterEndListener, addSlpIterEndListener, addSlpIterStartListener, addSlpIterStartListener, addSlpIterStartListener, addSlpIterStartListener, addSlpIterVarListener, addSlpIterVarListener, addSlpIterVarListener, addSlpIterVarListener, addSlpPreUpdateLinearizationListener, addSlpPreUpdateLinearizationListener, addSlpPreUpdateLinearizationListener, addSlpPreUpdateLinearizationListener, addUserSolNotifyListener, addUserSolNotifyListener, addUserSolNotifyListener, addUserSolNotifyListener, alter, attributes, basisCondition, basisStability, basisStability, basisStability, binVar, binVar, binVarArray, binVarArray, binVarMap, binVarMap, bndsa, btran, calcObjective, calcObjective, calcObjN, calcObjN, calcReducedCosts, calcSlacks, calcSolInfo, calcSolInfo, chgBounds, chgBounds, chgCoef, chgColType, chgColType, chgGlbLimit, chgGlbLimit, chgLB, chgMCoef, chgMCoef, chgMCoef, chgMQObj, chgMQObj, chgMQObj, chgObj, chgObj, chgObjN, chgObjSense, chgObjSense, chgQObj, chgQRowCoeff, chgRHS, chgRHS, chgRHSrange, chgRHSrange, chgRowType, chgRowType, chgUB, clearIIS, clearObjective, clearRowFlags, close, controls, contVar, contVar, contVar, contVar, contVarArray, contVarArray, contVarArray, contVarArray, contVarArray, contVarMap, contVarMap, copyCallBacks, copyControls, copyProb, createBranchObject, createBranchObjectFromGlobal, crossoverLpSol, crossoverLpSol, delCPCuts, delCPCuts, delCPCuts, delCPCuts, delCPCuts, delCuts, delCuts, delCuts, delCuts, delCuts, delCuts, delIndicator, delIndicators, delObj, delQMatrix, destroyProb, dumpControls, estimateRowDualRanges, firstIIS, firstIIS, fixGlobals, fixMIPEntities, ftran, getAttribInfo, getAttribInfo, getBarNumStability, getBasis, getBasisVal, getBasisVal, getCallbackDual, getCallbackDual, getCallbackDuals, getCallbackDuals, getCallbackDuals, getCallbackDuals, getCallbackDuals, getCallbackPresolveDual, getCallbackPresolveDual, getCallbackPresolveDuals, getCallbackPresolveDuals, getCallbackPresolveDuals, getCallbackPresolveDuals, getCallbackPresolveDuals, getCallbackPresolveRedCost, getCallbackPresolveRedCost, getCallbackPresolveRedCosts, getCallbackPresolveRedCosts, getCallbackPresolveRedCosts, getCallbackPresolveRedCosts, getCallbackPresolveRedCosts, getCallbackPresolveSlack, getCallbackPresolveSlack, getCallbackPresolveSlacks, getCallbackPresolveSlacks, getCallbackPresolveSlacks, getCallbackPresolveSlacks, getCallbackPresolveSlacks, getCallbackPresolveSolution, getCallbackPresolveSolution, getCallbackPresolveSolution, getCallbackPresolveSolution, getCallbackPresolveSolution, getCallbackPresolveSolution, getCallbackPresolveSolution, getCallbackRedCost, getCallbackRedCost, getCallbackRedCosts, getCallbackRedCosts, getCallbackRedCosts, getCallbackRedCosts, getCallbackRedCosts, getCallbackSlack, getCallbackSlack, getCallbackSlacks, getCallbackSlacks, getCallbackSlacks, getCallbackSlacks, getCallbackSlacks, getCallbackSolution, getCallbackSolution, getCallbackSolution, getCallbackSolution, getCallbackSolution, getCallbackSolution, getCallbackSolution, getCoef, getCoef, getColBasisVal, getCols, getCols, getCols, getCols, getCols, getColType, getColType, getColType, getColumnName, getColumnNames, getControlInfo, getControlInfo, getCPCutList, getCPCutList, getCPCutList, getCPCutList, getCPCuts, getCPCuts, getCPCuts, getCutList, getCutList, getCutList, getCutList, getCutList, getCutMap, getCutSlack, getCutSlack, getDblAttrib, getDblAttrib, getDblControl, getDblControl, getDirs, getDirs, getDirs, getDiscreteCols, getDual, getDual, getDualRay, getDualRay, getDuals, getDuals, getDuals, getDuals, getDuals, getGenCons, getGenCons, getGenCons, getGenConsName, getGenConsNames, getGlobal, getGlobal, getGlobalEntities, getGlobalSets, getIISData, getIISData, getIndex, getIndex, getIndicator, getIndicators, getIndicators, getInfeas, getInfeas, getIntAttrib, getIntAttrib, getIntControl, getIntControl, getLastBarSol, getLastBarSol, getLastBarSol, getLastBarSolDjs, getLastBarSolDuals, getLastBarSolSlack, getLastBarSolX, getLastError, getLastError, getLB, getLB, getLB, getLongAttrib, getLongAttrib, getLongControl, getLongControl, getLpSol, getLpSol, getLpSol, getLpSolDjs, getLpSolDuals, getLpSolSlack, getLpSolVal, getLpSolVal, getLpSolX, getMessageStatus, getMessageStatus, getMIPEntities, getMIPEntities, getMIPEntities, getMIPEntities, getMIPEntities, getMipSol, getMipSol, getMipSol, getMipSolSlack, getMipSolVal, getMipSolVal, getMipSolX, getMQObj, getMQObj, getMQObj, getMQObj, getMQObj, getName, getName, getNameListObject, getNames, getNames, getNames, getNames, getNlpsol, getObj, getObj, getObj, getObjDblAttrib, getObjDblAttrib, getObjDblControl, getObjDblControl, getObjIntAttrib, getObjIntAttrib, getObjIntAttrib, getObjIntControl, getObjIntControl, getObjLongAttrib, getObjN, getPivotOrder, getPivots, getPresolveBasis, getPresolveMap, getPresolveSol, getPresolveSol, getPresolveSol, getPresolveSolDjs, getPresolveSolDuals, getPresolveSolSlack, getPresolveSolX, getPrimalRay, getPrimalRay, getProbName, getProbName, getPwlCons, getPwlCons, getPwlCons, getPWLName, getPWLNames, getQObj, getQObj, getQRowCoeff, getQRowCoeff, getQRowIndices, getQRowQMatrix, getQRowQMatrix, getQRowQMatrixTriplets, getQRowQMatrixTriplets, getQRowQMatrixTriplets, getQRows, getQRows, getQRows, getRedCost, getRedCost, getRedCosts, getRedCosts, getRedCosts, getRedCosts, getRedCosts, getRHS, getRHS, getRHS, getRHSrange, getRHSrange, getRHSrange, getRowBasisVal, getRowFlags, getRowFlags, getRowFlags, getRowName, getRowNames, getRows, getRows, getRows, getRows, getRows, getRowType, getRowType, getRowType, getScale, getScaledInfeas, getScaledInfeas, getSetDefinitions, getSetName, getSetNames, getSets, getSlack, getSlack, getSlacks, getSlacks, getSlacks, getSlacks, getSlacks, getSol, getSol, getSol, getSolDjs, getSolDuals, getSolSlack, getSolution, getSolution, getSolution, getSolution, getSolution, getSolution, getSolution, getSolX, getStrAttrib, getStrAttrib, getStrControl, getStrControl, getStringControl, getStrStringAttrib, getUB, getUB, getUB, getUnbVec, getUnbVec, iISAll, IISAll, iISIsolations, IISIsolations, iISStatus, IISStatus, IISStatus, interrupt, interrupt, interrupt, intVar, intVar, intVar, intVar, intVarArray, intVarArray, intVarArray, intVarArray, intVarArray, intVarMap, intVarMap, loadBasis, loadBranchDirs, loadBranchDirs, loadCuts, loadCuts, loadCuts, loadCuts, loadDelayedRows, loadDirs, loadGlobal, loadGlobal, loadLp, loadLp, loadLp, loadLp, loadLPSol, loadLPSol, loadMIP, loadMIP, loadMipSol, loadMipSol, loadMIQCQP, loadMIQCQP, loadMIQP, loadMIQP, loadModelCuts, loadPresolveBasis, loadPresolveDirs, loadQCQP, loadQCQP, loadQCQPGlobal, loadQCQPGlobal, loadQGlobal, loadQGlobal, loadQP, loadQP, loadSecureVecs, lpOptimize, lpOptimize, maxim, maxim, minim, minim, mipOptimize, mipOptimize, msAddCustomPreset, msAddJob, msAddPreset, msClear, nextIIS, nextIIS, nlpAddFormulas, nlpAddUserFunction, nlpAddUserFunction, nlpAddUserFunction, nlpAddUserFunction, nlpAddUserFunction, nlpAddUserFunction, nlpCalcSlacks, nlpChgFormula, nlpChgFormulaStr, nlpChgFormulaString, nlpCurrentIV, nlpDelFormulas, nlpDelUserFunction, nlpEvaluateFormula, nlpEvaluateFormula, nlpGetFormula, nlpGetFormulaRows, nlpGetFormulaStr, nlpGetFormulaString, nlpImportLibFunc, nlpLoadFormulas, nlpOptimize, nlpPostsolveProb, nlpPrintEvalInfo, nlpSetFunctionError, nlpSetInitVal, nlpSetInitVal, nlpValidate, nlpValidateKKT, nlpValidateRow, nlpValidateVector, objSA, optimize, optimize, optimize, pivot, postSolve, postSolveSol, presolveRow, presolveRow, presolveRow, printIIS, readBasis, readBasis, readBasis, readBinSol, readBinSol, readBinSol, readDirs, readDirs, readProb, readProb, readSlxSol, readSlxSol, readSlxSol, refineMipSol, refineMipSol, removeAfterObjectiveListener, removeAfterObjectiveListener, removeAfterObjectiveListener, removeAfterObjectiveListeners, removeBarIterationListener, removeBarIterationListener, removeBarIterationListener, removeBarIterationListeners, removeBarLogListener, removeBarLogListener, removeBarLogListener, removeBarLogListeners, removeBeforeObjectiveListener, removeBeforeObjectiveListener, removeBeforeObjectiveListener, removeBeforeObjectiveListeners, removeBeforeSolveListener, removeBeforeSolveListener, removeBeforeSolveListener, removeBeforeSolveListeners, removeChangeBranchObjectListener, removeChangeBranchObjectListener, removeChangeBranchObjectListener, removeChangeBranchObjectListeners, removeCheckTimeListener, removeCheckTimeListener, removeCheckTimeListener, removeCheckTimeListeners, removeChgBranchListener, removeChgBranchListener, removeChgBranchListener, removeChgBranchListeners, removeChgNodeListener, removeChgNodeListener, removeChgNodeListener, removeChgNodeListeners, removeComputeRestartListener, removeComputeRestartListener, removeComputeRestartListener, removeComputeRestartListeners, removeCutLogListener, removeCutLogListener, removeCutLogListener, removeCutLogListeners, removeCutMgrListener, removeCutMgrListener, removeCutMgrListener, removeCutMgrListeners, removeDestroyMTListener, removeDestroyMTListener, removeDestroyMTListener, removeDestroyMTListeners, removeGapNotifyListener, removeGapNotifyListener, removeGapNotifyListener, removeGapNotifyListeners, removeInfNodeListener, removeInfNodeListener, removeInfNodeListener, removeInfNodeListeners, removeIntSolListener, removeIntSolListener, removeIntSolListener, removeIntSolListeners, removeLpLogListener, removeLpLogListener, removeLpLogListener, removeLpLogListeners, removeMessageListener, removeMessageListener, removeMessageListener, removeMessageListeners, removeMipLogListener, removeMipLogListener, removeMipLogListener, removeMipLogListeners, removeMipThreadListener, removeMipThreadListener, removeMipThreadListener, removeMipThreadListeners, removeMsgHandlerListener, removeMsgHandlerListener, removeMsgHandlerListener, removeMsgHandlerListeners, removeMsJobEndListener, removeMsJobEndListener, removeMsJobEndListener, removeMsJobEndListeners, removeMsJobStartListener, removeMsJobStartListener, removeMsJobStartListener, removeMsJobStartListeners, removeMsWinnerListener, removeMsWinnerListener, removeMsWinnerListener, removeMsWinnerListeners, removeNewnodeListener, removeNewnodeListener, removeNewnodeListener, removeNewnodeListeners, removeNlpCoefEvalErrorListener, removeNlpCoefEvalErrorListener, removeNlpCoefEvalErrorListener, removeNlpCoefEvalErrorListeners, removeNodeCutoffListener, removeNodeCutoffListener, removeNodeCutoffListener, removeNodeCutoffListeners, removeNodeLPSolvedListener, removeNodeLPSolvedListener, removeNodeLPSolvedListener, removeNodeLPSolvedListeners, removeOptNodeListener, removeOptNodeListener, removeOptNodeListener, removeOptNodeListeners, removePreIntsolListener, removePreIntsolListener, removePreIntsolListener, removePreIntsolListeners, removePreNodeListener, removePreNodeListener, removePreNodeListener, removePreNodeListeners, removePresolveListener, removePresolveListener, removePresolveListener, removePresolveListeners, removeSlpCascadeEndListener, removeSlpCascadeEndListener, removeSlpCascadeEndListener, removeSlpCascadeEndListeners, removeSlpCascadeStartListener, removeSlpCascadeStartListener, removeSlpCascadeStartListener, removeSlpCascadeStartListeners, removeSlpCascadeVarFailListener, removeSlpCascadeVarFailListener, removeSlpCascadeVarFailListener, removeSlpCascadeVarFailListeners, removeSlpCascadeVarListener, removeSlpCascadeVarListener, removeSlpCascadeVarListener, removeSlpCascadeVarListeners, removeSlpConstructListener, removeSlpConstructListener, removeSlpConstructListener, removeSlpConstructListeners, removeSlpDrColListener, removeSlpDrColListener, removeSlpDrColListener, removeSlpDrColListeners, removeSlpIntSolListener, removeSlpIntSolListener, removeSlpIntSolListener, removeSlpIntSolListeners, removeSlpIterEndListener, removeSlpIterEndListener, removeSlpIterEndListener, removeSlpIterEndListeners, removeSlpIterStartListener, removeSlpIterStartListener, removeSlpIterStartListener, removeSlpIterStartListeners, removeSlpIterVarListener, removeSlpIterVarListener, removeSlpIterVarListener, removeSlpIterVarListeners, removeSlpPreUpdateLinearizationListener, removeSlpPreUpdateLinearizationListener, removeSlpPreUpdateLinearizationListener, removeSlpPreUpdateLinearizationListeners, removeUserSolNotifyListener, removeUserSolNotifyListener, removeUserSolNotifyListener, removeUserSolNotifyListeners, repairInfeas, repairInfeas, repairWeightedInfeas, repairWeightedInfeas, repairWeightedInfeasBounds, repairWeightedInfeasBounds, restore, restore, restore, rhsSA, save, saveAs, scale, setDblControl, setDefaultControl, setDefaults, setIndicator, setIndicators, setIntControl, setLogFile, setLongControl, setMessageStatus, setObjDblControl, setObjective, setObjective, setObjIntControl, setProbname, setStrControl, slpAddCoefs, slpCascadeOrder, slpCascadeSol, slpChgCascadeNLimit, slpChgCCoef, slpChgCoef, slpChgCoefStr, slpChgDeltaType, slpChgRowStatus, slpChgRowStatus, slpChgRowWt, slpConstruct, slpDelCoefs, slpDelCoefs, slpEvaluateCoef, slpEvaluateCoef, slpFixPenalties, slpGetCCoef, slpGetCoefFormula, slpGetCoefs, slpGetCoefStr, slpGetRowStatus, slpGetRowWT, slpGetRowWT, slpLoadCoefs, slpReInitialize, slpSetDetRow, slpSetDetRow, slpUnConstruct, slpUpdateLinearization, sparseBTran, sparseFTran, storeCuts, storeCuts, storeCuts, strongBranch, strongBranchCB, tune, tuneProbSetFile, tunerReadMethod, tunerWriteMethod, unloadProb, varArray, varArray, varArray, varArray, varArray, varMap, varMap, writeBasis, writeBasis, writeBasis, writeBinSol, writeBinSol, writeBinSol, writeDirs, writeDirs, writeIIS, writeIIS, writeProb, writeProb, writeProb, writePrtSol, writePrtSol, writePrtSol, writeSlxSol, writeSlxSol, writeSlxSol, writeSol, writeSol, writeSol
-
Methods inherited from class com.dashoptimization.XPRSobject
addMsgHandlerListener, addMsgHandlerListener, destroy, isDestroyed
-
-
-
-
Field Detail
-
NULL_VARIABLE
public static final Variable NULL_VARIABLE
Variable object that is used to indicate a constant term in expressions that are implemented as maps.- Since:
- 43.00
-
callbacks
public final XpressProblem.CallbackAPI callbacks
Property through which callbacks for this instance can be accessed.
-
-
Constructor Detail
-
XpressProblem
public XpressProblem()
Create a new problem without internal name. If not yet done then Xpress is initialized with the license found at the default license location. If Xpress is initialized this way then it will be automatically de-initialized once the newly created problem instance is closed.- Since:
- 43.00
-
XpressProblem
public XpressProblem(java.lang.String problemName)
Create a new problem with internal name. If not yet done then Xpress is initialized with the license found at the default license location. If Xpress is initialized this way then it will be automatically de-initialized once the newly created problem instance is closed.- Parameters:
-
problemName
- Internal name of new problem, can benull
. - Since:
- 43.00
-
XpressProblem
public XpressProblem(java.lang.String problemName, java.lang.String licensePath)
Create a new problem with internal name and non-default license. If not yet done then Xpress is initialized with the license found atlicensePath
. If Xpress is initialized this way then it will be automatically de-initialized once the newly created problem instance is closed.- Parameters:
-
problemName
- Internal name of new problem, can benull
. -
licensePath
- Path to license location. Can benull
or the empty string to indicate that the license is in the default location. - Since:
- 43.00
-
-
Method Detail
-
variableForIndex
public Variable variableForIndex(int index)
Map a variable index to a variable object.- Parameters:
-
index
- Index to map. - Returns:
-
The variable for
index
. - Since:
- 43.00
- See Also:
-
getVariables()
-
variablesForIndices
public Variable[] variablesForIndices(int first, int last)
Map a range of variable indices to variable objects.- Parameters:
-
first
- First index to map. -
last
- Last index to map. - Returns:
-
The variables from
first
(inclusive) throughlast
(inclusive). - Since:
- 43.00
-
delCols
public void delCols(int ncols, int[] colind)
Delete columns from this problem. Note that this may be expensive if you useVariable
instances to formulate your problem since indices of remaining variables will have to be updated after columns were deleted from the underlying model. If you have to delete multiple variables then it is best to collect all variables to be deleted in an array and then delete all of them with a single call to this function.
-
delVariables
public void delVariables(Variable[] vars)
Delete variables from this problem.- Parameters:
-
vars
- Variables to be deleted. - Since:
- 43.00
-
getSolution
public double[] getSolution(Variable[] vars)
Get the current solution for an array of variables. The values in the returned array are in 1-to-1 correspondence with the variables invars
.- Parameters:
-
vars
- Variables for which solution is queried. - Since:
- 43.00
-
getSolution
public double[] getSolution(java.util.Collection<Variable> vars)
Get the current solution for a collection of variables. The values in the returned array are in 1-to-1 correspondence with the variables invars
.Used in these examples:
- AddMipSol
- GoalProg
- Polygon
- PolygonMap
- PolygonMapDelta
- PolygonMultiMap
- PolygonMultiMapDelta
- PolygonVecMap
- PolygonVecMapDelta
- Repair
- RoundInt
- TSP
- Tableau
- Trimloss
- Parameters:
-
vars
- Variables for which solution is queried. - Returns:
-
Solution values for
vars
. - Since:
- 43.00
-
getSolution
public double getSolution(Variable v)
Get the current solution for a single variable.Used in these examples:
- AddMipSol
- GoalProg
- Polygon
- PolygonMap
- PolygonMapDelta
- PolygonMultiMap
- PolygonMultiMapDelta
- PolygonVecMap
- PolygonVecMapDelta
- Repair
- RoundInt
- TSP
- Tableau
- Trimloss
- Parameters:
-
v
- Variable for which solution is queried. - Returns:
-
Solution for
v
. - Since:
- 43.00
-
getRedCosts
public double[] getRedCosts(Variable[] vars)
Get the reduced costs for an array of variables. The values in the returned array are in 1-to-1 correspondence with the variables invars
.- Parameters:
-
vars
- Variables for which reduced costs are queried. - Returns:
-
Reduced costs for variables in
vars
. - Since:
- 43.00
-
getRedCosts
public double[] getRedCosts(java.util.Collection<Variable> vars)
Get the reduced costs for a collection of variables. The values in the returned array are in 1-to-1 correspondence with the variables invars
.- Parameters:
-
vars
- Variables for which reduced costs are queried. - Returns:
-
Reduced costs for variables in
vars
. - Since:
- 43.00
-
getRedCost
public double getRedCost(Variable v)
Get the reduced cost for a single variable.- Parameters:
-
v
- Variable for which reduced cost is queried. - Returns:
-
Reduced cost for
v
. - Since:
- 43.00
-
getCallbackSolution
public double[] getCallbackSolution(Variable[] vars)
Get the solution associated with the current callback for an array of variables. The values in the returned array are in 1-to-1 correspondence with the variables invars
.Used in these examples:
- AddMipSol
- Knapsack
- MostViolated
- SaveSol
- TSP
- Parameters:
-
vars
- Variables for which solution is queried. - Returns:
-
Solution values for
vars
. - Since:
- 44.00
-
getCallbackSolution
public double[] getCallbackSolution(java.util.Collection<Variable> vars)
Get the solution associated with the current callback for a collection of variables. The values in the returned array are in 1-to-1 correspondence with the variables invars
.Used in these examples:
- AddMipSol
- Knapsack
- MostViolated
- SaveSol
- TSP
- Parameters:
-
vars
- Variables for which solution is queried. - Returns:
-
Solution values for
vars
. - Since:
- 44.00
-
getCallbackSolution
public double getCallbackSolution(Variable v)
Get the solution associated with the current callback for a single variable.Used in these examples:
- AddMipSol
- Knapsack
- MostViolated
- SaveSol
- TSP
- Parameters:
-
v
- Variable for which solution is queried. - Returns:
-
Solution for
v
. - Since:
- 44.00
-
getCallbackRedCosts
public double[] getCallbackRedCosts(Variable[] vars)
Get the reduced costs associated with the current callback for an array of variables. The values in the returned array are in 1-to-1 correspondence with the variables invars
.- Parameters:
-
vars
- Variables for which reduced costs are queried. - Returns:
-
Reduced costs for variables in
vars
. - Since:
- 44.00
-
getCallbackRedCosts
public double[] getCallbackRedCosts(java.util.Collection<Variable> vars)
Get the reduced costs associated with the current callback for a collection of variables. The values in the returned array are in 1-to-1 correspondence with the variables invars
.- Parameters:
-
vars
- Variables for which reduced costs are queried. - Returns:
-
Reduced costs for variables in
vars
. - Since:
- 44.00
-
getCallbackRedCost
public double getCallbackRedCost(Variable v)
Get the reduced cost associated with the current callbackfor a single variable.- Parameters:
-
v
- Variable for which reduced cost is queried. - Returns:
-
Reduced cost for
v
. - Since:
- 44.00
-
objSA
public void objSA(int len, Variable[] variables, double[] lower, double[] upper)
Returns upper and lower sensitivity ranges for specified objective function coefficients. If the objective coefficients are varied within these ranges the current basis remains optimal and the reduced costs remain valid.- Parameters:
-
len
- Sensitivity analysis is performed only on the firstlen
variables invariables
. -
variables
- Variables on which to perform sensitivity analysis. -
lower
- Array of length at leastlen
that receives the sensitivity analysis lower bounds. -
upper
- Array of length at leastlen
that receives the sensitivity analysis upper bounds. - Since:
- 43.00
-
objSA
public void objSA(Variable[] variables, double[] lower, double[] upper)
Returns upper and lower sensitivity ranges for specified objective function coefficients. If the objective coefficients are varied within these ranges the current basis remains optimal and the reduced costs remain valid.- Parameters:
-
variables
- Variables on which to perform sensitivity analysis. -
lower
- Array at least as long asvariables
that receives the sensitivity analysis lower bounds. -
upper
- Array at least as long asvariables
that receives the sensitivity analysis upper bounds. - Since:
- 43.00
-
bndSA
public void bndSA(int len, Variable[] variables, double[] lblower, double[] lbupper, double[] ublower, double[] ubupper)
Returns upper and lower sensitivity ranges for specified variables' lower and upper bounds. If the bounds are varied within these ranges the current basis remains optimal and feasible.- Parameters:
-
len
- Sensitivity analysis is performed only on the firstlen
variables invariables
. -
variables
- Variables on which to perform sensitivity analysis. -
lblower
- Array of length at leastlen
that receives the sensitivity analysis lower bounds for the variables' lower bound constraints. -
lbupper
- Array of length at leastlen
that receives the sensitivity analysis upper bounds for the variables' lower bound constraints. -
ublower
- Array of length at leastlen
that receives the sensitivity analysis lower bounds for the variables' upper bound constraints. -
ubupper
- Array of length at leastlen
that receives the sensitivity analysis upper bounds for the variables' upper bound constraints. - Since:
- 43.00
-
bndSA
public void bndSA(Variable[] variables, double[] lblower, double[] lbupper, double[] ublower, double[] ubupper)
Returns upper and lower sensitivity ranges for specified variables' lower and upper bounds. If the bounds are varied within these ranges the current basis remains optimal and feasible.- Parameters:
-
variables
- Variables on which to perform sensitivity analysis. -
lblower
- Array at least as long asvariables
that receives the sensitivity analysis lower bounds for the variables' lower bound constraints. -
lbupper
- Array at least as long asvariables
that receives the sensitivity analysis upper bounds for the variables' lower bound constraints. -
ublower
- Array at least as long asvariables
that receives the sensitivity analysis lower bounds for the variables' upper bound constraints. -
ubupper
- Array at least as long asvariables
that receives the sensitivity analysis upper bounds for the variables' upper bound constraints. - Since:
- 43.00
-
addMipSol
public void addMipSol(double[] values, Variable[] variables, java.lang.String name)
Adds a new feasible, infeasible or partial MIP solution for the problem to the Optimizer.Used in these examples:
- AddMipSol
- TSP
- Parameters:
-
values
- Values forvariables
. -
variables
- Variables in the solution. -
name
- Name for solution, can benull
. - Since:
- 43.00
-
getVariables
public Variable[] getVariables()
Get all the variables currently defined in this problem.- Returns:
- All the variables in this problem.
- Since:
- 43.00
- See Also:
-
variableForIndex(int)
-
chgBounds
public void chgBounds(Variable[] variables, byte[] bndType, double[] bndValue)
Change bounds for multiple variables.Used in these examples:
- AddMipSol
- FixBV
- RoundInt
- Parameters:
-
variables
- Variables for which to change bounds. -
bndType
- Type of bounds to change. -
bndValue
- New bounds. - Since:
- 43.00
-
chgColType
public void chgColType(Variable[] variables, ColumnType[] colType)
Change types for multiple variables.Used in these examples:
- Trimloss
- Parameters:
-
variables
- Variables for which to change types. -
colType
- New column types. - Since:
- 43.00
-
isNullVariable
public static boolean isNullVariable(Variable v)
Check whether a variable is the same asNULL_VARIABLE
. TheNULL_VARIABLE
is used in certain places to indicate the absence of a variable. For example, when iterating over the linear terms of an expression, a term with aNULL_VARIABLE
indicates a constant term in the expression.- Parameters:
-
v
- The variable to check. - Returns:
-
true
ifv
is the null variable. - Since:
- 44.00
-
slpSetDetRow
public void slpSetDetRow(Variable v, Inequality i)
Set the determining row of a variable.- Parameters:
-
v
- Variable for which the determining row is set. -
i
- Determining row forv
. - Since:
- 44.00
-
delIndicator
public void delIndicator(Inequality row)
Delete a single indicator constraint. This only deletes the "indicator property from the specified row. Neither the associated variable nor the row are deleted.- Parameters:
-
row
- Row from which to delete the indicator constraint. - Since:
- 43.00
-
getIndicator
public IndicatorObjects getIndicator(Inequality row)
Get indicator information for a single row.- Parameters:
-
row
- The row to query. - Returns:
-
Indicator information for
row
. This will benull
ifrow
is not an indicator row. - Since:
- 43.00
-
setIndicator
public void setIndicator(Variable indicatorVariable, boolean indicatorValue, Inequality row)
Add an indicator constraint to this model. Both variable and row must exist.- Parameters:
-
indicatorVariable
- Indicator variable. -
indicatorValue
- Whetherrow
becomes active ifindicatorVariable
is non-zero (indicatorValue
istrue
) or ifindicatorVariable
is zero (indicatorValue
isfalse
). -
row
- The implied row for the indicator constraint. - Since:
- 43.00
-
setIndicators
public void setIndicators(Variable[] indicatorVariable, boolean[] indicatorValue, Inequality[] row)
Add indicator constraints to this model. The provided arrays must all have length at leastcount
and for anyi
in 0..count-1
an indicator constraint is constructed fromindicatorVariable[i]
,indicatorValue[i]
androw[i]
. IfindicatorValue[i]
istrue
then the constraints states that ifindicatorVariable[i]
is 1 (one), thenrow[i]
must be satisfied (and ifindicator
is 0 (zero) thenrow[i]
is ignored). Otherwise,row[i]
must be satisfied ifindicator[i]
is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.- Parameters:
-
indicatorVariable
- Indicator variables. -
indicatorValue
- Whether rows become active if indicator variables are non-zero (indicatorValue[.]
istrue
) or if indicator variables are zero (indicatorValue
isfalse
). If this isnull
or empty then rows become active if indicator variables are non-zero. -
row
- The implied rows for the indicator constraints. - Since:
- 43.00
-
setIndicators
public <T> void setIndicators(java.lang.Iterable<T> data, java.util.function.Function<T,Variable> indicatorVariable, java.util.function.Function<T,java.lang.Boolean> indicatorValue, java.util.function.Function<T,Inequality> row)
Add indicator constraints to this model. The function iterates throughdata
and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixedt
, ifindicatorValue(t)
returnstrue
then the created constraint states that ifindicatorVariable(t)
is 1 (one), thenrow(t)
must be satisfied and is ignored otherwise. Otherwise,row(t)
must be satisfied ifindicatorVariable(t)
is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.- Type Parameters:
-
T
- Data type. - Parameters:
-
data
- Data for which constraints are created. -
indicatorVariable
- Indicator variables. -
indicatorValue
- Whether indicator variables should be non-zero or zero for rows to become active. If this isnull
then rows become active if indicator variables are non-zero. -
row
- The implied rows for the indicator constraints. - Since:
- 43.00
-
setIndicators
public <T> void setIndicators(T[] data, java.util.function.Function<T,Variable> indicatorVariable, java.util.function.Function<T,java.lang.Boolean> indicatorValue, java.util.function.Function<T,Inequality> row)
Add indicator constraints to this model. The function iterates throughdata
and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixedt
, ifindicatorValue(t)
returnstrue
then the created constraint states that ifindicatorVariable(t)
is 1 (one), thenrow(t)
must be satisfied and is ignored otherwise. Otherwise,row(t)
must be satisfied ifindicatorVariable(t)
is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.- Type Parameters:
-
T
- Data type. - Parameters:
-
data
- Data for which constraints are created. -
indicatorVariable
- Indicator variables. -
indicatorValue
- Whether indicator variables should be non-zero or zero for rows to become active. If this isnull
then rows become active if indicator variables are non-zero. -
row
- The implied rows for the indicator constraints. - Since:
- 43.00
-
setIndicators
public <T> void setIndicators(java.util.Collection<T> data, java.util.function.Function<T,Variable> indicatorVariable, java.util.function.Function<T,java.lang.Boolean> indicatorValue, java.util.function.Function<T,Inequality> row)
Add indicator constraints to this model. The function iterates throughdata
and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixedt
, ifindicatorValue(t)
returnstrue
then the created constraint states that ifindicatorVariable(t)
is 1 (one), thenrow(t)
must be satisfied and is ignored otherwise. Otherwise,row(t)
must be satisfied ifindicatorVariable(t)
is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.- Type Parameters:
-
T
- Data type. - Parameters:
-
data
- Data for which constraints are created. -
indicatorVariable
- Indicator variables. -
indicatorValue
- Whether indicator variables should be non-zero or zero for rows to become active. If this isnull
then rows become active if indicator variables are non-zero. -
row
- The implied rows for the indicator constraints. - Since:
- 43.00
-
setIndicators
public <T> void setIndicators(java.util.stream.Stream<T> data, java.util.function.Function<T,Variable> indicatorVariable, java.util.function.Function<T,java.lang.Boolean> indicatorValue, java.util.function.Function<T,Inequality> row)
Add indicator constraints to this model. The function iterates throughdata
and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixedt
, ifindicatorValue(t)
returnstrue
then the created constraint states that ifindicatorVariable(t)
is 1 (one), thenrow(t)
must be satisfied and is ignored otherwise. Otherwise,row(t)
must be satisfied ifindicatorVariable(t)
is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.- Type Parameters:
-
T
- Data type. - Parameters:
-
data
- Data for which constraints are created. -
indicatorVariable
- Indicator variables. -
indicatorValue
- Whether indicator variables should be non-zero or zero for rows to become active. If this isnull
then rows become active if indicator variables are non-zero. -
row
- The implied rows for the indicator constraints. - Since:
- 43.00
-
setIndicators
public void setIndicators(int count, java.util.function.Function<java.lang.Integer,Variable> indicatorVariable, java.util.function.Function<java.lang.Integer,java.lang.Boolean> indicatorValue, java.util.function.Function<java.lang.Integer,Inequality> row)
Add indicator constraints to this model. The function iterates through[0, ... ,count[
and calls the provided functions for each in this interval. The return values of the functions are used to construct an indicator constraint. For a fixedt
, ifindicatorValue(t)
returnstrue
then the created constraint states that ifindicatorVariable(t)
is 1 (one), thenrow(t)
must be satisfied and is ignored otherwise. Otherwise,row(t)
must be satisfied ifindicatorVariable(t)
is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.- Parameters:
-
count
- How many constraint to add. -
indicatorVariable
- Indicator variables. -
indicatorValue
- Whether indicator variables should be non-zero or zero for rows to become active. If this isnull
then rows become active if indicator variables are non-zero. -
row
- The implied rows for the indicator constraints. - Since:
- 43.00
-
setIndicators
public void setIndicators(int[] data, java.util.function.IntFunction<Variable> indicatorVariable, java.util.function.IntFunction<java.lang.Boolean> indicatorValue, java.util.function.IntFunction<Inequality> row)
Add indicator constraints to this model. The function iterates throughdata
and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixedt
, ifindicatorValue(t)
returnstrue
then the created constraint states that ifindicatorVariable(t)
is 1 (one), thenrow(t)
must be satisfied and is ignored otherwise. Otherwise,row(t)
must be satisfied ifindicatorVariable(t)
is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.- Parameters:
-
data
- Data for which constraints are created. -
indicatorVariable
- Indicator variables. -
indicatorValue
- Whether indicator variables should be non-zero or zero for rows to become active. If this isnull
then rows become active if indicator variables are non-zero. -
row
- The implied rows for the indicator constraints. - Since:
- 43.00
-
setIndicators
public void setIndicators(java.util.stream.IntStream data, java.util.function.IntFunction<Variable> indicatorVariable, java.util.function.IntFunction<java.lang.Boolean> indicatorValue, java.util.function.IntFunction<Inequality> row)
Add indicator constraints to this model. The function iterates throughdata
and calls the provided functions for each element found. The return values of the functions are used to construct an indicator constraint. For a fixedt
, ifindicatorValue(t)
returnstrue
then the created constraint states that ifindicatorVariable(t)
is 1 (one), thenrow(t)
must be satisfied and is ignored otherwise. Otherwise,row(t)
must be satisfied ifindicatorVariable(t)
is 0 (zero) and is ignored otherwise. All referenced variables and rows must exist.- Parameters:
-
data
- Data for which constraints are created. -
indicatorVariable
- Indicator variables. -
indicatorValue
- Whether indicator variables should be non-zero or zero for rows to become active. If this isnull
then rows become active if indicator variables are non-zero. -
row
- The implied rows for the indicator constraints. - Since:
- 43.00
-
repairWeightedInfeas
public int repairWeightedInfeas(java.util.Map<Inequality,java.lang.Double> lepref, java.util.Map<Inequality,java.lang.Double> gepref, java.util.Map<Variable,java.lang.Double> lbpref, java.util.Map<Variable,java.lang.Double> ubpref, char phase2, double delta, java.lang.String flags)
Repair infeasibilities using weights. By relaxing a set of selected constraints and bounds of an infeasible problem, it attempts to identify a 'solution' that violates the selected set of constraints and bounds minimally, while satisfying all other constraints and bounds. Among such solution candidates, it selects one that is optimal regarding the original objective function.Used in these examples:
- Repair
- Parameters:
-
lepref
- Map with preferences for relaxing the less-than-or-equal direction of rows. Inequalities without preference will not be relaxed. Can benull
. -
gepref
- Map with preferences for relaxing the greater-than-or-equal direction of rows. Inequalities without preference will not be relaxed. Can benull
. -
lbpref
- Map with preferences for relaxing the lower bounds of variables. Variables without preference will not be relaxed. Can benull
. -
ubpref
- Map with preferences for relaxing the upper bounds of variables. Variables without preference will not be relaxed. Can benull
. -
phase2
- Controls the second phase of optimization. -
delta
- Relaxation multiplier in second phase - 1. -
flags
- Flags passed to the optimizer. - Returns:
- Result status.
- Since:
- 43.00
-
getSOSs
public SOS[] getSOSs()
Get all the special ordered set constraints currently defined in this problem.- Returns:
- All special ordered set constraints in this problem.
- Since:
- 44.00
- See Also:
-
sosForIndex(int)
-
sosForIndex
public SOS sosForIndex(int index)
Map an SOS index to an SOS object.- Parameters:
-
index
- Index to map. - Returns:
-
The SOS for
index
. - Since:
- 43.00
- See Also:
-
getSOSs()
-
sosForIndices
public SOS[] sosForIndices(int first, int last)
Map a range of SOS indices to SOS objects.- Parameters:
-
first
- First index to map. -
last
- Last index to map. - Since:
- 43.00
-
delSets
public void delSets(int nsets, int[] sosind)
Delete sets from this problem. Note that this may be expensive if you useSOS
instances to formulate your problem since indices of remaining sets will have to be updated after sets were deleted from the underlying model. If you have to delete multiple sets then it is best to collect all sets to be deleted in an array and then delete all of them with a single call to this function.
-
delSOS
public void delSOS(SOS[] soss)
Delete special ordered set constraints. Removes all the specified special ordered set constraints from this problem.- Parameters:
-
soss
- SOS to be deleted. - Since:
- 43.00
-
delSOS
public void delSOS(SOS sos)
Delete a single SOS from the problem.- Parameters:
-
sos
- SOS to delete. - Since:
- 43.00
-
getPWLs
public PWL[] getPWLs()
Get all piecewise linear constraints currently defined in this problem.- Returns:
- All piecewise linear constraints in this problem.
- Since:
- 44.00
- See Also:
-
pwlForIndex(int)
-
pwlForIndex
public PWL pwlForIndex(int index)
Map a PWL index to a PWL object.- Parameters:
-
index
- Index to map. - Returns:
-
The PWL for
index
. - Since:
- 43.00
- See Also:
-
getPWLs()
-
pwlsForIndices
public PWL[] pwlsForIndices(int first, int last)
Map a range of PWL indices to PWL objects.- Parameters:
-
first
- First index to map. -
last
- Last index to map. - Returns:
-
The SOSs from
first
(inclusive). - Since:
- 43.00
-
delPwlCons
public void delPwlCons(int npwls, int[] pwlind)
Delete piecewise linear constraints from this problem. Note that this may be expensive if you usePWL
instances to formulate your problem since indices of remaining variables will have to be updated after columns were deleted from the underlying model. If you have to delete multiple variables then it is best to collect all variables to be deleted in an array and then delete all of them with a single call to this function.- Overrides:
-
delPwlCons
in classXPRSprob
- Parameters:
-
npwls
- Number of constraints to delete. -
pwlind
- Indices of constraints to delete. - Since:
- 43.00
-
delPwlConstraints
public void delPwlConstraints(PWL[] pwls)
Delete PWL constraints from this problem.- Parameters:
-
pwls
- Piecewise linear constraints to be deleted. - Since:
- 43.00
-
getIIS
public IIS getIIS(int iis)
Get the specified IIS.- Parameters:
-
iis
- The index of the IIS for which data is queried. - Returns:
-
The IIS specified by
iis
. - Since:
- 43.00
-
chgObj
public XpressProblem chgObj(Variable variable, double coefficient)
Change objective function coefficient. This changes the linear coefficient in the first/primary objective function. In order to delete a coefficient from the objective set it to 0 (zero).Used in these examples:
- GlobalObjectiveParametrics
- GoalProg
- Parameters:
-
variable
- Variable for which to change coefficient. -
coefficient
- New coefficient for variables. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
chgObj
public XpressProblem chgObj(Variable[] variables, double[] coefficients)
Change objective function coefficients. This changes the linear coefficients in the first/primary objective function. In order to delete a coefficient from the objective set it to 0 (zero).Used in these examples:
- GlobalObjectiveParametrics
- GoalProg
- Parameters:
-
variables
- Variables for which to change coefficients. -
coefficients
- New coefficients for variables. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
chgObjN
public XpressProblem chgObjN(int objidx, Variable variable, double coefficient)
Change an objective function coefficient for a multi-objective problem. This changes the linear coefficient in the objective functionobjidx
. In order to delete a coefficient from the objective set it to 0 (zero).Used in these examples:
- GoalProg
- Parameters:
-
objidx
- Index of objective function to change, -
variable
- Variable for which to change coefficient. -
coefficient
- New coefficient for variable. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
chgObjN
public XpressProblem chgObjN(int objidx, Variable[] variables, double[] coefficients)
Change objective function coefficients for a multi-objective problem. This changes tje linear coefficients in the objective functionobjidx
. In order to delete a coefficient from the obejctive set it to 0 (zero).Used in these examples:
- GoalProg
- Parameters:
-
objidx
- Index of objective function to change, -
variables
- Variables for which to change coefficients. -
coefficients
- New coefficients for variables. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
chgCoef
public XpressProblem chgCoef(Inequality row, Variable variable, double coefficient)
Changes the coefficient forvariable
inrow
in the linear matrix.- Parameters:
-
row
- Inequality in which to change coefficient. -
variable
- Variable for which to change coefficient. -
coefficient
- The new coefficient. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
chgCoefs
public XpressProblem chgCoefs(Inequality[] row, Variable[] variable, double[] coefficient)
Change coefficients in the linear matrix. The function changes the coefficients as indicated by the triplets given byrow
,variable
,coefficient
.- Parameters:
-
row
- Inequality in which to change coefficient. -
variable
- Variable for which to change coefficient. -
coefficient
- The new coefficient. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
getGeneralConstraints
public GeneralConstraint[] getGeneralConstraints()
Get all the general constraints currently defined in this problem.- Returns:
- All general constraints in this problem.
- Since:
- 43.00
- See Also:
-
generalConstraintForIndex(int)
-
generalConstraintForIndex
public GeneralConstraint generalConstraintForIndex(int index)
Map a general constraint index to aGeneralConstraint
object.- Parameters:
-
index
- The index to map. - Returns:
-
The
GeneralConstraint
object forindex
. - Since:
- 43.00
- See Also:
-
getGeneralConstraints()
-
generalConstraintForIndices
public GeneralConstraint[] generalConstraintForIndices(int first, int last)
Map a range of general constraint indices toGeneralConstraint
objects.- Parameters:
-
first
- First index in range (inclusive). -
last
- Last index in range (inclusive). - Returns:
-
The
GeneralConstraint
objects in the specified range. - Since:
- 43.00
-
delGenCons
public void delGenCons(int nconstraints, int[] conind)
Delete constraints from this problem. Note that this may be expensive if you useGeneralConstraint
instances to formulate your problem since indices of remaining constraints will have to be updated after constraints were deleted from the underlying model. If you have to delete multiple constraints then it is best to collect all constraints to be deleted in an array and then delete all of them with a single call to this function.- Overrides:
-
delGenCons
in classXPRSprob
- Parameters:
-
nconstraints
- Number of constraints to delete. -
conind
- Indices of constraints to delete. - Since:
- 43.00
-
delGeneralConstraints
public void delGeneralConstraints(GeneralConstraint[] constraints)
Delete general constraints from this problem.- Parameters:
-
constraints
- The constraints to be deleted. - Since:
- 43.00
-
inequalityForIndex
public Inequality inequalityForIndex(int index)
Map an inequality index to an inequality object.- Parameters:
-
index
- Index to map. - Returns:
-
The inequality for
index
. - Since:
- 43.00
- See Also:
-
getInequalities()
-
inequalitiesForIndices
public Inequality[] inequalitiesForIndices(int first, int last)
Map a range of inequality indices to inequality objects.- Parameters:
-
first
- First index to map. -
last
- Last index to map. - Since:
- 43.00
-
getInequalities
public Inequality[] getInequalities()
Get all the inequalities currently defined in this problem.- Returns:
- All the inequalities in this problem.
- Since:
- 43.00
- See Also:
-
inequalityForIndex(int)
-
delRows
public void delRows(int nrows, int[] rowind)
Delete rows from this problem. Note that this may be expensive if you useInequality
instances to formulate your problem since indices of remaining rows will have to be updated after rows were deleted from the underlying model. If you have to delete multiple rows then it is best to collect all rows to be deleted in an array and then delete all of them with a single call to this function.
-
delInequalities
public void delInequalities(Inequality[] rows)
Delete inequality constraints from this problem.- Parameters:
-
rows
- Inequalities to be deleted. - Since:
- 43.00
-
getSlacks
public double[] getSlacks(Inequality[] rows)
Get the current slacks for an array of rows. The values in the returned array are in 1-to-1 correspondence with the rows inrows
.Used in these examples:
- Repair
- Tableau
- Parameters:
-
rows
- Inequalities for which to query slacks. - Returns:
-
Slacks for inequalities in
rows
. - Since:
- 43.00
-
getSlacks
public double[] getSlacks(java.util.Collection<Inequality> rows)
Get the current slacks for a collection of rows. The values in the returned array are in 1-to-1 correspondence with the rows inrows
.Used in these examples:
- Repair
- Tableau
- Parameters:
-
rows
- Inequalities for which to query slacks. - Returns:
-
Slacks for inequalities in
rows
. - Since:
- 43.00
-
getSlack
public double getSlack(Inequality r)
Get the current slack for a single row.- Parameters:
-
r
- Inequality for which to query slack. - Returns:
-
Slack for
r
. - Since:
- 43.00
-
getDuals
public double[] getDuals(Inequality[] rows)
Get the duals for an array of rows. The values in the returned array are in 1-to-1 correspondence with the rows inrows
.- Parameters:
-
rows
- Inequalities for which to query duals. - Returns:
-
Duals for inequalities in
rows
. - Since:
- 43.00
-
getDuals
public double[] getDuals(java.util.Collection<Inequality> rows)
Get the duals for a collection of rows. The values in the returned array are in 1-to-1 correspondence with the row inrow
.- Parameters:
-
rows
- Inequalties for which to query duals. - Returns:
-
Duals for inequalities in
rows
. - Since:
- 43.00
-
getDual
public double getDual(Inequality r)
Get the dual for a single row.- Parameters:
-
r
- Inequality for which to query dual. - Returns:
-
Dual for
r
. - Since:
- 43.00
-
getCallbackSlacks
public double[] getCallbackSlacks(Inequality[] rows)
Get the slacks associated with the current callback for an array of rows. The values in the returned array are in 1-to-1 correspondence with the rows inrows
.- Parameters:
-
rows
- Inequalities for which to query slacks. - Returns:
-
Slacks for inequalities in
rows
. - Since:
- 44.00
-
getCallbackSlacks
public double[] getCallbackSlacks(java.util.Collection<Inequality> rows)
Get the slacks associated with the current callback for a collection of rows. The values in the returned array are in 1-to-1 correspondence with the rows inrows
.- Parameters:
-
rows
- Inequalities for which to query slacks. - Returns:
-
Slacks for inequalities in
rows
. - Since:
- 44.00
-
getCallbackSlack
public double getCallbackSlack(Inequality r)
Get the slack associated with the current callback for a single row.- Parameters:
-
r
- Inequality for which to query slack. - Returns:
-
Slack for
r
. - Since:
- 44.00
-
getCallbackDuals
public double[] getCallbackDuals(Inequality[] rows)
Get the duals associated with the current callback for an array of rows. The values in the returned array are in 1-to-1 correspondence with the rows inrows
.- Parameters:
-
rows
- Inequalities for which to query duals. - Returns:
-
Duals for inequalities in
rows
. - Since:
- 44.00
-
getCallbackDuals
public double[] getCallbackDuals(java.util.Collection<Inequality> rows)
Get the duals associated with the current callback for a collection of rows. The values in the returned array are in 1-to-1 correspondence with the row inrow
.- Parameters:
-
rows
- Inequalties for which to query duals. - Returns:
-
Duals for inequalities in
rows
. - Since:
- 43.00
-
getCallbackDual
public double getCallbackDual(Inequality r)
Get the dual associated with the current callback for a single row.- Parameters:
-
r
- Inequality for which to query dual. - Returns:
-
Dual for
r
. - Since:
- 44.00
-
rhsSA
public void rhsSA(int len, Inequality[] rows, double[] lower, double[] upper)
Returns upper and lower sensitivity ranges for specified right hand side (RHS) function coefficients. If the RHS coefficients are varied within these ranges the current basis remains optimal and the reduced costs remain valid.- Parameters:
-
len
- Sensitity analysis is only performed for the firstlen
elements inrows
. -
rows
- The rows for which to perform sensitivity analysis. -
lower
- Array of length at leastlen
that receives the sensitivity lower bounds. -
upper
- Array of length at leastlen
that receives the sensitivity upper bounds. - Since:
- 43.00
-
rhsSA
public void rhsSA(Inequality[] rows, double[] lower, double[] upper)
Returns upper and lower sensitivity ranges for specified right hand side (RHS) function coefficients. If the RHS coefficients are varied within these ranges the current basis remains optimal and the reduced costs remain valid.- Parameters:
-
rows
- The rows for which to perform sensitivity analysis. -
lower
- Array at least as long asrows
that receives the sensitivity lower bounds. -
upper
- Array at least as long asrows
that receives the sensitivity upper bounds. - Since:
- 43.00
-
chgRHS
public void chgRHS(Inequality[] rows, double[] newRHS)
Change right-hand side for multiple rows.Used in these examples:
- GlobalRHSParametrics
- Repair
- Parameters:
-
rows
- Inequalities for which to change right-hand sides. -
newRHS
- New right-hand side values. - Since:
- 43.00
-
chgRowType
public void chgRowType(Inequality[] rows, RowType[] rowType)
Change types for multiple rows.Used in these examples:
- Repair
- Parameters:
-
rows
- Inequalities for which to change types. -
rowType
- New row types. - Since:
- 43.00
-
chgRHSrange
public void chgRHSrange(Inequality[] rows, double[] newRange)
Change right-hand side ranges for multiple rows.Used in these examples:
- Repair
- Parameters:
-
rows
- Inequalities for which to right-hand side ranges. -
newRange
- New right-hand side range values. - Since:
- 43.00
-
loadDelayedRows
public void loadDelayedRows(Inequality[] rows)
Marks a set of rows as delayed rows.- Parameters:
-
rows
- Inequalities to mark as delayed. - Since:
- 43.00
-
loadModelCuts
public void loadModelCuts(Inequality[] rows)
Marks a set of rows as model cuts.- Parameters:
-
rows
- Inequalities to mark as model cuts. - Since:
- 43.00
-
getCoef
public double getCoef(Inequality row, Variable variable)
Query a single coefficient from the linear matrix. Retrieves the coefficient ofvariable
inrow
in the linear matrix. Note that the coefficient will be 0 (zero) in case the variable has no coefficient in that row.- Parameters:
-
row
- The row in which to query the coefficient. -
variable
- The variable for which to query the coefficient. - Returns:
- The queried coefficient.
- Since:
- 43.00
-
getObj
public double getObj(Variable variable)
Query an objective function coefficient. Retrieves the linear objective coefficient for the specified variable from the first/primary objective.Used in these examples:
- Knapsack
- Parameters:
-
variable
- The variable for which to query the objective. - Returns:
-
The objective coefficient for
variable
. - Since:
- 43.00
-
getObjN
public double getObjN(int objidx, Variable variable)
Query an objective function coefficient. Retrieves the linear objective coefficient for the specified variable from objectiveobjidx
.- Parameters:
-
objidx
- objects.Index of objective function to query. -
variable
- The variable for which to query the objective. - Returns:
-
The objective coefficient for
variable
. - Since:
- 43.00
-
addConstraints
public <T,C extends Index> java.util.stream.Stream<java.util.Map.Entry<T,C>> addConstraints(java.util.Iterator<T> data, java.util.function.Function<T,ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem. Calls the specified functions for each element indata
and adds a constraint as specified by the return values of the functions.- Type Parameters:
-
T
- Data type. -
C
- Constraint type. - Parameters:
-
data
- Data to generate constraints. -
defs
- Function to produce the constraint definitions. - Returns:
- The created constraint indexed by data.
- Since:
- 43.00
-
addConstraint
public <C extends Index> C addConstraint(ConstraintDefinition<C> def)
Add a single constraint to this problem.- Type Parameters:
-
C
- Constraint type. - Parameters:
-
def
- Definition of the constraint to add. - Returns:
- The new constraint.
- Since:
- 43.00
-
addConstraints
public <C extends Index,T extends ConstraintDefinition<C>> java.util.stream.Stream<C> addConstraints(java.util.stream.Stream<T> defs)
Add multiple constraints of the same type to the problem.- Type Parameters:
-
C
- Constraint type. -
T
- Definition type. - Parameters:
-
defs
- The constraints to add. - Returns:
- The new constraints.
- Since:
- 43.00
-
addConstraints
public <C extends Index,T extends ConstraintDefinition<C>> java.util.stream.Stream<C> addConstraints(java.lang.Iterable<T> defs)
Add multiple constraints of the same type to the problem.- Type Parameters:
-
C
- Constraint type. -
T
- Definition type. - Parameters:
-
defs
- The constraints to add. - Returns:
- The new constraints.
- Since:
- 43.00
-
addConstraints
public <C extends Index> java.util.stream.Stream<C> addConstraints(ConstraintDefinition<C>[] defs)
Add multiple of the same type constraints to the problem.- Type Parameters:
-
C
- Constraint type. - Parameters:
-
defs
- The constraints to add. - Returns:
- The new constraints.
- Since:
- 43.00
-
addConstraints
public <C extends Index> java.util.stream.Stream<C> addConstraints(int count, java.util.function.IntFunction<ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem. Calls the specified function for each element in[0, ..., count[
and adds a constraint as specified by the return value of the function.- Type Parameters:
-
C
- Constraint type. - Parameters:
-
count
- Number of constraints to add. -
defs
- Function to produce the constraints to add. - Returns:
- The new constraints.
- Since:
- 43.00
-
addConstraints
public <T,C extends Index> java.util.stream.Stream<C> addConstraints(java.util.stream.Stream<T> data, java.util.function.Function<T,ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem. Calls the specified function for each element indata
and adds a constraint as specified by the return value of the function.- Type Parameters:
-
T
- Data type. -
C
- Constraint type. - Parameters:
-
data
- Data to generate constraints. -
defs
- Function to generate a constraint for each data element. - Returns:
- The new constraints.
- Since:
- 43.00
-
addConstraints
public <T,C extends Index> java.util.stream.Stream<C> addConstraints(T[] data, java.util.function.Function<T,ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem. Calls the specified function for each element indata
and adds a constraint as specified by the return value of the function.- Type Parameters:
-
T
- Data type -
C
- Constraint type. - Parameters:
-
data
- Data to generate constraints. -
defs
- Function to generate a constraint for each data element. - Returns:
- The new constraints.
- Since:
- 43.00
-
addConstraints
public <T,C extends Index> java.util.stream.Stream<C> addConstraints(java.lang.Iterable<T> data, java.util.function.Function<T,ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem. Calls the specified function for each element indata
and adds a constraint as specified by the return value of the function.- Type Parameters:
-
T
- Data type -
C
- Constraint type. - Parameters:
-
data
- Data for the constraints. -
defs
- Function to generate a constraint for each data element. - Returns:
- The new constraints.
- Since:
- 43.00
-
addConstraints
public <C extends Index> java.util.stream.Stream<C> addConstraints(int[] data, java.util.function.IntFunction<ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem. Calls the specified function for each element indata
and adds a constraint as specified by the return value of the function.- Type Parameters:
-
C
- Constraint type. - Parameters:
-
data
- Data to generate constraints. -
defs
- Function to generate a constraint for each data item. - Returns:
- The new constraints.
- Since:
- 43.00
-
addConstraints
public <C extends Index> java.util.stream.Stream<C> addConstraints(java.util.stream.IntStream data, java.util.function.IntFunction<ConstraintDefinition<C>> defs)
Add multiple constraints of the same type to the problem. Calls the specified function for each element indata
and adds a constraint as specified by the return value of the function.- Type Parameters:
-
C
- Constraint type. - Parameters:
-
data
- Data to generate constraints. -
defs
- Function to generate a constraint for each data element. - Returns:
- The new constraints.
- Since:
- 43.00
-
getInequalityLinear
@Deprecated public LinTermList getInequalityLinear(Inequality row)
Deprecated.since 44.00, Use getLhs() insteadGet the linear part of the left-hand side of a row.- Parameters:
-
row
- The row for which the linear part is queried. - Returns:
- The linear part of the row. This is guaranteed to not have any duplicates.
- Since:
- 43.00
-
getInequalityLinear
public LinExpression getInequalityLinear(Inequality row, java.util.function.Supplier<LinExpression> expression)
Get the linear part of the left-hand side of a row. The function adds the linear part ofrow
to the expression provided byexpression
. Ifexpression
isnull
then the function allocates a newcom.dashoptimization.objects.LinTermList
for it. If the function allocates a newcom.dashoptimization.objects.LinTermList
then it also returns that new object. In that case the list is guaranteed to not have any duplicates.- Parameters:
-
row
- The row for which the linear part is queried. -
expression
- Creates the expression that is returned by this function. Can benull
in which case a newcom.dashoptimization.objects.LinTermList
is created. - Returns:
- An expression that represent the linear part of the given row.
- Since:
- 43.00
-
isOriginal
public boolean isOriginal()
Check whether this model instance is in the original state. A model is not in the original state if it is a callback problem or its problem state indicates being presolved.Used in these examples:
- MostViolated
- Returns:
-
true
if this instance is in original state. - Since:
- 43.00
-
addCut
public int addCut(int cuttype, Inequality.Definition cut)
Add a cut at the current node. It is assumed that the left-hand side (lhs
) is formulated in terms of the original model. So you can useVariable
instances to formulate it. When using plain variable indices, be sure these indices are for the original model. The function will automatically transform (presolve) the cut to the presolved space. If presolving the cut fails then the cut is not added and the reason for failure is returned. Failing to presolve (and thus adding) a cut is not a problem in every context. That is why this does not raise an exception but instead leaves it to the caller to decide whether this is an error or not.Used in these examples:
- TSP
- Parameters:
-
cuttype
- User defined cut type. -
cut
- The inequality to add as cut. - Returns:
-
0 (zero) if the cut was successfully added. Otherwise the status code from
presolveRow
that indicates why the cut could not be presolved. It is up to the caller to decide whether not being able to presolve the cut is a problem or not. - Since:
- 43.00
-
createBranchObject
public XpressProblem.BranchObject createBranchObject()
Create a new branch object. This is different from the super class's createBranchObject() function in two aspects: - it returns an instance ofBranchObject
, notXPRSbranchobject
. The former is a subclass of the latter and has functions to add bounds and constraints that referenceVariable
objects. - the returned object always operates in the original space.Used in these examples:
- MostViolated
- Returns:
- The new branch object.
- Since:
- 43.00
-
setObjective
public void setObjective(Expression obj)
Set the objective function to a new expression.Used in these examples:
- TSP
- Parameters:
-
obj
- The new objective - Since:
- 43.00
-
setObjective
public void setObjective(Expression obj, XPRSenumerations.ObjSense sense)
Set the objective function to a new expression.Used in these examples:
- TSP
- Parameters:
-
obj
- The new objective -
sense
- The new objective sense (minimize or maximize). - Since:
- 43.00
-
addObjective
public void addObjective(Expression obj, int priority, double weight)
Add a new objective function. This turns the problem into a multi-objective problem.- Parameters:
-
obj
- The new objective -
priority
- Priority for new objective. -
weight
- Weight for new objective. - Since:
- 43.00
-
setObjective
public void setObjective(int idx, Expression obj, int priority, double weight, double abstol, double reltol)
Set an objective function and its controls. In case of error: - if the function created new objectives then all newly created objectives will be removed, - if an existing objective was modified then that objective function will be cleared and all controls will be unchanged.Used in these examples:
- TSP
- Parameters:
-
idx
- Index of objective to set. -
obj
- New objective foridx
. -
priority
- New objective priority. -
weight
- New objective weight. -
abstol
- New absolute tolerance for objectiveidx
. -
reltol
- New relative tolerance for objectiveidx
. - Since:
- 43.00
-
nlpSetInitVal
public void nlpSetInitVal(java.util.Map<Variable,java.lang.Double> values)
Set initial values of variables for a non-linear solve.- Parameters:
-
values
- Values to be set. For each variable/value pair in this map the corresponding initial value is set. - Since:
- 43.00
-
nlpSetInitVal
public void nlpSetInitVal(Variable[] variables, double[] values)
Set initial values of variables for a non-linear solve.- Parameters:
-
variables
- Variables for which to set values. -
values
- Values forvariables
. This must have the same length asvariables
. The initial value forvariables[i]
isvalues[i]
. - Since:
- 43.00
-
getLhsExpression
public Expression getLhsExpression(int row)
Get the left-hand side of a row as an expression.- Parameters:
-
row
- Index of row to fetch. - Returns:
-
The left-hand side of row
row
. - Since:
- 43.00
-
addConstraints
public <C extends Index> void addConstraints(int count1, int count2, java.util.function.BiFunction<java.lang.Integer,java.lang.Integer,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of[0,count1[, ..., [0,countN[
and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
C
- The type of constraints. - Parameters:
-
count1
- Length of dimension 1. -
count2
- Length of dimension 2. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <K1,K2,C extends Index> void addConstraints(java.lang.Iterable<K1> iterable1, java.lang.Iterable<K2> iterable2, java.util.function.BiFunction<K1,K2,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of the iterables and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
K1
- Data for dimension 1. -
K2
- Data for dimension 2. -
C
- The type of constraints. - Parameters:
-
iterable1
- Keys for dimension 1. -
iterable2
- Keys for dimension 2. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <K1,K2,C extends Index> void addConstraints(K1[] array1, K2[] array2, java.util.function.BiFunction<K1,K2,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of the arrays and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
K1
- Data for dimension 1. -
K2
- Data for dimension 2. -
C
- The type of constraints. - Parameters:
-
array1
- Data for dimension 1. -
array2
- Data for dimension 2. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <C extends Index> void addConstraints(int count1, int count2, int count3, Function3<java.lang.Integer,java.lang.Integer,java.lang.Integer,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of[0,count1[, ..., [0,countN[
and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
C
- The type of constraints. - Parameters:
-
count1
- Length of dimension 1. -
count2
- Length of dimension 2. -
count3
- Length of dimension 3. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <K1,K2,K3,C extends Index> void addConstraints(java.lang.Iterable<K1> iterable1, java.lang.Iterable<K2> iterable2, java.lang.Iterable<K3> iterable3, Function3<K1,K2,K3,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of the iterables and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
K1
- Data for dimension 1. -
K2
- Data for dimension 2. -
K3
- Data for dimension 3. -
C
- The type of constraints. - Parameters:
-
iterable1
- Keys for dimension 1. -
iterable2
- Keys for dimension 2. -
iterable3
- Keys for dimension 3. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <K1,K2,K3,C extends Index> void addConstraints(K1[] array1, K2[] array2, K3[] array3, Function3<K1,K2,K3,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of the arrays and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
K1
- Data for dimension 1. -
K2
- Data for dimension 2. -
K3
- Data for dimension 3. -
C
- The type of constraints. - Parameters:
-
array1
- Data for dimension 1. -
array2
- Data for dimension 2. -
array3
- Data for dimension 3. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <C extends Index> void addConstraints(int count1, int count2, int count3, int count4, Function4<java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of[0,count1[, ..., [0,countN[
and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
C
- The type of constraints. - Parameters:
-
count1
- Length of dimension 1. -
count2
- Length of dimension 2. -
count3
- Length of dimension 3. -
count4
- Length of dimension 4. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <K1,K2,K3,K4,C extends Index> void addConstraints(java.lang.Iterable<K1> iterable1, java.lang.Iterable<K2> iterable2, java.lang.Iterable<K3> iterable3, java.lang.Iterable<K4> iterable4, Function4<K1,K2,K3,K4,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of the iterables and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
K1
- Data for dimension 1. -
K2
- Data for dimension 2. -
K3
- Data for dimension 3. -
K4
- Data for dimension 4. -
C
- The type of constraints. - Parameters:
-
iterable1
- Keys for dimension 1. -
iterable2
- Keys for dimension 2. -
iterable3
- Keys for dimension 3. -
iterable4
- Keys for dimension 4. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <K1,K2,K3,K4,C extends Index> void addConstraints(K1[] array1, K2[] array2, K3[] array3, K4[] array4, Function4<K1,K2,K3,K4,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of the arrays and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
K1
- Data for dimension 1. -
K2
- Data for dimension 2. -
K3
- Data for dimension 3. -
K4
- Data for dimension 4. -
C
- The type of constraints. - Parameters:
-
array1
- Data for dimension 1. -
array2
- Data for dimension 2. -
array3
- Data for dimension 3. -
array4
- Data for dimension 4. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <C extends Index> void addConstraints(int count1, int count2, int count3, int count4, int count5, Function5<java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,java.lang.Integer,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of[0,count1[, ..., [0,countN[
and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
C
- The type of constraints. - Parameters:
-
count1
- Length of dimension 1. -
count2
- Length of dimension 2. -
count3
- Length of dimension 3. -
count4
- Length of dimension 4. -
count5
- Length of dimension 5. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <K1,K2,K3,K4,K5,C extends Index> void addConstraints(java.lang.Iterable<K1> iterable1, java.lang.Iterable<K2> iterable2, java.lang.Iterable<K3> iterable3, java.lang.Iterable<K4> iterable4, java.lang.Iterable<K5> iterable5, Function5<K1,K2,K3,K4,K5,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of the iterables and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
K1
- Data for dimension 1. -
K2
- Data for dimension 2. -
K3
- Data for dimension 3. -
K4
- Data for dimension 4. -
K5
- Data for dimension 5. -
C
- The type of constraints. - Parameters:
-
iterable1
- Keys for dimension 1. -
iterable2
- Keys for dimension 2. -
iterable3
- Keys for dimension 3. -
iterable4
- Keys for dimension 4. -
iterable5
- Keys for dimension 5. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addConstraints
public <K1,K2,K3,K4,K5,C extends Index> void addConstraints(K1[] array1, K2[] array2, K3[] array3, K4[] array4, K5[] array5, Function5<K1,K2,K3,K4,K5,ConstraintDefinition<C>> makeConstraint)
Add multiple constraints to this problem. CallsmakeConstraint
for each element in the cartesian product of the arrays and adds the constraint that is produced by this function call. A deep copy is made of each constraint, thus modifying the constraint later will not alter the model.- Type Parameters:
-
K1
- Data for dimension 1. -
K2
- Data for dimension 2. -
K3
- Data for dimension 3. -
K4
- Data for dimension 4. -
K5
- Data for dimension 5. -
C
- The type of constraints. - Parameters:
-
array1
- Data for dimension 1. -
array2
- Data for dimension 2. -
array3
- Data for dimension 3. -
array4
- Data for dimension 4. -
array5
- Data for dimension 5. -
makeConstraint
- Function to generate a constraint. - Since:
- 43.00
-
addVariables
public VariableBuilder.VariableArrayBuilder addVariables(int dim)
Create an 1-dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoArray()
function.// Create a multi-dimensional array of binary variables com.dashoptimization.objects.Variable[] = prob.addVariables(dim) .withType(com.dashoptimization.objects.ColumnType.Binary) .toArray();
SeeVariableBuilder.VariableArrayBuilder
for details of how to modify the specification in the builder.- Parameters:
-
dim
- Dimension. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1> VariableBuilder.VariableMapBuilder<K1> addVariables(java.util.Collection<K1> coll1)
Create an 1-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional map of binary variables java.util.HashMap<K1 ,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMapBuilder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. - Parameters:
-
coll1
- Data for dimension 1. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1> VariableBuilder.VariableMapBuilder<K1> addVariables(K1[] arr1)
Create an 1-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional array of binary columns java.util.HashMap<K1 ,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMapBuilder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. - Parameters:
-
arr1
- Data for the builder. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1> VariableBuilder.VariableMapBuilder<K1> addVariables(java.util.stream.Stream<K1> strm)
Create an 1-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional array of binary columns java.util.HashMap<K1 ,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMapBuilder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. - Parameters:
-
strm
- Stream with data from which to generate variables. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariable
public Variable addVariable(double lb, double ub, ColumnType type, java.lang.String name)
Add a single variable to this problem.- Parameters:
-
lb
- Lower bound for new variable. -
ub
- Upper bound for new variable. -
type
- Type for new variable. -
name
- Name for new variable, can benull
. - Returns:
- The newly created variable.
- Since:
- 43.00
-
addVariable
public Variable addVariable(double lb, double ub, ColumnType type, double limit, java.lang.String name)
Add a single variable to this problem.- Parameters:
-
lb
- Lower bound for new variable. -
ub
- Upper bound for new variable. -
type
- Type for new variable. -
limit
- Global limit for the variable. This is ignored unless the variable is semi-continuous, semi-integer or partial integer. -
name
- Name for new variable, can benull
. - Returns:
- The newly created variable.
- Since:
- 43.00
-
addVariable
public Variable addVariable(double lb, double ub, ColumnType type)
Add a single variable to this problem.- Parameters:
-
lb
- Lower bound for new variable. -
ub
- Upper bound for new variable. -
type
- Type for new variable. - Returns:
- The newly created variable.
- Since:
- 43.00
-
addVariable
public Variable addVariable(java.lang.String name)
Add a single variable to this problem. The variable will have default type (continuous) and bounds (0 and infinity).- Parameters:
-
name
- Name for new variable. - Returns:
- The newly created variable.
- Since:
- 43.00
-
addVariable
public Variable addVariable(ColumnType type)
Add a single variable to this problem. The variable will have default bounds and no name.- Parameters:
-
type
- Type for new variable. - Returns:
- The newly created variable.
- Since:
- 43.00
-
addVariable
public Variable addVariable(ColumnType type, java.lang.String name)
Add a single variable to this problem. The variable will have default bounds.- Parameters:
-
type
- Type for new variable. -
name
- Name for new variable. - Returns:
- The newly created variable.
- Since:
- 43.00
-
addVariable
public Variable addVariable()
Add a single variable to this problem. This variable will be continuous, have default bounds (0 and infinity) and will not have a name.- Returns:
- The newly created variable.
- Since:
- 43.00
-
addVariables
public VariableBuilder.VariableArray2Builder addVariables(int dim1, int dim2)
Create an 2-dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoArray()
function.// Create a multi-dimensional array of binary variables com.dashoptimization.objects.Variable[] [] = prob.addVariables(dim1 ,dim2) .withType(com.dashoptimization.objects.ColumnType.Binary) .toArray();
SeeVariableBuilder.VariableArray2Builder
for details of how to modify the specification in the builder.- Parameters:
-
dim1
- Dimension 1. -
dim2
- Dimension 2. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1,K2> VariableBuilder.VariableMap2Builder<K1,K2> addVariables(java.util.Collection<K1> coll1, java.util.Collection<K2> coll2)
Create an 2-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional map of binary variables com.dashoptimization.maps.HashMap2<K1 ,K2,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMap2Builder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. -
K2
- Data type for dimension 2. - Parameters:
-
coll1
- Data for dimension 1. -
coll2
- Data for dimension 2. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1,K2> VariableBuilder.VariableMap2Builder<K1,K2> addVariables(K1[] arr1, K2[] arr2)
Create an 2-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional array of binary columns com.dashoptimization.maps.HashMap2<K1 ,K2,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMap2Builder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. -
K2
- Data type for dimension 2. - Parameters:
-
arr1
- Data for the builder. -
arr2
- Data for the builder. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public VariableBuilder.VariableArray3Builder addVariables(int dim1, int dim2, int dim3)
Create an 3-dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoArray()
function.// Create a multi-dimensional array of binary variables com.dashoptimization.objects.Variable[] [] [] = prob.addVariables(dim1 ,dim2 ,dim3) .withType(com.dashoptimization.objects.ColumnType.Binary) .toArray();
SeeVariableBuilder.VariableArray3Builder
for details of how to modify the specification in the builder.- Parameters:
-
dim1
- Dimension 1. -
dim2
- Dimension 2. -
dim3
- Dimension 3. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1,K2,K3> VariableBuilder.VariableMap3Builder<K1,K2,K3> addVariables(java.util.Collection<K1> coll1, java.util.Collection<K2> coll2, java.util.Collection<K3> coll3)
Create an 3-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional map of binary variables com.dashoptimization.maps.HashMap3<K1 ,K2 ,K3,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMap3Builder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. -
K2
- Data type for dimension 2. -
K3
- Data type for dimension 3. - Parameters:
-
coll1
- Data for dimension 1. -
coll2
- Data for dimension 2. -
coll3
- Data for dimension 3. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1,K2,K3> VariableBuilder.VariableMap3Builder<K1,K2,K3> addVariables(K1[] arr1, K2[] arr2, K3[] arr3)
Create an 3-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional array of binary columns com.dashoptimization.maps.HashMap3<K1 ,K2 ,K3,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMap3Builder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. -
K2
- Data type for dimension 2. -
K3
- Data type for dimension 3. - Parameters:
-
arr1
- Data for the builder. -
arr2
- Data for the builder. -
arr3
- Data for the builder. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public VariableBuilder.VariableArray4Builder addVariables(int dim1, int dim2, int dim3, int dim4)
Create an 4-dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoArray()
function.// Create a multi-dimensional array of binary variables com.dashoptimization.objects.Variable[] [] [] [] = prob.addVariables(dim1 ,dim2 ,dim3 ,dim4) .withType(com.dashoptimization.objects.ColumnType.Binary) .toArray();
SeeVariableBuilder.VariableArray4Builder
for details of how to modify the specification in the builder.- Parameters:
-
dim1
- Dimension 1. -
dim2
- Dimension 2. -
dim3
- Dimension 3. -
dim4
- Dimension 4. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1,K2,K3,K4> VariableBuilder.VariableMap4Builder<K1,K2,K3,K4> addVariables(java.util.Collection<K1> coll1, java.util.Collection<K2> coll2, java.util.Collection<K3> coll3, java.util.Collection<K4> coll4)
Create an 4-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional map of binary variables com.dashoptimization.maps.HashMap4<K1 ,K2 ,K3 ,K4,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3 ,coll4) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMap4Builder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. -
K2
- Data type for dimension 2. -
K3
- Data type for dimension 3. -
K4
- Data type for dimension 4. - Parameters:
-
coll1
- Data for dimension 1. -
coll2
- Data for dimension 2. -
coll3
- Data for dimension 3. -
coll4
- Data for dimension 4. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1,K2,K3,K4> VariableBuilder.VariableMap4Builder<K1,K2,K3,K4> addVariables(K1[] arr1, K2[] arr2, K3[] arr3, K4[] arr4)
Create an 4-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional array of binary columns com.dashoptimization.maps.HashMap4<K1 ,K2 ,K3 ,K4,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3 ,coll4) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMap4Builder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. -
K2
- Data type for dimension 2. -
K3
- Data type for dimension 3. -
K4
- Data type for dimension 4. - Parameters:
-
arr1
- Data for the builder. -
arr2
- Data for the builder. -
arr3
- Data for the builder. -
arr4
- Data for the builder. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public VariableBuilder.VariableArray5Builder addVariables(int dim1, int dim2, int dim3, int dim4, int dim5)
Create an 5-dimensional array of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoArray()
function.// Create a multi-dimensional array of binary variables com.dashoptimization.objects.Variable[] [] [] [] [] = prob.addVariables(dim1 ,dim2 ,dim3 ,dim4 ,dim5) .withType(com.dashoptimization.objects.ColumnType.Binary) .toArray();
SeeVariableBuilder.VariableArray5Builder
for details of how to modify the specification in the builder.- Parameters:
-
dim1
- Dimension 1. -
dim2
- Dimension 2. -
dim3
- Dimension 3. -
dim4
- Dimension 4. -
dim5
- Dimension 5. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1,K2,K3,K4,K5> VariableBuilder.VariableMap5Builder<K1,K2,K3,K4,K5> addVariables(java.util.Collection<K1> coll1, java.util.Collection<K2> coll2, java.util.Collection<K3> coll3, java.util.Collection<K4> coll4, java.util.Collection<K5> coll5)
Create an 5-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional map of binary variables com.dashoptimization.maps.HashMap5<K1 ,K2 ,K3 ,K4 ,K5,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3 ,coll4 ,coll5) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMap5Builder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. -
K2
- Data type for dimension 2. -
K3
- Data type for dimension 3. -
K4
- Data type for dimension 4. -
K5
- Data type for dimension 5. - Parameters:
-
coll1
- Data for dimension 1. -
coll2
- Data for dimension 2. -
coll3
- Data for dimension 3. -
coll4
- Data for dimension 4. -
coll5
- Data for dimension 5. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
addVariables
public <K1,K2,K3,K4,K5> VariableBuilder.VariableMap5Builder<K1,K2,K3,K4,K5> addVariables(K1[] arr1, K2[] arr2, K3[] arr3, K4[] arr4, K5[] arr5)
Create an 5-dimensional map of variables. This function returns a builder that generates variables according to a specification. The specification can be modified. In order to actually create the variables, you have to call the returned builder'stoMap()
function.// Create a multi-dimensional array of binary columns com.dashoptimization.maps.HashMap5<K1 ,K2 ,K3 ,K4 ,K5,com.dashoptimization.objects.Variable> x = prob.addVariables(coll1 ,coll2 ,coll3 ,coll4 ,coll5) .withType(com.dashoptimization.objects.ColumnType.Binary) .toMap();
SeeVariableBuilder.VariableMap5Builder
for details of how to modify the specification in the builder.- Type Parameters:
-
K1
- Data type for dimension 1. -
K2
- Data type for dimension 2. -
K3
- Data type for dimension 3. -
K4
- Data type for dimension 4. -
K5
- Data type for dimension 5. - Parameters:
-
arr1
- Data for the builder. -
arr2
- Data for the builder. -
arr3
- Data for the builder. -
arr4
- Data for the builder. -
arr5
- Data for the builder. - Returns:
- A builder that will create the variables.
- Since:
- 43.00
-
-
© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.