Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Vector
- allocaVector :: (Ptr Vector -> IO a) -> IO a
- allocaVectorN :: Int -> (Ptr Vector -> IO a) -> IO a
- withList :: Real a => [a] -> (Ptr Vector -> IO b) -> IO b
- withListMaybe :: Real a => Maybe [a] -> (Ptr Vector -> IO b) -> IO b
- toList :: Ptr Vector -> IO [Double]
- igraphVectorNull :: Ptr Vector -> IO ()
- igraphVectorFill :: Ptr Vector -> Double -> IO ()
- igraphVectorE :: Ptr Vector -> Int -> IO Double
- igraphVectorSet :: Ptr Vector -> Int -> Double -> IO ()
- igraphVectorTail :: Ptr Vector -> IO Double
- igraphVectorSize :: Ptr Vector -> IO Int
- igraphVectorCopyTo :: Ptr Vector -> Ptr CDouble -> IO ()
- data VectorPtr
- allocaVectorPtr :: (Ptr VectorPtr -> IO a) -> IO a
- allocaVectorPtrN :: Int -> (Ptr VectorPtr -> IO a) -> IO a
- withPtrs :: [Ptr a] -> (Ptr VectorPtr -> IO b) -> IO b
- toLists :: Ptr VectorPtr -> IO [[Double]]
- igraphVectorPtrSize :: Ptr VectorPtr -> IO Int
- igraphVectorPtrE :: Ptr VectorPtr -> Int -> IO (Ptr ())
- igraphVectorPtrSet :: Ptr VectorPtr -> Int -> Ptr () -> IO ()
- data BSLen
- withByteString :: ByteString -> (Ptr BSLen -> IO a) -> IO a
- toByteString :: Ptr BSLen -> IO ByteString
- data BSVector
- allocaBSVectorN :: Int -> (Ptr BSVector -> IO a) -> IO a
- withByteStrings :: [ByteString] -> (Ptr BSVector -> IO a) -> IO a
- bsvectorSet :: Ptr BSVector -> Int -> ByteString -> IO ()
- data Matrix
- allocaMatrix :: (Ptr Matrix -> IO a) -> IO a
- allocaMatrixN :: Int -> Int -> (Ptr Matrix -> IO a) -> IO a
- withRowLists :: Real a => [[a]] -> (Ptr Matrix -> IO b) -> IO b
- toRowLists :: Ptr Matrix -> IO [[Double]]
- toColumnLists :: Ptr Matrix -> IO [[Double]]
- igraphMatrixNull :: Ptr Matrix -> IO ()
- igraphMatrixFill :: Ptr Matrix -> Double -> IO ()
- igraphMatrixE :: Ptr Matrix -> Int -> Int -> IO Double
- igraphMatrixSet :: Ptr Matrix -> Int -> Int -> Double -> IO ()
- igraphMatrixCopyTo :: Ptr Matrix -> Ptr CDouble -> IO ()
- igraphMatrixNrow :: Ptr Matrix -> IO Int
- igraphMatrixNcol :: Ptr Matrix -> IO Int
- data IGraph
- withIGraph :: IGraph -> (Ptr IGraph -> IO b) -> IO b
- allocaIGraph :: (Ptr IGraph -> IO a) -> IO a
- addIGraphFinalizer :: Ptr IGraph -> IO IGraph
- mkLabelToId :: (Ord v, Serialize v) => IGraph -> Map v [Int]
- initializeNullAttribute :: PrimMonad m => IGraph -> m ()
- igraphNew :: Int -> Bool -> HasInit -> IO IGraph
- igraphCreate :: Ptr Vector -> Int -> Bool -> IO IGraph
- igraphIsSimple :: IGraph -> IO Bool
- igraphHasMultiple :: IGraph -> IO Bool
- data VertexSelector
- withVerticesAll :: (Ptr VertexSelector -> IO a) -> IO a
- withVerticesAdj :: Int -> Neimode -> (Ptr VertexSelector -> IO a) -> IO a
- withVerticesVector :: Ptr Vector -> (Ptr VertexSelector -> IO a) -> IO a
- withVerticesList :: Real a => [a] -> (Ptr VertexSelector -> IO b) -> IO b
- data VertexIterator
- iterateVertices :: IGraph -> Ptr VertexSelector -> (Ptr VertexIterator -> IO a) -> IO a
- iterateVerticesC :: IGraph -> Ptr VertexSelector -> (ConduitT i Int IO () -> IO a) -> IO a
- data EdgeSelector
- withEdgesAll :: EdgeOrderType -> (Ptr EdgeSelector -> IO a) -> IO a
- withEdgeIdsVector :: Ptr Vector -> (Ptr EdgeSelector -> IO a) -> IO a
- withEdgeIdsList :: [Int] -> (Ptr EdgeSelector -> IO b) -> IO b
- data EdgeIterator
- iterateEdges :: IGraph -> Ptr EdgeSelector -> (Ptr EdgeIterator -> IO a) -> IO a
- iterateEdgesC :: IGraph -> Ptr EdgeSelector -> (ConduitT i Int IO () -> IO a) -> IO a
- igraphCopy :: IGraph -> IO IGraph
- igraphVcount :: IGraph -> IO Int
- igraphEcount :: IGraph -> IO Int
- igraphGetEid :: IGraph -> Int -> Int -> Bool -> Bool -> IO Int
- igraphEdge :: IGraph -> Int -> IO (Int, Int)
- igraphAddVertices :: IGraph -> Int -> Ptr () -> IO ()
- igraphAddEdge :: IGraph -> Int -> Int -> IO ()
- igraphAddEdges :: IGraph -> Ptr Vector -> Ptr () -> IO ()
- igraphDeleteVertices :: IGraph -> Ptr VertexSelector -> IO ()
- igraphDeleteEdges :: IGraph -> Ptr EdgeSelector -> IO ()
- data AttributeRecord
- withAttr :: Serialize a => String -> [a] -> (Ptr AttributeRecord -> IO b) -> IO b
- withBSAttr :: String -> Ptr BSVector -> (Ptr AttributeRecord -> IO b) -> IO b
- igraphHaskellAttributeHasAttr :: IGraph -> AttributeElemtype -> String -> IO Bool
- igraphHaskellAttributeVAS :: IGraph -> String -> Int -> IO (Ptr BSLen)
- igraphHaskellAttributeEAS :: IGraph -> String -> Int -> IO (Ptr BSLen)
- igraphHaskellAttributeVASSet :: IGraph -> String -> Int -> Ptr BSLen -> IO ()
- igraphHaskellAttributeVASSetv :: IGraph -> String -> Ptr BSVector -> IO ()
- igraphHaskellAttributeEASSet :: IGraph -> String -> Int -> Ptr BSLen -> IO ()
- igraphHaskellAttributeEASSetv :: IGraph -> String -> Ptr BSVector -> IO ()
- data ArpackOpt
- allocaArpackOpt :: (Ptr ArpackOpt -> IO a) -> IO a
Data structure library: vector, matrix, other data types
Igraph vector type and basic operations
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.
Customized bytestring for storing attributes
withByteString :: ByteString -> (Ptr BSLen -> IO a) -> IO a Source #
toByteString :: Ptr BSLen -> IO ByteString Source #
Customized bytestring vector
withByteStrings :: [ByteString] -> (Ptr BSVector -> IO a) -> IO a Source #
bsvectorSet :: Ptr BSVector -> Int -> ByteString -> IO () Source #
Igraph matrix type
Igraph type and constructors
initializeNullAttribute :: PrimMonad m => IGraph -> m () Source #
igraphNew :: Int -> Bool -> HasInit -> IO IGraph Source #
Create a igraph object and attach a finalizer
:: 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 |
igraphIsSimple :: IGraph -> IO Bool Source #
A graph is a simple graph if it does not contain loop edges and multiple edges.
Selector and iterator for edge and vertex
Igraph vertex selector
data VertexSelector Source #
withVerticesAll :: (Ptr VertexSelector -> IO a) -> IO a Source #
withVerticesAdj :: Int -> Neimode -> (Ptr VertexSelector -> IO a) -> IO a Source #
withVerticesVector :: Ptr Vector -> (Ptr VertexSelector -> IO a) -> IO a Source #
withVerticesList :: Real a => [a] -> (Ptr VertexSelector -> IO b) -> IO b Source #
Igraph vertex iterator
data VertexIterator Source #
iterateVertices :: IGraph -> Ptr VertexSelector -> (Ptr VertexIterator -> IO a) -> IO a Source #
Igraph edge Selector
data EdgeSelector Source #
withEdgesAll :: EdgeOrderType -> (Ptr EdgeSelector -> IO a) -> IO a Source #
withEdgeIdsVector :: Ptr Vector -> (Ptr EdgeSelector -> IO a) -> IO a Source #
withEdgeIdsList :: [Int] -> (Ptr EdgeSelector -> IO b) -> IO b Source #
Igraph edge iterator
data EdgeIterator Source #
iterateEdges :: IGraph -> Ptr EdgeSelector -> (Ptr EdgeIterator -> IO a) -> IO a Source #
Basic graph operations
:: 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.
igraphDeleteVertices :: IGraph -> Ptr VertexSelector -> IO () Source #
delete vertices
igraphDeleteEdges :: IGraph -> Ptr EdgeSelector -> IO () Source #
delete edges
Igraph attribute record
data AttributeRecord Source #
igraphHaskellAttributeHasAttr Source #
:: 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 #
Query a string vertex attribute
igraphHaskellAttributeEAS Source #
Query a string edge attribute.
igraphHaskellAttributeEASSet Source #
:: 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 #
:: 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.