function retval = extrosenfnhess(x) % usage: hess = extrosenfnhess(x) % description: Returns the Hessian matrix for extrosenfn % of Exercise 9.1 of Nocedal and Wright's text, Numerical % Optimization. This is the extended Rosenbrock % function. It is *assumed* that length(x) is even! % Solution is x* = (1,1,...,1), minimum value 0. % no bulletproofing % for adapting this problem, change c here and in % gradient and original functions. c = 10; m = length(x); retval = zeros(m,m); for j = (1:2:m) retval(j:j+1,j:j+1) = [2-4*c*x(j+1)+12*c*x(j)^2, -4*c*x(j); -4*c*x(j) 2*c]; end