accelerate-bignum-0.1.0.0: Fixed-length large integer arithmetic for Accelerate

Copyright[2016] Trevor L. McDonell
LicenseBSD3
MaintainerTrevor L. McDonell <tmcdonell@cse.unsw.edu.au>
Stabilityexperimental
Portabilitynon-portable (GHC extensions)
Safe HaskellNone
LanguageHaskell2010

Data.Array.Accelerate.Data.BigInt

Contents

Description

Fixed length signed integer types

Synopsis

Documentation

Internals

data BigInt hi lo Source #

Large integers of fixed size represented as separate (signed) high and (unsigned) low words.

Constructors

I2 !hi !lo 

Instances

(Bounded a, Bounded b) => Bounded (BigInt a b) Source # 

Methods

minBound :: BigInt a b #

maxBound :: BigInt a b #

(Enum a, Num a, Eq a, Enum b, Num b, Eq b, Bounded b) => Enum (BigInt a b) Source # 

Methods

succ :: BigInt a b -> BigInt a b #

pred :: BigInt a b -> BigInt a b #

toEnum :: Int -> BigInt a b #

fromEnum :: BigInt a b -> Int #

enumFrom :: BigInt a b -> [BigInt a b] #

enumFromThen :: BigInt a b -> BigInt a b -> [BigInt a b] #

enumFromTo :: BigInt a b -> BigInt a b -> [BigInt a b] #

enumFromThenTo :: BigInt a b -> BigInt a b -> BigInt a b -> [BigInt a b] #

(Eq a, Eq b) => Eq (BigInt a b) Source # 

Methods

(==) :: BigInt a b -> BigInt a b -> Bool #

(/=) :: BigInt a b -> BigInt a b -> Bool #

(Integral a, Integral b, Bounded b, Integral (BigWord (Unsigned a) b), Num2 (BigInt a b), Num2 (BigWord (Unsigned a) b), BigIntCtx a b) => Integral (BigInt a b) Source # 

Methods

quot :: BigInt a b -> BigInt a b -> BigInt a b #

rem :: BigInt a b -> BigInt a b -> BigInt a b #

div :: BigInt a b -> BigInt a b -> BigInt a b #

mod :: BigInt a b -> BigInt a b -> BigInt a b #

quotRem :: BigInt a b -> BigInt a b -> (BigInt a b, BigInt a b) #

divMod :: BigInt a b -> BigInt a b -> (BigInt a b, BigInt a b) #

toInteger :: BigInt a b -> Integer #

(Integral a, Ord a, Integral b, Ord b, Bounded b, Ord (BigInt a b), Num (BigInt a b), Num2 (BigInt a b), Num (BigWord (Unsigned a) b), Num2 (BigWord (Unsigned a) b), BigIntCtx a b) => Num (BigInt a b) Source # 

Methods

(+) :: BigInt a b -> BigInt a b -> BigInt a b #

(-) :: BigInt a b -> BigInt a b -> BigInt a b #

(*) :: BigInt a b -> BigInt a b -> BigInt a b #

negate :: BigInt a b -> BigInt a b #

abs :: BigInt a b -> BigInt a b #

signum :: BigInt a b -> BigInt a b #

fromInteger :: Integer -> BigInt a b #

(Ord a, Ord b) => Ord (BigInt a b) Source # 

Methods

compare :: BigInt a b -> BigInt a b -> Ordering #

(<) :: BigInt a b -> BigInt a b -> Bool #

(<=) :: BigInt a b -> BigInt a b -> Bool #

(>) :: BigInt a b -> BigInt a b -> Bool #

(>=) :: BigInt a b -> BigInt a b -> Bool #

max :: BigInt a b -> BigInt a b -> BigInt a b #

min :: BigInt a b -> BigInt a b -> BigInt a b #

(Integral (BigInt a b), Num (BigInt a b), Ord (BigInt a b)) => Real (BigInt a b) Source # 

Methods

toRational :: BigInt a b -> Rational #

Integral (BigInt a b) => Show (BigInt a b) Source # 

Methods

showsPrec :: Int -> BigInt a b -> ShowS #

show :: BigInt a b -> String #

showList :: [BigInt a b] -> ShowS #

(FiniteBits a, Integral a, FiniteBits b, Integral b, FiniteBits (BigInt a b), Num2 (BigInt a b), Num2 (BigWord (Unsigned a) b), Bits (BigWord (Unsigned a) b), Integral (Signed b), Bits (Signed b), BigIntCtx a b) => Bits (BigInt a b) Source # 

Methods

(.&.) :: BigInt a b -> BigInt a b -> BigInt a b #

(.|.) :: BigInt a b -> BigInt a b -> BigInt a b #

xor :: BigInt a b -> BigInt a b -> BigInt a b #

complement :: BigInt a b -> BigInt a b #

shift :: BigInt a b -> Int -> BigInt a b #

rotate :: BigInt a b -> Int -> BigInt a b #

zeroBits :: BigInt a b #

bit :: Int -> BigInt a b #

setBit :: BigInt a b -> Int -> BigInt a b #

clearBit :: BigInt a b -> Int -> BigInt a b #

complementBit :: BigInt a b -> Int -> BigInt a b #

testBit :: BigInt a b -> Int -> Bool #

bitSizeMaybe :: BigInt a b -> Maybe Int #

bitSize :: BigInt a b -> Int #

isSigned :: BigInt a b -> Bool #

shiftL :: BigInt a b -> Int -> BigInt a b #

unsafeShiftL :: BigInt a b -> Int -> BigInt a b #

shiftR :: BigInt a b -> Int -> BigInt a b #

unsafeShiftR :: BigInt a b -> Int -> BigInt a b #

rotateL :: BigInt a b -> Int -> BigInt a b #

rotateR :: BigInt a b -> Int -> BigInt a b #

popCount :: BigInt a b -> Int #

(FiniteBits a, FiniteBits b, Bits (BigInt a b), Num2 (BigInt a b), FiniteBits (BigWord (Unsigned a) b), BigIntCtx a b) => FiniteBits (BigInt a b) Source # 
(Ord a, Num a, Num2 a, Num (BigInt a b), Ord (BigInt a b), Num2 (BigInt a b), Bits (BigInt a b), Num (BigWord (Unsigned a) b), Num2 (BigWord (Unsigned a) b), Bounded (BigWord (Unsigned a) b), BigIntCtx a b, (~) * (Unsigned (Unsigned a)) (Unsigned a)) => Num2 (BigInt a b) Source # 

Associated Types

type Signed (BigInt a b) :: * Source #

type Unsigned (BigInt a b) :: * Source #

Methods

signed :: BigInt a b -> Signed (BigInt a b) Source #

unsigned :: BigInt a b -> Unsigned (BigInt a b) Source #

addWithCarry :: BigInt a b -> BigInt a b -> (BigInt a b, Unsigned (BigInt a b)) Source #

mulWithCarry :: BigInt a b -> BigInt a b -> (BigInt a b, Unsigned (BigInt a b)) Source #

type Signed (Exp (BigInt a b)) Source # 
type Signed (Exp (BigInt a b)) = Exp (BigInt a b)
type Unsigned (Exp (BigInt a b)) Source # 
type Unsigned (Exp (BigInt a b)) = Exp (BigWord (Unsigned a) b)
type EltRepr (BigInt a b) 
type EltRepr (BigInt a b) = EltRepr (a, b)
type ProdRepr (BigInt a b) 
type ProdRepr (BigInt a b) = ProdRepr (a, b)
type Plain (BigInt a b) # 
type Plain (BigInt a b) = BigInt (Plain a) (Plain b)
type Signed (BigInt a b) Source # 
type Signed (BigInt a b) = BigInt (Signed a) b
type Unsigned (BigInt a b) Source # 
type Unsigned (BigInt a b) = BigWord (Unsigned a) b

class Num2 w where Source #

Addition and multiplication with carry

Minimal complete definition

signed, unsigned, addWithCarry, mulWithCarry

Associated Types

type Signed w Source #

type Unsigned w Source #

Methods

signed :: w -> Signed w Source #

unsigned :: w -> Unsigned w Source #

addWithCarry :: w -> w -> (w, Unsigned w) Source #

mulWithCarry :: w -> w -> (w, Unsigned w) Source #

Instances

Num2 Int8 Source # 
Num2 Int16 Source # 
Num2 Int32 Source # 
Num2 Int64 Source # 
Num2 Word8 Source # 
Num2 Word16 Source # 
Num2 Word32 Source # 
Num2 Word64 Source # 
(Ord a, Num a, Num2 a, Num (BigInt a b), Ord (BigInt a b), Num2 (BigInt a b), Bits (BigInt a b), Num (BigWord (Unsigned a) b), Num2 (BigWord (Unsigned a) b), Bounded (BigWord (Unsigned a) b), BigIntCtx a b, (~) * (Unsigned (Unsigned a)) (Unsigned a)) => Num2 (BigInt a b) Source # 

Associated Types

type Signed (BigInt a b) :: * Source #

type Unsigned (BigInt a b) :: * Source #

Methods

signed :: BigInt a b -> Signed (BigInt a b) Source #

unsigned :: BigInt a b -> Unsigned (BigInt a b) Source #

addWithCarry :: BigInt a b -> BigInt a b -> (BigInt a b, Unsigned (BigInt a b)) Source #

mulWithCarry :: BigInt a b -> BigInt a b -> (BigInt a b, Unsigned (BigInt a b)) Source #

(Integral a, FiniteBits a, Num2 a, Integral b, FiniteBits b, Num2 b, BigWordCtx a b) => Num2 (BigWord a b) Source # 

Associated Types

type Signed (BigWord a b) :: * Source #

type Unsigned (BigWord a b) :: * Source #

Methods

signed :: BigWord a b -> Signed (BigWord a b) Source #

unsigned :: BigWord a b -> Unsigned (BigWord a b) Source #

addWithCarry :: BigWord a b -> BigWord a b -> (BigWord a b, Unsigned (BigWord a b)) Source #

mulWithCarry :: BigWord a b -> BigWord a b -> (BigWord a b, Unsigned (BigWord a b)) Source #