pub struct RealPlanND<T: Float> { /* private fields */ }Expand description
A plan for N-dimensional real-to-complex and complex-to-real transforms.
Implementations§
Source§impl<T: Float> RealPlanND<T>
impl<T: Float> RealPlanND<T>
Sourcepub fn r2c(dims: &[usize], flags: Flags) -> Option<Self>
pub fn r2c(dims: &[usize], flags: Flags) -> Option<Self>
Create an N-dimensional R2C plan.
§Examples
use oxifft::{Complex, Flags, RealPlanND};
// 1D R2C transform via RealPlanND
let plan = RealPlanND::<f64>::r2c(&[8], Flags::ESTIMATE)
.expect("plan construction failed");
let input = vec![1.0_f64; 8];
// Output size = last_dim / 2 + 1 = 5
let mut output = vec![Complex::<f64>::zero(); 5];
plan.execute_r2c(&input, &mut output);
// DC bin = sum of all elements = 8
assert!((output[0].re - 8.0_f64).abs() < 1e-9);Sourcepub fn execute_r2c(&self, input: &[T], output: &mut [Complex<T>])
pub fn execute_r2c(&self, input: &[T], output: &mut [Complex<T>])
Execute R2C transform.
§Panics
Panics if input/output don’t have the expected lengths, or if the
internal 2D/3D plan constructor (rank 2/3) rejects self.dims. The
latter cannot currently happen: Self::r2c already rejects an empty
dims or any zero dimension at construction, which is the only
condition the internal constructors check.
Sourcepub fn execute_c2r(&self, input: &[Complex<T>], output: &mut [T])
pub fn execute_c2r(&self, input: &[Complex<T>], output: &mut [T])
Execute the N-dimensional C2R transform with normalization.
The output is divided by product(dims), so an N-D r2c -> c2r round
trip is the identity. See RealPlan::execute_c2r for the crate-wide
normalization convention (it deliberately differs from FFTW). Use
execute_c2r_unnormalized for the raw,
FFTW-style result.
§Panics
Panics if input/output don’t have the expected lengths, or if the
internal 2D/3D plan constructor (rank 2/3) rejects self.dims. The
latter cannot currently happen: Self::c2r already rejects an empty
dims or any zero dimension at construction, which is the only
condition the internal constructors check.
Sourcepub fn execute_c2r_unnormalized(&self, input: &[Complex<T>], output: &mut [T])
pub fn execute_c2r_unnormalized(&self, input: &[Complex<T>], output: &mut [T])
Execute the N-dimensional C2R transform without normalization (FFTW convention).
The result is scaled by product(dims) relative to
execute_c2r.
§Panics
See execute_c2r — both share the same
underlying pipeline and panic conditions.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for RealPlanND<T>
impl<T> RefUnwindSafe for RealPlanND<T>where
T: RefUnwindSafe,
impl<T> Send for RealPlanND<T>
impl<T> Sync for RealPlanND<T>
impl<T> Unpin for RealPlanND<T>where
T: Unpin,
impl<T> UnsafeUnpin for RealPlanND<T>
impl<T> UnwindSafe for RealPlanND<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more