XPRBctr
- java.lang.Object
-
- com.dashoptimization.XPRBctr
-
public class XPRBctr extends java.lang.Object
This class represents a constraint definition in BCL. All terms in a constraint must belong to the same problem as the constraint itself.
-
-
Method Summary
Modifier and Type Method and Description void
add(double val)
void
add(XPRBexpr l)
Add a linear expression to a constraint.void
add(XPRBvar var)
void
addTerm(double val)
Add a constant term to a constraint.void
addTerm(double val, XPRBvar var)
void
addTerm(double val, XPRBvar var1, XPRBvar var2)
void
addTerm(XPRBvar var)
void
addTerm(XPRBvar var, double val)
Add a linear term to a constraint.void
addTerm(XPRBvar var1, XPRBvar var2, double val)
Add a quadratic term to a constraint.void
assign(XPRBrelation lr)
Assign a linear relation to a constraint.void
delTerm(XPRBvar var)
Delete a linear term from a constraint.void
delTerm(XPRBvar var1, XPRBvar var2)
Delete a quadratic term from a constraint.double
getAct()
Get the activity value for a constraint.double
getCoefficient(XPRBvar var)
Get the coefficient of a linear constraint term.double
getCoefficient(XPRBvar var1, XPRBvar var2)
Get the coefficient of a quadratic constraint term.double
getDual()
Get the dual value for a constraint.int
getIndicator()
Get the indicator type of a constraint.XPRBvar
getIndVar()
Get the indicator variable of a constraint.java.lang.String
getName()
Get the name of a constraint.java.lang.Iterable<XPRBqterm>
getQTerms()
Returns an iterable (anonymous) object over the quadratic terms in this constraint.double
getRangeL()
Get the lower range bound for a range constraint.double
getRangeU()
Get the upper range bound for a range constraint.double
getRHS()
Get the RHS value (= constant term) of a constraint.double
getRNG(int rngtype)
Get ranging information for a constraint.int
getRowNum()
Get the row number for a constraint.int
getSize()
Get the size of a constraint.double
getSlack()
Get the slack value for a constraint.java.lang.Iterable<XPRBterm>
getTerms()
Returns an iterable (anonymous) object over the linear terms in this constraint.int
getType()
Get the type of a constraint.boolean
isDelayed()
Test the type of a constraint.boolean
isIncludeVars()
Test the type of a constraint.boolean
isIndicator()
Test the indicator type of a constraint.boolean
isModCut()
Test the type of a constraint.boolean
isValid()
Test whether a constraint is correctly defined.void
print()
Print out a constraint.void
setDelayed(boolean d)
Set the constraint type.void
setIncludeVars(boolean i)
Set the constraint type.void
setIndicator(int dir)
void
setIndicator(int dir, XPRBvar b)
Set the indicator constraint type.void
setIndicator(XPRBvar b, int dir)
void
setModCut(boolean m)
Set the constraint type.void
setRange(double lb, double ub)
Define a range constraint.void
setTerm(double val)
Set the constant term (= RHS value) of a constraint.void
setTerm(double val, XPRBvar var)
void
setTerm(double val, XPRBvar var1, XPRBvar var2)
void
setTerm(XPRBvar var, double val)
Set a linear constraint term.void
setTerm(XPRBvar var1, XPRBvar var2, double val)
Set a quadratic constraint term.void
setType(int type)
Set the constraint row type.java.lang.String
toString()
-
-
-
Method Detail
-
isValid
public boolean isValid()
Test whether a constraint is correctly defined.XPRBctr ctr1; if(ctr1.isValid() == false) System.out.println("Error in constraint definition.");
-
assign
public void assign(XPRBrelation lr)
Assign a linear relation to a constraint.XPRBprob expl2; XPRBvar x1, x2; XPRBrelation lr; XPRBctr ctr5; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); x2 = expl2.newVar("abc1", XPRB.PL, 0, XPRB.INFINITY); lr = x2.gEql(x1); ctr5.assign(lr);
- Parameters:
-
lr
- linear relation
-
setType
public void setType(int type)
Set the constraint row type. This method changes the type of a previously defined constraint to inequality, equation or non-binding. MethodsetRange(double, double)
has to be used for changing the constraint to a ranged constraint. If a ranged constraint is changed back to some other type with this method, its upper bound becomes the RHS value.XPRBprob expl2; XPRBctr ctr1; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); ctr1.setType(XPRB.E);
- Parameters:
-
type
- Constraint type. Possible values:XPRB.L
<= (inequality)XPRB.G
>= (inequality)XPRB.E
= (equation)XPRB.N
non-binding
-
setRange
public void setRange(double lb, double ub)
Define a range constraint. This method changes the type of a previously defined constraint to a range constraint within the bounds specified bylb
andub
. The constraint type and RHS value of the constraint are replaced by the typeXPRB.R
(range) and the two bounds.XPRBprob expl2; XPRBvar x4[5]; XPRBctr ctr2; int i; for(i=0;i<5;i++) x4[i] = expl2.newVar("x4", XPRB.PL, 0, 500); ctr2 = expl2.newCtr("r2", x4[0].add(x4[1]).eql(9)); ctr2.setRange(4.0, 15.5);
- Parameters:
-
lb
- lower bound on the range constraint -
ub
- upper bound on the range constraint
-
setDelayed
public void setDelayed(boolean d)
Set the constraint type. This method changes the type of a previously defined constraint from ordinary constraint to delayed constraint and vice versa. Delayed or 'lazy' constraints must be satisfied for any integer solution, but will not be loaded into the active set of constraints until required.
Constraint properties 'model cut', 'delayed constraint', 'indicator constraint' and 'include vars' are mutually exclusive. When changing from one of these types to another you must first reset the correponding type to 0.XPRBprob expl2; XPRBctr ctr1; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); ctr1.setDelayed(1);
- Parameters:
-
d
- Constraint type. Possible values:true
delayed constraintfalse
ordinary constraint
-
isDelayed
public boolean isDelayed()
Test the type of a constraint. This method indicates whether the given constraint is a delayed constraint or an ordinary constraint.XPRBprob expl2; XPRBctr ctr1; boolean dstat; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); dstat = ctr1.isDelayed();
- Returns:
-
Constraint type. Possible values:
true
model cutfalse
constraint
-
setIncludeVars
public void setIncludeVars(boolean i)
Set the constraint type. This method changes the type of a previously defined constraint from ordinary constraint to "include vars" and vice versa. "Include vars" constraints are non-binding (type N) constraints used only to force loading their variables into the optimizer. Constraint properties 'model cut', 'delayed constraint', 'indicator constraint' and 'include vars' are mutually exclusive. When changing from one of these types to another you must first reset the correponding type to 0.XPRBprob expl2; XPRBctr ctr1; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); ctr1.setIncludeVars(true);
- Parameters:
-
i
- Constraint type. Possible values:true
include varsfalse
ordinary constraint
-
isIncludeVars
public boolean isIncludeVars()
Test the type of a constraint. This method indicates whether the given constraint is an "include vars" constraint or an ordinary constraint.XPRBprob expl2; XPRBctr ctr1; boolean dstat; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); dstat = ctr1.isIncludeVars();
- Returns:
-
Constraint type. Possible values:
true
include varsfalse
constraint
-
setIndicator
public void setIndicator(int dir, XPRBvar b)
Set the indicator constraint type. This method changes the type of a previously defined constraint from ordinary constraint to indicator constraint and vice versa. Indicator constraints are defined by associating a binary variable and an implication sense with a linear inequality or range constraint.
Constraint properties 'model cut', 'delayed constraint', 'indicator constraint' and 'include vars' are mutually exclusive. When changing from one of these types to another you must first reset the correponding type to 0.XPRBprob expl2; XPRBctr ctr1; XPRBvar b, x1, x2; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1", x2.gEql(x1)); b = expl2.newVar("b", XPRB.BV); ctr1.setIndicator(1, b); // Results in: b=1 -> ctr1
- Parameters:
-
dir
- Constraint type. Possible values:-1
indicator constraint with condition b=00
ordinary constraint1
indicator constraint with condition b=1
-
b
- Previsouly created binary variable
-
setIndicator
public void setIndicator(XPRBvar b, int dir)
- See Also:
-
setIndicator(dir, b)
-
setIndicator
public void setIndicator(int dir)
- See Also:
-
setIndicator(dir, null)
-
getIndicator
public int getIndicator()
Get the indicator type of a constraint. This method returns the indicator status of the given constraint.XPRBprob expl2; XPRBctr ctr1; int dir; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); dir = ctr1.getIndicator();
- Returns:
-
Constraint type. Possible values:
-1
indicator constraint with condition b=00
ordinary constraint1
indicator constraint with condition b=1
-
getIndVar
public XPRBvar getIndVar()
Get the indicator variable of a constraint. This method returns the indicator variable associated with the given constraint.XPRBprob expl2; XPRBctr ctr1; XPRBvar x; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); if (ctr1.isIndicator()) x = ctr1.getIndVar();
- Returns:
-
A variable of type
XPRBvar
(check its validity withXPRBvar.isValid()
).
-
isIndicator
public boolean isIndicator()
Test the indicator type of a constraint. This method indicates whether the given constraint is an indicator constraint or an ordinary constraint.XPRBprob expl2; XPRBctr ctr1; boolean istat; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); istat = ctr1.isIndicator();
- Returns:
-
Constraint type. Possible values:
true
indicator constraintfalse
ordinary constraint
-
setModCut
public void setModCut(boolean m)
Set the constraint type. This method changes the type of a previously defined constraint from ordinary constraint to model cut and vice versa. Model cuts must be 'true' cuts, in the sense that they are redundant at the optimal MIP solution. The Optimizer does not guarantee to add all violated model cuts, so they must not be required to define the optimal MIP solution.
Constraint properties 'model cut', 'delayed constraint', 'indicator constraint' and 'include vars' are mutually exclusive. When changing from one of these types to another you must first reset the correponding type to 0.XPRBprob expl2; XPRBctr ctr1; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); ctr1.setModCut(true);
- Parameters:
-
m
- Constraint type. Possible values:true
model cutfalse
ordinary constraint
-
isModCut
public boolean isModCut()
Test the type of a constraint. This method indicates whether the given constraint is a model cut or an ordinary constraint.XPRBprob expl2; XPRBctr ctr1; boolean mcstat; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); mcstat = ctr1.isModCut();
- Returns:
-
Constraint type. Possible values:
true
model cutfalse
ordinary constraint
-
getName
public java.lang.String getName()
Get the name of a constraint. If the user has not defined a name the default name generated by BCL is returned.XPRBprob expl2; XPRBctr ctr1; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); System.out.println(ctr1.getName());
- Returns:
-
Name of the constraint if method executed successfully,
null
otherwise
-
getRangeL
public double getRangeL()
Get the lower range bound for a range constraint.XPRBprob expl2; XPRBvar x4[5]; XPRBctr ctr2; int i; double lr; for(i=0;i<5;i++) x4[i] = expl2.newVar("x4", XPRB.PL, 0, 500); ctr2 = expl2.newCtr("r2", x4[0].add(x4[1]).eql(9)); lr = ctr2.getRangeL(); ctr2
- Returns:
- Lower bound on the range constraint
-
getRangeU
public double getRangeU()
Get the upper range bound for a range constraint.XPRBprob expl2; XPRBvar x4[5]; XPRBctr ctr2; int i; double lr; for(i=0;i<5;i++) x4[i] = expl2.newVar("x4", XPRB.PL, 0, 500); ctr2 = expl2.newCtr("r2", x4[0].add(x4[1]).eql(9)); lr = ctr2.getRangeU(); ctr2
- Returns:
- Upper bound on the range constraint
-
getRHS
public double getRHS()
Get the RHS value (= constant term) of a constraint. The default RHS value is 0. If the given constraint is a ranged constraint this method returns its upper bound.XPRBprob expl2; XPRBctr ctr1; double rhs; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); rhs = ctr1.getRHS();
- Returns:
- Right hand side (RHS) value (default 0)
-
getRowNum
public int getRowNum()
Get the row number for a constraint. If the matrix has not yet been generated or the constraint is not part of the matrix (constraint typeXPRB.N
or no non-zero terms) then the return value is negative. The counting of row numbers starts with 0.XPRBprob expl2; XPRBctr ctr1; int rindex; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); rindex = ctr1.getRowNum();
- Returns:
- Matrix row number (integer value)
-
getSize
public int getSize()
Get the size of a constraint. Returns the number of (non-zero) linear and quadratic terms in a constraint.XPRBprob expl2; XPRBctr ctr1; int size; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); size = ctr1.getSize();
- Returns:
- Constraint size (integer value)
-
getType
public int getType()
Get the type of a constraint.XPRBprob expl2; XPRBctr ctr1; int rtype; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); rtype = ctr1.getType();
- Returns:
-
Constraint type. Possible values:
XPRB.L
<= (inequality)XPRB.G
>= (inequality)XPRB.E
= (equation)XPRB.N
non-bindingXPRB.R
range constraint-1
an error has occurred
-
getSlack
public double getSlack()
Get the slack value for a constraint. The user may wish to test first whether this constraint is part of the problem, for instance by checking that the row number is non-negative.XPRBprob expl2; XPRBvar x4[5]; XPRBctr ctr2; int i; double slack; expl2 = new XPRBprob("example2"); for(i=0;i<5;i++) x4[i] = expl2.newVar("x4", XPRB.PL, 0, 500); ctr2 = expl2.newCtr("r2", x4[0].add(x4[1]).eql(9)); expl2.lpOptimize(); slack = ctr2.getSlack();
- Returns:
- Slack value for the constraint (default 0)
-
getAct
public double getAct()
Get the activity value for a constraint. This method may be used on constraints that are not part of the problem (in particular constraints without relational operators). In this case it returns the evaluation of the terms involving variables that are in the problem.XPRBprob expl2; XPRBvar x4[5]; XPRBctr ctr2; int i; double act; expl2 = new XPRBprob("example2"); for(i=0;i<5;i++) x4[i] = expl2.newVar("x4", XPRB.PL, 0, 500); ctr2 = expl2.newCtr("r2", x4[0].add(x4[1]).eql(9)); expl2.lpOptimize(); act = ctr2.getAct();
- Returns:
- Activity value for the constraint (default 0)
-
getDual
public double getDual()
Get the dual value for a constraint. The user may wish to test first whether this constraint is part of the problem, for instance by checking that the row number is non-negative. Dual information is available only after LP solving. Dual information for MIP problems can be obtained by fixing all discrete variables to their solution values and re-solving the resulting LP problem.XPRBprob expl2; XPRBvar x4[5]; XPRBctr ctr2; int i; double dual; expl2 = new XPRBprob("example2"); for(i=0;i<5;i++) x4[i] = expl2.newVar("x4", XPRB.PL, 0, 500); ctr2 = expl2.newCtr("r2", x4[0].add(x4[1]).eql(9)); expl2.lpOptimize(); slack = ctr2.getDual();
- Returns:
- Dual value for the constraint (default 0)
-
getRNG
public double getRNG(int rngtype)
Get ranging information for a constraint. This method can only be used after solving an LP problem. Ranging information for MIP problems can be obtained by fixing all discrete variables to their solution values and re-solving the resulting LP problem.XPRBprob expl2; XPRBvar x4[5]; XPRBctr ctr2; int i; double upact; expl2 = new XPRBprob("example2"); for(i=0;i<5;i++) x4[i] = expl2.newVar("x4", XPRB.PL, 0, 500); ctr2 = expl2.newCtr("r2", x4[0].add(x4[1]).eql(9)); expl2.lpOptimize(); upact = ctr2.getRNG(XPRB.UPACT);
- Parameters:
-
rngtype
- Ranging information type. Possible values:XPRB.UPACT
the largest value which the constraint RHS can take while the current basis remains optimalXPRB.LOACT
the smallest value which the constraint RHS can take while the current basis remains optimalXPRB.UUP
the change in objective value per unit increase in the constraint RHS, assuming the the current basis remains optimalXPRB.UDN
the change in objective value per unit decrease in the constraint RHS, assuming the the current basis remains optimal
- Returns:
- Ranging information of the required type
-
setTerm
public void setTerm(XPRBvar var, double val)
Set a linear constraint term. This method sets the coefficient of a given variable to the valueval
.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); ctr1 = expl2.newCtr("r1"); ctr1.setTerm(x1, 5.4);
- Parameters:
-
var
- variable of typeXPRBvar
-
val
- value of the coefficient of the variablevar
-
setTerm
public void setTerm(double val, XPRBvar var)
- See Also:
-
setTerm(var, val)
-
setTerm
public void setTerm(XPRBvar var1, XPRBvar var2, double val)
Set a quadratic constraint term. This method sets the coefficient of the product of the given variables to the valueval
.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1, x2; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); x2 = expl2.newVar("abc1"); ctr1 = expl2.newCtr("r1"); ctr1.setTerm(x1, x2, 5.4);
- Parameters:
-
var1
- variable of typeXPRBvar
-
var2
- variable of typeXPRBvar
-
val
- value of the coefficient of the product of the variables
-
setTerm
public void setTerm(double val, XPRBvar var1, XPRBvar var2)
- See Also:
-
setTerm(var1, var2, val)
-
setTerm
public void setTerm(double val)
Set the constant term (= RHS value) of a constraint. The RHS of the constraint is set to the given constant.XPRBprob expl2; XPRBctr ctr1; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); ctr1.setTerm(7);
- Parameters:
-
val
- constant term (RHS value)
-
getCoefficient
public double getCoefficient(XPRBvar var)
Get the coefficient of a linear constraint term. This method returns the coefficient of a given variable in the constraint or 0 if the variable does not occur.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1; double val; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); ctr1 = expl2.newCtr("r1"); ctr1.setTerm(x1, 5.4); val = ctr1.getCoefficient(x1);
- Parameters:
-
var
- variable of typeXPRBvar
- Returns:
- coefficient for the given variable
-
getCoefficient
public double getCoefficient(XPRBvar var1, XPRBvar var2)
Get the coefficient of a quadratic constraint term. This method returns the coefficient of a given pair of variables in the constraint or 0 if the term does not occur.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1, x2; double val; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); x2 = expl2.newVar("abc1"); ctr1 = expl2.newCtr("r1"); ctr1.addTerm(x1, x2, 5.4); val = ctr1.getCoefficient(x1, x2);
- Parameters:
-
var1
- variable of typeXPRBvar
-
var2
- variable of typeXPRBvar
- Returns:
- coefficient for the given variables
-
addTerm
public void addTerm(XPRBvar var, double val)
Add a linear term to a constraint. This method adds a new term to a constraint, comprising the variablevar
with coefficientval
. If the constraint already has a term with variablevar
,val
is added to its coefficient.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); ctr1 = expl2.newCtr("r1"); ctr1.addTerm(x1, 5.4);
- Parameters:
-
var
- variable of typeXPRBvar
-
val
- value to be added to the coefficient of the variablevar
-
addTerm
public void addTerm(double val, XPRBvar var)
- See Also:
-
addTerm(var, val)
-
addTerm
public void addTerm(XPRBvar var)
- See Also:
-
addTerm(var, 1)
-
addTerm
public void addTerm(XPRBvar var1, XPRBvar var2, double val)
Add a quadratic term to a constraint. This method adds a new term to a constraint, comprising the product of the variablesvar1
andvar2
with coefficientval
. If the constraint already has a term with variablesvar1
andvar2
, thenval
is added to its coefficient.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1, x2; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); x2 = expl2.newVar("abc1"); ctr1 = expl2.newCtr("r1"); ctr1.addTerm(x1, x2, 5.4);
- Parameters:
-
var1
- variable of typeXPRBvar
-
var2
- variable of typeXPRBvar
-
val
- value to be added to the coefficient of the product of the variables
-
addTerm
public void addTerm(double val, XPRBvar var1, XPRBvar var2)
- See Also:
-
addTerm(var1, var2, val)
-
addTerm
public void addTerm(double val)
Add a constant term to a constraint. The given constant term is added to the RHS value of the constraint.XPRBprob expl2; XPRBctr ctr1; expl2 = new XPRBprob("example2"); ctr1 = expl2.newCtr("r1"); ctr1.addTerm(7);
- Parameters:
-
val
- value to be added to the RHS of the constraint
-
delTerm
public void delTerm(XPRBvar var)
Delete a linear term from a constraint.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); ctr1 = expl2.newCtr("r1"); ctr1.addTerm(x1, 5.4); ctr1.delTerm(x1);
- Parameters:
-
var
- variable of typeXPRBvar
-
delTerm
public void delTerm(XPRBvar var1, XPRBvar var2)
Delete a quadratic term from a constraint. This method removes the term involving the product of the two given variables from the constraint.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1, x2; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); x2 = expl2.newVar("abc1"); ctr1 = expl2.newCtr("r1"); ctr1.addTerm(x1, x2, 5.4); ctr1.delTerm(x1, x2);
- Parameters:
-
var1
- variable of typeXPRBvar
-
var2
- variable of typeXPRBvar
-
add
public void add(XPRBexpr l)
Add a linear expression to a constraint. The entire linear expression given is added to the left hand side of the constraint. That is, in order to normalize the constraint representation, any constant term contained in the linear expression will be subtracted from the RHS value.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); ctr1 = expl2.newCtr("r1"); ctr1.add(x1.add(17));
- Parameters:
-
l
- linear expression of typeXPRBexpr
-
add
public void add(XPRBvar var)
- See Also:
-
addTerm(var, 1)
-
add
public void add(double val)
- See Also:
-
addTerm(val)
-
print
public void print()
Print out a constraint. This method prints out a constraint in LP-format. It is not available in the Student Edition.XPRBprob expl2; XPRBctr ctr2; XPRBvar x4[5]; XPRBctr ctr2; int i; for(i=0;i<5;i++) x4[i] = expl2.newVar("x4", XPRB.PL, 0, 500); ctr2 = expl2.newCtr("r2", x4[0].add(x4[1]).eql(9)); ctr2.print();
-
toString
public java.lang.String toString()
- Overrides:
-
toString
in classjava.lang.Object
- See Also:
-
getName()
-
getTerms
public java.lang.Iterable<XPRBterm> getTerms()
Returns an iterable (anonymous) object over the linear terms in this constraint.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1; double val; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); ctr1 = expl2.newCtr("r1"); ctr1.addTerm(x1, 5.4); for (XPRBterm t : ctr1.getTerms()) { System.out.println(t); }
- Returns:
-
An iterable of type
Iterable<XPRBterm>
-
getQTerms
public java.lang.Iterable<XPRBqterm> getQTerms()
Returns an iterable (anonymous) object over the quadratic terms in this constraint.XPRBprob expl2; XPRBctr ctr1; XPRBvar x1, x2; double val; expl2 = new XPRBprob("example2"); x1 = expl2.newVar("abc3", XPRB.UI, 1, 100); x2 = expl2.newVar("abc1"); ctr1 = expl2.newCtr("r1"); ctr1.addTerm(x1, x2, 5.4); for (XPRBqterm t : ctr1.getQTerms()) { System.out.println(t); }
- Returns:
-
An iterable of type
Iterable<XPRBqterm>
-
-
© 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.