% Two and threedimensional (centered) Fourier transformation
% where the input can be subject to rigid body motion:
%    matrix vector multiplication
%
% (c) by Alexander Loktyushin, MPI for Biological Cybernetics, 2011 February 19

function y = mvm(A,x,ctransp)
  if isreal(x) 
    x = complex(x);
  end;
  
  if ctransp
    if A.dkind
      [xi, dy] = feval('multitrans_gpu','get_image_derivative');
       y = cell(2,1); y{1} = xi; y{2} = dy;      
    else
      y = feval('multitrans_gpu','get_transpose',x(:));
    end;
  else
    if A.dkind
      [xi, dy] = feval('multitrans_gpu','get_derivatives');
       y = cell(2,1); y{1} = xi; y{2} = dy;
    else
      y = feval('multitrans_gpu','get_image',x(:));
    end;
  end;  
 