Variable
- java.lang.Object
-  
  - com.dashoptimization.objects.Expression
-  
    - com.dashoptimization.objects.Variable
 
 
-  
    
   
 public final class Variable extends Expression implements Index, java.lang.Comparable<Variable> A reference to a variable.- Since:
- 43.00
 
-  
    
   -  
         Method SummaryModifier and Type Method Description GeneralConstraint.DefinitionabsOf(Variable x)Create a constraint that requires this variable to be the absolute value ofx.GeneralConstraint.DefinitionandOf(Variable... variables)Create a constraint that requires this variable to be the and of the specified other variables.GeneralConstraint.DefinitionandOf(Variable[] variables, java.lang.String name)Create a constraint that requires this variable to be the and of the specified arguments.GeneralConstraint.DefinitionandOf(java.util.Collection<Variable> variables)Create a constraint that requires this variable to be the and of the specified arguments.GeneralConstraint.DefinitionandOf(java.util.stream.Stream<Variable> variables)Create a constraint that requires this variable to be the and of the specified arguments.voidchgCoef(Inequality r, double newCoef)Change the coefficient for this variable in a row.voidchgCoefs(Inequality[] r, double[] newCoef)Change the coefficients for this variable in multiple rows.VariablechgObj(double newCoef)Change objective coefficient for this variable.VariablechgObjN(int objidx, double newCoef)Change objective coefficient for this variable.intcompareTo(Variable other)LinTermdiv(double arg)Create a new expression that represents the quotient ofthisandarg.LinTermdiv(ConstantExpression arg)Expressiondiv(Expression arg)Create a new expression that represents the quotient ofthisandarg.Inequality.Definitioneq(double rhs)Create an "equals" constraint with this expression as left-hand side.Inequality.Definitioneq(Expression rhs)Create an "equals" constraint with this expression as left-hand side.booleanequals(java.lang.Object other)doubleevaluate(double[] solution)Compute the value of this expression with respect to the given solution vector (which is not required to be feasible).voidextract(double factor, PostfixExtractor extractor)Extract this expression into postfix notation.booleanextract(double factor, XPRSprob.RowCreator creator)Extract this expression into a row.Variablefix(double value)Fix this variable to a value.Inequality.Definitiongeq(double rhs)Create a "greater than or equal" constraint with this expression as left-hand side.Inequality.Definitiongeq(Expression rhs)Create a "greater than or equal" constraint with this expression as left-hand side.intgetIndex()Get the index that this object has in the underlying model.intgetIndexForProb(XpressProblem prob)Get the index stored in this object but raise an exception if the problem that created this object is notprob.doublegetLB()Get the lower bound for this variable.java.lang.StringgetName()Get the name of this object.doublegetObj()Get objective coefficient for this variable.doublegetObjN(int objIdx)Get objective coefficient for this variable.XpressProblemgetProblem()Get the problem to which this element belongs.doublegetRedCost()Get the current reduced cost value for this variable.doublegetSolution()Get the current solution value for this variable.ColumnTypegetType()Get the type for this variable.doublegetUB()Get the upper bound for this variable.doublegetValue(double[] data)Get the value of this variable from an array.inthashCode()IndicatorDescriptionifNotThen(Inequality.Definition implied)Create an indicator constraint with this variable as indicator variable.IndicatorDescriptionifThen(Inequality.Definition implied)Create an indicator constraint with this variable as indicator variable.Inequality.Definitionin(double lb, double ub)Create a range constraint that bounds this expression from below and above.Inequality.Definitionleq(double rhs)Create a "less than or equal" constraint with this expression as left-hand side.Inequality.Definitionleq(Expression rhs)Create a "less than or equal" constraint with this expression as left-hand side.GeneralConstraint.DefinitionmaxOf(Variable... variables)Create a constraint that requires this variable to be the maximum of the specified other variables.GeneralConstraint.DefinitionmaxOf(Variable[] variables, double... values)Create a constraint that requires this variable to be the maximum of the specified other variables and values.GeneralConstraint.DefinitionmaxOf(Variable[] variables, double[] values, java.lang.String name)Create a constraint that requires this variable to be the maximum of the specified arguments.GeneralConstraint.DefinitionmaxOf(java.util.Collection<Variable> variables, java.util.Collection<java.lang.Double> values)Create a constraint that requires this variable to be the maximum of the specified arguments.GeneralConstraint.DefinitionmaxOf(java.util.stream.Stream<Variable> variables, java.util.stream.Stream<java.lang.Double> values)Create a constraint that requires this variable to be the maximum of the specified arguments.GeneralConstraint.DefinitionminOf(Variable... variables)Create a constraint that requires this variable to be the minimum of the specified other variables.GeneralConstraint.DefinitionminOf(Variable[] variables, double... values)Create a constraint that requires this variable to be the minimum of the specified other variables and values.GeneralConstraint.DefinitionminOf(Variable[] variables, double[] values, java.lang.String name)Create a constraint that requires this variable to be the minimum of the specified arguments.GeneralConstraint.DefinitionminOf(java.util.Collection<Variable> variables, java.util.Collection<java.lang.Double> values)Create a constraint that requires this variable to be the minimum of the specified arguments.GeneralConstraint.DefinitionminOf(java.util.stream.Stream<Variable> variables, java.util.stream.Stream<java.lang.Double> values)Create a constraint that requires this variable to be the minimum of the specified arguments.LinTermmul(double arg)Create a new expression that represents the product ofthisandarg.LinTermmul(ConstantExpression arg)Expressionmul(Expression arg)Create a new expression that represents the product ofthisandarg.QuadTermmul(LinTerm arg)QuadTermmul(Variable arg)GeneralConstraint.DefinitionorOf(Variable... variables)Create a constraint that requires this variable to be the or of the specified other variables.GeneralConstraint.DefinitionorOf(Variable[] variables, java.lang.String name)Create a constraint that requires this variable to be the or of the specified arguments.GeneralConstraint.DefinitionorOf(java.util.Collection<Variable> variables)Create a constraint that requires this variable to be the or of the specified arguments.GeneralConstraint.DefinitionorOf(java.util.stream.Stream<Variable> variables)Create a constraint that requires this variable to be the or of the specified arguments.PWL.DefinitionpwlOf(Variable input, double[] xval, double[] yval)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified byxval/yvalevaluated forinput.PWL.DefinitionpwlOf(Variable input, double[] xval, double[] yval, java.lang.String name)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified byxval/yvalevaluated forinput.PWL.DefinitionpwlOf(Variable input, PwlBreakpoint... breakpoints)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.PWL.DefinitionpwlOf(Variable input, PwlBreakpoint[] breakpoints, java.lang.String name)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.PWL.DefinitionpwlOf(Variable input, java.lang.Iterable<PwlBreakpoint> breakpoints)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.PWL.DefinitionpwlOf(Variable input, java.util.Collection<PwlBreakpoint> breakpoints)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.PWL.DefinitionpwlOf(Variable input, java.util.Collection<PwlBreakpoint> breakpoints, java.lang.String name)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.PWL.DefinitionpwlOf(Variable input, java.util.stream.Stream<PwlBreakpoint> breakpoints)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.PWL.DefinitionpwlOf(Variable input, java.util.stream.Stream<PwlBreakpoint> breakpoints, java.lang.String name)Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.VariablesetLB(double newLB)Set the lower bound for this variable.VariablesetLimit(double newLimit)Set the limit for this variable.VariablesetName(java.lang.String newName)Set the name of this variable.VariablesetType(ColumnType newType)Set the type for this variable.VariablesetUB(double newUB)Set the upper bound for this variable.QuadTermsquare()Create a quadratic term by multiplying this variable with itself.java.lang.StringtoString()Returns the name fromgetName().LinTermuminus()Create a new expression that represents the unary minus of this one.voidupdateIndex(int delta)-  
           Methods inherited from class com.dashoptimization.objects.Expressionminus, minus, plus, plus
 
