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