Hi Jason,
You can browse the examples online here:
http://gurobi.com/documentation/4.6/example-tour/
The example files are included in the installation under
/path/to/gurobi461/arch/examples. For example, with win64 and the
default installation path, the examples would be located in the
directory C:\gurobi461\win64\examples.
It looks like you are trying to call the GRBgetconstrs() function
associated with the C API. If you are using C++, you should call
getConstrs() from the C++ API. The documentation for that function is
here:
http://gurobi.com/documentation/4.6/reference-manual/node123
Note that this function returns a GRBConstr object. To get access to
the GRBLinExpr associated with that constraint you will need to use
getRow() described here:
http://gurobi.com/documentation/4.6/reference-manual/node126
Thanks,
Chris
Hi Jason,
The error 10003 corresponds to GRB_ERROR_INVALID_ARGUMENT. You are
probably getting this error because the argument i to getConstr() is
greater than the number of rows (or constraints) in your model. You
need to add the constraints to the model before adding a term to a
column.
If you wish to create your model by defining the nonzeros in each
column, rather than defining constraints, you might want to use the C
matrix interface. The C function GRBaddvar() might be what you are
looking for:
http://gurobi.com/documentation/4.6/reference-manual/node15
Chris