accelerate-1.1.1.0: An embedded language for accelerated array processing

Copyright [2015..2017] Trevor L. McDonell BSD3 Trevor L. McDonell experimental non-portable (GHC extensions) None Haskell98

Data.Array.Accelerate.Data.Complex

Description

Complex numbers

Synopsis

# Rectangular from

data Complex a :: * -> * #

Complex numbers are an algebraic type.

For a complex number z, abs z is a number with the magnitude of z, but oriented in the positive real direction, whereas signum z has the phase of z, but unit magnitude.

The Foldable and Traversable instances traverse the real part first.

Constructors

 ~a :+ ~a infix 6 forms a complex number from its real and imaginary rectangular components.

Instances

real :: Elt a => Exp (Complex a) -> Exp a Source #

Return the real part of a complex number

imag :: Elt a => Exp (Complex a) -> Exp a Source #

Return the imaginary part of a complex number

# Polar form

mkPolar :: forall a. Floating a => Exp a -> Exp a -> Exp (Complex a) Source #

Form a complex number from polar components of magnitude and phase.

cis :: forall a. Floating a => Exp a -> Exp (Complex a) Source #

cis t is a complex value with magnitude 1 and phase t (modulo 2*pi).

polar :: RealFloat a => Exp (Complex a) -> Exp (a, a) Source #

The function polar takes a complex number and returns a (magnitude, phase) pair in canonical form: the magnitude is non-negative, and the phase in the range (-pi, pi]; if the magnitude is zero, then so is the phase.

magnitude :: RealFloat a => Exp (Complex a) -> Exp a Source #

The non-negative magnitude of a complex number

phase :: RealFloat a => Exp (Complex a) -> Exp a Source #

The phase of a complex number, in the range (-pi, pi]. If the magnitude is zero, then so is the phase.

# Conjugate

conjugate :: Num a => Exp (Complex a) -> Exp (Complex a) Source #

Return the complex conjugate of a complex number, defined as

conjugate(Z) = X - iY

# Orphan instances

 (FromIntegral a b, Num b) => FromIntegral a (Complex b) Source # MethodsfromIntegral :: Exp a -> Exp (Complex b) Source # Elt a => Unlift Exp (Complex (Exp a)) Source # Methodsunlift :: Exp (Plain (Complex (Exp a))) -> Complex (Exp a) Source # (Lift Exp a, Elt (Plain a)) => Lift Exp (Complex a) Source # Associated Typestype Plain (Complex a) :: * Source # Methodslift :: Complex a -> Exp (Plain (Complex a)) Source # RealFloat a => Floating (Exp (Complex a)) Source # Methodspi :: Exp (Complex a) #exp :: Exp (Complex a) -> Exp (Complex a) #log :: Exp (Complex a) -> Exp (Complex a) #sqrt :: Exp (Complex a) -> Exp (Complex a) #(**) :: Exp (Complex a) -> Exp (Complex a) -> Exp (Complex a) #logBase :: Exp (Complex a) -> Exp (Complex a) -> Exp (Complex a) #sin :: Exp (Complex a) -> Exp (Complex a) #cos :: Exp (Complex a) -> Exp (Complex a) #tan :: Exp (Complex a) -> Exp (Complex a) #asin :: Exp (Complex a) -> Exp (Complex a) #acos :: Exp (Complex a) -> Exp (Complex a) #atan :: Exp (Complex a) -> Exp (Complex a) #sinh :: Exp (Complex a) -> Exp (Complex a) #cosh :: Exp (Complex a) -> Exp (Complex a) #tanh :: Exp (Complex a) -> Exp (Complex a) #asinh :: Exp (Complex a) -> Exp (Complex a) #acosh :: Exp (Complex a) -> Exp (Complex a) #atanh :: Exp (Complex a) -> Exp (Complex a) #log1p :: Exp (Complex a) -> Exp (Complex a) #expm1 :: Exp (Complex a) -> Exp (Complex a) #log1pexp :: Exp (Complex a) -> Exp (Complex a) #log1mexp :: Exp (Complex a) -> Exp (Complex a) # RealFloat a => Fractional (Exp (Complex a)) Source # Methods(/) :: Exp (Complex a) -> Exp (Complex a) -> Exp (Complex a) #recip :: Exp (Complex a) -> Exp (Complex a) # RealFloat a => Num (Exp (Complex a)) Source # Methods(+) :: Exp (Complex a) -> Exp (Complex a) -> Exp (Complex a) #(-) :: Exp (Complex a) -> Exp (Complex a) -> Exp (Complex a) #(*) :: Exp (Complex a) -> Exp (Complex a) -> Exp (Complex a) #negate :: Exp (Complex a) -> Exp (Complex a) #abs :: Exp (Complex a) -> Exp (Complex a) #signum :: Exp (Complex a) -> Exp (Complex a) # Elt a => Elt (Complex a) Source # MethodseltType :: Complex a -> TupleType (EltRepr (Complex a))fromElt :: Complex a -> EltRepr (Complex a)toElt :: EltRepr (Complex a) -> Complex a Eq a => Eq (Complex a) Source # Methods(==) :: Exp (Complex a) -> Exp (Complex a) -> Exp Bool Source #(/=) :: Exp (Complex a) -> Exp (Complex a) -> Exp Bool Source #