Add new decision variables to a model.
| GRBVar[] | AddVars ( | int | count, |
| char | type ) |
count new decision variables to a model. All
associated attributes take their default values, except the
variable type, which is specified as an argument.
Arguments:
count: Number of variables to add.
type: Variable type for new variables (GRB.CONTINUOUS, GRB.BINARY, GRB.INTEGER, GRB.SEMICONT, or GRB.SEMIINT).
Return value:
Array of new variable objects.
| GRBVar[] | AddVars ( | double[] | lb, |
| double[] | ub, | ||
| double[] | obj, | ||
| char[] | type, | ||
| string[] | names ) |
Arguments:
lb: Lower bounds for new variables. Can be null, in which case the variables get lower bounds of 0.0.
ub: Upper bounds for new variables. Can be null, in which case the variables get infinite upper bounds.
obj: Objective coefficients for new variables. Can be null, in which case the variables get objective coefficients of 0.0.
type: Variable types for new variables (GRB.CONTINUOUS, GRB.BINARY, GRB.INTEGER, GRB.SEMICONT, or GRB.SEMIINT). Can be null, in which case the variables are assumed to be continuous.
names: Names for new variables. Can be null, in which case all variables are given default names.
Return value:
Array of new variable objects.
| GRBVar[] | AddVars ( | double[] | lb, |
| double[] | ub, | ||
| double[] | obj, | ||
| char[] | type, | ||
| string[] | names, | ||
| int | start, | ||
| int | len ) |
start and
len arguments allow you to specify which variables to add.
Arguments:
lb: Lower bounds for new variables. Can be null, in which case the variables get lower bounds of 0.0.
ub: Upper bounds for new variables. Can be null, in which case the variables get infinite upper bounds.
obj: Objective coefficients for new variables. Can be null, in which case the variables get objective coefficients of 0.0.
type: Variable types for new variables (GRB.CONTINUOUS, GRB.BINARY, GRB.INTEGER, GRB.SEMICONT, or GRB.SEMIINT). Can be null, in which case the variables are assumed to be continuous.
names: Names for new variables. Can be 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.
Return value:
Array of new variable objects.
| GRBVar[] | AddVars ( | double[] | lb, |
| double[] | ub, | ||
| double[] | obj, | ||
| char[] | type, | ||
| string[] | names, | ||
| GRBColumn[] | col ) |
Arguments:
lb: Lower bounds for new variables. Can be null, in which case the variables get lower bounds of 0.0.
ub: Upper bounds for new variables. Can be null, in which case the variables get infinite upper bounds.
obj: Objective coefficients for new variables. Can be null, in which case the variables get objective coefficients of 0.0.
type: Variable types for new variables (GRB.CONTINUOUS, GRB.BINARY, GRB.INTEGER, GRB.SEMICONT, or GRB.SEMIINT). Can be null, in which case the variables are assumed to be continuous.
names: Names for new variables. Can be 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.
Return value:
Array of new variable objects.