Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
26 changes: 13 additions & 13 deletions src/analysis/wholeBody/PSCMToolbox/optimizeWBModel.m
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@

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
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