gurobipy 13.0.0b1__cp312-cp312-macosx_10_13_universal2.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gurobipy might be problematic. Click here for more details.
- gurobipy/.libs/gurobi.lic +6 -0
- gurobipy/.libs/libgurobi130.dylib +0 -0
- gurobipy/__init__.py +139 -0
- gurobipy/__init__.pyi +3364 -0
- gurobipy/_attrconst.py +477 -0
- gurobipy/_attrutil.cpython-312-darwin.so +0 -0
- gurobipy/_batch.cpython-312-darwin.so +0 -0
- gurobipy/_callbackconst.py +206 -0
- gurobipy/_core.cpython-312-darwin.so +0 -0
- gurobipy/_errorconst.py +80 -0
- gurobipy/_exception.cpython-312-darwin.so +0 -0
- gurobipy/_grb.py +298 -0
- gurobipy/_helpers.cpython-312-darwin.so +0 -0
- gurobipy/_load_model.py +169 -0
- gurobipy/_lowlevel.cpython-312-darwin.so +0 -0
- gurobipy/_matrixapi.cpython-312-darwin.so +0 -0
- gurobipy/_model.cpython-312-darwin.so +0 -0
- gurobipy/_modelutil.cpython-312-darwin.so +0 -0
- gurobipy/_paramconst.py +491 -0
- gurobipy/_paramdetails.py +2068 -0
- gurobipy/_statusconst.py +47 -0
- gurobipy/_util.cpython-312-darwin.so +0 -0
- gurobipy/nlfunc.py +34 -0
- gurobipy/nlfunc.pyi +52 -0
- gurobipy/py.typed +0 -0
- gurobipy-13.0.0b1.dist-info/METADATA +347 -0
- gurobipy-13.0.0b1.dist-info/RECORD +30 -0
- gurobipy-13.0.0b1.dist-info/WHEEL +5 -0
- gurobipy-13.0.0b1.dist-info/licenses/LICENSE.txt +3174 -0
- gurobipy-13.0.0b1.dist-info/top_level.txt +1 -0
|
Binary file
|
gurobipy/__init__.py
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Python interface to the Gurobi Optimizer
|
|
3
|
+
|
|
4
|
+
The Gurobi Optimizer is a mathematical optimization software library for
|
|
5
|
+
solving mixed-integer linear, quadratic, and nonlinear optimization problems.
|
|
6
|
+
|
|
7
|
+
This package comes with a trial license that allows you to solve problems of
|
|
8
|
+
limited size. As a student or staff member of an academic institution, you
|
|
9
|
+
qualify for a free, full product license. For more information visit
|
|
10
|
+
https://www.gurobi.com/academia/academic-program-and-licenses/
|
|
11
|
+
|
|
12
|
+
For a commercial evaluation, you can request an evaluation license by
|
|
13
|
+
visiting https://www.gurobi.com/free-trial/.
|
|
14
|
+
|
|
15
|
+
Other useful resources to get started:
|
|
16
|
+
|
|
17
|
+
- Gurobi Documentation: https://docs.gurobi.com/
|
|
18
|
+
- Gurobi Community: https://support.gurobi.com/hc/en-us/community/topics/
|
|
19
|
+
|
|
20
|
+
A simple example, formulating and solving a mixed-integer linear program:
|
|
21
|
+
|
|
22
|
+
# maximize
|
|
23
|
+
# x + y + 2 z
|
|
24
|
+
# subject to
|
|
25
|
+
# x + 2 y + 3 z <= 4
|
|
26
|
+
# x + y >= 1
|
|
27
|
+
# x, y, z binary
|
|
28
|
+
|
|
29
|
+
import gurobipy as gp
|
|
30
|
+
|
|
31
|
+
with gp.Env() as env, gp.Model(env=env) as model:
|
|
32
|
+
|
|
33
|
+
# Create variables
|
|
34
|
+
x = model.addVar(vtype='B', name="x")
|
|
35
|
+
y = model.addVar(vtype='B', name="y")
|
|
36
|
+
z = model.addVar(vtype='B', name="z")
|
|
37
|
+
|
|
38
|
+
# Set objective function
|
|
39
|
+
model.setObjective(x + y + 2 * z, gp.GRB.MAXIMIZE)
|
|
40
|
+
|
|
41
|
+
# Add constraints
|
|
42
|
+
model.addConstr(x + 2 * y + 3 * z <= 4)
|
|
43
|
+
model.addConstr(x + y >= 1)
|
|
44
|
+
|
|
45
|
+
# Solve it!
|
|
46
|
+
model.optimize()
|
|
47
|
+
|
|
48
|
+
print(f"Optimal objective value: {model.ObjVal}")
|
|
49
|
+
print(f"Solution values: x={x.X}, y={y.X}, z={z.X}")
|
|
50
|
+
"""
|
|
51
|
+
|
|
52
|
+
__version__ = "13.0.0b1"
|
|
53
|
+
|
|
54
|
+
from gurobipy._batch import Batch
|
|
55
|
+
|
|
56
|
+
from gurobipy._core import (
|
|
57
|
+
Column,
|
|
58
|
+
Constr,
|
|
59
|
+
Env,
|
|
60
|
+
GenConstr,
|
|
61
|
+
GenExpr,
|
|
62
|
+
LinExpr,
|
|
63
|
+
QConstr,
|
|
64
|
+
QuadExpr,
|
|
65
|
+
SOS,
|
|
66
|
+
Var,
|
|
67
|
+
NLExpr,
|
|
68
|
+
TempConstr,
|
|
69
|
+
tuplelist,
|
|
70
|
+
tupledict,
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
from gurobipy._core import abs_, all_, and_, any_, max_, min_, norm, or_
|
|
74
|
+
|
|
75
|
+
from gurobipy._core import (
|
|
76
|
+
disposeDefaultEnv,
|
|
77
|
+
getParamInfo,
|
|
78
|
+
gurobi,
|
|
79
|
+
paramHelp,
|
|
80
|
+
read,
|
|
81
|
+
readParams,
|
|
82
|
+
resetParams,
|
|
83
|
+
setParam,
|
|
84
|
+
writeParams,
|
|
85
|
+
)
|
|
86
|
+
|
|
87
|
+
from gurobipy._exception import GurobiError
|
|
88
|
+
|
|
89
|
+
from gurobipy._grb import GRB
|
|
90
|
+
|
|
91
|
+
from gurobipy._helpers import multidict, quicksum
|
|
92
|
+
|
|
93
|
+
from gurobipy._matrixapi import (
|
|
94
|
+
MConstr,
|
|
95
|
+
MGenConstr,
|
|
96
|
+
MLinExpr,
|
|
97
|
+
MQConstr,
|
|
98
|
+
MQuadExpr,
|
|
99
|
+
MVar,
|
|
100
|
+
MNLExpr,
|
|
101
|
+
concatenate,
|
|
102
|
+
hstack,
|
|
103
|
+
vstack,
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
from gurobipy._model import Model
|
|
107
|
+
|
|
108
|
+
from gurobipy._load_model import loadModel
|
|
109
|
+
|
|
110
|
+
import gurobipy.nlfunc as nlfunc
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
# fmt: off
|
|
114
|
+
__all__ = [
|
|
115
|
+
# _batch
|
|
116
|
+
"Batch",
|
|
117
|
+
# _core
|
|
118
|
+
"Column", "Constr", "Env", "GenConstr", "GenExpr", "LinExpr", "QConstr",
|
|
119
|
+
"QuadExpr", "SOS", "Var", "NLExpr", "TempConstr", "tuplelist", "tupledict",
|
|
120
|
+
"abs_", "all_", "and_", "any_", "max_", "min_", "norm", "or_",
|
|
121
|
+
"disposeDefaultEnv", "getParamInfo", "gurobi", "paramHelp", "read",
|
|
122
|
+
"readParams", "resetParams", "setParam", "writeParams",
|
|
123
|
+
# _exception
|
|
124
|
+
"GurobiError",
|
|
125
|
+
# _grb
|
|
126
|
+
"GRB",
|
|
127
|
+
# _helpers
|
|
128
|
+
"multidict", "quicksum",
|
|
129
|
+
# _matrixapi
|
|
130
|
+
"MConstr", "MGenConstr", "MLinExpr", "MQConstr", "MQuadExpr", "MVar",
|
|
131
|
+
"MNLExpr", "concatenate", "hstack", "vstack",
|
|
132
|
+
# _model
|
|
133
|
+
"Model",
|
|
134
|
+
# _load_model
|
|
135
|
+
"loadModel",
|
|
136
|
+
# _nlfunc
|
|
137
|
+
"nlfunc",
|
|
138
|
+
]
|
|
139
|
+
# fmt: on
|