|
1 | | -function testprima(release, precision, nrun) |
| 1 | +function testprima(release, precision, nrun, test_classical) |
2 | 2 | %TESTPRIMA tests prima on a few VERY simple problems. |
| 3 | +% release is a boolean that controls whether to test prima in release mode (true) or not (false). |
| 4 | +% In release mode, the testing precision is relaxed and the testing results are not printed. |
| 5 | +% precision is a positive scalar that specifies the required precision. |
| 6 | +% nrun is a positive integer that specifies the number of runs with randomly perturbed x0. The |
| 7 | +% default value is 1, meaning that no perturbation will be added to x0. If nrun > 1, a tiny |
| 8 | +% quasi-random perturbation will be added to x0 in each run. |
| 9 | +% test_classical is a boolean that controls whether to test the classical version of prima. |
3 | 10 | % |
4 | 11 | % Note: Do NOT follow the syntax here when you use prima. This file is |
5 | 12 | % written for testing purpose, and it uses quite atypical syntax. See |
@@ -40,6 +47,9 @@ function testprima(release, precision, nrun) |
40 | 47 | else |
41 | 48 | perturb = eps; |
42 | 49 | end |
| 50 | +if nargin < 4 |
| 51 | + test_classical = false; |
| 52 | +end |
43 | 53 |
|
44 | 54 | options.debug = true; |
45 | 55 | options.chkfunval = true; |
@@ -80,7 +90,7 @@ function testprima(release, precision, nrun) |
80 | 90 | % 2. Himmelblau's function (hmlb) has multiple minima when |
81 | 91 | % unconstrained. They are [3; 2], [-2.805118; 3.131312], [-3.779310; -3.283186], [3.584428; -1.848126] |
82 | 92 |
|
83 | | -if release |
| 93 | +if release || ~test_classical |
84 | 94 | clflag_list = {false}; % clflag: call the solvers in classical mode (true) or not (false) |
85 | 95 | else |
86 | 96 | clflag_list = {true, false}; % clflag: call the solvers in classical mode (true) or not (false) |
|
0 commit comments