Skip to content

Commit 0c42512

Browse files
committed
Use have_feature() everywhere in place of deprecated have_fcn().
1 parent 1cf19d4 commit 0c42512

16 files changed

Lines changed: 72 additions & 72 deletions

lib/mpoption_info_most.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
if nargin < 1
2929
selector = 'D';
3030
end
31-
if have_fcn('most')
31+
if have_feature('most')
3232
switch upper(selector)
3333
case {'D', 'V'} %% default and valid options
3434
opt = struct(...

lib/t/most_ex6_uc.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function most_ex6_uc(quiet)
2222
mpopt = mpoption(mpopt, 'most.price_stage_warn_tol', 1e-5);
2323

2424
%% solver options
25-
if have_fcn('cplex')
25+
if have_feature('cplex')
2626
%mpopt = mpoption(mpopt, 'cplex.lpmethod', 0); %% automatic
2727
%mpopt = mpoption(mpopt, 'cplex.lpmethod', 1); %% primal simplex
2828
mpopt = mpoption(mpopt, 'cplex.lpmethod', 2); %% dual simplex
@@ -32,12 +32,12 @@ function most_ex6_uc(quiet)
3232
mpopt = mpoption(mpopt, 'cplex.opts.mip.tolerances.absmipgap', 0);
3333
mpopt = mpoption(mpopt, 'cplex.opts.threads', 2);
3434
end
35-
if have_fcn('glpk')
35+
if have_feature('glpk')
3636
mpopt = mpoption(mpopt, 'glpk.opts.mipgap', 0);
3737
mpopt = mpoption(mpopt, 'glpk.opts.tolint', 1e-10);
3838
mpopt = mpoption(mpopt, 'glpk.opts.tolobj', 1e-10);
3939
end
40-
if have_fcn('gurobi')
40+
if have_feature('gurobi')
4141
%mpopt = mpoption(mpopt, 'gurobi.method', -1); %% automatic
4242
%mpopt = mpoption(mpopt, 'gurobi.method', 0); %% primal simplex
4343
mpopt = mpoption(mpopt, 'gurobi.method', 1); %% dual simplex
@@ -46,7 +46,7 @@ function most_ex6_uc(quiet)
4646
mpopt = mpoption(mpopt, 'gurobi.opts.MIPGap', 0);
4747
mpopt = mpoption(mpopt, 'gurobi.opts.MIPGapAbs', 0);
4848
end
49-
if have_fcn('mosek')
49+
if have_feature('mosek')
5050
sc = mosek_symbcon;
5151
%mpopt = mpoption(mpopt, 'mosek.lp_alg', sc.MSK_OPTIMIZER_FREE); %% default
5252
%mpopt = mpoption(mpopt, 'mosek.lp_alg', sc.MSK_OPTIMIZER_INTPNT); %% interior point
@@ -61,7 +61,7 @@ function most_ex6_uc(quiet)
6161
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_REL_GAP', 0);
6262
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_ABS_GAP', 0);
6363
end
64-
if have_fcn('intlinprog')
64+
if have_feature('intlinprog')
6565
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'interior-point');
6666
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'active-set');
6767
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');

lib/t/most_ex7_suc.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ function most_ex7_suc(quiet)
2222
mpopt = mpoption(mpopt, 'most.price_stage_warn_tol', 10);
2323

