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

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

function f = cq4(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];

x = x(:);

f = 1 + 0.5*x'*x + 0.25*s*(x'*A*x)^2;
