function [gf,gg]=grosenbrock(x)
% Der Gradient der Rosenbrock-Funktion
%
% Helge Baumann, 17.8.1998
global outputname

gf = [-400 * (x(2,:) - x(1,:).*x(1,:)) * x(1,:) - 2*(1-x(1,:));
       200 * (x(2,:) - x(1,:)*x(1,:)) ];

gg = [2*x(1,:);2*x(2,:)];

if ~isempty(outputname), feval(outputname,x); end;