]> gitweb.michael.orlitzky.com - octave.git/blob - optimization/test_functions/powell_hessian.m
48cc390df91b3ac1436bb3ead7c2190c9a3a500a
[octave.git] / optimization / test_functions / powell_hessian.m
1 function H = powell_hessian(x1, x2, x3, x4)
2 ##
3 ## The Hessian of the Powell function. See powell.m for more
4 ## information.
5 ##
6 H = zeros(4,4);
7
8 H(1,1) = 120*(x1 - x4)^2 + 2;
9 H(1,2) = 20;
10 H(1,3) = 0;
11 H(1,4) = -120*(x1 - x4)^2;
12
13 H(2,1) = H(1,2);
14 H(2,2) = 12*(x2 - 2*x3)^2 + 200;
15 H(2,3) = -24*(x2 - 2*x3)^2;
16 H(2,4) = 0;
17
18 H(3,1) = H(1,3);
19 H(3,2) = H(1,3);
20 H(3,3) = 48*(x2 - 2*x3)^2 + 10;
21 H(3,4) = -10;
22
23 H(4,1) = H(1,4);
24 H(4,2) = H(2,4);
25 H(4,3) = H(3,4);
26 H(4,4) = 120*(x1 - x4)^2 + 10;
27 end