function [y,yprime]=junkfn(x0)
% outputs the values of a quadratic function and its gradient at x(vector of length 3)
% stacks them if x is n by 3
%f(x)=x.^3+2x1+x1x2
H=[[1 .5 0];[.5 1 0];[0 0 1]];
b=[0 0 0]';
y=[];
yprime=[];
for i=1:size(x0,1)
   x=x0(i,:);
   y=[y;x*b+x*H*x'];
%y=[y;sum([x.^2 2*x(1) x(1)*x(2)])];
%yprime=[yprime;[2*x(1)+x(2)+2  2*x(2)+x(1) 2*x(3)]];
yprime=[yprime;b'+2*x*H];
end

