pub struct Plan { /* private fields */ }
fft128
only.Expand description
128-bit negacyclic FFT plan.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn new(n: usize) -> Self
pub fn new(n: usize) -> Self
Returns a new negacyclic FFT plan for the given vector size, following the algorithm in Fast and Error-Free Negacyclic Integer Convolution using Extended Fourier Transform
§Panics
- Panics if
n
is not a power of two, or if it is less than32
.
§Example
use tfhe_fft::fft128::Plan;
let plan = Plan::new(32);
Sourcepub fn fft_size(&self) -> usize
pub fn fft_size(&self) -> usize
Returns the vector size of the negacyclic FFT.
§Example
use tfhe_fft::fft128::Plan;
let plan = Plan::new(32);
assert_eq!(plan.fft_size(), 32);
Sourcepub fn fwd(
&self,
buf_re0: &mut [f64],
buf_re1: &mut [f64],
buf_im0: &mut [f64],
buf_im1: &mut [f64],
)
pub fn fwd( &self, buf_re0: &mut [f64], buf_re1: &mut [f64], buf_im0: &mut [f64], buf_im1: &mut [f64], )
Performs a forward negacyclic FFT in place.
§Note
The values in buf_re0
, buf_re1
, buf_im0
, buf_im1
must be in standard order prior to
calling this function. When this function returns, the values in buf_re0
, buf_re1
,
buf_im0
, buf_im1
will contain the terms of the forward transform in bit-reversed
order.
Sourcepub fn inv(
&self,
buf_re0: &mut [f64],
buf_re1: &mut [f64],
buf_im0: &mut [f64],
buf_im1: &mut [f64],
)
pub fn inv( &self, buf_re0: &mut [f64], buf_re1: &mut [f64], buf_im0: &mut [f64], buf_im1: &mut [f64], )
Performs an inverse negacyclic FFT in place.
§Note
The values in buf_re0
, buf_re1
, buf_im0
, buf_im1
must be in bit-reversed order
prior to calling this function. When this function returns, the values in buf_re0
,
buf_re1
, buf_im0
, buf_im1
will contain the terms of the inverse transform in standard
order.