function value = rosenbrock_f ( m, n, x )

%*****************************************************************************80
%
%% rosenbrock_f() returns the function in the rosenbrock problem.
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    26 January 2016
%
%  Author:
%
%    John Burkardt
%
%  Reference:
%
%    Sashwati Ray, PSV Nataraj,
%    An efficient algorithm for range computation of polynomials using the
%    Bernstein form,
%    Journal of Global Optimization,
%    Volume 45, 2009, pages 403-426.
%
%  Input:
%
%    integer M, the number of variables.
%
%    integer N, the number of points.
%
%    real X(M,N), the points.
%
%  Output:
%
%    real VALUE(N), the value of the function at X.
%
  value = zeros ( 1, n );

  for i = 1 : m - 1
    value = value ...
      + 100.0E+00 * ( x(i,1:n) - x(i+1,1:n) ) .^2 ...
      +             ( x(i,1:n) - 1.0E+00    ) .^2;
  end

  value = value';

  return
end


