Commit 055a3114 authored by Kai Zhang's avatar Kai Zhang

v0.5.0

parent e3f55c20
Revision history for haskell-igraph
===================================
v0.4.* --
v0.5.0 -- 2018-04-25
-------------------
* Fix memory leaks.
* Interface change: `mapNodes`, `mapEdges`, `filterNodes`, `filterEdges` become
`nmap`, `emap`, `nfilter`, `efilter`.
v0.4.0 -- 2018-04-20
......
name: haskell-igraph
version: 0.4.0
version: 0.5.0
synopsis: Haskell interface of the igraph library.
description: igraph<"http://igraph.org/c/"> is a library for creating
and manipulating large graphs. This package provides the Haskell
......
......@@ -4,8 +4,6 @@ module IGraph.Mutable
, MLGraph(..)
, setEdgeAttr
, setNodeAttr
, edgeAttr
, vertexAttr
)where
import Control.Monad (when, forM)
......@@ -17,12 +15,6 @@ import IGraph.Internal
import IGraph.Internal.Initialization
import IGraph.Types
vertexAttr :: String
vertexAttr = "vertex_attribute"
edgeAttr :: String
edgeAttr = "edge_attribute"
-- | Mutable labeled graph.
newtype MLGraph m d v e = MLGraph IGraph
......
......@@ -29,12 +29,8 @@ inducedSubgraph :: (Hashable v, Eq v, Serialize v) => LGraph d v e -> [Int] -> L
inducedSubgraph gr vs = unsafePerformIO $ do
vs' <- fromList $ map fromIntegral vs
vsptr <- igraphVsVector vs'
g' <- igraphInducedSubgraph (_graph gr) vsptr IgraphSubgraphCreateFromScratch
nV <- igraphVcount g'
labels <- forM [0 .. nV - 1] $ \i ->
igraphHaskellAttributeVAS g' vertexAttr i >>= bsToByteString >>=
return . fromRight (error "decode failed") . decode
return $ LGraph g' $ M.fromListWith (++) $ zip labels $ map return [0..nV-1]
igraphInducedSubgraph (_graph gr) vsptr IgraphSubgraphCreateFromScratch >>=
unsafeFreeze . MLGraph
-- | Closeness centrality
closeness :: [Int] -- ^ vertices
......
......@@ -12,3 +12,9 @@ data U
-- | Directed graph.
data D
vertexAttr :: String
vertexAttr = "vertex_attribute"
edgeAttr :: String
edgeAttr = "edge_attribute"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment