Skip to content

Commit b0e76a1

Browse files
committed
250909.013857.CST matlab profiling: implement test_feasibility_problems
1 parent 61d6b50 commit b0e76a1

File tree

7 files changed

+40
-4
lines changed

7 files changed

+40
-4
lines changed

.github/workflows/profile_all.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
use_system_libgcc: [true] # Whether to use the system libgcc or the one shipped with MATLAB.
3434
with_optim_toolbox: [yes, no]
3535
ctol_indicator: [0, 1, 2]
36+
test_feasibility_problems: [true, false]
3637
exclude:
3738
- solver: cobylan
3839
with_optim_toolbox: yes
@@ -54,6 +55,13 @@ jobs:
5455
ctol_indicator: 1
5556
- solver: bobyqa
5657
ctol_indicator: 2
58+
- solver: uobyqa
59+
test_feasibility_problems: true
60+
- solver: newuoa
61+
test_feasibility_problems: true
62+
- solver: bobyqa
63+
test_feasibility_problems: true
64+
5765

5866
steps:
5967
- name: Get the solver name
@@ -202,6 +210,7 @@ jobs:
202210
options = struct();
203211
options.nr = 4; % 4 random runs for each problem
204212
options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}'));
213+
options.test_feasibility_problems = ${{ matrix.test_feasibility_problems }};
205214
206215
if strcmp('${{ matrix.solver }}', 'cobylal')
207216
%options.nr = 3;

.github/workflows/profile_all_sq.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
use_system_libgcc: [true] # Whether to use the system libgcc or the one shipped with MATLAB.
3535
precision: [single, quadruple]
3636
ctol_indicator: [0, 1, 2]
37-
37+
test_feasibility_problems: [true, false]
3838
exclude:
3939
- solver: uobyqa
4040
ctol_indicator: 1
@@ -51,6 +51,13 @@ jobs:
5151
- solver: uobyqa # See https://github.com/libprima/prima/issues/98
5252
competitor: classical
5353
precision: single
54+
- solver: uobyqa
55+
test_feasibility_problems: true
56+
- solver: newuoa
57+
test_feasibility_problems: true
58+
- solver: bobyqa
59+
test_feasibility_problems: true
60+
5461

5562
steps:
5663
- name: Get the solver name
@@ -202,6 +209,7 @@ jobs:
202209
options.nr = 1;
203210
options.precision = '${{ matrix.precision }}';
204211
options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}'));
212+
options.test_feasibility_problems = ${{ matrix.test_feasibility_problems }};
205213
206214
try
207215
if strcmp('${{ matrix.solver }}', 'cobylal')

.github/workflows/profile_cobyla_small.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
use_system_libgcc: [true] # Whether to use the system libgcc or the one shipped with MATLAB.
3535
with_optim_toolbox: [yes, no]
3636
ctol_indicator: [0, 1, 2]
37+
test_feasibility_problems: [true, false]
3738
exclude:
3839
- solver: cobylan
3940
with_optim_toolbox: yes
@@ -187,6 +188,7 @@ jobs:
187188
options = struct();
188189
options.nr = 3;
189190
options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}'));
191+
options.test_feasibility_problems = ${{ matrix.test_feasibility_problems }};
190192
191193
if strcmp('${{ matrix.solver }}', 'cobylal')
192194
prof('cobyla', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options);

.github/workflows/profile_cobyla_small_sq.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
competitor: [classical, archiva, norma]
3535
use_system_libgcc: [true] # Whether to use the system libgcc or the one shipped with MATLAB.
3636
ctol_indicator: [0, 1, 2]
37+
test_feasibility_problems: [true, false]
3738

3839
steps:
3940

@@ -178,6 +179,7 @@ jobs:
178179
options.nr = 1;
179180
options.precision = '${{ matrix.precision }}';
180181
options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}'));
182+
options.test_feasibility_problems = ${{ matrix.test_feasibility_problems }};
181183
182184
if strcmp('${{ matrix.solver }}', 'cobylal')
183185
prof('cobyla', '${{ matrix.dim }}', 'l', '${{ matrix.competitor }}', options);

