|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgurobi.GRBModel
public class GRBModel
Gurobi model object. Commonly used methods include @link GRBModel#addVar addVar (adds a new decision variable to the model),
Constructor Summary | |
---|---|
GRBModel(GRBEnv env)
Model constructor. |
|
GRBModel(GRBEnv env,
java.lang.String filename)
Read a model from a file. |
|
GRBModel(GRBModel model)
Create a copy of an existing model. |
Method Summary | |
---|---|
GRBConstr |
addConstr(double lhs,
char sense,
GRBLinExpr rhsExpr,
java.lang.String name)
Add a single linear constraint to a model. |
GRBConstr |
addConstr(double lhs,
char sense,
GRBVar rhsVar,
java.lang.String name)
Add a single linear constraint to a model. |
GRBConstr |
addConstr(GRBLinExpr lhsExpr,
char sense,
double rhs,
java.lang.String name)
Add a single linear constraint to a model. |
GRBConstr |
addConstr(GRBLinExpr lhsExpr,
char sense,
GRBLinExpr rhsExpr,
java.lang.String name)
Add a single linear constraint to a model. |
GRBConstr |
addConstr(GRBLinExpr lhsExpr,
char sense,
GRBVar rhsVar,
java.lang.String name)
Add a single linear constraint to a model. |
GRBConstr |
addConstr(GRBVar lhsVar,
char sense,
double rhs,
java.lang.String name)
Add a single linear constraint to a model. |
GRBConstr |
addConstr(GRBVar lhsVar,
char sense,
GRBLinExpr rhsExpr,
java.lang.String name)
Add a single linear constraint to a model. |
GRBConstr |
addConstr(GRBVar lhsVar,
char sense,
GRBVar rhsVar,
java.lang.String name)
Add a single linear constraint to a model. |
GRBConstr[] |
addConstrs(GRBLinExpr[] lhsExprs,
char[] senses,
double[] rhss,
java.lang.String[] names)
Add new linear constraints to a model. |
GRBConstr[] |
addConstrs(GRBLinExpr[] lhsExprs,
char[] senses,
double[] rhss,
java.lang.String[] names,
int start,
int len)
Add new linear constraints to a model. |
GRBConstr[] |
addConstrs(int count)
Add @code count new linear constraints to a model. |
GRBGenConstr |
addGenConstrAbs(GRBVar resvar,
GRBVar argvar,
java.lang.String name)
Add a new general constraint of type @literal GRB.GENCONSTR_ABS to a model. |
GRBGenConstr |
addGenConstrAnd(GRBVar resvar,
GRBVar[] vars,
java.lang.String name)
Add a new general constraint of type @literal GRB.GENCONSTR_AND to a model. |
GRBGenConstr |
addGenConstrCos(GRBVar xvar,
GRBVar yvar,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_COS to a model. |
GRBGenConstr |
addGenConstrExp(GRBVar xvar,
GRBVar yvar,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_EXP to a model. |
GRBGenConstr |
addGenConstrExpA(GRBVar xvar,
GRBVar yvar,
double a,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_EXPA to a model. |
GRBGenConstr |
addGenConstrIndicator(GRBVar binvar,
int binval,
GRBLinExpr expr,
char sense,
double rhs,
java.lang.String name)
Add a new general constraint of type @literal GRB.GENCONSTR_INDICATOR to a model. |
GRBGenConstr |
addGenConstrLog(GRBVar xvar,
GRBVar yvar,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_LOG to a model. |
GRBGenConstr |
addGenConstrLogA(GRBVar xvar,
GRBVar yvar,
double a,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_LOGA to a model. |
GRBGenConstr |
addGenConstrMax(GRBVar resvar,
GRBVar[] vars,
double constant,
java.lang.String name)
Add a new general constraint of type @literal GRB.GENCONSTR_MAX to a model. |
GRBGenConstr |
addGenConstrMin(GRBVar resvar,
GRBVar[] vars,
double constant,
java.lang.String name)
Add a new general constraint of type @literal GRB.GENCONSTR_MIN to a model. |
GRBGenConstr |
addGenConstrOr(GRBVar resvar,
GRBVar[] vars,
java.lang.String name)
Add a new general constraint of type @literal GRB.GENCONSTR_OR to a model. |
GRBGenConstr |
addGenConstrPoly(GRBVar xvar,
GRBVar yvar,
double[] p,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_POLY to a model. |
GRBGenConstr |
addGenConstrPow(GRBVar xvar,
GRBVar yvar,
double a,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_POW to a model. |
GRBGenConstr |
addGenConstrPWL(GRBVar xvar,
GRBVar yvar,
double[] xpts,
double[] ypts,
java.lang.String name)
Add a new general constraint of type @literal GRB.GENCONSTR_PWL to a model. |
GRBGenConstr |
addGenConstrSin(GRBVar xvar,
GRBVar yvar,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_SIN to a model. |
GRBGenConstr |
addGenConstrTan(GRBVar xvar,
GRBVar yvar,
java.lang.String name,
java.lang.String options)
Add a new general constraint of type @literal GRB.GENCONSTR_TAN to a model. |
GRBQConstr |
addQConstr(double lhs,
char sense,
GRBQuadExpr rhsExpr,
java.lang.String name)
Add a quadratic constraint to a model. |
GRBQConstr |
addQConstr(GRBLinExpr lhsExpr,
char sense,
GRBQuadExpr rhsExpr,
java.lang.String name)
Add a quadratic constraint to a model. |
GRBQConstr |
addQConstr(GRBQuadExpr lhsExpr,
char sense,
double rhs,
java.lang.String name)
Add a quadratic constraint to a model. |
GRBQConstr |
addQConstr(GRBQuadExpr lhsExpr,
char sense,
GRBLinExpr rhsExpr,
java.lang.String name)
Add a quadratic constraint to a model. |
GRBQConstr |
addQConstr(GRBQuadExpr lhsExpr,
char sense,
GRBQuadExpr rhsExpr,
java.lang.String name)
Add a quadratic constraint to a model. |
GRBQConstr |
addQConstr(GRBQuadExpr lhsExpr,
char sense,
GRBVar rhsVar,
java.lang.String name)
Add a quadratic constraint to a model. |
GRBQConstr |
addQConstr(GRBVar lhsVar,
char sense,
GRBQuadExpr rhsExpr,
java.lang.String name)
Add a quadratic constraint to a model. |
GRBConstr |
addRange(GRBLinExpr expr,
double lower,
double upper,
java.lang.String name)
Add a single range constraint to a model. |
GRBConstr[] |
addRanges(GRBLinExpr[] exprs,
double[] lower,
double[] upper,
java.lang.String[] names)
Add new range constraints to a model. |
gurobi.GRBSOS |
addSOS(GRBVar[] vars,
double[] weights,
int type)
Add an SOS constraint to the model. |
GRBVar |
addVar(double lb,
double ub,
double obj,
char type,
GRBColumn col,
java.lang.String name)
Add a variable to a model. |
GRBVar |
addVar(double lb,
double ub,
double obj,
char type,
GRBConstr[] constrs,
double[] coeffs,
java.lang.String name)
Add a variable to a model, and the associated non-zero coefficients. |
GRBVar |
addVar(double lb,
double ub,
double obj,
char type,
java.lang.String name)
Add a variable to a model; non-zero entries will be added later. |
GRBVar[] |
addVars(double[] lb,
double[] ub,
double[] obj,
char[] type,
java.lang.String[] names)
Add new decision variables to a model. |
GRBVar[] |
addVars(double[] lb,
double[] ub,
double[] obj,
char[] type,
java.lang.String[] names,
GRBColumn[] cols)
Add new decision variables to a model. |
GRBVar[] |
addVars(double[] lb,
double[] ub,
double[] obj,
char[] type,
java.lang.String[] names,
int start,
int len)
Add new decision variables to a model. |
GRBVar[] |
addVars(int count,
char type)
Add @code count new decision variables to a model. |
void |
BasisHead(int[] bhead)
|
int |
BinvColj(int col,
int[] xind,
double[] xval)
|
int |
Binvi(int i,
int[] xind,
double[] xval)
|
int |
Binvj(int j,
int[] xind,
double[] xval)
|
int |
BinvRowi(int i,
int[] xind,
double[] xval)
|
int |
BSolve(int blen,
int[] bind,
double[] bval,
int[] xind,
double[] xval)
|
void |
check()
|
void |
chgCoeff(GRBConstr constr,
GRBVar var,
double newval)
Change one coefficient in the model. |
void |
chgCoeffs(GRBConstr[] constrs,
GRBVar[] vars,
double[] newvals)
Change a list of coefficients in the model. |
void |
computeIIS()
Compute an Irreducible Inconsistent Subsystem (IIS). |
void |
discardConcurrentEnvs()
Discard concurrent environments for a model. |
void |
discardMultiobjEnvs()
Use @link GRBModel#getMultiobjEnv getMultiobjEnv to create a multi- objective environments. |
void |
dispose()
Release the resources associated with a @code GRBModel object. |
GRBModel |
feasibility()
|
double |
feasRelax(int relaxobjtype,
boolean minrelax,
boolean vrelax,
boolean crelax)
Simplified method for creating a feasibility relaxation model. |
double |
feasRelax(int relaxobjtype,
boolean minrelax,
GRBVar[] vars,
double[] lbpen,
double[] ubpen,
GRBConstr[] constrs,
double[] rhspen)
Create a feasibility relaxation model. |
protected void |
finalize()
|
GRBModel |
fixedModel()
Create the fixed model associated with a MIP model. |
int |
FSolve(int blen,
int[] bind,
double[] bval,
int[] xind,
double[] xval)
|
char[] |
get(GRB.CharAttr attr,
GRBConstr[] constrs)
Query a char-valued constraint attribute for an array of constraints. |
char[][] |
get(GRB.CharAttr attr,
GRBConstr[][] constrs)
Query a char-valued constraint attribute for a two-dimensional array of constraints. |
char[][][] |
get(GRB.CharAttr attr,
GRBConstr[][][] constrs)
Query a char-valued constraint attribute for a three-dimensional array of constraints. |
char[] |
get(GRB.CharAttr attr,
GRBConstr[] constrs,
int start,
int len)
Query a char-valued constraint attribute for a sub-array of constraints. |
char[] |
get(GRB.CharAttr attr,
GRBQConstr[] qconstrs)
Query a char-valued quadratic constraint attribute for an array of quadratic constraints. |
char[][] |
get(GRB.CharAttr attr,
GRBQConstr[][] qconstrs)
Query a char-valued quadratic constraint attribute for a two- dimensional array of quadratic constraints. |
char[][][] |
get(GRB.CharAttr attr,
GRBQConstr[][][] qconstrs)
Query a char-valued quadratic constraint attribute for a three- dimensional array of quadratic constraints. |
char[] |
get(GRB.CharAttr attr,
GRBQConstr[] qconstrs,
int start,
int len)
Query a char-valued quadratic constraint attribute for a sub-array of quadratic constraints. |
char[] |
get(GRB.CharAttr attr,
GRBVar[] vars)
Query a char-valued variable attribute for an array of variables. |
char[][] |
get(GRB.CharAttr attr,
GRBVar[][] vars)
Query a char-valued variable attribute for a two-dimensional array of variables. |
char[][][] |
get(GRB.CharAttr attr,
GRBVar[][][] vars)
Query a char-valued variable attribute for a three-dimensional array of variables. |
char[] |
get(GRB.CharAttr attr,
GRBVar[] vars,
int start,
int len)
Query a char-valued variable attribute for a sub-array of variables. |
double |
get(GRB.DoubleAttr attr)
Query the value of a double-valued model attribute. |
double[] |
get(GRB.DoubleAttr attr,
GRBConstr[] constrs)
Query a double-valued constraint attribute for an array of constraints. |
double[][] |
get(GRB.DoubleAttr attr,
GRBConstr[][] constrs)
Query a double-valued constraint attribute for a two-dimensional array of constraints. |
double[][][] |
get(GRB.DoubleAttr attr,
GRBConstr[][][] constrs)
Query a double-valued constraint attribute for a three-dimensional array of constraints. |
double[] |
get(GRB.DoubleAttr attr,
GRBConstr[] constrs,
int start,
int len)
Query a double-valued constraint attribute for a sub-array of constraints. |
double[] |
get(GRB.DoubleAttr attr,
GRBQConstr[] qconstrs)
Query a double-valued quadratic constraint attribute for an array of quadratic constraints. |
double[][] |
get(GRB.DoubleAttr attr,
GRBQConstr[][] qconstrs)
Query a double-valued quadratic constraint attribute for a two- dimensional array of quadratic constraints. |
double[][][] |
get(GRB.DoubleAttr attr,
GRBQConstr[][][] qconstrs)
Query a double-valued quadratic constraint attribute for a three- dimensional array of quadratic constraints. |
double[] |
get(GRB.DoubleAttr attr,
GRBQConstr[] qconstrs,
int start,
int len)
Query a double-valued quadratic constraint attribute for a sub-array of quadratic constraints. |
double[] |
get(GRB.DoubleAttr attr,
GRBVar[] vars)
Query a double-valued variable attribute for an array of variables. |
double[][] |
get(GRB.DoubleAttr attr,
GRBVar[][] vars)
Query a double-valued variable attribute for a two-dimensional array of variables. |
double[][][] |
get(GRB.DoubleAttr attr,
GRBVar[][][] vars)
Query a double-valued variable attribute for a three-dimensional array of variables. |
double[] |
get(GRB.DoubleAttr attr,
GRBVar[] vars,
int start,
int len)
Query a double-valued variable attribute for a sub-array of variables. |
double |
get(GRB.DoubleParam param)
Query the value of a double-valued parameter. |
int |
get(GRB.IntAttr attr)
Query the value of an int-valued model attribute. |
int[] |
get(GRB.IntAttr attr,
GRBConstr[] constrs)
Query an int-valued constraint attribute for an array of constraints. |
int[][] |
get(GRB.IntAttr attr,
GRBConstr[][] constrs)
Query an int-valued constraint attribute for a two-dimensional array of constraints. |
int[][][] |
get(GRB.IntAttr attr,
GRBConstr[][][] constrs)
Query an int-valued constraint attribute for a three-dimensional array of constraints. |
int[] |
get(GRB.IntAttr attr,
GRBConstr[] constrs,
int start,
int len)
Query an int-valued constraint attribute for a sub-array of constraints. |
int[] |
get(GRB.IntAttr attr,
GRBGenConstr[] genconstrs)
Query an int-valued general constraint attribute for an array of general constraints. |
int[][] |
get(GRB.IntAttr attr,
GRBGenConstr[][] genconstrs)
Query an int-valued general constraint attribute for a two-dimensional array of general constraints. |
int[][][] |
get(GRB.IntAttr attr,
GRBGenConstr[][][] genconstrs)
Query an int-valued general constraint attribute for a three- dimensional array of general constraints. |
int[] |
get(GRB.IntAttr attr,
GRBGenConstr[] genconstrs,
int start,
int len)
Query an int-valued general constraint attribute for a sub-array of general constraints. |
int[] |
get(GRB.IntAttr attr,
GRBQConstr[] qconstrs)
Query an int-valued quadratic constraint attribute for an array of quadratic constraints. |
int[][] |
get(GRB.IntAttr attr,
GRBQConstr[][] qconstrs)
Query an int-valued quadratic constraint attribute for a two- dimensional array of quadratic constraints. |
int[][][] |
get(GRB.IntAttr attr,
GRBQConstr[][][] qconstrs)
Query an int-valued quadratic constraint attribute for a three- dimensional array of quadratic constraints. |
int[] |
get(GRB.IntAttr attr,
GRBQConstr[] qconstrs,
int start,
int len)
Query an int-valued quadratic constraint attribute for a sub-array of quadratic constraints. |
int[] |
get(GRB.IntAttr attr,
GRBVar[] vars)
Query an int-valued variable attribute for an array of variables. |
int[][] |
get(GRB.IntAttr attr,
GRBVar[][] vars)
Query an int-valued variable attribute for a two-dimensional array of variables. |
int[][][] |
get(GRB.IntAttr attr,
GRBVar[][][] vars)
Query an int-valued variable attribute for a three-dimensional array of variables. |
int[] |
get(GRB.IntAttr attr,
GRBVar[] vars,
int start,
int len)
Query an int-valued variable attribute for a sub-array of variables. |
int |
get(GRB.IntParam param)
Query the value of an int-valued parameter. |
java.lang.String |
get(GRB.StringAttr attr)
Query the value of a string-valued model attribute. |
java.lang.String[] |
get(GRB.StringAttr attr,
GRBConstr[] constrs)
Query a String-valued constraint attribute for an array of constraints. |
java.lang.String[][] |
get(GRB.StringAttr attr,
GRBConstr[][] constrs)
Query a String-valued constraint attribute for a two-dimensional array of constraints. |
java.lang.String[][][] |
get(GRB.StringAttr attr,
GRBConstr[][][] constrs)
Query a String-valued constraint attribute for a three-dimensional array of constraints. |
java.lang.String[] |
get(GRB.StringAttr attr,
GRBConstr[] constrs,
int start,
int len)
Query a String-valued constraint attribute for a sub-array of constraints. |
java.lang.String[] |
get(GRB.StringAttr attr,
GRBGenConstr[] genconstrs)
Query a String-valued general constraint attribute for an array of general constraints. |
java.lang.String[][] |
get(GRB.StringAttr attr,
GRBGenConstr[][] genconstrs)
Query a String-valued constraint attribute for a two-dimensional array of general constraints. |
java.lang.String[][][] |
get(GRB.StringAttr attr,
GRBGenConstr[][][] genconstrs)
Query a String-valued constraint attribute for a three-dimensional array of general constraints. |
java.lang.String[] |
get(GRB.StringAttr attr,
GRBGenConstr[] genconstrs,
int start,
int len)
Query a String-valued general constraint attribute for a sub-array of constraints. |
java.lang.String[] |
get(GRB.StringAttr attr,
GRBQConstr[] qconstrs)
Query a String-valued quadratic constraint attribute for an array of quadratic constraints. |
java.lang.String[][] |
get(GRB.StringAttr attr,
GRBQConstr[][] qconstrs)
Query a String-valued quadratic constraint attribute for a two- dimensional array of quadratic constraints. |
java.lang.String[][][] |
get(GRB.StringAttr attr,
GRBQConstr[][][] qconstrs)
Query a String-valued quadratic constraint attribute for a three- dimensional array of quadratic constraints. |
java.lang.String[] |
get(GRB.StringAttr attr,
GRBQConstr[] qconstrs,
int start,
int len)
Query a String-valued quadratic constraint attribute for a sub-array of quadratic constraints. |
java.lang.String[] |
get(GRB.StringAttr attr,
GRBVar[] vars)
Query a String-valued variable attribute for an array of variables. |
java.lang.String[][] |
get(GRB.StringAttr attr,
GRBVar[][] vars)
Query a String-valued variable attribute for a two-dimensional array of variables. |
java.lang.String[][][] |
get(GRB.StringAttr attr,
GRBVar[][][] vars)
Query a String-valued variable attribute for a three-dimensional array of variables. |
java.lang.String[] |
get(GRB.StringAttr attr,
GRBVar[] vars,
int start,
int len)
Query a String-valued variable attribute for a sub-array of variables. |
java.lang.String |
get(GRB.StringParam param)
Query the value of a string-valued parameter. |
double |
getCoeff(GRBConstr constr,
GRBVar var)
Query the coefficient of variable @code var in linear constraint @code constr (note that the result can be zero). |
GRBColumn |
getCol(GRBVar var)
Retrieve the list of constraints in which a variable participates, and the associated coefficients. |
GRBEnv |
getConcurrentEnv(int num)
Create/retrieve a concurrent environment for a model. |
GRBConstr |
getConstr(int i)
|
GRBConstr |
getConstrByName(java.lang.String name)
Retrieve a linear constraint from its name. |
GRBConstr[] |
getConstrs()
Retrieve an array of all linear constraints in the model. |
GRBEnv |
getEnv()
Query the environment associated with the model. |
void |
getGenConstrAbs(GRBGenConstr genc,
GRBVar[] resvar,
GRBVar[] argvar)
Any of the following arguments can be @literal null. |
void |
getGenConstrAnd(GRBGenConstr genc,
GRBVar[] resvar,
GRBVar[] vars,
int[] len)
Any of the following arguments can be @literal null. |
void |
getGenConstrCos(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar)
Any of the following arguments can be @literal null. |
void |
getGenConstrExp(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar)
Any of the following arguments can be @literal null. |
void |
getGenConstrExpA(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar,
double[] a)
Any of the following arguments can be @literal null. |
void |
getGenConstrIndicator(GRBGenConstr genc,
GRBVar[] binvar,
int[] binval,
GRBLinExpr[] expr,
char[] sense,
double[] rhs)
Any of the following arguments can be @literal null. |
void |
getGenConstrLog(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar)
Any of the following arguments can be @literal null. |
void |
getGenConstrLogA(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar,
double[] a)
Any of the following arguments can be @literal null. |
void |
getGenConstrMax(GRBGenConstr genc,
GRBVar[] resvar,
GRBVar[] vars,
int[] len,
double[] constant)
Any of the following arguments can be @literal null. |
void |
getGenConstrMin(GRBGenConstr genc,
GRBVar[] resvar,
GRBVar[] vars,
int[] len,
double[] constant)
Any of the following arguments can be @literal null. |
void |
getGenConstrOr(GRBGenConstr genc,
GRBVar[] resvar,
GRBVar[] vars,
int[] len)
Any of the following arguments can be @literal null. |
void |
getGenConstrPoly(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar,
int[] plen,
double[] p)
Any of the following arguments can be @literal null. |
void |
getGenConstrPow(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar,
double[] a)
Any of the following arguments can be @literal null. |
void |
getGenConstrPWL(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar,
int[] npts,
double[] xpts,
double[] ypts)
Any of the following arguments can be @literal null. |
GRBGenConstr[] |
getGenConstrs()
Retrieve an array of all general constraints in the model. |
void |
getGenConstrSin(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar)
Any of the following arguments can be @literal null. |
void |
getGenConstrTan(GRBGenConstr genc,
GRBVar[] xvar,
GRBVar[] yvar)
Any of the following arguments can be @literal null. |
java.lang.String |
getJSONSolution()
|
GRBEnv |
getMultiobjEnv(int num)
Use @link GRBModel#discardMultiobjEnvs discardMultiobjEnvs to discard multi-objective environments and return to standard behavior. |
GRBExpr |
getObjective()
Retrieve the optimization objective. |
GRBLinExpr |
getObjective(int index)
Retrieve an alternative optimization objective. |
int |
getPWLObj(GRBVar var,
double[] x,
double[] y)
Retrieve the piecewise-linear objective function for a variable. |
GRBQConstr[] |
getQConstrs()
Retrieve an array of all quadratic constraints in the model. |
GRBQuadExpr |
getQCRow(GRBQConstr qc)
Retrieve the left-hand side expression from a quadratic constraint. |
GRBLinExpr |
getRow(GRBConstr constr)
Retrieve a list of variables that participate in a constraint, and the associated coefficients. |
int |
getSOS(gurobi.GRBSOS sos,
GRBVar[] vars,
double[] weights,
int[] type)
Retrieve the list of variables that participate in an SOS constraint, and the associated coefficients. |
gurobi.GRBSOS[] |
getSOSs()
Retrieve an array of all SOS constraints in the model. |
void |
getTuneResult(int i)
Use this method to retrieve the results of a previous @link GRBModel#tune tune call. |
GRBVar |
getVar(int i)
|
GRBVar |
getVarByName(java.lang.String name)
Retrieve a variable from its name. |
GRBVar[] |
getVars()
Retrieve an array of all variables in the model. |
GRBModel |
linearize()
|
void |
optimize()
Optimize the model. |
void |
optimizeasync()
Optimize a model asynchronously. |
java.lang.String |
optimizeBatch()
|
GRBModel |
presolve()
Perform presolve on a model. |
void |
read(java.lang.String filename)
This method is the general entry point for importing data from a file into a model. |
GRBModel |
relax()
|
void |
remove(GRBConstr constr)
Remove a linear constraint from the model. |
void |
remove(GRBGenConstr genconstr)
Remove a general constraint from the model. |
void |
remove(GRBQConstr qconstr)
Remove a quadratic constraint from the model. |
void |
remove(gurobi.GRBSOS sos)
Remove an SOS constraint from the model. |
void |
remove(GRBVar var)
Remove a variable from the model. |
void |
reset()
Reset the model to an unsolved state, discarding any previously computed solution information. |
void |
reset(int clearall)
Reset the model to an unsolved state, discarding any previously computed solution information. |
void |
set(GRB.CharAttr attr,
GRBConstr[][][] constrs,
char[][][] newvals)
Set a char-valued constraint attribute for a three-dimensional array of constraints. |
void |
set(GRB.CharAttr attr,
GRBConstr[][] constrs,
char[][] newvals)
Set a char-valued constraint attribute for a two-dimensional array of constraints. |
void |
set(GRB.CharAttr attr,
GRBConstr[] constrs,
char[] newvals)
Set a char-valued constraint attribute for an array of constraints. |
void |
set(GRB.CharAttr attr,
GRBConstr[] constrs,
char[] newvals,
int start,
int len)
Set a char-valued constraint attribute for a sub-array of constraints. |
void |
set(GRB.CharAttr attr,
GRBQConstr[][][] qconstrs,
char[][][] newvals)
Set a char-valued quadratic constraint attribute for a three- dimensional array of quadratic constraints. |
void |
set(GRB.CharAttr attr,
GRBQConstr[][] qconstrs,
char[][] newvals)
Set a char-valued quadratic constraint attribute for a two-dimensional array of quadratic constraints. |
void |
set(GRB.CharAttr attr,
GRBQConstr[] qconstrs,
char[] newvals)
Set a char-valued quadratic constraint attribute for an array of quadratic constraints. |
void |
set(GRB.CharAttr attr,
GRBQConstr[] qconstrs,
char[] newvals,
int start,
int len)
Set a char-valued quadratic constraint attribute for a sub-array of quadratic constraints. |
void |
set(GRB.CharAttr attr,
GRBVar[][][] vars,
char[][][] newvals)
Set a char-valued variable attribute for a three-dimensional array of variables. |
void |
set(GRB.CharAttr attr,
GRBVar[][] vars,
char[][] newvals)
Set a char-valued variable attribute for a two-dimensional array of variables. |
void |
set(GRB.CharAttr attr,
GRBVar[] vars,
char[] newvals)
Set a char-valued variable attribute for an array of variables. |
void |
set(GRB.CharAttr attr,
GRBVar[] vars,
char[] newvals,
int start,
int len)
Set a char-valued variable attribute for a sub-array of variables. |
void |
set(GRB.DoubleAttr attr,
double newval)
Set the value of a double-valued model attribute. |
void |
set(GRB.DoubleAttr attr,
GRBConstr[][][] constrs,
double[][][] newvals)
Set a double-valued constraint attribute for a three-dimensional array of constraints. |
void |
set(GRB.DoubleAttr attr,
GRBConstr[][] constrs,
double[][] newvals)
Set a double-valued constraint attribute for a two-dimensional array of constraints. |
void |
set(GRB.DoubleAttr attr,
GRBConstr[] constrs,
double[] newvals)
Set a double-valued constraint attribute for an array of constraints. |
void |
set(GRB.DoubleAttr attr,
GRBConstr[] constrs,
double[] newvals,
int start,
int len)
Set a double-valued constraint attribute for a sub-array of constraints. |
void |
set(GRB.DoubleAttr attr,
GRBQConstr[][][] qconstrs,
double[][][] newvals)
Set a double-valued quadratic constraint attribute for a three- dimensional array of quadratic constraints. |
void |
set(GRB.DoubleAttr attr,
GRBQConstr[][] qconstrs,
double[][] newvals)
Set a double-valued quadratic constraint attribute for a two- dimensional array of quadratic constraints. |
void |
set(GRB.DoubleAttr attr,
GRBQConstr[] qconstrs,
double[] newvals)
Set a double-valued quadratic constraint attribute for an array of quadratic constraints. |
void |
set(GRB.DoubleAttr attr,
GRBQConstr[] qconstrs,
double[] newvals,
int start,
int len)
Set a double-valued quadratic constraint attribute for a sub-array of quadratic constraints. |
void |
set(GRB.DoubleAttr attr,
GRBVar[][][] vars,
double[][][] newvals)
Set a double-valued variable attribute for a three-dimensional array of variables. |
void |
set(GRB.DoubleAttr attr,
GRBVar[][] vars,
double[][] newvals)
Set a double-valued variable attribute for a two-dimensional array of variables. |
void |
set(GRB.DoubleAttr attr,
GRBVar[] vars,
double[] newvals)
Set a double-valued variable attribute for an array of variables. |
void |
set(GRB.DoubleAttr attr,
GRBVar[] vars,
double[] newvals,
int start,
int len)
Set a double-valued variable attribute for a sub-array of variables. |
void |
set(GRB.DoubleParam param,
double newval)
Set the value of a double-valued parameter. |
void |
set(GRB.IntAttr attr,
GRBConstr[][][] constrs,
int[][][] newvals)
Set an int-valued constraint attribute for a three-dimensional array of constraints. |
void |
set(GRB.IntAttr attr,
GRBConstr[][] constrs,
int[][] newvals)
Set an int-valued constraint attribute for a two-dimensional array of constraints. |
void |
set(GRB.IntAttr attr,
GRBConstr[] constrs,
int[] newvals)
Set an int-valued constraint attribute for an array of constraints. |
void |
set(GRB.IntAttr attr,
GRBConstr[] constrs,
int[] newvals,
int start,
int len)
Set an int-valued constraint attribute for a sub-array of constraints. |
void |
set(GRB.IntAttr attr,
GRBVar[][][] vars,
int[][][] newvals)
Set an int-valued variable attribute for a three-dimensional array of variables. |
void |
set(GRB.IntAttr attr,
GRBVar[][] vars,
int[][] newvals)
Set an int-valued variable attribute for a two-dimensional array of variables. |
void |
set(GRB.IntAttr attr,
GRBVar[] vars,
int[] newvals)
Set an int-valued variable attribute for an array of variables. |
void |
set(GRB.IntAttr attr,
GRBVar[] vars,
int[] newvals,
int start,
int len)
Set an int-valued variable attribute for a sub-array of variables. |
void |
set(GRB.IntAttr attr,
int newval)
Set the value of an int-valued model attribute. |
void |
set(GRB.IntParam param,
int newval)
Set the value of an int-valued parameter. |
void |
set(GRB.StringAttr attr,
GRBConstr[][][] constrs,
java.lang.String[][][] newvals)
Set a String-valued constraint attribute for a three-dimensional array of constraints. |
void |
set(GRB.StringAttr attr,
GRBConstr[][] constrs,
java.lang.String[][] newvals)
Set a String-valued constraint attribute for a two-dimensional array of constraints. |
void |
set(GRB.StringAttr attr,
GRBConstr[] constrs,
java.lang.String[] newvals)
Set a String-valued constraint attribute for an array of constraints. |
void |
set(GRB.StringAttr attr,
GRBConstr[] constrs,
java.lang.String[] newvals,
int start,
int len)
Set a String-valued constraint attribute for a sub-array of constraints. |
void |
set(GRB.StringAttr attr,
GRBGenConstr[][][] genconstrs,
java.lang.String[][][] newvals)
Set a String-valued general constraint attribute for a three- dimensional array of general constraints. |
void |
set(GRB.StringAttr attr,
GRBGenConstr[][] genconstrs,
java.lang.String[][] newvals)
Set a String-valued general constraint attribute for a two-dimensional array of general constraints. |
void |
set(GRB.StringAttr attr,
GRBGenConstr[] genconstrs,
java.lang.String[] newvals)
Set a String-valued general constraint attribute for an array of general constraints. |
void |
set(GRB.StringAttr attr,
GRBGenConstr[] genconstrs,
java.lang.String[] newvals,
int start,
int len)
Set a String-valued general constraint attribute for a sub-array of general constraints. |
void |
set(GRB.StringAttr attr,
GRBQConstr[][][] qconstrs,
java.lang.String[][][] newvals)
Set a String-valued quadratic constraint attribute for a three- dimensional array of quadratic constraints. |
void |
set(GRB.StringAttr attr,
GRBQConstr[][] qconstrs,
java.lang.String[][] newvals)
Set a String-valued quadratic constraint attribute for a two- dimensional array of quadratic constraints. |
void |
set(GRB.StringAttr attr,
GRBQConstr[] qconstrs,
java.lang.String[] newvals)
Set a String-valued quadratic constraint attribute for an array of quadratic constraints. |
void |
set(GRB.StringAttr attr,
GRBQConstr[] qconstrs,
java.lang.String[] newvals,
int start,
int len)
Set a String-valued quadratic constraint attribute for a sub-array of quadratic constraints. |
void |
set(GRB.StringAttr attr,
GRBVar[][][] vars,
java.lang.String[][][] newvals)
Set a String-valued variable attribute for a three-dimensional array of variables. |
void |
set(GRB.StringAttr attr,
GRBVar[][] vars,
java.lang.String[][] newvals)
Set a String-valued variable attribute for a two-dimensional array of variables. |
void |
set(GRB.StringAttr attr,
GRBVar[] vars,
java.lang.String[] newvals)
Set a String-valued variable attribute for an array of variables. |
void |
set(GRB.StringAttr attr,
GRBVar[] vars,
java.lang.String[] newvals,
int start,
int len)
Set a String-valued variable attribute for a sub-array of variables. |
void |
set(GRB.StringAttr attr,
java.lang.String newval)
Set the value of a String-valued model attribute. |
void |
set(GRB.StringParam param,
java.lang.String newval)
Set the value of a string-valued parameter. |
void |
set(java.lang.String param,
java.lang.String newval)
Set the value of any parameter using strings alone. |
void |
setCallback(GRBCallback cb)
Set the callback object for a model. |
void |
setObjective(GRBExpr expr)
Set the model objective. |
void |
setObjective(GRBExpr expr,
int sense)
Set the model objective, and the objective sense (@code GRB.MINIMIZE for minimization, @code GRB.MAXIMIZE for maximization). |
void |
setObjectiveN(GRBLinExpr expr,
int index,
int priority,
double weight,
double abstol,
double reltol,
java.lang.String name)
Set an alternative optimization objective equal to a linear expression. |
void |
setPWLObj(GRBVar var,
double[] x,
double[] y)
Set the piecewise-linear objective function for a variable. |
GRBModel |
singleScenarioModel()
Capture a single scenario from a multi-scenario model. |
void |
sync()
Wait for a previous asynchronous optimization call to complete. |
void |
terminate()
Generate a request to terminate the current optimization. |
void |
tune()
Perform an automated search for parameter settings that improve performance. |
void |
update()
Process any pending model modifications. |
void |
write(java.lang.String filename)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GRBModel(GRBEnv env) throws GRBException
env
- Environment for new model.
GRBException
public GRBModel(GRBEnv env, java.lang.String filename) throws GRBException
env
- Environment for new model.filename
- Name of the file containing the model.
GRBException
public GRBModel(GRBModel model) throws GRBException
model
- Model to copy.
GRBException
Method Detail |
---|
public void dispose()
You should not attempt to use a @code GRBModel object after calling
protected void finalize()
finalize
in class java.lang.Object
public void read(java.lang.String filename) throws GRBException
Note that this is not the method to use if you want to read a new model from a file. For that, use the @link GRBModel#GRBModel GRBModel constructor. One variant of the constructor takes the name of the file that contains the new model as its argument.
filename
- Name of the file to read. The suffix on the file must be either
GRBException
public void write(java.lang.String filename) throws GRBException
filename
- The name of the file to be written. The file type is encoded in the
file name suffix. Valid suffixes are @literal .mps, @literal .rew,
GRBException
public void sync() throws GRBException
Calling @link GRBModel#optimizeasync optimizeasync returns control to the calling routine immediately. The caller can perform other computations while optimization proceeds, and can check on the progress of the optimization by querying various model attributes. The
GRBException
public GRBModel relax() throws GRBException
GRBException
public GRBModel fixedModel() throws GRBException
Note that, while the fixed problem is always a continuous model, it may contain a non-convex quadratic objective or non-convex quadratic constraints. As a result, it may still be solved using the MIP algorithm.
GRBException
public GRBModel presolve() throws GRBException
GRBException
public GRBModel feasibility() throws GRBException
GRBException
public GRBModel linearize() throws GRBException
GRBException
public GRBModel singleScenarioModel() throws GRBException
GRBException
public double feasRelax(int relaxobjtype, boolean minrelax, boolean vrelax, boolean crelax) throws GRBException
relaxobjtype
- The cost function used when finding the minimum cost relaxation.minrelax
- The type of feasibility relaxation to perform.vrelax
- Indicates whether variable bounds can be relaxed (with a cost of 1.0
for any violations.crelax
- Indicates whether linear constraints can be relaxed (with a cost of
1.0 for any violations.
GRBException
public double feasRelax(int relaxobjtype, boolean minrelax, GRBVar[] vars, double[] lbpen, double[] ubpen, GRBConstr[] constrs, double[] rhspen) throws GRBException
relaxobjtype
- The cost function used when finding the minimum cost relaxation.minrelax
- The type of feasibility relaxation to perform.vars
- Variables whose bounds are allowed to be violated.lbpen
- Penalty for violating a variable lower bound. One entry for each
variable in argument @literal vars.ubpen
- Penalty for violating a variable upper bound. One entry for each
variable in argument @literal vars.constrs
- Linear constraints that are allowed to be violated.rhspen
- Penalty for violating a linear constraint. One entry for each
constraint in argument @literal constrs.
GRBException
public GRBVar getVar(int i)
public GRBVar[] getVars()
public GRBVar getVarByName(java.lang.String name) throws GRBException
name
- The name of the desired variable.
GRBException
public GRBConstr getConstr(int i)
public GRBConstr[] getConstrs()
public GRBConstr getConstrByName(java.lang.String name) throws GRBException
name
- The name of the desired linear constraint.
GRBException
public gurobi.GRBSOS[] getSOSs()
public GRBQConstr[] getQConstrs()
public GRBGenConstr[] getGenConstrs()
public GRBExpr getObjective() throws GRBException
Note that the constant and linear portions of the objective can also be retrieved using the
GRBException
public GRBLinExpr getObjective(int index) throws GRBException
Please refer to the discussion of Multiple Objectives for more information on the use of alternative objectives.
Note that alternative objectives can also be retrieved using the @literal ObjNCon and @literal ObjN attributes.
index
- The index for the requested alternative objective.
GRBException
public int getPWLObj(GRBVar var, double[] x, double[] y) throws GRBException
Refer to this discussion for additional information on what the values in x and y mean.
var
- The variable whose objective function is being retrieved.x
- The x values for the points that define the piecewise-linear function.
These will always be in non-decreasing order.y
- The y values for the points that define the piecewise-linear function.
GRBException
public void setObjective(GRBExpr expr) throws GRBException
expr
- New model objective.
GRBException
public void setObjective(GRBExpr expr, int sense) throws GRBException
expr
- New model objective.sense
- New optimization sense (@literal GRB.MINIMIZE for minimization,
GRBException
public void setObjectiveN(GRBLinExpr expr, int index, int priority, double weight, double abstol, double reltol, java.lang.String name) throws GRBException
Please refer to the discussion of Multiple Objectives for more information on the use of alternative objectives.
Note that you can also modify an alternative objective using the @literal ObjN variable attribute. If you wish to mix and match these two approaches, please note that this method replaces the entire existing objective, while the @code ObjN attribute can be used to modify individual terms.
expr
- New alternative objective.index
- Index for new objective. If you use an index of 0, this routine will
change the primary optimization objective.priority
- Priority for the alternative objective. This initializes the @literal
ObjNPriority attribute for this objective.weight
- Weight for the alternative objective. This initializes the @literal
ObjNWeight attribute for this objective.abstol
- Absolute tolerance for the alternative objective. This initializes thereltol
- Relative tolerance for the alternative objective. This initializes thename
- Name of the alternative objective. This initializes the @literal
ObjNName attribute for this objective.
GRBException
public void setPWLObj(GRBVar var, double[] x, double[] y) throws GRBException
var
- The variable whose objective function is being set.x
- The x values for the points that define the piecewise-linear function.
Must be in non-decreasing order.y
- The y values for the points that define the piecewise-linear function.
GRBException
public void optimize() throws GRBException
Please consult this section in the Reference Manual for a discussion of some of the practical issues associated with solving a precisely defined mathematical model using finite-precision floating-point arithmetic.
Note that this method will process all pending model modifications.
GRBException
public void optimizeasync() throws GRBException
GRBException
public java.lang.String optimizeBatch() throws GRBException
GRBException
public void computeIIS() throws GRBException
Note that an infeasible model may have multiple IISs. The one returned by Gurobi is not necessarily the one with minimum cardinality; there may exist others with fewer constraints or bounds.
If an IIS computation is interrupted before completion, Gurobi will return the smallest IIS found to that point.
This method populates the @code IISCONSTR, @code IISQCONSTR, and @code IISGENCONSTR constraint attributes, the @code IISSOS SOS attribute, and the @code IISLB, and @code IISUB variable attributes. You can also obtain information about the results of the IIS computation by writing a @code .ilp format file (see @link GRBModel#write GRBModel.write). This file contains only the IIS from the original model.
Note that this method can be used to compute IISs for both continuous and MIP models.
GRBException
public void tune() throws GRBException
Please refer to the Parameter Tuning section in the Reference Manual for details on the tuning tool.
GRBException
public void getTuneResult(int i) throws GRBException
Once you have retrieved a tuning result, you can call @link GRBModel#optimize optimize to use these parameter settings to optimize the model, or @link GRBModel#write write to write the changed parameters to a @code .prm file.
Please refer to the Parameter Tuning section in the Reference Manual for details on the tuning tool.
i
- The index of the tuning result to retrieve. The best result is
available as index 0. The number of stored results is available in
attribute @literal TuneResultCount.
GRBException
public void reset() throws GRBException
GRBException
public void reset(int clearall) throws GRBException
clearall
- Should additional information such as MIP starts, variable hints,
branching priorities, lazy flags, and partition information be
cleared?
GRBException
public void check() throws GRBException
GRBException
public void terminate()
public void update() throws GRBException
GRBException
public GRBVar addVar(double lb, double ub, double obj, char type, java.lang.String name) throws GRBException
lb
- Lower bound for new variable.ub
- Upper bound for new variable.obj
- Objective coefficient for new variable.type
- Variable type for new variable (@literal GRB.CONTINUOUS, @literal
GRB.BINARY, @literal GRB.INTEGER, @literal GRB.SEMICONT, or @literal
GRB.SEMIINT).name
- Name for new variable.
GRBException
public GRBVar addVar(double lb, double ub, double obj, char type, GRBConstr[] constrs, double[] coeffs, java.lang.String name) throws GRBException
lb
- Lower bound for new variable.ub
- Upper bound for new variable.obj
- Objective coefficient for new variable.type
- Variable type for new variable (@literal GRB.CONTINUOUS, @literal
GRB.BINARY, @literal GRB.INTEGER, @literal GRB.SEMICONT, or @literal
GRB.SEMIINT).constrs
- Array of constraints in which the variable participates.coeffs
- Array of coefficients for each constraint in which the variable
participates. The lengths of the @literal constrs and @literal coeffs
arrays must be identical.name
- Name for new variable.
GRBException
public GRBVar addVar(double lb, double ub, double obj, char type, GRBColumn col, java.lang.String name) throws GRBException
lb
- Lower bound for new variable.ub
- Upper bound for new variable.obj
- Objective coefficient for new variable.type
- Variable type for new variable (@literal GRB.CONTINUOUS, @literal
GRB.BINARY, @literal GRB.INTEGER, @literal GRB.SEMICONT, or @literal
GRB.SEMIINT).col
- GRBColumn object for specifying a set of constraints to which new
variable belongs.name
- Name for new variable.
GRBException
public GRBVar[] addVars(int count, char type) throws GRBException
count
- Number of variables to add.type
- Variable type for new variables (@literal GRB.CONTINUOUS, @literal
GRB.BINARY, @literal GRB.INTEGER, @literal GRB.SEMICONT, or @literal
GRB.SEMIINT).
GRBException
public GRBVar[] addVars(double[] lb, double[] ub, double[] obj, char[] type, java.lang.String[] names) throws GRBException
lb
- Lower bounds for new variables. Can be @literal null, in which case
the variables get lower bounds of 0.0.ub
- Upper bounds for new variables. Can be @literal null, in which case
the variables get infinite upper bounds.obj
- Objective coefficients for new variables. Can be @literal null, in
which case the variables get objective coefficients of 0.0.type
- Variable types for new variables (@literal GRB.CONTINUOUS, @literal
GRB.BINARY, @literal GRB.INTEGER, @literal GRB.SEMICONT, or @literal
GRB.SEMIINT). Can be @literal null, in which case the variables are
assumed to be continuous.names
- Names for new variables. Can be @literal null, in which case all
variables are given default names.
GRBException
public GRBVar[] addVars(double[] lb, double[] ub, double[] obj, char[] type, java.lang.String[] names, int start, int len) throws GRBException
lb
- Lower bounds for new variables. Can be @literal null, in which case
the variables get lower bounds of 0.0.ub
- Upper bounds for new variables. Can be @literal null, in which case
the variables get infinite upper bounds.obj
- Objective coefficients for new variables. Can be @literal null, in
which case the variables get objective coefficients of 0.0.type
- Variable types for new variables (@literal GRB.CONTINUOUS, @literal
GRB.BINARY, @literal GRB.INTEGER, @literal GRB.SEMICONT, or @literal
GRB.SEMIINT). Can be @literal null, in which case the variables are
assumed to be continuous.names
- Names for new variables. Can be @literal null, in which case all
variables are given default names.start
- The first variable in the list to add.len
- The number of variables to add.
GRBException
public GRBVar[] addVars(double[] lb, double[] ub, double[] obj, char[] type, java.lang.String[] names, GRBColumn[] cols) throws GRBException
lb
- Lower bounds for new variables. Can be @literal null, in which case
the variables get lower bounds of 0.0.ub
- Upper bounds for new variables. Can be @literal null, in which case
the variables get infinite upper bounds.obj
- Objective coefficients for new variables. Can be @literal null, in
which case the variables get objective coefficients of 0.0.type
- Variable types for new variables (@literal GRB.CONTINUOUS, @literal
GRB.BINARY, @literal GRB.INTEGER, @literal GRB.SEMICONT, or @literal
GRB.SEMIINT). Can be @literal null, in which case the variables are
assumed to be continuous.names
- Names for new variables. Can be @literal null, in which case all
variables are given default names.cols
- GRBColumn objects for specifying a set of constraints to which each
new column belongs.
GRBException
public GRBConstr addConstr(GRBLinExpr lhsExpr, char sense, GRBLinExpr rhsExpr, java.lang.String name) throws GRBException
lhsExpr
- Left-hand side expression for new linear constraint.sense
- Sense for new linear constraint (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhsExpr
- Right-hand side expression for new linear constraint.name
- Name for new constraint.
GRBException
public GRBConstr addConstr(GRBLinExpr lhsExpr, char sense, GRBVar rhsVar, java.lang.String name) throws GRBException
lhsExpr
- Left-hand side expression for new linear constraint.sense
- Sense for new linear constraint (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhsVar
- Right-hand side variable for new linear constraint.name
- Name for new constraint.
GRBException
public GRBConstr addConstr(GRBVar lhsVar, char sense, GRBLinExpr rhsExpr, java.lang.String name) throws GRBException
lhsVar
- Left-hand side variable for new linear constraint.sense
- Sense for new linear constraint (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhsExpr
- Right-hand side expression for new linear constraint.name
- Name for new constraint.
GRBException
public GRBConstr addConstr(GRBVar lhsVar, char sense, GRBVar rhsVar, java.lang.String name) throws GRBException
lhsVar
- Left-hand side variable for new linear constraint.sense
- Sense for new linear constraint (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhsVar
- Right-hand side variable for new linear constraint.name
- Name for new constraint.
GRBException
public GRBConstr addConstr(GRBVar lhsVar, char sense, double rhs, java.lang.String name) throws GRBException
lhsVar
- Left-hand side variable for new linear constraint.sense
- Sense for new linear constraint (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhs
- Right-hand side value for new linear constraint.name
- Name for new constraint.
GRBException
public GRBConstr addConstr(double lhs, char sense, GRBVar rhsVar, java.lang.String name) throws GRBException
lhs
- Left-hand side value for new linear constraint.sense
- Sense for new linear constraint (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhsVar
- Right-hand side variable for new linear constraint.name
- Name for new constraint.
GRBException
public GRBConstr addConstr(GRBLinExpr lhsExpr, char sense, double rhs, java.lang.String name) throws GRBException
lhsExpr
- Left-hand side expression for new linear constraint.sense
- Sense for new linear constraint (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhs
- Right-hand side value for new linear constraint.name
- Name for new constraint.
GRBException
public GRBConstr addConstr(double lhs, char sense, GRBLinExpr rhsExpr, java.lang.String name) throws GRBException
lhs
- Left-hand side value for new linear constraint.sense
- Sense for new linear constraint (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhsExpr
- Right-hand side expression for new linear constraint.name
- Name for new constraint.
GRBException
public GRBConstr addRange(GRBLinExpr expr, double lower, double upper, java.lang.String name) throws GRBException
expr
- Linear expression for new range constraint.lower
- Lower bound for linear expression.upper
- Upper bound for linear expression.name
- Name for new constraint.
GRBException
public GRBConstr[] addConstrs(int count) throws GRBException
count
- Number of constraints to add.
GRBException
public GRBConstr[] addConstrs(GRBLinExpr[] lhsExprs, char[] senses, double[] rhss, java.lang.String[] names) throws GRBException
lhsExprs
- Left-hand side expressions for the new linear constraints.senses
- Senses for new linear constraints (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhss
- Right-hand side values for the new linear constraints.names
- Names for new constraints.
GRBException
public GRBConstr[] addConstrs(GRBLinExpr[] lhsExprs, char[] senses, double[] rhss, java.lang.String[] names, int start, int len) throws GRBException
lhsExprs
- Left-hand side expressions for the new linear constraints.senses
- Senses for new linear constraints (@literal GRB.LESS_EQUAL, @literal
GRB.EQUAL, or @literal GRB.GREATER_EQUAL).rhss
- Right-hand side values for the new linear constraints.names
- Names for new constraints.start
- The first constraint in the list to add.len
- The number of constraints to add.
GRBException
public GRBConstr[] addRanges(GRBLinExpr[] exprs, double[] lower, double[] upper, java.lang.String[] names) throws GRBException
exprs
- Linear expressions for the new range constraints.lower
- Lower bounds for linear expressions.upper
- Upper bounds for linear expressions.names
- Names for new range constraints.
GRBException
public GRBQConstr addQConstr(GRBQuadExpr lhsExpr, char sense, GRBQuadExpr rhsExpr, java.lang.String name) throws GRBException
lhsExpr
- Left-hand side quadratic expression for new quadratic constraint.sense
- Sense for new quadratic constraint (@literal GRB.LESS_EQUAL orrhsExpr
- Right-hand side quadratic expression for new quadratic constraint.name
- Name for new constraint.
GRBException
public GRBQConstr addQConstr(GRBQuadExpr lhsExpr, char sense, GRBLinExpr rhsExpr, java.lang.String name) throws GRBException
lhsExpr
- Left-hand side quadratic expression for new quadratic constraint.sense
- Sense for new quadratic constraint (@literal GRB.LESS_EQUAL orrhsExpr
- Right-hand side linear expression for new quadratic constraint.name
- Name for new constraint.
GRBException
public GRBQConstr addQConstr(GRBLinExpr lhsExpr, char sense, GRBQuadExpr rhsExpr, java.lang.String name) throws GRBException
lhsExpr
- Left-hand side linear expression for new quadratic constraint.sense
- Sense for new quadratic constraint (@literal GRB.LESS_EQUAL orrhsExpr
- Right-hand side quadratic expression for new quadratic constraint.name
- Name for new constraint.
GRBException
public GRBQConstr addQConstr(GRBQuadExpr lhsExpr, char sense, GRBVar rhsVar, java.lang.String name) throws GRBException
lhsExpr
- Left-hand side quadratic expression for new quadratic constraint.sense
- Sense for new quadratic constraint (@literal GRB.LESS_EQUAL orrhsVar
- Right-hand side variable for new quadratic constraint.name
- Name for new constraint.
GRBException
public GRBQConstr addQConstr(GRBVar lhsVar, char sense, GRBQuadExpr rhsExpr, java.lang.String name) throws GRBException
lhsVar
- Left-hand side variable for new quadratic constraint.sense
- Sense for new quadratic constraint (@literal GRB.LESS_EQUAL orrhsExpr
- Right-hand side quadratic expression for new quadratic constraint.name
- Name for new constraint.
GRBException
public GRBQConstr addQConstr(GRBQuadExpr lhsExpr, char sense, double rhs, java.lang.String name) throws GRBException
lhsExpr
- Left-hand side quadratic expression for new quadratic constraint.sense
- Sense for new quadratic constraint (@literal GRB.LESS_EQUAL orrhs
- Right-hand side value for new quadratic constraint.name
- Name for new constraint.
GRBException
public GRBQConstr addQConstr(double lhs, char sense, GRBQuadExpr rhsExpr, java.lang.String name) throws GRBException
lhs
- Left-hand side value for new quadratic constraint.sense
- Sense for new quadratic constraint (@literal GRB.LESS_EQUAL orrhsExpr
- Right-hand side quadratic expression for new quadratic constraint.name
- Name for new constraint.
GRBException
public GRBGenConstr addGenConstrMax(GRBVar resvar, GRBVar[] vars, double constant, java.lang.String name) throws GRBException
resvar
- The resultant variable of the new constraint.vars
- Array of variables that are the operands of the new constraint.constant
- The additional constant operand of the new constraint.name
- Name for the new general constraint.
GRBException
public GRBGenConstr addGenConstrMin(GRBVar resvar, GRBVar[] vars, double constant, java.lang.String name) throws GRBException
resvar
- The resultant variable of the new constraint.vars
- Array of variables that are the operands of the new constraint.constant
- The additional constant operand of the new constraint.name
- Name for the new general constraint.
GRBException
public GRBGenConstr addGenConstrAbs(GRBVar resvar, GRBVar argvar, java.lang.String name) throws GRBException
resvar
- The resultant variable of the new constraint.argvar
- The argument variable of the new constraint.name
- Name for the new general constraint.
GRBException
public GRBGenConstr addGenConstrAnd(GRBVar resvar, GRBVar[] vars, java.lang.String name) throws GRBException
Note that all variables participating in such a constraint will be forced to be binary, independent of how they were created.
resvar
- The resultant variable of the new constraint.vars
- Array of variables that are the operands of the new constraint.name
- Name for the new general constraint.
GRBException
public GRBGenConstr addGenConstrOr(GRBVar resvar, GRBVar[] vars, java.lang.String name) throws GRBException
Note that all variables participating in such a constraint will be forced to be binary, independent of how they were created.
resvar
- The resultant variable of the new constraint.vars
- Array of variables that are the operands of the new constraint.name
- Name for the new general constraint.
GRBException
public GRBGenConstr addGenConstrIndicator(GRBVar binvar, int binval, GRBLinExpr expr, char sense, double rhs, java.lang.String name) throws GRBException
Note that the indicator variable z of a constraint will be forced to be binary, independent of how it was created.
binvar
- The binary indicator variable.binval
- The value for the binary indicator variable that would force the
linear constraint to be satisfied (0 or 1).expr
- Left-hand side expression for the linear constraint triggered by the
indicator.sense
- Sense for the linear constraint. Options are @literal GRB.LESS_EQUAL,rhs
- Right-hand side value for the linear constraint.name
- Name for the new general constraint.
GRBException
public GRBGenConstr addGenConstrPWL(GRBVar xvar, GRBVar yvar, double[] xpts, double[] ypts, java.lang.String name) throws GRBException
xvar
- The x variable.yvar
- The y variable.xpts
- The x values for the points that define the piecewise-linear function.
Must be in non-decreasing order.ypts
- The y values for the points that define the piecewise-linear function.name
- Name for the new general constraint.
GRBException
public GRBGenConstr addGenConstrPoly(GRBVar xvar, GRBVar yvar, double[] p, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.p
- The coefficients for the polynomial function (starting with the
coefficient for the highest power).name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public GRBGenConstr addGenConstrExp(GRBVar xvar, GRBVar yvar, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public GRBGenConstr addGenConstrExpA(GRBVar xvar, GRBVar yvar, double a, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.a
- name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public GRBGenConstr addGenConstrLog(GRBVar xvar, GRBVar yvar, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public GRBGenConstr addGenConstrLogA(GRBVar xvar, GRBVar yvar, double a, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.a
- name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public GRBGenConstr addGenConstrPow(GRBVar xvar, GRBVar yvar, double a, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.a
- name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public GRBGenConstr addGenConstrSin(GRBVar xvar, GRBVar yvar, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public GRBGenConstr addGenConstrCos(GRBVar xvar, GRBVar yvar, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public GRBGenConstr addGenConstrTan(GRBVar xvar, GRBVar yvar, java.lang.String name, java.lang.String options) throws GRBException
A piecewise-linear approximation of the function is added to the model. The details of the approximation are controlled using the following four attributes (or using the parameters with the same names): @literal FuncPieces, @literal FuncPieceError, @literal FuncPiecesLength, and @literal FuncPieceRatio. For details, consult the General Constraint discussion.
xvar
- The x variable.yvar
- The y variable.name
- Name for the new general constraint.options
- A string that can be used to set the attributes that control the
piecewise-linear approximation of this function constraint. To assign
a value to an attribute, follow the attribute name with an equal sign
and the desired value (with no spaces). Assignments for different
attributes should be separated by spaces (e.g. "FuncPieces=-1
FuncPieceError=0.001").
GRBException
public void remove(GRBVar var) throws GRBException
var
- The variable to remove.
GRBException
public void remove(GRBConstr constr) throws GRBException
constr
- The linear constraint to remove.
GRBException
public void chgCoeff(GRBConstr constr, GRBVar var, double newval) throws GRBException
Note that, due to our lazy update approach, the change won't actually take effect until you update the model (using @link GRBModel#update GRBModel.update), optimize the model (using @link GRBModel#optimize GRBModel.optimize), or write the model to disk (using @link GRBModel#write GRBModel.write).
constr
- Constraint for coefficient to be changed.var
- Variable for coefficient to be changed.newval
- Desired new value for coefficient.
GRBException
public void chgCoeffs(GRBConstr[] constrs, GRBVar[] vars, double[] newvals) throws GRBException
Note that, due to our lazy update approach, the change won't actually take effect until you update the model (using @link GRBModel#update GRBModel.update), optimize the model (using @link GRBModel#optimize GRBModel.optimize), or write the model to disk (using @link GRBModel#write GRBModel.write).
constrs
- Constraints for coefficients to be changed.vars
- Variables for coefficients to be changed.newvals
- Desired new values for coefficients.
GRBException
public double getCoeff(GRBConstr constr, GRBVar var) throws GRBException
constr
- The requested constraint.var
- The requested variable.
GRBException
public GRBColumn getCol(GRBVar var) throws GRBException
var
- The variable of interest.
GRBException
public GRBLinExpr getRow(GRBConstr constr) throws GRBException
constr
- The constraint of interest.
GRBException
public gurobi.GRBSOS addSOS(GRBVar[] vars, double[] weights, int type) throws GRBException
vars
- Array of variables that participate in the SOS constraint.weights
- Weights for the variables in the SOS constraint.type
- SOS type (can be @literal GRB.SOS_TYPE1 or @literal GRB.SOS_TYPE2).
GRBException
public int getSOS(gurobi.GRBSOS sos, GRBVar[] vars, double[] weights, int[] type) throws GRBException
sos
- The SOS set of interest.vars
- A list of variables that participate in @literal sos. Can be @literal
null.weights
- The SOS weights for each participating variable. Can be @literal null.type
- The type of the SOS set (either @literal GRB.SOS_TYPE1 or @literal
GRB.SOS_TYPE2) is returned in @literal type[0].
GRBException
public void getGenConstrMax(GRBGenConstr genc, GRBVar[] resvar, GRBVar[] vars, int[] len, double[] constant) throws GRBException
genc
- The general constraint object.resvar
- Store the resultant variable of the constraint at @literal resvar[0].vars
- Array to store the operand variables of the constraint.len
- Store the number of operand variables of the constraint at @literal
len[0].constant
- Store the additional constant operand of the constraint at @literal
constant[0].
GRBException
public void getGenConstrMin(GRBGenConstr genc, GRBVar[] resvar, GRBVar[] vars, int[] len, double[] constant) throws GRBException
genc
- The general constraint object.resvar
- Store the resultant variable of the constraint at @literal resvar[0].vars
- Array to store the operand variables of the constraint.len
- Store the number of operand variables of the constraint at @literal
len[0].constant
- Store the additional constant operand of the constraint at @literal
constant[0].
GRBException
public void getGenConstrAbs(GRBGenConstr genc, GRBVar[] resvar, GRBVar[] argvar) throws GRBException
genc
- The general constraint object.resvar
- Store the resultant variable of the constraint at @literal resvar[0].argvar
- Store the argument variable of the constraint at @literal resvar[0].
GRBException
public void getGenConstrAnd(GRBGenConstr genc, GRBVar[] resvar, GRBVar[] vars, int[] len) throws GRBException
genc
- The general constraint object.resvar
- Store the resultant variable of the constraint at @literal resvar[0].vars
- Array to store the operand variables of the constraint.len
- Store the number of operand variables of the constraint at @literal
len[0].
GRBException
public void getGenConstrOr(GRBGenConstr genc, GRBVar[] resvar, GRBVar[] vars, int[] len) throws GRBException
genc
- The general constraint object.resvar
- Store the resultant variable of the constraint at @literal resvar[0].vars
- Array to store the operand variables of the constraint.len
- Store the number of operand variables of the constraint at @literal
len[0].
GRBException
public void getGenConstrIndicator(GRBGenConstr genc, GRBVar[] binvar, int[] binval, GRBLinExpr[] expr, char[] sense, double[] rhs) throws GRBException
genc
- The general constraint object.binvar
- Store the binary indicator variable of the constraint at @literal
binvar[0].binval
- Store the value that the indicator variable has to take in order to
trigger the linear constraint at @literal binval[0].expr
- Create a @link GRBLinExpr GRBLinExpr object to store the left-hand
side expression of the linear constraint that is triggered by the
indicator at @literal expr[0].sense
- Store the sense for the linear constraint at @literal sense[0].
Options are @literal GRB.LESS_EQUAL, @literal GRB.EQUAL, or @literal
GRB.GREATER_EQUAL.rhs
- Store the right-hand side value for the linear constraint at @literal
rhs[0].
GRBException
public void getGenConstrPWL(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar, int[] npts, double[] xpts, double[] ypts) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.npts
- Store the number of points that define the piecewise-linear function.xpts
- The x values for the points that define the piecewise-linear function.ypts
- The y values for the points that define the piecewise-linear function.
GRBException
public void getGenConstrPoly(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar, int[] plen, double[] p) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.plen
- p
- The coefficients for polynomial function.
GRBException
public void getGenConstrExp(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.
GRBException
public void getGenConstrExpA(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar, double[] a) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.a
- Store the base of the function.
GRBException
public void getGenConstrLog(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.
GRBException
public void getGenConstrLogA(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar, double[] a) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.a
- Store the base of the function.
GRBException
public void getGenConstrPow(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar, double[] a) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.a
- Store the exponent of the function.
GRBException
public void getGenConstrSin(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.
GRBException
public void getGenConstrCos(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.
GRBException
public void getGenConstrTan(GRBGenConstr genc, GRBVar[] xvar, GRBVar[] yvar) throws GRBException
genc
- The general constraint object.xvar
- Store the x variable.yvar
- Store the y variable.
GRBException
public GRBQuadExpr getQCRow(GRBQConstr qc) throws GRBException
qc
- The quadratic constraint of interest.
GRBException
public void remove(gurobi.GRBSOS sos) throws GRBException
sos
- The SOS constraint to remove.
GRBException
public void remove(GRBQConstr qconstr) throws GRBException
qconstr
- The quadratic constraint to remove.
GRBException
public void remove(GRBGenConstr genconstr) throws GRBException
genconstr
- The general constraint to remove.
GRBException
public GRBEnv getEnv() throws GRBException
GRBException
public GRBEnv getConcurrentEnv(int num) throws GRBException
This method provides fine-grained control over the concurrent optimizer. By creating your own concurrent environments and setting appropriate parameters on these environments (e.g., the @literal Method parameter), you can control exactly which strategies the concurrent optimizer employs. For example, if you create two concurrent environments, and set @code Method to primal simplex for one and dual simplex for the other, subsequent concurrent optimizer runs will use the two simplex algorithms rather than the default choices.
Note that you must create contiguously numbered concurrent environments, starting with @code num=0. For example, if you want three concurrent environments, they must be numbered 0, 1, and 2.
Once you create concurrent environments, they will be used for every subsequent concurrent optimization on that model. Use @link GRBModel#discardConcurrentEnvs discardConcurrentEnvs to revert back to default concurrent optimizer behavior.
num
- The concurrent environment number.
GRBException
public void discardConcurrentEnvs() throws GRBException
The concurrent environments created by @link GRBModel#getConcurrentEnv getConcurrentEnv will be used by every subsequent call to the concurrent optimizer until the concurrent environments are discarded.
Use @link GRBModel#getMultiobjEnv getMultiobjEnv to create a multi- objective environment.
GRBException
public java.lang.String getJSONSolution() throws GRBException
GRBException
public GRBEnv getMultiobjEnv(int num) throws GRBException
num
- The objective index.
GRBException
public void discardMultiobjEnvs() throws GRBException
GRBException
public int get(GRB.IntParam param) throws GRBException
param
- The parameter being queried.
GRBException
public double get(GRB.DoubleParam param) throws GRBException
param
- The parameter being queried.
GRBException
public java.lang.String get(GRB.StringParam param) throws GRBException
param
- The parameter being queried.
GRBException
public void set(GRB.IntParam param, int newval) throws GRBException
The difference between setting a parameter on a model and setting it on an environment (i.e., through @link GRBEnv#set GRBEnv.set) is that the former modifies the parameter for a single model, while the latter modifies the parameter for every model that is subsequently built using that environment (and leaves the parameter unchanged for models that were previously built using that environment).
param
- The parameter being modified.newval
- The desired new value for the parameter.
GRBException
public void set(GRB.DoubleParam param, double newval) throws GRBException
The difference between setting a parameter on a model and setting it on an environment (i.e., through @link GRBEnv#set GRBEnv.set) is that the former modifies the parameter for a single model, while the latter modifies the parameter for every model that is subsequently built using that environment (and leaves the parameter unchanged for models that were previously built using that environment).
param
- The parameter being modified.newval
- The desired new value for the parameter.
GRBException
public void set(GRB.StringParam param, java.lang.String newval) throws GRBException
The difference between setting a parameter on a model and setting it on an environment (i.e., through @link GRBEnv#set GRBEnv.set) is that the former modifies the parameter for a single model, while the latter modifies the parameter for every model that is subsequently built using that environment (and leaves the parameter unchanged for models that were previously built using that environment).
param
- The parameter being modified.newval
- The desired new value for the parameter.
GRBException
public void set(java.lang.String param, java.lang.String newval) throws GRBException
The difference between setting a parameter on a model and setting it on an environment (i.e., through @link GRBEnv#set GRBEnv.set) is that the former modifies the parameter for a single model, while the latter modifies the parameter for every model that is subsequently built using that environment (and leaves the parameter unchanged for models that were previously built using that environment).
param
- The name of the parameter being modified.newval
- The desired new value for the parameter.
GRBException
public int get(GRB.IntAttr attr) throws GRBException
attr
- The attribute being queried.
GRBException
public double get(GRB.DoubleAttr attr) throws GRBException
attr
- The attribute being queried.
GRBException
public java.lang.String get(GRB.StringAttr attr) throws GRBException
attr
- The attribute being queried.
GRBException
public void set(GRB.IntAttr attr, int newval) throws GRBException
attr
- The attribute being modified.newval
- The desired new value for the attribute.
GRBException
public void set(GRB.DoubleAttr attr, double newval) throws GRBException
attr
- The attribute being modified.newval
- The desired new value for the attribute.
GRBException
public void set(GRB.StringAttr attr, java.lang.String newval) throws GRBException
attr
- The attribute being modified.newval
- The desired new value for the attribute.
GRBException
public int[] get(GRB.IntAttr attr, GRBVar[] vars) throws GRBException
attr
- The attribute being queried.vars
- The variables whose attribute values are being queried.
GRBException
public char[] get(GRB.CharAttr attr, GRBVar[] vars) throws GRBException
attr
- The attribute being queried.vars
- The variables whose attribute values are being queried.
GRBException
public double[] get(GRB.DoubleAttr attr, GRBVar[] vars) throws GRBException
attr
- The attribute being queried.vars
- The variables whose attribute values are being queried.
GRBException
public java.lang.String[] get(GRB.StringAttr attr, GRBVar[] vars) throws GRBException
attr
- The attribute being queried.vars
- The variables whose attribute values are being queried.
GRBException
public int[] get(GRB.IntAttr attr, GRBVar[] vars, int start, int len) throws GRBException
attr
- The attribute being queried.vars
- A one-dimensional array of variables whose attribute values are being
queried.start
- The index of the first variable of interest in the list.len
- The number of variables.
GRBException
public char[] get(GRB.CharAttr attr, GRBVar[] vars, int start, int len) throws GRBException
attr
- The attribute being queried.vars
- A one-dimensional array of variables whose attribute values are being
queried.start
- The index of the first variable of interest in the list.len
- The number of variables.
GRBException
public double[] get(GRB.DoubleAttr attr, GRBVar[] vars, int start, int len) throws GRBException
attr
- The attribute being queried.vars
- A one-dimensional array of variables whose attribute values are being
queried.start
- The index of the first variable of interest in the list.len
- The number of variables.
GRBException
public java.lang.String[] get(GRB.StringAttr attr, GRBVar[] vars, int start, int len) throws GRBException
attr
- The attribute being queried.vars
- A one-dimensional array of variables whose attribute values are being
queried.start
- The index of the first variable of interest in the list.len
- The number of variables.
GRBException
public int[][] get(GRB.IntAttr attr, GRBVar[][] vars) throws GRBException
attr
- The attribute being queried.vars
- A two-dimensional array of variables whose attribute values are being
queried.
GRBException
public char[][] get(GRB.CharAttr attr, GRBVar[][] vars) throws GRBException
attr
- The attribute being queried.vars
- A two-dimensional array of variables whose attribute values are being
queried.
GRBException
public double[][] get(GRB.DoubleAttr attr, GRBVar[][] vars) throws GRBException
attr
- The attribute being queried.vars
- A two-dimensional array of variables whose attribute values are being
queried.
GRBException
public java.lang.String[][] get(GRB.StringAttr attr, GRBVar[][] vars) throws GRBException
attr
- The attribute being queried.vars
- A two-dimensional array of variables whose attribute values are being
queried.
GRBException
public int[][][] get(GRB.IntAttr attr, GRBVar[][][] vars) throws GRBException
attr
- The attribute being queried.vars
- A three-dimensional array of variables whose attribute values are
being queried.
GRBException
public char[][][] get(GRB.CharAttr attr, GRBVar[][][] vars) throws GRBException
attr
- The attribute being queried.vars
- A three-dimensional array of variables whose attribute values are
being queried.
GRBException
public double[][][] get(GRB.DoubleAttr attr, GRBVar[][][] vars) throws GRBException
attr
- The attribute being queried.vars
- A three-dimensional array of variables whose attribute values are
being queried.
GRBException
public java.lang.String[][][] get(GRB.StringAttr attr, GRBVar[][][] vars) throws GRBException
attr
- The attribute being queried.vars
- A three-dimensional array of variables whose attribute values are
being queried.
GRBException
public int[] get(GRB.IntAttr attr, GRBConstr[] constrs) throws GRBException
attr
- The attribute being queried.constrs
- The constraints whose attribute values are being queried.
GRBException
public char[] get(GRB.CharAttr attr, GRBConstr[] constrs) throws GRBException
attr
- The attribute being queried.constrs
- The constraints whose attribute values are being queried.
GRBException
public double[] get(GRB.DoubleAttr attr, GRBConstr[] constrs) throws GRBException
attr
- The attribute being queried.constrs
- The constraints whose attribute values are being queried.
GRBException
public java.lang.String[] get(GRB.StringAttr attr, GRBConstr[] constrs) throws GRBException
attr
- The attribute being queried.constrs
- The constraints whose attribute values are being queried.
GRBException
public int[] get(GRB.IntAttr attr, GRBConstr[] constrs, int start, int len) throws GRBException
attr
- The attribute being queried.constrs
- A one-dimensional array of constraints whose attribute values are
being queried.start
- The index of the first constraint of interest in the list.len
- The number of constraints.
GRBException
public char[] get(GRB.CharAttr attr, GRBConstr[] constrs, int start, int len) throws GRBException
attr
- The attribute being queried.constrs
- A one-dimensional array of constraints whose attribute values are
being queried.start
- The index of the first constraint of interest in the list.len
- The number of constraints.
GRBException
public double[] get(GRB.DoubleAttr attr, GRBConstr[] constrs, int start, int len) throws GRBException
attr
- The attribute being queried.constrs
- A one-dimensional array of constraints whose attribute values are
being queried.start
- The first constraint of interest in the list.len
- The number of constraints.
GRBException
public java.lang.String[] get(GRB.StringAttr attr, GRBConstr[] constrs, int start, int len) throws GRBException
attr
- The attribute being queried.constrs
- A one-dimensional array of constraints whose attribute values are
being queried.start
- The index of the first constraint of interest in the list.len
- The number of constraints.
GRBException
public int[][] get(GRB.IntAttr attr, GRBConstr[][] constrs) throws GRBException
attr
- The attribute being queried.constrs
- A two-dimensional array of constraints whose attribute values are
being queried.
GRBException
public char[][] get(GRB.CharAttr attr, GRBConstr[][] constrs) throws GRBException
attr
- The attribute being queried.constrs
- A two-dimensional array of constraints whose attribute values are
being queried.
GRBException
public double[][] get(GRB.DoubleAttr attr, GRBConstr[][] constrs) throws GRBException
attr
- The attribute being queried.constrs
- A two-dimensional array of constraints whose attribute values are
being queried.
GRBException
public java.lang.String[][] get(GRB.StringAttr attr, GRBConstr[][] constrs) throws GRBException
attr
- The attribute being queried.constrs
- A two-dimensional array of constraints whose attribute values are
being queried.
GRBException
public int[][][] get(GRB.IntAttr attr, GRBConstr[][][] constrs) throws GRBException
attr
- The attribute being queried.constrs
- A three-dimensional array of constraints whose attribute values are
being queried.
GRBException
public char[][][] get(GRB.CharAttr attr, GRBConstr[][][] constrs) throws GRBException
attr
- The attribute being queried.constrs
- A three-dimensional array of constraints whose attribute values are
being queried.
GRBException
public double[][][] get(GRB.DoubleAttr attr, GRBConstr[][][] constrs) throws GRBException
attr
- The attribute being queried.constrs
- A three-dimensional array of constraints whose attribute values are
being queried.
GRBException
public java.lang.String[][][] get(GRB.StringAttr attr, GRBConstr[][][] constrs) throws GRBException
attr
- The attribute being queried.constrs
- A three-dimensional array of constraints whose attribute values are
being queried.
GRBException
public int[] get(GRB.IntAttr attr, GRBQConstr[] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- The quadratic constraints whose attribute values are being queried.
GRBException
public char[] get(GRB.CharAttr attr, GRBQConstr[] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- The quadratic constraints whose attribute values are being queried.
GRBException
public double[] get(GRB.DoubleAttr attr, GRBQConstr[] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- The quadratic constraints whose attribute values are being queried.
GRBException
public java.lang.String[] get(GRB.StringAttr attr, GRBQConstr[] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- The quadratic constraints whose attribute values are being queried.
GRBException
public int[] get(GRB.IntAttr attr, GRBQConstr[] qconstrs, int start, int len) throws GRBException
attr
- The attribute being queried.qconstrs
- A one-dimensional array of quadratic constraints whose attribute
values are being queried.start
- The index of the first quadratic constraint of interest in the list.len
- The number of quadratic constraints.
GRBException
public char[] get(GRB.CharAttr attr, GRBQConstr[] qconstrs, int start, int len) throws GRBException
attr
- The attribute being queried.qconstrs
- A one-dimensional array of quadratic constraints whose attribute
values are being queried.start
- The index of the first quadratic constraint of interest in the list.len
- The number of quadratic constraints.
GRBException
public double[] get(GRB.DoubleAttr attr, GRBQConstr[] qconstrs, int start, int len) throws GRBException
attr
- The attribute being queried.qconstrs
- A one-dimensional array of quadratic constraints whose attribute
values are being queried.start
- The first quadratic constraint of interest in the list.len
- The number of quadratic constraints.
GRBException
public java.lang.String[] get(GRB.StringAttr attr, GRBQConstr[] qconstrs, int start, int len) throws GRBException
attr
- The attribute being queried.qconstrs
- A one-dimensional array of quadratic constraints whose attribute
values are being queried.start
- The index of the first quadratic constraint of interest in the list.len
- The number of quadratic constraints.
GRBException
public int[][] get(GRB.IntAttr attr, GRBQConstr[][] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- A two-dimensional array of quadratic constraints whose attribute
values are being queried.
GRBException
public char[][] get(GRB.CharAttr attr, GRBQConstr[][] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- A two-dimensional array of quadratic constraints whose attribute
values are being queried.
GRBException
public double[][] get(GRB.DoubleAttr attr, GRBQConstr[][] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- A two-dimensional array of quadratic constraints whose attribute
values are being queried.
GRBException
public java.lang.String[][] get(GRB.StringAttr attr, GRBQConstr[][] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- A two-dimensional array of quadratic constraints whose attribute
values are being queried.
GRBException
public int[][][] get(GRB.IntAttr attr, GRBQConstr[][][] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- A three-dimensional array of quadratic constraints whose attribute
values are being queried.
GRBException
public char[][][] get(GRB.CharAttr attr, GRBQConstr[][][] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- A three-dimensional array of quadratic constraints whose attribute
values are being queried.
GRBException
public double[][][] get(GRB.DoubleAttr attr, GRBQConstr[][][] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- A three-dimensional array of quadratic constraints whose attribute
values are being queried.
GRBException
public java.lang.String[][][] get(GRB.StringAttr attr, GRBQConstr[][][] qconstrs) throws GRBException
attr
- The attribute being queried.qconstrs
- A three-dimensional array of quadratic constraints whose attribute
values are being queried.
GRBException
public int[] get(GRB.IntAttr attr, GRBGenConstr[] genconstrs) throws GRBException
attr
- The attribute being queried.genconstrs
- The general constraints whose attribute values are being queried.
GRBException
public java.lang.String[] get(GRB.StringAttr attr, GRBGenConstr[] genconstrs) throws GRBException
attr
- The attribute being queried.genconstrs
- The general constraints whose attribute values are being queried.
GRBException
public int[] get(GRB.IntAttr attr, GRBGenConstr[] genconstrs, int start, int len) throws GRBException
attr
- The attribute being queried.genconstrs
- A one-dimensional array of general constraints whose attribute values
are being queried.start
- The index of the first general constraint of interest in the list.len
- The number of general constraints.
GRBException
public java.lang.String[] get(GRB.StringAttr attr, GRBGenConstr[] genconstrs, int start, int len) throws GRBException
attr
- The attribute being queried.genconstrs
- A one-dimensional array of general constraints whose attribute values
are being queried.start
- The index of the first general constraint of interest in the list.len
- The number of general constraints.
GRBException
public int[][] get(GRB.IntAttr attr, GRBGenConstr[][] genconstrs) throws GRBException
attr
- The attribute being queried.genconstrs
- A two-dimensional array of general constraints whose attribute values
are being queried.
GRBException
public java.lang.String[][] get(GRB.StringAttr attr, GRBGenConstr[][] genconstrs) throws GRBException
attr
- The attribute being queried.genconstrs
- A two-dimensional array of general constraints whose attribute values
are being queried.
GRBException
public int[][][] get(GRB.IntAttr attr, GRBGenConstr[][][] genconstrs) throws GRBException
attr
- The attribute being queried.genconstrs
- A three-dimensional array of general constraints whose attribute
values are being queried.
GRBException
public java.lang.String[][][] get(GRB.StringAttr attr, GRBGenConstr[][][] genconstrs) throws GRBException
attr
- The attribute being queried.genconstrs
- A three-dimensional array of general constraints whose attribute
values are being queried.
GRBException
public void set(GRB.IntAttr attr, GRBVar[] vars, int[] newvals) throws GRBException
attr
- The attribute being modified.vars
- The variables whose attribute values are being modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.CharAttr attr, GRBVar[] vars, char[] newvals) throws GRBException
attr
- The attribute being modified.vars
- The variables whose attribute values are being modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.DoubleAttr attr, GRBVar[] vars, double[] newvals) throws GRBException
attr
- The attribute being modified.vars
- The variables whose attribute values are being modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.StringAttr attr, GRBVar[] vars, java.lang.String[] newvals) throws GRBException
attr
- The attribute being modified.vars
- The variables whose attribute values are being modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.IntAttr attr, GRBVar[] vars, int[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.vars
- A one-dimensional array of variables whose attribute values are being
modified.newvals
- The desired new values for the attribute for each input variable.start
- The index of the first variable of interest in the list.len
- The number of variables.
GRBException
public void set(GRB.CharAttr attr, GRBVar[] vars, char[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.vars
- A one-dimensional array of variables whose attribute values are being
modified.newvals
- The desired new values for the attribute for each input variable.start
- The index of the first variable of interest in the list.len
- The number of variables.
GRBException
public void set(GRB.DoubleAttr attr, GRBVar[] vars, double[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.vars
- A one-dimensional array of variables whose attribute values are being
modified.newvals
- The desired new values for the attribute for each input variable.start
- The index of the first variable of interest in the list.len
- The number of variables.
GRBException
public void set(GRB.StringAttr attr, GRBVar[] vars, java.lang.String[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.vars
- A one-dimensional array of variables whose attribute values are being
modified.newvals
- The desired new values for the attribute for each input variable.start
- The index of the first variable of interest in the list.len
- The number of variables.
GRBException
public void set(GRB.IntAttr attr, GRBVar[][] vars, int[][] newvals) throws GRBException
attr
- The attribute being modified.vars
- A two-dimensional array of variables whose attribute values are being
modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.CharAttr attr, GRBVar[][] vars, char[][] newvals) throws GRBException
attr
- The attribute being modified.vars
- A two-dimensional array of variables whose attribute values are being
modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.DoubleAttr attr, GRBVar[][] vars, double[][] newvals) throws GRBException
attr
- The attribute being modified.vars
- A two-dimensional array of variables whose attribute values are being
modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.StringAttr attr, GRBVar[][] vars, java.lang.String[][] newvals) throws GRBException
attr
- The attribute being modified.vars
- A two-dimensional array of variables whose attribute values are being
modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.IntAttr attr, GRBVar[][][] vars, int[][][] newvals) throws GRBException
attr
- The attribute being modified.vars
- A three-dimensional array of variables whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.CharAttr attr, GRBVar[][][] vars, char[][][] newvals) throws GRBException
attr
- The attribute being modified.vars
- A three-dimensional array of variables whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.DoubleAttr attr, GRBVar[][][] vars, double[][][] newvals) throws GRBException
attr
- The attribute being modified.vars
- A three-dimensional array of variables whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.StringAttr attr, GRBVar[][][] vars, java.lang.String[][][] newvals) throws GRBException
attr
- The attribute being modified.vars
- A three-dimensional array of variables whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input variable.
GRBException
public void set(GRB.IntAttr attr, GRBConstr[] constrs, int[] newvals) throws GRBException
attr
- The attribute being modified.constrs
- The constraints whose attribute values are being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.CharAttr attr, GRBConstr[] constrs, char[] newvals) throws GRBException
attr
- The attribute being modified.constrs
- The constraints whose attribute values are being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.DoubleAttr attr, GRBConstr[] constrs, double[] newvals) throws GRBException
attr
- The attribute being modified.constrs
- The constraints whose attribute values are being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.StringAttr attr, GRBConstr[] constrs, java.lang.String[] newvals) throws GRBException
attr
- The attribute being modified.constrs
- The constraints whose attribute values are being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.IntAttr attr, GRBConstr[] constrs, int[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.constrs
- A one-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.start
- The index of the first constraint of interest in the list.len
- The number of constraints.
GRBException
public void set(GRB.CharAttr attr, GRBConstr[] constrs, char[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.constrs
- A one-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.start
- The index of the first constraint of interest in the list.len
- The number of constraints.
GRBException
public void set(GRB.DoubleAttr attr, GRBConstr[] constrs, double[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.constrs
- A one-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.start
- The first constraint of interest in the list.len
- The number of constraints.
GRBException
public void set(GRB.StringAttr attr, GRBConstr[] constrs, java.lang.String[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.constrs
- A one-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.start
- The index of the first constraint of interest in the list.len
- The number of constraints.
GRBException
public void set(GRB.IntAttr attr, GRBConstr[][] constrs, int[][] newvals) throws GRBException
attr
- The attribute being modified.constrs
- A two-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.CharAttr attr, GRBConstr[][] constrs, char[][] newvals) throws GRBException
attr
- The attribute being modified.constrs
- A two-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.DoubleAttr attr, GRBConstr[][] constrs, double[][] newvals) throws GRBException
attr
- The attribute being modified.constrs
- A two-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.StringAttr attr, GRBConstr[][] constrs, java.lang.String[][] newvals) throws GRBException
attr
- The attribute being modified.constrs
- A two-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.IntAttr attr, GRBConstr[][][] constrs, int[][][] newvals) throws GRBException
attr
- The attribute being modified.constrs
- A three-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.CharAttr attr, GRBConstr[][][] constrs, char[][][] newvals) throws GRBException
attr
- The attribute being modified.constrs
- A three-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.DoubleAttr attr, GRBConstr[][][] constrs, double[][][] newvals) throws GRBException
attr
- The attribute being modified.constrs
- A three-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.StringAttr attr, GRBConstr[][][] constrs, java.lang.String[][][] newvals) throws GRBException
attr
- The attribute being modified.constrs
- A three-dimensional array of constraints whose attribute values are
being modified.newvals
- The desired new values for the attribute for each input constraint.
GRBException
public void set(GRB.CharAttr attr, GRBQConstr[] qconstrs, char[] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- The quadratic constraints whose attribute values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.DoubleAttr attr, GRBQConstr[] qconstrs, double[] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- The quadratic constraints whose attribute values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.StringAttr attr, GRBQConstr[] qconstrs, java.lang.String[] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- The quadratic constraints whose attribute values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.CharAttr attr, GRBQConstr[] qconstrs, char[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.qconstrs
- A one-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.start
- The index of the first quadratic constraint of interest in the list.len
- The number of quadratic constraints.
GRBException
public void set(GRB.DoubleAttr attr, GRBQConstr[] qconstrs, double[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.qconstrs
- A one-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.start
- The first quadratic constraint of interest in the list.len
- The number of quadratic constraints.
GRBException
public void set(GRB.StringAttr attr, GRBQConstr[] qconstrs, java.lang.String[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.qconstrs
- A one-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.start
- The index of the first quadratic constraint of interest in the list.len
- The number of quadratic constraints.
GRBException
public void set(GRB.CharAttr attr, GRBQConstr[][] qconstrs, char[][] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- A two-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.DoubleAttr attr, GRBQConstr[][] qconstrs, double[][] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- A two-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.StringAttr attr, GRBQConstr[][] qconstrs, java.lang.String[][] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- A two-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.CharAttr attr, GRBQConstr[][][] qconstrs, char[][][] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- A three-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.DoubleAttr attr, GRBQConstr[][][] qconstrs, double[][][] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- A three-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.StringAttr attr, GRBQConstr[][][] qconstrs, java.lang.String[][][] newvals) throws GRBException
attr
- The attribute being modified.qconstrs
- A three-dimensional array of quadratic constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input quadratic
constraint.
GRBException
public void set(GRB.StringAttr attr, GRBGenConstr[] genconstrs, java.lang.String[] newvals) throws GRBException
attr
- The attribute being modified.genconstrs
- The general constraints whose attribute values are being modified.newvals
- The desired new values for the attribute for each input general
constraint.
GRBException
public void set(GRB.StringAttr attr, GRBGenConstr[] genconstrs, java.lang.String[] newvals, int start, int len) throws GRBException
attr
- The attribute being modified.genconstrs
- A one-dimensional array of general constraints whose attribute values
are being modified.newvals
- The desired new values for the attribute for each input general
constraint.start
- The index of the first general constraint of interest in the list.len
- The number of general constraints.
GRBException
public void set(GRB.StringAttr attr, GRBGenConstr[][] genconstrs, java.lang.String[][] newvals) throws GRBException
attr
- The attribute being modified.genconstrs
- A two-dimensional array of general constraints whose attribute values
are being modified.newvals
- The desired new values for the attribute for each input general
constraint.
GRBException
public void set(GRB.StringAttr attr, GRBGenConstr[][][] genconstrs, java.lang.String[][][] newvals) throws GRBException
attr
- The attribute being modified.genconstrs
- A three-dimensional array of general constraints whose attribute
values are being modified.newvals
- The desired new values for the attribute for each input general
constraint.
GRBException
public void setCallback(GRBCallback cb)
Note that a model can only have a single callback method, so this call will replace an existing callback.
cb
- New callback object. To disable a previously set callback, call this
method with a null argument.public int FSolve(int blen, int[] bind, double[] bval, int[] xind, double[] xval) throws GRBException
GRBException
public int BinvColj(int col, int[] xind, double[] xval) throws GRBException
GRBException
public int Binvj(int j, int[] xind, double[] xval) throws GRBException
GRBException
public int BSolve(int blen, int[] bind, double[] bval, int[] xind, double[] xval) throws GRBException
GRBException
public int Binvi(int i, int[] xind, double[] xval) throws GRBException
GRBException
public int BinvRowi(int i, int[] xind, double[] xval) throws GRBException
GRBException
public void BasisHead(int[] bhead) throws GRBException
GRBException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |