Skip to content

Commit

Permalink
doc and generalise PDL::Complex test handling slightly
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Mar 22, 2021
1 parent b7c8a69 commit c4e7762
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions README.pod
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ a single-precision floating point transform (and return data of that type).
This module expects complex numbers to be stored as a (real,imag) pair in the
first dimension of a piddle. Thus in a complex piddle C<$x>, it is expected that
C<$x-E<gt>dim(0) == 2> (this module verifies this before proceeding).
As of 0.10, it works to pass in a L<PDL::Complex> object, though the
output will still currently be a similarly-shaped "real" L<PDL>
object with the initial dimension of 2. This is intended to be changed
so the output type is the same as the input.

Generally, the sizes of the input and the output must match. This is completely
true for the complex <-> complex transforms: the output will have the same size
Expand Down
4 changes: 3 additions & 1 deletion t/fftw.t
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ my $Nplans = 0;
ok_should_make_plan( all( approx( fft1(float $x), float($Xref), approx_eps_single) ),
"Basic 1D complex FFT - single precision" );

ok_should_make_plan( all( approx( fft1(cplx $x), $Xref, approx_eps_double) ),
my $x_cplx = cplx $x;
my $cplx_result = fft1($x_cplx);
ok_should_make_plan( all( approx( $cplx_result, $Xref, approx_eps_double) ),
"Basic 1D complex FFT with PDL::Complex" );

ok_should_make_plan( all( approx( ifft1(fft1($x)), $x , approx_eps_double) ),
Expand Down

0 comments on commit c4e7762

Please sign in to comment.