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

Safe HaskellNone
LanguageHaskell2010

IGraph.Internal

Contents

Synopsis

Data structure library: vector, matrix, other data types

Igraph vector type and basic operations

allocaVector :: (Ptr Vector -> IO a) -> IO a Source #

Allocate and initialize a vector.

allocaVectorN :: Int -> (Ptr Vector -> IO a) -> IO a Source #

withList :: Real a => [a] -> (Ptr Vector -> IO b) -> IO b Source #

withListMaybe :: Real a => Maybe [a] -> (Ptr Vector -> IO b) -> IO b Source #

Allocate a nullPtr if Nothing

Igraph pointer vector

allocaVectorPtr :: (Ptr VectorPtr -> IO a) -> IO a Source #

Allocate and initialize a pointer vector.

withPtrs :: [Ptr a] -> (Ptr VectorPtr -> IO b) -> IO b Source #

Customized bytestring for storing attributes

Customized bytestring vector

Igraph matrix type

allocaMatrixN Source #

Arguments

:: Int

Number of rows

-> Int

Number of columns

-> (Ptr Matrix -> IO a) 
-> IO a 

withRowLists :: Real a => [[a]] -> (Ptr Matrix -> IO b) -> IO b Source #

Igraph type and constructors

withIGraph :: IGraph -> (Ptr IGraph -> IO b) -> IO b Source #

igraphNew :: Int -> Bool -> HasInit -> IO IGraph Source #

Create a igraph object and attach a finalizer

igraphCreate Source #

Arguments

:: Ptr Vector

The edges to add, the first two elements are the first edge, etc.

-> Int

The number of vertices in the graph, if smaller or equal to the highest vertex id in the edges vector it will be increased automatically. So it is safe to give 0 here.

-> Bool

Whether to create a directed graph or not. If yes, then the first edge points from the first vertex id in edges to the second, etc.

-> IO IGraph 

Selector and iterator for edge and vertex

Igraph vertex selector

withVerticesList :: Real a => [a] -> (Ptr VertexSelector -> IO b) -> IO b Source #

Igraph vertex iterator

Igraph edge Selector

Igraph edge iterator

Basic graph operations

igraphAddEdges Source #

Arguments

:: IGraph

The graph to which the edges will be added.

-> Ptr Vector

The edges themselves.

-> Ptr ()

The attributes of the new edges.

-> IO () 

The edges are given in a vector, the first two elements define the first edge (the order is from , to for directed graphs). The vector should contain even number of integer numbers between zero and the number of vertices in the graph minus one (inclusive). If you also want to add new vertices, call igraph_add_vertices() first.

Igraph attribute record

withAttr Source #

Arguments

:: Serialize a 
=> String

Attribute name

-> [a]

Attributes

-> (Ptr AttributeRecord -> IO b) 
-> IO b 

withBSAttr Source #

Arguments

:: String

Attribute name

-> Ptr BSVector

Attributes

-> (Ptr AttributeRecord -> IO b) 
-> IO b 

igraphHaskellAttributeHasAttr Source #

Arguments

:: IGraph 
-> AttributeElemtype

The type of the attribute

-> String

The name of the attribute

-> IO Bool 

Checks whether a (graph, vertex or edge) attribute exists

igraphHaskellAttributeVAS Source #

Arguments

:: IGraph 
-> String

The name of the attribute

-> Int

The id of the queried vertex

-> IO (Ptr BSLen) 

Query a string vertex attribute

igraphHaskellAttributeEAS Source #

Arguments

:: IGraph 
-> String

The name of the attribute

-> Int

The id of the queried edge

-> IO (Ptr BSLen) 

Query a string edge attribute.

igraphHaskellAttributeVASSetv Source #

Arguments

:: IGraph 
-> String

Name of the attribute

-> Ptr BSVector

String vector, the new attribute values. The length of this vector must match the number of vertices.

-> IO () 

igraphHaskellAttributeEASSet Source #

Arguments

:: IGraph 
-> String

The name of the attribute

-> Int

The id of the queried vertex

-> Ptr BSLen

The (new) value of the attribute.

-> IO () 

Set a string edge attribute.

igraphHaskellAttributeEASSetv Source #

Arguments

:: IGraph 
-> String

Name of the attribute

-> Ptr BSVector

String vector, the new attribute values. The length of this vector must match the number of edges.

-> IO () 

Set a string edge attribute for all edges.

Igraph arpack options type