Safe Haskell | None |
---|---|
Language | Haskell2010 |
- barabasiAlbertGraph :: GenIO -> Int -> Int -> IO GraphInfo
- barabasiAlbertGraph' :: Int -> Int -> IO GraphInfo
- selectNth :: Int -> [(Int, Int)] -> Int
- selectRandomElement :: GenIO -> (IntMultiSet, Int) -> IO Int
- selectNDistinctRandomElements :: GenIO -> Int -> (IntMultiSet, Int) -> IO [Int]
Graph generators
Utility functions
selectNth :: Int -> [(Int, Int)] -> Int Source
Select the nth element from a multiset occur list, treating it as virtual large list This is significantly faster than building up the entire list and selecting the nth element
selectRandomElement :: GenIO -> (IntMultiSet, Int) -> IO Int Source
Select a single random element from the multiset, with precalculated size Note that the given size must be the total multiset size, not the number of distinct elements in said se
selectNDistinctRandomElements :: GenIO -> Int -> (IntMultiSet, Int) -> IO [Int] Source
Select n distinct random elements from a multiset, with This function will fail to terminate if there are less than n distinct elements in the multiset. This function accepts a multiset with precomputed size for performance reasons