function y = g(x,H,b,c)
% g evaluates the function g at x given the data.
%
% INPUT: x (Point where function should be evaluated given as a column 
%           vector. x can also be a matrix where each column is a point).
%        H (symmetric positive definite matrix).
%        b (Column vector).
%        c (Column vector).
%        
%
% OUTPUT: y (Function value or vector of function values if x is a matrix).
%

m = size(x,2);
y = -b'*x+0.5*dot(x,H*x)+(1/12)*dot(x,repmat(c,1,m).*x.^3);

end

