Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions build/pkgs/bliss/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,21 @@ canonical forms of graphs.
License
-------

LGPL
LGPL3


Upstream Contact
----------------

Bliss is currently being maintained by Tommi Junttila and Petteri Kaski.
Bliss is currently being maintained by Tommi Junttila at

https://users.aalto.fi/~tjunttil/bliss/index.html

Bliss used to be maintained by Tommi Junttila and Petteri Kaski up to version 0.73 at

http://www.tcs.tkk.fi/Software/bliss/index.html

We apply patches generated from https://github.com/mkoeppe/bliss (branch
apply_debian_patches) as our upstream. This tracks the patches from the
Debian package, adding an autotools build system and adjusting the
include file locations.
Dependencies
------------

None
9 changes: 5 additions & 4 deletions build/pkgs/bliss/checksums.ini
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion build/pkgs/bliss/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# no dependencies
| cmake

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/bliss/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.73+debian-1+sage-2016-08-02.p0
0.77
32 changes: 32 additions & 0 deletions build/pkgs/bliss/patches/bliss-0.77-install.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 01ed093..cfdb0a6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -62,3 +62,27 @@ if(USE_GMP)
target_link_libraries(bliss-executable ${GMP_LIBRARIES})
endif(USE_GMP)
set_target_properties(bliss-executable PROPERTIES OUTPUT_NAME bliss)
+
+include(GNUInstallDirs)
+
+set(
+ BLISS_HEADERS
+ src/bliss_C.h
+ src/uintseqhash.hh
+ src/abstractgraph.hh
+ src/stats.hh
+ src/digraph.hh
+ src/defs.hh
+ src/heap.hh
+ src/graph.hh
+ src/partition.hh
+ src/kqueue.hh
+ src/utils.hh
+ src/orbit.hh
+ src/timer.hh
+ src/bignum.hh
+)
+
+install(TARGETS bliss-executable RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(TARGETS bliss LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+install(FILES ${BLISS_HEADERS} DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/bliss)
2 changes: 1 addition & 1 deletion build/pkgs/bliss/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd src
sdh_configure --disable-gmp
sdh_cmake -DUSE_GMP=OFF -DCMAKE_VERBOSE_MAKEFILE=ON
sdh_make
sdh_make_install
28 changes: 0 additions & 28 deletions build/pkgs/bliss/spkg-src

This file was deleted.

29 changes: 13 additions & 16 deletions src/sage/graphs/bliss.pyx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# distutils: language = c++
# distutils: extra_compile_args = -std=c++11
# distutils: libraries = bliss
# sage_setup: distribution = sagemath-bliss

Expand Down Expand Up @@ -47,22 +48,22 @@ 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_cpp/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"""
Expand Down Expand Up @@ -124,10 +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
#####################################################
Expand Down Expand Up @@ -346,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]
Expand Down Expand Up @@ -643,11 +640,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, <void*>data)
bliss_find_automorphisms(d, add_gen, <void*>data, s)
del d
else:
g = bliss_graph_from_labelled_edges(Vnr, Lnr, Vout, Vin, labels, partition)
g.find_automorphisms(s, add_gen, <void*>data)
bliss_find_automorphisms(g, add_gen, <void*>data, s)
del g

return [[cyc for cyc in gen if cyc[0] is not None] for gen in gens]
Expand Down
22 changes: 22 additions & 0 deletions src/sage/graphs/bliss_cpp/bliss_find_automorphisms.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include <bliss/graph.hh>
#include <bliss/digraph.hh>

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);
}