{-# LINE 1 "src/IGraph/Internal/Constants.chs" #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module IGraph.Internal.Constants where
data Neimode = IgraphOut
| IgraphIn
| IgraphAll
| IgraphTotal
deriving (Show,Eq)
instance Enum Neimode where
succ IgraphOut = IgraphIn
succ IgraphIn = IgraphAll
succ IgraphAll = error "Neimode.succ: IgraphAll has no successor"
succ IgraphTotal = error "Neimode.succ: IgraphTotal has no successor"
pred IgraphIn = IgraphOut
pred IgraphAll = IgraphIn
pred IgraphTotal = IgraphIn
pred IgraphOut = error "Neimode.pred: IgraphOut has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphTotal
fromEnum IgraphOut = 1
fromEnum IgraphIn = 2
fromEnum IgraphAll = 3
fromEnum IgraphTotal = 3
toEnum 1 = IgraphOut
toEnum 2 = IgraphIn
toEnum 3 = IgraphAll
toEnum unmatched = error ("Neimode.toEnum: Cannot match " ++ show unmatched)
{-# LINE 7 "src/IGraph/Internal/Constants.chs" #-}
data EdgeOrderType = IgraphEdgeorderId
| IgraphEdgeorderFrom
| IgraphEdgeorderTo
deriving (Show,Eq)
instance Enum EdgeOrderType where
succ IgraphEdgeorderId = IgraphEdgeorderFrom
succ IgraphEdgeorderFrom = IgraphEdgeorderTo
succ IgraphEdgeorderTo = error "EdgeOrderType.succ: IgraphEdgeorderTo has no successor"
pred IgraphEdgeorderFrom = IgraphEdgeorderId
pred IgraphEdgeorderTo = IgraphEdgeorderFrom
pred IgraphEdgeorderId = error "EdgeOrderType.pred: IgraphEdgeorderId has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphEdgeorderTo
fromEnum IgraphEdgeorderId = 0
fromEnum IgraphEdgeorderFrom = 1
fromEnum IgraphEdgeorderTo = 2
toEnum 0 = IgraphEdgeorderId
toEnum 1 = IgraphEdgeorderFrom
toEnum 2 = IgraphEdgeorderTo
toEnum unmatched = error ("EdgeOrderType.toEnum: Cannot match " ++ show unmatched)
{-# LINE 10 "src/IGraph/Internal/Constants.chs" #-}
data SpincommUpdate = IgraphSpincommUpdateSimple
| IgraphSpincommUpdateConfig
deriving (Show,Eq)
instance Enum SpincommUpdate where
succ IgraphSpincommUpdateSimple = IgraphSpincommUpdateConfig
succ IgraphSpincommUpdateConfig = error "SpincommUpdate.succ: IgraphSpincommUpdateConfig has no successor"
pred IgraphSpincommUpdateConfig = IgraphSpincommUpdateSimple
pred IgraphSpincommUpdateSimple = error "SpincommUpdate.pred: IgraphSpincommUpdateSimple has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphSpincommUpdateConfig
fromEnum IgraphSpincommUpdateSimple = 0
fromEnum IgraphSpincommUpdateConfig = 1
toEnum 0 = IgraphSpincommUpdateSimple
toEnum 1 = IgraphSpincommUpdateConfig
toEnum unmatched = error ("SpincommUpdate.toEnum: Cannot match " ++ show unmatched)
{-# LINE 13 "src/IGraph/Internal/Constants.chs" #-}
data SpinglassImplementation = IgraphSpincommImpOrig
| IgraphSpincommImpNeg
deriving (Show,Eq)
instance Enum SpinglassImplementation where
succ IgraphSpincommImpOrig = IgraphSpincommImpNeg
succ IgraphSpincommImpNeg = error "SpinglassImplementation.succ: IgraphSpincommImpNeg has no successor"
pred IgraphSpincommImpNeg = IgraphSpincommImpOrig
pred IgraphSpincommImpOrig = error "SpinglassImplementation.pred: IgraphSpincommImpOrig has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphSpincommImpNeg
fromEnum IgraphSpincommImpOrig = 0
fromEnum IgraphSpincommImpNeg = 1
toEnum 0 = IgraphSpincommImpOrig
toEnum 1 = IgraphSpincommImpNeg
toEnum unmatched = error ("SpinglassImplementation.toEnum: Cannot match " ++ show unmatched)
{-# LINE 16 "src/IGraph/Internal/Constants.chs" #-}
data AttributeElemtype = IgraphAttributeGraph
| IgraphAttributeVertex
| IgraphAttributeEdge
deriving (Show,Eq)
instance Enum AttributeElemtype where
succ IgraphAttributeGraph = IgraphAttributeVertex
succ IgraphAttributeVertex = IgraphAttributeEdge
succ IgraphAttributeEdge = error "AttributeElemtype.succ: IgraphAttributeEdge has no successor"
pred IgraphAttributeVertex = IgraphAttributeGraph
pred IgraphAttributeEdge = IgraphAttributeVertex
pred IgraphAttributeGraph = error "AttributeElemtype.pred: IgraphAttributeGraph has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphAttributeEdge
fromEnum IgraphAttributeGraph = 0
fromEnum IgraphAttributeVertex = 1
fromEnum IgraphAttributeEdge = 2
toEnum 0 = IgraphAttributeGraph
toEnum 1 = IgraphAttributeVertex
toEnum 2 = IgraphAttributeEdge
toEnum unmatched = error ("AttributeElemtype.toEnum: Cannot match " ++ show unmatched)
{-# LINE 19 "src/IGraph/Internal/Constants.chs" #-}
data SubgraphImplementation = IgraphSubgraphAuto
| IgraphSubgraphCopyAndDelete
| IgraphSubgraphCreateFromScratch
deriving (Show,Read,Eq)
instance Enum SubgraphImplementation where
succ IgraphSubgraphAuto = IgraphSubgraphCopyAndDelete
succ IgraphSubgraphCopyAndDelete = IgraphSubgraphCreateFromScratch
succ IgraphSubgraphCreateFromScratch = error "SubgraphImplementation.succ: IgraphSubgraphCreateFromScratch has no successor"
pred IgraphSubgraphCopyAndDelete = IgraphSubgraphAuto
pred IgraphSubgraphCreateFromScratch = IgraphSubgraphCopyAndDelete
pred IgraphSubgraphAuto = error "SubgraphImplementation.pred: IgraphSubgraphAuto has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphSubgraphCreateFromScratch
fromEnum IgraphSubgraphAuto = 0
fromEnum IgraphSubgraphCopyAndDelete = 1
fromEnum IgraphSubgraphCreateFromScratch = 2
toEnum 0 = IgraphSubgraphAuto
toEnum 1 = IgraphSubgraphCopyAndDelete
toEnum 2 = IgraphSubgraphCreateFromScratch
toEnum unmatched = error ("SubgraphImplementation.toEnum: Cannot match " ++ show unmatched)
{-# LINE 22 "src/IGraph/Internal/Constants.chs" #-}
data PagerankAlgo = IgraphPagerankAlgoPower
| IgraphPagerankAlgoArpack
| IgraphPagerankAlgoPrpack
deriving (Show,Read,Eq)
instance Enum PagerankAlgo where
succ IgraphPagerankAlgoPower = IgraphPagerankAlgoArpack
succ IgraphPagerankAlgoArpack = IgraphPagerankAlgoPrpack
succ IgraphPagerankAlgoPrpack = error "PagerankAlgo.succ: IgraphPagerankAlgoPrpack has no successor"
pred IgraphPagerankAlgoArpack = IgraphPagerankAlgoPower
pred IgraphPagerankAlgoPrpack = IgraphPagerankAlgoArpack
pred IgraphPagerankAlgoPower = error "PagerankAlgo.pred: IgraphPagerankAlgoPower has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphPagerankAlgoPrpack
fromEnum IgraphPagerankAlgoPower = 0
fromEnum IgraphPagerankAlgoArpack = 1
fromEnum IgraphPagerankAlgoPrpack = 2
toEnum 0 = IgraphPagerankAlgoPower
toEnum 1 = IgraphPagerankAlgoArpack
toEnum 2 = IgraphPagerankAlgoPrpack
toEnum unmatched = error ("PagerankAlgo.toEnum: Cannot match " ++ show unmatched)
{-# LINE 25 "src/IGraph/Internal/Constants.chs" #-}
data ErdosRenyi = IgraphErdosRenyiGnp
| IgraphErdosRenyiGnm
deriving (Show,Read,Eq)
instance Enum ErdosRenyi where
succ IgraphErdosRenyiGnp = IgraphErdosRenyiGnm
succ IgraphErdosRenyiGnm = error "ErdosRenyi.succ: IgraphErdosRenyiGnm has no successor"
pred IgraphErdosRenyiGnm = IgraphErdosRenyiGnp
pred IgraphErdosRenyiGnp = error "ErdosRenyi.pred: IgraphErdosRenyiGnp has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphErdosRenyiGnm
fromEnum IgraphErdosRenyiGnp = 0
fromEnum IgraphErdosRenyiGnm = 1
toEnum 0 = IgraphErdosRenyiGnp
toEnum 1 = IgraphErdosRenyiGnm
toEnum unmatched = error ("ErdosRenyi.toEnum: Cannot match " ++ show unmatched)
{-# LINE 28 "src/IGraph/Internal/Constants.chs" #-}
data Rewiring = IgraphRewiringSimple
| IgraphRewiringSimpleLoops
deriving (Show,Read,Eq)
instance Enum Rewiring where
succ IgraphRewiringSimple = IgraphRewiringSimpleLoops
succ IgraphRewiringSimpleLoops = error "Rewiring.succ: IgraphRewiringSimpleLoops has no successor"
pred IgraphRewiringSimpleLoops = IgraphRewiringSimple
pred IgraphRewiringSimple = error "Rewiring.pred: IgraphRewiringSimple has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphRewiringSimpleLoops
fromEnum IgraphRewiringSimple = 0
fromEnum IgraphRewiringSimpleLoops = 1
toEnum 0 = IgraphRewiringSimple
toEnum 1 = IgraphRewiringSimpleLoops
toEnum unmatched = error ("Rewiring.toEnum: Cannot match " ++ show unmatched)
{-# LINE 31 "src/IGraph/Internal/Constants.chs" #-}
data Degseq = IgraphDegseqSimple
| IgraphDegseqVl
| IgraphDegseqSimpleNoMultiple
deriving (Show,Read,Eq)
instance Enum Degseq where
succ IgraphDegseqSimple = IgraphDegseqVl
succ IgraphDegseqVl = IgraphDegseqSimpleNoMultiple
succ IgraphDegseqSimpleNoMultiple = error "Degseq.succ: IgraphDegseqSimpleNoMultiple has no successor"
pred IgraphDegseqVl = IgraphDegseqSimple
pred IgraphDegseqSimpleNoMultiple = IgraphDegseqVl
pred IgraphDegseqSimple = error "Degseq.pred: IgraphDegseqSimple has no predecessor"
enumFromTo from to = go from
where
end = fromEnum to
go v = case compare (fromEnum v) end of
LT -> v : go (succ v)
EQ -> [v]
GT -> []
enumFrom from = enumFromTo from IgraphDegseqSimpleNoMultiple
fromEnum IgraphDegseqSimple = 0
fromEnum IgraphDegseqVl = 1
fromEnum IgraphDegseqSimpleNoMultiple = 2
toEnum 0 = IgraphDegseqSimple
toEnum 1 = IgraphDegseqVl
toEnum 2 = IgraphDegseqSimpleNoMultiple
toEnum unmatched = error ("Degseq.toEnum: Cannot match " ++ show unmatched)
{-# LINE 34 "src/IGraph/Internal/Constants.chs" #-}