From 534e75b6e778fde08423773c902d74d979a4cd20 Mon Sep 17 00:00:00 2001
From: "Bernhard R. Link" <brlink@debian.org>
Date: Sun, 2 Jun 2013 20:05:32 +0200
Subject: [PATCH] reduce cliquer patching

build/pkgs/cliquer/patches/graph.c.patch  11 
build/pkgs/cliquer/spkginstall  1 
src/sage/graphs/cliquer.pxd  4 ++
src/sage/graphs/cliquer.pyx  16 +++
4 files changed, 5 insertions(+), 27 deletions()
delete mode 100644 build/pkgs/cliquer/patches/graph.c.patch
diff git a/build/pkgs/cliquer/patches/graph.c.patch b/build/pkgs/cliquer/patches/graph.c.patch
deleted file mode 100644
index 24c101f..0000000
+




1    graph.c 20120504 10:04:46.000000000 +0200 
2   +++ graphpatched.c 20120504 10:04:32.000000000 +0200 
3   @@ 359,7 +359,7 @@ 
4   * (mainly generatorspecific information) are ignored silently, 
5   * for all others a warning message is printed to stderr. 
6   */ 
7   static boolean parse_input(char *str,graph_t *g) { 
8   +boolean parse_input(char *str,graph_t *g) { 
9   int i,j,w; 
10   char tmp[16]; 
11   
diff git a/build/pkgs/cliquer/spkginstall b/build/pkgs/cliquer/spkginstall
index 96953ec..1399538 100755
a

b

cd src 
172  172  patch N p1 <../patches/Makefile.patch  : 
173  173  
174  174  # Add to the source the code we need 
175   patch N <../patches/graph.c.patch  : 
176  175  patch N <../patches/cl.c.patch  : 
177  176  cp ../patches/cl.h . 
178  177  
diff git a/src/sage/graphs/cliquer.pxd b/src/sage/graphs/cliquer.pxd
index 2db867d..aa82d43 100644
a

b


1  1  cdef extern from "cliquer/graph.h": 
2   struct graph_t: 
 2  ctypedef struct graph_t: 
3  3  pass 
4  4  
5  5  cdef extern from "cliquer/cliquer.h": 
… 
… 
cdef extern from "cliquer/cl.h": 
23  23  cdef extern from "cliquer/graph.h": 
24  24  cdef graph_t * graph_new(int n) 
25  25  cdef void graph_print(graph_t *g) 
26   cdef void parse_input(char *str,graph_t *g) 
27  26  cdef void graph_free(graph_t *g) 
 27  cdef void GRAPH_ADD_EDGE(graph_t *g, int, int) 
28  28  
diff git a/src/sage/graphs/cliquer.pyx b/src/sage/graphs/cliquer.pyx
index de6c066..f89eccd 100644
a

b

def max_clique(graph): 
65  65  
66  66  cdef graph_t *g 
67  67  g=graph_new(graph.order()) 
68   buf="p edges %d %d" %(graph.order(),graph.size()) 
69   parse_input(buf,g) 
70   
71  68  for e in graph.edge_iterator(): 
72  69  (u,v,w)=e 
73   buf=' e %d %d' %(u+1,v+1) 
74   parse_input(buf,g) 
 70  GRAPH_ADD_EDGE(g,u,v) 
75  71  
76  72  cdef int* list 
77  73  cdef int size 
… 
… 
def all_max_clique(graph): 
133  129  
134  130  cdef graph_t *g 
135  131  g=graph_new(graph.order()) 
136   buf="p edges %d %d" %(graph.order(),graph.size()) 
137   parse_input(buf,g) 
138  132  
139  133  for e in graph.edge_iterator(): 
140  134  (u,v,w)=e 
141   buf=' e %d %d' %(u+1,v+1) 
142   parse_input(buf,g) 
 135  GRAPH_ADD_EDGE(g,u,v) 
143  136  
144  137  cdef int* list 
145  138  cdef int size 
… 
… 
def clique_number(graph): 
185  178  graph=graph.relabel(inplace=False) 
186  179  cdef graph_t *g 
187  180  g=graph_new(graph.order()) 
188   buf="p edges %d %d" %(graph.order(),graph.size()) 
189   parse_input(buf,g) 
190  181  
191  182  for e in graph.edge_iterator(): 
192  183  (u,v,w)=e 
193   buf=' e %d %d' %(u+1,v+1) 
194   parse_input(buf,g) 
 184  GRAPH_ADD_EDGE(g,u,v) 
195  185  
196  186  cdef int c 
197  187  sig_on() 