{-# LINE 1 "src/Numeric/MPFR/Types.hsc" #-}
{-# LINE 7 "src/Numeric/MPFR/Types.hsc" #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE PatternSynonyms #-}
module Numeric.MPFR.Types where
import Data.Data
import Data.Typeable
import Data.Bits
import Data.Ix
import Data.Int
import Data.Word
import Foreign (Storable(..), Ptr)
import Numeric.GMP.Types (MPLimb(..))
pattern MPFR_VERSION_MAJOR = 3
{-# LINE 36 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_VERSION_MINOR = 1
{-# LINE 37 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_VERSION_PATCHLEVEL = 2
{-# LINE 38 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_VERSION = 196866
{-# LINE 39 "src/Numeric/MPFR/Types.hsc" #-}
data MPFR = MPFR
{ mpfrPrec :: !MPFRPrec
, mpfrSign :: !MPFRSign
, mpfrExp :: !MPFRExp
, mpfrD :: !(Ptr MPLimb)
}
instance Storable MPFR where
sizeOf _ = ((32))
{-# LINE 50 "src/Numeric/MPFR/Types.hsc" #-}
alignment _ = (8)
{-# LINE 51 "src/Numeric/MPFR/Types.hsc" #-}
peek ptr = do
prec <- ((\hsc_ptr -> peekByteOff hsc_ptr 0)) ptr
{-# LINE 53 "src/Numeric/MPFR/Types.hsc" #-}
sign <- ((\hsc_ptr -> peekByteOff hsc_ptr 8)) ptr
{-# LINE 54 "src/Numeric/MPFR/Types.hsc" #-}
exp' <- ((\hsc_ptr -> peekByteOff hsc_ptr 16)) ptr
{-# LINE 55 "src/Numeric/MPFR/Types.hsc" #-}
d <- ((\hsc_ptr -> peekByteOff hsc_ptr 24)) ptr
{-# LINE 56 "src/Numeric/MPFR/Types.hsc" #-}
return (MPFR{ mpfrPrec = prec, mpfrSign = sign, mpfrExp = exp', mpfrD = d })
poke ptr (MPFR{ mpfrPrec = prec, mpfrSign = sign, mpfrExp = exp', mpfrD = d }) = do
((\hsc_ptr -> pokeByteOff hsc_ptr 0)) ptr prec
{-# LINE 59 "src/Numeric/MPFR/Types.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 8)) ptr sign
{-# LINE 60 "src/Numeric/MPFR/Types.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 16)) ptr exp'
{-# LINE 61 "src/Numeric/MPFR/Types.hsc" #-}
((\hsc_ptr -> pokeByteOff hsc_ptr 24)) ptr d
{-# LINE 62 "src/Numeric/MPFR/Types.hsc" #-}
newtype MPFRInt = MPFRInt (Int32)
{-# LINE 65 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
newtype MPFRUInt = MPFRUInt (Word32)
{-# LINE 68 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
newtype MPFRLong = MPFRLong (Int64)
{-# LINE 72 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
newtype MPFRULong = MPFRULong (Word64)
{-# LINE 75 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
newtype MPFRSize = MPFRSize (Word64)
{-# LINE 79 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
newtype MPFRPrec = MPFRPrec (Int64)
{-# LINE 83 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
newtype MPFRUPrec = MPFRUPrec (Word64)
{-# LINE 86 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
pattern MPFR_PREC_MIN = (2)
{-# LINE 88 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_PREC_MAX = (9223372036854775807)
{-# LINE 89 "src/Numeric/MPFR/Types.hsc" #-}
newtype MPFRSign = MPFRSign (Int32)
{-# LINE 92 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
newtype MPFRExp = MPFRExp (Int64)
{-# LINE 96 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
newtype MPFRUExp = MPFRUExp (Word64)
{-# LINE 99 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
pattern MPFR_EMAX_DEFAULT = (1073741823)
{-# LINE 101 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_EMIN_DEFAULT = (-1073741823)
{-# LINE 102 "src/Numeric/MPFR/Types.hsc" #-}
newtype MPFRRnd = MPFRRnd (Int32)
{-# LINE 105 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
pattern MPFR_RNDN = (0)
{-# LINE 108 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_RNDZ = (1)
{-# LINE 110 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_RNDU = (2)
{-# LINE 112 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_RNDD = (3)
{-# LINE 114 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_RNDA = (4)
{-# LINE 116 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_RNDF = (5)
{-# LINE 118 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_RNDNA = (-1)
{-# LINE 120 "src/Numeric/MPFR/Types.hsc" #-}
newtype MPFRKind = MPFRKind (Word32)
{-# LINE 123 "src/Numeric/MPFR/Types.hsc" #-}
deriving (Eq, Ord, Read, Show, Enum, Bounded, Num, Integral, Real, Ix, Bits, FiniteBits, Data, Typeable, Storable)
pattern MPFR_NAN_KIND = (0)
{-# LINE 125 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_INF_KIND = (1)
{-# LINE 126 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_ZERO_KIND = (2)
{-# LINE 127 "src/Numeric/MPFR/Types.hsc" #-}
pattern MPFR_REGULAR_KIND = (3)
{-# LINE 128 "src/Numeric/MPFR/Types.hsc" #-}