function c = c8vec_sftf_matrix ( n )

%*****************************************************************************80
%
%% c8vec_sftf_matrix() returns the slow Fourier Transform Forward matrix.
%
%  Discussion:
%
%    SFTF and SFTB are inverses of each other.  If we begin with data
%    X and apply SFTF to get Y, and then apply SFTB to Y,
%    we should get back the original X.
%
%    This routine is provided for illustration and testing.  It is inefficient
%    relative to optimized routines that use fast Fourier techniques.
%
%    For 0 <= I <= N - 1
%
%      Y(I) = Sum ( 0 <= J <= N - 1 ) X(J) * exp ( - 2 pi i I J / N )
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    17 October 2015
%
%  Author:
%
%    John Burkardt
%
%  Input:
%
%    integer N, the number of data values.
%
%  Output:
%
%    complex C(N,N), the SFTF matrix.
%
  c = zeros ( n, n );

  for k = 1 : n
    for j = 1 : n
      theta = - 2.0 * pi * ( k - 1 ) * ( j - 1 ) / n;
      c(k,j) = cos ( theta ) - i * sin ( theta );
    end
  end

  return
end
