xref: /petsc/src/tao/leastsquares/tutorials/matlab/more_wild_probs/dfoxs.m (revision ecceeb7d86a3b9d2c0da2aced471d46acf67b452)
1function x = dfoxs(n,nprob,factor)
2%     This is a MATLAB version of the subroutine dfoxs.f
3%     This subroutine specifies the standard starting points for the
4%     functions defined by subroutine dfovec as used in:
5%
6%     Benchmarking Derivative-Free Optimization Algorithms
7%     Jorge J. More' and Stefan M. Wild
8%     SIAM J. Optimization, Vol. 20 (1), pp.172-191, 2009.
9%
10%     The latest version of this subroutine is always available at
11%     http://www.mcs.anl.gov/~more/dfo/
12%     The authors would appreciate feedback and experiences from numerical
13%     studies conducted using this subroutine.
14%
15%     The subroutine returns
16%     in x a multiple (factor) of the standard starting point. for
17%     the 11th function the standard starting point is zero, so in
18%     this case, if factor is not unity, then the subroutine returns
19%     the vector  x(j) = factor, j=1,...,n.
20%
21%       xs is an output array of length n which contains the standard
22%         starting point for problem nprob multiplied by factor.
23%       n is a positive integer input variable.
24%       nprob is a positive integer input variable which defines the
25%         number of the problem. nprob must not exceed 22.
26%       factor is an input variable which specifies the multiple of
27%         the standard starting point. if factor is unity, no
28%         multiplication is performed.
29%
30%     Argonne National Laboratory
31%     Jorge More' and Stefan Wild. January 2008.
32
33x = zeros(n,1);
34
35switch nprob
36    case 1 %     linear function - full rank or rank 1.
37        x = ones(n,1);
38    case 2 %     linear function - full rank or rank 1.
39        x = ones(n,1);
40    case 3 %     linear function - full rank or rank 1.
41        x = ones(n,1);
42    case 4 %     rosenbrock function.
43        x(1) = -1.2;
44        x(2) = 1;
45    case 5 %     helical valley function.
46        x(1) = -1;
47    case 6 %     powell singular function.
48        x(1) = 3;
49        x(2) = -1;
50        x(3) = 0;
51        x(4) = 1;
52    case 7 %     freudenstein and roth function.
53        x(1) = .5;
54        x(2) = -2;
55    case 8 %     bard function.
56        x(1:3) = 1;
57    case 9 %     kowalik and osborne function.
58        x(1) = .25;
59        x(2) = .39;
60        x(3) = .415;
61        x(4) = .39;
62    case 10 %     meyer function.
63        x(1) = .02;
64        x(2) = 4000;
65        x(3) = 250;
66    case 11 %     watson function.
67        x = .5*ones(n,1);
68    case 12 %     box 3-dimensional function.
69        x(1) = 0;
70        x(2) = 10;
71        x(3) = 20;
72    case 13 %     jennrich and sampson function.
73        x(1) = .3;
74        x(2) = .4;
75    case 14 %     brown and dennis function.
76        x(1) = 25;
77        x(2) = 5;
78        x(3) = -5;
79        x(4) = -1;
80    case 15 %     chebyquad function.
81        for k = 1:n
82            x(k) = k/(n+1);
83        end
84    case 16 %     brown almost-linear function.
85        x = .5*ones(n,1);
86    case 17 %     osborne 1 function.
87        x(1) = .5;
88        x(2) = 1.5;
89        x(3) = 1;
90        x(4) = .01;
91        x(5) = .02;
92    case 18 %     osborne 2 function.
93        x(1) = 1.3;
94        x(2) = .65;
95        x(3) = .65;
96        x(4) = .7;
97        x(5) = .6;
98        x(6) = 3;
99        x(7) = 5;
100        x(8) = 7;
101        x(9) = 2;
102        x(10) = 4.5;
103        x(11) = 5.5;
104    case 19 % bdqrtic
105        x = ones(n,1);
106    case 20 % cube
107        x = .5*ones(n,1);
108    case 21 % mancino
109        for i=1:n
110            ss = 0;
111            for j=1:n
112                ss = ss+(sqrt(i/j)*((sin(log(sqrt(i/j))))^5+(cos(log(sqrt(i/j))))^5));
113            end
114            x(i) = -8.710996D-4*((i-50)^3 + ss);
115        end
116    case 22  % Heart8
117        x= [-.3, -.39, .3, -.344, -1.2, 2.69, 1.59, -1.5]';
118end
119
120x = factor*x;
121