Inequality
- java.lang.Object
-
- com.dashoptimization.objects.Inequality
-
- All Implemented Interfaces:
-
Index,java.lang.Comparable<Inequality>
public final class Inequality extends java.lang.Object implements Index, java.lang.Comparable<Inequality>
A reference to an equation, inequality, or ranged row.- Since:
- 43.00
-
-
Nested Class Summary
Modifier and Type Class Description static classInequality.DefinitionClass representing a<=,>=,==, or ranged constraint.
-
Method Summary
Modifier and Type Method Description InequalitychgCoef(Variable v, double newCoef)Change the coefficient for a variable in this row.InequalitychgCoefs(Variable[] v, double[] newCoef)Change the coefficients for multiple variables in this row.intcompareTo(Inequality other)booleanequals(java.lang.Object other)doublegetCallbackDual()Get the dual value value for this row from the solution associated with the current callback.doublegetCallbackSlack()Get the slack value for this row from the solution associated with the current callback.doublegetDual()Get the current dual value value for this row.intgetIndex()Get the index that this object has in the underlying model.intgetIndexForProb(XpressProblem xprob)Get the index stored in this object but raise an exception if the problem that created this object is notprob.ExpressiongetLhs()Get the left-hand side of this inequality.java.lang.StringgetName()Get the name of this object.XpressProblemgetProblem()Get the problem to which this element belongs.doublegetRhs()Get the right-hand side for this row.doublegetRhsRange()Get the right-hand side range for this row.doublegetSlack()Get the current slack value for this row.RowTypegetType()Get the type for this row.doublegetValue(double[] data)Get the value of this row from an array.inthashCode()InequalitysetName(java.lang.String newName)Set the name of this inequality.InequalitysetRhs(double newRhs)Set the right-hand side for this row.InequalitysetRhsRange(double newRange)Set the right-hand side range for this row.InequalitysetType(RowType newType)Set the type for this row.
-
-
-
Method Detail
-
getIndex
public final 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.Examples using
getIndex:
-
getIndexForProb
public final 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:
-
getIndexForProbin interfaceIndex - Parameters:
-
xprob- 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
-
getProblem
public final 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
-
equals
public final boolean equals(java.lang.Object other)
- Overrides:
-
equalsin classjava.lang.Object - Parameters:
-
other- - Returns:
- Since:
- 43.00
-
compareTo
public final int compareTo(Inequality other)
- Specified by:
-
compareToin interfacejava.lang.Comparable<Inequality> - Parameters:
-
other- - Returns:
- Since:
- 43.00
-
hashCode
public final int hashCode()
- Overrides:
-
hashCodein classjava.lang.Object
-
getRhs
public double getRhs()
Get the right-hand side for this row. Queries thecom.dashoptimization.objects.XpressProbleminstance to which this row belongs and returns the right-hand side from that instance.- Returns:
- Right-hand side of this inequality.
- Since:
- 43.00
-
getRhsRange
public double getRhsRange()
Get the right-hand side range for this row. Queries thecom.dashoptimization.objects.XpressProbleminstance to which this row belongs and returns the right-hand side range from that instance.- Returns:
- Right-hand side range of this inequality.
- Since:
- 43.00
-
getName
public final 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.Examples using
getName:
-
getType
public RowType getType()
Get the type for this row. Queries thecom.dashoptimization.objects.XpressProbleminstance to which this row belongs and returns the name obtained from that instance.Examples using
getType:- Returns:
- Type of this inequality.
- Since:
- 43.00
-
setRhs
public Inequality setRhs(double newRhs)
Set the right-hand side for this row. Set the right-hand side in thecom.dashoptimization.objects.XpressProbleminstance to which this row belongs.Examples using
setRhs:- Parameters:
-
newRhs- New rhs. - Returns:
- This row
- Since:
- 43.00
-
setRhsRange
public Inequality setRhsRange(double newRange)
Set the right-hand side range for this row. Sets the right-hand side range value in thecom.dashoptimization.objects.XpressProbleminstance to which this row belongs.- Parameters:
-
newRange- The new range value for this row. - Returns:
- This row.
- Since:
- 43.00
-
setType
public Inequality setType(RowType newType)
Set the type for this row. Set the type in thecom.dashoptimization.objects.XpressProbleminstance to which this row belongs.Examples using
setType:- Parameters:
-
newType- New type. - Returns:
- This row
- Since:
- 43.00
-
setName
public Inequality setName(java.lang.String newName)
Set the name of this inequality. Sets the name of this inequality in the problem instance that owns the object.Examples using
setName:- Catenary.java
- ContractAllocation.java
- CuttingStock.java
- ELS.java
- ELSCut.java
- FolioCB.java
- FolioHeuristic.java
- FolioIIS.java
- FolioInit.java
- FolioMip1.java
- FolioMip2.java
- FolioMipIIS.java
- FolioQC.java
- FolioQP.java
- GeneralConstraints.java
- MultipleProblems.java
- ProductionPlanning_Index.java
- QuadraticProgramming.java
- RecursiveFinancialPlanning.java
- Wagon.java
- Parameters:
-
newName- The name to be set. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
getValue
public double getValue(double[] data)
Get the value of this row from an array. The function assumes thatdatais an array that stores a value for each row in the underlying problem and returns the value from this array that corresponds to this row.dataarrays can be obtained for example fromprob.getSlacks()orprob.getCallbackSlacks().Examples using
getValue:- AddMipSol.java
- BoolVars.java
- Boxes02.java
- Capbgt2l.java
- ContractAllocation.java
- CuttingStock.java
- ELS.java
- ELSCut.java
- ELSManagedCuts.java
- FacilityLocationArray.java
- FacilityLocationCollection.java
- FixBV.java
- Folio.java
- FolioCB.java
- FolioHeuristic.java
- FolioInit.java
- FolioMip1.java
- FolioMip2.java
- FolioQC.java
- FolioQP.java
- GeneralConstraints.java
- Glidert.java
- GlobalObjectiveParametrics.java
- GlobalRHSParametrics.java
- GoalProg.java
- Knapsack.java
- LoadLP.java
- MipSolEnum.java
- MipSolPool.java
- MostViolated.java
- MultipleKnapsack_Arrays.java
- MultipleKnapsack_Collections.java
- MultipleProblems.java
- PiecewiseLinear.java
- PolygonObjects.java
- Pplan.java
- Pplan2.java
- ProductionPlanning_Index.java
- PurchasePWL.java
- PurchaseSOS2.java
- QuadraticProgramming.java
- RecursiveFinancialPlanning.java
- Sangraalind.java
- SaveSol.java
- SpecialOrderedSets.java
- SpecialOrderedSetsQuadratic.java
- TSP.java
- Tableau.java
- TravelingSalesPerson.java
- Trimloss.java
- Wagon.java
- Parameters:
-
data- Array data with data for this inequality. - Returns:
-
The value for this inequality in
data. - Since:
- 43.00
-
getSlack
public double getSlack()
Get the current slack value for this row.Note: This function uses
XPRSprob.getSlacks(IntHolder, double[], int, int)under the hood. This is only valid to call if the `com.dashoptimization.objects.XpressProblem` instance owning this row is currently not under optimization.Note: Calling this function for multiple rows is not efficient. If you need to get values for multiple rows then consider using
XPRSprob.getSlacks()to get the values for all rows and then usegetValue(double[])to extract the value for a particular row. This strategy is also valid from callbacks.Examples using
getSlack:- Returns:
- Slack for this row.
- Since:
- 43.00
-
getDual
public double getDual()
Get the current dual value value for this row.Note: This function uses
XPRSprob.getDuals(IntHolder, double[], int, int)under the hood. This is only valid to call if the `com.dashoptimization.objects.XpressProblem` instance owning this row is currently not under optimization.Note: Calling this function for multiple rows is not efficient. If you need to get values for multiple rows then consider using
XPRSprob.getDuals()to get the values for all rows and then usegetValue(double[])to extract the value for a particular row. This strategy is also valid from callbacks.Examples using
getDual:- Returns:
- Dual value for this row.
- Since:
- 43.00
-
getCallbackSlack
public double getCallbackSlack()
Get the slack value for this row from the solution associated with the current callback.Note: This function uses
XPRSprob.getCallbackSlacks(BoolHolder, double[], int, int)under the hood.Note: Calling this function for multiple rows is not efficient. If you need to get values for multiple rows then consider using
XPRSprob.getCallbackSlacks()to get the values for all rows and then usegetValue(double[])to extract the value for a particular row.- Returns:
- Slack for this row.
- Since:
- 43.00
-
getCallbackDual
public double getCallbackDual()
Get the dual value value for this row from the solution associated with the current callback.Note: This function uses
XPRSprob.getCallbackDuals(BoolHolder, double[], int, int)under the hood.Note: Calling this function for multiple rows is not efficient. If you need to get values for multiple rows then consider using
XPRSprob.getCallbackDuals()to get the values for all rows and then usegetValue(double[])to extract the value for a particular row.- Returns:
- Dual value for this row.
- Since:
- 43.00
-
chgCoef
public Inequality chgCoef(Variable v, double newCoef)
Change the coefficient for a variable in this row.Examples using
chgCoef:- Parameters:
-
v- Variable for which to change the coefficient. -
newCoef- New coefficient. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
chgCoefs
public Inequality chgCoefs(Variable[] v, double[] newCoef)
Change the coefficients for multiple variables in this row.- Parameters:
-
v- Variables for which to change the coefficient. -
newCoef- New coefficients. - Returns:
- Always returns this instance.
- Since:
- 43.00
-
getLhs
public Expression getLhs()
Get the left-hand side of this inequality.- Returns:
- The left-hand side of this inequality.
- 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.