.github/workflows/profile_lincoa_small.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
use_system_libgcc: [true] # Whether to use the system libgcc or the one shipped with MATLAB.
3535
with_optim_toolbox: [yes, no]
3636
ctol_indicator: [0, 1, 2]
37+
test_feasibility_problems: [true, false]
3738

3839
steps:
3940

@@ -181,6 +182,7 @@ jobs:
181182
options = struct();
182183
options.nr = 3;
183184
options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}'));
185+
options.test_feasibility_problems = ${{ matrix.test_feasibility_problems }};
184186
185187
prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', options);
186188

.github/workflows/profile_lincoa_small_sq.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ jobs:
3434
competitor: [classical, archiva, norma]
3535
use_system_libgcc: [true] # Whether to use the system libgcc or the one shipped with MATLAB.
3636
ctol_indicator: [0, 1, 2]
37+
test_feasibility_problems: [true, false]
3738

3839
steps:
3940

@@ -175,6 +176,7 @@ jobs:
175176
options.nr = 1;
176177
options.precision = '${{ matrix.precision }}';
177178
options.ctol_multiple = 10^(2*str2num('${{ matrix.ctol_indicator }}'));
179+
options.test_feasibility_problems = ${{ matrix.test_feasibility_problems }};
178180
179181
try
180182
prof('${{ matrix.solver }}', '${{ matrix.dim }}', '${{ matrix.competitor }}', 'l', options);

matlab/tests/private/testcu.m

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@
6969
minip = 1;
7070
maxip = 2^32 - 1;
7171
strict = 2;
72-
7372
verbose = false;
73+
% Zaikun 20250908: It turns out that CUTEst contains many feasibility problems. We do not test them by default.
74+
test_feasibility_problems = false;
7475

7576
% Directories for recording the starting/ending of problems (tic/toc are unavailable in parfor).
7677
stamp = options.stamp;
@@ -96,7 +97,7 @@
9697
% Set options
9798
options = setopt(options, precision, rhobeg, rhoend, npt, maxfun_dim, maxfun, maxit, ftarget, perm, randomizex0, ...
9899
eval_options, nr, ctol, ctol_multiple, cpenalty, type, mindim, maxdim, mincon, maxcon, ...
99-
sequential, debug, chkfunval, output_xhist, output_nlchist, thorough_test, minip, maxip, strict, verbose);
100+
sequential, debug, chkfunval, output_xhist, output_nlchist, thorough_test, minip, maxip, strict, verbose, test_feasibility_problems);
100101

101102
assert(options.maxdim <= maxn);
102103

@@ -114,6 +115,13 @@
114115
requirements.maxcon = options.maxcon;
115116
requirements.type = options.type;
116117

118+
if ~options.test_feasibility_problems
119+
% If requirements does not contain `is_feasibility`, then we test all problems, including feasibility problems.
120+
% If requirements.is_feasibility = false, then we test only the problems that are not feasibility problems.
121+
% If requirements.is_feasibility = true, then we test only feasibility problems.
122+
requirements.is_feasibility = false;
123+
end
124+
117125
if isfield(options, 'blacklist')
118126
requirements.blacklist = options.blacklist;
119127
else
@@ -555,7 +563,7 @@
555563
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
556564
function options = setopt(options, precision, rhobeg, rhoend, npt, maxfun_dim, maxfun, maxit, ftarget, perm, ...
557565
randomizex0, eval_options, nr, ctol, ctol_multiple, cpenalty, type, mindim, maxdim, mincon, maxcon, ...
558-
sequential, debug, chkfunval, output_xhist, output_nlchist, thorough_test, minip, maxip, strict, verbose) % Set options
566+
sequential, debug, chkfunval, output_xhist, output_nlchist, thorough_test, minip, maxip, strict, verbose, test_feasibility_problems) % Set options
559567

560568
if (~isfield(options, 'precision'))
561569
options.precision = precision;
@@ -651,6 +659,9 @@
651659
if (~isfield(options, 'verbose'))
652660
options.verbose = verbose;
653661
end
662+
if (~isfield(options, 'test_feasibility_problems'))
663+
options.test_feasibility_problems = test_feasibility_problems;
664+
end
654665

655666
% Set eval_options
656667
have_eval_options = isfield(options, 'eval_options') && isstruct(options.eval_options) && ~isempty(fieldnames(options.eval_options));

0 commit comments

Comments
 (0)