2424
%% solver options
25-
if have_fcn('cplex')
25+
if have_feature('cplex')
2626
%mpopt = mpoption(mpopt, 'cplex.lpmethod', 0); %% automatic
2727
%mpopt = mpoption(mpopt, 'cplex.lpmethod', 1); %% primal simplex
2828
mpopt = mpoption(mpopt, 'cplex.lpmethod', 2); %% dual simplex
@@ -32,12 +32,12 @@ function most_ex7_suc(quiet)
3232
mpopt = mpoption(mpopt, 'cplex.opts.mip.tolerances.absmipgap', 0);
3333
mpopt = mpoption(mpopt, 'cplex.opts.threads', 2);
3434
end
35-
if have_fcn('glpk')
35+
if have_feature('glpk')
3636
mpopt = mpoption(mpopt, 'glpk.opts.mipgap', 0);
3737
mpopt = mpoption(mpopt, 'glpk.opts.tolint', 1e-10);
3838
mpopt = mpoption(mpopt, 'glpk.opts.tolobj', 1e-10);
3939
end
40-
if have_fcn('gurobi')
40+
if have_feature('gurobi')
4141
%mpopt = mpoption(mpopt, 'gurobi.method', -1); %% automatic
4242
%mpopt = mpoption(mpopt, 'gurobi.method', 0); %% primal simplex
4343
mpopt = mpoption(mpopt, 'gurobi.method', 1); %% dual simplex
@@ -46,7 +46,7 @@ function most_ex7_suc(quiet)
4646
mpopt = mpoption(mpopt, 'gurobi.opts.MIPGap', 0);
4747
mpopt = mpoption(mpopt, 'gurobi.opts.MIPGapAbs', 0);
4848
end
49-
if have_fcn('mosek')
49+
if have_feature('mosek')
5050
sc = mosek_symbcon;
5151
%mpopt = mpoption(mpopt, 'mosek.lp_alg', sc.MSK_OPTIMIZER_FREE); %% default
5252
%mpopt = mpoption(mpopt, 'mosek.lp_alg', sc.MSK_OPTIMIZER_INTPNT); %% interior point
@@ -61,7 +61,7 @@ function most_ex7_suc(quiet)
6161
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_REL_GAP', 0);
6262
mpopt = mpoption(mpopt, 'mosek.opts.MSK_DPAR_MIO_TOL_ABS_GAP', 0);
6363
end
64-
if have_fcn('intlinprog')
64+
if have_feature('intlinprog')
6565
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'interior-point');
6666
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'active-set');
6767
%mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');

lib/t/t_most_30b_1_1_0.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ function t_most_30b_1_1_0(quiet)
2929
mpopt = mpoption(mpopt, 'opf.violation', 5e-7, 'mips.comptol', 5e-8);
3030
%mpopt = mpoption(mpopt, 'opf.dc.solver', 'OT');
3131
%mpopt = mpoption(mpopt, 'most.solver', 'OT');
32-
if have_fcn('linprog')
33-
if have_fcn('linprog_ds')
32+
if have_feature('linprog')
33+
if have_feature('linprog_ds')
3434
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
3535
else
3636
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');

lib/t/t_most_30b_1_1_0_uc.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ function t_most_30b_1_1_0_uc(quiet)
2424
% mpopt = mpoption('verbose', 2, 'out.all', -1);
2525
mpopt = mpoption(mpopt, 'out.bus', 0, 'out.branch', 0, 'out.gen', 2);
2626
mpopt = mpoption(mpopt, 'opf.violation', 5e-7, 'mips.comptol', 5e-8);
27-
if have_fcn('intlinprog')
27+
if have_feature('intlinprog')
2828
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
2929
mpopt = mpoption(mpopt, 'intlinprog.RootLPAlgorithm', 'dual-simplex');
3030
mpopt = mpoption(mpopt, 'intlinprog.TolCon', 1e-9);
@@ -157,13 +157,13 @@ function t_most_30b_1_1_0_uc(quiet)
157157
xgd = loadxgendata(xgd_table, mpc);
158158
md = loadmd(mpc, [], xgd);
159159

160-
if have_fcn('cplex')
160+
if have_feature('cplex')
161161
mpopt = mpoption(mpopt, 'cplex.lpmethod', 2); %% dual-simplex
162162
end
163-
if have_fcn('gurobi')
163+
if have_feature('gurobi')
164164
mpopt = mpoption(mpopt, 'gurobi.method', 1); %% dual-simplex
165165
end
166-
if have_fcn('linprog')
166+
if have_feature('linprog')
167167
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
168168
% mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');
169169
% mpopt = mpoption(mpopt, 'linprog.Algorithm', 'interior-point');

