pub struct GuruPlan<T: Float> { /* private fields */ }Expand description
Guru interface for maximum flexibility.
Allows specifying arbitrary dimensions, strides, and batch parameters. This is the most general FFT interface, supporting:
- Arbitrary transform dimensions (1D, 2D, 3D, ND)
- Arbitrary strides for input and output
- Batched transforms with arbitrary batch dimensions
- In-place or out-of-place operation
§Example
ⓘ
use oxifft::{Complex, Direction, Flags, IoDim, Tensor};
use oxifft::api::GuruPlan;
// Create a batched 1D FFT: 10 transforms of size 256
let dims = Tensor::new(vec![IoDim::contiguous(256)]);
let howmany = Tensor::new(vec![IoDim::new(10, 256, 256)]); // 10 batches, stride=256
let mut input = vec![Complex::new(0.0, 0.0); 2560];
let mut output = vec![Complex::new(0.0, 0.0); 2560];
let plan = GuruPlan::<f64>::dft(
&dims,
&howmany,
Direction::Forward,
Flags::ESTIMATE,
).unwrap();
plan.execute(&input, &mut output);Implementations§
Source§impl<T: Float> GuruPlan<T>
impl<T: Float> GuruPlan<T>
Sourcepub fn dft(
dims: &Tensor,
howmany: &Tensor,
direction: Direction,
flags: Flags,
) -> Option<Self>
pub fn dft( dims: &Tensor, howmany: &Tensor, direction: Direction, flags: Flags, ) -> Option<Self>
Create a guru DFT plan with full control over dimensions and strides.
§Arguments
dims- Transform dimensions with input/output strideshowmany- Batch dimensions (vector rank). Can be empty for single transform.direction- Forward or Backwardflags- Planning flags
§Returns
A plan that can be executed on buffers with the specified layout.
Returns None if any dimension has size 0.
§Memory Layout
dimsspecifies the transform dimensions (innermost dimensions transform)howmanyspecifies the batch dimensions (outermost dimensions iterate)- Strides can be different for input and output (for in-place: use same strides)
Sourcepub fn transform_size(&self) -> usize
pub fn transform_size(&self) -> usize
Get the total number of elements in one transform.
Sourcepub fn batch_count(&self) -> usize
pub fn batch_count(&self) -> usize
Get the total number of transforms (batch count).
Sourcepub fn execute_inplace(&self, data: &mut [Complex<T>])
pub fn execute_inplace(&self, data: &mut [Complex<T>])
Execute the plan in-place.
For in-place execution, input and output strides must be identical.
Auto Trait Implementations§
impl<T> Freeze for GuruPlan<T>
impl<T> RefUnwindSafe for GuruPlan<T>where
T: RefUnwindSafe,
impl<T> Send for GuruPlan<T>
impl<T> Sync for GuruPlan<T>
impl<T> Unpin for GuruPlan<T>
impl<T> UnwindSafe for GuruPlan<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
Mutably borrows from an owned value. Read more
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>
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 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>
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