vector-fftw-0.1.2: A binding to the fftw library for one-dimensional vectors.

Safe Haskell Safe-Infered

Numeric.FFT.Vector.Plan

Contents

Synopsis

# Transform

data Transform a b Source

A transform which may be applied to vectors of different sizes.

planOfType :: (Storable a, Storable b) => PlanType -> Transform a b -> Int -> Plan a bSource

Create a `Plan` of a specific size for this transform.

data PlanType Source

Constructors

 Estimate Measure Patient Exhaustive

plan :: (Storable a, Storable b) => Transform a b -> Int -> Plan a bSource

Create a `Plan` of a specific size. This function is equivalent to `planOfType Estimate`.

run :: (Vector v a, Vector v b, Storable a, Storable b) => Transform a b -> v a -> v bSource

Create and run a `Plan` for the given transform.

# Plans

data Plan a b Source

A `Plan` can be used to run an `fftw` algorithm for a specific input/output size.

planInputSize :: Storable a => Plan a b -> IntSource

The (only) valid input size for this plan.

planOutputSize :: Storable b => Plan a b -> IntSource

The (only) valid output size for this plan.

execute :: (Vector v a, Vector v b, Storable a, Storable b) => Plan a b -> v a -> v bSource

Run a plan on the given `Vector`.

If `planInputSize p /= length v`, then calling `execute p v` will throw an exception.

Arguments

 :: forall m v a b . (PrimMonad m, MVector v a, MVector v b, Storable a, Storable b) => Plan a b The plan to run. -> v (PrimState m) a The input vector. -> v (PrimState m) b The output vector. -> m ()

Run a plan on the given mutable vectors. The same vector may be used for both input and output.

If `planInputSize p /= length vIn` or `planOutputSize p /= length vOut`, then calling `unsafeExecuteM p vIn vOut` will throw an exception.