Skip to main content

SplitPlan

Struct SplitPlan 

Source
pub struct SplitPlan<T: Float> { /* private fields */ }
Expand description

A plan for split-complex format (separate real and imaginary arrays).

Split-complex format stores the real parts in one array and the imaginary parts in another, rather than interleaving them:

  • Interleaved: [re0, im0, re1, im1, re2, im2, ...]
  • Split: real = [re0, re1, re2, ...], imag = [im0, im1, im2, ...]

This format can be more efficient for SIMD processing and is used by some numerical libraries.

§Example

use oxifft::{SplitPlan, Direction, Flags};

let n = 256;
let plan = SplitPlan::<f64>::dft_1d(n, Direction::Forward, Flags::ESTIMATE).unwrap();

let mut in_real = vec![0.0; n];
let mut in_imag = vec![0.0; n];
let mut out_real = vec![0.0; n];
let mut out_imag = vec![0.0; n];

// Initialize input...
in_real[0] = 1.0;

plan.execute(&in_real, &in_imag, &mut out_real, &mut out_imag);

Implementations§

Source§

impl<T: Float> SplitPlan<T>

Source

pub fn dft_1d(n: usize, direction: Direction, flags: Flags) -> Option<Self>

Create a 1D DFT plan for split-complex format.

§Arguments
  • n - Transform size
  • direction - Forward or Backward
  • flags - Planning flags
Source

pub fn size(&self) -> usize

Get the transform size.

Source

pub fn direction(&self) -> Direction

Get the transform direction.

Source

pub fn execute( &self, in_real: &[T], in_imag: &[T], out_real: &mut [T], out_imag: &mut [T], )

Execute the transform on split-complex input/output.

§Arguments
  • in_real - Input real parts
  • in_imag - Input imaginary parts
  • out_real - Output real parts
  • out_imag - Output imaginary parts
§Panics

Panics if any buffer size doesn’t match the plan size.

Source

pub fn execute_inplace(&self, real: &mut [T], imag: &mut [T])

Execute the transform in-place on split-complex data.

§Arguments
  • real - Real parts (in-place)
  • imag - Imaginary parts (in-place)
§Panics

Panics if any buffer size doesn’t match the plan size.

Trait Implementations§

Source§

impl<T: Float> Debug for SplitPlan<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 SplitPlan<T>

§

impl<T> RefUnwindSafe for SplitPlan<T>
where T: RefUnwindSafe,

§

impl<T> Send for SplitPlan<T>

§

impl<T> Sync for SplitPlan<T>

§

impl<T> Unpin for SplitPlan<T>

§

impl<T> UnsafeUnpin for SplitPlan<T>

§

impl<T> UnwindSafe for SplitPlan<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.