Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 15 additions & 15 deletions src/analysis/wholeBody/PSCMToolbox/optimizeWBModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,15 @@

case 'ibm_cplex'
% https://www.ibm.com/docs/en/icos/12.10.0?topic=infeasibility-coping-ill-conditioned-problem-handling-unscaled-infeasibilities
param.minNorm = 0;
% param.minNorm = 0;

% Decides how to scale the problem matrix.
% Value Meaning
% -1 No scaling
% 0 Equilibration scaling; default
% 1 More aggressive scaling
% https://www.ibm.com/docs/en/icos/12.10.0?topic=parameters-scale-parameter
param.scaind = -1;
% param.scaind = -1;

% Emphasizes precision in numerically unstable or difficult problems.
% This parameter lets you specify to CPLEX that it should emphasize precision in
Expand All @@ -198,7 +198,7 @@
% 0 Do not emphasize numerical precision; default
% 1 Exercise extreme caution in computation
% https://www.ibm.com/docs/en/icos/12.10.0?topic=parameters-numerical-precision-emphasis
param.emphasis_numerical=1;
% param.emphasis_numerical=1;
case 'mosek'
param.MSK_DPAR_OPTIMIZER_MAX_TIME=param.secondsTimeLimit;
param.MSK_IPAR_WRITE_DATA_PARAM='MSK_ON';
Expand Down Expand Up @@ -258,26 +258,26 @@
noLinearObjective = all(model.c==0);

if noLinearObjective
[tmp, solverOK] = getCobraSolver('QP');
solverName{1,1} = tmp;
solverName{1,2} = 'QP';
[tmp, solverOK] = getCobraSolver('QP', 1);
solverNameQP{1,1} = tmp;
solverNameQP{1,2} = 'QP';
else
[solverName{1,1}, solverOK] = getCobraSolver('LP');
solverName{1,2} = 'QP';
[solverName{2,1}, solverOK] = getCobraSolver('QP');
solverName{2,2} = 'QP';
[solverNameQP{1,1}, solverOK] = getCobraSolver('LP', 1);
solverNameQP{1,2} = 'QP';
[solverNameQP{2,1}, solverOK] = getCobraSolver('QP', 1);
solverNameQP{2,2} = 'QP';
end

for i = 1:size(solverName,1)
if ~any(strcmp(solverName{i,1},validatedSolvers))
for i = 1:size(solverNameQP,1)
if ~any(strcmp(solverNameQP{i,1},validatedSolvers))
fprintf('%s\n','Note that the solvers validated for use with the PSCM toolbox are:')
disp(validatedSolvers)
%switch over to a validated solver
[solverOK, solverInstalled] = changeCobraSolver('tomlab_cplex', solverName{i,2},1,1);
[solverOK, solverInstalled] = changeCobraSolver('tomlab_cplex', solverNameQP{i,2},1,1);
if solverOK
fprintf('%s\n',[solverName{i,1} ' has not been validated for use with the PSCM toolbox. Tried to change to tomlab_cplex, but it failed.'])
fprintf('%s\n',[solverNameQP{i,1} ' has not been validated for use with the PSCM toolbox. Tried to change to tomlab_cplex, but it failed.'])
else
error([solverName{i,1} ' has not been validated for use with the PSCM toolbox. Tried to change to tomlab_cplex, but it failed.'])
error([solverNameQP{i,1} ' has not been validated for use with the PSCM toolbox. Tried to change to tomlab_cplex, but it failed.'])
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions src/base/solvers/buildOptProblemFromModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@
%nothing to do - done above already
case 'QP'
%nothing to do - done above already
case 'QPold'
%nothing to do - done above already
case 'QRLP'
[m,n]=size(optProblem.A);
optProblem.A = [...
Expand Down