diff --git a/build/pkgs/bliss/checksums.ini b/build/pkgs/bliss/checksums.ini index e97d89587b..0c1ebf647b 100644 --- a/build/pkgs/bliss/checksums.ini +++ b/build/pkgs/bliss/checksums.ini @@ -1,4 +1,5 @@ -tarball=bliss-VERSION.tar.gz -sha1=1da8f098046824fbfff4c64c337e28b2a082f74f -md5=452aea8737d3c4ad0d8ff39180be8004 -cksum=2193930007 +tarball=bliss-VERSION.zip +sha1=c91c9dcbc11d66ffbcf6415e09ebe793df37be2a +md5=5707cbfd9fd00980571c64ab3584c505 +cksum=1626493724 +upstream_url=https://users.aalto.fi/~tjunttil/bliss/downloads/bliss-VERSION.zip diff --git a/build/pkgs/bliss/dependencies b/build/pkgs/bliss/dependencies index 4f00de2037..c225c495cc 100644 --- a/build/pkgs/bliss/dependencies +++ b/build/pkgs/bliss/dependencies @@ -1,4 +1,4 @@ -# no dependencies +| cmake ---------- All lines of this file are ignored except the first. diff --git a/build/pkgs/bliss/package-version.txt b/build/pkgs/bliss/package-version.txt index e93ee1376f..9e1e206c41 100644 --- a/build/pkgs/bliss/package-version.txt +++ b/build/pkgs/bliss/package-version.txt @@ -1 +1 @@ -0.73+debian-1+sage-2016-08-02.p0 +0.77 diff --git a/build/pkgs/bliss/spkg-install.in b/build/pkgs/bliss/spkg-install.in index aaf4c3037b..4124a2338e 100644 --- a/build/pkgs/bliss/spkg-install.in +++ b/build/pkgs/bliss/spkg-install.in @@ -1,4 +1,4 @@ cd src -sdh_configure --disable-gmp +sdh_cmake -DUSE_GMP=OFF -DCMAKE_VERBOSE_MAKEFILE=ON sdh_make sdh_make_install diff --git a/build/pkgs/bliss/spkg-src b/build/pkgs/bliss/spkg-src deleted file mode 100755 index 90073233b7..0000000000 --- a/build/pkgs/bliss/spkg-src +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh -# -# creates the tarball in the current dir, to be moved to ../../../upstream -# -# adapted from cliquer/spkg-src - -die () { - echo >&2 "$@" - exit 1 -} - -rm -rf bliss/ -git clone -b sage_package https://github.com/mkoeppe/bliss.git || die "Failed to git clone" -cd bliss/ - -VERSION=`autoconf --trace='AC_INIT:$2'` -libtoolize || die "Failed to autoreconf" -autoreconf -fi || die "Failed to autoreconf" -automake --add-missing --copy || die "automake failed" -./configure || die "configure failed" - -rm -f bliss-$VERSION.tar.gz -make dist || die "make dist failed" -mv bliss-$VERSION.tar.gz ../ -cd .. -rm -rf bliss/ - - diff --git a/src/sage/graphs/bliss.pyx b/src/sage/graphs/bliss.pyx index 921bc6a765..1f1f502558 100644 --- a/src/sage/graphs/bliss.pyx +++ b/src/sage/graphs/bliss.pyx @@ -47,22 +47,23 @@ cdef extern from "bliss/graph.hh" namespace "bliss": cdef cppclass Graph(AbstractGraph): Graph(const unsigned int) void add_edge(const unsigned int, const unsigned int) - void find_automorphisms(Stats&, void (*)(void*, unsigned int, - const unsigned int*), void*) void change_color(const unsigned int, const unsigned int) - const unsigned int* canonical_form(Stats&, void (*)(void*, unsigned int, - const unsigned int*), void*) + const unsigned int* canonical_form(Stats&) + +cdef extern from "bliss/digraph.hh" namespace "bliss": cdef cppclass Digraph(AbstractGraph): Digraph(const unsigned int) void add_edge(const unsigned int, const unsigned int) - void find_automorphisms(Stats&, void (*)(void*, unsigned int, - const unsigned int*), void*) void change_color(const unsigned int, const unsigned int) - const unsigned int* canonical_form(Stats&, void (*)(void*, unsigned int, - const unsigned int*), void*) + const unsigned int* canonical_form(Stats&) unsigned int get_hash() +cdef extern from "bliss_find_automorphisms.h": + + void bliss_find_automorphisms(Graph*, void (*)(void*, unsigned int, const unsigned int*), void*, Stats&) + void bliss_find_automorphisms(Digraph*, void (*)(void*, unsigned int, const unsigned int*), void*, Stats&) + cdef int encoding_numbits(int n): r""" @@ -124,9 +125,6 @@ cdef void add_gen(void *user_param, unsigned int n, const unsigned int *aut): sig_free(done) -cdef void empty_hook(void *user_param, unsigned int n, const unsigned int *aut): - return - ##################################################### # constructing bliss graphs from edge lists ##################################################### @@ -345,10 +343,10 @@ cdef canonical_form_from_edge_list(int Vnr, list Vout, list Vin, int Lnr=1, list if directed: d = bliss_digraph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition) - aut = d.canonical_form(s, empty_hook, NULL) + aut = d.canonical_form(s) else: g = bliss_graph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition) - aut = g.canonical_form(s, empty_hook, NULL) + aut = g.canonical_form(s) for i in range(len(Vout)): x = Vout[i] @@ -640,11 +638,11 @@ cdef automorphism_group_gens_from_edge_list(int Vnr, Vout, Vin, int Lnr=1, label if directed: d = bliss_digraph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition) - d.find_automorphisms(s, add_gen, data) + bliss_find_automorphisms(d, add_gen, data, s) del d else: g = bliss_graph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition) - g.find_automorphisms(s, add_gen, data) + bliss_find_automorphisms(g, add_gen, data, s) del g return [[cyc for cyc in gen if cyc[0] is not None] for gen in gens] diff --git a/src/sage/graphs/bliss_find_automorphisms.h b/src/sage/graphs/bliss_find_automorphisms.h new file mode 100644 index 0000000000..a2c084a163 --- /dev/null +++ b/src/sage/graphs/bliss_find_automorphisms.h @@ -0,0 +1,22 @@ +#include +#include + +inline void bliss_find_automorphisms(bliss::Graph *graph, void (*hook)(void *user_param, unsigned int n, const unsigned int *aut), void *hook_user_param, bliss::Stats s) +{ + auto report_aut = [&](unsigned int n, const unsigned int *aut) -> void { + if(hook) + (*hook)(hook_user_param, n, aut); + }; + + graph->find_automorphisms(s, report_aut); +} + +inline void bliss_find_automorphisms(bliss::Digraph *graph, void (*hook)(void *user_param, unsigned int n, const unsigned int *aut), void *hook_user_param, bliss::Stats s) +{ + auto report_aut = [&](unsigned int n, const unsigned int *aut) -> void { + if(hook) + (*hook)(hook_user_param, n, aut); + }; + + graph->find_automorphisms(s, report_aut); +}