Skip to content

Commit 3d4a436

Browse files
committed
250909.134913.CST [skip ci] revise parse_input regarding maxdim
1 parent e9f3970 commit 3d4a436

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

matlab/tests/private/parse_input.m

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,15 +137,18 @@
137137
end
138138
end
139139

140+
user_sets_dim = false; % Whether the user sets the dimension range explicitly.
140141
if length(argin) == 2
141142
if ischarstr(argin{1}) && isnumvec(argin{2}) && length(argin{2}) == 2
142143
solver = argin{1};
143144
mindim = min(argin{2});
144145
maxdim = max(argin{2});
146+
user_sets_dim = true;
145147
elseif ischarstr(argin{2}) && isnumvec(argin{1}) && length(argin{1}) == 2
146148
solver = argin{2};
147149
mindim = min(argin{1});
148150
maxdim = max(argin{1});
151+
user_sets_dim = true;
149152
elseif ischarstr(argin{1}) && ischarstr(argin{2})
150153
argin = lower(argin);
151154
if length(intersect(argin, known_solvers)) == 1
@@ -202,7 +205,7 @@
202205
options.maxdim = maxdim;
203206

204207
% Revise the dimension range for COBYLA, UOBYQA, and PRIMA.
205-
if strcmpi(solver, 'cobyla') || strcmpi(solver, 'uobyqa') || strcmpi(solver, 'prima')
208+
if ~user_sets_dim && (strcmpi(solver, 'cobyla') || strcmpi(solver, 'uobyqa') || strcmpi(solver, 'prima'))
206209
if options.maxdim == 50
207210
options.maxdim = 20;
208211
end
@@ -223,7 +226,7 @@
223226
options.maxcon = 100*options.maxdim;
224227

225228
% Revise the dimension range for verification to avoid overtime of GitHub Actions.
226-
if strcmpi(invoker, 'verify')
229+
if ~user_sets_dim && strcmpi(invoker, 'verify')
227230
if strcmpi(solver, 'cobyla')
228231
options.maxdim = min(options.maxdim, 80); %!!!
229232
elseif strcmpi(solver, 'newuoa')

0 commit comments

Comments
 (0)