14 #ifndef OR_TOOLS_LINEAR_SOLVER_GUROBI_ENVIRONMENT_H_
15 #define OR_TOOLS_LINEAR_SOLVER_GUROBI_ENVIRONMENT_H_
17 #include "absl/status/status.h"
23 #define STDCALL __stdcall
30 typedef struct _GRBenv
GRBenv;
36 #define CB_ARGS GRBmodel *model, void *cbdata, int where, void *usrdata
37 extern std::function<int(
GRBmodel*,
int,
int*,
double*,
double,
double,
41 extern std::function<int(
GRBmodel*
model,
int numnz,
int* vind,
double* vval,
42 double obj,
double lb,
double ub,
char vtype,
46 extern std::function<int(
GRBmodel*,
int,
int,
int*,
int*,
double*,
double*,
47 double*,
double*,
char*,
char**)>
50 extern std::function<int(
GRBmodel*
model,
int numchgs,
int* cind,
int* vind,
55 extern std::function<int(
GRBmodel*,
const char*,
int,
char*)>
58 extern std::function<int(
GRBmodel*,
const char*,
int,
int,
double*)>
60 extern std::function<int(
GRBmodel*,
const char*,
int,
double*)>
66 extern std::function<int(
GRBmodel*,
const char*,
int,
int*)>
69 extern std::function<int(
GRBenv*,
GRBmodel**,
const char*,
int numvars,
double*,
70 double*,
double*,
char*,
char**)>
76 extern std::function<int(
GRBmodel*,
const char*,
int,
char)>
79 extern std::function<int(
GRBmodel*,
const char*,
int,
double)>
86 extern std::function<void(
int*,
int*,
int*)>
GRBversion;
88 extern std::function<int(
void* cbdata,
int where,
int what,
void* resultP)>
90 extern std::function<int(
void* cbdata,
int cutlen,
const int* cutind,
91 const double* cutval,
char cutsense,
double cutrhs)>
93 extern std::function<int(
void* cbdata,
int lazylen,
const int* lazyind,
94 const double* lazyval,
char lazysense,
double lazyrhs)>
96 extern std::function<int(
void* cbdata,
const double* solution,
double* objvalP)>
98 extern std::function<int(
GRBmodel*
model,
int numnz,
int* cind,
double* cval,
99 char sense,
double rhs,
const char* constrname)>
102 int binval,
int nvars,
const int* vars,
103 const double* vals,
char sense,
double rhs)>
105 extern std::function<int(
GRBmodel*
model,
const char* attrname,
int element,
111 extern std::function<int(
GRBenv* env,
const char* paramname,
const char*
value)>
113 extern std::function<int(
GRBmodel*
model,
int numsos,
int nummembers,
114 int* types,
int* beg,
int* ind,
double*
weight)>
117 extern std::function<int(
GRBmodel*
model,
int numlnz,
int* lind,
double* lval,
118 int numqnz,
int* qrow,
int* qcol,
double* qval,
119 char sense,
double rhs,
const char* QCname)>
122 int nvars,
const int* vars,
double constant)>
125 int nvars,
const int* vars,
double constant)>
131 int nvars,
const int* vars)>
134 int nvars,
const int* vars)>
136 extern std::function<int(
GRBmodel*
model,
int numqnz,
int* qrow,
int* qcol,
140 #define GRB_VERSION_MAJOR 9
141 #define GRB_VERSION_MINOR 0
142 #define GRB_VERSION_TECHNICAL 2
143 #define GRB_ERROR_OUT_OF_MEMORY 10001
144 #define GRB_ERROR_NULL_ARGUMENT 10002
145 #define GRB_ERROR_INVALID_ARGUMENT 10003
146 #define GRB_ERROR_UNKNOWN_ATTRIBUTE 10004
147 #define GRB_ERROR_DATA_NOT_AVAILABLE 10005
148 #define GRB_ERROR_INDEX_OUT_OF_RANGE 10006
149 #define GRB_ERROR_UNKNOWN_PARAMETER 10007
150 #define GRB_ERROR_VALUE_OUT_OF_RANGE 10008
151 #define GRB_ERROR_NO_LICENSE 10009
152 #define GRB_ERROR_SIZE_LIMIT_EXCEEDED 10010
153 #define GRB_ERROR_CALLBACK 10011
154 #define GRB_ERROR_FILE_READ 10012
155 #define GRB_ERROR_FILE_WRITE 10013
156 #define GRB_ERROR_NUMERIC 10014
157 #define GRB_ERROR_IIS_NOT_INFEASIBLE 10015
158 #define GRB_ERROR_NOT_FOR_MIP 10016
159 #define GRB_ERROR_OPTIMIZATION_IN_PROGRESS 10017
160 #define GRB_ERROR_DUPLICATES 10018
161 #define GRB_ERROR_NODEFILE 10019
162 #define GRB_ERROR_Q_NOT_PSD 10020
163 #define GRB_ERROR_QCP_EQUALITY_CONSTRAINT 10021
164 #define GRB_ERROR_NETWORK 10022
165 #define GRB_ERROR_JOB_REJECTED 10023
166 #define GRB_ERROR_NOT_SUPPORTED 10024
167 #define GRB_ERROR_EXCEED_2B_NONZEROS 10025
168 #define GRB_ERROR_INVALID_PIECEWISE_OBJ 10026
169 #define GRB_ERROR_UPDATEMODE_CHANGE 10027
170 #define GRB_ERROR_CLOUD 10028
171 #define GRB_ERROR_MODEL_MODIFICATION 10029
172 #define GRB_ERROR_CSWORKER 10030
173 #define GRB_ERROR_TUNE_MODEL_TYPES 10031
174 #define GRB_ERROR_SECURITY 10032
175 #define GRB_LESS_EQUAL '<'
176 #define GRB_GREATER_EQUAL '>'
177 #define GRB_EQUAL '='
178 #define GRB_CONTINUOUS 'C'
179 #define GRB_BINARY 'B'
180 #define GRB_INTEGER 'I'
181 #define GRB_SEMICONT 'S'
182 #define GRB_SEMIINT 'N'
183 #define GRB_MINIMIZE 1
184 #define GRB_MAXIMIZE -1
185 #define GRB_SOS_TYPE1 1
186 #define GRB_SOS_TYPE2 2
187 #define GRB_INFINITY 1e100
188 #define GRB_UNDEFINED 1e101
189 #define GRB_MAXINT 2000000000
190 #define GRB_MAX_NAMELEN 255
191 #define GRB_MAX_STRLEN 512
192 #define GRB_MAX_TAGLEN 10240
193 #define GRB_MAX_CONCURRENT 64
194 #define GRB_INT_ATTR_NUMCONSTRS "NumConstrs"
195 #define GRB_INT_ATTR_NUMVARS "NumVars"
196 #define GRB_INT_ATTR_NUMSOS "NumSOS"
197 #define GRB_INT_ATTR_NUMQCONSTRS \
200 #define GRB_INT_ATTR_NUMGENCONSTRS \
202 #define GRB_INT_ATTR_NUMNZS "NumNZs"
203 #define GRB_DBL_ATTR_DNUMNZS "DNumNZs"
204 #define GRB_INT_ATTR_NUMQNZS "NumQNZs"
205 #define GRB_INT_ATTR_NUMQCNZS "NumQCNZs"
206 #define GRB_INT_ATTR_NUMINTVARS "NumIntVars"
207 #define GRB_INT_ATTR_NUMBINVARS "NumBinVars"
208 #define GRB_INT_ATTR_NUMPWLOBJVARS \
210 #define GRB_STR_ATTR_MODELNAME "ModelName"
211 #define GRB_INT_ATTR_MODELSENSE "ModelSense"
212 #define GRB_DBL_ATTR_OBJCON "ObjCon"
213 #define GRB_INT_ATTR_IS_MIP "IsMIP"
214 #define GRB_INT_ATTR_IS_QP "IsQP"
215 #define GRB_INT_ATTR_IS_QCP "IsQCP"
216 #define GRB_INT_ATTR_IS_MULTIOBJ \
218 #define GRB_STR_ATTR_SERVER "Server"
219 #define GRB_STR_ATTR_JOBID "JobID"
220 #define GRB_INT_ATTR_LICENSE_EXPIRATION \
222 #define GRB_INT_ATTR_NUMTAGGED \
224 #define GRB_INT_ATTR_BATCHERRORCODE "BatchErrorCode"
225 #define GRB_STR_ATTR_BATCHERRORMESSAGE "BatchErrorMessage"
226 #define GRB_STR_ATTR_BATCHID "BatchID"
227 #define GRB_INT_ATTR_BATCHSTATUS "BatchStatus"
228 #define GRB_DBL_ATTR_LB "LB"
229 #define GRB_DBL_ATTR_UB "UB"
230 #define GRB_DBL_ATTR_OBJ "Obj"
231 #define GRB_CHAR_ATTR_VTYPE "VType"
232 #define GRB_DBL_ATTR_START "Start"
233 #define GRB_DBL_ATTR_PSTART "PStart"
234 #define GRB_INT_ATTR_BRANCHPRIORITY "BranchPriority"
235 #define GRB_STR_ATTR_VARNAME "VarName"
236 #define GRB_INT_ATTR_PWLOBJCVX "PWLObjCvx"
237 #define GRB_DBL_ATTR_VARHINTVAL "VarHintVal"
238 #define GRB_INT_ATTR_VARHINTPRI "VarHintPri"
239 #define GRB_INT_ATTR_PARTITION "Partition"
240 #define GRB_STR_ATTR_VTAG "VTag"
241 #define GRB_STR_ATTR_CTAG "CTag"
242 #define GRB_DBL_ATTR_RHS "RHS"
243 #define GRB_DBL_ATTR_DSTART "DStart"
244 #define GRB_CHAR_ATTR_SENSE "Sense"
245 #define GRB_STR_ATTR_CONSTRNAME "ConstrName"
246 #define GRB_INT_ATTR_LAZY "Lazy"
247 #define GRB_STR_ATTR_QCTAG "QCTag"
248 #define GRB_DBL_ATTR_QCRHS "QCRHS"
249 #define GRB_CHAR_ATTR_QCSENSE "QCSense"
250 #define GRB_STR_ATTR_QCNAME "QCName"
251 #define GRB_INT_ATTR_GENCONSTRTYPE \
253 #define GRB_STR_ATTR_GENCONSTRNAME \
255 #define GRB_INT_ATTR_FUNCPIECES \
258 #define GRB_DBL_ATTR_FUNCPIECEERROR \
260 #define GRB_DBL_ATTR_FUNCPIECELENGTH \
262 #define GRB_DBL_ATTR_FUNCPIECERATIO \
264 #define GRB_DBL_ATTR_MAX_COEFF "MaxCoeff"
265 #define GRB_DBL_ATTR_MIN_COEFF "MinCoeff"
266 #define GRB_DBL_ATTR_MAX_BOUND "MaxBound"
267 #define GRB_DBL_ATTR_MIN_BOUND "MinBound"
268 #define GRB_DBL_ATTR_MAX_OBJ_COEFF "MaxObjCoeff"
269 #define GRB_DBL_ATTR_MIN_OBJ_COEFF "MinObjCoeff"
270 #define GRB_DBL_ATTR_MAX_RHS "MaxRHS"
271 #define GRB_DBL_ATTR_MIN_RHS "MinRHS"
272 #define GRB_DBL_ATTR_MAX_QCCOEFF "MaxQCCoeff"
273 #define GRB_DBL_ATTR_MIN_QCCOEFF "MinQCCoeff"
274 #define GRB_DBL_ATTR_MAX_QOBJ_COEFF \
276 #define GRB_DBL_ATTR_MIN_QOBJ_COEFF \
278 #define GRB_DBL_ATTR_MAX_QCLCOEFF \
280 #define GRB_DBL_ATTR_MIN_QCLCOEFF \
282 #define GRB_DBL_ATTR_MAX_QCRHS "MaxQCRHS"
283 #define GRB_DBL_ATTR_MIN_QCRHS "MinQCRHS"
284 #define GRB_DBL_ATTR_RUNTIME "Runtime"
285 #define GRB_INT_ATTR_STATUS "Status"
286 #define GRB_DBL_ATTR_OBJVAL "ObjVal"
287 #define GRB_DBL_ATTR_OBJBOUND "ObjBound"
288 #define GRB_DBL_ATTR_OBJBOUNDC "ObjBoundC"
289 #define GRB_DBL_ATTR_POOLOBJBOUND \
291 #define GRB_DBL_ATTR_POOLOBJVAL \
293 #define GRB_DBL_ATTR_MIPGAP "MIPGap"
294 #define GRB_INT_ATTR_SOLCOUNT "SolCount"
295 #define GRB_DBL_ATTR_ITERCOUNT "IterCount"
296 #define GRB_INT_ATTR_BARITERCOUNT \
299 #define GRB_DBL_ATTR_NODECOUNT "NodeCount"
300 #define GRB_DBL_ATTR_OPENNODECOUNT \
303 #define GRB_INT_ATTR_HASDUALNORM "HasDualNorm"
304 #define GRB_DBL_ATTR_X "X"
305 #define GRB_DBL_ATTR_XN "Xn"
306 #define GRB_DBL_ATTR_BARX "BarX"
307 #define GRB_DBL_ATTR_RC "RC"
308 #define GRB_DBL_ATTR_VDUALNORM "VDualNorm"
309 #define GRB_INT_ATTR_VBASIS "VBasis"
310 #define GRB_DBL_ATTR_PI "Pi"
311 #define GRB_DBL_ATTR_QCPI "QCPi"
312 #define GRB_DBL_ATTR_SLACK "Slack"
313 #define GRB_DBL_ATTR_QCSLACK "QCSlack"
314 #define GRB_DBL_ATTR_CDUALNORM "CDualNorm"
315 #define GRB_INT_ATTR_CBASIS "CBasis"
316 #define GRB_DBL_ATTR_BOUND_VIO "BoundVio"
317 #define GRB_DBL_ATTR_BOUND_SVIO "BoundSVio"
318 #define GRB_INT_ATTR_BOUND_VIO_INDEX "BoundVioIndex"
319 #define GRB_INT_ATTR_BOUND_SVIO_INDEX "BoundSVioIndex"
320 #define GRB_DBL_ATTR_BOUND_VIO_SUM "BoundVioSum"
321 #define GRB_DBL_ATTR_BOUND_SVIO_SUM "BoundSVioSum"
322 #define GRB_DBL_ATTR_CONSTR_VIO "ConstrVio"
323 #define GRB_DBL_ATTR_CONSTR_SVIO "ConstrSVio"
324 #define GRB_INT_ATTR_CONSTR_VIO_INDEX "ConstrVioIndex"
325 #define GRB_INT_ATTR_CONSTR_SVIO_INDEX "ConstrSVioIndex"
326 #define GRB_DBL_ATTR_CONSTR_VIO_SUM "ConstrVioSum"
327 #define GRB_DBL_ATTR_CONSTR_SVIO_SUM "ConstrSVioSum"
328 #define GRB_DBL_ATTR_CONSTR_RESIDUAL "ConstrResidual"
329 #define GRB_DBL_ATTR_CONSTR_SRESIDUAL "ConstrSResidual"
330 #define GRB_INT_ATTR_CONSTR_RESIDUAL_INDEX "ConstrResidualIndex"
331 #define GRB_INT_ATTR_CONSTR_SRESIDUAL_INDEX "ConstrSResidualIndex"
332 #define GRB_DBL_ATTR_CONSTR_RESIDUAL_SUM "ConstrResidualSum"
333 #define GRB_DBL_ATTR_CONSTR_SRESIDUAL_SUM "ConstrSResidualSum"
334 #define GRB_DBL_ATTR_DUAL_VIO "DualVio"
335 #define GRB_DBL_ATTR_DUAL_SVIO "DualSVio"
336 #define GRB_INT_ATTR_DUAL_VIO_INDEX "DualVioIndex"
337 #define GRB_INT_ATTR_DUAL_SVIO_INDEX "DualSVioIndex"
338 #define GRB_DBL_ATTR_DUAL_VIO_SUM "DualVioSum"
339 #define GRB_DBL_ATTR_DUAL_SVIO_SUM "DualSVioSum"
340 #define GRB_DBL_ATTR_DUAL_RESIDUAL "DualResidual"
341 #define GRB_DBL_ATTR_DUAL_SRESIDUAL "DualSResidual"
342 #define GRB_INT_ATTR_DUAL_RESIDUAL_INDEX "DualResidualIndex"
343 #define GRB_INT_ATTR_DUAL_SRESIDUAL_INDEX "DualSResidualIndex"
344 #define GRB_DBL_ATTR_DUAL_RESIDUAL_SUM "DualResidualSum"
345 #define GRB_DBL_ATTR_DUAL_SRESIDUAL_SUM "DualSResidualSum"
346 #define GRB_DBL_ATTR_INT_VIO "IntVio"
347 #define GRB_INT_ATTR_INT_VIO_INDEX "IntVioIndex"
348 #define GRB_DBL_ATTR_INT_VIO_SUM "IntVioSum"
349 #define GRB_DBL_ATTR_COMPL_VIO "ComplVio"
350 #define GRB_INT_ATTR_COMPL_VIO_INDEX "ComplVioIndex"
351 #define GRB_DBL_ATTR_COMPL_VIO_SUM "ComplVioSum"
352 #define GRB_DBL_ATTR_KAPPA "Kappa"
353 #define GRB_DBL_ATTR_KAPPA_EXACT "KappaExact"
354 #define GRB_DBL_ATTR_N2KAPPA "N2Kappa"
355 #define GRB_DBL_ATTR_SA_OBJLOW "SAObjLow"
356 #define GRB_DBL_ATTR_SA_OBJUP "SAObjUp"
357 #define GRB_DBL_ATTR_SA_LBLOW "SALBLow"
358 #define GRB_DBL_ATTR_SA_LBUP "SALBUp"
359 #define GRB_DBL_ATTR_SA_UBLOW "SAUBLow"
360 #define GRB_DBL_ATTR_SA_UBUP "SAUBUp"
361 #define GRB_DBL_ATTR_SA_RHSLOW "SARHSLow"
362 #define GRB_DBL_ATTR_SA_RHSUP "SARHSUp"
363 #define GRB_INT_ATTR_IIS_MINIMAL "IISMinimal"
364 #define GRB_INT_ATTR_IIS_LB "IISLB"
365 #define GRB_INT_ATTR_IIS_UB "IISUB"
366 #define GRB_INT_ATTR_IIS_CONSTR "IISConstr"
367 #define GRB_INT_ATTR_IIS_SOS "IISSOS"
368 #define GRB_INT_ATTR_IIS_QCONSTR \
371 #define GRB_INT_ATTR_IIS_GENCONSTR \
373 #define GRB_INT_ATTR_TUNE_RESULTCOUNT "TuneResultCount"
374 #define GRB_DBL_ATTR_FARKASDUAL "FarkasDual"
375 #define GRB_DBL_ATTR_FARKASPROOF "FarkasProof"
376 #define GRB_DBL_ATTR_UNBDRAY "UnbdRay"
377 #define GRB_INT_ATTR_INFEASVAR "InfeasVar"
378 #define GRB_INT_ATTR_UNBDVAR "UnbdVar"
379 #define GRB_INT_ATTR_VARPRESTAT "VarPreStat"
380 #define GRB_DBL_ATTR_PREFIXVAL "PreFixVal"
381 #define GRB_DBL_ATTR_OBJN "ObjN"
382 #define GRB_DBL_ATTR_OBJNVAL \
384 #define GRB_DBL_ATTR_OBJNCON "ObjNCon"
385 #define GRB_DBL_ATTR_OBJNWEIGHT "ObjNWeight"
386 #define GRB_INT_ATTR_OBJNPRIORITY "ObjNPriority"
387 #define GRB_DBL_ATTR_OBJNRELTOL "ObjNRelTol"
388 #define GRB_DBL_ATTR_OBJNABSTOL "ObjNAbsTol"
389 #define GRB_STR_ATTR_OBJNNAME "ObjNName"
390 #define GRB_DBL_ATTR_SCENNLB "ScenNLB"
391 #define GRB_DBL_ATTR_SCENNUB "ScenNUB"
392 #define GRB_DBL_ATTR_SCENNOBJ "ScenNObj"
393 #define GRB_DBL_ATTR_SCENNRHS "ScenNRHS"
394 #define GRB_STR_ATTR_SCENNNAME "ScenNName"
395 #define GRB_DBL_ATTR_SCENNX "ScenNX"
396 #define GRB_DBL_ATTR_SCENNOBJBOUND \
398 #define GRB_DBL_ATTR_SCENNOBJVAL \
400 #define GRB_INT_ATTR_NUMOBJ "NumObj"
401 #define GRB_INT_ATTR_NUMSCENARIOS "NumScenarios"
402 #define GRB_INT_ATTR_NUMSTART "NumStart"
403 #define GRB_DBL_ATTR_Xn "Xn"
404 #define GRB_GENCONSTR_MAX 0
405 #define GRB_GENCONSTR_MIN 1
406 #define GRB_GENCONSTR_ABS 2
407 #define GRB_GENCONSTR_AND 3
408 #define GRB_GENCONSTR_OR 4
409 #define GRB_GENCONSTR_INDICATOR 5
410 #define GRB_GENCONSTR_PWL 6
411 #define GRB_GENCONSTR_POLY 7
412 #define GRB_GENCONSTR_EXP 8
413 #define GRB_GENCONSTR_EXPA 9
414 #define GRB_GENCONSTR_LOG 10
415 #define GRB_GENCONSTR_LOGA 11
416 #define GRB_GENCONSTR_POW 12
417 #define GRB_GENCONSTR_SIN 13
418 #define GRB_GENCONSTR_COS 14
419 #define GRB_GENCONSTR_TAN 15
420 #define GRB_CB_POLLING 0
421 #define GRB_CB_PRESOLVE 1
422 #define GRB_CB_SIMPLEX 2
424 #define GRB_CB_MIPSOL 4
425 #define GRB_CB_MIPNODE 5
426 #define GRB_CB_MESSAGE 6
427 #define GRB_CB_BARRIER 7
428 #define GRB_CB_MULTIOBJ 8
429 #define GRB_CB_PRE_COLDEL 1000
430 #define GRB_CB_PRE_ROWDEL 1001
431 #define GRB_CB_PRE_SENCHG 1002
432 #define GRB_CB_PRE_BNDCHG 1003
433 #define GRB_CB_PRE_COECHG 1004
434 #define GRB_CB_SPX_ITRCNT 2000
435 #define GRB_CB_SPX_OBJVAL 2001
436 #define GRB_CB_SPX_PRIMINF 2002
437 #define GRB_CB_SPX_DUALINF 2003
438 #define GRB_CB_SPX_ISPERT 2004
439 #define GRB_CB_MIP_OBJBST 3000
440 #define GRB_CB_MIP_OBJBND 3001
441 #define GRB_CB_MIP_NODCNT 3002
442 #define GRB_CB_MIP_SOLCNT 3003
443 #define GRB_CB_MIP_CUTCNT 3004
444 #define GRB_CB_MIP_NODLFT 3005
445 #define GRB_CB_MIP_ITRCNT 3006
446 #define GRB_CB_MIP_OBJBNDC 3007
447 #define GRB_CB_MIPSOL_SOL 4001
448 #define GRB_CB_MIPSOL_OBJ 4002
449 #define GRB_CB_MIPSOL_OBJBST 4003
450 #define GRB_CB_MIPSOL_OBJBND 4004
451 #define GRB_CB_MIPSOL_NODCNT 4005
452 #define GRB_CB_MIPSOL_SOLCNT 4006
453 #define GRB_CB_MIPSOL_OBJBNDC 4007
454 #define GRB_CB_MIPNODE_STATUS 5001
455 #define GRB_CB_MIPNODE_REL 5002
456 #define GRB_CB_MIPNODE_OBJBST 5003
457 #define GRB_CB_MIPNODE_OBJBND 5004
458 #define GRB_CB_MIPNODE_NODCNT 5005
459 #define GRB_CB_MIPNODE_SOLCNT 5006
460 #define GRB_CB_MIPNODE_BRVAR 5007
461 #define GRB_CB_MIPNODE_OBJBNDC 5008
462 #define GRB_CB_MSG_STRING 6001
463 #define GRB_CB_RUNTIME 6002
464 #define GRB_CB_BARRIER_ITRCNT 7001
465 #define GRB_CB_BARRIER_PRIMOBJ 7002
466 #define GRB_CB_BARRIER_DUALOBJ 7003
467 #define GRB_CB_BARRIER_PRIMINF 7004
468 #define GRB_CB_BARRIER_DUALINF 7005
469 #define GRB_CB_BARRIER_COMPL 7006
470 #define GRB_CB_MULTIOBJ_OBJCNT 8001
471 #define GRB_CB_MULTIOBJ_SOLCNT 8002
472 #define GRB_CB_MULTIOBJ_SOL 8003
473 #define GRB_FEASRELAX_LINEAR 0
474 #define GRB_FEASRELAX_QUADRATIC 1
475 #define GRB_FEASRELAX_CARDINALITY 2
477 #define GRB_OPTIMAL 2
478 #define GRB_INFEASIBLE 3
479 #define GRB_INF_OR_UNBD 4
480 #define GRB_UNBOUNDED 5
482 #define GRB_ITERATION_LIMIT 7
483 #define GRB_NODE_LIMIT 8
484 #define GRB_TIME_LIMIT 9
485 #define GRB_SOLUTION_LIMIT 10
486 #define GRB_INTERRUPTED 11
487 #define GRB_NUMERIC 12
488 #define GRB_SUBOPTIMAL 13
489 #define GRB_INPROGRESS 14
490 #define GRB_USER_OBJ_LIMIT 15
492 #define GRB_NONBASIC_LOWER -1
493 #define GRB_NONBASIC_UPPER -2
494 #define GRB_SUPERBASIC -3
495 #define GRB_INT_PAR_BARITERLIMIT "BarIterLimit"
496 #define GRB_DBL_PAR_CUTOFF "Cutoff"
497 #define GRB_DBL_PAR_ITERATIONLIMIT "IterationLimit"
498 #define GRB_DBL_PAR_NODELIMIT "NodeLimit"
499 #define GRB_INT_PAR_SOLUTIONLIMIT "SolutionLimit"
500 #define GRB_DBL_PAR_TIMELIMIT "TimeLimit"
501 #define GRB_DBL_PAR_BESTOBJSTOP "BestObjStop"
502 #define GRB_DBL_PAR_BESTBDSTOP "BestBdStop"
503 #define GRB_DBL_PAR_FEASIBILITYTOL "FeasibilityTol"
504 #define GRB_DBL_PAR_INTFEASTOL "IntFeasTol"
505 #define GRB_DBL_PAR_MARKOWITZTOL "MarkowitzTol"
506 #define GRB_DBL_PAR_MIPGAP "MIPGap"
507 #define GRB_DBL_PAR_MIPGAPABS "MIPGapAbs"
508 #define GRB_DBL_PAR_OPTIMALITYTOL "OptimalityTol"
509 #define GRB_DBL_PAR_PSDTOL "PSDTol"
510 #define GRB_INT_PAR_METHOD "Method"
511 #define GRB_DBL_PAR_PERTURBVALUE "PerturbValue"
512 #define GRB_DBL_PAR_OBJSCALE "ObjScale"
513 #define GRB_INT_PAR_SCALEFLAG "ScaleFlag"
514 #define GRB_INT_PAR_SIMPLEXPRICING "SimplexPricing"
515 #define GRB_INT_PAR_QUAD "Quad"
516 #define GRB_INT_PAR_NORMADJUST "NormAdjust"
517 #define GRB_INT_PAR_SIFTING "Sifting"
518 #define GRB_INT_PAR_SIFTMETHOD "SiftMethod"
519 #define GRB_DBL_PAR_BARCONVTOL "BarConvTol"
520 #define GRB_INT_PAR_BARCORRECTORS "BarCorrectors"
521 #define GRB_INT_PAR_BARHOMOGENEOUS "BarHomogeneous"
522 #define GRB_INT_PAR_BARORDER "BarOrder"
523 #define GRB_DBL_PAR_BARQCPCONVTOL "BarQCPConvTol"
524 #define GRB_INT_PAR_CROSSOVER "Crossover"
525 #define GRB_INT_PAR_CROSSOVERBASIS "CrossoverBasis"
526 #define GRB_INT_PAR_BRANCHDIR "BranchDir"
527 #define GRB_INT_PAR_DEGENMOVES "DegenMoves"
528 #define GRB_INT_PAR_DISCONNECTED "Disconnected"
529 #define GRB_DBL_PAR_HEURISTICS "Heuristics"
530 #define GRB_DBL_PAR_IMPROVESTARTGAP "ImproveStartGap"
531 #define GRB_DBL_PAR_IMPROVESTARTTIME "ImproveStartTime"
532 #define GRB_DBL_PAR_IMPROVESTARTNODES "ImproveStartNodes"
533 #define GRB_INT_PAR_MINRELNODES "MinRelNodes"
534 #define GRB_INT_PAR_MIPFOCUS "MIPFocus"
535 #define GRB_STR_PAR_NODEFILEDIR "NodefileDir"
536 #define GRB_DBL_PAR_NODEFILESTART "NodefileStart"
537 #define GRB_INT_PAR_NODEMETHOD "NodeMethod"
538 #define GRB_INT_PAR_NORELHEURISTIC "NoRelHeuristic"
539 #define GRB_INT_PAR_PUMPPASSES "PumpPasses"
540 #define GRB_INT_PAR_RINS "RINS"
541 #define GRB_STR_PAR_SOLFILES "SolFiles"
542 #define GRB_INT_PAR_STARTNODELIMIT "StartNodeLimit"
543 #define GRB_INT_PAR_SUBMIPNODES "SubMIPNodes"
544 #define GRB_INT_PAR_SYMMETRY "Symmetry"
545 #define GRB_INT_PAR_VARBRANCH "VarBranch"
546 #define GRB_INT_PAR_SOLUTIONNUMBER "SolutionNumber"
547 #define GRB_INT_PAR_ZEROOBJNODES "ZeroObjNodes"
548 #define GRB_INT_PAR_CUTS "Cuts"
549 #define GRB_INT_PAR_CLIQUECUTS "CliqueCuts"
550 #define GRB_INT_PAR_COVERCUTS "CoverCuts"
551 #define GRB_INT_PAR_FLOWCOVERCUTS "FlowCoverCuts"
552 #define GRB_INT_PAR_FLOWPATHCUTS "FlowPathCuts"
553 #define GRB_INT_PAR_GUBCOVERCUTS "GUBCoverCuts"
554 #define GRB_INT_PAR_IMPLIEDCUTS "ImpliedCuts"
555 #define GRB_INT_PAR_PROJIMPLIEDCUTS "ProjImpliedCuts"
556 #define GRB_INT_PAR_MIPSEPCUTS "MIPSepCuts"
557 #define GRB_INT_PAR_MIRCUTS "MIRCuts"
558 #define GRB_INT_PAR_STRONGCGCUTS "StrongCGCuts"
559 #define GRB_INT_PAR_MODKCUTS "ModKCuts"
560 #define GRB_INT_PAR_ZEROHALFCUTS "ZeroHalfCuts"
561 #define GRB_INT_PAR_NETWORKCUTS "NetworkCuts"
562 #define GRB_INT_PAR_SUBMIPCUTS "SubMIPCuts"
563 #define GRB_INT_PAR_INFPROOFCUTS "InfProofCuts"
564 #define GRB_INT_PAR_RLTCUTS "RLTCuts"
565 #define GRB_INT_PAR_RELAXLIFTCUTS "RelaxLiftCuts"
566 #define GRB_INT_PAR_BQPCUTS "BQPCuts"
567 #define GRB_INT_PAR_CUTAGGPASSES "CutAggPasses"
568 #define GRB_INT_PAR_CUTPASSES "CutPasses"
569 #define GRB_INT_PAR_GOMORYPASSES "GomoryPasses"
570 #define GRB_STR_PAR_WORKERPOOL "WorkerPool"
571 #define GRB_STR_PAR_WORKERPASSWORD "WorkerPassword"
572 #define GRB_STR_PAR_COMPUTESERVER "ComputeServer"
573 #define GRB_STR_PAR_TOKENSERVER "TokenServer"
574 #define GRB_STR_PAR_SERVERPASSWORD "ServerPassword"
575 #define GRB_INT_PAR_SERVERTIMEOUT "ServerTimeout"
576 #define GRB_STR_PAR_CSROUTER "CSRouter"
577 #define GRB_STR_PAR_CSGROUP "CSGroup"
578 #define GRB_DBL_PAR_CSQUEUETIMEOUT "CSQueueTimeout"
579 #define GRB_INT_PAR_CSPRIORITY "CSPriority"
580 #define GRB_INT_PAR_CSIDLETIMEOUT "CSIdleTimeout"
581 #define GRB_INT_PAR_CSTLSINSECURE "CSTLSInsecure"
582 #define GRB_INT_PAR_TSPORT "TSPort"
583 #define GRB_STR_PAR_CLOUDACCESSID "CloudAccessID"
584 #define GRB_STR_PAR_CLOUDSECRETKEY "CloudSecretKey"
585 #define GRB_STR_PAR_CLOUDPOOL "CloudPool"
586 #define GRB_STR_PAR_CLOUDHOST "CloudHost"
587 #define GRB_STR_PAR_CSMANAGER "CSManager"
588 #define GRB_STR_PAR_CSAUTHTOKEN "CSAuthToken"
589 #define GRB_STR_PAR_CSAPIACCESSID "CSAPIAccessID"
590 #define GRB_STR_PAR_CSAPISECRET "CSAPISecret"
591 #define GRB_INT_PAR_CSBATCHMODE "CSBatchMode"
592 #define GRB_STR_PAR_USERNAME "Username"
593 #define GRB_STR_PAR_CSAPPNAME "CSAppName"
594 #define GRB_INT_PAR_CSCLIENTLOG "CSClientLog"
595 #define GRB_INT_PAR_AGGREGATE "Aggregate"
596 #define GRB_INT_PAR_AGGFILL "AggFill"
597 #define GRB_INT_PAR_CONCURRENTMIP "ConcurrentMIP"
598 #define GRB_INT_PAR_CONCURRENTJOBS "ConcurrentJobs"
599 #define GRB_INT_PAR_DISPLAYINTERVAL "DisplayInterval"
600 #define GRB_INT_PAR_DISTRIBUTEDMIPJOBS "DistributedMIPJobs"
601 #define GRB_INT_PAR_DUALREDUCTIONS "DualReductions"
602 #define GRB_DBL_PAR_FEASRELAXBIGM "FeasRelaxBigM"
603 #define GRB_INT_PAR_IISMETHOD "IISMethod"
604 #define GRB_INT_PAR_INFUNBDINFO "InfUnbdInfo"
605 #define GRB_INT_PAR_JSONSOLDETAIL "JSONSolDetail"
606 #define GRB_INT_PAR_LAZYCONSTRAINTS "LazyConstraints"
607 #define GRB_STR_PAR_LOGFILE "LogFile"
608 #define GRB_INT_PAR_LOGTOCONSOLE "LogToConsole"
609 #define GRB_INT_PAR_MIQCPMETHOD "MIQCPMethod"
610 #define GRB_INT_PAR_NONCONVEX "NonConvex"
611 #define GRB_INT_PAR_NUMERICFOCUS "NumericFocus"
612 #define GRB_INT_PAR_OUTPUTFLAG "OutputFlag"
613 #define GRB_INT_PAR_PRECRUSH "PreCrush"
614 #define GRB_INT_PAR_PREDEPROW "PreDepRow"
615 #define GRB_INT_PAR_PREDUAL "PreDual"
616 #define GRB_INT_PAR_PREPASSES "PrePasses"
617 #define GRB_INT_PAR_PREQLINEARIZE "PreQLinearize"
618 #define GRB_INT_PAR_PRESOLVE "Presolve"
619 #define GRB_DBL_PAR_PRESOS1BIGM "PreSOS1BigM"
620 #define GRB_DBL_PAR_PRESOS2BIGM "PreSOS2BigM"
621 #define GRB_INT_PAR_PRESPARSIFY "PreSparsify"
622 #define GRB_INT_PAR_PREMIQCPFORM "PreMIQCPForm"
623 #define GRB_INT_PAR_QCPDUAL "QCPDual"
624 #define GRB_INT_PAR_RECORD "Record"
625 #define GRB_STR_PAR_RESULTFILE "ResultFile"
626 #define GRB_INT_PAR_SEED "Seed"
627 #define GRB_INT_PAR_THREADS "Threads"
628 #define GRB_DBL_PAR_TUNETIMELIMIT "TuneTimeLimit"
629 #define GRB_INT_PAR_TUNERESULTS "TuneResults"
630 #define GRB_INT_PAR_TUNECRITERION "TuneCriterion"
631 #define GRB_INT_PAR_TUNETRIALS "TuneTrials"
632 #define GRB_INT_PAR_TUNEOUTPUT "TuneOutput"
633 #define GRB_INT_PAR_TUNEJOBS "TuneJobs"
634 #define GRB_INT_PAR_UPDATEMODE "UpdateMode"
635 #define GRB_INT_PAR_OBJNUMBER "ObjNumber"
636 #define GRB_INT_PAR_MULTIOBJMETHOD "MultiObjMethod"
637 #define GRB_INT_PAR_MULTIOBJPRE "MultiObjPre"
638 #define GRB_INT_PAR_SCENARIONUMBER "ScenarioNumber"
639 #define GRB_INT_PAR_POOLSOLUTIONS "PoolSolutions"
640 #define GRB_DBL_PAR_POOLGAP "PoolGap"
641 #define GRB_INT_PAR_POOLSEARCHMODE "PoolSearchMode"
642 #define GRB_INT_PAR_IGNORENAMES "IgnoreNames"
643 #define GRB_INT_PAR_STARTNUMBER "StartNumber"
644 #define GRB_INT_PAR_PARTITIONPLACE "PartitionPlace"
645 #define GRB_INT_PAR_FUNCPIECES "FuncPieces"
646 #define GRB_DBL_PAR_FUNCPIECELENGTH "FuncPieceLength"
647 #define GRB_DBL_PAR_FUNCPIECEERROR "FuncPieceError"
648 #define GRB_DBL_PAR_FUNCPIECERATIO "FuncPieceRatio"
649 #define GRB_DBL_PAR_FUNCMAXVAL "FuncMaxVal"
650 #define GRB_STR_PAR_DUMMY "Dummy"
651 #define GRB_STR_PAR_JOBID "JobID"
652 #define GRB_CUTS_AUTO -1
653 #define GRB_CUTS_OFF 0
654 #define GRB_CUTS_CONSERVATIVE 1
655 #define GRB_CUTS_AGGRESSIVE 2
656 #define GRB_CUTS_VERYAGGRESSIVE 3
657 #define GRB_PRESOLVE_AUTO -1
658 #define GRB_PRESOLVE_OFF 0
659 #define GRB_PRESOLVE_CONSERVATIVE 1
660 #define GRB_PRESOLVE_AGGRESSIVE 2
661 #define GRB_METHOD_AUTO -1
662 #define GRB_METHOD_PRIMAL 0
663 #define GRB_METHOD_DUAL 1
664 #define GRB_METHOD_BARRIER 2
665 #define GRB_METHOD_CONCURRENT 3
666 #define GRB_METHOD_DETERMINISTIC_CONCURRENT 4
667 #define GRB_METHOD_DETERMINISTIC_CONCURRENT_SIMPLEX 5
668 #define GRB_BARHOMOGENEOUS_AUTO -1
669 #define GRB_BARHOMOGENEOUS_OFF 0
670 #define GRB_BARHOMOGENEOUS_ON 1
671 #define GRB_MIPFOCUS_BALANCED 0
672 #define GRB_MIPFOCUS_FEASIBILITY 1
673 #define GRB_MIPFOCUS_OPTIMALITY 2
674 #define GRB_MIPFOCUS_BESTBOUND 3
675 #define GRB_BARORDER_AUTOMATIC -1
676 #define GRB_BARORDER_AMD 0
677 #define GRB_BARORDER_NESTEDDISSECTION 1
678 #define GRB_SIMPLEXPRICING_AUTO -1
679 #define GRB_SIMPLEXPRICING_PARTIAL 0
680 #define GRB_SIMPLEXPRICING_STEEPEST_EDGE 1
681 #define GRB_SIMPLEXPRICING_DEVEX 2
682 #define GRB_SIMPLEXPRICING_STEEPEST_QUICK 3
683 #define GRB_VARBRANCH_AUTO -1
684 #define GRB_VARBRANCH_PSEUDO_REDUCED 0
685 #define GRB_VARBRANCH_PSEUDO_SHADOW 1
686 #define GRB_VARBRANCH_MAX_INFEAS 2
687 #define GRB_VARBRANCH_STRONG 3
688 #define GRB_PARTITION_EARLY 16
689 #define GRB_PARTITION_ROOTSTART 8
690 #define GRB_PARTITION_ROOTEND 4
691 #define GRB_PARTITION_NODES 2
692 #define GRB_PARTITION_CLEANUP 1
693 #define GRB_BATCH_STATUS_UNKNOWN 0
694 #define GRB_BATCH_CREATED 1
695 #define GRB_BATCH_SUBMITTED 2
696 #define GRB_BATCH_ABORTED 3
697 #define GRB_BATCH_FAILED 4
698 #define GRB_BATCH_COMPLETED 5
struct _GRBmodel GRBmodel
The vehicle routing library lets one model and solve generic vehicle routing problems ranging from th...
std::function< int(GRBenv *, GRBmodel **, const char *, int numvars, double *, double *, double *, char *, char **)> GRBnewmodel
std::function< void(int *, int *, int *)> GRBversion
std::function< int(GRBmodel *model, const char *name, int resvar, int nvars, const int *vars, double constant)> GRBaddgenconstrMin
std::function< int(GRBmodel *model, int numnz, int *cind, double *cval, char sense, double rhs, const char *constrname)> GRBaddconstr
std::function< int(GRBmodel *model, int numlnz, int *lind, double *lval, int numqnz, int *qrow, int *qcol, double *qval, char sense, double rhs, const char *QCname)> GRBaddqconstr
std::function< int(GRBmodel *model, int numnz, int *vind, double *vval, double obj, double lb, double ub, char vtype, const char *varname)> GRBaddvar
std::function< void(GRBenv *)> GRBfreeenv
std::function< int(GRBmodel *, const char *, int, char)> GRBsetcharattrelement
std::function< char *(GRBenv *)> GRBgeterrormsg
std::function< int(GRBmodel *, const char *, int)> GRBsetintattr
std::function< int(GRBmodel *, const char *)> GRBwrite
std::function< int(GRBenv *env, const char *paramname, const char *value)> GRBsetparam
std::function< int(GRBmodel *model, int(STDCALL *cb)(CB_ARGS), void *usrdata)> GRBsetcallbackfunc
std::function< int(void *cbdata, int lazylen, const int *lazyind, const double *lazyval, char lazysense, double lazyrhs)> GRBcblazy
std::function< int(GRBenv *, const char *)> GRBreadparams
std::function< int(GRBmodel *model, const char *name, int resvar, int argvar)> GRBaddgenconstrAbs
std::function< int(void *cbdata, int where, int what, void *resultP)> GRBcbget
std::function< int(GRBmodel *, const char *, int *)> GRBgetintattr
std::function< int(GRBmodel *, const char *, int, int *)> GRBgetintattrelement
std::function< int(GRBenv *, const char *, double)> GRBsetdblparam
std::function< void(GRBmodel *)> GRBterminate
std::function< int(GRBenv *dest, GRBenv *src)> GRBcopyparams
std::function< int(GRBmodel *, const char *, double)> GRBsetdblattr
std::function< int(GRBmodel *)> GRBoptimize
std::function< int(GRBmodel *)> GRBupdatemodel
std::function< int(GRBmodel *model, int numqnz, int *qrow, int *qcol, double *qval)> GRBaddqpterms
std::function< int(GRBmodel *model, const char *name, int resvar, int nvars, const int *vars, double constant)> GRBaddgenconstrMax
std::function< int(GRBmodel *)> GRBfreemodel
std::function< int(GRBmodel *, const char *, int, int, double *)> GRBgetdblattrarray
std::function< int(GRBmodel *, int, int, int *, int *, double *, double *, double *, double *, char *, char **)> GRBaddvars
std::function< int(GRBmodel *, const char *, int, char *)> GRBgetcharattrelement
std::function< int(GRBenv *)> GRBresetparams
std::function< int(GRBmodel *model, const char *name, int resvar, int nvars, const int *vars)> GRBaddgenconstrAnd
std::function< int(GRBmodel *model, const char *attrname, int element, int newvalue)> GRBsetintattrelement
std::function< int(GRBmodel *model, const char *name, int resvar, int nvars, const int *vars)> GRBaddgenconstrOr
std::function< int(GRBmodel *model, int numchgs, int *cind, int *vind, double *val)> GRBchgcoeffs
std::function< int(void *cbdata, const double *solution, double *objvalP)> GRBcbsolution
std::function< int(GRBenv *, const char *, double *)> GRBgetdblparam
std::function< int(GRBmodel *, const char *, double *)> GRBgetdblattr
absl::Status LoadGurobiEnvironment(GRBenv **env)
std::function< int(GRBmodel *, const char *, int, double)> GRBsetdblattrelement
std::function< int(GRBmodel *, const char *, int, double *)> GRBgetdblattrelement
std::function< int(GRBmodel *model, int numsos, int nummembers, int *types, int *beg, int *ind, double *weight)> GRBaddsos
std::function< int(void *cbdata, int cutlen, const int *cutind, const double *cutval, char cutsense, double cutrhs)> GRBcbcut
std::function< GRBenv *(GRBmodel *)> GRBgetenv
std::function< int(GRBenv **, const char *)> GRBloadenv
std::function< int(GRBmodel *model, const char *name, int binvar, int binval, int nvars, const int *vars, const double *vals, char sense, double rhs)> GRBaddgenconstrIndicator
std::function< int(GRBmodel *, int, int *, double *, double, double, const char *)> GRBaddrangeconstr
std::function< int(GRBenv *, const char *, int)> GRBsetintparam