infft - Class file for fast computation of an inverse NFFT

 Computes an inverse nonequispaced fast Fourier transform (iNFFT), i.e., 
 approximates the Fourier coefficients fhat in sums of the form
 
   f(y(j)) = sum_{k = -N/2}^{N/2-1} fhat(k) * exp(2*pi*i*k*y(j)),  j = 1,...,M,
 
 where y(j) and f(y(j)) are given 

 as well as

 an inverse adjoint nonequispaced fast Fourier transform, 
 i.e., approximates the function values f in sums of the form
 
   fhat(k) = sum_{j=1}^{M} f(j) * exp(-2*pi*i*k*y(j)),  k = -N/2,...,N/2-1,
 
 where y(j) and fhat(k) are given.


 For this purpose new direct methods are incorporated, which differ 
 depending on the relation between the number M of nodes and 
 the number N of unknown Fourier coefficients.

 QUADRATIC SETTING M=N:
 The computation of an iNFFT can be reduced to the computation of some 
 needed coefficients and the application of an FFT afterwards.
 For fast evaluation of the occurring sums the fastsum is used.

 RECTANGULAR SETTING M~=N:
 An iNFFT can be obtained by performing only one adjoint NFFT with a 
 specific optimized matrix. This optimization is done in a 
 precomputational step according to the given nodes.

 ADDITIONAL APPROACH FOR THE SETTING M>=N:
 An iNFFT can be obtained by exactly solving the normal equations.
 This is possible since A'*A is a Toeplitz matrix. Therefore, A'*A 
 can be inverted exactly by means of the Gohberg-Semencul formula.

 It must be pointed out that the algorithms only work in the one-dimensional setting.
 For more details see [1,2].

------------------------------------------------------------------------------------------------
 EXAMPLE WORKFLOW iNFFT
 
 INIT AND PRECOMPUTE:
  plan = infft(y,N); % Using the default values (see INPUT)
 
  Optional input arguments can be communicated to infft.m as follows
      infft(y,N,'name',value,'name',value,...)
  e.g. 
      infft(y,N,'sigma',2).

  If called as infft(y) or infft(y,'name',value,'name',value,...) 
  the quadratic setting M=N is assumed and N is set to length(y).
 
 SET FUNCTION VALUES:
  plan.f = f;
 
 TRAFO:
  infft_trafo(plan) % Fast computation
 or
  infft_trafo_direct(plan) % Direct computation

------------------------------------------------------------------------------------------------
 INPUT

 y - Nodes, where the iNFFT should be computed      
 N - Number of Fourier coefficients that shall be computed
 f - Function evaluations at points y

------------------------------------------------------------------------------------------------
 OPTIONAL INPUT

 n - Expansion degree                             default: n = N
 m - Cut-off parameter for NFFT                   default: m = 4
 sigma - Oversampling factor                      default: sigma = 2

 SPECIFIC FOR QUADRATIC SETTING M=N:
 p - Degree of smoothness of regularization       default: p = 4
 eps_I - Inner boundary for fastsum (<=1/4)       default: eps_I = 4*p/n

 SPECIFIC FOR RECTANGULAR SETTING M~=N:
 m2 - Cut-off parameter for inner NFFT            default: m2 = 4
 window - Window function for inversion           default: 'Dirichlet'

 ADDITIONAL FOR SETTING M>=N:
 flag_toeplitz - Flag to switch between approaches      default: flag_toeplitz = 0
  ( 0 - matrix approach, 1 - Toeplitz approach )

------------------------------------------------------------------------------------------------
 The following instances can be computed. 

 fcheck - Approximations of the Fourier coefficients fhat
 fcheck_direct - Direct computed Fourier coefficients fhat
 times - Field including:
   times.t_precompute - Computation time for precomputation
   times.t_trafo - Computation time of the inversion
   times.t_direct - Total computation time of the exact computation

 Use the Matlab script files 'test_underdetermined.m', 'test_quadratic.m' 
 and 'test_overdetermined' for demonstration.

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------

 EXAMPLE WORKFLOW ADJOINT
   plan = infft(y,N);           % Initialization and precomputation
   plan.fhat = fhat;            % Set Fourier coefficients
   infft_adjoint(plan)          % Trafo
   infft_adjoint_direct(plan)   % Direct computation
 
 The following instances can be computed. 

 ftilde - Approximations of the function values f
 ftilde_direct - Direct computed function values f
 times - Field including:
   times.t_precompute - Computation time for precomputation
   times.t_trafo - Computation time of the inversion
   times.t_direct - Total computation time of the exact computation

 Use the Matlab script file 'test_adjoint.m' for demonstration.

 Please note that the Toeplitz approach via Gohberg-Semencul formula is not
 available for the adjoint infft.

------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
References:

   [1]  M. Kircheis. Die Direkte Inverse NFFT,
        Bachelor's Thesis, Chemnitz University of Technology, 2017.
        https://www.tu-chemnitz.de/~kimel/paper/bachelorthesis.pdf

   [2]  M. Kircheis, D. Potts. Direct inversion of the nonequispaced fast Fourier transform.
        arXiv:1811.05335, 2018
        https://www.tu-chemnitz.de/~kimel/paper/infft_1d.pdf


------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------
Octave:

 The iNFFT is written for Matlab. It is not compatible with GNU Octave (as of Octave version 5).
