Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
environment.h
Go to the documentation of this file.
1// Copyright 2010-2024 Google LLC
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6// http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14#ifndef OR_TOOLS_GUROBI_ENVIRONMENT_H_
15#define OR_TOOLS_GUROBI_ENVIRONMENT_H_
16
17#include "absl/flags/declare.h"
18#include "absl/flags/flag.h"
19#include "absl/status/status.h"
20#include "absl/status/statusor.h"
23
24#if defined(_MSC_VER)
25#define GUROBI_STDCALL __stdcall
26#else
27#define GUROBI_STDCALL
28#endif
29
30extern "C" {
31typedef struct _GRBmodel GRBmodel;
32typedef struct _GRBenv GRBenv;
33typedef struct _GRBsvec {
34 int len;
35 int* ind;
36 double* val;
38}
39
40namespace operations_research {
41
42absl::StatusOr<GRBenv*> GetGurobiEnv();
43
44// This returns true if the Gurobi shared library is properly loaded (otherwise,
45// tries to find it and load it) and if a Gurobi license can be obtained (it
46// does that by trying to grab a license and then release it).
48
49// clang-format off
50// Force the loading of the gurobi dynamic library. It returns true if the
51// library was successfully loaded. This method can only be called once.
52// Successive calls are no-op.
53//
54// Note that it does not check if a token license can be grabbed.
55absl::Status LoadGurobiDynamicLibrary(std::vector<std::string> potential_paths);
56
57// The list of #define and extern std::function<> below is generated directly
58// from gurobi_c.h via parse_header.py
59// See the top comment on the parse_header.py file.
60// This is the header section
61
62#define GRB_VERSION_MAJOR 10
63#define GRB_VERSION_MINOR 0
64#define GRB_VERSION_TECHNICAL 0
65#define DEFAULT_CS_PRIORITY 0
66#define MAX_CS_PRIORITY 100
67#define DEFAULT_CS_PORT 61000
68#define DEFAULT_CS_HANGUP 60
69#define GRB_ERROR_OUT_OF_MEMORY 10001
70#define GRB_ERROR_NULL_ARGUMENT 10002
71#define GRB_ERROR_INVALID_ARGUMENT 10003
72#define GRB_ERROR_UNKNOWN_ATTRIBUTE 10004
73#define GRB_ERROR_DATA_NOT_AVAILABLE 10005
74#define GRB_ERROR_INDEX_OUT_OF_RANGE 10006
75#define GRB_ERROR_UNKNOWN_PARAMETER 10007
76#define GRB_ERROR_VALUE_OUT_OF_RANGE 10008
77#define GRB_ERROR_NO_LICENSE 10009
78#define GRB_ERROR_SIZE_LIMIT_EXCEEDED 10010
79#define GRB_ERROR_CALLBACK 10011
80#define GRB_ERROR_FILE_READ 10012
81#define GRB_ERROR_FILE_WRITE 10013
82#define GRB_ERROR_NUMERIC 10014
83#define GRB_ERROR_IIS_NOT_INFEASIBLE 10015
84#define GRB_ERROR_NOT_FOR_MIP 10016
85#define GRB_ERROR_OPTIMIZATION_IN_PROGRESS 10017
86#define GRB_ERROR_DUPLICATES 10018
87#define GRB_ERROR_NODEFILE 10019
88#define GRB_ERROR_Q_NOT_PSD 10020
89#define GRB_ERROR_QCP_EQUALITY_CONSTRAINT 10021
90#define GRB_ERROR_NETWORK 10022
91#define GRB_ERROR_JOB_REJECTED 10023
92#define GRB_ERROR_NOT_SUPPORTED 10024
93#define GRB_ERROR_EXCEED_2B_NONZEROS 10025
94#define GRB_ERROR_INVALID_PIECEWISE_OBJ 10026
95#define GRB_ERROR_UPDATEMODE_CHANGE 10027
96#define GRB_ERROR_CLOUD 10028
97#define GRB_ERROR_MODEL_MODIFICATION 10029
98#define GRB_ERROR_CSWORKER 10030
99#define GRB_ERROR_TUNE_MODEL_TYPES 10031
100#define GRB_ERROR_SECURITY 10032
101#define GRB_LESS_EQUAL '<'
102#define GRB_GREATER_EQUAL '>'
103#define GRB_EQUAL '='
104#define GRB_CONTINUOUS 'C'
105#define GRB_BINARY 'B'
106#define GRB_INTEGER 'I'
107#define GRB_SEMICONT 'S'
108#define GRB_SEMIINT 'N'
109#define GRB_MINIMIZE 1
110#define GRB_MAXIMIZE -1
111#define GRB_SOS_TYPE1 1
112#define GRB_SOS_TYPE2 2
113#define GRB_INFINITY 1e100
114#define GRB_UNDEFINED 1e101
115#define GRB_MAXINT 2000000000
116#define GRB_MAX_NAMELEN 255
117#define GRB_MAX_STRLEN 512
118#define GRB_MAX_TAGLEN 10240
119#define GRB_MAX_CONCURRENT 64
120#define CB_ARGS GRBmodel *model, void *cbdata, int where, void *usrdata
121#define LOGCB_ARGS char *msg, void *logdata
122extern std::function<int(GRBenv**, const char*, const char*, const char*, int, const char*)> GRBisqp;
123extern std::function<int(GRBmodel *model, const char *attrname)> GRBisattravailable;
124extern std::function<int(GRBmodel *model, const char *attrname, int *valueP)> GRBgetintattr;
125extern std::function<int(GRBmodel *model, const char *attrname, int newvalue)> GRBsetintattr;
126extern std::function<int(GRBmodel *model, const char *attrname,int element, int *valueP)> GRBgetintattrelement;
127extern std::function<int(GRBmodel *model, const char *attrname,int element, int newvalue)> GRBsetintattrelement;
128extern std::function<int(GRBmodel *model, const char *attrname,int first, int len, int *values)> GRBgetintattrarray;
129extern std::function<int(GRBmodel *model, const char *attrname,int first, int len, int *newvalues)> GRBsetintattrarray;
130extern std::function<int(GRBmodel *model, const char *attrname,int len, int *ind, int *newvalues)> GRBsetintattrlist;
131extern std::function<int(GRBmodel *model, const char *attrname,int element, char *valueP)> GRBgetcharattrelement;
132extern std::function<int(GRBmodel *model, const char *attrname,int element, char newvalue)> GRBsetcharattrelement;
133extern std::function<int(GRBmodel *model, const char *attrname,int first, int len, char *values)> GRBgetcharattrarray;
134extern std::function<int(GRBmodel *model, const char *attrname,int first, int len, char *newvalues)> GRBsetcharattrarray;
135extern std::function<int(GRBmodel *model, const char *attrname,int len, int *ind, char *newvalues)> GRBsetcharattrlist;
136extern std::function<int(GRBmodel *model, const char *attrname, double *valueP)> GRBgetdblattr;
137extern std::function<int(GRBmodel *model, const char *attrname, double newvalue)> GRBsetdblattr;
138extern std::function<int(GRBmodel *model, const char *attrname,int element, double *valueP)> GRBgetdblattrelement;
139extern std::function<int(GRBmodel *model, const char *attrname,int element, double newvalue)> GRBsetdblattrelement;
140extern std::function<int(GRBmodel *model, const char *attrname,int first, int len, double *values)> GRBgetdblattrarray;
141extern std::function<int(GRBmodel *model, const char *attrname,int first, int len, double *newvalues)> GRBsetdblattrarray;
142extern std::function<int(GRBmodel *model, const char *attrname,int len, int *ind, double *newvalues)> GRBsetdblattrlist;
143extern std::function<int(GRBmodel *model, const char *attrname, char **valueP)> GRBgetstrattr;
144extern std::function<int(GRBmodel *model, const char *attrname, const char *newvalue)> GRBsetstrattr;
145extern std::function<int(GRBmodel *model,int (GUROBI_STDCALL *cb)(CB_ARGS),void *usrdata)> GRBsetcallbackfunc;
146extern std::function<int(void *cbdata, int where, int what, void *resultP)> GRBcbget;
147extern std::function<int(void *cbdata, const double *solution, double *objvalP)> GRBcbsolution;
148extern std::function<int(void *cbdata, int cutlen, const int *cutind, const double *cutval,char cutsense, double cutrhs)> GRBcbcut;
149extern std::function<int(void *cbdata, int lazylen, const int *lazyind,const double *lazyval, char lazysense, double lazyrhs)> GRBcblazy;
150#define GRB_INT_ATTR_NUMCONSTRS "NumConstrs"
151#define GRB_INT_ATTR_NUMVARS "NumVars"
152#define GRB_INT_ATTR_NUMSOS "NumSOS"
153#define GRB_INT_ATTR_NUMQCONSTRS "NumQConstrs"
154#define GRB_INT_ATTR_NUMGENCONSTRS "NumGenConstrs"
155#define GRB_INT_ATTR_NUMNZS "NumNZs"
156#define GRB_DBL_ATTR_DNUMNZS "DNumNZs"
157#define GRB_INT_ATTR_NUMQNZS "NumQNZs"
158#define GRB_INT_ATTR_NUMQCNZS "NumQCNZs"
159#define GRB_INT_ATTR_NUMINTVARS "NumIntVars"
160#define GRB_INT_ATTR_NUMBINVARS "NumBinVars"
161#define GRB_INT_ATTR_NUMPWLOBJVARS "NumPWLObjVars"
162#define GRB_STR_ATTR_MODELNAME "ModelName"
163#define GRB_INT_ATTR_MODELSENSE "ModelSense"
164#define GRB_DBL_ATTR_OBJCON "ObjCon"
165#define GRB_INT_ATTR_IS_MIP "IsMIP"
166#define GRB_INT_ATTR_IS_QP "IsQP"
167#define GRB_INT_ATTR_IS_QCP "IsQCP"
168#define GRB_INT_ATTR_IS_MULTIOBJ "IsMultiObj"
169#define GRB_INT_ATTR_LICENSE_EXPIRATION "LicenseExpiration"
170#define GRB_INT_ATTR_NUMTAGGED "NumTagged"
171#define GRB_INT_ATTR_FINGERPRINT "Fingerprint"
172#define GRB_INT_ATTR_BATCHERRORCODE "BatchErrorCode"
173#define GRB_STR_ATTR_BATCHERRORMESSAGE "BatchErrorMessage"
174#define GRB_STR_ATTR_BATCHID "BatchID"
175#define GRB_INT_ATTR_BATCHSTATUS "BatchStatus"
176#define GRB_DBL_ATTR_LB "LB"
177#define GRB_DBL_ATTR_UB "UB"
178#define GRB_DBL_ATTR_OBJ "Obj"
179#define GRB_CHAR_ATTR_VTYPE "VType"
180#define GRB_DBL_ATTR_START "Start"
181#define GRB_DBL_ATTR_PSTART "PStart"
182#define GRB_INT_ATTR_BRANCHPRIORITY "BranchPriority"
183#define GRB_STR_ATTR_VARNAME "VarName"
184#define GRB_INT_ATTR_PWLOBJCVX "PWLObjCvx"
185#define GRB_DBL_ATTR_VARHINTVAL "VarHintVal"
186#define GRB_INT_ATTR_VARHINTPRI "VarHintPri"
187#define GRB_INT_ATTR_PARTITION "Partition"
188#define GRB_INT_ATTR_POOLIGNORE "PoolIgnore"
189#define GRB_STR_ATTR_VTAG "VTag"
190#define GRB_STR_ATTR_CTAG "CTag"
191#define GRB_DBL_ATTR_RHS "RHS"
192#define GRB_DBL_ATTR_DSTART "DStart"
193#define GRB_CHAR_ATTR_SENSE "Sense"
194#define GRB_STR_ATTR_CONSTRNAME "ConstrName"
195#define GRB_INT_ATTR_LAZY "Lazy"
196#define GRB_STR_ATTR_QCTAG "QCTag"
197#define GRB_DBL_ATTR_QCRHS "QCRHS"
198#define GRB_CHAR_ATTR_QCSENSE "QCSense"
199#define GRB_STR_ATTR_QCNAME "QCName"
200#define GRB_INT_ATTR_GENCONSTRTYPE "GenConstrType"
201#define GRB_STR_ATTR_GENCONSTRNAME "GenConstrName"
202#define GRB_INT_ATTR_FUNCPIECES "FuncPieces"
203#define GRB_DBL_ATTR_FUNCPIECEERROR "FuncPieceError"
204#define GRB_DBL_ATTR_FUNCPIECELENGTH "FuncPieceLength"
205#define GRB_DBL_ATTR_FUNCPIECERATIO "FuncPieceRatio"
206#define GRB_DBL_ATTR_MAX_COEFF "MaxCoeff"
207#define GRB_DBL_ATTR_MIN_COEFF "MinCoeff"
208#define GRB_DBL_ATTR_MAX_BOUND "MaxBound"
209#define GRB_DBL_ATTR_MIN_BOUND "MinBound"
210#define GRB_DBL_ATTR_MAX_OBJ_COEFF "MaxObjCoeff"
211#define GRB_DBL_ATTR_MIN_OBJ_COEFF "MinObjCoeff"
212#define GRB_DBL_ATTR_MAX_RHS "MaxRHS"
213#define GRB_DBL_ATTR_MIN_RHS "MinRHS"
214#define GRB_DBL_ATTR_MAX_QCCOEFF "MaxQCCoeff"
215#define GRB_DBL_ATTR_MIN_QCCOEFF "MinQCCoeff"
216#define GRB_DBL_ATTR_MAX_QOBJ_COEFF "MaxQObjCoeff"
217#define GRB_DBL_ATTR_MIN_QOBJ_COEFF "MinQObjCoeff"
218#define GRB_DBL_ATTR_MAX_QCLCOEFF "MaxQCLCoeff"
219#define GRB_DBL_ATTR_MIN_QCLCOEFF "MinQCLCoeff"
220#define GRB_DBL_ATTR_MAX_QCRHS "MaxQCRHS"
221#define GRB_DBL_ATTR_MIN_QCRHS "MinQCRHS"
222#define GRB_DBL_ATTR_RUNTIME "Runtime"
223#define GRB_DBL_ATTR_WORK "Work"
224#define GRB_INT_ATTR_STATUS "Status"
225#define GRB_DBL_ATTR_OBJVAL "ObjVal"
226#define GRB_DBL_ATTR_OBJBOUND "ObjBound"
227#define GRB_DBL_ATTR_OBJBOUNDC "ObjBoundC"
228#define GRB_DBL_ATTR_POOLOBJBOUND "PoolObjBound"
229#define GRB_DBL_ATTR_POOLOBJVAL "PoolObjVal"
230#define GRB_DBL_ATTR_MIPGAP "MIPGap"
231#define GRB_INT_ATTR_SOLCOUNT "SolCount"
232#define GRB_DBL_ATTR_ITERCOUNT "IterCount"
233#define GRB_INT_ATTR_BARITERCOUNT "BarIterCount"
234#define GRB_DBL_ATTR_NODECOUNT "NodeCount"
235#define GRB_DBL_ATTR_OPENNODECOUNT "OpenNodeCount"
236#define GRB_INT_ATTR_HASDUALNORM "HasDualNorm"
237#define GRB_INT_ATTR_CONCURRENTWINMETHOD "ConcurrentWinMethod"
238#define GRB_DBL_ATTR_X "X"
239#define GRB_DBL_ATTR_XN "Xn"
240#define GRB_DBL_ATTR_BARX "BarX"
241#define GRB_DBL_ATTR_RC "RC"
242#define GRB_DBL_ATTR_VDUALNORM "VDualNorm"
243#define GRB_INT_ATTR_VBASIS "VBasis"
244#define GRB_DBL_ATTR_PI "Pi"
245#define GRB_DBL_ATTR_QCPI "QCPi"
246#define GRB_DBL_ATTR_SLACK "Slack"
247#define GRB_DBL_ATTR_QCSLACK "QCSlack"
248#define GRB_DBL_ATTR_CDUALNORM "CDualNorm"
249#define GRB_INT_ATTR_CBASIS "CBasis"
250#define GRB_DBL_ATTR_MAX_VIO "MaxVio"
251#define GRB_DBL_ATTR_BOUND_VIO "BoundVio"
252#define GRB_DBL_ATTR_BOUND_SVIO "BoundSVio"
253#define GRB_INT_ATTR_BOUND_VIO_INDEX "BoundVioIndex"
254#define GRB_INT_ATTR_BOUND_SVIO_INDEX "BoundSVioIndex"
255#define GRB_DBL_ATTR_BOUND_VIO_SUM "BoundVioSum"
256#define GRB_DBL_ATTR_BOUND_SVIO_SUM "BoundSVioSum"
257#define GRB_DBL_ATTR_CONSTR_VIO "ConstrVio"
258#define GRB_DBL_ATTR_CONSTR_SVIO "ConstrSVio"
259#define GRB_INT_ATTR_CONSTR_VIO_INDEX "ConstrVioIndex"
260#define GRB_INT_ATTR_CONSTR_SVIO_INDEX "ConstrSVioIndex"
261#define GRB_DBL_ATTR_CONSTR_VIO_SUM "ConstrVioSum"
262#define GRB_DBL_ATTR_CONSTR_SVIO_SUM "ConstrSVioSum"
263#define GRB_DBL_ATTR_CONSTR_RESIDUAL "ConstrResidual"
264#define GRB_DBL_ATTR_CONSTR_SRESIDUAL "ConstrSResidual"
265#define GRB_INT_ATTR_CONSTR_RESIDUAL_INDEX "ConstrResidualIndex"
266#define GRB_INT_ATTR_CONSTR_SRESIDUAL_INDEX "ConstrSResidualIndex"
267#define GRB_DBL_ATTR_CONSTR_RESIDUAL_SUM "ConstrResidualSum"
268#define GRB_DBL_ATTR_CONSTR_SRESIDUAL_SUM "ConstrSResidualSum"
269#define GRB_DBL_ATTR_DUAL_VIO "DualVio"
270#define GRB_DBL_ATTR_DUAL_SVIO "DualSVio"
271#define GRB_INT_ATTR_DUAL_VIO_INDEX "DualVioIndex"
272#define GRB_INT_ATTR_DUAL_SVIO_INDEX "DualSVioIndex"
273#define GRB_DBL_ATTR_DUAL_VIO_SUM "DualVioSum"
274#define GRB_DBL_ATTR_DUAL_SVIO_SUM "DualSVioSum"
275#define GRB_DBL_ATTR_DUAL_RESIDUAL "DualResidual"
276#define GRB_DBL_ATTR_DUAL_SRESIDUAL "DualSResidual"
277#define GRB_INT_ATTR_DUAL_RESIDUAL_INDEX "DualResidualIndex"
278#define GRB_INT_ATTR_DUAL_SRESIDUAL_INDEX "DualSResidualIndex"
279#define GRB_DBL_ATTR_DUAL_RESIDUAL_SUM "DualResidualSum"
280#define GRB_DBL_ATTR_DUAL_SRESIDUAL_SUM "DualSResidualSum"
281#define GRB_DBL_ATTR_INT_VIO "IntVio"
282#define GRB_INT_ATTR_INT_VIO_INDEX "IntVioIndex"
283#define GRB_DBL_ATTR_INT_VIO_SUM "IntVioSum"
284#define GRB_DBL_ATTR_COMPL_VIO "ComplVio"
285#define GRB_INT_ATTR_COMPL_VIO_INDEX "ComplVioIndex"
286#define GRB_DBL_ATTR_COMPL_VIO_SUM "ComplVioSum"
287#define GRB_DBL_ATTR_KAPPA "Kappa"
288#define GRB_DBL_ATTR_KAPPA_EXACT "KappaExact"
289#define GRB_DBL_ATTR_N2KAPPA "N2Kappa"
290#define GRB_DBL_ATTR_SA_OBJLOW "SAObjLow"
291#define GRB_DBL_ATTR_SA_OBJUP "SAObjUp"
292#define GRB_DBL_ATTR_SA_LBLOW "SALBLow"
293#define GRB_DBL_ATTR_SA_LBUP "SALBUp"
294#define GRB_DBL_ATTR_SA_UBLOW "SAUBLow"
295#define GRB_DBL_ATTR_SA_UBUP "SAUBUp"
296#define GRB_DBL_ATTR_SA_RHSLOW "SARHSLow"
297#define GRB_DBL_ATTR_SA_RHSUP "SARHSUp"
298#define GRB_INT_ATTR_IIS_MINIMAL "IISMinimal"
299#define GRB_INT_ATTR_IIS_LB "IISLB"
300#define GRB_INT_ATTR_IIS_UB "IISUB"
301#define GRB_INT_ATTR_IIS_CONSTR "IISConstr"
302#define GRB_INT_ATTR_IIS_SOS "IISSOS"
303#define GRB_INT_ATTR_IIS_QCONSTR "IISQConstr"
304#define GRB_INT_ATTR_IIS_GENCONSTR "IISGenConstr"
305#define GRB_INT_ATTR_IIS_LBFORCE "IISLBForce"
306#define GRB_INT_ATTR_IIS_UBFORCE "IISUBForce"
307#define GRB_INT_ATTR_IIS_CONSTRFORCE "IISConstrForce"
308#define GRB_INT_ATTR_IIS_SOSFORCE "IISSOSForce"
309#define GRB_INT_ATTR_IIS_QCONSTRFORCE "IISQConstrForce"
310#define GRB_INT_ATTR_IIS_GENCONSTRFORCE "IISGenConstrForce"
311#define GRB_INT_ATTR_TUNE_RESULTCOUNT "TuneResultCount"
312#define GRB_DBL_ATTR_FARKASDUAL "FarkasDual"
313#define GRB_DBL_ATTR_FARKASPROOF "FarkasProof"
314#define GRB_DBL_ATTR_UNBDRAY "UnbdRay"
315#define GRB_INT_ATTR_INFEASVAR "InfeasVar"
316#define GRB_INT_ATTR_UNBDVAR "UnbdVar"
317#define GRB_INT_ATTR_VARPRESTAT "VarPreStat"
318#define GRB_DBL_ATTR_PREFIXVAL "PreFixVal"
319#define GRB_DBL_ATTR_OBJN "ObjN"
320#define GRB_DBL_ATTR_OBJNVAL "ObjNVal"
321#define GRB_DBL_ATTR_OBJNCON "ObjNCon"
322#define GRB_DBL_ATTR_OBJNWEIGHT "ObjNWeight"
323#define GRB_INT_ATTR_OBJNPRIORITY "ObjNPriority"
324#define GRB_DBL_ATTR_OBJNRELTOL "ObjNRelTol"
325#define GRB_DBL_ATTR_OBJNABSTOL "ObjNAbsTol"
326#define GRB_STR_ATTR_OBJNNAME "ObjNName"
327#define GRB_DBL_ATTR_SCENNLB "ScenNLB"
328#define GRB_DBL_ATTR_SCENNUB "ScenNUB"
329#define GRB_DBL_ATTR_SCENNOBJ "ScenNObj"
330#define GRB_DBL_ATTR_SCENNRHS "ScenNRHS"
331#define GRB_STR_ATTR_SCENNNAME "ScenNName"
332#define GRB_DBL_ATTR_SCENNX "ScenNX"
333#define GRB_DBL_ATTR_SCENNOBJBOUND "ScenNObjBound"
334#define GRB_DBL_ATTR_SCENNOBJVAL "ScenNObjVal"
335#define GRB_INT_ATTR_NUMOBJ "NumObj"
336#define GRB_INT_ATTR_NUMSCENARIOS "NumScenarios"
337#define GRB_INT_ATTR_NUMSTART "NumStart"
338#define GRB_GENCONSTR_MAX 0
339#define GRB_GENCONSTR_MIN 1
340#define GRB_GENCONSTR_ABS 2
341#define GRB_GENCONSTR_AND 3
342#define GRB_GENCONSTR_OR 4
343#define GRB_GENCONSTR_NORM 5
344#define GRB_GENCONSTR_INDICATOR 6
345#define GRB_GENCONSTR_PWL 7
346#define GRB_GENCONSTR_POLY 8
347#define GRB_GENCONSTR_EXP 9
348#define GRB_GENCONSTR_EXPA 10
349#define GRB_GENCONSTR_LOG 11
350#define GRB_GENCONSTR_LOGA 12
351#define GRB_GENCONSTR_POW 13
352#define GRB_GENCONSTR_SIN 14
353#define GRB_GENCONSTR_COS 15
354#define GRB_GENCONSTR_TAN 16
355#define GRB_GENCONSTR_LOGISTIC 17
356#define GRB_CB_POLLING 0
357#define GRB_CB_PRESOLVE 1
358#define GRB_CB_SIMPLEX 2
359#define GRB_CB_MIP 3
360#define GRB_CB_MIPSOL 4
361#define GRB_CB_MIPNODE 5
362#define GRB_CB_MESSAGE 6
363#define GRB_CB_BARRIER 7
364#define GRB_CB_MULTIOBJ 8
365#define GRB_CB_IIS 9
366#define GRB_CB_PRE_COLDEL 1000
367#define GRB_CB_PRE_ROWDEL 1001
368#define GRB_CB_PRE_SENCHG 1002
369#define GRB_CB_PRE_BNDCHG 1003
370#define GRB_CB_PRE_COECHG 1004
371#define GRB_CB_SPX_ITRCNT 2000
372#define GRB_CB_SPX_OBJVAL 2001
373#define GRB_CB_SPX_PRIMINF 2002
374#define GRB_CB_SPX_DUALINF 2003
375#define GRB_CB_SPX_ISPERT 2004
376#define GRB_CB_MIP_OBJBST 3000
377#define GRB_CB_MIP_OBJBND 3001
378#define GRB_CB_MIP_NODCNT 3002
379#define GRB_CB_MIP_SOLCNT 3003
380#define GRB_CB_MIP_CUTCNT 3004
381#define GRB_CB_MIP_NODLFT 3005
382#define GRB_CB_MIP_ITRCNT 3006
383#define GRB_CB_MIP_OPENSCENARIOS 3007
384#define GRB_CB_MIP_PHASE 3008
385#define GRB_CB_MIPSOL_SOL 4001
386#define GRB_CB_MIPSOL_OBJ 4002
387#define GRB_CB_MIPSOL_OBJBST 4003
388#define GRB_CB_MIPSOL_OBJBND 4004
389#define GRB_CB_MIPSOL_NODCNT 4005
390#define GRB_CB_MIPSOL_SOLCNT 4006
391#define GRB_CB_MIPSOL_OPENSCENARIOS 4007
392#define GRB_CB_MIPSOL_PHASE 4008
393#define GRB_CB_MIPNODE_STATUS 5001
394#define GRB_CB_MIPNODE_REL 5002
395#define GRB_CB_MIPNODE_OBJBST 5003
396#define GRB_CB_MIPNODE_OBJBND 5004
397#define GRB_CB_MIPNODE_NODCNT 5005
398#define GRB_CB_MIPNODE_SOLCNT 5006
399#define GRB_CB_MIPNODE_BRVAR 5007
400#define GRB_CB_MIPNODE_OPENSCENARIOS 5008
401#define GRB_CB_MIPNODE_PHASE 5009
402#define GRB_CB_MSG_STRING 6001
403#define GRB_CB_RUNTIME 6002
404#define GRB_CB_WORK 6003
405#define GRB_CB_BARRIER_ITRCNT 7001
406#define GRB_CB_BARRIER_PRIMOBJ 7002
407#define GRB_CB_BARRIER_DUALOBJ 7003
408#define GRB_CB_BARRIER_PRIMINF 7004
409#define GRB_CB_BARRIER_DUALINF 7005
410#define GRB_CB_BARRIER_COMPL 7006
411#define GRB_CB_MULTIOBJ_OBJCNT 8001
412#define GRB_CB_MULTIOBJ_SOLCNT 8002
413#define GRB_CB_MULTIOBJ_SOL 8003
414#define GRB_CB_IIS_CONSTRMIN 9001
415#define GRB_CB_IIS_CONSTRMAX 9002
416#define GRB_CB_IIS_CONSTRGUESS 9003
417#define GRB_CB_IIS_BOUNDMIN 9004
418#define GRB_CB_IIS_BOUNDMAX 9005
419#define GRB_CB_IIS_BOUNDGUESS 9006
420#define GRB_FEASRELAX_LINEAR 0
421#define GRB_FEASRELAX_QUADRATIC 1
422#define GRB_FEASRELAX_CARDINALITY 2
423extern std::function<int(GRBmodel *model, int *numnzP, int *vbeg, int *vind,double *vval, int start, int len)> GRBgetvars;
424extern std::function<int(GRBmodel *model)> GRBoptimize;
425extern std::function<int(GRBmodel *model)> GRBcomputeIIS;
426#define MALLOCCB_ARGS size_t size, void *syscbusrdata
427#define CALLOCCB_ARGS size_t nmemb, size_t size, void *syscbusrdata
428#define REALLOCCB_ARGS void *ptr, size_t size, void *syscbusrdata
429#define FREECB_ARGS void *ptr, void *syscbusrdata
430#define THREADCREATECB_ARGS void **threadP, void (*start_routine)(void *), void *arg, void *syscbusrdata
431#define THREADJOINCB_ARGS void *thread, void *syscbusrdata
432extern std::function<int(GRBmodel *model, const char *filename)> GRBwrite;
433extern std::function<int(GRBenv *env, GRBmodel **modelP, const char *Pname, int numvars,double *obj, double *lb, double *ub, char *vtype,char **varnames)> GRBnewmodel;
434extern std::function<int(GRBmodel *model, int numnz, int *vind, double *vval,double obj, double lb, double ub, char vtype,const char *varname)> GRBaddvar;
435extern std::function<int(GRBmodel *model, int numvars, int numnz,int *vbeg, int *vind, double *vval,double *obj, double *lb, double *ub, char *vtype,char **varnames)> GRBaddvars;
436extern std::function<int(GRBmodel *model, int numnz, int *cind, double *cval,char sense, double rhs, const char *constrname)> GRBaddconstr;
437extern std::function<int(GRBmodel *model, int numconstrs, int numnz,int *cbeg, int *cind, double *cval,char *sense, double *rhs, char **constrnames)> GRBaddconstrs;
438extern std::function<int(GRBmodel *model, int numnz, int *cind, double *cval,double lower, double upper, const char *constrname)> GRBaddrangeconstr;
439extern std::function<int(GRBmodel *model, int numsos, int nummembers, int *types,int *beg, int *ind, double *weight)> GRBaddsos;
440extern std::function<int(GRBmodel *model, const char *name,int resvar, int nvars, const int *vars,double constant)> GRBaddgenconstrMax;
441extern std::function<int(GRBmodel *model, const char *name,int resvar, int nvars, const int *vars,double constant)> GRBaddgenconstrMin;
442extern std::function<int(GRBmodel *model, const char *name,int resvar, int argvar)> GRBaddgenconstrAbs;
443extern std::function<int(GRBmodel *model, const char *name,int resvar, int nvars, const int *vars)> GRBaddgenconstrAnd;
444extern std::function<int(GRBmodel *model, const char *name,int resvar, int nvars, const int *vars)> GRBaddgenconstrOr;
445extern 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;
446extern 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;
447extern std::function<int(GRBmodel *model, int numqnz, int *qrow, int *qcol,double *qval)> GRBaddqpterms;
448extern std::function<int(GRBmodel *model, int len, int *ind)> GRBdelvars;
449extern std::function<int(GRBmodel *model, int len, int *ind)> GRBdelconstrs;
450extern std::function<int(GRBmodel *model, int len, int *ind)> GRBdelsos;
451extern std::function<int(GRBmodel *model, int len, int *ind)> GRBdelgenconstrs;
452extern std::function<int(GRBmodel *model, int len, int *ind)> GRBdelqconstrs;
453extern std::function<int(GRBmodel *model)> GRBdelq;
454extern std::function<int(GRBmodel *model, int cnt, int *cind, int *vind, double *val)> GRBchgcoeffs;
455extern std::function<int(GRBmodel *model)> GRBupdatemodel;
456extern std::function<int(GRBmodel *model)> GRBfreemodel;
457#define GRB_LOADED 1
458#define GRB_OPTIMAL 2
459#define GRB_INFEASIBLE 3
460#define GRB_INF_OR_UNBD 4
461#define GRB_UNBOUNDED 5
462#define GRB_CUTOFF 6
463#define GRB_ITERATION_LIMIT 7
464#define GRB_NODE_LIMIT 8
465#define GRB_TIME_LIMIT 9
466#define GRB_SOLUTION_LIMIT 10
467#define GRB_INTERRUPTED 11
468#define GRB_NUMERIC 12
469#define GRB_SUBOPTIMAL 13
470#define GRB_INPROGRESS 14
471#define GRB_USER_OBJ_LIMIT 15
472#define GRB_WORK_LIMIT 16
473#define GRB_MEM_LIMIT 17
474#define GRB_BASIC 0
475#define GRB_NONBASIC_LOWER -1
476#define GRB_NONBASIC_UPPER -2
477#define GRB_SUPERBASIC -3
478#define GRB_INT_PAR_BARITERLIMIT "BarIterLimit"
479#define GRB_DBL_PAR_CUTOFF "Cutoff"
480#define GRB_DBL_PAR_ITERATIONLIMIT "IterationLimit"
481#define GRB_DBL_PAR_NODELIMIT "NodeLimit"
482#define GRB_INT_PAR_SOLUTIONLIMIT "SolutionLimit"
483#define GRB_DBL_PAR_TIMELIMIT "TimeLimit"
484#define GRB_DBL_PAR_WORKLIMIT "WorkLimit"
485#define GRB_DBL_PAR_MEMLIMIT "MemLimit"
486#define GRB_DBL_PAR_SOFTMEMLIMIT "SoftMemLimit"
487#define GRB_DBL_PAR_BESTOBJSTOP "BestObjStop"
488#define GRB_DBL_PAR_BESTBDSTOP "BestBdStop"
489#define GRB_DBL_PAR_FEASIBILITYTOL "FeasibilityTol"
490#define GRB_DBL_PAR_INTFEASTOL "IntFeasTol"
491#define GRB_DBL_PAR_MARKOWITZTOL "MarkowitzTol"
492#define GRB_DBL_PAR_MIPGAP "MIPGap"
493#define GRB_DBL_PAR_MIPGAPABS "MIPGapAbs"
494#define GRB_DBL_PAR_OPTIMALITYTOL "OptimalityTol"
495#define GRB_DBL_PAR_PSDTOL "PSDTol"
496#define GRB_INT_PAR_METHOD "Method"
497#define GRB_DBL_PAR_PERTURBVALUE "PerturbValue"
498#define GRB_DBL_PAR_OBJSCALE "ObjScale"
499#define GRB_INT_PAR_SCALEFLAG "ScaleFlag"
500#define GRB_INT_PAR_SIMPLEXPRICING "SimplexPricing"
501#define GRB_INT_PAR_QUAD "Quad"
502#define GRB_INT_PAR_NORMADJUST "NormAdjust"
503#define GRB_INT_PAR_SIFTING "Sifting"
504#define GRB_INT_PAR_SIFTMETHOD "SiftMethod"
505#define GRB_INT_PAR_LPWARMSTART "LPWarmStart"
506#define GRB_INT_PAR_NETWORKALG "NetworkAlg"
507#define GRB_DBL_PAR_BARCONVTOL "BarConvTol"
508#define GRB_INT_PAR_BARCORRECTORS "BarCorrectors"
509#define GRB_INT_PAR_BARHOMOGENEOUS "BarHomogeneous"
510#define GRB_INT_PAR_BARORDER "BarOrder"
511#define GRB_DBL_PAR_BARQCPCONVTOL "BarQCPConvTol"
512#define GRB_INT_PAR_CROSSOVER "Crossover"
513#define GRB_INT_PAR_CROSSOVERBASIS "CrossoverBasis"
514#define GRB_INT_PAR_BRANCHDIR "BranchDir"
515#define GRB_INT_PAR_DEGENMOVES "DegenMoves"
516#define GRB_INT_PAR_DISCONNECTED "Disconnected"
517#define GRB_DBL_PAR_HEURISTICS "Heuristics"
518#define GRB_DBL_PAR_IMPROVESTARTGAP "ImproveStartGap"
519#define GRB_DBL_PAR_IMPROVESTARTTIME "ImproveStartTime"
520#define GRB_DBL_PAR_IMPROVESTARTNODES "ImproveStartNodes"
521#define GRB_INT_PAR_INTEGRALITYFOCUS "IntegralityFocus"
522#define GRB_INT_PAR_MINRELNODES "MinRelNodes"
523#define GRB_INT_PAR_MIPFOCUS "MIPFocus"
524#define GRB_INT_PAR_NLPHEUR "NLPHeur"
525#define GRB_STR_PAR_NODEFILEDIR "NodefileDir"
526#define GRB_DBL_PAR_NODEFILESTART "NodefileStart"
527#define GRB_INT_PAR_NODEMETHOD "NodeMethod"
528#define GRB_DBL_PAR_NORELHEURTIME "NoRelHeurTime"
529#define GRB_DBL_PAR_NORELHEURWORK "NoRelHeurWork"
530#define GRB_INT_PAR_OBBT "OBBT"
531#define GRB_INT_PAR_PUMPPASSES "PumpPasses"
532#define GRB_INT_PAR_RINS "RINS"
533#define GRB_STR_PAR_SOLFILES "SolFiles"
534#define GRB_INT_PAR_STARTNODELIMIT "StartNodeLimit"
535#define GRB_INT_PAR_SUBMIPNODES "SubMIPNodes"
536#define GRB_INT_PAR_SYMMETRY "Symmetry"
537#define GRB_INT_PAR_VARBRANCH "VarBranch"
538#define GRB_INT_PAR_SOLUTIONNUMBER "SolutionNumber"
539#define GRB_INT_PAR_ZEROOBJNODES "ZeroObjNodes"
540#define GRB_INT_PAR_CUTS "Cuts"
541#define GRB_INT_PAR_CLIQUECUTS "CliqueCuts"
542#define GRB_INT_PAR_COVERCUTS "CoverCuts"
543#define GRB_INT_PAR_FLOWCOVERCUTS "FlowCoverCuts"
544#define GRB_INT_PAR_FLOWPATHCUTS "FlowPathCuts"
545#define GRB_INT_PAR_GUBCOVERCUTS "GUBCoverCuts"
546#define GRB_INT_PAR_IMPLIEDCUTS "ImpliedCuts"
547#define GRB_INT_PAR_PROJIMPLIEDCUTS "ProjImpliedCuts"
548#define GRB_INT_PAR_MIPSEPCUTS "MIPSepCuts"
549#define GRB_INT_PAR_MIRCUTS "MIRCuts"
550#define GRB_INT_PAR_STRONGCGCUTS "StrongCGCuts"
551#define GRB_INT_PAR_MODKCUTS "ModKCuts"
552#define GRB_INT_PAR_ZEROHALFCUTS "ZeroHalfCuts"
553#define GRB_INT_PAR_NETWORKCUTS "NetworkCuts"
554#define GRB_INT_PAR_SUBMIPCUTS "SubMIPCuts"
555#define GRB_INT_PAR_INFPROOFCUTS "InfProofCuts"
556#define GRB_INT_PAR_RLTCUTS "RLTCuts"
557#define GRB_INT_PAR_RELAXLIFTCUTS "RelaxLiftCuts"
558#define GRB_INT_PAR_BQPCUTS "BQPCuts"
559#define GRB_INT_PAR_PSDCUTS "PSDCuts"
560#define GRB_INT_PAR_LIFTPROJECTCUTS "LiftProjectCuts"
561#define GRB_INT_PAR_CUTAGGPASSES "CutAggPasses"
562#define GRB_INT_PAR_CUTPASSES "CutPasses"
563#define GRB_INT_PAR_GOMORYPASSES "GomoryPasses"
564#define GRB_STR_PAR_WORKERPOOL "WorkerPool"
565#define GRB_STR_PAR_WORKERPASSWORD "WorkerPassword"
566#define GRB_STR_PAR_COMPUTESERVER "ComputeServer"
567#define GRB_STR_PAR_TOKENSERVER "TokenServer"
568#define GRB_STR_PAR_SERVERPASSWORD "ServerPassword"
569#define GRB_INT_PAR_SERVERTIMEOUT "ServerTimeout"
570#define GRB_STR_PAR_CSROUTER "CSRouter"
571#define GRB_STR_PAR_CSGROUP "CSGroup"
572#define GRB_DBL_PAR_CSQUEUETIMEOUT "CSQueueTimeout"
573#define GRB_INT_PAR_CSPRIORITY "CSPriority"
574#define GRB_INT_PAR_CSIDLETIMEOUT "CSIdleTimeout"
575#define GRB_INT_PAR_CSTLSINSECURE "CSTLSInsecure"
576#define GRB_INT_PAR_TSPORT "TSPort"
577#define GRB_STR_PAR_CLOUDACCESSID "CloudAccessID"
578#define GRB_STR_PAR_CLOUDSECRETKEY "CloudSecretKey"
579#define GRB_STR_PAR_CLOUDPOOL "CloudPool"
580#define GRB_STR_PAR_CLOUDHOST "CloudHost"
581#define GRB_STR_PAR_CSMANAGER "CSManager"
582#define GRB_STR_PAR_CSAUTHTOKEN "CSAuthToken"
583#define GRB_STR_PAR_CSAPIACCESSID "CSAPIAccessID"
584#define GRB_STR_PAR_CSAPISECRET "CSAPISecret"
585#define GRB_INT_PAR_CSBATCHMODE "CSBatchMode"
586#define GRB_STR_PAR_USERNAME "Username"
587#define GRB_STR_PAR_CSAPPNAME "CSAppName"
588#define GRB_INT_PAR_CSCLIENTLOG "CSClientLog"
589#define GRB_STR_PAR_WLSACCESSID "WLSAccessID"
590#define GRB_STR_PAR_WLSSECRET "WLSSecret"
591#define GRB_INT_PAR_WLSTOKENDURATION "WLSTokenDuration"
592#define GRB_DBL_PAR_WLSTOKENREFRESH "WLSTokenRefresh"
593#define GRB_STR_PAR_WLSTOKEN "WLSToken"
594#define GRB_INT_PAR_LICENSEID "LicenseID"
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_PRESOS1ENCODING "PreSOS1Encoding"
622#define GRB_INT_PAR_PRESOS2ENCODING "PreSOS2Encoding"
623#define GRB_INT_PAR_PRESPARSIFY "PreSparsify"
624#define GRB_INT_PAR_PREMIQCPFORM "PreMIQCPForm"
625#define GRB_INT_PAR_QCPDUAL "QCPDual"
626#define GRB_INT_PAR_RECORD "Record"
627#define GRB_STR_PAR_RESULTFILE "ResultFile"
628#define GRB_INT_PAR_SEED "Seed"
629#define GRB_INT_PAR_SOLUTIONTARGET "SolutionTarget"
630#define GRB_INT_PAR_THREADS "Threads"
631#define GRB_DBL_PAR_TUNETIMELIMIT "TuneTimeLimit"
632#define GRB_INT_PAR_TUNERESULTS "TuneResults"
633#define GRB_INT_PAR_TUNECRITERION "TuneCriterion"
634#define GRB_INT_PAR_TUNETRIALS "TuneTrials"
635#define GRB_INT_PAR_TUNEOUTPUT "TuneOutput"
636#define GRB_INT_PAR_TUNEJOBS "TuneJobs"
637#define GRB_DBL_PAR_TUNECLEANUP "TuneCleanup"
638#define GRB_DBL_PAR_TUNETARGETMIPGAP "TuneTargetMIPGap"
639#define GRB_DBL_PAR_TUNETARGETTIME "TuneTargetTime"
640#define GRB_INT_PAR_TUNEMETRIC "TuneMetric"
641#define GRB_INT_PAR_UPDATEMODE "UpdateMode"
642#define GRB_INT_PAR_OBJNUMBER "ObjNumber"
643#define GRB_INT_PAR_MULTIOBJMETHOD "MultiObjMethod"
644#define GRB_INT_PAR_MULTIOBJPRE "MultiObjPre"
645#define GRB_INT_PAR_SCENARIONUMBER "ScenarioNumber"
646#define GRB_INT_PAR_POOLSOLUTIONS "PoolSolutions"
647#define GRB_DBL_PAR_POOLGAP "PoolGap"
648#define GRB_DBL_PAR_POOLGAPABS "PoolGapAbs"
649#define GRB_INT_PAR_POOLSEARCHMODE "PoolSearchMode"
650#define GRB_INT_PAR_IGNORENAMES "IgnoreNames"
651#define GRB_INT_PAR_STARTNUMBER "StartNumber"
652#define GRB_INT_PAR_PARTITIONPLACE "PartitionPlace"
653#define GRB_INT_PAR_FUNCPIECES "FuncPieces"
654#define GRB_DBL_PAR_FUNCPIECELENGTH "FuncPieceLength"
655#define GRB_DBL_PAR_FUNCPIECEERROR "FuncPieceError"
656#define GRB_DBL_PAR_FUNCPIECERATIO "FuncPieceRatio"
657#define GRB_DBL_PAR_FUNCMAXVAL "FuncMaxVal"
658#define GRB_STR_PAR_DUMMY "Dummy"
659#define GRB_STR_PAR_JOBID "JobID"
660#define GRB_CUTS_AUTO -1
661#define GRB_CUTS_OFF 0
662#define GRB_CUTS_CONSERVATIVE 1
663#define GRB_CUTS_AGGRESSIVE 2
664#define GRB_CUTS_VERYAGGRESSIVE 3
665#define GRB_PRESOLVE_AUTO -1
666#define GRB_PRESOLVE_OFF 0
667#define GRB_PRESOLVE_CONSERVATIVE 1
668#define GRB_PRESOLVE_AGGRESSIVE 2
669#define GRB_METHOD_NONE -1
670#define GRB_METHOD_AUTO -1
671#define GRB_METHOD_PRIMAL 0
672#define GRB_METHOD_DUAL 1
673#define GRB_METHOD_BARRIER 2
674#define GRB_METHOD_CONCURRENT 3
675#define GRB_METHOD_DETERMINISTIC_CONCURRENT 4
676#define GRB_METHOD_DETERMINISTIC_CONCURRENT_SIMPLEX 5
677#define GRB_BARHOMOGENEOUS_AUTO -1
678#define GRB_BARHOMOGENEOUS_OFF 0
679#define GRB_BARHOMOGENEOUS_ON 1
680#define GRB_MIPFOCUS_BALANCED 0
681#define GRB_MIPFOCUS_FEASIBILITY 1
682#define GRB_MIPFOCUS_OPTIMALITY 2
683#define GRB_MIPFOCUS_BESTBOUND 3
684#define GRB_BARORDER_AUTOMATIC -1
685#define GRB_BARORDER_AMD 0
686#define GRB_BARORDER_NESTEDDISSECTION 1
687#define GRB_SIMPLEXPRICING_AUTO -1
688#define GRB_SIMPLEXPRICING_PARTIAL 0
689#define GRB_SIMPLEXPRICING_STEEPEST_EDGE 1
690#define GRB_SIMPLEXPRICING_DEVEX 2
691#define GRB_SIMPLEXPRICING_STEEPEST_QUICK 3
692#define GRB_VARBRANCH_AUTO -1
693#define GRB_VARBRANCH_PSEUDO_REDUCED 0
694#define GRB_VARBRANCH_PSEUDO_SHADOW 1
695#define GRB_VARBRANCH_MAX_INFEAS 2
696#define GRB_VARBRANCH_STRONG 3
697#define GRB_PARTITION_EARLY 16
698#define GRB_PARTITION_ROOTSTART 8
699#define GRB_PARTITION_ROOTEND 4
700#define GRB_PARTITION_NODES 2
701#define GRB_PARTITION_CLEANUP 1
702#define GRB_PHASE_MIP_NOREL 0
703#define GRB_PHASE_MIP_SEARCH 1
704#define GRB_PHASE_MIP_IMPROVE 2
705extern std::function<void(GRBmodel *model)> GRBterminate;
706extern std::function<int(GRBmodel *model, int index, int priority, double weight,double abstol, double reltol, const char *name,double constant, int lnz, int *lind, double *lval)> GRBsetobjectiven;
707extern std::function<int(GRBenv *env, const char *paramname, int *valueP)> GRBgetintparam;
708extern std::function<int(GRBenv *env, const char *paramname, double *valueP)> GRBgetdblparam;
709extern std::function<int(GRBenv *env, const char *paramname, char *valueP)> GRBgetstrparam;
710extern std::function<int(GRBenv *env, const char *paramname, const char *value)> GRBsetparam;
711extern std::function<int(GRBenv *env, const char *paramname, int value)> GRBsetintparam;
712extern std::function<int(GRBenv *env, const char *paramname, double value)> GRBsetdblparam;
713extern std::function<int(GRBenv *env, const char *paramname, const char *value)> GRBsetstrparam;
714extern std::function<int(GRBenv *env)> GRBresetparams;
715extern std::function<int(GRBenv *dest, GRBenv *src)> GRBcopyparams;
716extern std::function<int(GRBenv **envP, const char *logfilename)> GRBloadenv;
717extern std::function<int(GRBenv *env)> GRBstartenv;
718extern std::function<int(GRBenv **envP)> GRBemptyenv;
719extern std::function<int(GRBenv *envP)> GRBgetnumparams;
720extern std::function<int(GRBenv *envP, int i, char **paramnameP)> GRBgetparamname;
721extern std::function<int(GRBenv *envP, const char *paramname)> GRBgetparamtype;
722extern std::function<int(GRBenv *envP, const char *paramname, int *valueP, int *minP, int *maxP, int *defP)> GRBgetintparaminfo;
723extern std::function<int(GRBenv *envP, const char *paramname, double *valueP, double *minP, double *maxP, double *defP)> GRBgetdblparaminfo;
724extern std::function<int(GRBenv *envP, const char *paramname, char *valueP, char *defP)> GRBgetstrparaminfo;
725extern std::function<GRBenv *(GRBmodel *model)> GRBgetenv;
726extern std::function<void(GRBenv *env)> GRBfreeenv;
727extern std::function<const char *(GRBenv *env)> GRBgeterrormsg;
728extern std::function<void(int *majorP, int *minorP, int *technicalP)> GRBversion;
729extern std::function<char *(void)> GRBplatform;
730#define GRB_BATCH_STATUS_UNKNOWN 0
731#define GRB_BATCH_CREATED 1
732#define GRB_BATCH_SUBMITTED 2
733#define GRB_BATCH_ABORTED 3
734#define GRB_BATCH_FAILED 4
735#define GRB_BATCH_COMPLETED 5
736} // namespace operations_research
737
738#endif // OR_TOOLS_GUROBI_ENVIRONMENT_H_
const std::string name
A name for logging purposes.
int64_t value
double lower
double upper
#define GUROBI_STDCALL
Definition environment.h:27
struct _GRBenv GRBenv
Definition environment.h:32
struct _GRBsvec GRBsvec
struct _GRBmodel GRBmodel
Definition environment.h:31
#define CB_ARGS
GRBmodel * model
int where
int index
double solution
In SWIG mode, we don't want anything besides these top-level includes.
std::function< int(GRBmodel *model, int numnz, int *cind, double *cval, char sense, double rhs, const char *constrname)> GRBaddconstr
std::function< void(GRBenv *env)> GRBfreeenv
std::function< int(GRBmodel *model, const char *attrname, double *valueP)> GRBgetdblattr
std::function< int(GRBmodel *model, const char *attrname, int first, int len, double *values)> GRBgetdblattrarray
std::function< int(GRBmodel *model, const char *attrname, int first, int len, int *values)> GRBgetintattrarray
std::function< int(GRBmodel *model, const char *attrname, double newvalue)> GRBsetdblattr
std::function< int(GRBmodel *model, int len, int *ind)> GRBdelsos
std::function< int(GRBmodel *model, int numvars, int numnz, int *vbeg, int *vind, double *vval, double *obj, double *lb, double *ub, char *vtype, char **varnames)> GRBaddvars
std::function< int(GRBmodel *model, int(GUROBI_STDCALL *cb)(CB_ARGS), void *usrdata)> GRBsetcallbackfunc
std::function< int(GRBenv *dest, GRBenv *src)> GRBcopyparams
std::function< int(GRBmodel *model, int *numnzP, int *vbeg, int *vind, double *vval, int start, int len)> GRBgetvars
std::function< int(GRBmodel *model, const char *attrname, int len, int *ind, int *newvalues)> GRBsetintattrlist
std::function< int(GRBmodel *model, int cnt, int *cind, int *vind, double *val)> GRBchgcoeffs
std::function< int(GRBmodel *model, const char *attrname, int first, int len, char *values)> GRBgetcharattrarray
std::function< int(void *cbdata, int cutlen, const int *cutind, const double *cutval, char cutsense, double cutrhs)> GRBcbcut
std::function< int(GRBenv *env, const char *paramname, double *valueP)> GRBgetdblparam
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 len, int *ind)> GRBdelvars
std::function< int(GRBmodel *model, const char *attrname, int newvalue)> GRBsetintattr
std::function< int(GRBenv *env, const char *paramname, const char *value)> GRBsetparam
std::function< int(GRBmodel *model, const char *attrname, int element, int *valueP)> GRBgetintattrelement
std::function< int(GRBenv *env, GRBmodel **modelP, const char *Pname, int numvars, double *obj, double *lb, double *ub, char *vtype, char **varnames)> GRBnewmodel
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< int(GRBmodel *model, const char *attrname, int first, int len, int *newvalues)> GRBsetintattrarray
absl::Status LoadGurobiDynamicLibrary(std::vector< std::string > potential_paths)
std::function< int(GRBmodel *model)> GRBupdatemodel
std::function< void(int *majorP, int *minorP, int *technicalP)> GRBversion
std::function< GRBenv *(GRBmodel *model)> GRBgetenv
std::function< int(GRBmodel *model, const char *attrname, int len, int *ind, char *newvalues)> GRBsetcharattrlist
bool GurobiIsCorrectlyInstalled()
std::function< int(GRBenv *env, const char *paramname, char *valueP)> GRBgetstrparam
std::function< int(GRBmodel *model, const char *attrname, int element, double *valueP)> GRBgetdblattrelement
std::function< int(GRBmodel *model, const char *attrname, int first, int len, char *newvalues)> GRBsetcharattrarray
std::function< int(GRBmodel *model)> GRBfreemodel
std::function< int(GRBmodel *model, int len, int *ind)> GRBdelqconstrs
std::function< int(void *cbdata, int lazylen, const int *lazyind, const double *lazyval, char lazysense, double lazyrhs)> GRBcblazy
std::function< int(GRBmodel *model)> GRBcomputeIIS
std::function< int(void *cbdata, int where, int what, void *resultP)> GRBcbget
std::function< int(GRBenv *env, const char *paramname, int value)> GRBsetintparam
std::function< int(GRBmodel *model, const char *attrname)> GRBisattravailable
std::function< int(GRBenv *env, const char *paramname, const char *value)> GRBsetstrparam
std::function< int(GRBenv *env, const char *paramname, char *valueP, char *defP)> GRBgetstrparaminfo
std::function< int(GRBmodel *model, const char *attrname, int first, int len, double *newvalues)> GRBsetdblattrarray
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, double lower, double upper, const char *constrname)> GRBaddrangeconstr
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 *model, const char *attrname, int element, char newvalue)> GRBsetcharattrelement
std::function< int(GRBmodel *model, const char *attrname, int element, int newvalue)> GRBsetintattrelement
std::function< int(GRBenv *env)> GRBresetparams
std::function< int(GRBmodel *model, const char *attrname, const char *newvalue)> GRBsetstrattr
std::function< int(GRBmodel *model)> GRBoptimize
std::function< int(GRBenv **envP, const char *logfilename)> GRBloadenv
std::function< int(GRBmodel *model, int numqnz, int *qrow, int *qcol, double *qval)> GRBaddqpterms
std::function< int(GRBenv **, const char *, const char *, const char *, int, const char *)> GRBisqp
This is the 'define' section.
std::function< int(GRBenv **envP)> GRBemptyenv
std::function< int(GRBenv *env, const char *paramname)> GRBgetparamtype
std::function< int(GRBmodel *model, int len, int *ind)> GRBdelconstrs
std::function< int(GRBmodel *model, const char *name, int resvar, int argvar)> GRBaddgenconstrAbs
std::function< int(GRBenv *env, int i, char **paramnameP)> GRBgetparamname
std::function< int(GRBmodel *model, const char *attrname, int *valueP)> GRBgetintattr
std::function< int(GRBmodel *model, int len, int *ind)> GRBdelgenconstrs
std::function< int(GRBmodel *model, int index, int priority, double weight, double abstol, double reltol, const char *name, double constant, int lnz, int *lind, double *lval)> GRBsetobjectiven
std::function< const char *(GRBenv *env)> GRBgeterrormsg
absl::StatusOr< GRBenv * > GetGurobiEnv()
std::function< int(GRBmodel *model, const char *filename)> GRBwrite
std::function< int(GRBenv *env, const char *paramname, double *valueP, double *minP, double *maxP, double *defP)> GRBgetdblparaminfo
std::function< int(GRBenv *env, const char *paramname, int *valueP)> GRBgetintparam
std::function< int(GRBmodel *model, const char *name, int resvar, int nvars, const int *vars)> GRBaddgenconstrAnd
std::function< int(GRBenv *env)> GRBstartenv
std::function< int(GRBmodel *model, const char *name, int resvar, int nvars, const int *vars)> GRBaddgenconstrOr
std::function< int(GRBmodel *model, int numconstrs, int numnz, int *cbeg, int *cind, double *cval, char *sense, double *rhs, char **constrnames)> GRBaddconstrs
std::function< int(GRBmodel *model, const char *attrname, int len, int *ind, double *newvalues)> GRBsetdblattrlist
std::function< int(GRBmodel *model, const char *name, int resvar, int nvars, const int *vars, double constant)> GRBaddgenconstrMax
std::function< char *(void)> GRBplatform
std::function< int(GRBenv *env, const char *paramname, int *valueP, int *minP, int *maxP, int *defP)> GRBgetintparaminfo
std::function< int(GRBmodel *model, int numsos, int nummembers, int *types, int *beg, int *ind, double *weight)> GRBaddsos
std::function< int(GRBenv *env)> GRBgetnumparams
std::function< int(GRBmodel *model, const char *attrname, int element, char *valueP)> GRBgetcharattrelement
std::function< int(GRBmodel *model, const char *attrname, char **valueP)> GRBgetstrattr
std::function< int(GRBmodel *model)> GRBdelq
std::function< int(void *cbdata, const double *solution, double *objvalP)> GRBcbsolution
std::function< void(GRBmodel *model)> GRBterminate
std::function< int(GRBenv *env, const char *paramname, double value)> GRBsetdblparam
std::function< int(GRBmodel *model, const char *attrname, int element, double newvalue)> GRBsetdblattrelement
int64_t weight
Definition pack.cc:510
int64_t start
int * ind
Definition environment.h:35
double * val
Definition environment.h:36