function grad = rosenjac(x)
% usage: grad = rosenjac(x)
% description: Returns the jacobian matrix
% for rosen(x).

% a little bit of bulletproofing
if (~isvector(x) | (length(x) ~= 2))
  error('rosen: needs a two-dimensional vector argument');
end
if (size(x,2) ~= 1)
  error('rosen: needs a column vector');
end 
% the actual calculation
grad = sqrt(2)*[-20*x(1), 10; -1, 0];
