Skip to main content

RealPlanND

Struct RealPlanND 

Source
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>

Source

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);
Source

pub fn c2r(dims: &[usize], flags: Flags) -> Option<Self>

Create an N-dimensional C2R plan.

Source

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.

Source

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.

Source

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§

Source§

impl<T: Float> Debug for RealPlanND<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more