function u = sintv ( z )

%*****************************************************************************80
%
%% sintv() applies a sine transform, assume that size(z)=[nx,ny]=[2^k-1,ny].
%
%  Licensing:
%
%    This code is distributed under the MIT license.
%
%  Modified:
%
%    14 April 2021
%
%  Author:
%
%    Tim Kelley
%
%  Reference:
%
%    Tim Kelley,
%    Iterative Methods for Linear and Nonlinear Equations,
%    SIAM, 2004,
%    ISBN: 0898713528,
%    LC: QA297.8.K45.
%
%  Input:
%
%    real Z(nx,ny): the data to be transformed.  
%    NX should have the form 2^k-1.
%
%  Output:
%
%    real U(nx,y): the data after the sine transform.
%
  [ nx, ny ] = size ( z );

  ww = - 4.0 * fft ( [zeros(ny,1), z']', 2*nx+2 );

  u = imag ( ww(2:nx+1,:) );

  return
end

