Copyright | (C) 2014 Hugo Pacheco |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Hugo Pacheco <hpacheco@nii.ac.jp> |
Stability | provisional |
Safe Haskell | None |
Language | Haskell98 |
Random graph generation examples.
- type Vertex = Int
- type Edges = [Vertex]
- type Graph = [(Vertex, Edges)]
- genGraph :: Int -> Int -> Gen Graph
- genGraph' :: [Int] -> [(Int, Int)] -> Graph
- genEdges :: [Int] -> Int -> Gen [(Int, Int)]
- genEdge :: [Int] -> Gen (Int, Int)
- deleteVertex :: Monad m => Vertex -> PutlensM m Graph Graph
- testDelete :: Graph
- genGraphPut :: PutlensM (MaybeT Gen) Graph (Int, Int)
- edgesPut :: PutlensM (MaybeT Gen) Graph Int
- lengthEdgesFromPut :: PutlensM (ReaderT [Vertex] (MaybeT Gen)) [Vertex] Int
- verticesPut :: PutlensM (MaybeT Gen) Graph [Vertex]
- lengthVerticesPut :: PutlensM (MaybeT Gen) [Vertex] Int
- sumEdgesPut :: PutlensM (ReaderT [Vertex] (MaybeT Gen)) [Int] Int
- exg :: [(Vertex, [Vertex])]
- testGraph :: IO (Maybe Graph)
- testSum :: IO (Maybe [Int])
- anyint :: Gen Int
- positiveint :: Gen Int
Documentation
sumEdgesPut :: PutlensM (ReaderT [Vertex] (MaybeT Gen)) [Int] Int Source
Updates the sum of a list (distributes the difference by dividing it by the length of the original list, always preserving the size of the original list even when the view is zero) the source always contains positive numbers
positiveint :: Gen Int Source