|const char||**varnames )|
If your constraint matrix may contain more than 2 billion non-zero values, you should consider using the GRBXaddvars variant of this routine.
A non-zero return value indicates that a problem occurred while adding the variables. Refer to the Error Code table for a list of possible return values. Details on the error can be obtained by calling GRBgeterrormsg.
model: The model to which the new variables should be added.
numvars: The number of new variables to add.
numnz: The total number of non-zero coefficients in the new columns.
vbeg: Constraint matrix non-zero values are passed into this routine in Compressed Sparse Column (CSC) format. Each column in the constraint matrix is represented as a list of index-value pairs, where each index entry provides the constraint index for a non-zero coefficient, and each value entry provides the corresponding non-zero value. Each variable in the model has a vbeg, indicating the start position of the non-zeros for that variable in the vind and vval arrays. This routine requires columns to be stored contiguously, so the start position for a variable is the end position for the previous variable. To give an example, if vbeg = 10 and vbeg = 12, that would indicate that variable 2 has two non-zero values associated with it. Their constraint indices can be found in vind and vind, and the numerical values for those non-zeros can be found in vval and vval.
vind: Constraint indices associated with non-zero values. See the description of the vbeg argument for more information.
vval: Numerical values associated with constraint matrix non-zeros. See the description of the vbeg argument for more information.
obj: Objective coefficients for the new variables. This argument can be NULL, in which case the objective coefficients are set to 0.0.
lb: Lower bounds for the new variables. This argument can be NULL, in which case all variables get lower bounds of 0.0.
ub: Upper bounds for the new variables. This argument can be NULL, in which case all variables get infinite upper bounds.
vtype: Types for the variables. Options are GRB_CONTINUOUS, GRB_BINARY, GRB_INTEGER, GRB_SEMICONT, or GRB_SEMIINT. This argument can be NULL, in which case all variables are assumed to be continuous.
varnames: Names for the new variables. This argument can be NULL, in which case all variables are given default names.