-  
           
 
-  
         
-  
    
   -  
         Method Detail-  getIndexpublic int getIndex() Get the index that this object has in the underlying model. Attention: this is a very advanced function. Use it only if you know exactly what you are doing.Used in these examples: - GlobalObjectiveParametrics
- GlobalRHSParametrics
 Used in these examples: - GlobalObjectiveParametrics
- GlobalRHSParametrics
 
 -  updateIndexpublic void updateIndex(int delta) - Specified by:
- 
          updateIndexin interfaceIndex
- Since:
- 43.00
 
 -  getIndexForProbpublic int getIndexForProb(XpressProblem prob) Get the index stored in this object but raise an exception if the problem that created this object is notprob.- Specified by:
- 
          getIndexForProbin interfaceIndex
- Parameters:
- 
          prob- The problem for which the index is queried. If this object does not belong toprobthen an execption is raised.
- Returns:
- 
          The low-level index for this object in 
          prob.
- Since:
- 43.00
 
 -  getProblempublic XpressProblem getProblem() Get the problem to which this element belongs.- Specified by:
- 
          getProblemin interfaceIndex
- Returns:
- 
          The problem to which this element belongs. This will be 
          nullif the element was deleted.
- Since:
- 43.00
 
 -  equalspublic final boolean equals(java.lang.Object other) Used in these examples: - FixBV
