{-# LINE 1 "src/ArrayFire/Internal/Types.hsc" #-}
{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE CPP #-}
module ArrayFire.Internal.Types where
import ArrayFire.Internal.Defines
import Data.Complex
import Data.Proxy
import Data.Word
import Foreign.C.String
import Foreign.C.Types
import Foreign.ForeignPtr
import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
import Foreign.Marshal.Alloc (alloca)
import Foreign.Ptr (Ptr)
import Foreign.Storable
import GHC.Int
data AFSeq
= AFSeq
{ AFSeq -> Double
afSeqBegin :: {-# UNPACK #-} !Double
, AFSeq -> Double
afSeqEnd :: {-# UNPACK #-} !Double
, AFSeq -> Double
afSeqStep :: {-# UNPACK #-} !Double
} deriving (Int -> AFSeq -> ShowS
[AFSeq] -> ShowS
AFSeq -> [Char]
(Int -> AFSeq -> ShowS)
-> (AFSeq -> [Char]) -> ([AFSeq] -> ShowS) -> Show AFSeq
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AFSeq -> ShowS
showsPrec :: Int -> AFSeq -> ShowS
$cshow :: AFSeq -> [Char]
show :: AFSeq -> [Char]
$cshowList :: [AFSeq] -> ShowS
showList :: [AFSeq] -> ShowS
Show, AFSeq -> AFSeq -> Bool
(AFSeq -> AFSeq -> Bool) -> (AFSeq -> AFSeq -> Bool) -> Eq AFSeq
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AFSeq -> AFSeq -> Bool
== :: AFSeq -> AFSeq -> Bool
$c/= :: AFSeq -> AFSeq -> Bool
/= :: AFSeq -> AFSeq -> Bool
Eq)
instance Storable AFSeq where
sizeOf :: AFSeq -> Int
sizeOf AFSeq
_ = (Int
24)
{-# LINE 37 "src/ArrayFire/Internal/Types.hsc" #-}
alignment _ = 8
{-# LINE 38 "src/ArrayFire/Internal/Types.hsc" #-}
peek ptr = do
afSeqBegin <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
{-# LINE 40 "src/ArrayFire/Internal/Types.hsc" #-}
afSeqEnd <- (\hsc_ptr -> peekByteOff hsc_ptr 8) ptr
{-# LINE 41 "src/ArrayFire/Internal/Types.hsc" #-}
afSeqStep <- (\hsc_ptr -> peekByteOff hsc_ptr 16) ptr
{-# LINE 42 "src/ArrayFire/Internal/Types.hsc" #-}
pure AFSeq {..}
poke :: Ptr AFSeq -> AFSeq -> IO ()
poke Ptr AFSeq
ptr AFSeq{Double
afSeqBegin :: AFSeq -> Double
afSeqEnd :: AFSeq -> Double
afSeqStep :: AFSeq -> Double
afSeqBegin :: Double
afSeqEnd :: Double
afSeqStep :: Double
..} = do
(\Ptr AFSeq
hsc_ptr -> Ptr AFSeq -> Int -> Double -> IO ()
forall b. Ptr b -> Int -> Double -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr AFSeq
hsc_ptr Int
0) Ptr AFSeq
ptr Double
afSeqBegin
{-# LINE 45 "src/ArrayFire/Internal/Types.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 8) ptr afSeqEnd
{-# LINE 46 "src/ArrayFire/Internal/Types.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 16) ptr afSeqStep
{-# LINE 47 "src/ArrayFire/Internal/Types.hsc" #-}
data AFIndex
= AFIndex
{ AFIndex -> Either AFArray AFSeq
afIdx :: !(Either AFArray AFSeq)
, AFIndex -> Bool
afIsSeq :: !Bool
, AFIndex -> Bool
afIsBatch :: !Bool
}
instance Storable AFIndex where
sizeOf :: AFIndex -> Int
sizeOf AFIndex
_ = (Int
32)
{-# LINE 57 "src/ArrayFire/Internal/Types.hsc" #-}
alignment _ = 8
{-# LINE 58 "src/ArrayFire/Internal/Types.hsc" #-}
peek ptr = do
afIsSeq <- (\hsc_ptr -> peekByteOff hsc_ptr 24) ptr
{-# LINE 60 "src/ArrayFire/Internal/Types.hsc" #-}
afIsBatch <- (\hsc_ptr -> peekByteOff hsc_ptr 25) ptr
{-# LINE 61 "src/ArrayFire/Internal/Types.hsc" #-}
afIdx <-
if afIsSeq
then Right <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
{-# LINE 64 "src/ArrayFire/Internal/Types.hsc" #-}
else Left <$> (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
{-# LINE 65 "src/ArrayFire/Internal/Types.hsc" #-}
pure AFIndex{..}
poke :: Ptr AFIndex -> AFIndex -> IO ()
poke Ptr AFIndex
ptr AFIndex{Bool
Either AFArray AFSeq
afIdx :: AFIndex -> Either AFArray AFSeq
afIsSeq :: AFIndex -> Bool
afIsBatch :: AFIndex -> Bool
afIdx :: Either AFArray AFSeq
afIsSeq :: Bool
afIsBatch :: Bool
..} = do
case Either AFArray AFSeq
afIdx of
Left AFArray
afarr -> (\Ptr AFIndex
hsc_ptr -> Ptr AFIndex -> Int -> AFArray -> IO ()
forall b. Ptr b -> Int -> AFArray -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr AFIndex
hsc_ptr Int
0) Ptr AFIndex
ptr AFArray
afarr
{-# LINE 69 "src/ArrayFire/Internal/Types.hsc" #-}
Right afseq -> (\hsc_ptr -> pokeByteOff hsc_ptr 0) ptr afseq
{-# LINE 70 "src/ArrayFire/Internal/Types.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 24) ptr afIsSeq
{-# LINE 71 "src/ArrayFire/Internal/Types.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 25) ptr afIsBatch
{-# LINE 72 "src/ArrayFire/Internal/Types.hsc" #-}
data AFCFloat
= AFCFloat
{ AFCFloat -> Float
afcReal :: {-# UNPACK #-} !Float
, AFCFloat -> Float
afcImag :: {-# UNPACK #-} !Float
} deriving (AFCFloat -> AFCFloat -> Bool
(AFCFloat -> AFCFloat -> Bool)
-> (AFCFloat -> AFCFloat -> Bool) -> Eq AFCFloat
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AFCFloat -> AFCFloat -> Bool
== :: AFCFloat -> AFCFloat -> Bool
$c/= :: AFCFloat -> AFCFloat -> Bool
/= :: AFCFloat -> AFCFloat -> Bool
Eq, Int -> AFCFloat -> ShowS
[AFCFloat] -> ShowS
AFCFloat -> [Char]
(Int -> AFCFloat -> ShowS)
-> (AFCFloat -> [Char]) -> ([AFCFloat] -> ShowS) -> Show AFCFloat
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AFCFloat -> ShowS
showsPrec :: Int -> AFCFloat -> ShowS
$cshow :: AFCFloat -> [Char]
show :: AFCFloat -> [Char]
$cshowList :: [AFCFloat] -> ShowS
showList :: [AFCFloat] -> ShowS
Show)
instance Storable AFCFloat where
sizeOf :: AFCFloat -> Int
sizeOf AFCFloat
_ = (Int
8)
{-# LINE 81 "src/ArrayFire/Internal/Types.hsc" #-}
alignment _ = 4
{-# LINE 82 "src/ArrayFire/Internal/Types.hsc" #-}
peek ptr = do
afcReal <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
{-# LINE 84 "src/ArrayFire/Internal/Types.hsc" #-}
afcImag <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
{-# LINE 85 "src/ArrayFire/Internal/Types.hsc" #-}
pure AFCFloat{..}
poke :: Ptr AFCFloat -> AFCFloat -> IO ()
poke Ptr AFCFloat
ptr AFCFloat{Float
afcReal :: AFCFloat -> Float
afcImag :: AFCFloat -> Float
afcReal :: Float
afcImag :: Float
..} = do
(\Ptr AFCFloat
hsc_ptr -> Ptr AFCFloat -> Int -> Float -> IO ()
forall b. Ptr b -> Int -> Float -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr AFCFloat
hsc_ptr Int
0) Ptr AFCFloat
ptr Float
afcReal
{-# LINE 88 "src/ArrayFire/Internal/Types.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 4) ptr afcImag
{-# LINE 89 "src/ArrayFire/Internal/Types.hsc" #-}
data AFCell
= AFCell
{ AFCell -> Int
afCellRow :: {-# UNPACK #-} !Int
, AFCell -> Int
afCellCol :: {-# UNPACK #-} !Int
, AFCell -> CString
afCellTitle :: {-# UNPACK #-} !CString
, AFCell -> AFColorMap
afCellColorMap :: {-# UNPACK #-} !AFColorMap
} deriving (Int -> AFCell -> ShowS
[AFCell] -> ShowS
AFCell -> [Char]
(Int -> AFCell -> ShowS)
-> (AFCell -> [Char]) -> ([AFCell] -> ShowS) -> Show AFCell
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AFCell -> ShowS
showsPrec :: Int -> AFCell -> ShowS
$cshow :: AFCell -> [Char]
show :: AFCell -> [Char]
$cshowList :: [AFCell] -> ShowS
showList :: [AFCell] -> ShowS
Show, AFCell -> AFCell -> Bool
(AFCell -> AFCell -> Bool)
-> (AFCell -> AFCell -> Bool) -> Eq AFCell
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AFCell -> AFCell -> Bool
== :: AFCell -> AFCell -> Bool
$c/= :: AFCell -> AFCell -> Bool
/= :: AFCell -> AFCell -> Bool
Eq)
instance Storable AFCell where
sizeOf :: AFCell -> Int
sizeOf AFCell
_ = (Int
24)
{-# LINE 100 "src/ArrayFire/Internal/Types.hsc" #-}
alignment _ = 8
{-# LINE 101 "src/ArrayFire/Internal/Types.hsc" #-}
peek ptr = do
afCellRow <- (\hsc_ptr -> peekByteOff hsc_ptr 0) ptr
{-# LINE 103 "src/ArrayFire/Internal/Types.hsc" #-}
afCellCol <- (\hsc_ptr -> peekByteOff hsc_ptr 4) ptr
{-# LINE 104 "src/ArrayFire/Internal/Types.hsc" #-}
afCellTitle <- (\hsc_ptr -> peekByteOff hsc_ptr 8) ptr
{-# LINE 105 "src/ArrayFire/Internal/Types.hsc" #-}
afCellColorMap <- (\hsc_ptr -> peekByteOff hsc_ptr 16) ptr
{-# LINE 106 "src/ArrayFire/Internal/Types.hsc" #-}
pure AFCell{..}
poke :: Ptr AFCell -> AFCell -> IO ()
poke Ptr AFCell
ptr AFCell{Int
CString
AFColorMap
afCellRow :: AFCell -> Int
afCellCol :: AFCell -> Int
afCellTitle :: AFCell -> CString
afCellColorMap :: AFCell -> AFColorMap
afCellRow :: Int
afCellCol :: Int
afCellTitle :: CString
afCellColorMap :: AFColorMap
..} = do
(\Ptr AFCell
hsc_ptr -> Ptr AFCell -> Int -> Int -> IO ()
forall b. Ptr b -> Int -> Int -> IO ()
forall a b. Storable a => Ptr b -> Int -> a -> IO ()
pokeByteOff Ptr AFCell
hsc_ptr Int
0) Ptr AFCell
ptr Int
afCellRow
{-# LINE 109 "src/ArrayFire/Internal/Types.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 4) ptr afCellCol
{-# LINE 110 "src/ArrayFire/Internal/Types.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 8) ptr afCellTitle
{-# LINE 111 "src/ArrayFire/Internal/Types.hsc" #-}
(\hsc_ptr -> pokeByteOff hsc_ptr 16) ptr afCellColorMap
{-# LINE 112 "src/ArrayFire/Internal/Types.hsc" #-}
newtype Array a = Array (ForeignPtr ())
newtype Features = Features (ForeignPtr ())
newtype RandomEngine = RandomEngine (ForeignPtr ())
newtype Window = Window (ForeignPtr ())
class Storable a => AFType a where
afType :: Proxy a -> AFDtype
instance AFType Double where afType :: Proxy Double -> AFDtype
afType Proxy Double
Proxy = AFDtype
f64
instance AFType Float where afType :: Proxy Float -> AFDtype
afType Proxy Float
Proxy = AFDtype
f32
instance AFType (Complex Double) where afType :: Proxy (Complex Double) -> AFDtype
afType Proxy (Complex Double)
Proxy = AFDtype
c64
instance AFType (Complex Float) where afType :: Proxy (Complex Float) -> AFDtype
afType Proxy (Complex Float)
Proxy = AFDtype
c32
instance AFType CBool where afType :: Proxy CBool -> AFDtype
afType Proxy CBool
Proxy = AFDtype
b8
instance AFType Int32 where afType :: Proxy Int32 -> AFDtype
afType Proxy Int32
Proxy = AFDtype
s32
instance AFType Word32 where afType :: Proxy Word32 -> AFDtype
afType Proxy Word32
Proxy = AFDtype
u32
instance AFType Word8 where afType :: Proxy Word8 -> AFDtype
afType Proxy Word8
Proxy = AFDtype
u8
instance AFType Int64 where afType :: Proxy Int64 -> AFDtype
afType Proxy Int64
Proxy = AFDtype
s64
instance AFType Int where afType :: Proxy Int -> AFDtype
afType Proxy Int
Proxy = AFDtype
s64
instance AFType Int16 where afType :: Proxy Int16 -> AFDtype
afType Proxy Int16
Proxy = AFDtype
s16
instance AFType Word16 where afType :: Proxy Word16 -> AFDtype
afType Proxy Word16
Proxy = AFDtype
u16
instance AFType Word64 where afType :: Proxy Word64 -> AFDtype
afType Proxy Word64
Proxy = AFDtype
u64
instance AFType Word where afType :: Proxy Word -> AFDtype
afType Proxy Word
Proxy = AFDtype
u64
class AFType a => AFResult a where
type Scalar a
toAFResult :: (Double, Double) -> Scalar a
instance AFResult Double where
type Scalar Double = Double
toAFResult :: (Double, Double) -> Scalar Double
toAFResult (Double
r, Double
_) = Double
Scalar Double
r
instance AFResult Float where
type Scalar Float = Double
toAFResult :: (Double, Double) -> Scalar Float
toAFResult (Double
r, Double
_) = Double
Scalar Float
r
instance AFResult (Complex Double) where
type Scalar (Complex Double) = Complex Double
toAFResult :: (Double, Double) -> Scalar (Complex Double)
toAFResult (Double
r, Double
i) = Double
r Double -> Double -> Complex Double
forall a. a -> a -> Complex a
:+ Double
i
instance AFResult (Complex Float) where
type Scalar (Complex Float) = Complex Double
toAFResult :: (Double, Double) -> Scalar (Complex Float)
toAFResult (Double
r, Double
i) = Double
r Double -> Double -> Complex Double
forall a. a -> a -> Complex a
:+ Double
i
instance AFResult CBool where
type Scalar CBool = Double
toAFResult :: (Double, Double) -> Scalar CBool
toAFResult (Double
r, Double
_) = Double
Scalar CBool
r
instance AFResult Int32 where
type Scalar Int32 = Double
toAFResult :: (Double, Double) -> Scalar Int32
toAFResult (Double
r, Double
_) = Double
Scalar Int32
r
instance AFResult Word32 where
type Scalar Word32 = Double
toAFResult :: (Double, Double) -> Scalar Word32
toAFResult (Double
r, Double
_) = Double
Scalar Word32
r
instance AFResult Word8 where
type Scalar Word8 = Double
toAFResult :: (Double, Double) -> Scalar Word8
toAFResult (Double
r, Double
_) = Double
Scalar Word8
r
instance AFResult Int64 where
type Scalar Int64 = Double
toAFResult :: (Double, Double) -> Scalar Int64
toAFResult (Double
r, Double
_) = Double
Scalar Int64
r
instance AFResult Int where
type Scalar Int = Double
toAFResult :: (Double, Double) -> Scalar Int
toAFResult (Double
r, Double
_) = Double
Scalar Int
r
instance AFResult Int16 where
type Scalar Int16 = Double
toAFResult :: (Double, Double) -> Scalar Int16
toAFResult (Double
r, Double
_) = Double
Scalar Int16
r
instance AFResult Word16 where
type Scalar Word16 = Double
toAFResult :: (Double, Double) -> Scalar Word16
toAFResult (Double
r, Double
_) = Double
Scalar Word16
r
instance AFResult Word64 where
type Scalar Word64 = Double
toAFResult :: (Double, Double) -> Scalar Word64
toAFResult (Double
r, Double
_) = Double
Scalar Word64
r
instance AFResult Word where
type Scalar Word = Double
toAFResult :: (Double, Double) -> Scalar Word
toAFResult (Double
r, Double
_) = Double
Scalar Word
r
data Backend
= Default
| CPU
| CUDA
| OpenCL
deriving (Int -> Backend -> ShowS
[Backend] -> ShowS
Backend -> [Char]
(Int -> Backend -> ShowS)
-> (Backend -> [Char]) -> ([Backend] -> ShowS) -> Show Backend
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Backend -> ShowS
showsPrec :: Int -> Backend -> ShowS
$cshow :: Backend -> [Char]
show :: Backend -> [Char]
$cshowList :: [Backend] -> ShowS
showList :: [Backend] -> ShowS
Show, Backend -> Backend -> Bool
(Backend -> Backend -> Bool)
-> (Backend -> Backend -> Bool) -> Eq Backend
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Backend -> Backend -> Bool
== :: Backend -> Backend -> Bool
$c/= :: Backend -> Backend -> Bool
/= :: Backend -> Backend -> Bool
Eq, Eq Backend
Eq Backend =>
(Backend -> Backend -> Ordering)
-> (Backend -> Backend -> Bool)
-> (Backend -> Backend -> Bool)
-> (Backend -> Backend -> Bool)
-> (Backend -> Backend -> Bool)
-> (Backend -> Backend -> Backend)
-> (Backend -> Backend -> Backend)
-> Ord Backend
Backend -> Backend -> Bool
Backend -> Backend -> Ordering
Backend -> Backend -> Backend
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Backend -> Backend -> Ordering
compare :: Backend -> Backend -> Ordering
$c< :: Backend -> Backend -> Bool
< :: Backend -> Backend -> Bool
$c<= :: Backend -> Backend -> Bool
<= :: Backend -> Backend -> Bool
$c> :: Backend -> Backend -> Bool
> :: Backend -> Backend -> Bool
$c>= :: Backend -> Backend -> Bool
>= :: Backend -> Backend -> Bool
$cmax :: Backend -> Backend -> Backend
max :: Backend -> Backend -> Backend
$cmin :: Backend -> Backend -> Backend
min :: Backend -> Backend -> Backend
Ord)
toBackend :: AFBackend -> Backend
toBackend :: AFBackend -> Backend
toBackend (AFBackend CInt
0) = Backend
Default
toBackend (AFBackend CInt
1) = Backend
CPU
toBackend (AFBackend CInt
2) = Backend
CUDA
toBackend (AFBackend CInt
4) = Backend
OpenCL
toBackend (AFBackend CInt
x) = [Char] -> Backend
forall a. HasCallStack => [Char] -> a
error ([Char] -> Backend) -> [Char] -> Backend
forall a b. (a -> b) -> a -> b
$ [Char]
"Invalid backend: " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> CInt -> [Char]
forall a. Show a => a -> [Char]
show CInt
x
toAFBackend :: Backend -> AFBackend
toAFBackend :: Backend -> AFBackend
toAFBackend Backend
Default = (CInt -> AFBackend
AFBackend CInt
0)
toAFBackend Backend
CPU = (CInt -> AFBackend
AFBackend CInt
1)
toAFBackend Backend
CUDA = (CInt -> AFBackend
AFBackend CInt
2)
toAFBackend Backend
OpenCL = (CInt -> AFBackend
AFBackend CInt
4)
toBackends :: Int -> [Backend]
toBackends :: Int -> [Backend]
toBackends Int
1 = [Backend
CPU]
toBackends Int
2 = [Backend
CUDA]
toBackends Int
3 = [Backend
CPU,Backend
CUDA]
toBackends Int
4 = [Backend
OpenCL]
toBackends Int
5 = [Backend
CPU,Backend
OpenCL]
toBackends Int
6 = [Backend
CUDA,Backend
OpenCL]
toBackends Int
7 = [Backend
CPU,Backend
CUDA,Backend
OpenCL]
toBackends Int
_ = []
data MatProp
= None
| Trans
| CTrans
| Conj
| Upper
| Lower
| DiagUnit
| Sym
| PosDef
| Orthog
| TriDiag
| BlockDiag
deriving (Int -> MatProp -> ShowS
[MatProp] -> ShowS
MatProp -> [Char]
(Int -> MatProp -> ShowS)
-> (MatProp -> [Char]) -> ([MatProp] -> ShowS) -> Show MatProp
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MatProp -> ShowS
showsPrec :: Int -> MatProp -> ShowS
$cshow :: MatProp -> [Char]
show :: MatProp -> [Char]
$cshowList :: [MatProp] -> ShowS
showList :: [MatProp] -> ShowS
Show, MatProp -> MatProp -> Bool
(MatProp -> MatProp -> Bool)
-> (MatProp -> MatProp -> Bool) -> Eq MatProp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MatProp -> MatProp -> Bool
== :: MatProp -> MatProp -> Bool
$c/= :: MatProp -> MatProp -> Bool
/= :: MatProp -> MatProp -> Bool
Eq, Eq MatProp
Eq MatProp =>
(MatProp -> MatProp -> Ordering)
-> (MatProp -> MatProp -> Bool)
-> (MatProp -> MatProp -> Bool)
-> (MatProp -> MatProp -> Bool)
-> (MatProp -> MatProp -> Bool)
-> (MatProp -> MatProp -> MatProp)
-> (MatProp -> MatProp -> MatProp)
-> Ord MatProp
MatProp -> MatProp -> Bool
MatProp -> MatProp -> Ordering
MatProp -> MatProp -> MatProp
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: MatProp -> MatProp -> Ordering
compare :: MatProp -> MatProp -> Ordering
$c< :: MatProp -> MatProp -> Bool
< :: MatProp -> MatProp -> Bool
$c<= :: MatProp -> MatProp -> Bool
<= :: MatProp -> MatProp -> Bool
$c> :: MatProp -> MatProp -> Bool
> :: MatProp -> MatProp -> Bool
$c>= :: MatProp -> MatProp -> Bool
>= :: MatProp -> MatProp -> Bool
$cmax :: MatProp -> MatProp -> MatProp
max :: MatProp -> MatProp -> MatProp
$cmin :: MatProp -> MatProp -> MatProp
min :: MatProp -> MatProp -> MatProp
Ord)
fromMatProp
:: AFMatProp
-> MatProp
fromMatProp :: AFMatProp -> MatProp
fromMatProp (AFMatProp Int
0) = MatProp
None
fromMatProp (AFMatProp Int
1) = MatProp
Trans
fromMatProp (AFMatProp Int
2) = MatProp
CTrans
fromMatProp (AFMatProp Int
4) = MatProp
Conj
fromMatProp (AFMatProp Int
32) = MatProp
Upper
fromMatProp (AFMatProp Int
64) = MatProp
Lower
fromMatProp (AFMatProp Int
128) = MatProp
DiagUnit
fromMatProp (AFMatProp Int
512) = MatProp
Sym
fromMatProp (AFMatProp Int
1024) = MatProp
PosDef
fromMatProp (AFMatProp Int
2048) = MatProp
Orthog
fromMatProp (AFMatProp Int
4096) = MatProp
TriDiag
fromMatProp (AFMatProp Int
8192) = MatProp
BlockDiag
fromMatProp AFMatProp
x = [Char] -> MatProp
forall a. HasCallStack => [Char] -> a
error ([Char] -> MatProp) -> [Char] -> MatProp
forall a b. (a -> b) -> a -> b
$ [Char]
"Invalid AFMatProp value: " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> AFMatProp -> [Char]
forall a. Show a => a -> [Char]
show AFMatProp
x
toMatProp
:: MatProp
-> AFMatProp
toMatProp :: MatProp -> AFMatProp
toMatProp MatProp
None = (Int -> AFMatProp
AFMatProp Int
0)
toMatProp MatProp
Trans = (Int -> AFMatProp
AFMatProp Int
1)
toMatProp MatProp
CTrans = (Int -> AFMatProp
AFMatProp Int
2)
toMatProp MatProp
Conj = (Int -> AFMatProp
AFMatProp Int
4)
toMatProp MatProp
Upper = (Int -> AFMatProp
AFMatProp Int
32)
toMatProp MatProp
Lower = (Int -> AFMatProp
AFMatProp Int
64)
toMatProp MatProp
DiagUnit = (Int -> AFMatProp
AFMatProp Int
128)
toMatProp MatProp
Sym = (Int -> AFMatProp
AFMatProp Int
512)
toMatProp MatProp
PosDef = (Int -> AFMatProp
AFMatProp Int
1024)
toMatProp MatProp
Orthog = (Int -> AFMatProp
AFMatProp Int
2048)
toMatProp MatProp
TriDiag = (Int -> AFMatProp
AFMatProp Int
4096)
toMatProp MatProp
BlockDiag = (Int -> AFMatProp
AFMatProp Int
8192)
data BinaryOp
= Add
| Mul
| Min
| Max
deriving (Int -> BinaryOp -> ShowS
[BinaryOp] -> ShowS
BinaryOp -> [Char]
(Int -> BinaryOp -> ShowS)
-> (BinaryOp -> [Char]) -> ([BinaryOp] -> ShowS) -> Show BinaryOp
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BinaryOp -> ShowS
showsPrec :: Int -> BinaryOp -> ShowS
$cshow :: BinaryOp -> [Char]
show :: BinaryOp -> [Char]
$cshowList :: [BinaryOp] -> ShowS
showList :: [BinaryOp] -> ShowS
Show, BinaryOp -> BinaryOp -> Bool
(BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool) -> Eq BinaryOp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BinaryOp -> BinaryOp -> Bool
== :: BinaryOp -> BinaryOp -> Bool
$c/= :: BinaryOp -> BinaryOp -> Bool
/= :: BinaryOp -> BinaryOp -> Bool
Eq, Eq BinaryOp
Eq BinaryOp =>
(BinaryOp -> BinaryOp -> Ordering)
-> (BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> Bool)
-> (BinaryOp -> BinaryOp -> BinaryOp)
-> (BinaryOp -> BinaryOp -> BinaryOp)
-> Ord BinaryOp
BinaryOp -> BinaryOp -> Bool
BinaryOp -> BinaryOp -> Ordering
BinaryOp -> BinaryOp -> BinaryOp
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: BinaryOp -> BinaryOp -> Ordering
compare :: BinaryOp -> BinaryOp -> Ordering
$c< :: BinaryOp -> BinaryOp -> Bool
< :: BinaryOp -> BinaryOp -> Bool
$c<= :: BinaryOp -> BinaryOp -> Bool
<= :: BinaryOp -> BinaryOp -> Bool
$c> :: BinaryOp -> BinaryOp -> Bool
> :: BinaryOp -> BinaryOp -> Bool
$c>= :: BinaryOp -> BinaryOp -> Bool
>= :: BinaryOp -> BinaryOp -> Bool
$cmax :: BinaryOp -> BinaryOp -> BinaryOp
max :: BinaryOp -> BinaryOp -> BinaryOp
$cmin :: BinaryOp -> BinaryOp -> BinaryOp
min :: BinaryOp -> BinaryOp -> BinaryOp
Ord)
toBinaryOp :: BinaryOp -> AFBinaryOp
toBinaryOp :: BinaryOp -> AFBinaryOp
toBinaryOp BinaryOp
Add = CInt -> AFBinaryOp
AFBinaryOp CInt
0
toBinaryOp BinaryOp
Mul = CInt -> AFBinaryOp
AFBinaryOp CInt
1
toBinaryOp BinaryOp
Min = CInt -> AFBinaryOp
AFBinaryOp CInt
2
toBinaryOp BinaryOp
Max = CInt -> AFBinaryOp
AFBinaryOp CInt
3
fromBinaryOp :: AFBinaryOp -> BinaryOp
fromBinaryOp :: AFBinaryOp -> BinaryOp
fromBinaryOp (AFBinaryOp CInt
0) = BinaryOp
Add
fromBinaryOp (AFBinaryOp CInt
1) = BinaryOp
Mul
fromBinaryOp (AFBinaryOp CInt
2) = BinaryOp
Min
fromBinaryOp (AFBinaryOp CInt
3) = BinaryOp
Max
fromBinaryOp AFBinaryOp
x = [Char] -> BinaryOp
forall a. HasCallStack => [Char] -> a
error ([Char]
"Invalid Binary Op: " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> AFBinaryOp -> [Char]
forall a. Show a => a -> [Char]
show AFBinaryOp
x)
data Storage
= Dense
| CSR
| CSC
| COO
deriving (Int -> Storage -> ShowS
[Storage] -> ShowS
Storage -> [Char]
(Int -> Storage -> ShowS)
-> (Storage -> [Char]) -> ([Storage] -> ShowS) -> Show Storage
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Storage -> ShowS
showsPrec :: Int -> Storage -> ShowS
$cshow :: Storage -> [Char]
show :: Storage -> [Char]
$cshowList :: [Storage] -> ShowS
showList :: [Storage] -> ShowS
Show, Storage -> Storage -> Bool
(Storage -> Storage -> Bool)
-> (Storage -> Storage -> Bool) -> Eq Storage
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Storage -> Storage -> Bool
== :: Storage -> Storage -> Bool
$c/= :: Storage -> Storage -> Bool
/= :: Storage -> Storage -> Bool
Eq, Eq Storage
Eq Storage =>
(Storage -> Storage -> Ordering)
-> (Storage -> Storage -> Bool)
-> (Storage -> Storage -> Bool)
-> (Storage -> Storage -> Bool)
-> (Storage -> Storage -> Bool)
-> (Storage -> Storage -> Storage)
-> (Storage -> Storage -> Storage)
-> Ord Storage
Storage -> Storage -> Bool
Storage -> Storage -> Ordering
Storage -> Storage -> Storage
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Storage -> Storage -> Ordering
compare :: Storage -> Storage -> Ordering
$c< :: Storage -> Storage -> Bool
< :: Storage -> Storage -> Bool
$c<= :: Storage -> Storage -> Bool
<= :: Storage -> Storage -> Bool
$c> :: Storage -> Storage -> Bool
> :: Storage -> Storage -> Bool
$c>= :: Storage -> Storage -> Bool
>= :: Storage -> Storage -> Bool
$cmax :: Storage -> Storage -> Storage
max :: Storage -> Storage -> Storage
$cmin :: Storage -> Storage -> Storage
min :: Storage -> Storage -> Storage
Ord, Int -> Storage
Storage -> Int
Storage -> [Storage]
Storage -> Storage
Storage -> Storage -> [Storage]
Storage -> Storage -> Storage -> [Storage]
(Storage -> Storage)
-> (Storage -> Storage)
-> (Int -> Storage)
-> (Storage -> Int)
-> (Storage -> [Storage])
-> (Storage -> Storage -> [Storage])
-> (Storage -> Storage -> [Storage])
-> (Storage -> Storage -> Storage -> [Storage])
-> Enum Storage
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Storage -> Storage
succ :: Storage -> Storage
$cpred :: Storage -> Storage
pred :: Storage -> Storage
$ctoEnum :: Int -> Storage
toEnum :: Int -> Storage
$cfromEnum :: Storage -> Int
fromEnum :: Storage -> Int
$cenumFrom :: Storage -> [Storage]
enumFrom :: Storage -> [Storage]
$cenumFromThen :: Storage -> Storage -> [Storage]
enumFromThen :: Storage -> Storage -> [Storage]
$cenumFromTo :: Storage -> Storage -> [Storage]
enumFromTo :: Storage -> Storage -> [Storage]
$cenumFromThenTo :: Storage -> Storage -> Storage -> [Storage]
enumFromThenTo :: Storage -> Storage -> Storage -> [Storage]
Enum)
toStorage :: Storage -> AFStorage
toStorage :: Storage -> AFStorage
toStorage = CInt -> AFStorage
AFStorage (CInt -> AFStorage) -> (Storage -> CInt) -> Storage -> AFStorage
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Storage -> Int) -> Storage -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Storage -> Int
forall a. Enum a => a -> Int
fromEnum
fromStorage :: AFStorage -> Storage
fromStorage :: AFStorage -> Storage
fromStorage (AFStorage (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x))
| Int
x Int -> [Int] -> Bool
forall a. Eq a => a -> [a] -> Bool
forall (t :: * -> *) a. (Foldable t, Eq a) => a -> t a -> Bool
`elem` [Int
0..Int
3] = Int -> Storage
forall a. Enum a => Int -> a
toEnum Int
x
| Bool
otherwise = [Char] -> Storage
forall a. HasCallStack => [Char] -> a
error ([Char] -> Storage) -> [Char] -> Storage
forall a b. (a -> b) -> a -> b
$ [Char]
"Invalid Storage " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> (Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x)
data RandomEngineType
= Philox
| ThreeFry
| Mersenne
deriving (RandomEngineType -> RandomEngineType -> Bool
(RandomEngineType -> RandomEngineType -> Bool)
-> (RandomEngineType -> RandomEngineType -> Bool)
-> Eq RandomEngineType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RandomEngineType -> RandomEngineType -> Bool
== :: RandomEngineType -> RandomEngineType -> Bool
$c/= :: RandomEngineType -> RandomEngineType -> Bool
/= :: RandomEngineType -> RandomEngineType -> Bool
Eq, Int -> RandomEngineType -> ShowS
[RandomEngineType] -> ShowS
RandomEngineType -> [Char]
(Int -> RandomEngineType -> ShowS)
-> (RandomEngineType -> [Char])
-> ([RandomEngineType] -> ShowS)
-> Show RandomEngineType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RandomEngineType -> ShowS
showsPrec :: Int -> RandomEngineType -> ShowS
$cshow :: RandomEngineType -> [Char]
show :: RandomEngineType -> [Char]
$cshowList :: [RandomEngineType] -> ShowS
showList :: [RandomEngineType] -> ShowS
Show)
toRandomEngine :: AFRandomEngineType -> RandomEngineType
toRandomEngine :: AFRandomEngineType -> RandomEngineType
toRandomEngine (AFRandomEngineType CInt
100) = RandomEngineType
Philox
toRandomEngine (AFRandomEngineType CInt
200) = RandomEngineType
ThreeFry
toRandomEngine (AFRandomEngineType CInt
300) = RandomEngineType
Mersenne
toRandomEngine (AFRandomEngineType CInt
x) =
[Char] -> RandomEngineType
forall a. HasCallStack => [Char] -> a
error ([Char]
"Invalid random engine: " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> CInt -> [Char]
forall a. Show a => a -> [Char]
show CInt
x)
fromRandomEngine :: RandomEngineType -> AFRandomEngineType
fromRandomEngine :: RandomEngineType -> AFRandomEngineType
fromRandomEngine RandomEngineType
Philox = (CInt -> AFRandomEngineType
AFRandomEngineType CInt
100)
fromRandomEngine RandomEngineType
ThreeFry = (CInt -> AFRandomEngineType
AFRandomEngineType CInt
200)
fromRandomEngine RandomEngineType
Mersenne = (CInt -> AFRandomEngineType
AFRandomEngineType CInt
300)
data InterpType
= Nearest
| Linear
| Bilinear
| Cubic
| LowerInterp
| LinearCosine
| BilinearCosine
| Bicubic
| CubicSpline
| BicubicSpline
deriving (Int -> InterpType -> ShowS
[InterpType] -> ShowS
InterpType -> [Char]
(Int -> InterpType -> ShowS)
-> (InterpType -> [Char])
-> ([InterpType] -> ShowS)
-> Show InterpType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InterpType -> ShowS
showsPrec :: Int -> InterpType -> ShowS
$cshow :: InterpType -> [Char]
show :: InterpType -> [Char]
$cshowList :: [InterpType] -> ShowS
showList :: [InterpType] -> ShowS
Show, InterpType -> InterpType -> Bool
(InterpType -> InterpType -> Bool)
-> (InterpType -> InterpType -> Bool) -> Eq InterpType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InterpType -> InterpType -> Bool
== :: InterpType -> InterpType -> Bool
$c/= :: InterpType -> InterpType -> Bool
/= :: InterpType -> InterpType -> Bool
Eq, Eq InterpType
Eq InterpType =>
(InterpType -> InterpType -> Ordering)
-> (InterpType -> InterpType -> Bool)
-> (InterpType -> InterpType -> Bool)
-> (InterpType -> InterpType -> Bool)
-> (InterpType -> InterpType -> Bool)
-> (InterpType -> InterpType -> InterpType)
-> (InterpType -> InterpType -> InterpType)
-> Ord InterpType
InterpType -> InterpType -> Bool
InterpType -> InterpType -> Ordering
InterpType -> InterpType -> InterpType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: InterpType -> InterpType -> Ordering
compare :: InterpType -> InterpType -> Ordering
$c< :: InterpType -> InterpType -> Bool
< :: InterpType -> InterpType -> Bool
$c<= :: InterpType -> InterpType -> Bool
<= :: InterpType -> InterpType -> Bool
$c> :: InterpType -> InterpType -> Bool
> :: InterpType -> InterpType -> Bool
$c>= :: InterpType -> InterpType -> Bool
>= :: InterpType -> InterpType -> Bool
$cmax :: InterpType -> InterpType -> InterpType
max :: InterpType -> InterpType -> InterpType
$cmin :: InterpType -> InterpType -> InterpType
min :: InterpType -> InterpType -> InterpType
Ord, Int -> InterpType
InterpType -> Int
InterpType -> [InterpType]
InterpType -> InterpType
InterpType -> InterpType -> [InterpType]
InterpType -> InterpType -> InterpType -> [InterpType]
(InterpType -> InterpType)
-> (InterpType -> InterpType)
-> (Int -> InterpType)
-> (InterpType -> Int)
-> (InterpType -> [InterpType])
-> (InterpType -> InterpType -> [InterpType])
-> (InterpType -> InterpType -> [InterpType])
-> (InterpType -> InterpType -> InterpType -> [InterpType])
-> Enum InterpType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: InterpType -> InterpType
succ :: InterpType -> InterpType
$cpred :: InterpType -> InterpType
pred :: InterpType -> InterpType
$ctoEnum :: Int -> InterpType
toEnum :: Int -> InterpType
$cfromEnum :: InterpType -> Int
fromEnum :: InterpType -> Int
$cenumFrom :: InterpType -> [InterpType]
enumFrom :: InterpType -> [InterpType]
$cenumFromThen :: InterpType -> InterpType -> [InterpType]
enumFromThen :: InterpType -> InterpType -> [InterpType]
$cenumFromTo :: InterpType -> InterpType -> [InterpType]
enumFromTo :: InterpType -> InterpType -> [InterpType]
$cenumFromThenTo :: InterpType -> InterpType -> InterpType -> [InterpType]
enumFromThenTo :: InterpType -> InterpType -> InterpType -> [InterpType]
Enum)
toInterpType :: AFInterpType -> InterpType
toInterpType :: AFInterpType -> InterpType
toInterpType (AFInterpType (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> InterpType
forall a. Enum a => Int -> a
toEnum Int
x
fromInterpType :: InterpType -> AFInterpType
fromInterpType :: InterpType -> AFInterpType
fromInterpType = CInt -> AFInterpType
AFInterpType (CInt -> AFInterpType)
-> (InterpType -> CInt) -> InterpType -> AFInterpType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (InterpType -> Int) -> InterpType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InterpType -> Int
forall a. Enum a => a -> Int
fromEnum
data BorderType
= PadZero
| PadSym
deriving (Int -> BorderType -> ShowS
[BorderType] -> ShowS
BorderType -> [Char]
(Int -> BorderType -> ShowS)
-> (BorderType -> [Char])
-> ([BorderType] -> ShowS)
-> Show BorderType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> BorderType -> ShowS
showsPrec :: Int -> BorderType -> ShowS
$cshow :: BorderType -> [Char]
show :: BorderType -> [Char]
$cshowList :: [BorderType] -> ShowS
showList :: [BorderType] -> ShowS
Show, Eq BorderType
Eq BorderType =>
(BorderType -> BorderType -> Ordering)
-> (BorderType -> BorderType -> Bool)
-> (BorderType -> BorderType -> Bool)
-> (BorderType -> BorderType -> Bool)
-> (BorderType -> BorderType -> Bool)
-> (BorderType -> BorderType -> BorderType)
-> (BorderType -> BorderType -> BorderType)
-> Ord BorderType
BorderType -> BorderType -> Bool
BorderType -> BorderType -> Ordering
BorderType -> BorderType -> BorderType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: BorderType -> BorderType -> Ordering
compare :: BorderType -> BorderType -> Ordering
$c< :: BorderType -> BorderType -> Bool
< :: BorderType -> BorderType -> Bool
$c<= :: BorderType -> BorderType -> Bool
<= :: BorderType -> BorderType -> Bool
$c> :: BorderType -> BorderType -> Bool
> :: BorderType -> BorderType -> Bool
$c>= :: BorderType -> BorderType -> Bool
>= :: BorderType -> BorderType -> Bool
$cmax :: BorderType -> BorderType -> BorderType
max :: BorderType -> BorderType -> BorderType
$cmin :: BorderType -> BorderType -> BorderType
min :: BorderType -> BorderType -> BorderType
Ord, Int -> BorderType
BorderType -> Int
BorderType -> [BorderType]
BorderType -> BorderType
BorderType -> BorderType -> [BorderType]
BorderType -> BorderType -> BorderType -> [BorderType]
(BorderType -> BorderType)
-> (BorderType -> BorderType)
-> (Int -> BorderType)
-> (BorderType -> Int)
-> (BorderType -> [BorderType])
-> (BorderType -> BorderType -> [BorderType])
-> (BorderType -> BorderType -> [BorderType])
-> (BorderType -> BorderType -> BorderType -> [BorderType])
-> Enum BorderType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: BorderType -> BorderType
succ :: BorderType -> BorderType
$cpred :: BorderType -> BorderType
pred :: BorderType -> BorderType
$ctoEnum :: Int -> BorderType
toEnum :: Int -> BorderType
$cfromEnum :: BorderType -> Int
fromEnum :: BorderType -> Int
$cenumFrom :: BorderType -> [BorderType]
enumFrom :: BorderType -> [BorderType]
$cenumFromThen :: BorderType -> BorderType -> [BorderType]
enumFromThen :: BorderType -> BorderType -> [BorderType]
$cenumFromTo :: BorderType -> BorderType -> [BorderType]
enumFromTo :: BorderType -> BorderType -> [BorderType]
$cenumFromThenTo :: BorderType -> BorderType -> BorderType -> [BorderType]
enumFromThenTo :: BorderType -> BorderType -> BorderType -> [BorderType]
Enum, BorderType -> BorderType -> Bool
(BorderType -> BorderType -> Bool)
-> (BorderType -> BorderType -> Bool) -> Eq BorderType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: BorderType -> BorderType -> Bool
== :: BorderType -> BorderType -> Bool
$c/= :: BorderType -> BorderType -> Bool
/= :: BorderType -> BorderType -> Bool
Eq)
toBorderType :: AFBorderType -> BorderType
toBorderType :: AFBorderType -> BorderType
toBorderType (AFBorderType (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> BorderType
forall a. Enum a => Int -> a
toEnum Int
x
fromBorderType :: BorderType -> AFBorderType
fromBorderType :: BorderType -> AFBorderType
fromBorderType = CInt -> AFBorderType
AFBorderType (CInt -> AFBorderType)
-> (BorderType -> CInt) -> BorderType -> AFBorderType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (BorderType -> Int) -> BorderType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. BorderType -> Int
forall a. Enum a => a -> Int
fromEnum
data Connectivity
= Conn4
| Conn8
deriving (Int -> Connectivity -> ShowS
[Connectivity] -> ShowS
Connectivity -> [Char]
(Int -> Connectivity -> ShowS)
-> (Connectivity -> [Char])
-> ([Connectivity] -> ShowS)
-> Show Connectivity
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Connectivity -> ShowS
showsPrec :: Int -> Connectivity -> ShowS
$cshow :: Connectivity -> [Char]
show :: Connectivity -> [Char]
$cshowList :: [Connectivity] -> ShowS
showList :: [Connectivity] -> ShowS
Show, Eq Connectivity
Eq Connectivity =>
(Connectivity -> Connectivity -> Ordering)
-> (Connectivity -> Connectivity -> Bool)
-> (Connectivity -> Connectivity -> Bool)
-> (Connectivity -> Connectivity -> Bool)
-> (Connectivity -> Connectivity -> Bool)
-> (Connectivity -> Connectivity -> Connectivity)
-> (Connectivity -> Connectivity -> Connectivity)
-> Ord Connectivity
Connectivity -> Connectivity -> Bool
Connectivity -> Connectivity -> Ordering
Connectivity -> Connectivity -> Connectivity
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Connectivity -> Connectivity -> Ordering
compare :: Connectivity -> Connectivity -> Ordering
$c< :: Connectivity -> Connectivity -> Bool
< :: Connectivity -> Connectivity -> Bool
$c<= :: Connectivity -> Connectivity -> Bool
<= :: Connectivity -> Connectivity -> Bool
$c> :: Connectivity -> Connectivity -> Bool
> :: Connectivity -> Connectivity -> Bool
$c>= :: Connectivity -> Connectivity -> Bool
>= :: Connectivity -> Connectivity -> Bool
$cmax :: Connectivity -> Connectivity -> Connectivity
max :: Connectivity -> Connectivity -> Connectivity
$cmin :: Connectivity -> Connectivity -> Connectivity
min :: Connectivity -> Connectivity -> Connectivity
Ord, Int -> Connectivity
Connectivity -> Int
Connectivity -> [Connectivity]
Connectivity -> Connectivity
Connectivity -> Connectivity -> [Connectivity]
Connectivity -> Connectivity -> Connectivity -> [Connectivity]
(Connectivity -> Connectivity)
-> (Connectivity -> Connectivity)
-> (Int -> Connectivity)
-> (Connectivity -> Int)
-> (Connectivity -> [Connectivity])
-> (Connectivity -> Connectivity -> [Connectivity])
-> (Connectivity -> Connectivity -> [Connectivity])
-> (Connectivity -> Connectivity -> Connectivity -> [Connectivity])
-> Enum Connectivity
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: Connectivity -> Connectivity
succ :: Connectivity -> Connectivity
$cpred :: Connectivity -> Connectivity
pred :: Connectivity -> Connectivity
$ctoEnum :: Int -> Connectivity
toEnum :: Int -> Connectivity
$cfromEnum :: Connectivity -> Int
fromEnum :: Connectivity -> Int
$cenumFrom :: Connectivity -> [Connectivity]
enumFrom :: Connectivity -> [Connectivity]
$cenumFromThen :: Connectivity -> Connectivity -> [Connectivity]
enumFromThen :: Connectivity -> Connectivity -> [Connectivity]
$cenumFromTo :: Connectivity -> Connectivity -> [Connectivity]
enumFromTo :: Connectivity -> Connectivity -> [Connectivity]
$cenumFromThenTo :: Connectivity -> Connectivity -> Connectivity -> [Connectivity]
enumFromThenTo :: Connectivity -> Connectivity -> Connectivity -> [Connectivity]
Enum, Connectivity -> Connectivity -> Bool
(Connectivity -> Connectivity -> Bool)
-> (Connectivity -> Connectivity -> Bool) -> Eq Connectivity
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Connectivity -> Connectivity -> Bool
== :: Connectivity -> Connectivity -> Bool
$c/= :: Connectivity -> Connectivity -> Bool
/= :: Connectivity -> Connectivity -> Bool
Eq)
toConnectivity :: AFConnectivity -> Connectivity
toConnectivity :: AFConnectivity -> Connectivity
toConnectivity (AFConnectivity CInt
4) = Connectivity
Conn4
toConnectivity (AFConnectivity CInt
8) = Connectivity
Conn8
toConnectivity (AFConnectivity CInt
x) = [Char] -> Connectivity
forall a. HasCallStack => [Char] -> a
error ([Char]
"Unknown connectivity option: " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> CInt -> [Char]
forall a. Show a => a -> [Char]
show CInt
x)
fromConnectivity :: Connectivity -> AFConnectivity
fromConnectivity :: Connectivity -> AFConnectivity
fromConnectivity Connectivity
Conn4 = CInt -> AFConnectivity
AFConnectivity CInt
4
fromConnectivity Connectivity
Conn8 = CInt -> AFConnectivity
AFConnectivity CInt
8
data CSpace
= Gray
| RGB
| HSV
| YCBCR
deriving (Int -> CSpace -> ShowS
[CSpace] -> ShowS
CSpace -> [Char]
(Int -> CSpace -> ShowS)
-> (CSpace -> [Char]) -> ([CSpace] -> ShowS) -> Show CSpace
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CSpace -> ShowS
showsPrec :: Int -> CSpace -> ShowS
$cshow :: CSpace -> [Char]
show :: CSpace -> [Char]
$cshowList :: [CSpace] -> ShowS
showList :: [CSpace] -> ShowS
Show, CSpace -> CSpace -> Bool
(CSpace -> CSpace -> Bool)
-> (CSpace -> CSpace -> Bool) -> Eq CSpace
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CSpace -> CSpace -> Bool
== :: CSpace -> CSpace -> Bool
$c/= :: CSpace -> CSpace -> Bool
/= :: CSpace -> CSpace -> Bool
Eq, Eq CSpace
Eq CSpace =>
(CSpace -> CSpace -> Ordering)
-> (CSpace -> CSpace -> Bool)
-> (CSpace -> CSpace -> Bool)
-> (CSpace -> CSpace -> Bool)
-> (CSpace -> CSpace -> Bool)
-> (CSpace -> CSpace -> CSpace)
-> (CSpace -> CSpace -> CSpace)
-> Ord CSpace
CSpace -> CSpace -> Bool
CSpace -> CSpace -> Ordering
CSpace -> CSpace -> CSpace
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CSpace -> CSpace -> Ordering
compare :: CSpace -> CSpace -> Ordering
$c< :: CSpace -> CSpace -> Bool
< :: CSpace -> CSpace -> Bool
$c<= :: CSpace -> CSpace -> Bool
<= :: CSpace -> CSpace -> Bool
$c> :: CSpace -> CSpace -> Bool
> :: CSpace -> CSpace -> Bool
$c>= :: CSpace -> CSpace -> Bool
>= :: CSpace -> CSpace -> Bool
$cmax :: CSpace -> CSpace -> CSpace
max :: CSpace -> CSpace -> CSpace
$cmin :: CSpace -> CSpace -> CSpace
min :: CSpace -> CSpace -> CSpace
Ord, Int -> CSpace
CSpace -> Int
CSpace -> [CSpace]
CSpace -> CSpace
CSpace -> CSpace -> [CSpace]
CSpace -> CSpace -> CSpace -> [CSpace]
(CSpace -> CSpace)
-> (CSpace -> CSpace)
-> (Int -> CSpace)
-> (CSpace -> Int)
-> (CSpace -> [CSpace])
-> (CSpace -> CSpace -> [CSpace])
-> (CSpace -> CSpace -> [CSpace])
-> (CSpace -> CSpace -> CSpace -> [CSpace])
-> Enum CSpace
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: CSpace -> CSpace
succ :: CSpace -> CSpace
$cpred :: CSpace -> CSpace
pred :: CSpace -> CSpace
$ctoEnum :: Int -> CSpace
toEnum :: Int -> CSpace
$cfromEnum :: CSpace -> Int
fromEnum :: CSpace -> Int
$cenumFrom :: CSpace -> [CSpace]
enumFrom :: CSpace -> [CSpace]
$cenumFromThen :: CSpace -> CSpace -> [CSpace]
enumFromThen :: CSpace -> CSpace -> [CSpace]
$cenumFromTo :: CSpace -> CSpace -> [CSpace]
enumFromTo :: CSpace -> CSpace -> [CSpace]
$cenumFromThenTo :: CSpace -> CSpace -> CSpace -> [CSpace]
enumFromThenTo :: CSpace -> CSpace -> CSpace -> [CSpace]
Enum)
toCSpace :: AFCSpace -> CSpace
toCSpace :: AFCSpace -> CSpace
toCSpace (AFCSpace (Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> CSpace
forall a. Enum a => Int -> a
toEnum Int
x
fromCSpace :: CSpace -> AFCSpace
fromCSpace :: CSpace -> AFCSpace
fromCSpace = Int -> AFCSpace
AFCSpace (Int -> AFCSpace) -> (CSpace -> Int) -> CSpace -> AFCSpace
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> Int) -> (CSpace -> Int) -> CSpace -> Int
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CSpace -> Int
forall a. Enum a => a -> Int
fromEnum
data YccStd
= Ycc601
| Ycc709
| Ycc2020
deriving (Int -> YccStd -> ShowS
[YccStd] -> ShowS
YccStd -> [Char]
(Int -> YccStd -> ShowS)
-> (YccStd -> [Char]) -> ([YccStd] -> ShowS) -> Show YccStd
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> YccStd -> ShowS
showsPrec :: Int -> YccStd -> ShowS
$cshow :: YccStd -> [Char]
show :: YccStd -> [Char]
$cshowList :: [YccStd] -> ShowS
showList :: [YccStd] -> ShowS
Show, YccStd -> YccStd -> Bool
(YccStd -> YccStd -> Bool)
-> (YccStd -> YccStd -> Bool) -> Eq YccStd
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: YccStd -> YccStd -> Bool
== :: YccStd -> YccStd -> Bool
$c/= :: YccStd -> YccStd -> Bool
/= :: YccStd -> YccStd -> Bool
Eq, Eq YccStd
Eq YccStd =>
(YccStd -> YccStd -> Ordering)
-> (YccStd -> YccStd -> Bool)
-> (YccStd -> YccStd -> Bool)
-> (YccStd -> YccStd -> Bool)
-> (YccStd -> YccStd -> Bool)
-> (YccStd -> YccStd -> YccStd)
-> (YccStd -> YccStd -> YccStd)
-> Ord YccStd
YccStd -> YccStd -> Bool
YccStd -> YccStd -> Ordering
YccStd -> YccStd -> YccStd
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: YccStd -> YccStd -> Ordering
compare :: YccStd -> YccStd -> Ordering
$c< :: YccStd -> YccStd -> Bool
< :: YccStd -> YccStd -> Bool
$c<= :: YccStd -> YccStd -> Bool
<= :: YccStd -> YccStd -> Bool
$c> :: YccStd -> YccStd -> Bool
> :: YccStd -> YccStd -> Bool
$c>= :: YccStd -> YccStd -> Bool
>= :: YccStd -> YccStd -> Bool
$cmax :: YccStd -> YccStd -> YccStd
max :: YccStd -> YccStd -> YccStd
$cmin :: YccStd -> YccStd -> YccStd
min :: YccStd -> YccStd -> YccStd
Ord)
toAFYccStd :: AFYccStd -> YccStd
toAFYccStd :: AFYccStd -> YccStd
toAFYccStd (AFYccStd Int
601) = YccStd
Ycc601
toAFYccStd (AFYccStd Int
709) = YccStd
Ycc709
toAFYccStd (AFYccStd Int
2020) = YccStd
Ycc2020
toAFYccStd (AFYccStd Int
x) = [Char] -> YccStd
forall a. HasCallStack => [Char] -> a
error ([Char]
"Unknown AFYccStd option: " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x)
fromAFYccStd :: YccStd -> AFYccStd
fromAFYccStd :: YccStd -> AFYccStd
fromAFYccStd YccStd
Ycc601 = AFYccStd
afYcc601
fromAFYccStd YccStd
Ycc709 = AFYccStd
afYcc709
fromAFYccStd YccStd
Ycc2020 = AFYccStd
afYcc2020
data MomentType
= M00
| M01
| M10
| M11
| FirstOrder
deriving (Int -> MomentType -> ShowS
[MomentType] -> ShowS
MomentType -> [Char]
(Int -> MomentType -> ShowS)
-> (MomentType -> [Char])
-> ([MomentType] -> ShowS)
-> Show MomentType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MomentType -> ShowS
showsPrec :: Int -> MomentType -> ShowS
$cshow :: MomentType -> [Char]
show :: MomentType -> [Char]
$cshowList :: [MomentType] -> ShowS
showList :: [MomentType] -> ShowS
Show, MomentType -> MomentType -> Bool
(MomentType -> MomentType -> Bool)
-> (MomentType -> MomentType -> Bool) -> Eq MomentType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MomentType -> MomentType -> Bool
== :: MomentType -> MomentType -> Bool
$c/= :: MomentType -> MomentType -> Bool
/= :: MomentType -> MomentType -> Bool
Eq, Eq MomentType
Eq MomentType =>
(MomentType -> MomentType -> Ordering)
-> (MomentType -> MomentType -> Bool)
-> (MomentType -> MomentType -> Bool)
-> (MomentType -> MomentType -> Bool)
-> (MomentType -> MomentType -> Bool)
-> (MomentType -> MomentType -> MomentType)
-> (MomentType -> MomentType -> MomentType)
-> Ord MomentType
MomentType -> MomentType -> Bool
MomentType -> MomentType -> Ordering
MomentType -> MomentType -> MomentType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: MomentType -> MomentType -> Ordering
compare :: MomentType -> MomentType -> Ordering
$c< :: MomentType -> MomentType -> Bool
< :: MomentType -> MomentType -> Bool
$c<= :: MomentType -> MomentType -> Bool
<= :: MomentType -> MomentType -> Bool
$c> :: MomentType -> MomentType -> Bool
> :: MomentType -> MomentType -> Bool
$c>= :: MomentType -> MomentType -> Bool
>= :: MomentType -> MomentType -> Bool
$cmax :: MomentType -> MomentType -> MomentType
max :: MomentType -> MomentType -> MomentType
$cmin :: MomentType -> MomentType -> MomentType
min :: MomentType -> MomentType -> MomentType
Ord)
toMomentType :: AFMomentType -> MomentType
toMomentType :: AFMomentType -> MomentType
toMomentType AFMomentType
x
| AFMomentType
x AFMomentType -> AFMomentType -> Bool
forall a. Eq a => a -> a -> Bool
== AFMomentType
afMomentM00 = MomentType
M00
| AFMomentType
x AFMomentType -> AFMomentType -> Bool
forall a. Eq a => a -> a -> Bool
== AFMomentType
afMomentM01 = MomentType
M01
| AFMomentType
x AFMomentType -> AFMomentType -> Bool
forall a. Eq a => a -> a -> Bool
== AFMomentType
afMomentM10 = MomentType
M10
| AFMomentType
x AFMomentType -> AFMomentType -> Bool
forall a. Eq a => a -> a -> Bool
== AFMomentType
afMomentM11 = MomentType
M11
| AFMomentType
x AFMomentType -> AFMomentType -> Bool
forall a. Eq a => a -> a -> Bool
== AFMomentType
afMomentFirstOrder = MomentType
FirstOrder
| Bool
otherwise = [Char] -> MomentType
forall a. HasCallStack => [Char] -> a
error ([Char]
"Unknown moment type: " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> AFMomentType -> [Char]
forall a. Show a => a -> [Char]
show AFMomentType
x)
fromMomentType :: MomentType -> AFMomentType
fromMomentType :: MomentType -> AFMomentType
fromMomentType MomentType
M00 = AFMomentType
afMomentM00
fromMomentType MomentType
M01 = AFMomentType
afMomentM01
fromMomentType MomentType
M10 = AFMomentType
afMomentM10
fromMomentType MomentType
M11 = AFMomentType
afMomentM11
fromMomentType MomentType
FirstOrder = AFMomentType
afMomentFirstOrder
data CannyThreshold
= Manual
| AutoOtsu
deriving (Int -> CannyThreshold -> ShowS
[CannyThreshold] -> ShowS
CannyThreshold -> [Char]
(Int -> CannyThreshold -> ShowS)
-> (CannyThreshold -> [Char])
-> ([CannyThreshold] -> ShowS)
-> Show CannyThreshold
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> CannyThreshold -> ShowS
showsPrec :: Int -> CannyThreshold -> ShowS
$cshow :: CannyThreshold -> [Char]
show :: CannyThreshold -> [Char]
$cshowList :: [CannyThreshold] -> ShowS
showList :: [CannyThreshold] -> ShowS
Show, CannyThreshold -> CannyThreshold -> Bool
(CannyThreshold -> CannyThreshold -> Bool)
-> (CannyThreshold -> CannyThreshold -> Bool) -> Eq CannyThreshold
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: CannyThreshold -> CannyThreshold -> Bool
== :: CannyThreshold -> CannyThreshold -> Bool
$c/= :: CannyThreshold -> CannyThreshold -> Bool
/= :: CannyThreshold -> CannyThreshold -> Bool
Eq, Eq CannyThreshold
Eq CannyThreshold =>
(CannyThreshold -> CannyThreshold -> Ordering)
-> (CannyThreshold -> CannyThreshold -> Bool)
-> (CannyThreshold -> CannyThreshold -> Bool)
-> (CannyThreshold -> CannyThreshold -> Bool)
-> (CannyThreshold -> CannyThreshold -> Bool)
-> (CannyThreshold -> CannyThreshold -> CannyThreshold)
-> (CannyThreshold -> CannyThreshold -> CannyThreshold)
-> Ord CannyThreshold
CannyThreshold -> CannyThreshold -> Bool
CannyThreshold -> CannyThreshold -> Ordering
CannyThreshold -> CannyThreshold -> CannyThreshold
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: CannyThreshold -> CannyThreshold -> Ordering
compare :: CannyThreshold -> CannyThreshold -> Ordering
$c< :: CannyThreshold -> CannyThreshold -> Bool
< :: CannyThreshold -> CannyThreshold -> Bool
$c<= :: CannyThreshold -> CannyThreshold -> Bool
<= :: CannyThreshold -> CannyThreshold -> Bool
$c> :: CannyThreshold -> CannyThreshold -> Bool
> :: CannyThreshold -> CannyThreshold -> Bool
$c>= :: CannyThreshold -> CannyThreshold -> Bool
>= :: CannyThreshold -> CannyThreshold -> Bool
$cmax :: CannyThreshold -> CannyThreshold -> CannyThreshold
max :: CannyThreshold -> CannyThreshold -> CannyThreshold
$cmin :: CannyThreshold -> CannyThreshold -> CannyThreshold
min :: CannyThreshold -> CannyThreshold -> CannyThreshold
Ord, Int -> CannyThreshold
CannyThreshold -> Int
CannyThreshold -> [CannyThreshold]
CannyThreshold -> CannyThreshold
CannyThreshold -> CannyThreshold -> [CannyThreshold]
CannyThreshold
-> CannyThreshold -> CannyThreshold -> [CannyThreshold]
(CannyThreshold -> CannyThreshold)
-> (CannyThreshold -> CannyThreshold)
-> (Int -> CannyThreshold)
-> (CannyThreshold -> Int)
-> (CannyThreshold -> [CannyThreshold])
-> (CannyThreshold -> CannyThreshold -> [CannyThreshold])
-> (CannyThreshold -> CannyThreshold -> [CannyThreshold])
-> (CannyThreshold
-> CannyThreshold -> CannyThreshold -> [CannyThreshold])
-> Enum CannyThreshold
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: CannyThreshold -> CannyThreshold
succ :: CannyThreshold -> CannyThreshold
$cpred :: CannyThreshold -> CannyThreshold
pred :: CannyThreshold -> CannyThreshold
$ctoEnum :: Int -> CannyThreshold
toEnum :: Int -> CannyThreshold
$cfromEnum :: CannyThreshold -> Int
fromEnum :: CannyThreshold -> Int
$cenumFrom :: CannyThreshold -> [CannyThreshold]
enumFrom :: CannyThreshold -> [CannyThreshold]
$cenumFromThen :: CannyThreshold -> CannyThreshold -> [CannyThreshold]
enumFromThen :: CannyThreshold -> CannyThreshold -> [CannyThreshold]
$cenumFromTo :: CannyThreshold -> CannyThreshold -> [CannyThreshold]
enumFromTo :: CannyThreshold -> CannyThreshold -> [CannyThreshold]
$cenumFromThenTo :: CannyThreshold
-> CannyThreshold -> CannyThreshold -> [CannyThreshold]
enumFromThenTo :: CannyThreshold
-> CannyThreshold -> CannyThreshold -> [CannyThreshold]
Enum)
toCannyThreshold :: AFCannyThreshold -> CannyThreshold
toCannyThreshold :: AFCannyThreshold -> CannyThreshold
toCannyThreshold (AFCannyThreshold (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> CannyThreshold
forall a. Enum a => Int -> a
toEnum Int
x
fromCannyThreshold :: CannyThreshold -> AFCannyThreshold
fromCannyThreshold :: CannyThreshold -> AFCannyThreshold
fromCannyThreshold = CInt -> AFCannyThreshold
AFCannyThreshold (CInt -> AFCannyThreshold)
-> (CannyThreshold -> CInt) -> CannyThreshold -> AFCannyThreshold
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (CannyThreshold -> Int) -> CannyThreshold -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CannyThreshold -> Int
forall a. Enum a => a -> Int
fromEnum
data FluxFunction
= FluxDefault
| FluxQuadratic
| FluxExponential
deriving (Int -> FluxFunction -> ShowS
[FluxFunction] -> ShowS
FluxFunction -> [Char]
(Int -> FluxFunction -> ShowS)
-> (FluxFunction -> [Char])
-> ([FluxFunction] -> ShowS)
-> Show FluxFunction
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> FluxFunction -> ShowS
showsPrec :: Int -> FluxFunction -> ShowS
$cshow :: FluxFunction -> [Char]
show :: FluxFunction -> [Char]
$cshowList :: [FluxFunction] -> ShowS
showList :: [FluxFunction] -> ShowS
Show, FluxFunction -> FluxFunction -> Bool
(FluxFunction -> FluxFunction -> Bool)
-> (FluxFunction -> FluxFunction -> Bool) -> Eq FluxFunction
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: FluxFunction -> FluxFunction -> Bool
== :: FluxFunction -> FluxFunction -> Bool
$c/= :: FluxFunction -> FluxFunction -> Bool
/= :: FluxFunction -> FluxFunction -> Bool
Eq, Eq FluxFunction
Eq FluxFunction =>
(FluxFunction -> FluxFunction -> Ordering)
-> (FluxFunction -> FluxFunction -> Bool)
-> (FluxFunction -> FluxFunction -> Bool)
-> (FluxFunction -> FluxFunction -> Bool)
-> (FluxFunction -> FluxFunction -> Bool)
-> (FluxFunction -> FluxFunction -> FluxFunction)
-> (FluxFunction -> FluxFunction -> FluxFunction)
-> Ord FluxFunction
FluxFunction -> FluxFunction -> Bool
FluxFunction -> FluxFunction -> Ordering
FluxFunction -> FluxFunction -> FluxFunction
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: FluxFunction -> FluxFunction -> Ordering
compare :: FluxFunction -> FluxFunction -> Ordering
$c< :: FluxFunction -> FluxFunction -> Bool
< :: FluxFunction -> FluxFunction -> Bool
$c<= :: FluxFunction -> FluxFunction -> Bool
<= :: FluxFunction -> FluxFunction -> Bool
$c> :: FluxFunction -> FluxFunction -> Bool
> :: FluxFunction -> FluxFunction -> Bool
$c>= :: FluxFunction -> FluxFunction -> Bool
>= :: FluxFunction -> FluxFunction -> Bool
$cmax :: FluxFunction -> FluxFunction -> FluxFunction
max :: FluxFunction -> FluxFunction -> FluxFunction
$cmin :: FluxFunction -> FluxFunction -> FluxFunction
min :: FluxFunction -> FluxFunction -> FluxFunction
Ord, Int -> FluxFunction
FluxFunction -> Int
FluxFunction -> [FluxFunction]
FluxFunction -> FluxFunction
FluxFunction -> FluxFunction -> [FluxFunction]
FluxFunction -> FluxFunction -> FluxFunction -> [FluxFunction]
(FluxFunction -> FluxFunction)
-> (FluxFunction -> FluxFunction)
-> (Int -> FluxFunction)
-> (FluxFunction -> Int)
-> (FluxFunction -> [FluxFunction])
-> (FluxFunction -> FluxFunction -> [FluxFunction])
-> (FluxFunction -> FluxFunction -> [FluxFunction])
-> (FluxFunction -> FluxFunction -> FluxFunction -> [FluxFunction])
-> Enum FluxFunction
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: FluxFunction -> FluxFunction
succ :: FluxFunction -> FluxFunction
$cpred :: FluxFunction -> FluxFunction
pred :: FluxFunction -> FluxFunction
$ctoEnum :: Int -> FluxFunction
toEnum :: Int -> FluxFunction
$cfromEnum :: FluxFunction -> Int
fromEnum :: FluxFunction -> Int
$cenumFrom :: FluxFunction -> [FluxFunction]
enumFrom :: FluxFunction -> [FluxFunction]
$cenumFromThen :: FluxFunction -> FluxFunction -> [FluxFunction]
enumFromThen :: FluxFunction -> FluxFunction -> [FluxFunction]
$cenumFromTo :: FluxFunction -> FluxFunction -> [FluxFunction]
enumFromTo :: FluxFunction -> FluxFunction -> [FluxFunction]
$cenumFromThenTo :: FluxFunction -> FluxFunction -> FluxFunction -> [FluxFunction]
enumFromThenTo :: FluxFunction -> FluxFunction -> FluxFunction -> [FluxFunction]
Enum)
toFluxFunction :: AFFluxFunction -> FluxFunction
toFluxFunction :: AFFluxFunction -> FluxFunction
toFluxFunction (AFFluxFunction (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> FluxFunction
forall a. Enum a => Int -> a
toEnum Int
x
fromFluxFunction :: FluxFunction -> AFFluxFunction
fromFluxFunction :: FluxFunction -> AFFluxFunction
fromFluxFunction = CInt -> AFFluxFunction
AFFluxFunction (CInt -> AFFluxFunction)
-> (FluxFunction -> CInt) -> FluxFunction -> AFFluxFunction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (FluxFunction -> Int) -> FluxFunction -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. FluxFunction -> Int
forall a. Enum a => a -> Int
fromEnum
data DiffusionEq
= DiffusionDefault
| DiffusionGrad
| DiffusionMCDE
deriving (Int -> DiffusionEq -> ShowS
[DiffusionEq] -> ShowS
DiffusionEq -> [Char]
(Int -> DiffusionEq -> ShowS)
-> (DiffusionEq -> [Char])
-> ([DiffusionEq] -> ShowS)
-> Show DiffusionEq
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> DiffusionEq -> ShowS
showsPrec :: Int -> DiffusionEq -> ShowS
$cshow :: DiffusionEq -> [Char]
show :: DiffusionEq -> [Char]
$cshowList :: [DiffusionEq] -> ShowS
showList :: [DiffusionEq] -> ShowS
Show, DiffusionEq -> DiffusionEq -> Bool
(DiffusionEq -> DiffusionEq -> Bool)
-> (DiffusionEq -> DiffusionEq -> Bool) -> Eq DiffusionEq
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: DiffusionEq -> DiffusionEq -> Bool
== :: DiffusionEq -> DiffusionEq -> Bool
$c/= :: DiffusionEq -> DiffusionEq -> Bool
/= :: DiffusionEq -> DiffusionEq -> Bool
Eq, Eq DiffusionEq
Eq DiffusionEq =>
(DiffusionEq -> DiffusionEq -> Ordering)
-> (DiffusionEq -> DiffusionEq -> Bool)
-> (DiffusionEq -> DiffusionEq -> Bool)
-> (DiffusionEq -> DiffusionEq -> Bool)
-> (DiffusionEq -> DiffusionEq -> Bool)
-> (DiffusionEq -> DiffusionEq -> DiffusionEq)
-> (DiffusionEq -> DiffusionEq -> DiffusionEq)
-> Ord DiffusionEq
DiffusionEq -> DiffusionEq -> Bool
DiffusionEq -> DiffusionEq -> Ordering
DiffusionEq -> DiffusionEq -> DiffusionEq
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: DiffusionEq -> DiffusionEq -> Ordering
compare :: DiffusionEq -> DiffusionEq -> Ordering
$c< :: DiffusionEq -> DiffusionEq -> Bool
< :: DiffusionEq -> DiffusionEq -> Bool
$c<= :: DiffusionEq -> DiffusionEq -> Bool
<= :: DiffusionEq -> DiffusionEq -> Bool
$c> :: DiffusionEq -> DiffusionEq -> Bool
> :: DiffusionEq -> DiffusionEq -> Bool
$c>= :: DiffusionEq -> DiffusionEq -> Bool
>= :: DiffusionEq -> DiffusionEq -> Bool
$cmax :: DiffusionEq -> DiffusionEq -> DiffusionEq
max :: DiffusionEq -> DiffusionEq -> DiffusionEq
$cmin :: DiffusionEq -> DiffusionEq -> DiffusionEq
min :: DiffusionEq -> DiffusionEq -> DiffusionEq
Ord, Int -> DiffusionEq
DiffusionEq -> Int
DiffusionEq -> [DiffusionEq]
DiffusionEq -> DiffusionEq
DiffusionEq -> DiffusionEq -> [DiffusionEq]
DiffusionEq -> DiffusionEq -> DiffusionEq -> [DiffusionEq]
(DiffusionEq -> DiffusionEq)
-> (DiffusionEq -> DiffusionEq)
-> (Int -> DiffusionEq)
-> (DiffusionEq -> Int)
-> (DiffusionEq -> [DiffusionEq])
-> (DiffusionEq -> DiffusionEq -> [DiffusionEq])
-> (DiffusionEq -> DiffusionEq -> [DiffusionEq])
-> (DiffusionEq -> DiffusionEq -> DiffusionEq -> [DiffusionEq])
-> Enum DiffusionEq
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: DiffusionEq -> DiffusionEq
succ :: DiffusionEq -> DiffusionEq
$cpred :: DiffusionEq -> DiffusionEq
pred :: DiffusionEq -> DiffusionEq
$ctoEnum :: Int -> DiffusionEq
toEnum :: Int -> DiffusionEq
$cfromEnum :: DiffusionEq -> Int
fromEnum :: DiffusionEq -> Int
$cenumFrom :: DiffusionEq -> [DiffusionEq]
enumFrom :: DiffusionEq -> [DiffusionEq]
$cenumFromThen :: DiffusionEq -> DiffusionEq -> [DiffusionEq]
enumFromThen :: DiffusionEq -> DiffusionEq -> [DiffusionEq]
$cenumFromTo :: DiffusionEq -> DiffusionEq -> [DiffusionEq]
enumFromTo :: DiffusionEq -> DiffusionEq -> [DiffusionEq]
$cenumFromThenTo :: DiffusionEq -> DiffusionEq -> DiffusionEq -> [DiffusionEq]
enumFromThenTo :: DiffusionEq -> DiffusionEq -> DiffusionEq -> [DiffusionEq]
Enum)
toDiffusionEq :: AFDiffusionEq -> DiffusionEq
toDiffusionEq :: AFDiffusionEq -> DiffusionEq
toDiffusionEq (AFDiffusionEq (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> DiffusionEq
forall a. Enum a => Int -> a
toEnum Int
x
fromDiffusionEq :: DiffusionEq -> AFDiffusionEq
fromDiffusionEq :: DiffusionEq -> AFDiffusionEq
fromDiffusionEq = CInt -> AFDiffusionEq
AFDiffusionEq (CInt -> AFDiffusionEq)
-> (DiffusionEq -> CInt) -> DiffusionEq -> AFDiffusionEq
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (DiffusionEq -> Int) -> DiffusionEq -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. DiffusionEq -> Int
forall a. Enum a => a -> Int
fromEnum
data IterativeDeconvAlgo
= DeconvDefault
| DeconvLandweber
| DeconvRichardsonLucy
deriving (Int -> IterativeDeconvAlgo -> ShowS
[IterativeDeconvAlgo] -> ShowS
IterativeDeconvAlgo -> [Char]
(Int -> IterativeDeconvAlgo -> ShowS)
-> (IterativeDeconvAlgo -> [Char])
-> ([IterativeDeconvAlgo] -> ShowS)
-> Show IterativeDeconvAlgo
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> IterativeDeconvAlgo -> ShowS
showsPrec :: Int -> IterativeDeconvAlgo -> ShowS
$cshow :: IterativeDeconvAlgo -> [Char]
show :: IterativeDeconvAlgo -> [Char]
$cshowList :: [IterativeDeconvAlgo] -> ShowS
showList :: [IterativeDeconvAlgo] -> ShowS
Show, IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
(IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool)
-> (IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool)
-> Eq IterativeDeconvAlgo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
== :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
$c/= :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
/= :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
Eq, Eq IterativeDeconvAlgo
Eq IterativeDeconvAlgo =>
(IterativeDeconvAlgo -> IterativeDeconvAlgo -> Ordering)
-> (IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool)
-> (IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool)
-> (IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool)
-> (IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool)
-> (IterativeDeconvAlgo
-> IterativeDeconvAlgo -> IterativeDeconvAlgo)
-> (IterativeDeconvAlgo
-> IterativeDeconvAlgo -> IterativeDeconvAlgo)
-> Ord IterativeDeconvAlgo
IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
IterativeDeconvAlgo -> IterativeDeconvAlgo -> Ordering
IterativeDeconvAlgo -> IterativeDeconvAlgo -> IterativeDeconvAlgo
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Ordering
compare :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Ordering
$c< :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
< :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
$c<= :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
<= :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
$c> :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
> :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
$c>= :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
>= :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> Bool
$cmax :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> IterativeDeconvAlgo
max :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> IterativeDeconvAlgo
$cmin :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> IterativeDeconvAlgo
min :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> IterativeDeconvAlgo
Ord, Int -> IterativeDeconvAlgo
IterativeDeconvAlgo -> Int
IterativeDeconvAlgo -> [IterativeDeconvAlgo]
IterativeDeconvAlgo -> IterativeDeconvAlgo
IterativeDeconvAlgo -> IterativeDeconvAlgo -> [IterativeDeconvAlgo]
IterativeDeconvAlgo
-> IterativeDeconvAlgo
-> IterativeDeconvAlgo
-> [IterativeDeconvAlgo]
(IterativeDeconvAlgo -> IterativeDeconvAlgo)
-> (IterativeDeconvAlgo -> IterativeDeconvAlgo)
-> (Int -> IterativeDeconvAlgo)
-> (IterativeDeconvAlgo -> Int)
-> (IterativeDeconvAlgo -> [IterativeDeconvAlgo])
-> (IterativeDeconvAlgo
-> IterativeDeconvAlgo -> [IterativeDeconvAlgo])
-> (IterativeDeconvAlgo
-> IterativeDeconvAlgo -> [IterativeDeconvAlgo])
-> (IterativeDeconvAlgo
-> IterativeDeconvAlgo
-> IterativeDeconvAlgo
-> [IterativeDeconvAlgo])
-> Enum IterativeDeconvAlgo
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: IterativeDeconvAlgo -> IterativeDeconvAlgo
succ :: IterativeDeconvAlgo -> IterativeDeconvAlgo
$cpred :: IterativeDeconvAlgo -> IterativeDeconvAlgo
pred :: IterativeDeconvAlgo -> IterativeDeconvAlgo
$ctoEnum :: Int -> IterativeDeconvAlgo
toEnum :: Int -> IterativeDeconvAlgo
$cfromEnum :: IterativeDeconvAlgo -> Int
fromEnum :: IterativeDeconvAlgo -> Int
$cenumFrom :: IterativeDeconvAlgo -> [IterativeDeconvAlgo]
enumFrom :: IterativeDeconvAlgo -> [IterativeDeconvAlgo]
$cenumFromThen :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> [IterativeDeconvAlgo]
enumFromThen :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> [IterativeDeconvAlgo]
$cenumFromTo :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> [IterativeDeconvAlgo]
enumFromTo :: IterativeDeconvAlgo -> IterativeDeconvAlgo -> [IterativeDeconvAlgo]
$cenumFromThenTo :: IterativeDeconvAlgo
-> IterativeDeconvAlgo
-> IterativeDeconvAlgo
-> [IterativeDeconvAlgo]
enumFromThenTo :: IterativeDeconvAlgo
-> IterativeDeconvAlgo
-> IterativeDeconvAlgo
-> [IterativeDeconvAlgo]
Enum)
toIterativeDeconvAlgo :: AFIterativeDeconvAlgo -> IterativeDeconvAlgo
toIterativeDeconvAlgo :: AFIterativeDeconvAlgo -> IterativeDeconvAlgo
toIterativeDeconvAlgo (AFIterativeDeconvAlgo (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> IterativeDeconvAlgo
forall a. Enum a => Int -> a
toEnum Int
x
fromIterativeDeconvAlgo :: IterativeDeconvAlgo -> AFIterativeDeconvAlgo
fromIterativeDeconvAlgo :: IterativeDeconvAlgo -> AFIterativeDeconvAlgo
fromIterativeDeconvAlgo = CInt -> AFIterativeDeconvAlgo
AFIterativeDeconvAlgo (CInt -> AFIterativeDeconvAlgo)
-> (IterativeDeconvAlgo -> CInt)
-> IterativeDeconvAlgo
-> AFIterativeDeconvAlgo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (IterativeDeconvAlgo -> Int) -> IterativeDeconvAlgo -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. IterativeDeconvAlgo -> Int
forall a. Enum a => a -> Int
fromEnum
data InverseDeconvAlgo
= InverseDeconvDefault
| InverseDeconvTikhonov
deriving (Int -> InverseDeconvAlgo -> ShowS
[InverseDeconvAlgo] -> ShowS
InverseDeconvAlgo -> [Char]
(Int -> InverseDeconvAlgo -> ShowS)
-> (InverseDeconvAlgo -> [Char])
-> ([InverseDeconvAlgo] -> ShowS)
-> Show InverseDeconvAlgo
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> InverseDeconvAlgo -> ShowS
showsPrec :: Int -> InverseDeconvAlgo -> ShowS
$cshow :: InverseDeconvAlgo -> [Char]
show :: InverseDeconvAlgo -> [Char]
$cshowList :: [InverseDeconvAlgo] -> ShowS
showList :: [InverseDeconvAlgo] -> ShowS
Show, InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
(InverseDeconvAlgo -> InverseDeconvAlgo -> Bool)
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> Bool)
-> Eq InverseDeconvAlgo
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
== :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
$c/= :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
/= :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
Eq, Eq InverseDeconvAlgo
Eq InverseDeconvAlgo =>
(InverseDeconvAlgo -> InverseDeconvAlgo -> Ordering)
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> Bool)
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> Bool)
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> Bool)
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> Bool)
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> InverseDeconvAlgo)
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> InverseDeconvAlgo)
-> Ord InverseDeconvAlgo
InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
InverseDeconvAlgo -> InverseDeconvAlgo -> Ordering
InverseDeconvAlgo -> InverseDeconvAlgo -> InverseDeconvAlgo
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: InverseDeconvAlgo -> InverseDeconvAlgo -> Ordering
compare :: InverseDeconvAlgo -> InverseDeconvAlgo -> Ordering
$c< :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
< :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
$c<= :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
<= :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
$c> :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
> :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
$c>= :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
>= :: InverseDeconvAlgo -> InverseDeconvAlgo -> Bool
$cmax :: InverseDeconvAlgo -> InverseDeconvAlgo -> InverseDeconvAlgo
max :: InverseDeconvAlgo -> InverseDeconvAlgo -> InverseDeconvAlgo
$cmin :: InverseDeconvAlgo -> InverseDeconvAlgo -> InverseDeconvAlgo
min :: InverseDeconvAlgo -> InverseDeconvAlgo -> InverseDeconvAlgo
Ord, Int -> InverseDeconvAlgo
InverseDeconvAlgo -> Int
InverseDeconvAlgo -> [InverseDeconvAlgo]
InverseDeconvAlgo -> InverseDeconvAlgo
InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo]
InverseDeconvAlgo
-> InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo]
(InverseDeconvAlgo -> InverseDeconvAlgo)
-> (InverseDeconvAlgo -> InverseDeconvAlgo)
-> (Int -> InverseDeconvAlgo)
-> (InverseDeconvAlgo -> Int)
-> (InverseDeconvAlgo -> [InverseDeconvAlgo])
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo])
-> (InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo])
-> (InverseDeconvAlgo
-> InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo])
-> Enum InverseDeconvAlgo
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: InverseDeconvAlgo -> InverseDeconvAlgo
succ :: InverseDeconvAlgo -> InverseDeconvAlgo
$cpred :: InverseDeconvAlgo -> InverseDeconvAlgo
pred :: InverseDeconvAlgo -> InverseDeconvAlgo
$ctoEnum :: Int -> InverseDeconvAlgo
toEnum :: Int -> InverseDeconvAlgo
$cfromEnum :: InverseDeconvAlgo -> Int
fromEnum :: InverseDeconvAlgo -> Int
$cenumFrom :: InverseDeconvAlgo -> [InverseDeconvAlgo]
enumFrom :: InverseDeconvAlgo -> [InverseDeconvAlgo]
$cenumFromThen :: InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo]
enumFromThen :: InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo]
$cenumFromTo :: InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo]
enumFromTo :: InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo]
$cenumFromThenTo :: InverseDeconvAlgo
-> InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo]
enumFromThenTo :: InverseDeconvAlgo
-> InverseDeconvAlgo -> InverseDeconvAlgo -> [InverseDeconvAlgo]
Enum)
toInverseDeconvAlgo :: AFInverseDeconvAlgo -> InverseDeconvAlgo
toInverseDeconvAlgo :: AFInverseDeconvAlgo -> InverseDeconvAlgo
toInverseDeconvAlgo (AFInverseDeconvAlgo (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> InverseDeconvAlgo
forall a. Enum a => Int -> a
toEnum Int
x
fromInverseDeconvAlgo :: InverseDeconvAlgo -> AFInverseDeconvAlgo
fromInverseDeconvAlgo :: InverseDeconvAlgo -> AFInverseDeconvAlgo
fromInverseDeconvAlgo = CInt -> AFInverseDeconvAlgo
AFInverseDeconvAlgo (CInt -> AFInverseDeconvAlgo)
-> (InverseDeconvAlgo -> CInt)
-> InverseDeconvAlgo
-> AFInverseDeconvAlgo
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt)
-> (InverseDeconvAlgo -> Int) -> InverseDeconvAlgo -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. InverseDeconvAlgo -> Int
forall a. Enum a => a -> Int
fromEnum
data Cell
= Cell
{ Cell -> Int
cellRow :: Int
, Cell -> Int
cellCol :: Int
, Cell -> [Char]
cellTitle :: String
, Cell -> ColorMap
cellColorMap :: ColorMap
} deriving (Int -> Cell -> ShowS
[Cell] -> ShowS
Cell -> [Char]
(Int -> Cell -> ShowS)
-> (Cell -> [Char]) -> ([Cell] -> ShowS) -> Show Cell
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Cell -> ShowS
showsPrec :: Int -> Cell -> ShowS
$cshow :: Cell -> [Char]
show :: Cell -> [Char]
$cshowList :: [Cell] -> ShowS
showList :: [Cell] -> ShowS
Show, Cell -> Cell -> Bool
(Cell -> Cell -> Bool) -> (Cell -> Cell -> Bool) -> Eq Cell
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Cell -> Cell -> Bool
== :: Cell -> Cell -> Bool
$c/= :: Cell -> Cell -> Bool
/= :: Cell -> Cell -> Bool
Eq)
withAFCell :: Cell -> (Ptr AFCell -> IO a) -> IO a
withAFCell :: forall a. Cell -> (Ptr AFCell -> IO a) -> IO a
withAFCell Cell {Int
[Char]
ColorMap
cellRow :: Cell -> Int
cellCol :: Cell -> Int
cellTitle :: Cell -> [Char]
cellColorMap :: Cell -> ColorMap
cellRow :: Int
cellCol :: Int
cellTitle :: [Char]
cellColorMap :: ColorMap
..} Ptr AFCell -> IO a
f =
[Char] -> (CString -> IO a) -> IO a
forall a. [Char] -> (CString -> IO a) -> IO a
withCString [Char]
cellTitle ((CString -> IO a) -> IO a) -> (CString -> IO a) -> IO a
forall a b. (a -> b) -> a -> b
$ \CString
cstr ->
(Ptr AFCell -> IO a) -> IO a
forall a b. Storable a => (Ptr a -> IO b) -> IO b
alloca ((Ptr AFCell -> IO a) -> IO a) -> (Ptr AFCell -> IO a) -> IO a
forall a b. (a -> b) -> a -> b
$ \Ptr AFCell
cellPtr -> do
Ptr AFCell -> AFCell -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke Ptr AFCell
cellPtr AFCell { afCellRow :: Int
afCellRow = Int
cellRow
, afCellCol :: Int
afCellCol = Int
cellCol
, afCellTitle :: CString
afCellTitle = CString
cstr
, afCellColorMap :: AFColorMap
afCellColorMap = ColorMap -> AFColorMap
fromColorMap ColorMap
cellColorMap
}
Ptr AFCell -> IO a
f Ptr AFCell
cellPtr
data ColorMap
= ColorMapDefault
| ColorMapSpectrum
| ColorMapColors
| ColorMapRed
| ColorMapMood
| ColorMapHeat
| ColorMapBlue
| ColorMapInferno
| ColorMapMagma
| ColorMapPlasma
| ColorMapViridis
deriving (Int -> ColorMap -> ShowS
[ColorMap] -> ShowS
ColorMap -> [Char]
(Int -> ColorMap -> ShowS)
-> (ColorMap -> [Char]) -> ([ColorMap] -> ShowS) -> Show ColorMap
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColorMap -> ShowS
showsPrec :: Int -> ColorMap -> ShowS
$cshow :: ColorMap -> [Char]
show :: ColorMap -> [Char]
$cshowList :: [ColorMap] -> ShowS
showList :: [ColorMap] -> ShowS
Show, ColorMap -> ColorMap -> Bool
(ColorMap -> ColorMap -> Bool)
-> (ColorMap -> ColorMap -> Bool) -> Eq ColorMap
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColorMap -> ColorMap -> Bool
== :: ColorMap -> ColorMap -> Bool
$c/= :: ColorMap -> ColorMap -> Bool
/= :: ColorMap -> ColorMap -> Bool
Eq, Eq ColorMap
Eq ColorMap =>
(ColorMap -> ColorMap -> Ordering)
-> (ColorMap -> ColorMap -> Bool)
-> (ColorMap -> ColorMap -> Bool)
-> (ColorMap -> ColorMap -> Bool)
-> (ColorMap -> ColorMap -> Bool)
-> (ColorMap -> ColorMap -> ColorMap)
-> (ColorMap -> ColorMap -> ColorMap)
-> Ord ColorMap
ColorMap -> ColorMap -> Bool
ColorMap -> ColorMap -> Ordering
ColorMap -> ColorMap -> ColorMap
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: ColorMap -> ColorMap -> Ordering
compare :: ColorMap -> ColorMap -> Ordering
$c< :: ColorMap -> ColorMap -> Bool
< :: ColorMap -> ColorMap -> Bool
$c<= :: ColorMap -> ColorMap -> Bool
<= :: ColorMap -> ColorMap -> Bool
$c> :: ColorMap -> ColorMap -> Bool
> :: ColorMap -> ColorMap -> Bool
$c>= :: ColorMap -> ColorMap -> Bool
>= :: ColorMap -> ColorMap -> Bool
$cmax :: ColorMap -> ColorMap -> ColorMap
max :: ColorMap -> ColorMap -> ColorMap
$cmin :: ColorMap -> ColorMap -> ColorMap
min :: ColorMap -> ColorMap -> ColorMap
Ord, Int -> ColorMap
ColorMap -> Int
ColorMap -> [ColorMap]
ColorMap -> ColorMap
ColorMap -> ColorMap -> [ColorMap]
ColorMap -> ColorMap -> ColorMap -> [ColorMap]
(ColorMap -> ColorMap)
-> (ColorMap -> ColorMap)
-> (Int -> ColorMap)
-> (ColorMap -> Int)
-> (ColorMap -> [ColorMap])
-> (ColorMap -> ColorMap -> [ColorMap])
-> (ColorMap -> ColorMap -> [ColorMap])
-> (ColorMap -> ColorMap -> ColorMap -> [ColorMap])
-> Enum ColorMap
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ColorMap -> ColorMap
succ :: ColorMap -> ColorMap
$cpred :: ColorMap -> ColorMap
pred :: ColorMap -> ColorMap
$ctoEnum :: Int -> ColorMap
toEnum :: Int -> ColorMap
$cfromEnum :: ColorMap -> Int
fromEnum :: ColorMap -> Int
$cenumFrom :: ColorMap -> [ColorMap]
enumFrom :: ColorMap -> [ColorMap]
$cenumFromThen :: ColorMap -> ColorMap -> [ColorMap]
enumFromThen :: ColorMap -> ColorMap -> [ColorMap]
$cenumFromTo :: ColorMap -> ColorMap -> [ColorMap]
enumFromTo :: ColorMap -> ColorMap -> [ColorMap]
$cenumFromThenTo :: ColorMap -> ColorMap -> ColorMap -> [ColorMap]
enumFromThenTo :: ColorMap -> ColorMap -> ColorMap -> [ColorMap]
Enum)
fromColorMap :: ColorMap -> AFColorMap
fromColorMap :: ColorMap -> AFColorMap
fromColorMap = CInt -> AFColorMap
AFColorMap (CInt -> AFColorMap)
-> (ColorMap -> CInt) -> ColorMap -> AFColorMap
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (ColorMap -> Int) -> ColorMap -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ColorMap -> Int
forall a. Enum a => a -> Int
fromEnum
toColorMap :: AFColorMap -> ColorMap
toColorMap :: AFColorMap -> ColorMap
toColorMap (AFColorMap (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> ColorMap
forall a. Enum a => Int -> a
toEnum Int
x
data MarkerType
= MarkerTypeNone
| MarkerTypePoint
| MarkerTypeCircle
| MarkerTypeSquare
| MarkerTypeTriangle
| MarkerTypeCross
| MarkerTypePlus
| MarkerTypeStar
deriving (Int -> MarkerType -> ShowS
[MarkerType] -> ShowS
MarkerType -> [Char]
(Int -> MarkerType -> ShowS)
-> (MarkerType -> [Char])
-> ([MarkerType] -> ShowS)
-> Show MarkerType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MarkerType -> ShowS
showsPrec :: Int -> MarkerType -> ShowS
$cshow :: MarkerType -> [Char]
show :: MarkerType -> [Char]
$cshowList :: [MarkerType] -> ShowS
showList :: [MarkerType] -> ShowS
Show, MarkerType -> MarkerType -> Bool
(MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> Bool) -> Eq MarkerType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MarkerType -> MarkerType -> Bool
== :: MarkerType -> MarkerType -> Bool
$c/= :: MarkerType -> MarkerType -> Bool
/= :: MarkerType -> MarkerType -> Bool
Eq, Eq MarkerType
Eq MarkerType =>
(MarkerType -> MarkerType -> Ordering)
-> (MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> Bool)
-> (MarkerType -> MarkerType -> MarkerType)
-> (MarkerType -> MarkerType -> MarkerType)
-> Ord MarkerType
MarkerType -> MarkerType -> Bool
MarkerType -> MarkerType -> Ordering
MarkerType -> MarkerType -> MarkerType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: MarkerType -> MarkerType -> Ordering
compare :: MarkerType -> MarkerType -> Ordering
$c< :: MarkerType -> MarkerType -> Bool
< :: MarkerType -> MarkerType -> Bool
$c<= :: MarkerType -> MarkerType -> Bool
<= :: MarkerType -> MarkerType -> Bool
$c> :: MarkerType -> MarkerType -> Bool
> :: MarkerType -> MarkerType -> Bool
$c>= :: MarkerType -> MarkerType -> Bool
>= :: MarkerType -> MarkerType -> Bool
$cmax :: MarkerType -> MarkerType -> MarkerType
max :: MarkerType -> MarkerType -> MarkerType
$cmin :: MarkerType -> MarkerType -> MarkerType
min :: MarkerType -> MarkerType -> MarkerType
Ord, Int -> MarkerType
MarkerType -> Int
MarkerType -> [MarkerType]
MarkerType -> MarkerType
MarkerType -> MarkerType -> [MarkerType]
MarkerType -> MarkerType -> MarkerType -> [MarkerType]
(MarkerType -> MarkerType)
-> (MarkerType -> MarkerType)
-> (Int -> MarkerType)
-> (MarkerType -> Int)
-> (MarkerType -> [MarkerType])
-> (MarkerType -> MarkerType -> [MarkerType])
-> (MarkerType -> MarkerType -> [MarkerType])
-> (MarkerType -> MarkerType -> MarkerType -> [MarkerType])
-> Enum MarkerType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: MarkerType -> MarkerType
succ :: MarkerType -> MarkerType
$cpred :: MarkerType -> MarkerType
pred :: MarkerType -> MarkerType
$ctoEnum :: Int -> MarkerType
toEnum :: Int -> MarkerType
$cfromEnum :: MarkerType -> Int
fromEnum :: MarkerType -> Int
$cenumFrom :: MarkerType -> [MarkerType]
enumFrom :: MarkerType -> [MarkerType]
$cenumFromThen :: MarkerType -> MarkerType -> [MarkerType]
enumFromThen :: MarkerType -> MarkerType -> [MarkerType]
$cenumFromTo :: MarkerType -> MarkerType -> [MarkerType]
enumFromTo :: MarkerType -> MarkerType -> [MarkerType]
$cenumFromThenTo :: MarkerType -> MarkerType -> MarkerType -> [MarkerType]
enumFromThenTo :: MarkerType -> MarkerType -> MarkerType -> [MarkerType]
Enum)
fromMarkerType :: MarkerType -> AFMarkerType
fromMarkerType :: MarkerType -> AFMarkerType
fromMarkerType = CInt -> AFMarkerType
AFMarkerType (CInt -> AFMarkerType)
-> (MarkerType -> CInt) -> MarkerType -> AFMarkerType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (MarkerType -> Int) -> MarkerType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MarkerType -> Int
forall a. Enum a => a -> Int
fromEnum
toMarkerType :: AFMarkerType -> MarkerType
toMarkerType :: AFMarkerType -> MarkerType
toMarkerType (AFMarkerType (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> MarkerType
forall a. Enum a => Int -> a
toEnum Int
x
data MatchType
= MatchTypeSAD
| MatchTypeZSAD
| MatchTypeLSAD
| MatchTypeSSD
| MatchTypeZSSD
| MatchTypeLSSD
| MatchTypeNCC
| MatchTypeZNCC
| MatchTypeSHD
deriving (Int -> MatchType -> ShowS
[MatchType] -> ShowS
MatchType -> [Char]
(Int -> MatchType -> ShowS)
-> (MatchType -> [Char])
-> ([MatchType] -> ShowS)
-> Show MatchType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> MatchType -> ShowS
showsPrec :: Int -> MatchType -> ShowS
$cshow :: MatchType -> [Char]
show :: MatchType -> [Char]
$cshowList :: [MatchType] -> ShowS
showList :: [MatchType] -> ShowS
Show, MatchType -> MatchType -> Bool
(MatchType -> MatchType -> Bool)
-> (MatchType -> MatchType -> Bool) -> Eq MatchType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: MatchType -> MatchType -> Bool
== :: MatchType -> MatchType -> Bool
$c/= :: MatchType -> MatchType -> Bool
/= :: MatchType -> MatchType -> Bool
Eq, Eq MatchType
Eq MatchType =>
(MatchType -> MatchType -> Ordering)
-> (MatchType -> MatchType -> Bool)
-> (MatchType -> MatchType -> Bool)
-> (MatchType -> MatchType -> Bool)
-> (MatchType -> MatchType -> Bool)
-> (MatchType -> MatchType -> MatchType)
-> (MatchType -> MatchType -> MatchType)
-> Ord MatchType
MatchType -> MatchType -> Bool
MatchType -> MatchType -> Ordering
MatchType -> MatchType -> MatchType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: MatchType -> MatchType -> Ordering
compare :: MatchType -> MatchType -> Ordering
$c< :: MatchType -> MatchType -> Bool
< :: MatchType -> MatchType -> Bool
$c<= :: MatchType -> MatchType -> Bool
<= :: MatchType -> MatchType -> Bool
$c> :: MatchType -> MatchType -> Bool
> :: MatchType -> MatchType -> Bool
$c>= :: MatchType -> MatchType -> Bool
>= :: MatchType -> MatchType -> Bool
$cmax :: MatchType -> MatchType -> MatchType
max :: MatchType -> MatchType -> MatchType
$cmin :: MatchType -> MatchType -> MatchType
min :: MatchType -> MatchType -> MatchType
Ord, Int -> MatchType
MatchType -> Int
MatchType -> [MatchType]
MatchType -> MatchType
MatchType -> MatchType -> [MatchType]
MatchType -> MatchType -> MatchType -> [MatchType]
(MatchType -> MatchType)
-> (MatchType -> MatchType)
-> (Int -> MatchType)
-> (MatchType -> Int)
-> (MatchType -> [MatchType])
-> (MatchType -> MatchType -> [MatchType])
-> (MatchType -> MatchType -> [MatchType])
-> (MatchType -> MatchType -> MatchType -> [MatchType])
-> Enum MatchType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: MatchType -> MatchType
succ :: MatchType -> MatchType
$cpred :: MatchType -> MatchType
pred :: MatchType -> MatchType
$ctoEnum :: Int -> MatchType
toEnum :: Int -> MatchType
$cfromEnum :: MatchType -> Int
fromEnum :: MatchType -> Int
$cenumFrom :: MatchType -> [MatchType]
enumFrom :: MatchType -> [MatchType]
$cenumFromThen :: MatchType -> MatchType -> [MatchType]
enumFromThen :: MatchType -> MatchType -> [MatchType]
$cenumFromTo :: MatchType -> MatchType -> [MatchType]
enumFromTo :: MatchType -> MatchType -> [MatchType]
$cenumFromThenTo :: MatchType -> MatchType -> MatchType -> [MatchType]
enumFromThenTo :: MatchType -> MatchType -> MatchType -> [MatchType]
Enum)
fromMatchType :: MatchType -> AFMatchType
fromMatchType :: MatchType -> AFMatchType
fromMatchType = CInt -> AFMatchType
AFMatchType (CInt -> AFMatchType)
-> (MatchType -> CInt) -> MatchType -> AFMatchType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (MatchType -> Int) -> MatchType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MatchType -> Int
forall a. Enum a => a -> Int
fromEnum
toMatchType :: AFMatchType -> MatchType
toMatchType :: AFMatchType -> MatchType
toMatchType (AFMatchType (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> MatchType
forall a. Enum a => Int -> a
toEnum Int
x
data TopK
= TopKDefault
| TopKMin
| TopKMax
deriving (Int -> TopK -> ShowS
[TopK] -> ShowS
TopK -> [Char]
(Int -> TopK -> ShowS)
-> (TopK -> [Char]) -> ([TopK] -> ShowS) -> Show TopK
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TopK -> ShowS
showsPrec :: Int -> TopK -> ShowS
$cshow :: TopK -> [Char]
show :: TopK -> [Char]
$cshowList :: [TopK] -> ShowS
showList :: [TopK] -> ShowS
Show, TopK -> TopK -> Bool
(TopK -> TopK -> Bool) -> (TopK -> TopK -> Bool) -> Eq TopK
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TopK -> TopK -> Bool
== :: TopK -> TopK -> Bool
$c/= :: TopK -> TopK -> Bool
/= :: TopK -> TopK -> Bool
Eq, Eq TopK
Eq TopK =>
(TopK -> TopK -> Ordering)
-> (TopK -> TopK -> Bool)
-> (TopK -> TopK -> Bool)
-> (TopK -> TopK -> Bool)
-> (TopK -> TopK -> Bool)
-> (TopK -> TopK -> TopK)
-> (TopK -> TopK -> TopK)
-> Ord TopK
TopK -> TopK -> Bool
TopK -> TopK -> Ordering
TopK -> TopK -> TopK
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: TopK -> TopK -> Ordering
compare :: TopK -> TopK -> Ordering
$c< :: TopK -> TopK -> Bool
< :: TopK -> TopK -> Bool
$c<= :: TopK -> TopK -> Bool
<= :: TopK -> TopK -> Bool
$c> :: TopK -> TopK -> Bool
> :: TopK -> TopK -> Bool
$c>= :: TopK -> TopK -> Bool
>= :: TopK -> TopK -> Bool
$cmax :: TopK -> TopK -> TopK
max :: TopK -> TopK -> TopK
$cmin :: TopK -> TopK -> TopK
min :: TopK -> TopK -> TopK
Ord, Int -> TopK
TopK -> Int
TopK -> [TopK]
TopK -> TopK
TopK -> TopK -> [TopK]
TopK -> TopK -> TopK -> [TopK]
(TopK -> TopK)
-> (TopK -> TopK)
-> (Int -> TopK)
-> (TopK -> Int)
-> (TopK -> [TopK])
-> (TopK -> TopK -> [TopK])
-> (TopK -> TopK -> [TopK])
-> (TopK -> TopK -> TopK -> [TopK])
-> Enum TopK
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: TopK -> TopK
succ :: TopK -> TopK
$cpred :: TopK -> TopK
pred :: TopK -> TopK
$ctoEnum :: Int -> TopK
toEnum :: Int -> TopK
$cfromEnum :: TopK -> Int
fromEnum :: TopK -> Int
$cenumFrom :: TopK -> [TopK]
enumFrom :: TopK -> [TopK]
$cenumFromThen :: TopK -> TopK -> [TopK]
enumFromThen :: TopK -> TopK -> [TopK]
$cenumFromTo :: TopK -> TopK -> [TopK]
enumFromTo :: TopK -> TopK -> [TopK]
$cenumFromThenTo :: TopK -> TopK -> TopK -> [TopK]
enumFromThenTo :: TopK -> TopK -> TopK -> [TopK]
Enum)
fromTopK :: TopK -> AFTopkFunction
fromTopK :: TopK -> AFTopkFunction
fromTopK = CInt -> AFTopkFunction
AFTopkFunction (CInt -> AFTopkFunction)
-> (TopK -> CInt) -> TopK -> AFTopkFunction
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (TopK -> Int) -> TopK -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TopK -> Int
forall a. Enum a => a -> Int
fromEnum
toTopK :: AFTopkFunction -> TopK
toTopK :: AFTopkFunction -> TopK
toTopK (AFTopkFunction (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> TopK
forall a. Enum a => Int -> a
toEnum Int
x
data VarBias
= VarianceDefault
| VarianceSample
| VariancePopulation
deriving (Int -> VarBias -> ShowS
[VarBias] -> ShowS
VarBias -> [Char]
(Int -> VarBias -> ShowS)
-> (VarBias -> [Char]) -> ([VarBias] -> ShowS) -> Show VarBias
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> VarBias -> ShowS
showsPrec :: Int -> VarBias -> ShowS
$cshow :: VarBias -> [Char]
show :: VarBias -> [Char]
$cshowList :: [VarBias] -> ShowS
showList :: [VarBias] -> ShowS
Show, VarBias -> VarBias -> Bool
(VarBias -> VarBias -> Bool)
-> (VarBias -> VarBias -> Bool) -> Eq VarBias
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: VarBias -> VarBias -> Bool
== :: VarBias -> VarBias -> Bool
$c/= :: VarBias -> VarBias -> Bool
/= :: VarBias -> VarBias -> Bool
Eq, Eq VarBias
Eq VarBias =>
(VarBias -> VarBias -> Ordering)
-> (VarBias -> VarBias -> Bool)
-> (VarBias -> VarBias -> Bool)
-> (VarBias -> VarBias -> Bool)
-> (VarBias -> VarBias -> Bool)
-> (VarBias -> VarBias -> VarBias)
-> (VarBias -> VarBias -> VarBias)
-> Ord VarBias
VarBias -> VarBias -> Bool
VarBias -> VarBias -> Ordering
VarBias -> VarBias -> VarBias
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: VarBias -> VarBias -> Ordering
compare :: VarBias -> VarBias -> Ordering
$c< :: VarBias -> VarBias -> Bool
< :: VarBias -> VarBias -> Bool
$c<= :: VarBias -> VarBias -> Bool
<= :: VarBias -> VarBias -> Bool
$c> :: VarBias -> VarBias -> Bool
> :: VarBias -> VarBias -> Bool
$c>= :: VarBias -> VarBias -> Bool
>= :: VarBias -> VarBias -> Bool
$cmax :: VarBias -> VarBias -> VarBias
max :: VarBias -> VarBias -> VarBias
$cmin :: VarBias -> VarBias -> VarBias
min :: VarBias -> VarBias -> VarBias
Ord, Int -> VarBias
VarBias -> Int
VarBias -> [VarBias]
VarBias -> VarBias
VarBias -> VarBias -> [VarBias]
VarBias -> VarBias -> VarBias -> [VarBias]
(VarBias -> VarBias)
-> (VarBias -> VarBias)
-> (Int -> VarBias)
-> (VarBias -> Int)
-> (VarBias -> [VarBias])
-> (VarBias -> VarBias -> [VarBias])
-> (VarBias -> VarBias -> [VarBias])
-> (VarBias -> VarBias -> VarBias -> [VarBias])
-> Enum VarBias
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: VarBias -> VarBias
succ :: VarBias -> VarBias
$cpred :: VarBias -> VarBias
pred :: VarBias -> VarBias
$ctoEnum :: Int -> VarBias
toEnum :: Int -> VarBias
$cfromEnum :: VarBias -> Int
fromEnum :: VarBias -> Int
$cenumFrom :: VarBias -> [VarBias]
enumFrom :: VarBias -> [VarBias]
$cenumFromThen :: VarBias -> VarBias -> [VarBias]
enumFromThen :: VarBias -> VarBias -> [VarBias]
$cenumFromTo :: VarBias -> VarBias -> [VarBias]
enumFromTo :: VarBias -> VarBias -> [VarBias]
$cenumFromThenTo :: VarBias -> VarBias -> VarBias -> [VarBias]
enumFromThenTo :: VarBias -> VarBias -> VarBias -> [VarBias]
Enum)
fromVarBias :: VarBias -> AFVarBias
fromVarBias :: VarBias -> AFVarBias
fromVarBias = CInt -> AFVarBias
AFVarBias (CInt -> AFVarBias) -> (VarBias -> CInt) -> VarBias -> AFVarBias
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (VarBias -> Int) -> VarBias -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. VarBias -> Int
forall a. Enum a => a -> Int
fromEnum
data HomographyType
= RANSAC
| LMEDS
deriving (Int -> HomographyType -> ShowS
[HomographyType] -> ShowS
HomographyType -> [Char]
(Int -> HomographyType -> ShowS)
-> (HomographyType -> [Char])
-> ([HomographyType] -> ShowS)
-> Show HomographyType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> HomographyType -> ShowS
showsPrec :: Int -> HomographyType -> ShowS
$cshow :: HomographyType -> [Char]
show :: HomographyType -> [Char]
$cshowList :: [HomographyType] -> ShowS
showList :: [HomographyType] -> ShowS
Show, HomographyType -> HomographyType -> Bool
(HomographyType -> HomographyType -> Bool)
-> (HomographyType -> HomographyType -> Bool) -> Eq HomographyType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: HomographyType -> HomographyType -> Bool
== :: HomographyType -> HomographyType -> Bool
$c/= :: HomographyType -> HomographyType -> Bool
/= :: HomographyType -> HomographyType -> Bool
Eq, Eq HomographyType
Eq HomographyType =>
(HomographyType -> HomographyType -> Ordering)
-> (HomographyType -> HomographyType -> Bool)
-> (HomographyType -> HomographyType -> Bool)
-> (HomographyType -> HomographyType -> Bool)
-> (HomographyType -> HomographyType -> Bool)
-> (HomographyType -> HomographyType -> HomographyType)
-> (HomographyType -> HomographyType -> HomographyType)
-> Ord HomographyType
HomographyType -> HomographyType -> Bool
HomographyType -> HomographyType -> Ordering
HomographyType -> HomographyType -> HomographyType
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: HomographyType -> HomographyType -> Ordering
compare :: HomographyType -> HomographyType -> Ordering
$c< :: HomographyType -> HomographyType -> Bool
< :: HomographyType -> HomographyType -> Bool
$c<= :: HomographyType -> HomographyType -> Bool
<= :: HomographyType -> HomographyType -> Bool
$c> :: HomographyType -> HomographyType -> Bool
> :: HomographyType -> HomographyType -> Bool
$c>= :: HomographyType -> HomographyType -> Bool
>= :: HomographyType -> HomographyType -> Bool
$cmax :: HomographyType -> HomographyType -> HomographyType
max :: HomographyType -> HomographyType -> HomographyType
$cmin :: HomographyType -> HomographyType -> HomographyType
min :: HomographyType -> HomographyType -> HomographyType
Ord, Int -> HomographyType
HomographyType -> Int
HomographyType -> [HomographyType]
HomographyType -> HomographyType
HomographyType -> HomographyType -> [HomographyType]
HomographyType
-> HomographyType -> HomographyType -> [HomographyType]
(HomographyType -> HomographyType)
-> (HomographyType -> HomographyType)
-> (Int -> HomographyType)
-> (HomographyType -> Int)
-> (HomographyType -> [HomographyType])
-> (HomographyType -> HomographyType -> [HomographyType])
-> (HomographyType -> HomographyType -> [HomographyType])
-> (HomographyType
-> HomographyType -> HomographyType -> [HomographyType])
-> Enum HomographyType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: HomographyType -> HomographyType
succ :: HomographyType -> HomographyType
$cpred :: HomographyType -> HomographyType
pred :: HomographyType -> HomographyType
$ctoEnum :: Int -> HomographyType
toEnum :: Int -> HomographyType
$cfromEnum :: HomographyType -> Int
fromEnum :: HomographyType -> Int
$cenumFrom :: HomographyType -> [HomographyType]
enumFrom :: HomographyType -> [HomographyType]
$cenumFromThen :: HomographyType -> HomographyType -> [HomographyType]
enumFromThen :: HomographyType -> HomographyType -> [HomographyType]
$cenumFromTo :: HomographyType -> HomographyType -> [HomographyType]
enumFromTo :: HomographyType -> HomographyType -> [HomographyType]
$cenumFromThenTo :: HomographyType
-> HomographyType -> HomographyType -> [HomographyType]
enumFromThenTo :: HomographyType
-> HomographyType -> HomographyType -> [HomographyType]
Enum)
fromHomographyType :: HomographyType -> AFHomographyType
fromHomographyType :: HomographyType -> AFHomographyType
fromHomographyType = CInt -> AFHomographyType
AFHomographyType (CInt -> AFHomographyType)
-> (HomographyType -> CInt) -> HomographyType -> AFHomographyType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (HomographyType -> Int) -> HomographyType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HomographyType -> Int
forall a. Enum a => a -> Int
fromEnum
toHomographyType :: AFHomographyType -> HomographyType
toHomographyType :: AFHomographyType -> HomographyType
toHomographyType (AFHomographyType (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> HomographyType
forall a. Enum a => Int -> a
toEnum Int
x
data Seq
= Seq
{ Seq -> Double
seqBegin :: !Double
, Seq -> Double
seqEnd :: !Double
, Seq -> Double
seqStep :: !Double
} deriving (Int -> Seq -> ShowS
[Seq] -> ShowS
Seq -> [Char]
(Int -> Seq -> ShowS)
-> (Seq -> [Char]) -> ([Seq] -> ShowS) -> Show Seq
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Seq -> ShowS
showsPrec :: Int -> Seq -> ShowS
$cshow :: Seq -> [Char]
show :: Seq -> [Char]
$cshowList :: [Seq] -> ShowS
showList :: [Seq] -> ShowS
Show, Seq -> Seq -> Bool
(Seq -> Seq -> Bool) -> (Seq -> Seq -> Bool) -> Eq Seq
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Seq -> Seq -> Bool
== :: Seq -> Seq -> Bool
$c/= :: Seq -> Seq -> Bool
/= :: Seq -> Seq -> Bool
Eq, Eq Seq
Eq Seq =>
(Seq -> Seq -> Ordering)
-> (Seq -> Seq -> Bool)
-> (Seq -> Seq -> Bool)
-> (Seq -> Seq -> Bool)
-> (Seq -> Seq -> Bool)
-> (Seq -> Seq -> Seq)
-> (Seq -> Seq -> Seq)
-> Ord Seq
Seq -> Seq -> Bool
Seq -> Seq -> Ordering
Seq -> Seq -> Seq
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
$ccompare :: Seq -> Seq -> Ordering
compare :: Seq -> Seq -> Ordering
$c< :: Seq -> Seq -> Bool
< :: Seq -> Seq -> Bool
$c<= :: Seq -> Seq -> Bool
<= :: Seq -> Seq -> Bool
$c> :: Seq -> Seq -> Bool
> :: Seq -> Seq -> Bool
$c>= :: Seq -> Seq -> Bool
>= :: Seq -> Seq -> Bool
$cmax :: Seq -> Seq -> Seq
max :: Seq -> Seq -> Seq
$cmin :: Seq -> Seq -> Seq
min :: Seq -> Seq -> Seq
Ord)
toAFSeq :: Seq -> AFSeq
toAFSeq :: Seq -> AFSeq
toAFSeq (Seq Double
x Double
y Double
z) = (Double -> Double -> Double -> AFSeq
AFSeq Double
x Double
y Double
z)
data Index
= SeqIndex Bool Seq
| ArrIndex Bool (Array Int)
seqIdx :: Seq -> Bool -> Index
seqIdx :: Seq -> Bool -> Index
seqIdx Seq
s Bool
batch = Bool -> Seq -> Index
SeqIndex Bool
batch Seq
s
arrIdx :: Array Int -> Bool -> Index
arrIdx :: Array Int -> Bool -> Index
arrIdx Array Int
a Bool
batch = Bool -> Array Int -> Index
ArrIndex Bool
batch Array Int
a
range :: Int -> Int -> Index
range :: Int -> Int -> Index
range Int
b Int
e = Bool -> Seq -> Index
SeqIndex Bool
False (Double -> Double -> Double -> Seq
Seq (Int -> Double
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
b) (Int -> Double
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
e) Double
1)
rangeStep :: Int -> Int -> Int -> Index
rangeStep :: Int -> Int -> Int -> Index
rangeStep Int
b Int
e Int
s = Bool -> Seq -> Index
SeqIndex Bool
False (Double -> Double -> Double -> Seq
Seq (Int -> Double
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
b) (Int -> Double
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
e) (Int -> Double
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
s))
at :: Int -> Index
at :: Int -> Index
at Int
n = let d :: Double
d = Int -> Double
forall a b. (Integral a, Num b) => a -> b
fromIntegral Int
n in Bool -> Seq -> Index
SeqIndex Bool
False (Double -> Double -> Double -> Seq
Seq Double
d Double
d Double
1)
toAFIndex :: Index -> IO AFIndex
toAFIndex :: Index -> IO AFIndex
toAFIndex (SeqIndex Bool
batch Seq
s) =
AFIndex -> IO AFIndex
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AFIndex -> IO AFIndex) -> AFIndex -> IO AFIndex
forall a b. (a -> b) -> a -> b
$ Either AFArray AFSeq -> Bool -> Bool -> AFIndex
AFIndex (AFSeq -> Either AFArray AFSeq
forall a b. b -> Either a b
Right (Seq -> AFSeq
toAFSeq Seq
s)) Bool
True Bool
batch
toAFIndex (ArrIndex Bool
batch (Array ForeignPtr ()
fptr)) =
AFIndex -> IO AFIndex
forall a. a -> IO a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (AFIndex -> IO AFIndex) -> AFIndex -> IO AFIndex
forall a b. (a -> b) -> a -> b
$ Either AFArray AFSeq -> Bool -> Bool -> AFIndex
AFIndex (AFArray -> Either AFArray AFSeq
forall a b. a -> Either a b
Left (ForeignPtr () -> AFArray
forall a. ForeignPtr a -> Ptr a
unsafeForeignPtrToPtr ForeignPtr ()
fptr)) Bool
False Bool
batch
type Version = (Int,Int,Int)
data NormType
= NormVectorOne
| NormVectorInf
| NormVector2
| NormVectorP
| NormMatrix1
| NormMatrixInf
| NormMatrix2
| NormMatrixLPQ
| NormEuclid
deriving (Int -> NormType -> ShowS
[NormType] -> ShowS
NormType -> [Char]
(Int -> NormType -> ShowS)
-> (NormType -> [Char]) -> ([NormType] -> ShowS) -> Show NormType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> NormType -> ShowS
showsPrec :: Int -> NormType -> ShowS
$cshow :: NormType -> [Char]
show :: NormType -> [Char]
$cshowList :: [NormType] -> ShowS
showList :: [NormType] -> ShowS
Show, NormType -> NormType -> Bool
(NormType -> NormType -> Bool)
-> (NormType -> NormType -> Bool) -> Eq NormType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: NormType -> NormType -> Bool
== :: NormType -> NormType -> Bool
$c/= :: NormType -> NormType -> Bool
/= :: NormType -> NormType -> Bool
Eq, Int -> NormType
NormType -> Int
NormType -> [NormType]
NormType -> NormType
NormType -> NormType -> [NormType]
NormType -> NormType -> NormType -> [NormType]
(NormType -> NormType)
-> (NormType -> NormType)
-> (Int -> NormType)
-> (NormType -> Int)
-> (NormType -> [NormType])
-> (NormType -> NormType -> [NormType])
-> (NormType -> NormType -> [NormType])
-> (NormType -> NormType -> NormType -> [NormType])
-> Enum NormType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: NormType -> NormType
succ :: NormType -> NormType
$cpred :: NormType -> NormType
pred :: NormType -> NormType
$ctoEnum :: Int -> NormType
toEnum :: Int -> NormType
$cfromEnum :: NormType -> Int
fromEnum :: NormType -> Int
$cenumFrom :: NormType -> [NormType]
enumFrom :: NormType -> [NormType]
$cenumFromThen :: NormType -> NormType -> [NormType]
enumFromThen :: NormType -> NormType -> [NormType]
$cenumFromTo :: NormType -> NormType -> [NormType]
enumFromTo :: NormType -> NormType -> [NormType]
$cenumFromThenTo :: NormType -> NormType -> NormType -> [NormType]
enumFromThenTo :: NormType -> NormType -> NormType -> [NormType]
Enum)
fromNormType :: NormType -> AFNormType
fromNormType :: NormType -> AFNormType
fromNormType NormType
NormVectorOne = Int -> AFNormType
AFNormType Int
0
fromNormType NormType
NormVectorInf = Int -> AFNormType
AFNormType Int
1
fromNormType NormType
NormVector2 = Int -> AFNormType
AFNormType Int
2
fromNormType NormType
NormVectorP = Int -> AFNormType
AFNormType Int
3
fromNormType NormType
NormMatrix1 = Int -> AFNormType
AFNormType Int
4
fromNormType NormType
NormMatrixInf = Int -> AFNormType
AFNormType Int
5
fromNormType NormType
NormMatrix2 = Int -> AFNormType
AFNormType Int
6
fromNormType NormType
NormMatrixLPQ = Int -> AFNormType
AFNormType Int
7
fromNormType NormType
NormEuclid = Int -> AFNormType
AFNormType Int
2
toNormType :: AFNormType -> NormType
toNormType :: AFNormType -> NormType
toNormType (AFNormType (Int -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x))
| Int
x Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= Int
0 Bool -> Bool -> Bool
&& Int
x Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= Int
7 = Int -> NormType
forall a. Enum a => Int -> a
toEnum Int
x
| Bool
otherwise = [Char] -> NormType
forall a. HasCallStack => [Char] -> a
error ([Char]
"Invalid AFNormType value: " [Char] -> ShowS
forall a. Semigroup a => a -> a -> a
<> Int -> [Char]
forall a. Show a => a -> [Char]
show Int
x)
data ConvDomain
= ConvDomainAuto
| ConvDomainSpatial
| ConvDomainFreq
deriving (Int -> ConvDomain -> ShowS
[ConvDomain] -> ShowS
ConvDomain -> [Char]
(Int -> ConvDomain -> ShowS)
-> (ConvDomain -> [Char])
-> ([ConvDomain] -> ShowS)
-> Show ConvDomain
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConvDomain -> ShowS
showsPrec :: Int -> ConvDomain -> ShowS
$cshow :: ConvDomain -> [Char]
show :: ConvDomain -> [Char]
$cshowList :: [ConvDomain] -> ShowS
showList :: [ConvDomain] -> ShowS
Show, ConvDomain -> ConvDomain -> Bool
(ConvDomain -> ConvDomain -> Bool)
-> (ConvDomain -> ConvDomain -> Bool) -> Eq ConvDomain
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConvDomain -> ConvDomain -> Bool
== :: ConvDomain -> ConvDomain -> Bool
$c/= :: ConvDomain -> ConvDomain -> Bool
/= :: ConvDomain -> ConvDomain -> Bool
Eq, Int -> ConvDomain
ConvDomain -> Int
ConvDomain -> [ConvDomain]
ConvDomain -> ConvDomain
ConvDomain -> ConvDomain -> [ConvDomain]
ConvDomain -> ConvDomain -> ConvDomain -> [ConvDomain]
(ConvDomain -> ConvDomain)
-> (ConvDomain -> ConvDomain)
-> (Int -> ConvDomain)
-> (ConvDomain -> Int)
-> (ConvDomain -> [ConvDomain])
-> (ConvDomain -> ConvDomain -> [ConvDomain])
-> (ConvDomain -> ConvDomain -> [ConvDomain])
-> (ConvDomain -> ConvDomain -> ConvDomain -> [ConvDomain])
-> Enum ConvDomain
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ConvDomain -> ConvDomain
succ :: ConvDomain -> ConvDomain
$cpred :: ConvDomain -> ConvDomain
pred :: ConvDomain -> ConvDomain
$ctoEnum :: Int -> ConvDomain
toEnum :: Int -> ConvDomain
$cfromEnum :: ConvDomain -> Int
fromEnum :: ConvDomain -> Int
$cenumFrom :: ConvDomain -> [ConvDomain]
enumFrom :: ConvDomain -> [ConvDomain]
$cenumFromThen :: ConvDomain -> ConvDomain -> [ConvDomain]
enumFromThen :: ConvDomain -> ConvDomain -> [ConvDomain]
$cenumFromTo :: ConvDomain -> ConvDomain -> [ConvDomain]
enumFromTo :: ConvDomain -> ConvDomain -> [ConvDomain]
$cenumFromThenTo :: ConvDomain -> ConvDomain -> ConvDomain -> [ConvDomain]
enumFromThenTo :: ConvDomain -> ConvDomain -> ConvDomain -> [ConvDomain]
Enum)
data ConvMode
= ConvDefault
| ConvExpand
deriving (Int -> ConvMode -> ShowS
[ConvMode] -> ShowS
ConvMode -> [Char]
(Int -> ConvMode -> ShowS)
-> (ConvMode -> [Char]) -> ([ConvMode] -> ShowS) -> Show ConvMode
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ConvMode -> ShowS
showsPrec :: Int -> ConvMode -> ShowS
$cshow :: ConvMode -> [Char]
show :: ConvMode -> [Char]
$cshowList :: [ConvMode] -> ShowS
showList :: [ConvMode] -> ShowS
Show, ConvMode -> ConvMode -> Bool
(ConvMode -> ConvMode -> Bool)
-> (ConvMode -> ConvMode -> Bool) -> Eq ConvMode
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ConvMode -> ConvMode -> Bool
== :: ConvMode -> ConvMode -> Bool
$c/= :: ConvMode -> ConvMode -> Bool
/= :: ConvMode -> ConvMode -> Bool
Eq, Int -> ConvMode
ConvMode -> Int
ConvMode -> [ConvMode]
ConvMode -> ConvMode
ConvMode -> ConvMode -> [ConvMode]
ConvMode -> ConvMode -> ConvMode -> [ConvMode]
(ConvMode -> ConvMode)
-> (ConvMode -> ConvMode)
-> (Int -> ConvMode)
-> (ConvMode -> Int)
-> (ConvMode -> [ConvMode])
-> (ConvMode -> ConvMode -> [ConvMode])
-> (ConvMode -> ConvMode -> [ConvMode])
-> (ConvMode -> ConvMode -> ConvMode -> [ConvMode])
-> Enum ConvMode
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: ConvMode -> ConvMode
succ :: ConvMode -> ConvMode
$cpred :: ConvMode -> ConvMode
pred :: ConvMode -> ConvMode
$ctoEnum :: Int -> ConvMode
toEnum :: Int -> ConvMode
$cfromEnum :: ConvMode -> Int
fromEnum :: ConvMode -> Int
$cenumFrom :: ConvMode -> [ConvMode]
enumFrom :: ConvMode -> [ConvMode]
$cenumFromThen :: ConvMode -> ConvMode -> [ConvMode]
enumFromThen :: ConvMode -> ConvMode -> [ConvMode]
$cenumFromTo :: ConvMode -> ConvMode -> [ConvMode]
enumFromTo :: ConvMode -> ConvMode -> [ConvMode]
$cenumFromThenTo :: ConvMode -> ConvMode -> ConvMode -> [ConvMode]
enumFromThenTo :: ConvMode -> ConvMode -> ConvMode -> [ConvMode]
Enum)
fromConvDomain :: ConvDomain -> AFConvDomain
fromConvDomain :: ConvDomain -> AFConvDomain
fromConvDomain = CInt -> AFConvDomain
AFConvDomain (CInt -> AFConvDomain)
-> (ConvDomain -> CInt) -> ConvDomain -> AFConvDomain
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (ConvDomain -> Int) -> ConvDomain -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConvDomain -> Int
forall a. Enum a => a -> Int
fromEnum
toConvDomain :: AFConvDomain -> ConvDomain
toConvDomain :: AFConvDomain -> ConvDomain
toConvDomain (AFConvDomain (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> ConvDomain
forall a. Enum a => Int -> a
toEnum Int
x
fromConvMode :: AFConvMode -> ConvMode
fromConvMode :: AFConvMode -> ConvMode
fromConvMode (AFConvMode (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> ConvMode
forall a. Enum a => Int -> a
toEnum Int
x
toConvMode :: ConvMode -> AFConvMode
toConvMode :: ConvMode -> AFConvMode
toConvMode = CInt -> AFConvMode
AFConvMode (CInt -> AFConvMode)
-> (ConvMode -> CInt) -> ConvMode -> AFConvMode
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (ConvMode -> Int) -> ConvMode -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ConvMode -> Int
forall a. Enum a => a -> Int
fromEnum
data AFDType
= F32
| C32
| F64
| C64
| B8
| S32
| U32
| U8
| S64
| U64
| S16
| U16
deriving (Int -> AFDType -> ShowS
[AFDType] -> ShowS
AFDType -> [Char]
(Int -> AFDType -> ShowS)
-> (AFDType -> [Char]) -> ([AFDType] -> ShowS) -> Show AFDType
forall a.
(Int -> a -> ShowS) -> (a -> [Char]) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> AFDType -> ShowS
showsPrec :: Int -> AFDType -> ShowS
$cshow :: AFDType -> [Char]
show :: AFDType -> [Char]
$cshowList :: [AFDType] -> ShowS
showList :: [AFDType] -> ShowS
Show, AFDType -> AFDType -> Bool
(AFDType -> AFDType -> Bool)
-> (AFDType -> AFDType -> Bool) -> Eq AFDType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: AFDType -> AFDType -> Bool
== :: AFDType -> AFDType -> Bool
$c/= :: AFDType -> AFDType -> Bool
/= :: AFDType -> AFDType -> Bool
Eq, Int -> AFDType
AFDType -> Int
AFDType -> [AFDType]
AFDType -> AFDType
AFDType -> AFDType -> [AFDType]
AFDType -> AFDType -> AFDType -> [AFDType]
(AFDType -> AFDType)
-> (AFDType -> AFDType)
-> (Int -> AFDType)
-> (AFDType -> Int)
-> (AFDType -> [AFDType])
-> (AFDType -> AFDType -> [AFDType])
-> (AFDType -> AFDType -> [AFDType])
-> (AFDType -> AFDType -> AFDType -> [AFDType])
-> Enum AFDType
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
$csucc :: AFDType -> AFDType
succ :: AFDType -> AFDType
$cpred :: AFDType -> AFDType
pred :: AFDType -> AFDType
$ctoEnum :: Int -> AFDType
toEnum :: Int -> AFDType
$cfromEnum :: AFDType -> Int
fromEnum :: AFDType -> Int
$cenumFrom :: AFDType -> [AFDType]
enumFrom :: AFDType -> [AFDType]
$cenumFromThen :: AFDType -> AFDType -> [AFDType]
enumFromThen :: AFDType -> AFDType -> [AFDType]
$cenumFromTo :: AFDType -> AFDType -> [AFDType]
enumFromTo :: AFDType -> AFDType -> [AFDType]
$cenumFromThenTo :: AFDType -> AFDType -> AFDType -> [AFDType]
enumFromThenTo :: AFDType -> AFDType -> AFDType -> [AFDType]
Enum)
fromAFType :: AFDtype -> AFDType
fromAFType :: AFDtype -> AFDType
fromAFType (AFDtype (CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral -> Int
x)) = Int -> AFDType
forall a. Enum a => Int -> a
toEnum Int
x
toAFType :: AFDType -> AFDtype
toAFType :: AFDType -> AFDtype
toAFType = CInt -> AFDtype
AFDtype (CInt -> AFDtype) -> (AFDType -> CInt) -> AFDType -> AFDtype
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (AFDType -> Int) -> AFDType -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. AFDType -> Int
forall a. Enum a => a -> Int
fromEnum