haskell-igraph-0.6.0: Haskell interface of the igraph library.

Safe HaskellNone
LanguageHaskell2010

IGraph.Mutable

Synopsis

Documentation

newtype MGraph m (d :: EdgeType) v e Source #

Mutable labeled graph.

Constructors

MGraph IGraph 

new :: forall m d v e. (SingI d, PrimMonad m) => Int -> m (MGraph (PrimState m) d v e) Source #

Create a new graph.

nNodes :: PrimMonad m => MGraph (PrimState m) d v e -> m Int Source #

Return the number of nodes in a graph.

nEdges :: PrimMonad m => MGraph (PrimState m) d v e -> m Int Source #

Return the number of edges in a graph.

addNodes Source #

Arguments

:: PrimMonad m 
=> Int

The number of new nodes.

-> MGraph (PrimState m) d v e 
-> m () 

Add nodes to the graph.

addLNodes Source #

Arguments

:: (Serialize v, PrimMonad m) 
=> [v]

vertices' labels

-> MGraph (PrimState m) d v e 
-> m () 

Add nodes with labels to the graph.

delNodes :: PrimMonad m => [Int] -> MGraph (PrimState m) d v e -> m () Source #

Delete nodes from the graph.

addEdges :: PrimMonad m => [(Int, Int)] -> MGraph (PrimState m) d v e -> m () Source #

Add edges to the graph.

addLEdges :: (PrimMonad m, Serialize e) => [LEdge e] -> MGraph (PrimState m) d v e -> m () Source #

Add edges with labels to the graph.

delEdges :: forall m d v e. (SingI d, PrimMonad m) => [(Int, Int)] -> MGraph (PrimState m) d v e -> m () Source #

Delete edges from the graph.

setEdgeAttr Source #

Arguments

:: (PrimMonad m, Serialize e) 
=> Int

Edge id

-> e 
-> MGraph (PrimState m) d v e 
-> m () 

Set edge attribute.

setNodeAttr Source #

Arguments

:: (PrimMonad m, Serialize v) 
=> Int

Node id

-> v 
-> MGraph (PrimState m) d v e 
-> m () 

Set node attribute.