@@ -16,11 +16,8 @@ function initCobraToolbox(updateToolbox)
16
16
%
17
17
% initCobraToolbox
18
18
% -or-
19
- % changeCobraSolver('gurobi');
20
- % changeCobraSolver('gurobi', 'MILP');
21
- % changeCobraSolver('tomlab_cplex', 'QP');
22
- % changeCobraSolver('tomlab_cplex', 'MIQP');
23
- % changeCbMapOutput('svg');
19
+ % changeCobraSolver('gurobi','all');
20
+ % changeCobraSolver('mosek', 'CLP');
24
21
%
25
22
% Maintained by Ronan M.T. Fleming
26
23
@@ -362,18 +359,7 @@ function initCobraToolbox(updateToolbox)
362
359
% requires the solver compatibility to be re-read at each initialisation
363
360
clear isCompatible
364
361
365
- % These default tolerances are based on the default values for the Gurobi LP
366
- % solver. Do not change them without first consulting with other developers.
367
- % https://www.gurobi.com/documentation/9.0/refman/parameters.html
368
- % (primal) feasibility tolerance
369
- changeCobraSolverParams(' LP' , ' feasTol' , 1e-6 );
370
- % (dual) optimality tolerance
371
- changeCobraSolverParams(' LP' , ' optTol' , 1e-6 );
372
362
373
- % (primal) feasibility tolerance
374
- changeCobraSolverParams(' EP' , ' feasTol' , 1e-8 );
375
- % (dual) optimality tolerance
376
- changeCobraSolverParams(' EP' , ' optTol' , 1e- 12 );
377
363
378
364
% Check that SBML toolbox is installed and accessible
379
365
if ~exist(' TranslateSBML' , ' file' )
@@ -409,10 +395,8 @@ function initCobraToolbox(updateToolbox)
409
395
% Define a set of "use first" solvers, other supported solvers will also be added to the struct.
410
396
% This allows to assign them in any order but keep the most commonly used ones on top of the struct.
411
397
SOLVERS = struct(' gurobi' ,struct(),...
412
- ' ibm_cplex' ,struct(),...
413
- ' tomlab_cplex' ,struct(),...
414
- ' glpk' ,struct(),...
415
398
' mosek' ,struct(),...
399
+ ' glpk' ,struct(),...
416
400
' matlab' ,struct());
417
401
418
402
% active support - supported solvers
@@ -423,25 +407,24 @@ function initCobraToolbox(updateToolbox)
423
407
SOLVERS.quadMinos.type = {' LP' };
424
408
SOLVERS.dqqMinos.type = {' LP' ,' QP' };
425
409
SOLVERS.matlab.type = {' LP' , ' NLP' };
426
- % active support of cplex interfaces - supported solvers
427
- SOLVERS.cplex_direct.type = {' LP' , ' MILP' , ' QP' };
428
- SOLVERS.ibm_cplex.type = {' LP' , ' MILP' , ' QP' , ' MIQP' };
429
- SOLVERS.cplexlp.type = {' LP' };
430
- SOLVERS.tomlab_cplex.type = {' LP' , ' MILP' , ' QP' , ' MIQP' };
410
+
431
411
432
412
% passive support - solver interfaces
433
413
SOLVERS.qpng.type = {' QP' };
434
414
SOLVERS.tomlab_snopt.type = {' NLP' };
435
415
436
416
% legacy solvers
417
+ SOLVERS.cplex_direct.type = {' LP' , ' MILP' , ' QP' };
418
+ SOLVERS.ibm_cplex.type = {' LP' , ' MILP' , ' QP' , ' MIQP' };
419
+ SOLVERS.cplexlp.type = {' LP' };
420
+ SOLVERS.tomlab_cplex.type = {' LP' , ' MILP' , ' QP' , ' MIQP' };
437
421
% SOLVERS.gurobi_mex.type = {'LP', 'MILP', 'QP', 'MIQP'};
438
422
% SOLVERS.lindo_old.type = {'LP'};
439
423
% SOLVERS.lindo_legacy.type = {'LP'};
440
424
SOLVERS.lp_solve.type = {' LP' };
441
425
% SOLVERS.opti.type = {'LP', 'MILP', 'QP', 'MIQP', 'NLP'};
442
426
443
427
% definition of category of solvers with active support
444
-
445
428
SOLVERS.dqqMinos.categ = ' active' ;
446
429
SOLVERS.glpk.categ = ' active' ;
447
430
SOLVERS.gurobi.categ = ' active' ;
@@ -450,11 +433,6 @@ function initCobraToolbox(updateToolbox)
450
433
SOLVERS.pdco.categ = ' active' ;
451
434
SOLVERS.quadMinos.categ = ' active' ;
452
435
453
- SOLVERS.cplex_direct.categ = ' active' ;
454
- SOLVERS.ibm_cplex.categ = ' active' ;
455
- SOLVERS.cplexlp.categ = ' active' ;
456
- SOLVERS.tomlab_cplex.categ = ' active' ;
457
-
458
436
% definition of category of solvers with passive support
459
437
SOLVERS.qpng.categ = ' passive' ;
460
438
SOLVERS.tomlab_snopt.categ = ' passive' ;
@@ -464,6 +442,10 @@ function initCobraToolbox(updateToolbox)
464
442
% SOLVERS.lindo_old.categ = 'legacy';
465
443
% SOLVERS.lindo_legacy.categ = 'legacy';
466
444
SOLVERS.lp_solve.categ = ' legacy' ;
445
+ SOLVERS.cplex_direct.categ = ' legacy' ;
446
+ SOLVERS.ibm_cplex.categ = ' legacy' ;
447
+ SOLVERS.cplexlp.categ = ' legacy' ;
448
+ SOLVERS.tomlab_cplex.categ = ' legacy' ;
467
449
% SOLVERS.opti.categ = 'legacy';
468
450
469
451
% definition of categories of solvers
@@ -484,17 +466,19 @@ function initCobraToolbox(updateToolbox)
484
466
end
485
467
end
486
468
487
- % check the installation of the solver
469
+ supportedSolversNames = setdiff(supportedSolversNames ,{' cplex_direct' ,' ibm_cplex' ,' cplexlp' ,' tomlab_cplex' });
470
+
471
+ % check the installation of the solver - except cplex
488
472
for i = 1 : length(supportedSolversNames )
489
473
if 0 % set to 1 to debug a new solver
490
474
disp(supportedSolversNames{i })
491
- if strcmp(supportedSolversNames{i },' quadMinos' )
492
- pause( 0.1 )
475
+ if strcmp(supportedSolversNames{i },' quadMinos' )
476
+ disp(supportedSolversNames{ i } )
493
477
end
494
478
end
495
479
% We will validate all solvers in init. After this, all solvers are
496
480
% checked, whether they actually work and the SOLVERS field is set.
497
- [solverOK ,solverInstalled ] = changeCobraSolver(supportedSolversNames{i },SOLVERS.(supportedSolversNames{i }).type{1 },0 , 2 );
481
+ [solverOK ,solverInstalled ] = changeCobraSolver(supportedSolversNames{i },SOLVERS.(supportedSolversNames{i }).type{1 },0 , 1 );
498
482
if strcmp(supportedSolversNames{i },' gurobi' ) && 0 % use fordebugging
499
483
disp(supportedSolversNames{i });
500
484
end
@@ -667,7 +651,6 @@ function initCobraToolbox(updateToolbox)
667
651
668
652
% use Gurobi (if installed) as the default solver for LP, QP and MILP problems
669
653
changeCobraSolver(' gurobi' , ' ALL' , 0 );
670
- % changeCobraSolver('ibm_cplex', 'QP', 0); %until problem with gurobi QP sorted
671
654
672
655
% check if a new update exists
673
656
if installedGit && ENV_VARS .printLevel && status_curl == 0 && contains(result_curl , ' 200' ) && updateToolbox
0 commit comments