- Knapsack
- MostViolated
- SaveSol
- Tableau
 - Overrides:
- 
          equalsin classjava.lang.Object
- Since:
- 43.00
 
 -  compareTopublic final int compareTo(Variable other) - Specified by:
- 
          compareToin interfacejava.lang.Comparable<Variable>
- Since:
- 43.00
 
 -  hashCodepublic final int hashCode() - Overrides:
- 
          hashCodein classjava.lang.Object
 
 -  leqpublic Inequality.Definition leq(double rhs) Create a "less than or equal" constraint with this expression as left-hand side.- Specified by:
- 
          leqin classExpression
- Parameters:
- 
          rhs- Right-hand side of new constraint.
- Returns:
- The new constraint.
- Since:
- 43.00
 
 -  leqpublic Inequality.Definition leq(Expression rhs) Create a "less than or equal" constraint with this expression as left-hand side.- Specified by:
- 
          leqin classExpression
- Parameters:
- 
          rhs- Right-hand side of new constraint.
- Returns:
- The new constraint.
- Since:
- 43.00
 
 -  geqpublic Inequality.Definition geq(double rhs) Create a "greater than or equal" constraint with this expression as left-hand side.- Specified by:
- 
          geqin classExpression
- Parameters:
- 
          rhs- Right-hand side of new constraint.
- Returns:
- The new constraint.
- Since:
- 43.00
 
 -  geqpublic Inequality.Definition geq(Expression rhs) Create a "greater than or equal" constraint with this expression as left-hand side.- Specified by:
- 
          geqin classExpression
- Parameters:
- 
          rhs- Right-hand side of new constraint.
- Returns:
- The new constraint.
- Since:
- 43.00
 
 -  eqpublic Inequality.Definition eq(double rhs) Create an "equals" constraint with this expression as left-hand side.- Specified by:
- 
          eqin classExpression
- Parameters:
- 
          rhs- Right-hand side of new constraint.
- Returns:
- The new constraint.
- Since:
- 43.00
 
 -  eqpublic Inequality.Definition eq(Expression rhs) Create an "equals" constraint with this expression as left-hand side.- Specified by:
- 
          eqin classExpression
- Parameters:
- 
          rhs- Right-hand side of new constraint.
- Returns:
- The new constraint.
- Since:
- 43.00
 
 -  inpublic Inequality.Definition in(double lb, double ub) Create a range constraint that bounds this expression from below and above.- Specified by:
- 
          inin classExpression
- Parameters:
- 
          lb- Lower bound for this expression.
- 
          ub- Upper bound for this expression.
- Returns:
- The new constraint.
- Since:
- 43.00
 
 -  squarepublic QuadTerm square() Create a quadratic term by multiplying this variable with itself.- Returns:
- The new term representing the product of this variable with itself.
- Since:
- 43.00
 
 -  getLBpublic double getLB() Get the lower bound for this variable. Queries thecom.dashoptimization.objects.XpressProbleminstance to which this variable belongs and returns the lower bound obtained from that instance.Used in these examples: - Repair
 - Since:
- 43.00
 
 -  getUBpublic double getUB() Get the upper bound for this variable. Queries thecom.dashoptimization.objects.XpressProbleminstance to which this variable belongs and returns the upper bound obtained from that instance.Used in these examples: - Repair
 - Since:
- 43.00
 
 -  getNamepublic java.lang.String getName() Get the name of this object. Queries the problem instance that own this objects and returns the name from that instance.
 -  getTypepublic ColumnType getType() Get the type for this variable. Queries thecom.dashoptimization.objects.XpressProbleminstance to which this variable belongs and returns the name obtained from that instance.- Since:
- 43.00
 
 -  fixpublic Variable fix(double value) Fix this variable to a value. Set the lower bound and upper bound in thecom.dashoptimization.objects.XpressProbleminstance to which this variable belongs.- Parameters:
- 
          value- New lower and upper bound.
- Returns:
- This variable
- Since:
- 43.00
 
 -  setLBpublic Variable setLB(double newLB) Set the lower bound for this variable. Set the lower bound in thecom.dashoptimization.objects.XpressProbleminstance to which this variable belongs.- Parameters:
- 
          newLB- New lower bound.
- Returns:
- This variable
- Since:
- 43.00
 
 -  setUBpublic Variable setUB(double newUB) Set the upper bound for this variable. Set the upper bound in thecom.dashoptimization.objects.XpressProbleminstance to which this variable belongs.- Parameters:
- 
          newUB- New upper bound.
- Returns:
- This variable
- Since:
- 43.00
 
 -  setTypepublic Variable setType(ColumnType newType) Set the type for this variable. Set the type in thecom.dashoptimization.objects.XpressProbleminstance to which this variable belongs.- Parameters:
- 
          newType- New type.
- Returns:
- This variable
- Since:
- 43.00
 
 -  setLimitpublic Variable setLimit(double newLimit) Set the limit for this variable. Set the limit in thecom.dashoptimization.objects.XpressProbleminstance to which this variable belongs. Note that limits are ignored unless the variable is semi-continuous, semi-integer, or partial integer.- Parameters:
- 
          newLimit- New limit.
- Returns:
- This variable
- Since:
- 43.00
 
 -  setNamepublic Variable setName(java.lang.String newName) Set the name of this variable. Sets the name of this variable in the problem instance that owns the object.- Parameters:
- 
          newName- The name to be set.
- Returns:
- Always returns this instance.
- Since:
- 43.00
 
 -  getValuepublic double getValue(double[] data) Get the value of this variable from an array. The function assumes thatdatais an array that stores a value for each variable in the underlying problem and returns the value from this array that corresponds to this variable.dataarrays can be obtained for example fromprob.getMipSolX(),prob.getLpSolX(),prob.getLpSolDj().Used in these examples: - AddMipSol
- FixBV
- GlobalObjectiveParametrics
- GlobalRHSParametrics
- GoalProg
- Knapsack
- LoadLP
- MipSolEnum
- MipSolPool
- MostViolated
- SaveSol
- TSP
- Tableau
- Trimloss
 - Since:
- 43.00
 
 -  getSolutionpublic double getSolution() Get the current solution value for this variable.Note: This functions uses XPRSprob.getSolution(IntHolder, double[], int, int)under the hood. This is only valid to call if the `com.dashoptimization.objects.XpressProblem` instance owning this variable is currently not under optimization.Note: Calling this function for multiple variables is not efficient. If you need to get values for multiple variables then consider using XPRSprob.getSolution()to get the values for all variables and then usegetValue(double[])to extract the value for a particular variable. This strategy is also valid from callbacks.Used in these examples: - Polygon
- PolygonMap
- PolygonMapDelta
- PolygonMultiMap
- PolygonMultiMapDelta
- PolygonVecMap
- PolygonVecMapDelta
 - Returns:
- Solution value for this variable.
- Since:
- 43.00
 
 -  getRedCostpublic double getRedCost() Get the current reduced cost value for this variable.Note: This functions uses XPRSprob.getRedCosts(IntHolder, double[], int, int)under the hood. This is only valid to call if the `com.dashoptimization.objects.XpressProblem` instance owning this variable is currently not under optimization.Note: Calling this function for multiple variables is not efficient. If you need to get values for multiple variables then consider using XPRSprob.getRedCosts()to get the values for all variables and then usegetValue(double[])to extract the value for a particular variable. This strategy is also valid from callbacks.- Returns:
- Solution value for this variable.
- Since:
- 43.00
 
 -  extractpublic boolean extract(double factor, XPRSprob.RowCreator creator)Extract this expression into a row. This is for internal use only, you should never have to call this function explicitly.- Specified by:
- 
          extractin classExpression
- Parameters:
- 
          factor- Factor by which to multiply the expression during extraction.
- 
          creator- The creator to which this expression should be extracted.
- Returns:
- 
          trueif the low-level representation does requires normalization (sorting, removal of dups, ...). In some special cases we know that this is not required and can returnfalseto save the overhead.
- Since:
- 43.00
 
 -  extractpublic void extract(double factor, PostfixExtractor extractor)Extract this expression into postfix notation.- Specified by:
- 
          extractin classExpression
- Parameters:
- 
          factor- Factor by which to multiply the expression during extraction.
- 
          extractor- The extractor to which the expression is extract.
- Since:
- 43.00
 
 -  evaluatepublic double evaluate(double[] solution) Compute the value of this expression with respect to the given solution vector (which is not required to be feasible).- Specified by:
- 
          evaluatein classExpression
- Parameters:
- 
          solution- Solution values for which the expression is evaluated.
- Since:
- 43.00
 
 -  chgCoefpublic void chgCoef(Inequality r, double newCoef) Change the coefficient for this variable in a row.- Parameters:
- 
          r- Inequality for which to change the coefficient.
- 
          newCoef- New coefficient.
- Since:
- 43.00
 
 -  chgCoefspublic void chgCoefs(Inequality[] r, double[] newCoef) Change the coefficients for this variable in multiple rows.- Parameters:
- 
          r- Inequalities for which to change the coefficient.
- 
          newCoef- New coefficients.
- Since:
- 43.00
 
 -  chgObjpublic Variable chgObj(double newCoef) Change objective coefficient for this variable.Used in these examples: - GlobalObjectiveParametrics
- GoalProg
 - Parameters:
- 
          newCoef- New objective coefficient.
- Returns:
- Always returns this instance.
- Since:
- 43.00
 
 -  getObjpublic double getObj() Get objective coefficient for this variable.Used in these examples: - Knapsack
 - Returns:
- Objective coefficient for this variable.
- Since:
- 43.00
 
 -  chgObjNpublic Variable chgObjN(int objidx, double newCoef) Change objective coefficient for this variable.Used in these examples: - GoalProg
 - Parameters:
- 
          objidx- Index of objective function to change.
- 
          newCoef- New objective coefficient.
- Returns:
- Always returns this instance.
- Since:
- 43.00
 
 -  getObjNpublic double getObjN(int objIdx) Get objective coefficient for this variable.- Parameters:
- 
          objIdx- Index of objective function to query.
- Returns:
- Objective coefficient for this variable.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, double[] xval, double[] yval) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified byxval/yvalevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- 
          xval- X coordinates of breakpoints.
- 
          yval- X coordinates of breakpoints.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, double[] xval, double[] yval, java.lang.String name) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified byxval/yvalevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- 
          xval- X coordinates of breakpoints.
- 
          yval- X coordinates of breakpoints.
- 
          name- Name of the new constraint, can benull.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, PwlBreakpoint... breakpoints) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- 
          breakpoints- Breakpoints for new constraint.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, PwlBreakpoint[] breakpoints, java.lang.String name) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- 
          breakpoints- Breakpoints for new constraint.
- 
          name- Name for the PWL, can benull.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, java.util.Collection<PwlBreakpoint> breakpoints) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- 
          breakpoints- Breakpoints for new constraint.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, java.util.Collection<PwlBreakpoint> breakpoints, java.lang.String name) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- 
          name- Name of the new PWL, can benull.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, java.util.stream.Stream<PwlBreakpoint> breakpoints) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- 
          breakpoints- Breakpoints for new constraint.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, java.util.stream.Stream<PwlBreakpoint> breakpoints, java.lang.String name) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- 
          breakpoints- Breakpoints for new constraint.
- 
          name- Name for new constraint, can benull.
- Since:
- 43.00
 
 -  pwlOfpublic PWL.Definition pwlOf(Variable input, java.lang.Iterable<PwlBreakpoint> breakpoints) Create a new piecewise linear constraint that requires this variable to be the value of the piecewise linear function specified bybreakpointsevaluated forinput.- Parameters:
- 
          input- Input for piecewise linear constraint.
- Since:
- 43.00
 
 -  maxOfpublic GeneralConstraint.Definition maxOf(Variable[] variables, double... values) Create a constraint that requires this variable to be the maximum of the specified other variables and values.- Parameters:
- 
          variables- Variables in the maximum constraint.
- 
          values- Values in the maximum constraint.
- Returns:
- 
          this = max(variables, value).
- Since:
- 43.00
 
 -  maxOfpublic GeneralConstraint.Definition maxOf(Variable[] variables, double[] values, java.lang.String name) Create a constraint that requires this variable to be the maximum of the specified arguments.- Parameters:
