Skip to content

Commit

Permalink
Tweak tests for Optimization Toolbox R2024a.
Browse files Browse the repository at this point in the history
Avoid warnings and presolve bug with new HiGHS-based `linprog` and `intlinprog` in Optimization Toolbox R2024a.
  • Loading branch information
rdzman committed Apr 4, 2024
1 parent ff9d4ae commit f1d989f
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ Change history for MOST
since 1.2
---------

#### 4/4/24
- Tweak tests to avoid warnings and presolve bug with new HiGHS-based
`linprog` and `intlinprog` in Optimization Toolbox R2024a.

#### 3/21/24
- Add Sphinx-based Reference documentation.

Expand Down
2 changes: 1 addition & 1 deletion lib/mostver.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
v = struct( 'Name', 'MOST', ...
'Version', '1.2+', ...
'Release', '', ...
'Date', '15-Mar-2024' );
'Date', '04-Apr-2024' );
if nargout > 0
if nargin > 0
rv = v;
Expand Down
2 changes: 1 addition & 1 deletion lib/mpoption_info_most.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
function opt = mpoption_info_most(selector)
% mpoption_info_most - Returns MATPOWER option info for MOST.
% mpoption_info_most - Returns |MATPOWER| option info for MOST.
% ::
%
% DEFAULT_OPTS = MPOPTION_INFO_MOST('D')
Expand Down
2 changes: 1 addition & 1 deletion lib/t/t_most_spuc.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function t_most_spuc(quiet, create_plots, create_pdfs, savedir)
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_REL_GAP', 0);
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_ABS_GAP', 0);
end
if have_feature('intlinprog')
if have_feature('intlinprog') && have_feature('intlinprog', 'vnum') < 24
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'interior-point');
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'active-set');
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');
Expand Down
2 changes: 1 addition & 1 deletion lib/t/t_most_suc.m
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ function t_most_suc(quiet, create_plots, create_pdfs, savedir)
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_REL_GAP', 0);
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_ABS_GAP', 0);
end
if have_feature('intlinprog')
if have_feature('intlinprog') && have_feature('intlinprog', 'vnum') < 24
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'interior-point');
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'active-set');
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');
Expand Down
31 changes: 19 additions & 12 deletions lib/t/t_most_uc.m
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,26 @@ function t_most_uc(quiet, create_plots, create_pdfs, savedir)
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_ABS_GAP', 0);
end
if have_feature('intlinprog')
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'interior-point');
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'active-set');
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
%mpopt = mpoption(mpopt, 'intlinprog.RootLPAlgorithm', 'primal-simplex');
mpopt = mpoption(mpopt, 'intlinprog.RootLPAlgorithm', 'dual-simplex');
mpopt = mpoption(mpopt, 'intlinprog.TolCon', 1e-9);
mpopt = mpoption(mpopt, 'intlinprog.TolGapAbs', 0);
mpopt = mpoption(mpopt, 'intlinprog.TolGapRel', 0);
mpopt = mpoption(mpopt, 'intlinprog.TolInteger', 1e-6);
%% next line is to work around a bug in intlinprog
% (Technical Support Case #01841662)
% (except actually in this case it triggers it rather than working
% around it, so we comment it out)
%mpopt = mpoption(mpopt, 'intlinprog.LPPreprocess', 'none');
if have_feature('intlinprog', 'vnum') < 24
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'interior-point');
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'active-set');
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
%mpopt = mpoption(mpopt, 'intlinprog.RootLPAlgorithm', 'primal-simplex');
mpopt = mpoption(mpopt, 'intlinprog.RootLPAlgorithm', 'dual-simplex');
mpopt = mpoption(mpopt, 'intlinprog.TolInteger', 1e-6);
%% next line is to work around a bug in intlinprog
% (Technical Support Case #01841662)
% (except actually in this case it triggers it rather than working
% around it, so we comment it out)
%mpopt = mpoption(mpopt, 'intlinprog.LPPreprocess', 'none');
else mpopt = mpoption(mpopt, 'intlinprog.LPPreprocess', 'none');
s2 = warning('query', 'optim:intlinprog:IgnoreOptions');
warning('off', 'optim:intlinprog:IgnoreOptions');
end
end
if ~verbose
mpopt = mpoption(mpopt, 'out.all', 0);
Expand Down Expand Up @@ -408,6 +413,8 @@ function t_most_uc(quiet, create_plots, create_pdfs, savedir)

if have_feature('octave')
warning(s1.state, file_in_path_warn_id);
elseif have_feature('intlinprog') && have_feature('intlinprog', 'vnum') >= 24
warning(s2.state, 'optim:intlinprog:IgnoreOptions');
end

t_end;
Expand Down

0 comments on commit f1d989f

Please sign in to comment.