GeneralConstraint
- java.lang.Object
-
- com.dashoptimization.objects.GeneralConstraint
-
- All Implemented Interfaces:
-
Index
,java.lang.Comparable<GeneralConstraint>
public final class GeneralConstraint extends java.lang.Object implements Index, java.lang.Comparable<GeneralConstraint>
General constraint. General constraints are unmodifiable.- Since:
- 43.00
-
-
Nested Class Summary
Modifier and Type Class Description static class
GeneralConstraint.Definition
Definition of a general constraint.
-
Method Summary
Modifier and Type Method Description static GeneralConstraint.Definition
abs(Variable resultant, Variable variable)
Create a definition forresultant = abs(variable)
.static GeneralConstraint.Definition
and(Variable resultant, Variable... variables)
Create a definition forresultant = and(variables...)
.int
compareTo(GeneralConstraint other)
boolean
equals(java.lang.Object other)
int
getIndex()
Get the index that this object has in the underlying model.int
getIndexForProb(XpressProblem xprob)
Get the index stored in this object but raise an exception if the problem that created this object is notprob
.java.lang.String
getName()
Get the name of this object.XpressProblem
getProblem()
Get the problem to which this element belongs.Variable
getResultant()
Get the resultant for this constraint.XPRSenumerations.GenConsType
getType()
Get the type for this constraint.double[]
getValues()
Get the values in this constraint.Variable[]
getVariables()
Get the variables in this constraint.int
hashCode()
static GeneralConstraint.Definition
max(Variable resultant, Variable... variables)
Create a definition forresultant = max(variables...)
.static GeneralConstraint.Definition
max(Variable resultant, Variable[] variables, double... values)
Create a definition forresultant = max(variables, values...)
.static GeneralConstraint.Definition
min(Variable resultant, Variable... variables)
Create a definition forresultant = min(variables...)
.static GeneralConstraint.Definition
min(Variable resultant, Variable[] variables, double... values)
Create a definition forresultant = min(variables, values...)
.static GeneralConstraint.Definition
or(Variable resultant, Variable... variables)
Create a definition forresultant = or(variables...)
.GeneralConstraint
setName(java.lang.String newName)
Set the name of this general constraint.void
updateIndex(int delta)
-
-
-
Method Detail
-
getIndex
public 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
-
updateIndex
public void updateIndex(int delta)
- Specified by:
-
updateIndex
in interfaceIndex
- Parameters:
-
delta
- The value to add to the index. - Since:
- 43.00
-
getIndexForProb
public int getIndexForProb(XpressProblem xprob)
Get the index stored in this object but raise an exception if the problem that created this object is notprob
.- Specified by:
-
getIndexForProb
in interfaceIndex
- Parameters:
-
xprob
- The problem for which the index is queried. If this object does not belong toprob
then an execption is raised. - Returns:
-
The low-level index for this object in
prob
. - Since:
- 43.00
-
getProblem
public XpressProblem getProblem()
Get the problem to which this element belongs.- Specified by:
-
getProblem
in interfaceIndex
- Returns:
-
The problem to which this element belongs. This will be
null
if the element was deleted. - Since:
- 43.00
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
-
equals
in classjava.lang.Object
- Parameters:
-
other
- - Returns:
- Since:
- 43.00
-
compareTo
public final int compareTo(GeneralConstraint other)
- Specified by:
-
compareTo
in interfacejava.lang.Comparable<GeneralConstraint>
- Parameters:
-
other
- - Returns:
- Since:
- 43.00
-
hashCode
public final int hashCode()
- Overrides:
-
hashCode
in classjava.lang.Object
-
getType
public XPRSenumerations.GenConsType getType()
Get the type for this constraint. Queries theXpressProblem
instance to which this constraint belongs returns the type from that instance.- Returns:
- The type of this constraint.
- Since:
- 43.00
-
getResultant
public Variable getResultant()
Get the resultant for this constraint. Queries theXpressProblem
instance to which this constraint belongs returns the resultant from that instance.- Returns:
- The resultant for this constraint.
- Since:
- 43.00
-
getVariables
public Variable[] getVariables()
Get the variables in this constraint. Queries theXpressProblem
instance to which this constraint belongs returns the variables from that instance.- Returns:
-
The variables in this constraint. This may be empty but is never
null
. - Since:
- 43.00
-
getValues
public double[] getValues()
Get the values in this constraint. Queries theXpressProblem
instance to which this constraint belongs returns the values from that instance.- Returns:
-
The value in this constraint. This may be empty but is never
null
. - Since:
- 43.00
-
getName
public java.lang.String getName()
Get the name of this object. Queries the problem instance that owns this object and returns the name from that instance.
-
setName
public GeneralConstraint setName(java.lang.String newName)
Set the name of this general constraint. Sets the name of this general constraint in the problem instance that owns the object.- Parameters:
-
newName
- New name. - Returns:
- Always returns this constraint.
- Since:
- 43.00
-
abs
public static GeneralConstraint.Definition abs(Variable resultant, Variable variable)
Create a definition forresultant = abs(variable)
.Used in these examples:
- AddMipSol
- FixBV
- GlobalObjectiveParametrics
- GlobalRHSParametrics
- GoalProg
- Knapsack
- LoadLP
- MipSolEnum
- MipSolPool
- MostViolated
- Repair
- SaveSol
- Tableau
- Trimloss
- Parameters:
-
resultant
- The resultant variable. -
variable
- The variable to take the absolute value of. - Returns:
-
resultant = abs(variable)
. - Since:
- 43.00
-
and
public static GeneralConstraint.Definition and(Variable resultant, Variable... variables)
Create a definition forresultant = and(variables...)
.- Parameters:
-
resultant
- Resultant variable. -
variables
- Argument variables. - Returns:
-
resultant = and(variables...)
. - Since:
- 43.00
-
or
public static GeneralConstraint.Definition or(Variable resultant, Variable... variables)
Create a definition forresultant = or(variables...)
.- Parameters:
-
resultant
- Resultant variable. -
variables
- Argument variables. - Returns:
-
resultant = or(variables...)
. - Since:
- 43.00
-
max
public static GeneralConstraint.Definition max(Variable resultant, Variable... variables)
Create a definition forresultant = max(variables...)
.- Parameters:
-
resultant
- Resultant variable. -
variables
- Argument variables. - Returns:
-
resultant = max(variables...)
. - Since:
- 43.00
-
max
public static GeneralConstraint.Definition max(Variable resultant, Variable[] variables, double... values)
Create a definition forresultant = max(variables, values...)
.- Parameters:
-
resultant
- Resultant variable. -
variables
- Argument variables. -
values
- Argument values. - Returns:
-
resultant = max(variables, values...)
. - Since:
- 43.00
-
min
public static GeneralConstraint.Definition min(Variable resultant, Variable... variables)
Create a definition forresultant = min(variables...)
.Used in these examples:
- MostViolated
- Parameters:
-
resultant
- Resultant variable. -
variables
- Argument variables. - Returns:
-
resultant = min(variables...)
. - Since:
- 43.00
-
min
public static GeneralConstraint.Definition min(Variable resultant, Variable[] variables, double... values)
Create a definition forresultant = min(variables, values...)
.Used in these examples:
- MostViolated
- Parameters:
-
resultant
- Resultant variable. -
variables
- Argument variables. -
values
- Argument values. - Returns:
-
resultant = min(variables, values...)
. - 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.