- 
          variables- Variables in the maximum constraint.
- 
          values- Values in the maximum constraint.
- 
          name- Constraint name, can benull.
- Returns:
- 
          this = max(variables, value).
- Since:
- 43.00
 
 -  maxOfpublic GeneralConstraint.Definition maxOf(java.util.Collection<Variable> variables, java.util.Collection<java.lang.Double> values) Create a constraint that requires this variable to be the maximum of the specified arguments.- Parameters:
- 
          variables- Variables in the maximum constraint.
- 
          values- Values in the maximum constraint.
- Returns:
- 
          this = max(variables, value).
- Since:
- 43.00
 
 -  maxOfpublic GeneralConstraint.Definition maxOf(java.util.stream.Stream<Variable> variables, java.util.stream.Stream<java.lang.Double> values) Create a constraint that requires this variable to be the maximum of the specified arguments.- Parameters:
- 
          variables- Variables in the maximum constraint.
- 
          values- Values in the maximum constraint.
- Returns:
- 
          this = max(variables, value).
- Since:
- 43.00
 
 -  maxOfpublic GeneralConstraint.Definition maxOf(Variable... variables) Create a constraint that requires this variable to be the maximum of the specified other variables.- Parameters:
- 
          variables- Variables in the maximum constraint.
- Returns:
- 
          this = max(variables).
- Since:
- 43.00
 
 -  minOfpublic GeneralConstraint.Definition minOf(Variable[] variables, double... values) Create a constraint that requires this variable to be the minimum of the specified other variables and values.- Parameters:
- 
          variables- Variables in the minimum constraint.
- 
          values- Values in the minimum constraint.
- Returns:
- 
          this = min(variables, value).
- Since:
- 43.00
 
 -  minOfpublic GeneralConstraint.Definition minOf(Variable[] variables, double[] values, java.lang.String name) Create a constraint that requires this variable to be the minimum of the specified arguments.- Parameters:
- 
          variables- Variables in the minimum constraint.
- 
          values- Values in the minimum constraint.
- 
          name- Constraint name, can benull.
- Returns:
- 
          this = min(variables, value).
- Since:
- 43.00
 
 -  minOfpublic GeneralConstraint.Definition minOf(java.util.Collection<Variable> variables, java.util.Collection<java.lang.Double> values) Create a constraint that requires this variable to be the minimum of the specified arguments.- Parameters:
- 
          variables- Variables in the minimum constraint.
- 
          values- Values in the minimum constraint.
- Returns:
- 
          this = min(variables, value).
- Since:
- 43.00
 
 -  minOfpublic GeneralConstraint.Definition minOf(java.util.stream.Stream<Variable> variables, java.util.stream.Stream<java.lang.Double> values) Create a constraint that requires this variable to be the minimum of the specified arguments.- Parameters:
- 
          variables- Variables in the minimum constraint.
- 
          values- Values in the minimum constraint.
- Returns:
- 
          this = min(variables, value).
- Since:
- 43.00
 
 -  minOfpublic GeneralConstraint.Definition minOf(Variable... variables) Create a constraint that requires this variable to be the minimum of the specified other variables.- Parameters:
- 
          variables- Variables in the minimum constraint.
- Returns:
- 
          this = min(variables).
- Since:
- 43.00
 
 -  orOfpublic GeneralConstraint.Definition orOf(Variable[] variables, java.lang.String name) Create a constraint that requires this variable to be the or of the specified arguments.- Parameters:
- 
          variables- Variables in the or constraint.
- 
          name- Constraint name, can benull.
- Returns:
- 
          this = or(variables, value).
- Since:
- 43.00
 
 -  orOfpublic GeneralConstraint.Definition orOf(java.util.Collection<Variable> variables) Create a constraint that requires this variable to be the or of the specified arguments.- Parameters:
- 
          variables- Variables in the or constraint.
- Returns:
- 
          this = or(variables, value).
- Since:
- 43.00
 
 -  orOfpublic GeneralConstraint.Definition orOf(java.util.stream.Stream<Variable> variables) Create a constraint that requires this variable to be the or of the specified arguments.- Parameters:
- 
          variables- Variables in the or constraint.
- Returns:
- 
          this = or(variables, value).
