packages feed

intmap-graph 1.0 → 1.0.0.1

raw patch · 2 files changed

+9/−5 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

intmap-graph.cabal view
@@ -1,5 +1,5 @@ name:                intmap-graph-version:             1.0+version:             1.0.0.1 Synopsis:            A graph library that allows to explore edges after their type Description:         It is easiest to explain this library with an example: A node has 300 outgoing edges, 100 red, 100 green, 100 blue. If you want to explore all green edges, most of the other graph libraries force you to look up all 300 edges and then filter after the property green. This means 300 O(log n) calls. With this library there is only one (log n) call necessary that gives a list of all green edges. homepage:            https://github.com/tkvogt/intmap-graph#readme@@ -8,7 +8,7 @@ author:              Tillmann Vogt maintainer:          tillk.vogt@gmail.com copyright:           2019 Tillmann Vogt-category:            Web+category:            graphs build-type:          Simple extra-source-files:  README.md cabal-version:       >=1.10
src/Graph/IntMap.hs view
@@ -5,9 +5,12 @@  License     :  BSD-style (see the file LICENSE) Maintainer  :  Tillmann Vogt <tillk.vogt@gmail.com>-Stability   :  provisional-Portability :  POSIX+Stability   :  stable+Portability :  GHC +The general idea of this library is that edges can put into classes. +As it is faster to lookup a 32/64-bit integer in an intmap than a tuple of integers in a Data.Map-map, we construct a graph by putting a node (24 bit) and its class (8 bit) of adjacent nodes into a 32 bit integer. We need to restrict it to 32 bit, because Javascript (and therefore GHCJS) only has 32 bit integers. If you want to use this library outside of a browser, use 64 bit and set the bool arg of some functions to False. Then there are 32 bits for the node and 32 bits for the edge class.+ -} module Graph.IntMap (     EdgeAttribute(..), Graph(..), ExtractNodeType(..),@@ -105,7 +108,8 @@          "}\n" ++          "\nincoming\ndigraph graphviz {\n"++          concat (zipWith3 lines nodeOrigins1 edges1 nodeDests1) ++-         "}\n\n nodes\n" ++ show nlGraph ++ "\n\n edges\n" ++ show elGraph+         "}\n\n nodes\n" ++ concat (map ((++"\n"). show) (I.toList nlGraph)) +++         "\n\n edges\n" ++ concat (map ((++"\n"). show) (Map.toList  elGraph))     where       nodeOrigins0 = map (if b then extractFirstWord24 . fromIntegral                                else extractFirstWord32 . fromIntegral)