% cq4h.m -- Convex quartic in 4 variables, Hessian, for M604 HW04
%
% Global variable CQ4_SIGMA is used
%

% (c) Philip D. Loewen
% 23 February 2001 -- Original

function Hessf = cq4h(x)

global CQ4_SIGMA

s = CQ4_SIGMA;
A = [5,1,0,0.5; 1,4,0.5,0; 0,0.4,3,0; 0.5,0,0,2];
Id = eye(4);

x = x(:);

Hessf = Id + 2*s*A*x*x'*A + s*(x'*A*x)*A;
