Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemath
GitHub Repository: sagemath/sagesmc
Path: blob/master/src/sage/numerical/backends/cplex_backend.pyx
8817 views
1
"""
2
CPLEX Backend
3
4
AUTHORS:
5
6
- Nathann Cohen (2010-10): initial implementation
7
8
"""
9
10
##############################################################################
11
# Copyright (C) 2010 Nathann Cohen <[email protected]>
12
# Distributed under the terms of the GNU General Public License (GPL)
13
# The full text of the GPL is available at:
14
# http://www.gnu.org/licenses/
15
##############################################################################
16
17
18
from sage.numerical.mip import MIPSolverException
19
20
cdef class CPLEXBackend(GenericBackend):
21
22
def __cinit__(self, maximization = True):
23
"""
24
Constructor
25
26
EXAMPLE::
27
28
sage: p = MixedIntegerLinearProgram(solver="CPLEX") # optional - CPLEX
29
"""
30
31
cdef int status
32
self.env = CPXopenCPLEX (&status)
33
check(status)
34
35
cdef char * tmp = ""
36
self.lp = CPXcreateprob (self.env, &status, tmp);
37
check(status)
38
39
if maximization:
40
self.set_sense(+1)
41
else:
42
self.set_sense(-1)
43
44
self.obj_constant_term = 0.0
45
46
cpdef int add_variable(self, lower_bound=0.0, upper_bound=None, binary=False, continuous=False, integer=False, obj=0.0, name=None) except -1:
47
"""
48
Add a variable.
49
50
This amounts to adding a new column to the matrix. By default,
51
the variable is both positive and real.
52
53
INPUT:
54
55
- ``lower_bound`` - the lower bound of the variable (default: 0)
56
57
- ``upper_bound`` - the upper bound of the variable (default: ``None``)
58
59
- ``binary`` - ``True`` if the variable is binary (default: ``False``).
60
61
- ``continuous`` - ``True`` if the variable is binary (default: ``True``).
62
63
- ``integer`` - ``True`` if the variable is binary (default: ``False``).
64
65
- ``obj`` - (optional) coefficient of this variable in the objective function (default: 0.0)
66
67
- ``name`` - an optional name for the newly added variable (default: ``None``).
68
69
OUTPUT: The index of the newly created variable
70
71
EXAMPLE::
72
73
sage: from sage.numerical.backends.generic_backend import get_solver
74
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
75
sage: p.ncols() # optional - CPLEX
76
0
77
sage: p.add_variable() # optional - CPLEX
78
0
79
sage: p.ncols() # optional - CPLEX
80
1
81
sage: p.add_variable(binary=True) # optional - CPLEX
82
1
83
sage: p.add_variable(lower_bound=-2.0, integer=True) # optional - CPLEX
84
2
85
sage: p.add_variable(continuous=True, integer=True) # optional - CPLEX
86
Traceback (most recent call last):
87
...
88
ValueError: ...
89
sage: p.add_variable(name='x',obj=1.0) # optional - CPLEX
90
3
91
sage: p.col_name(3) # optional - CPLEX
92
'x'
93
sage: p.objective_coefficient(3) # optional - CPLEX
94
1.0
95
96
"""
97
cdef char * c_name
98
cdef double c_coeff = obj
99
cdef int vtype = int(bool(binary)) + int(bool(continuous)) + int(bool(integer))
100
if vtype == 0:
101
continuous = True
102
elif vtype != 1:
103
raise ValueError("Exactly one parameter of 'binary', 'integer' and 'continuous' must be 'True'.")
104
105
cdef int status
106
status = CPXnewcols(self.env, self.lp, 1, NULL, NULL, NULL, NULL, NULL)
107
check(status)
108
109
cdef int n
110
n = CPXgetnumcols(self.env, self.lp) - 1
111
112
if lower_bound != 0.0:
113
self.variable_lower_bound(n, lower_bound)
114
if upper_bound is not None:
115
self.variable_upper_bound(n, upper_bound)
116
117
if binary:
118
self.set_variable_type(n,0)
119
elif integer:
120
self.set_variable_type(n,1)
121
122
if name is not None:
123
c_name = name
124
status = CPXchgcolname(self.env, self.lp, 1, &n, &c_name)
125
check(status)
126
127
if c_coeff:
128
status = CPXchgobj(self.env, self.lp, 1, &n, &c_coeff)
129
check(status)
130
131
return n
132
133
cpdef int add_variables(self, int number, lower_bound=0.0, upper_bound=None, binary=False, continuous=False, integer=False, obj=0.0, names=None) except -1:
134
"""
135
Add ``number`` new variables.
136
137
This amounts to adding new columns to the matrix. By default,
138
the variables are both positive and real.
139
140
INPUT:
141
142
- ``n`` - the number of new variables (must be > 0)
143
144
- ``lower_bound`` - the lower bound of the variable (default: 0)
145
146
- ``upper_bound`` - the upper bound of the variable (default: ``None``)
147
148
- ``binary`` - ``True`` if the variable is binary (default: ``False``).
149
150
- ``continuous`` - ``True`` if the variable is binary (default: ``True``).
151
152
- ``integer`` - ``True`` if the variable is binary (default: ``False``).
153
154
- ``obj`` - (optional) coefficient of all variables in the objective function (default: 0.0)
155
156
- ``names`` - optional list of names (default: ``None``)
157
158
OUTPUT: The index of the variable created last.
159
160
EXAMPLE::
161
162
sage: from sage.numerical.backends.generic_backend import get_solver
163
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
164
sage: p.ncols() # optional - CPLEX
165
0
166
sage: p.add_variables(5) # optional - CPLEX
167
4
168
sage: p.ncols() # optional - CPLEX
169
5
170
sage: p.add_variables(2, lower_bound=-2.0, integer=True, names=['a','b']) # optional - CPLEX
171
6
172
"""
173
cdef char * c_name
174
cdef double c_coeff = obj
175
cdef int vtype = int(bool(binary)) + int(bool(continuous)) + int(bool(integer))
176
if vtype == 0:
177
continuous = True
178
elif vtype != 1:
179
raise ValueError("Exactly one parameter of 'binary', 'integer' and 'continuous' must be 'True'.")
180
181
cdef int status
182
status = CPXnewcols(self.env, self.lp, number, NULL, NULL, NULL, NULL, NULL)
183
check(status)
184
185
cdef int n
186
n = CPXgetnumcols(self.env, self.lp) - 1
187
188
cdef int i, j
189
190
for 0<= i < number:
191
if lower_bound != 0.0:
192
self.variable_lower_bound(n - i, lower_bound)
193
if upper_bound is not None:
194
self.variable_upper_bound(n - i, upper_bound)
195
196
if binary:
197
self.set_variable_type(n - i,0)
198
elif integer:
199
self.set_variable_type(n - i,1)
200
201
if names:
202
j = n - i
203
c_name = names[i]
204
status = CPXchgcolname(self.env, self.lp, 1, &j, &c_name)
205
check(status)
206
207
if c_coeff:
208
j = n - i
209
status = CPXchgobj(self.env, self.lp, 1, &j, &c_coeff)
210
check(status)
211
212
return n
213
214
cpdef set_variable_type(self, int variable, int vtype):
215
r"""
216
Sets the type of a variable
217
218
INPUT:
219
220
- ``variable`` (integer) -- the variable's id
221
222
- ``vtype`` (integer) :
223
224
* 1 Integer
225
* 0 Binary
226
* -1 Real
227
228
EXAMPLE::
229
230
sage: from sage.numerical.backends.generic_backend import get_solver
231
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
232
sage: p.ncols() # optional - CPLEX
233
0
234
sage: p.add_variable() # optional - CPLEX
235
0
236
sage: p.set_variable_type(0,1) # optional - CPLEX
237
sage: p.is_variable_integer(0) # optional - CPLEX
238
True
239
"""
240
241
cdef int status
242
243
cdef char type
244
if vtype == 1:
245
type = 'I'
246
elif vtype == 0:
247
type = 'B'
248
else:
249
type = 'C'
250
251
status = CPXchgctype(self.env, self.lp, 1, &variable, &type)
252
check(status)
253
254
cpdef set_sense(self, int sense):
255
r"""
256
Sets the direction (maximization/minimization).
257
258
INPUT:
259
260
- ``sense`` (integer) :
261
262
* +1 => Maximization
263
* -1 => Minimization
264
265
EXAMPLE::
266
267
sage: from sage.numerical.backends.generic_backend import get_solver
268
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
269
sage: p.is_maximization() # optional - CPLEX
270
True
271
sage: p.set_sense(-1) # optional - CPLEX
272
sage: p.is_maximization() # optional - CPLEX
273
False
274
"""
275
276
CPXchgobjsen(self.env, self.lp, -sense)
277
278
cpdef objective_coefficient(self, int variable, coeff=None):
279
"""
280
Set or get the coefficient of a variable in the objective function
281
282
INPUT:
283
284
- ``variable`` (integer) -- the variable's id
285
286
- ``coeff`` (double) -- its coefficient or ``None`` for
287
reading (default: ``None``)
288
289
EXAMPLE::
290
291
sage: from sage.numerical.backends.generic_backend import get_solver
292
sage: p = get_solver(solver = "CPLEX") # optional -- CPLEX
293
sage: p.add_variable() # optional -- CPLEX
294
0
295
sage: p.objective_coefficient(0) # optional -- CPLEX
296
0.0
297
sage: p.objective_coefficient(0,2) # optional -- CPLEX
298
sage: p.objective_coefficient(0) # optional -- CPLEX
299
2.0
300
"""
301
302
cdef int status
303
cdef double value
304
305
if coeff is None:
306
status = CPXgetobj(self.env, self.lp, &value, variable, variable)
307
check(status)
308
return value
309
310
else:
311
value = coeff
312
status = CPXchgobj(self.env, self.lp, 1, &variable, &value)
313
check(status)
314
315
cpdef problem_name(self, char * name = NULL):
316
r"""
317
Returns or defines the problem's name
318
319
INPUT:
320
321
- ``name`` (``char *``) -- the problem's name. When set to
322
``NULL`` (default), the method returns the problem's name.
323
324
EXAMPLE::
325
326
sage: from sage.numerical.backends.generic_backend import get_solver
327
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
328
sage: p.problem_name("There once was a french fry") # optional - CPLEX
329
sage: print p.problem_name() # optional - CPLEX
330
There once was a french fry
331
"""
332
333
cdef int status
334
cdef int zero
335
cdef char * n
336
if name == NULL:
337
338
n = <char*> sage_malloc(500*sizeof(char))
339
status = CPXgetprobname(self.env, self.lp, n, 500, &zero)
340
check(status)
341
s = str(n)
342
sage_free(n)
343
return s
344
345
346
else:
347
status = CPXchgprobname(self.env, self.lp, name)
348
check(status)
349
350
351
cpdef set_objective(self, list coeff, d = 0.0):
352
r"""
353
Sets the objective function.
354
355
INPUT:
356
357
- ``coeff`` -- a list of real values, whose ith element is the
358
coefficient of the ith variable in the objective function.
359
360
- ``d`` (double) -- the constant term in the linear function (set to `0` by default)
361
362
EXAMPLE::
363
364
sage: from sage.numerical.backends.generic_backend import get_solver
365
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
366
sage: p.add_variables(5) # optional - CPLEX
367
4
368
sage: p.set_objective([1, 1, 2, 1, 3]) # optional - CPLEX
369
sage: map(lambda x :p.objective_coefficient(x), range(5)) # optional - CPLEX
370
[1.0, 1.0, 2.0, 1.0, 3.0]
371
372
Constants in the objective function are respected::
373
374
sage: p = MixedIntegerLinearProgram(solver='CPLEX') # optional - CPLEX
375
sage: x,y = p[0], p[1] # optional - CPLEX
376
sage: p.add_constraint(2*x + 3*y, max = 6) # optional - CPLEX
377
sage: p.add_constraint(3*x + 2*y, max = 6) # optional - CPLEX
378
sage: p.set_objective(x + y + 7) # optional - CPLEX
379
sage: p.set_integer(x); p.set_integer(y) # optional - CPLEX
380
sage: p.solve() # optional - CPLEX
381
9.0
382
"""
383
384
cdef int status
385
cdef int n = self.ncols()
386
cdef double * c_coeff = <double *> sage_malloc(n * sizeof(double))
387
cdef int * c_indices = <int *> sage_malloc(n * sizeof(int))
388
389
for i,v in enumerate(coeff):
390
c_coeff[i] = v
391
c_indices[i] = i
392
393
status = CPXchgobj(self.env, self.lp, n, c_indices, c_coeff)
394
check(status)
395
396
sage_free(c_coeff)
397
sage_free(c_indices)
398
399
self.obj_constant_term = d
400
401
402
cpdef set_verbosity(self, int level):
403
r"""
404
Sets the log (verbosity) level
405
406
INPUT:
407
408
- ``level`` (integer) -- From 0 (no verbosity) to 3.
409
410
EXAMPLE::
411
412
sage: from sage.numerical.backends.generic_backend import get_solver
413
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
414
sage: p.set_verbosity(2) # optional - CPLEX
415
416
"""
417
418
cdef int status
419
if level == 0:
420
status = CPXsetintparam (self.env, CPX_PARAM_SCRIND, 0)
421
check(status)
422
else:
423
status = CPXsetintparam (self.env, CPX_PARAM_SCRIND, CPX_ON)
424
check(status)
425
426
cpdef remove_constraint(self, int i):
427
r"""
428
Remove a constraint from self.
429
430
INPUT:
431
432
- ``i`` -- index of the constraint to remove
433
434
EXAMPLE::
435
436
sage: p = MixedIntegerLinearProgram(solver='CPLEX')# optional - CPLEX
437
sage: x,y = p[0], p[1] # optional - CPLEX
438
sage: p.add_constraint(2*x + 3*y, max = 6) # optional - CPLEX
439
sage: p.add_constraint(3*x + 2*y, max = 6) # optional - CPLEX
440
sage: p.set_objective(x + y + 7) # optional - CPLEX
441
sage: p.set_integer(x); p.set_integer(y) # optional - CPLEX
442
sage: p.solve() # optional - CPLEX
443
9.0
444
sage: p.remove_constraint(0) # optional - CPLEX
445
sage: p.solve() # optional - CPLEX
446
10.0
447
sage: p.get_values([x,y]) # optional - CPLEX
448
[0.0, 3.0]
449
"""
450
cdef int status
451
status = CPXdelrows(self.env, self.lp, i, i)
452
check(status)
453
454
cpdef add_linear_constraints(self, int number, lower_bound, upper_bound, names = None):
455
"""
456
Add ``'number`` linear constraints.
457
458
INPUT:
459
460
- ``number`` (integer) -- the number of constraints to add.
461
462
- ``lower_bound`` - a lower bound, either a real value or ``None``
463
464
- ``upper_bound`` - an upper bound, either a real value or ``None``
465
466
- ``names`` - an optional list of names (default: ``None``)
467
468
EXAMPLE::
469
470
sage: from sage.numerical.backends.generic_backend import get_solver
471
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
472
sage: p.add_variables(5) # optional - CPLEX
473
4
474
sage: p.add_linear_constraints(5, None, 2) # optional - CPLEX
475
sage: p.row(4) # optional - CPLEX
476
([], [])
477
sage: p.row_bounds(4) # optional - CPLEX
478
(None, 2.0)
479
sage: p.add_linear_constraints(2, None, 2, names=['foo','bar']) # optional - CPLEX
480
"""
481
if lower_bound is None and upper_bound is None:
482
raise ValueError("At least one of 'upper_bound' or 'lower_bound' must be set.")
483
484
cdef int status
485
cdef char * sense = <char *> sage_malloc(number * sizeof(char))
486
cdef double * bound = <double *> sage_malloc(number * sizeof(double))
487
cdef double * rng = NULL
488
cdef int i
489
cdef char ** c_names = <char **> sage_malloc(number * sizeof(char *))
490
491
if upper_bound == lower_bound:
492
sense[0] = 'E'
493
bound[0] = lower_bound
494
495
elif upper_bound is not None and lower_bound is not None:
496
if upper_bound < lower_bound:
497
raise ValueError("The upper bound must be at least equal to the lower bound !")
498
499
rng = <double *> sage_malloc(number * sizeof(double))
500
501
sense[0] = 'R'
502
bound[0] = lower_bound
503
rng[0] = upper_bound - lower_bound
504
505
elif upper_bound is not None:
506
sense[0] = 'L'
507
bound[0] = upper_bound
508
509
elif lower_bound is not None:
510
sense[0] = 'G'
511
bound[0] = lower_bound
512
513
if names:
514
c_names[0] = names[0]
515
516
for 1<= i <number:
517
sense[i] = sense[0]
518
bound[i] = bound[0]
519
if rng != NULL:
520
rng[i] = rng[0]
521
if names:
522
c_names[i] = names[i]
523
524
status = CPXnewrows(self.env, self.lp, number, bound, sense, rng, c_names if names else NULL)
525
526
sage_free(sense)
527
sage_free(bound)
528
sage_free(c_names)
529
check(status)
530
531
cpdef add_linear_constraint(self, coefficients, lower_bound, upper_bound, name = None):
532
"""
533
Add a linear constraint.
534
535
INPUT:
536
537
- ``coefficients`` an iterable with ``(c,v)`` pairs where ``c``
538
is a variable index (integer) and ``v`` is a value (real
539
value).
540
541
- ``lower_bound`` - a lower bound, either a real value or ``None``
542
543
- ``upper_bound`` - an upper bound, either a real value or ``None``
544
545
- ``name`` - an optional name for this row (default: ``None``)
546
547
EXAMPLE::
548
549
sage: from sage.numerical.backends.generic_backend import get_solver
550
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
551
sage: p.add_variables(5) # optional - CPLEX
552
4
553
sage: p.add_linear_constraint( zip(range(5), range(5)), 2.0, 2.0) # optional - CPLEX
554
sage: p.row(0) # optional - CPLEX
555
([1, 2, 3, 4], [1.0, 2.0, 3.0, 4.0])
556
sage: p.row_bounds(0) # optional - CPLEX
557
(2.0, 2.0)
558
sage: p.add_linear_constraint( zip(range(5), range(5)), 1.0, 1.0, name='foo') # optional - CPLEX
559
sage: p.row_name(1) # optional - CPLEX
560
'foo'
561
562
"""
563
if lower_bound is None and upper_bound is None:
564
raise ValueError("At least one of 'upper_bound' or 'lower_bound' must be set.")
565
566
cdef int status
567
cdef int i, j
568
cdef int n = len(coefficients)
569
cdef int nrows = self.nrows()
570
cdef char sense
571
572
cdef char * c_name
573
574
cdef double * c_coeff
575
cdef int * c_indices
576
cdef int * c_row
577
cdef double bound
578
cdef double rng
579
cdef double c
580
581
c_coeff = <double *> sage_malloc(n * sizeof(double))
582
c_indices = <int *> sage_malloc(n * sizeof(int))
583
c_row = <int *> sage_malloc(n * sizeof(int))
584
585
for i, (j, c) in enumerate(coefficients):
586
c_coeff[i] = c
587
c_indices[i] = j
588
c_row[i] = nrows
589
590
if upper_bound is None and lower_bound is None:
591
pass
592
593
elif upper_bound == lower_bound:
594
sense = 'E'
595
bound = lower_bound
596
597
elif upper_bound is not None and lower_bound is not None:
598
if upper_bound < lower_bound:
599
raise ValueError("The upper bound must be at least equal to the lower bound !")
600
601
sense = 'R'
602
bound = lower_bound
603
rng = upper_bound - lower_bound
604
605
elif upper_bound is not None:
606
sense = 'L'
607
bound = upper_bound
608
609
elif lower_bound is not None:
610
sense = 'G'
611
bound = lower_bound
612
613
if name:
614
c_name = name
615
616
status = CPXnewrows(self.env, self.lp, 1, &bound, &sense, &rng, NULL if (name is None) else &c_name)
617
618
check(status)
619
status = CPXchgcoeflist(self.env, self.lp, n, c_row, c_indices, c_coeff)
620
check(status)
621
622
# Free memory
623
sage_free(c_coeff)
624
sage_free(c_indices)
625
sage_free(c_row)
626
627
cpdef row(self, int index):
628
r"""
629
Returns a row
630
631
INPUT:
632
633
- ``index`` (integer) -- the constraint's id.
634
635
OUTPUT:
636
637
A pair ``(indices, coeffs)`` where ``indices`` lists the
638
entries whose coefficient is nonzero, and to which ``coeffs``
639
associates their coefficient on the model of the
640
``add_linear_constraint`` method.
641
642
EXAMPLE::
643
644
sage: from sage.numerical.backends.generic_backend import get_solver
645
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
646
sage: p.add_variables(5) # optional - CPLEX
647
4
648
sage: p.add_linear_constraint(zip(range(5), range(5)), 2, 2) # optional - CPLEX
649
sage: p.row(0) # optional - CPLEX
650
([1, 2, 3, 4], [1.0, 2.0, 3.0, 4.0])
651
sage: p.row_bounds(0) # optional - CPLEX
652
(2.0, 2.0)
653
"""
654
655
cdef int status
656
cdef int n,i
657
cdef int zero
658
cdef list indices = []
659
cdef list values = []
660
661
cdef double * c_coeff = <double *> sage_malloc((self.ncols()+10) * sizeof(double))
662
cdef int * c_indices = <int *> sage_malloc((self.ncols()+10) * sizeof(int))
663
664
status = CPXgetrows(self.env, self.lp, &n, &zero, c_indices, c_coeff, self.ncols()+3, &zero, index, index)
665
666
check(status)
667
668
for 0<= i<n:
669
indices.append(c_indices[i])
670
values.append(c_coeff[i])
671
672
sage_free(c_coeff)
673
sage_free(c_indices)
674
675
return (indices, values)
676
677
cpdef row_bounds(self, int index):
678
r"""
679
Returns the bounds of a specific constraint.
680
681
INPUT:
682
683
- ``index`` (integer) -- the constraint's id.
684
685
OUTPUT:
686
687
A pair ``(lower_bound, upper_bound)``. Each of them can be set
688
to ``None`` if the constraint is not bounded in the
689
corresponding direction, and is a real value otherwise.
690
691
EXAMPLE::
692
693
sage: from sage.numerical.backends.generic_backend import get_solver
694
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
695
sage: p.add_variables(5) # optional - CPLEX
696
4
697
sage: p.add_linear_constraint(zip(range(5), range(5)), 2, 2) # optional - CPLEX
698
sage: p.row(0) # optional - CPLEX
699
([1, 2, 3, 4], [1.0, 2.0, 3.0, 4.0])
700
sage: p.row_bounds(0) # optional - CPLEX
701
(2.0, 2.0)
702
"""
703
704
cdef int status
705
cdef double rng
706
cdef double value
707
status = CPXgetrhs(self.env, self.lp, &value, index, index)
708
check(status)
709
710
cdef char direction
711
status = CPXgetsense(self.env, self.lp, &direction, index, index)
712
check(status)
713
714
if direction == 'L':
715
return (None, value)
716
elif direction == 'G':
717
return (value, None)
718
elif direction == 'E':
719
return (value, value)
720
elif direction == 'R':
721
status = CPXgetrngval(self.env, self.lp, &rng, index, index)
722
check(status)
723
return (value, value + rng)
724
725
cpdef col_bounds(self, int index):
726
r"""
727
Returns the bounds of a specific variable.
728
729
INPUT:
730
731
- ``index`` (integer) -- the variable's id.
732
733
OUTPUT:
734
735
A pair ``(lower_bound, upper_bound)``. Each of them can be set
736
to ``None`` if the variable is not bounded in the
737
corresponding direction, and is a real value otherwise.
738
739
EXAMPLE::
740
741
sage: from sage.numerical.backends.generic_backend import get_solver
742
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
743
sage: p.add_variable() # optional - CPLEX
744
0
745
sage: p.col_bounds(0) # optional - CPLEX
746
(0.0, None)
747
sage: p.variable_upper_bound(0, 5) # optional - CPLEX
748
sage: p.col_bounds(0) # optional - CPLEX
749
(0.0, 5.0)
750
"""
751
752
cdef int status
753
cdef double ub
754
cdef double lb
755
756
status = CPXgetub(self.env, self.lp, &ub, index, index)
757
check(status)
758
759
status = CPXgetlb(self.env, self.lp, &lb, index, index)
760
check(status)
761
762
return (None if lb <= -int(CPX_INFBOUND) else lb,
763
None if ub >= +int(CPX_INFBOUND) else ub)
764
765
cpdef add_col(self, list indices, list coeffs):
766
r"""
767
Adds a column.
768
769
INPUT:
770
771
- ``indices`` (list of integers) -- this list constains the
772
indices of the constraints in which the variable's
773
coefficient is nonzero
774
775
- ``coeffs`` (list of real values) -- associates a coefficient
776
to the variable in each of the constraints in which it
777
appears. Namely, the ith entry of ``coeffs`` corresponds to
778
the coefficient of the variable in the constraint
779
represented by the ith entry in ``indices``.
780
781
.. NOTE::
782
783
``indices`` and ``coeffs`` are expected to be of the same
784
length.
785
786
EXAMPLE::
787
788
sage: from sage.numerical.backends.generic_backend import get_solver
789
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
790
sage: p.ncols() # optional - CPLEX
791
0
792
sage: p.nrows() # optional - CPLEX
793
0
794
sage: p.add_linear_constraints(5, 0, None) # optional - CPLEX
795
sage: p.add_col(range(5), range(5)) # optional - CPLEX
796
sage: p.nrows() # optional - CPLEX
797
5
798
"""
799
800
cdef int status
801
cdef int i
802
cdef int n = len(indices)
803
cdef int ncols = self.ncols()
804
805
status = CPXnewcols(self.env, self.lp, 1, NULL, NULL, NULL, NULL, NULL)
806
807
808
check(status)
809
810
cdef double * c_coeff = <double *> sage_malloc(n * sizeof(double))
811
cdef int * c_indices = <int *> sage_malloc(n * sizeof(int))
812
cdef int * c_col = <int *> sage_malloc(n * sizeof(int))
813
814
for 0<= i < n:
815
c_coeff[i] = coeffs[i]
816
c_indices[i] = indices[i]
817
c_col[i] = ncols
818
819
820
status = CPXchgcoeflist(self.env, self.lp, n, c_indices, c_col, c_coeff)
821
check(status)
822
823
sage_free(c_coeff)
824
sage_free(c_indices)
825
sage_free(c_col)
826
827
cpdef int solve(self) except -1:
828
r"""
829
Solves the problem.
830
831
.. NOTE::
832
833
This method raises ``MIPSolverException`` exceptions when
834
the solution can not be computed for any reason (none
835
exists, or the LP solver was not able to find it, etc...)
836
837
EXAMPLE::
838
839
sage: from sage.numerical.backends.generic_backend import get_solver
840
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
841
sage: p.add_linear_constraints(5, 0, None) # optional - CPLEX
842
sage: p.add_col(range(5), range(5)) # optional - CPLEX
843
sage: p.solve() # optional - CPLEX
844
0
845
sage: p.objective_coefficient(0,1) # optional - CPLEX
846
sage: p.solve() # optional - CPLEX
847
Traceback (most recent call last):
848
...
849
MIPSolverException: ...
850
"""
851
cdef int status
852
cdef int ptype
853
cdef int solnmethod_p, solntype_p, pfeasind_p, dfeasind_p
854
855
ptype = CPXgetprobtype(self.env, self.lp)
856
857
if ptype == 1:
858
status = CPXmipopt(self.env, self.lp)
859
elif ptype == 0:
860
status = CPXlpopt(self.env, self.lp)
861
else:
862
raise MIPSolverException("CPLEX: Unknown problem type")
863
864
check(status)
865
866
status = CPXsolninfo(self.env, self.lp, &solnmethod_p, &solntype_p, &pfeasind_p, &dfeasind_p)
867
check(status)
868
869
if solntype_p == CPX_NO_SOLN:
870
if not pfeasind_p:
871
raise MIPSolverException("CPLEX: The primal has no feasible solution")
872
elif not dfeasind_p:
873
raise MIPSolverException("CPLEX: The problem is unbounded")
874
else:
875
raise MIPSolverException("CPLEX: No solution has been found, but no idea why")
876
877
return 0
878
879
cpdef get_objective_value(self):
880
r"""
881
Returns the value of the objective function.
882
883
.. NOTE::
884
885
Has no meaning unless ``solve`` has been called before.
886
887
EXAMPLE::
888
889
sage: from sage.numerical.backends.generic_backend import get_solver
890
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
891
sage: p.add_variables(2) # optional - CPLEX
892
1
893
sage: p.add_linear_constraint([(0,1), (1,2)], None, 3) # optional - CPLEX
894
sage: p.set_objective([2, 5]) # optional - CPLEX
895
sage: p.solve() # optional - CPLEX
896
0
897
sage: p.get_objective_value() # optional - CPLEX
898
7.5
899
sage: p.get_variable_value(0) # optional - CPLEX
900
0.0
901
sage: p.get_variable_value(1) # optional - CPLEX
902
1.5
903
"""
904
905
cdef int status
906
cdef double value
907
status = CPXgetobjval (self.env, self.lp, &value)
908
check(status)
909
910
return value + self.obj_constant_term
911
912
913
cpdef get_variable_value(self, int variable):
914
r"""
915
Returns the value of a variable given by the solver.
916
917
.. NOTE::
918
919
Has no meaning unless ``solve`` has been called before.
920
921
EXAMPLE::
922
923
sage: from sage.numerical.backends.generic_backend import get_solver
924
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
925
sage: p.add_variables(2) # optional - CPLEX
926
1
927
sage: p.add_linear_constraint([(0,1), (1,2)], None, 3) # optional - CPLEX
928
sage: p.set_objective([2, 5]) # optional - CPLEX
929
sage: p.solve() # optional - CPLEX
930
0
931
sage: p.get_objective_value() # optional - CPLEX
932
7.5
933
sage: p.get_variable_value(0) # optional - CPLEX
934
0.0
935
sage: p.get_variable_value(1) # optional - CPLEX
936
1.5
937
"""
938
939
cdef int status
940
cdef int zero
941
cdef char ctype
942
cdef double value
943
status = CPXgetx(self.env, self.lp, &value, variable, variable)
944
check(status)
945
946
status = CPXgetctype(self.env, self.lp, &ctype, variable, variable)
947
948
return value if (status == 3003 or ctype=='C') else round(value)
949
950
cpdef int ncols(self):
951
r"""
952
Returns the number of columns/variables.
953
954
EXAMPLE::
955
956
sage: from sage.numerical.backends.generic_backend import get_solver
957
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
958
sage: p.ncols() # optional - CPLEX
959
0
960
sage: p.add_variables(2) # optional - CPLEX
961
1
962
sage: p.ncols() # optional - CPLEX
963
2
964
"""
965
966
return CPXgetnumcols(self.env, self.lp)
967
968
cpdef int nrows(self):
969
r"""
970
Returns the number of rows/constraints.
971
972
EXAMPLE::
973
974
sage: from sage.numerical.backends.generic_backend import get_solver
975
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
976
sage: p.nrows() # optional - CPLEX
977
0
978
sage: p.add_linear_constraints(2, 2, None) # optional - CPLEX
979
sage: p.nrows() # optional - CPLEX
980
2
981
"""
982
983
return CPXgetnumrows(self.env, self.lp)
984
985
cpdef row_name(self, int index):
986
r"""
987
Return the ``index`` th row name
988
989
INPUT:
990
991
- ``index`` (integer) -- the row's id
992
993
EXAMPLE::
994
995
sage: from sage.numerical.backends.generic_backend import get_solver
996
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
997
sage: p.add_linear_constraints(1, 2, None, names=['Empty constraint 1']) # optional - CPLEX
998
sage: p.row_name(0) # optional - CPLEX
999
'Empty constraint 1'
1000
"""
1001
1002
cdef int status
1003
cdef int zero
1004
cdef char * n
1005
1006
n = <char *>sage_malloc(500*sizeof(char))
1007
status = CPXgetrowname(self.env, self.lp, &n, n, 500, &zero, index, index)
1008
if status == 1219:
1009
sage_free(n)
1010
return ""
1011
check(status)
1012
1013
s = str(n)
1014
sage_free(n)
1015
1016
return s
1017
1018
cpdef col_name(self, int index):
1019
r"""
1020
Returns the ``index`` th col name.
1021
1022
INPUT:
1023
1024
- ``index`` (integer) -- the col's id
1025
1026
EXAMPLE::
1027
1028
sage: from sage.numerical.backends.generic_backend import get_solver
1029
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1030
sage: p.add_variable(name='I am a variable') # optional - CPLEX
1031
0
1032
sage: p.col_name(0) # optional - CPLEX
1033
'I am a variable'
1034
"""
1035
1036
cdef int status
1037
cdef char * n
1038
cdef int zero
1039
1040
n = <char *>sage_malloc(500*sizeof(char))
1041
status = CPXgetcolname(self.env, self.lp, &n, n, 500, &zero, index, index)
1042
if status == 1219:
1043
sage_free(n)
1044
return ""
1045
check(status)
1046
1047
s = str(n)
1048
sage_free(n)
1049
return s
1050
1051
cpdef bint is_variable_binary(self, int index):
1052
r"""
1053
Tests whether the given variable is of binary type.
1054
1055
INPUT:
1056
1057
- ``index`` (integer) -- the variable's id
1058
1059
EXAMPLE::
1060
1061
sage: from sage.numerical.backends.generic_backend import get_solver
1062
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1063
sage: p.ncols() # optional - CPLEX
1064
0
1065
sage: p.add_variable() # optional - CPLEX
1066
0
1067
sage: p.set_variable_type(0,0) # optional - CPLEX
1068
sage: p.is_variable_binary(0) # optional - CPLEX
1069
True
1070
1071
"""
1072
1073
cdef int status
1074
cdef char ctype
1075
1076
status = CPXgetctype(self.env, self.lp, &ctype, index, index)
1077
1078
# status = 3003 when the problem is a LP and not a MILP
1079
if status == 3003:
1080
return False
1081
1082
check(status)
1083
1084
return ctype == 'B'
1085
1086
1087
cpdef bint is_variable_integer(self, int index):
1088
r"""
1089
Tests whether the given variable is of integer type.
1090
1091
INPUT:
1092
1093
- ``index`` (integer) -- the variable's id
1094
1095
EXAMPLE::
1096
1097
sage: from sage.numerical.backends.generic_backend import get_solver
1098
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1099
sage: p.ncols() # optional - CPLEX
1100
0
1101
sage: p.add_variable() # optional - CPLEX
1102
0
1103
sage: p.set_variable_type(0,1) # optional - CPLEX
1104
sage: p.is_variable_integer(0) # optional - CPLEX
1105
True
1106
"""
1107
1108
cdef int status
1109
cdef char ctype
1110
1111
status = CPXgetctype(self.env, self.lp, &ctype, index, index)
1112
1113
# status = 3003 when the problem is a LP and not a MILP
1114
if status == 3003:
1115
return False
1116
1117
check(status)
1118
1119
return ctype == 'I'
1120
1121
1122
cpdef bint is_variable_continuous(self, int index):
1123
r"""
1124
Tests whether the given variable is of continuous/real type.
1125
1126
INPUT:
1127
1128
- ``index`` (integer) -- the variable's id
1129
1130
EXAMPLE::
1131
1132
sage: from sage.numerical.backends.generic_backend import get_solver
1133
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1134
sage: p.ncols() # optional - CPLEX
1135
0
1136
sage: p.add_variable() # optional - CPLEX
1137
0
1138
sage: p.is_variable_continuous(0) # optional - CPLEX
1139
True
1140
sage: p.set_variable_type(0,1) # optional - CPLEX
1141
sage: p.is_variable_continuous(0) # optional - CPLEX
1142
False
1143
1144
"""
1145
1146
cdef int status
1147
cdef char ctype
1148
1149
status = CPXgetctype(self.env, self.lp, &ctype, index, index)
1150
1151
# status = 3003 when the problem is a LP and not a MILP
1152
if status == 3003:
1153
return True
1154
1155
check(status)
1156
1157
return ctype == 'C'
1158
1159
1160
cpdef bint is_maximization(self):
1161
r"""
1162
Tests whether the problem is a maximization
1163
1164
EXAMPLE::
1165
1166
sage: from sage.numerical.backends.generic_backend import get_solver
1167
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1168
sage: p.is_maximization() # optional - CPLEX
1169
True
1170
sage: p.set_sense(-1) # optional - CPLEX
1171
sage: p.is_maximization() # optional - CPLEX
1172
False
1173
"""
1174
1175
return -1 == CPXgetobjsen(self.env, self.lp)
1176
1177
cpdef variable_upper_bound(self, int index, value = False):
1178
r"""
1179
Returns or defines the upper bound on a variable
1180
1181
INPUT:
1182
1183
- ``index`` (integer) -- the variable's id
1184
1185
- ``value`` -- real value, or ``None`` to mean that the
1186
variable has not upper bound. When set to ``False``
1187
(default), the method returns the current value.
1188
1189
EXAMPLE::
1190
1191
sage: from sage.numerical.backends.generic_backend import get_solver
1192
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1193
sage: p.add_variable() # optional - CPLEX
1194
0
1195
sage: p.col_bounds(0) # optional - CPLEX
1196
(0.0, None)
1197
sage: p.variable_upper_bound(0, 5) # optional - CPLEX
1198
sage: p.col_bounds(0) # optional - CPLEX
1199
(0.0, 5.0)
1200
1201
TESTS:
1202
1203
:trac:`14581`::
1204
1205
sage: P = MixedIntegerLinearProgram(solver="CPLEX") # optional - CPLEX
1206
sage: x = P["x"] # optional - CPLEX
1207
sage: P.set_max(x, 0) # optional - CPLEX
1208
sage: P.get_max(x) # optional - CPLEX
1209
0.0
1210
"""
1211
cdef int status
1212
cdef double ub
1213
cdef char x
1214
cdef double c_value
1215
1216
if value is False:
1217
status = CPXgetub(self.env, self.lp, &ub, index, index)
1218
check(status)
1219
1220
return ub if ub < int(CPX_INFBOUND) else None
1221
1222
else:
1223
x = 'U'
1224
c_value = value if value is not None else +CPX_INFBOUND
1225
status = CPXchgbds(self.env, self.lp, 1, &index, &x, &c_value)
1226
check(status)
1227
1228
cpdef variable_lower_bound(self, int index, value = False):
1229
r"""
1230
Returns or defines the lower bound on a variable
1231
1232
INPUT:
1233
1234
- ``index`` (integer) -- the variable's id
1235
1236
- ``value`` -- real value, or ``None`` to mean that the
1237
variable has not lower bound. When set to ``False``
1238
(default), the method returns the current value.
1239
1240
EXAMPLE::
1241
1242
sage: from sage.numerical.backends.generic_backend import get_solver
1243
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1244
sage: p.add_variable() # optional - CPLEX
1245
0
1246
sage: p.col_bounds(0) # optional - CPLEX
1247
(0.0, None)
1248
sage: p.variable_lower_bound(0, 5) # optional - CPLEX
1249
sage: p.col_bounds(0) # optional - CPLEX
1250
(5.0, None)
1251
1252
TESTS:
1253
1254
:trac:`14581`::
1255
1256
sage: P = MixedIntegerLinearProgram(solver="CPLEX") # optional - CPLEX
1257
sage: x = P["x"] # optional - CPLEX
1258
sage: P.set_min(x, 5) # optional - CPLEX
1259
sage: P.set_min(x, 0) # optional - CPLEX
1260
sage: P.get_min(x) # optional - CPLEX
1261
0.0
1262
"""
1263
cdef int status
1264
cdef double lb
1265
cdef char x
1266
cdef double c_value
1267
1268
if value is False:
1269
status = CPXgetlb(self.env, self.lp, &lb, index, index)
1270
check(status)
1271
return None if lb <= int(-CPX_INFBOUND) else lb
1272
1273
else:
1274
x = 'L'
1275
c_value = value if value is not None else -CPX_INFBOUND
1276
status = CPXchgbds(self.env, self.lp, 1, &index, &x, &c_value)
1277
check(status)
1278
1279
cpdef write_lp(self, char * filename):
1280
r"""
1281
Writes the problem to a .lp file
1282
1283
INPUT:
1284
1285
- ``filename`` (string)
1286
1287
EXAMPLE::
1288
1289
sage: from sage.numerical.backends.generic_backend import get_solver
1290
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1291
sage: p.add_variables(2) # optional - CPLEX
1292
1
1293
sage: p.add_linear_constraint([(0, 1), (1, 2)], None, 3) # optional - CPLEX
1294
sage: p.set_objective([2, 5]) # optional - CPLEX
1295
sage: p.write_lp(os.path.join(SAGE_TMP, "lp_problem.lp")) # optional - CPLEX
1296
"""
1297
1298
cdef int status
1299
cdef char * ext = "LP"
1300
status = CPXwriteprob(self.env, self.lp, filename, ext)
1301
check(status)
1302
1303
cpdef write_mps(self, char * filename, int modern):
1304
r"""
1305
Writes the problem to a .mps file
1306
1307
INPUT:
1308
1309
- ``filename`` (string)
1310
1311
EXAMPLE::
1312
1313
sage: from sage.numerical.backends.generic_backend import get_solver
1314
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1315
sage: p.add_variables(2) # optional - CPLEX
1316
1
1317
sage: p.add_linear_constraint([(0, 1), (1, 2)], None, 3) # optional - CPLEX
1318
sage: p.set_objective([2, 5]) # optional - CPLEX
1319
sage: p.write_lp(os.path.join(SAGE_TMP, "lp_problem.lp")) # optional - CPLEX
1320
"""
1321
1322
cdef int status
1323
cdef char * ext = "MPS"
1324
status = CPXwriteprob(self.env, self.lp, filename, ext)
1325
check(status)
1326
1327
cpdef CPLEXBackend copy(self):
1328
r"""
1329
Returns a copy of self.
1330
1331
EXAMPLE::
1332
1333
sage: from sage.numerical.backends.generic_backend import get_solver
1334
sage: p = MixedIntegerLinearProgram(solver = "CPLEX") # optional - CPLEX
1335
sage: b = p.new_variable() # optional - CPLEX
1336
sage: p.add_constraint(b[1] + b[2] <= 6) # optional - CPLEX
1337
sage: p.set_objective(b[1] + b[2]) # optional - CPLEX
1338
sage: copy(p).solve() # optional - CPLEX
1339
6.0
1340
"""
1341
cdef CPLEXBackend p = CPLEXBackend()
1342
1343
p.lp = CPXcloneprob(p.env, self.lp, &status)
1344
check(status)
1345
1346
p._mixed = self._mixed
1347
p.current_sol = self.current_sol
1348
1349
status = CPXchgprobtype(p.env, p.lp, CPXgetprobtype(self.env, self.lp))
1350
check(status)
1351
1352
return p
1353
1354
cpdef solver_parameter(self, name, value = None):
1355
"""
1356
Return or define a solver parameter
1357
1358
INPUT:
1359
1360
- ``name`` (string) -- the parameter
1361
1362
- ``value`` -- the parameter's value if it is to be defined,
1363
or ``None`` (default) to obtain its current value.
1364
1365
.. NOTE::
1366
1367
The list of available parameters is available at
1368
:meth:`sage.numerical.mip.MixedIntegerlinearProgram.solver_parameter`
1369
1370
EXAMPLE::
1371
1372
sage: from sage.numerical.backends.generic_backend import get_solver
1373
sage: p = get_solver(solver = "CPLEX") # optional - CPLEX
1374
sage: p.solver_parameter("timelimit", 60) # optional - CPLEX
1375
sage: p.solver_parameter("timelimit") # optional - CPLEX
1376
60.0
1377
"""
1378
cdef int intv
1379
cdef double doublev
1380
cdef char * strv
1381
1382
# If the name has to be translated to a CPLEX parameter ID
1383
if name == "timelimit":
1384
name = "CPX_PARAM_TILIM"
1385
1386
cdef int paramid = parameters.get(name,-1)
1387
1388
if paramid == -1:
1389
raise ValueError("This parameter is not available.")
1390
1391
# Type of the parameter. Can be INT (1), Double(2) or String(3)
1392
cdef int paramtype
1393
CPXgetparamtype(self.env, paramid, &paramtype)
1394
1395
if value is None:
1396
if paramtype == 1:
1397
CPXgetintparam(self.env, paramid, &intv)
1398
return intv
1399
elif paramtype == 2:
1400
CPXgetdblparam(self.env, paramid, &doublev)
1401
return doublev
1402
else:
1403
strv = <char *>sage_malloc(500*sizeof(char))
1404
CPXgetstrparam(self.env, paramid, strv)
1405
s = str(strv)
1406
sage_free(strv)
1407
return s
1408
else:
1409
if paramtype == 1:
1410
CPXsetintparam(self.env, paramid, value)
1411
elif paramtype == 2:
1412
CPXsetdblparam(self.env, paramid, value)
1413
else:
1414
CPXsetstrparam(self.env, paramid, value)
1415
1416
def __dealloc__(self):
1417
r"""
1418
Destructor for the class
1419
"""
1420
cdef int status
1421
1422
if self.lp != NULL:
1423
status = CPXfreeprob(self.env, &self.lp)
1424
1425
if self.env != NULL:
1426
status = CPXcloseCPLEX(&self.env)
1427
1428
cdef check(number):
1429
r"""
1430
Given a number, raises the corresponding exception or does nothing
1431
if ``number == 0``.
1432
1433
- ``number`` (integer) -- number corresponding to the error. If
1434
this number is unknown, the message contained in the raised
1435
exception will mention it.
1436
"""
1437
1438
# Below 1000 are 0 (no error), and some quality reports (but the
1439
# ERR* codes are above 1000)
1440
if number > 1000:
1441
from sage.numerical.mip import MIPSolverException
1442
default = "Error reported by the solver (unknown error number : "+str(number)+")"
1443
raise MIPSolverException("CPLEX: "+errors.get(number,default))
1444
1445
# Error codes
1446
#
1447
# Todo : when common error codes are returned, rewrite the message to
1448
# be more meaningful
1449
1450
cdef dict errors
1451
1452
errors = {
1453
1001 : "CPXERR_NO_MEMORY",
1454
1002 : "CPXERR_NO_ENVIRONMENT",
1455
1003 : "CPXERR_BAD_ARGUMENT",
1456
1004 : "CPXERR_NULL_POINTER",
1457
1006 : "CPXERR_CALLBACK",
1458
1009 : "CPXERR_NO_PROBLEM",
1459
1012 : "CPXERR_LIMITS_TOO_BIG",
1460
1013 : "CPXERR_BAD_PARAM_NUM",
1461
1014 : "CPXERR_PARAM_TOO_SMALL",
1462
1015 : "CPXERR_PARAM_TOO_BIG",
1463
1016 : "CPXERR_RESTRICTED_VERSION",
1464
1017 : "CPXERR_NOT_FOR_MIP",
1465
1018 : "CPXERR_NOT_FOR_QP",
1466
1019 : "CPXERR_CHILD_OF_CHILD",
1467
1020 : "CPXERR_TOO_MANY_THREADS",
1468
1021 : "CPXERR_CANT_CLOSE_CHILD",
1469
1022 : "CPXERR_BAD_PROB_TYPE",
1470
1023 : "CPXERR_NOT_ONE_PROBLEM",
1471
1024 : "CPXERR_NOT_MILPCLASS",
1472
1026 : "CPXERR_STR_PARAM_TOO_LONG",
1473
1027 : "CPXERR_DECOMPRESSION",
1474
1028 : "CPXERR_BAD_PARAM_NAME",
1475
1029 : "CPXERR_NOT_MIQPCLASS",
1476
1031 : "CPXERR_NOT_FOR_QCP",
1477
1051 : "CPXERR_MSG_NO_CHANNEL",
1478
1052 : "CPXERR_MSG_NO_FILEPTR",
1479
1053 : "CPXERR_MSG_NO_FUNCTION",
1480
1101 : "CPXERR_PRESLV_INForUNBD",
1481
1103 : "CPXERR_PRESLV_NO_PROB",
1482
1106 : "CPXERR_PRESLV_ABORT",
1483
1107 : "CPXERR_PRESLV_BASIS_MEM",
1484
1108 : "CPXERR_PRESLV_COPYSOS",
1485
1109 : "CPXERR_PRESLV_COPYORDER",
1486
1110 : "CPXERR_PRESLV_SOLN_MIP",
1487
1111 : "CPXERR_PRESLV_SOLN_QP",
1488
1112 : "CPXERR_PRESLV_START_LP",
1489
1114 : "CPXERR_PRESLV_FAIL_BASIS",
1490
1115 : "CPXERR_PRESLV_NO_BASIS",
1491
1117 : "CPXERR_PRESLV_INF",
1492
1118 : "CPXERR_PRESLV_UNBD",
1493
1119 : "CPXERR_PRESLV_DUAL",
1494
1120 : "CPXERR_PRESLV_UNCRUSHFORM",
1495
1121 : "CPXERR_PRESLV_CRUSHFORM",
1496
1122 : "CPXERR_PRESLV_BAD_PARAM",
1497
1123 : "CPXERR_PRESLV_TIME_LIM",
1498
1200 : "CPXERR_INDEX_RANGE",
1499
1201 : "CPXERR_COL_INDEX_RANGE",
1500
1203 : "CPXERR_ROW_INDEX_RANGE",
1501
1205 : "CPXERR_INDEX_RANGE_LOW",
1502
1206 : "CPXERR_INDEX_RANGE_HIGH",
1503
1207 : "CPXERR_NEGATIVE_SURPLUS",
1504
1208 : "CPXERR_ARRAY_TOO_LONG",
1505
1209 : "CPXERR_NAME_CREATION",
1506
1210 : "CPXERR_NAME_NOT_FOUND",
1507
1211 : "CPXERR_NO_RHS_IN_OBJ",
1508
1215 : "CPXERR_BAD_SENSE",
1509
1216 : "CPXERR_NO_RNGVAL",
1510
1217 : "CPXERR_NO_SOLN",
1511
1219 : "CPXERR_NO_NAMES",
1512
1221 : "CPXERR_NOT_FIXED",
1513
1222 : "CPXERR_DUP_ENTRY",
1514
1223 : "CPXERR_NO_BARRIER_SOLN",
1515
1224 : "CPXERR_NULL_NAME",
1516
1225 : "CPXERR_NAN",
1517
1226 : "CPXERR_ARRAY_NOT_ASCENDING",
1518
1227 : "CPXERR_COUNT_RANGE",
1519
1228 : "CPXERR_COUNT_OVERLAP",
1520
1229 : "CPXERR_BAD_LUB",
1521
1230 : "CPXERR_NODE_INDEX_RANGE",
1522
1231 : "CPXERR_ARC_INDEX_RANGE",
1523
1232 : "CPXERR_NO_DUAL_SOLN",
1524
1233 : "CPXERR_DBL_MAX",
1525
1234 : "CPXERR_THREAD_FAILED",
1526
1251 : "CPXERR_INDEX_NOT_BASIC",
1527
1252 : "CPXERR_NEED_OPT_SOLN",
1528
1253 : "CPXERR_BAD_STATUS",
1529
1254 : "CPXERR_NOT_UNBOUNDED",
1530
1255 : "CPXERR_SBASE_INCOMPAT",
1531
1256 : "CPXERR_SINGULAR",
1532
1257 : "CPXERR_PRIIND",
1533
1258 : "CPXERR_NO_LU_FACTOR",
1534
1260 : "CPXERR_NO_SENSIT",
1535
1261 : "CPXERR_NO_BASIC_SOLN",
1536
1262 : "CPXERR_NO_BASIS",
1537
1263 : "CPXERR_ABORT_STRONGBRANCH",
1538
1264 : "CPXERR_NO_NORMS",
1539
1265 : "CPXERR_NOT_DUAL_UNBOUNDED",
1540
1266 : "CPXERR_TILIM_STRONGBRANCH",
1541
1267 : "CPXERR_BAD_PIVOT",
1542
1268 : "CPXERR_TILIM_CONDITION_NO",
1543
1292 : "CPXERR_BAD_METHOD",
1544
1421 : "CPXERR_NO_FILENAME",
1545
1422 : "CPXERR_FAIL_OPEN_WRITE",
1546
1423 : "CPXERR_FAIL_OPEN_READ",
1547
1424 : "CPXERR_BAD_FILETYPE",
1548
1425 : "CPXERR_XMLPARSE",
1549
1431 : "CPXERR_TOO_MANY_ROWS",
1550
1432 : "CPXERR_TOO_MANY_COLS",
1551
1433 : "CPXERR_TOO_MANY_COEFFS",
1552
1434 : "CPXERR_BAD_NUMBER",
1553
1435 : "CPXERR_BAD_EXPO_RANGE",
1554
1436 : "CPXERR_NO_OBJ_SENSE",
1555
1437 : "CPXERR_QCP_SENSE_FILE",
1556
1438 : "CPXERR_BAD_LAZY_UCUT",
1557
1439 : "CPXERR_BAD_INDCONSTR",
1558
1441 : "CPXERR_NO_NAME_SECTION",
1559
1442 : "CPXERR_BAD_SOS_TYPE",
1560
1443 : "CPXERR_COL_ROW_REPEATS",
1561
1444 : "CPXERR_RIM_ROW_REPEATS",
1562
1445 : "CPXERR_ROW_REPEATS",
1563
1446 : "CPXERR_COL_REPEATS",
1564
1447 : "CPXERR_RIM_REPEATS",
1565
1448 : "CPXERR_ROW_UNKNOWN",
1566
1449 : "CPXERR_COL_UNKNOWN",
1567
1453 : "CPXERR_NO_ROW_SENSE",
1568
1454 : "CPXERR_EXTRA_FX_BOUND",
1569
1455 : "CPXERR_EXTRA_FR_BOUND",
1570
1456 : "CPXERR_EXTRA_BV_BOUND",
1571
1457 : "CPXERR_BAD_BOUND_TYPE",
1572
1458 : "CPXERR_UP_BOUND_REPEATS",
1573
1459 : "CPXERR_LO_BOUND_REPEATS",
1574
1460 : "CPXERR_NO_BOUND_TYPE",
1575
1461 : "CPXERR_NO_QMATRIX_SECTION",
1576
1462 : "CPXERR_BAD_SECTION_ENDATA",
1577
1463 : "CPXERR_INT_TOO_BIG_INPUT",
1578
1464 : "CPXERR_NAME_TOO_LONG",
1579
1465 : "CPXERR_LINE_TOO_LONG",
1580
1471 : "CPXERR_NO_ROWS_SECTION",
1581
1472 : "CPXERR_NO_COLUMNS_SECTION",
1582
1473 : "CPXERR_BAD_SECTION_BOUNDS",
1583
1474 : "CPXERR_RANGE_SECTION_ORDER",
1584
1475 : "CPXERR_BAD_SECTION_QMATRIX",
1585
1476 : "CPXERR_NO_OBJECTIVE",
1586
1477 : "CPXERR_ROW_REPEAT_PRINT",
1587
1478 : "CPXERR_COL_REPEAT_PRINT",
1588
1479 : "CPXERR_RIMNZ_REPEATS",
1589
1480 : "CPXERR_EXTRA_INTORG",
1590
1481 : "CPXERR_EXTRA_INTEND",
1591
1482 : "CPXERR_EXTRA_SOSORG",
1592
1483 : "CPXERR_EXTRA_SOSEND",
1593
1484 : "CPXERR_TOO_MANY_RIMS",
1594
1485 : "CPXERR_TOO_MANY_RIMNZ",
1595
1486 : "CPXERR_NO_ROW_NAME",
1596
1487 : "CPXERR_BAD_OBJ_SENSE",
1597
1550 : "CPXERR_BAS_FILE_SHORT",
1598
1551 : "CPXERR_BAD_INDICATOR",
1599
1552 : "CPXERR_NO_ENDATA",
1600
1553 : "CPXERR_FILE_ENTRIES",
1601
1554 : "CPXERR_SBASE_ILLEGAL",
1602
1555 : "CPXERR_BAS_FILE_SIZE",
1603
1556 : "CPXERR_NO_VECTOR_SOLN",
1604
1560 : "CPXERR_NOT_SAV_FILE",
1605
1561 : "CPXERR_SAV_FILE_DATA",
1606
1562 : "CPXERR_SAV_FILE_WRITE",
1607
1563 : "CPXERR_FILE_FORMAT",
1608
1602 : "CPXERR_ADJ_SIGNS",
1609
1603 : "CPXERR_RHS_IN_OBJ",
1610
1604 : "CPXERR_ADJ_SIGN_SENSE",
1611
1605 : "CPXERR_QUAD_IN_ROW",
1612
1606 : "CPXERR_ADJ_SIGN_QUAD",
1613
1607 : "CPXERR_NO_OPERATOR",
1614
1608 : "CPXERR_NO_OP_OR_SENSE",
1615
1609 : "CPXERR_NO_ID_FIRST",
1616
1610 : "CPXERR_NO_RHS_COEFF",
1617
1611 : "CPXERR_NO_NUMBER_FIRST",
1618
1612 : "CPXERR_NO_QUAD_EXP",
1619
1613 : "CPXERR_QUAD_EXP_NOT_2",
1620
1614 : "CPXERR_NO_QP_OPERATOR",
1621
1615 : "CPXERR_NO_NUMBER",
1622
1616 : "CPXERR_NO_ID",
1623
1617 : "CPXERR_BAD_ID",
1624
1618 : "CPXERR_BAD_EXPONENT",
1625
1619 : "CPXERR_Q_DIVISOR",
1626
1621 : "CPXERR_NO_BOUND_SENSE",
1627
1622 : "CPXERR_BAD_BOUND_SENSE",
1628
1623 : "CPXERR_NO_NUMBER_BOUND",
1629
1627 : "CPXERR_NO_SOS_SEPARATOR",
1630
1650 : "CPXERR_INVALID_NUMBER",
1631
1660 : "CPXERR_PRM_DATA",
1632
1661 : "CPXERR_PRM_HEADER",
1633
1719 : "CPXERR_NO_CONFLICT",
1634
1720 : "CPXERR_CONFLICT_UNSTABLE",
1635
1801 : "CPXERR_WORK_FILE_OPEN",
1636
1802 : "CPXERR_WORK_FILE_READ",
1637
1803 : "CPXERR_WORK_FILE_WRITE",
1638
1804 : "CPXERR_IN_INFOCALLBACK",
1639
1805 : "CPXERR_MIPSEARCH_WITH_CALLBACKS",
1640
1806 : "CPXERR_LP_NOT_IN_ENVIRONMENT",
1641
1807 : "CPXERR_PARAM_INCOMPATIBLE",
1642
32000 : "CPXERR_LICENSE_MIN",
1643
32201 : "CPXERR_ILOG_LICENSE",
1644
32301 : "CPXERR_NO_MIP_LIC",
1645
32302 : "CPXERR_NO_BARRIER_LIC",
1646
32305 : "CPXERR_NO_MIQP_LIC",
1647
32018 : "CPXERR_BADLDWID",
1648
32023 : "CPXERR_BADPRODUCT",
1649
32024 : "CPXERR_ALGNOTLICENSED",
1650
32999 : "CPXERR_LICENSE_MAX",
1651
1701 : "CPXERR_IIS_NO_INFO",
1652
1702 : "CPXERR_IIS_NO_SOLN",
1653
1703 : "CPXERR_IIS_FEAS",
1654
1704 : "CPXERR_IIS_NOT_INFEAS",
1655
1705 : "CPXERR_IIS_OPT_INFEAS",
1656
1706 : "CPXERR_IIS_DEFAULT",
1657
1707 : "CPXERR_IIS_NO_BASIC",
1658
1709 : "CPXERR_IIS_NO_LOAD",
1659
1710 : "CPXERR_IIS_SUB_OBJ_LIM",
1660
1711 : "CPXERR_IIS_SUB_IT_LIM",
1661
1712 : "CPXERR_IIS_SUB_TIME_LIM",
1662
1713 : "CPXERR_IIS_NUM_BEST",
1663
1714 : "CPXERR_IIS_SUB_ABORT",
1664
3003 : "CPXERR_NOT_MIP",
1665
3006 : "CPXERR_BAD_PRIORITY",
1666
3007 : "CPXERR_ORDER_BAD_DIRECTION",
1667
3009 : "CPXERR_ARRAY_BAD_SOS_TYPE",
1668
3010 : "CPXERR_UNIQUE_WEIGHTS",
1669
3012 : "CPXERR_BAD_DIRECTION",
1670
3015 : "CPXERR_NO_SOS",
1671
3016 : "CPXERR_NO_ORDER",
1672
3018 : "CPXERR_INT_TOO_BIG",
1673
3019 : "CPXERR_SUBPROB_SOLVE",
1674
3020 : "CPXERR_NO_MIPSTART",
1675
3021 : "CPXERR_BAD_CTYPE",
1676
3023 : "CPXERR_NO_INT_X",
1677
3024 : "CPXERR_NO_SOLNPOOL",
1678
3301 : "CPXERR_MISS_SOS_TYPE",
1679
3412 : "CPXERR_NO_TREE",
1680
3413 : "CPXERR_TREE_MEMORY_LIMIT",
1681
3414 : "CPXERR_FILTER_VARIABLE_TYPE",
1682
3504 : "CPXERR_NODE_ON_DISK",
1683
3601 : "CPXERR_PTHREAD_MUTEX_INIT",
1684
3603 : "CPXERR_PTHREAD_CREATE",
1685
1212 : "CPXERR_UNSUPPORTED_CONSTRAINT_TYPE",
1686
1213 : "CPXERR_ILL_DEFINED_PWL",
1687
1530 : "CPXERR_NET_DATA",
1688
1531 : "CPXERR_NOT_MIN_COST_FLOW",
1689
1532 : "CPXERR_BAD_ROW_ID",
1690
1537 : "CPXERR_BAD_CHAR",
1691
1538 : "CPXERR_NET_FILE_SHORT",
1692
5002 : "CPXERR_Q_NOT_POS_DEF",
1693
5004 : "CPXERR_NOT_QP",
1694
5011 : "CPXERR_Q_DUP_ENTRY",
1695
5012 : "CPXERR_Q_NOT_SYMMETRIC",
1696
5014 : "CPXERR_Q_NOT_INDEF",
1697
6002 : "CPXERR_QCP_SENSE"
1698
}
1699
1700
cdef dict parameters
1701
parameters = {
1702
"CPX_PARAMTYPE_NONE" : 0,
1703
"CPX_PARAMTYPE_INT" : 1,
1704
"CPX_PARAMTYPE_DOUBLE" : 2,
1705
"CPX_PARAMTYPE_STRING" : 3,
1706
"CPX_PARAM_ADVIND" : 1001,
1707
"CPX_PARAM_AGGFILL" : 1002,
1708
"CPX_PARAM_AGGIND" : 1003,
1709
"CPX_PARAM_BASINTERVAL" : 1004,
1710
"CPX_PARAM_CFILEMUL" : 1005,
1711
"CPX_PARAM_CLOCKTYPE" : 1006,
1712
"CPX_PARAM_CRAIND" : 1007,
1713
"CPX_PARAM_DEPIND" : 1008,
1714
"CPX_PARAM_DPRIIND" : 1009,
1715
"CPX_PARAM_PRICELIM" : 1010,
1716
"CPX_PARAM_EPMRK" : 1013,
1717
"CPX_PARAM_EPOPT" : 1014,
1718
"CPX_PARAM_EPPER" : 1015,
1719
"CPX_PARAM_EPRHS" : 1016,
1720
"CPX_PARAM_FASTMIP" : 1017,
1721
"CPX_PARAM_SIMDISPLAY" : 1019,
1722
"CPX_PARAM_ITLIM" : 1020,
1723
"CPX_PARAM_ROWREADLIM" : 1021,
1724
"CPX_PARAM_NETFIND" : 1022,
1725
"CPX_PARAM_COLREADLIM" : 1023,
1726
"CPX_PARAM_NZREADLIM" : 1024,
1727
"CPX_PARAM_OBJLLIM" : 1025,
1728
"CPX_PARAM_OBJULIM" : 1026,
1729
"CPX_PARAM_PERIND" : 1027,
1730
"CPX_PARAM_PERLIM" : 1028,
1731
"CPX_PARAM_PPRIIND" : 1029,
1732
"CPX_PARAM_PREIND" : 1030,
1733
"CPX_PARAM_REINV" : 1031,
1734
"CPX_PARAM_REVERSEIND" : 1032,
1735
"CPX_PARAM_RFILEMUL" : 1033,
1736
"CPX_PARAM_SCAIND" : 1034,
1737
"CPX_PARAM_SCRIND" : 1035,
1738
"CPX_PARAM_SINGLIM" : 1037,
1739
"CPX_PARAM_SINGTOL" : 1038,
1740
"CPX_PARAM_TILIM" : 1039,
1741
"CPX_PARAM_XXXIND" : 1041,
1742
"CPX_PARAM_PREDUAL" : 1044,
1743
"CPX_PARAM_EPOPT_H" : 1049,
1744
"CPX_PARAM_EPRHS_H" : 1050,
1745
"CPX_PARAM_PREPASS" : 1052,
1746
"CPX_PARAM_DATACHECK" : 1056,
1747
"CPX_PARAM_REDUCE" : 1057,
1748
"CPX_PARAM_PRELINEAR" : 1058,
1749
"CPX_PARAM_LPMETHOD" : 1062,
1750
"CPX_PARAM_QPMETHOD" : 1063,
1751
"CPX_PARAM_WORKDIR" : 1064,
1752
"CPX_PARAM_WORKMEM" : 1065,
1753
"CPX_PARAM_THREADS" : 1067,
1754
"CPX_PARAM_CONFLICTDISPLAY" : 1074,
1755
"CPX_PARAM_SIFTDISPLAY" : 1076,
1756
"CPX_PARAM_SIFTALG" : 1077,
1757
"CPX_PARAM_SIFTITLIM" : 1078,
1758
"CPX_PARAM_MPSLONGNUM" : 1081,
1759
"CPX_PARAM_MEMORYEMPHASIS" : 1082,
1760
"CPX_PARAM_NUMERICALEMPHASIS" : 1083,
1761
"CPX_PARAM_FEASOPTMODE" : 1084,
1762
"CPX_PARAM_PARALLELMODE" : 1109,
1763
"CPX_PARAM_TUNINGMEASURE" : 1110,
1764
"CPX_PARAM_TUNINGREPEAT" : 1111,
1765
"CPX_PARAM_TUNINGTILIM" : 1112,
1766
"CPX_PARAM_TUNINGDISPLAY" : 1113,
1767
"CPX_PARAM_WRITELEVEL" : 1114,
1768
"CPX_PARAM_ALL_MIN" : 1000,
1769
"CPX_PARAM_ALL_MAX" : 6000,
1770
"CPX_PARAM_BARDSTART" : 3001,
1771
"CPX_PARAM_BAREPCOMP" : 3002,
1772
"CPX_PARAM_BARGROWTH" : 3003,
1773
"CPX_PARAM_BAROBJRNG" : 3004,
1774
"CPX_PARAM_BARPSTART" : 3005,
1775
"CPX_PARAM_BARALG" : 3007,
1776
"CPX_PARAM_BARCOLNZ" : 3009,
1777
"CPX_PARAM_BARDISPLAY" : 3010,
1778
"CPX_PARAM_BARITLIM" : 3012,
1779
"CPX_PARAM_BARMAXCOR" : 3013,
1780
"CPX_PARAM_BARORDER" : 3014,
1781
"CPX_PARAM_BARSTARTALG" : 3017,
1782
"CPX_PARAM_BARCROSSALG" : 3018,
1783
"CPX_PARAM_BARQCPEPCOMP" : 3020,
1784
"CPX_PARAM_BRDIR" : 2001,
1785
"CPX_PARAM_BTTOL" : 2002,
1786
"CPX_PARAM_CLIQUES" : 2003,
1787
"CPX_PARAM_COEREDIND" : 2004,
1788
"CPX_PARAM_COVERS" : 2005,
1789
"CPX_PARAM_CUTLO" : 2006,
1790
"CPX_PARAM_CUTUP" : 2007,
1791
"CPX_PARAM_EPAGAP" : 2008,
1792
"CPX_PARAM_EPGAP" : 2009,
1793
"CPX_PARAM_EPINT" : 2010,
1794
"CPX_PARAM_MIPDISPLAY" : 2012,
1795
"CPX_PARAM_MIPINTERVAL" : 2013,
1796
"CPX_PARAM_INTSOLLIM" : 2015,
1797
"CPX_PARAM_NODEFILEIND" : 2016,
1798
"CPX_PARAM_NODELIM" : 2017,
1799
"CPX_PARAM_NODESEL" : 2018,
1800
"CPX_PARAM_OBJDIF" : 2019,
1801
"CPX_PARAM_MIPORDIND" : 2020,
1802
"CPX_PARAM_RELOBJDIF" : 2022,
1803
"CPX_PARAM_STARTALG" : 2025,
1804
"CPX_PARAM_SUBALG" : 2026,
1805
"CPX_PARAM_TRELIM" : 2027,
1806
"CPX_PARAM_VARSEL" : 2028,
1807
"CPX_PARAM_BNDSTRENIND" : 2029,
1808
"CPX_PARAM_HEURFREQ" : 2031,
1809
"CPX_PARAM_MIPORDTYPE" : 2032,
1810
"CPX_PARAM_CUTSFACTOR" : 2033,
1811
"CPX_PARAM_RELAXPREIND" : 2034,
1812
"CPX_PARAM_PRESLVND" : 2037,
1813
"CPX_PARAM_BBINTERVAL" : 2039,
1814
"CPX_PARAM_FLOWCOVERS" : 2040,
1815
"CPX_PARAM_IMPLBD" : 2041,
1816
"CPX_PARAM_PROBE" : 2042,
1817
"CPX_PARAM_GUBCOVERS" : 2044,
1818
"CPX_PARAM_STRONGCANDLIM" : 2045,
1819
"CPX_PARAM_STRONGITLIM" : 2046,
1820
"CPX_PARAM_FRACCAND" : 2048,
1821
"CPX_PARAM_FRACCUTS" : 2049,
1822
"CPX_PARAM_FRACPASS" : 2050,
1823
"CPX_PARAM_FLOWPATHS" : 2051,
1824
"CPX_PARAM_MIRCUTS" : 2052,
1825
"CPX_PARAM_DISJCUTS" : 2053,
1826
"CPX_PARAM_AGGCUTLIM" : 2054,
1827
"CPX_PARAM_MIPCBREDLP" : 2055 ,
1828
"CPX_PARAM_CUTPASS" : 2056,
1829
"CPX_PARAM_MIPEMPHASIS" : 2058,
1830
"CPX_PARAM_SYMMETRY" : 2059,
1831
"CPX_PARAM_DIVETYPE" : 2060,
1832
"CPX_PARAM_RINSHEUR" : 2061,
1833
"CPX_PARAM_SUBMIPNODELIM" : 2062,
1834
"CPX_PARAM_LBHEUR" : 2063,
1835
"CPX_PARAM_REPEATPRESOLVE" : 2064,
1836
"CPX_PARAM_PROBETIME" : 2065,
1837
"CPX_PARAM_POLISHTIME" : 2066,
1838
"CPX_PARAM_REPAIRTRIES" : 2067,
1839
"CPX_PARAM_EPLIN" : 2068,
1840
"CPX_PARAM_EPRELAX" : 2073,
1841
"CPX_PARAM_FPHEUR" : 2098,
1842
"CPX_PARAM_EACHCUTLIM" : 2102,
1843
"CPX_PARAM_SOLNPOOLCAPACITY" : 2103 ,
1844
"CPX_PARAM_SOLNPOOLREPLACE" : 2104 ,
1845
"CPX_PARAM_SOLNPOOLGAP" : 2105 ,
1846
"CPX_PARAM_SOLNPOOLAGAP" : 2106 ,
1847
"CPX_PARAM_SOLNPOOLINTENSITY" : 2107,
1848
"CPX_PARAM_POPULATELIM" : 2108,
1849
"CPX_PARAM_MIPSEARCH" : 2109,
1850
"CPX_PARAM_MIQCPSTRAT" : 2110,
1851
"CPX_PARAM_ZEROHALFCUTS" : 2111,
1852
"CPX_PARAM_POLISHAFTEREPAGAP" : 2126,
1853
"CPX_PARAM_POLISHAFTEREPGAP" : 2127,
1854
"CPX_PARAM_POLISHAFTERNODE" : 2128,
1855
"CPX_PARAM_POLISHAFTERINTSOL" : 2129,
1856
"CPX_PARAM_POLISHAFTERTIME" : 2130,
1857
"CPX_PARAM_MCFCUTS" : 2134,
1858
"CPX_PARAM_NETITLIM" : 5001,
1859
"CPX_PARAM_NETEPOPT" : 5002,
1860
"CPX_PARAM_NETEPRHS" : 5003,
1861
"CPX_PARAM_NETPPRIIND" : 5004,
1862
"CPX_PARAM_NETDISPLAY" : 5005,
1863
"CPX_PARAM_QPNZREADLIM" : 4001,
1864
"CPX_PARAM_QPMAKEPSDIND" : 4010,
1865
}
1866
1867