Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- fourier :: (Integral n0, Integral n1, Integral n2, Real a) => Sign -> Array (Cyclic n0, Cyclic n1, Cyclic n2) (Complex a) -> Array (Cyclic n0, Cyclic n1, Cyclic n2) (Complex a)
- data Sign
- flipSign :: Sign -> Sign
- fourierRC :: (Integral n0, Integral n1, Integral n2, Real a) => Array (Cyclic n0, Cyclic n1, Cyclic n2) a -> Array (Cyclic n0, Cyclic n1, Half n2) (Complex a)
- fourierCR :: (Integral n0, Integral n1, Integral n2, Real a) => Array (Cyclic n0, Cyclic n1, Half n2) (Complex a) -> Array (Cyclic n0, Cyclic n1, Cyclic n2) a
Documentation
fourier :: (Integral n0, Integral n1, Integral n2, Real a) => Sign -> Array (Cyclic n0, Cyclic n1, Cyclic n2) (Complex a) -> Array (Cyclic n0, Cyclic n1, Cyclic n2) (Complex a) Source #
QC.forAll genCyclicArray3 $ \xs sign-> approxComplex floatTol (adjust xs) (Trafo3.fourier sign (Trafo3.fourier (flipSign sign) xs))
QC.forAll genCyclicArray3 $ \xs sign -> approxComplex doubleTol (adjust xs) (Trafo3.fourier sign (Trafo3.fourier (flipSign sign) xs))
QC.forAll genCyclicArray3 $ \xs sign -> approxComplex floatTol (Trafo3.fourier sign (Array.map Complex.conjugate xs)) (Array.map Complex.conjugate (Trafo3.fourier (flipSign sign) xs))
QC.forAll genCyclicArray3 $ \xs sign -> approxComplex doubleTol (Trafo3.fourier sign (Array.map Complex.conjugate xs)) (Array.map Complex.conjugate (Trafo3.fourier (flipSign sign) xs))
QC.forAll genCyclicArray3 $ \xys sign -> let (xs,ys) = split xys in approxComplex floatTol (Trafo3.fourier sign $ Array.zipWith (+) xs ys) (Array.zipWith (+) (Trafo3.fourier sign xs) (Trafo3.fourier sign ys))
QC.forAll genCyclicArray3 $ \xys sign -> let (xs,ys) = split xys in approxComplex doubleTol (Trafo3.fourier sign $ Array.zipWith (+) xs ys) (Array.zipWith (+) (Trafo3.fourier sign xs) (Trafo3.fourier sign ys))
QC.forAll genCyclicArray3 $ \xys sign -> let (xs,ys) = split xys in Complex.magnitude (scalarProduct (adjust xs) ys - scalarProduct (Trafo3.fourier sign xs) (Trafo3.fourier sign ys)) <= floatTol * normInf Complex.magnitude (adjust xs) * normInf Complex.magnitude ys
QC.forAll genCyclicArray3 $ \xys sign -> let (xs,ys) = split xys in Complex.magnitude (scalarProduct (adjust xs) ys - scalarProduct (Trafo3.fourier sign xs) (Trafo3.fourier sign ys)) <= doubleTol * normInf Complex.magnitude (adjust xs) * normInf Complex.magnitude ys
\sign -> QC.forAll genCyclicArray3 $ immutable (Trafo3.fourier sign) . arrayComplexFloat
\sign -> QC.forAll genCyclicArray3 $ immutable (Trafo3.fourier sign) . arrayComplexDouble
Order is chosen such that the numeric sign is (-1) ^ fromEnum sign
.
fourierRC :: (Integral n0, Integral n1, Integral n2, Real a) => Array (Cyclic n0, Cyclic n1, Cyclic n2) a -> Array (Cyclic n0, Cyclic n1, Half n2) (Complex a) Source #
QC.forAll genCyclicArray3 $ \xs -> approxReal floatTol (adjust xs) (Trafo3.fourierCR (Trafo3.fourierRC xs))
QC.forAll genCyclicArray3 $ \xs -> approxReal doubleTol (adjust xs) (Trafo3.fourierCR (Trafo3.fourierRC xs))
QC.forAll genCyclicArray3 $ immutable Trafo3.fourierRC . arrayFloat
QC.forAll genCyclicArray3 $ immutable Trafo3.fourierRC . arrayDouble
fourierCR :: (Integral n0, Integral n1, Integral n2, Real a) => Array (Cyclic n0, Cyclic n1, Half n2) (Complex a) -> Array (Cyclic n0, Cyclic n1, Cyclic n2) a Source #
QC.forAll (fmap Trafo3.fourierRC genCyclicArray3) $ immutable Trafo3.fourierCR . arrayComplexFloat
QC.forAll (fmap Trafo3.fourierRC genCyclicArray3) $ immutable Trafo3.fourierCR . arrayComplexDouble