lib/t/t_most_30b_1_1_17.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ function t_most_30b_1_1_17(quiet)
3030
mpopt = mpoption('verbose', 0, 'out.all', 0);
3131
mpopt = mpoption(mpopt, 'opf.violation', 5e-7, 'mips.comptol', 5e-8);
3232
mpopt = mpoption(mpopt, 'sopf.force_Pc_eq_P0', 0); %% don't constrain contracted == base case dispatch
33-
if have_fcn('linprog')
34-
if have_fcn('linprog_ds')
33+
if have_feature('linprog')
34+
if have_feature('linprog_ds')
3535
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
3636
else
3737
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');

lib/t/t_most_30b_3_1_0.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function t_most_30b_3_1_0(quiet)
2727
%% options
2828
mpopt = mpoption('verbose', 0, 'out.all', 0);
2929
mpopt = mpoption(mpopt, 'opf.violation', 5e-7, 'mips.comptol', 5e-8);
30-
if have_fcn('linprog')
31-
if have_fcn('linprog_ds')
30+
if have_feature('linprog')
31+
if have_feature('linprog_ds')
3232
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
3333
else
3434
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');

lib/t/t_most_30b_3_1_17.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ function t_most_30b_3_1_17(quiet)
3030
mpopt = mpoption('verbose', 0, 'out.all', 0);
3131
mpopt = mpoption(mpopt, 'opf.violation', 5e-7, 'mips.comptol', 5e-8);
3232
mpopt = mpoption(mpopt, 'sopf.force_Pc_eq_P0', 0); %% don't constrain contracted == base case dispatch
33-
if have_fcn('gurobi')
33+
if have_feature('gurobi')
3434
mpopt = mpoption(mpopt, 'gurobi.method', 1); %% dual-simplex
3535
end
36-
if have_fcn('mosek')
36+
if have_feature('mosek')
3737
sc = mosek_symbcon;
3838
mpopt = mpoption(mpopt, 'mosek.lp_alg', sc.MSK_OPTIMIZER_DUAL_SIMPLEX); %% dual simplex
3939
end
40-
if have_fcn('linprog')
41-
if have_fcn('linprog_ds')
40+
if have_feature('linprog')
41+
if have_feature('linprog_ds')
4242
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
4343
else
4444
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');

lib/t/t_most_3b_3_1_2.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
mpopt = mpoption(mpopt, 'most.solver', algs.dc{1});
3636

3737
%% turn off warnings
38-
if have_fcn('octave')
38+
if have_feature('octave')
3939
s = warning('query', 'Octave:nearly-singular-matrix');
4040
warning('off', 'Octave:nearly-singular-matrix');
4141
else
@@ -204,7 +204,7 @@
204204

205205

206206
%% turn warnings back on
207-
if have_fcn('octave')
207+
if have_feature('octave')
208208
warning(s.state, 'Octave:nearly-singular-matrix');
209209
else
210210
warning(s7.state, 'MATLAB:nearlySingularMatrix');

lib/t/t_most_fixed_res.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ function t_most_fixed_res(quiet)
2727
mpopt = mpoption(mpopt, 'out.all', 0, 'verbose', verbose, 'opf.ac.solver', 'MIPS');
2828
mpopt = mpoption(mpopt, 'model', 'DC');
2929
mpopt = mpoption(mpopt, 'most.solver', 'DEFAULT');
30-
if have_fcn('gurobi')
30+
if have_feature('gurobi')
3131
mpopt = mpoption(mpopt, 'gurobi.method', 1); %% dual-simplex
3232
end
33-
if have_fcn('cplex')
33+
if have_feature('cplex')
3434
mpopt = mpoption(mpopt, 'cplex.qpmethod', 2); %% dual-simplex
3535
end
36-
% if have_fcn('mosek')
36+
% if have_feature('mosek')
3737
% sc = mosek_symbcon;
3838
% mpopt = mpoption(mpopt, 'mosek.lp_alg', sc.MSK_OPTIMIZER_DUAL_SIMPLEX); %% dual simplex
3939
% end
40-
if have_fcn('linprog')
41-
if have_fcn('linprog_ds')
40+
if have_feature('linprog')
41+
if have_feature('linprog_ds')
4242
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'dual-simplex');
4343
else
4444
mpopt = mpoption(mpopt, 'linprog.Algorithm', 'simplex');

0 commit comments

Comments
 (0)