Commit a3958109 authored by Kai Zhang's avatar Kai Zhang

change function signature for cliques

parent 575555f5
...@@ -10,20 +10,20 @@ import IGraph ...@@ -10,20 +10,20 @@ import IGraph
import IGraph.Internal.Clique import IGraph.Internal.Clique
import IGraph.Internal.Data import IGraph.Internal.Data
cliques :: (Int, Int) -- ^ Minimum and maximum size of the cliques to be returned. cliques :: LGraph d v e
-> (Int, Int) -- ^ Minimum and maximum size of the cliques to be returned.
-- No bound will be used if negative or zero -- No bound will be used if negative or zero
-> LGraph d v e
-> [[Int]] -- ^ cliques represented by node ids -> [[Int]] -- ^ cliques represented by node ids
cliques (lo, hi) gr = unsafePerformIO $ do cliques gr (lo, hi) = unsafePerformIO $ do
vpptr <- igraphVectorPtrNew 0 vpptr <- igraphVectorPtrNew 0
_ <- igraphCliques (_graph gr) vpptr lo hi _ <- igraphCliques (_graph gr) vpptr lo hi
(map.map) truncate <$> vectorPPtrToList vpptr (map.map) truncate <$> vectorPPtrToList vpptr
maximalCliques :: (Int, Int) -- ^ Minimum and maximum size of the cliques to be returned. maximalCliques :: LGraph d v e
-> (Int, Int) -- ^ Minimum and maximum size of the cliques to be returned.
-- No bound will be used if negative or zero -- No bound will be used if negative or zero
-> LGraph d v e
-> [[Int]] -- ^ cliques represented by node ids -> [[Int]] -- ^ cliques represented by node ids
maximalCliques (lo, hi) gr = unsafePerformIO $ do maximalCliques gr (lo, hi) = unsafePerformIO $ do
vpptr <- igraphVectorPtrNew 0 vpptr <- igraphVectorPtrNew 0
_ <- igraphMaximalCliques (_graph gr) vpptr lo hi _ <- igraphMaximalCliques (_graph gr) vpptr lo hi
(map.map) truncate <$> vectorPPtrToList vpptr (map.map) truncate <$> vectorPPtrToList vpptr
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