- Since:
- 43.00
 
 -  orOfpublic GeneralConstraint.Definition orOf(Variable... variables) Create a constraint that requires this variable to be the or of the specified other variables.- Parameters:
- 
          variables- Variables in the or constraint.
- Returns:
- 
          this = or(variables).
- Since:
- 43.00
 
 -  andOfpublic GeneralConstraint.Definition andOf(Variable[] variables, java.lang.String name) Create a constraint that requires this variable to be the and of the specified arguments.- Parameters:
- 
          variables- Variables in the and constraint.
- 
          name- Constraint name, can benull.
- Returns:
- 
          this = and(variables, value).
- Since:
- 43.00
 
 -  andOfpublic GeneralConstraint.Definition andOf(java.util.Collection<Variable> variables) Create a constraint that requires this variable to be the and of the specified arguments.- Parameters:
- 
          variables- Variables in the and constraint.
- Returns:
- 
          this = and(variables, value).
- Since:
- 43.00
 
 -  andOfpublic GeneralConstraint.Definition andOf(java.util.stream.Stream<Variable> variables) Create a constraint that requires this variable to be the and of the specified arguments.- Parameters:
- 
          variables- Variables in the and constraint.
- Returns:
- 
          this = and(variables, value).
- Since:
- 43.00
 
 -  andOfpublic GeneralConstraint.Definition andOf(Variable... variables) Create a constraint that requires this variable to be the and of the specified other variables.- Parameters:
- 
          variables- Variables in the and constraint.
- Returns:
- 
          this = and(variables).
- Since:
- 43.00
 
 -  absOfpublic GeneralConstraint.Definition absOf(Variable x) Create a constraint that requires this variable to be the absolute value ofx.- Parameters:
- 
          x- Argument for the absolute value constraint.
- Returns:
- 
          this = abs(x).
- Since:
- 43.00
 
 -  ifThenpublic IndicatorDescription ifThen(Inequality.Definition implied) Create an indicator constraint with this variable as indicator variable. The constraint will enforceimpliedif this variable is set to 1.- Parameters:
- 
          implied- The constraint that should be enforced if this variable is 1.
- Returns:
- The new constraint.
- Since:
- 43.00
 
 -  ifNotThenpublic IndicatorDescription ifNotThen(Inequality.Definition implied) Create an indicator constraint with this variable as indicator variable. The constraint will enforceimpliedif this variable is set to 0.- Parameters:
- 
          implied- The constraint that should be enforced if this variable is 0.
- Since:
- 43.00
 
 -  toStringpublic java.lang.String toString() Returns the name fromgetName().Used in these examples: - GlobalRHSParametrics
- IISExample
- Knapsack
- Trimloss
 - Overrides:
- 
          toStringin classjava.lang.Object
- Returns:
- This variable's name.
- Since:
- 43.00
 
 -  uminuspublic LinTerm uminus() Create a new expression that represents the unary minus of this one.- Overrides:
- 
          uminusin classExpression
- Returns:
- 
          Expression representing 
          -this.
- Since:
- 43.00
 
 -  mulpublic Expression mul(Expression arg) Create a new expression that represents the product ofthisandarg.- Overrides:
- 
          mulin classExpression
- Parameters:
- 
          arg- Factor.
- Returns:
- 
          Product of 
          thisandarg.
- Since:
- 43.00
 
 -  mulpublic LinTerm mul(ConstantExpression arg) - Since:
- 43.00
 
 -  mulpublic LinTerm mul(double arg) Create a new expression that represents the product ofthisandarg.- Overrides:
- 
          mulin classExpression
- Parameters:
- 
          arg- Factor.
- Returns:
- 
          Product of 
          thisandarg.
- Since:
- 43.00
 
 -  divpublic Expression div(Expression arg) Create a new expression that represents the quotient ofthisandarg.- Overrides:
- 
          divin classExpression
- Parameters:
- 
          arg- Divisor.
- Returns:
- 
          Quotient of 
          thisandarg.
- Since:
- 43.00
 
 -  divpublic LinTerm div(ConstantExpression arg) - Since:
- 43.00
 
 -  divpublic LinTerm div(double arg) Create a new expression that represents the quotient ofthisandarg.- Overrides:
- 
          divin classExpression
- Parameters:
- 
          arg- Divisor.
- Returns:
- 
          Quotient of 
          thisandarg.
- Since:
- 43.00
 
 
-  
 
-  
         
© 2001-2024 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.
 
