Commit 46224148 authored by Kai Zhang's avatar Kai Zhang

upgrade to Cabal 1.24

parent 32e9bb7b
#include "IGraph/Internal/Selector.chs.h"
igraph_vit_t * __c2hs_wrapped__igraph_vit_new(const igraph_t * graph,
igraph_vs_t * vs)
{
return igraph_vit_new(graph, *vs);
}
igraph_eit_t * __c2hs_wrapped__igraph_eit_new(const igraph_t * graph,
igraph_es_t * es)
{
return igraph_eit_new(graph, *es);
}
int __c2hs_wrapped__igraph_delete_vertices(igraph_t * graph,
const igraph_vs_t * vertices)
{
return igraph_delete_vertices(graph, *vertices);
}
int __c2hs_wrapped__igraph_delete_edges(igraph_t * graph,
igraph_es_t * edges)
{
return igraph_delete_edges(graph, *edges);
}
#include "IGraph/Internal/Structure.chs.h"
int __c2hs_wrapped__igraph_personalized_pagerank(const igraph_t * graph,
igraph_pagerank_algo_t algo,
igraph_vector_t * vector,
igraph_real_t * value,
const igraph_vs_t * vids,
igraph_bool_t directed,
igraph_real_t damping,
igraph_vector_t * reset,
const igraph_vector_t * weights,
void * options)
{
return igraph_personalized_pagerank(graph,
algo,
vector,
value,
*vids,
directed,
damping,
reset,
weights,
options);
}
int __c2hs_wrapped__igraph_pagerank(const igraph_t * graph,
igraph_pagerank_algo_t algo,
igraph_vector_t * vector,
igraph_real_t * value,
const igraph_vs_t * vids,
igraph_bool_t directed,
igraph_real_t damping,
const igraph_vector_t * weights,
void * options)
{
return igraph_pagerank(graph,
algo,
vector,
value,
*vids,
directed,
damping,
weights,
options);
}
int __c2hs_wrapped__igraph_induced_subgraph(const igraph_t * graph,
igraph_t * res,
const igraph_vs_t * vids,
igraph_subgraph_implementation_t impl)
{
return igraph_induced_subgraph(graph, res, *vids, impl);
}
int __c2hs_wrapped__igraph_closeness(const igraph_t * graph,
igraph_vector_t * res,
const igraph_vs_t * vids,
igraph_neimode_t mode,
const igraph_vector_t * weights,
igraph_bool_t normalized)
{
return igraph_closeness(graph,
res,
*vids,
mode,
weights,
normalized);
}
int __c2hs_wrapped__igraph_betweenness(const igraph_t * graph,
igraph_vector_t * res,
const igraph_vs_t * vids,
igraph_bool_t directed,
const igraph_vector_t * weights,
igraph_bool_t nobigint)
{
return igraph_betweenness(graph,
res,
*vids,
directed,
weights,
nobigint);
}
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
-- documentation, see http://haskell.org/cabal/users-guide/ -- documentation, see http://haskell.org/cabal/users-guide/
name: haskell-igraph name: haskell-igraph
version: 0.1.0 version: 0.2.0
synopsis: Imcomplete igraph bindings synopsis: Imcomplete igraph bindings
description: This is an attempt to create a complete bindings for the description: This is an attempt to create a complete bindings for the
igraph<"http://igraph.org/c/"> library. Related work: igraph<"http://igraph.org/c/"> library. Related work:
...@@ -11,11 +11,10 @@ license: MIT ...@@ -11,11 +11,10 @@ license: MIT
license-file: LICENSE license-file: LICENSE
author: Kai Zhang author: Kai Zhang
maintainer: kai@kzhang.org maintainer: kai@kzhang.org
copyright: (c) 2015 Kai Zhang copyright: (c) 2016 Kai Zhang
category: Math category: Math
build-type: Simple build-type: Simple
extra-source-files: cbits/haskelligraph.c cabal-version: >=1.24
cabal-version: >=1.22
Flag graphics Flag graphics
Description: Enable graphics output Description: Enable graphics output
...@@ -72,8 +71,6 @@ library ...@@ -72,8 +71,6 @@ library
build-tools: c2hs >=0.25.0 build-tools: c2hs >=0.25.0
C-Sources: C-Sources:
cbits/haskelligraph.c cbits/haskelligraph.c
cbits/Selector.chs.c
cbits/Structure.chs.c
test-suite tests test-suite tests
type: exitcode-stdio-1.0 type: exitcode-stdio-1.0
......
...@@ -4,4 +4,4 @@ flags: ...@@ -4,4 +4,4 @@ flags:
packages: packages:
- '.' - '.'
extra-deps: [] extra-deps: []
resolver: lts-6.1 resolver: lts-7.0
...@@ -28,14 +28,14 @@ graphCreation = testGroup "Graph creation" ...@@ -28,14 +28,14 @@ graphCreation = testGroup "Graph creation"
] ]
where where
edgeList = sort $ unsafePerformIO $ randEdges 1000 100 edgeList = sort $ unsafePerformIO $ randEdges 1000 100
gr = mkGraph (100,Nothing) (edgeList, Nothing) :: LGraph D () () gr = mkGraph (replicate 100 ()) $ zip edgeList $ repeat () :: LGraph D () ()
simple = mkGraph (3,Nothing) ([(0,1),(1,2),(2,0)],Nothing) :: LGraph D () () simple = mkGraph (replicate 3 ()) $ zip [(0,1),(1,2),(2,0)] $ repeat () :: LGraph D () ()
graphEdit :: TestTree graphEdit :: TestTree
graphEdit = testGroup "Graph editing" graphEdit = testGroup "Graph editing"
[ testCase "" $ [(1,2)] @=? (sort $ edges simple') ] [ testCase "" $ [(1,2)] @=? (sort $ edges simple') ]
where where
simple = mkGraph (3,Nothing) ([(0,1),(1,2),(2,0)],Nothing) :: LGraph U () () simple = mkGraph (replicate 3 ()) $ zip [(0,1),(1,2),(2,0)] $ repeat () :: LGraph U () ()
simple' = runST $ do simple' = runST $ do
g <- thaw simple g <- thaw simple
delEdges [(0,1),(0,2)] g delEdges [(0,1),(0,2)] g
......
...@@ -27,7 +27,7 @@ subGraphs = testGroup "generate induced subgraphs" ...@@ -27,7 +27,7 @@ subGraphs = testGroup "generate induced subgraphs"
, ["a","c"], [("a","c"), ("c","a")] ) , ["a","c"], [("a","c"), ("c","a")] )
test (ori,ns,expect) = sort expect @=? sort result test (ori,ns,expect) = sort expect @=? sort result
where where
gr = fromLabeledEdges ori :: LGraph D String () gr = fromLabeledEdges $ zip ori $ repeat () :: LGraph D String ()
ns' = map (head . getNodes gr) ns ns' = map (head . getNodes gr) ns
gr' = inducedSubgraph gr ns' gr' = inducedSubgraph gr ns'
result = map (nodeLab gr' *** nodeLab gr') $ edges gr' result = map (nodeLab gr' *** nodeLab gr') $ edges gr'
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