Skip to content

Commit

Permalink
cplex NET default algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
rmtfleming committed Sep 29, 2024
1 parent 0651958 commit aa28c1d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 9 deletions.
8 changes: 8 additions & 0 deletions src/base/solvers/cplex/setCplexParametersForProblem.m
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,16 @@
% 6 CPX_ALG_CONCURRENT Concurrent (Dual, Barrier, and Primal in opportunistic parallel mode; Dual and Barrier in deterministic parallel mode)
cplexProblem.Param.lpmethod.Cur=solverParams.lpmethod;
%cplexProblem.Param.qpmethod.Cur='CPX_ALG_PRIMAL';
else
cplexProblem.Param.lpmethod.Cur=3;%best benchmark performance on Harvetta
end

if isfield(solverParams,'timelimit')
%https://www.ibm.com/docs/en/icos/12.10.0?topic=parameters-optimizer-time-limit-in-seconds
cplexProblem.Param.timelimit.Cur = solverParams.timelimit;
end


if isfield(solverParams,'printLevel')
solverParams=rmfield(solverParams,'printLevel');
end
Expand Down
7 changes: 3 additions & 4 deletions src/base/solvers/msk/parseMskResult.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
origStat = res.sol.itr.solsta;
%disp(origStat)
switch origStat
case {'OPTIMAL','MSK_SOL_STA_OPTIMAL','MSK_SOL_STA_NEAR_OPTIMAL','UNKNOWN'}
case {'OPTIMAL','MSK_SOL_STA_OPTIMAL','MSK_SOL_STA_NEAR_OPTIMAL'}
if strcmp(res.rcodestr,'MSK_RES_TRM_STALL')
warning('Mosek stalling, returning solution as it may be almost optimal')
else
Expand Down Expand Up @@ -130,9 +130,8 @@
warning(['Unrecognised solsta: ' origStat])
stat=-1; %some other problem
end
end

if isfield(res.sol,'bas') && ~isequal(res.sol.bas.solsta,'UNKNOWN') %dont overwite interior point solution
elseif isfield(res.sol,'bas')
%&& ~isequal(res.sol.bas.solsta,'UNKNOWN') %dont overwite interior point solution
origStat = res.sol.bas.solsta;
switch origStat
case {'OPTIMAL','MSK_SOL_STA_OPTIMAL','MSK_SOL_STA_NEAR_OPTIMAL'}
Expand Down
13 changes: 8 additions & 5 deletions src/base/solvers/solveCobraLP.m
Original file line number Diff line number Diff line change
Expand Up @@ -1374,11 +1374,14 @@
else
stat = -1;
end

% cplexStatus analyzes the CPLEX output Inform code and returns
% the CPLEX solution status message in ExitText and the TOMLAB exit flag
% in ExitFlag
[origStatText, ~] = cplexStatus(origStat);
if 0
% cplexStatus analyzes the CPLEX output Inform code and returns
% the CPLEX solution status message in ExitText and the TOMLAB exit flag
% in ExitFlag
[origStatText, ~] = cplexStatus(origStat);
else
origStat = CplexLPproblem.Solution.statusstring;
end

switch CplexLPproblem.Param.lpmethod.Cur
case 0
Expand Down

0 comments on commit aa28c1d

Please sign in to comment.