Getsetsolver¶
- changeCobraSolver(solverName, problemType, printLevel, validationLevel)[source]¶
Changes the Cobra Toolbox optimization solver(s)
- USAGE
[solverOK, solverInstalled] = changeCobraSolver (solverName, problemType, printLevel, validationLevel)
- INPUTS
solverName – Solver name
problemType – Problem type (‘LP’ by default) (a) One of the following: LP MILP, QP, MIQP ‘EP’, ‘CLP’ (b) ‘all’ attempts to change all applicable solvers to solverName. This is purely a shorthand convenience. (c) Cell array of problemTypes, e.g. {‘LP’,’QP’}
printLevel – verbose level
if 0, warnings and errors are silenced
if > 0, warnings and errors are thrown. (default: 1)
- OPTIONAL INPUT
validationLevel – how much validation to use
-1: assign only the global variable. Do not assign any path.
0: adjust solver paths but don’t validate the solver
1: validate but remove outputs, silent (default)
2: validate and keep any outputs
- OUTPUT
solverOK – true if solver can be accessed, false if not
solverInstalled – true if the solver is installed (not necessarily working)
- USAGE
The following is an example of how to change gurobi to be the LP solver
[solverOK, solverInstalled] = changeCobraSolver (‘gurobi’,’LP’)
If there are problems changing to a solver, use the following call to debug
[solverOK, solverInstalled] = changeCobraSolver (‘gurobi’,’LP’,1,1)
Currently allowed LP solvers:
fully supported solvers
cplex_direct
CPLEX accessed directly through Tomlab cplex.m. This gives the user more control of solver parameters. e.g. minimising the Euclidean norm of the internal flux to get rid of net flux around loops
dqqMinos
Double Quad Quad precision solver for ill scaled prob
pronnb
glpk
GLPK solver with Matlab mex interface (glpkmex)
gurobi
Gurobi solver
ibm_cplex
The IBM API for CPLEX using the CPLEX class
matlab
MATLAB’s linprog function
mosek
Mosek LP solver with Matlab API (using linprog.m from Mosek)
pdco
PDCO solver
quadMinos
quad solver
tomlab_cplex
CPLEX accessed through Tomlab environment (default)
cplexlp
CPLEX accessed through IBM matlab functions
legacy solvers:
lindo_new
Lindo API > v2.0
lindo_legacy
Lindo API < v2.0
lp_solve
lp_solve with Matlab API
gurobi_mex
Gurobi accessed through Matlab mex interface (Gurobi mex)
opti
CLP(recommended), CSDP, DSDP, OOQP and SCIP(recommended) solver installed and called with OPTI TB wrapper Lower level calls with installed mex files are possible but best avoided for all solvers
Currently allowed MILP solvers:
fully supported solvers:
cplex_direct
CPLEX accessed directly through Tomlab cplex.m. This gives the user more control of solver parameters. e.g. minimising the Euclidean norm of the internal flux to get rid of net flux around loops
glpk
glpk MILP solver with Matlab mex interface (glpkmex)
gurobi
Gurobi solver
ibm_cplex
The IBM API for CPLEX using the CPLEX class
mosek
Mosek LP solver with Matlab API (using linprog.m from Mosek)
tomlab_cplex
CPLEX MILP solver accessed through Tomlab environment
legacy solvers:
gurobi_mex
Gurobi accessed through Matlab mex interface (Gurobi mex)
opti
CLP(recommended), CSDP, DSDP, OOQP and SCIP(recommended) solver installed and called with OPTI TB wrapper Lower level calls with installed mex files are possible but best avoided for all solvers
Currently allowed QP solvers:
fully supported solvers:
cplex_direct
CPLEX accessed directly through Tomlab cplex.m. This gives the user more control of solver parameters. e.g. minimising the Euclidean norm of the internal flux to get rid of net flux around loops
gurobi
Gurobi solver
ibm_cplex
The IBM API for CPLEX using the CPLEX class
mosek
Mosek QP solver with Matlab API
pdco
PDCO solver
tomlab_cplex
CPLEX QP solver accessed through Tomlab environment
dqqMinos
Double Quad Quad precision solver for ill scaled prob
experimental support:
qpng
qpng QP solver with Matlab mex interface (in glpkmex package, only limited support for small problems)
legacy solvers:
gurobi_mex
Gurobi accessed through Matlab mex interface (Gurobi mex)
opti
CLP(recommended), CSDP, DSDP, OOQP and SCIP(recommended) solver installed and called with OPTI TB wrapper. Lower level calls with installed mex files are possible
Currently allowed MIQP solvers:
fully supported solvers:
cplex_direct
CPLEX accessed directly through Tomlab cplex.m. This gives the user more control of solver parameters. e.g. minimising the Euclidean norm of the internal flux to get rid of net flux around loops
gurobi
Gurobi solver
ibm_cplex
The IBM API for CPLEX using the CPLEX class
tomlab_cplex
CPLEX MIQP solver accessed through Tomlab environment
legacy solvers:
gurobi_mex
Gurobi accessed through Matlab mex interface (Gurobi mex)
Currently allowed NLP solvers:
fully supported solvers:
matlab
MATLAB’s fmincon.m
quadMinos
quad solver
experimental support:
tomlab_snopt
SNOPT solver accessed through Tomlab environment
Note
It is a good idea to put this function call into your startup.m file (usually matlabinstall/toolboxes/local/startup.m)
- getAvailableSolversByType()[source]¶
Get the available solvers for the different solver types on the system.
- USAGE
solvers = getAvailableSolversByType()
- OUTPUT
solvers – struct containing one field per Problem type listing all solvers installed on the system for that problem type. Also contains an ALL field indicating all available solvers
- getCobraSolver(solverType, validate)[source]¶
Gets the current solver name given a solver type
- INPUTS
solverType – Solver type, LP, MILP, QP, MIQP (opt, default LP, all). ‘all’ attempts to change all applicable solvers to solverName. This is purely a shorthand convenience.
validate
- OUTPUT
solverName – Solver name
solverOK – true if solver can be accessed, false if not
solverInstalled – true if the solver is installed (not necessarily working)
- getCobraSolverVersion(solverName, printLevel, rootPathSolver)[source]¶
detects the version of given COBRA solver
- USAGE
solverVersion = getCobraSolverVersion (solverName, printLevel, rootPathSolver)
- INPUT
solverName – Name of the solver
printLevel – verbose level (default: 0)
rootPathSolver – Path to the solver installation
- OUTPUT
solverVersion – string that contains the version number