Ticket #14349: 0001-reduce-cliquer-patching.patch

File 0001-reduce-cliquer-patching.patch, 3.5 KB (added by felixs, 8 years ago)
  • deleted file build/pkgs/cliquer/patches/graph.c.patch

    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/spkg-install          |    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     2012-05-04 10:04:46.000000000 +0200
    2 +++ graphpatched.c      2012-05-04 10:04:32.000000000 +0200
    3 @@ -359,7 +359,7 @@
    4   *       (mainly generator-specific 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  
  • build/pkgs/cliquer/spkg-install

    diff --git a/build/pkgs/cliquer/spkg-install b/build/pkgs/cliquer/spkg-install
    index 96953ec..1399538 100755
    a b cd src 
    172172patch -N -p1 <../patches/Makefile.patch || :
    173173
    174174# Add to the source the code we need
    175 patch -N <../patches/graph.c.patch || :
    176175patch -N <../patches/cl.c.patch || :
    177176cp ../patches/cl.h .
    178177
  • src/sage/graphs/cliquer.pxd

    diff --git a/src/sage/graphs/cliquer.pxd b/src/sage/graphs/cliquer.pxd
    index 2db867d..aa82d43 100644
    a b  
    11cdef extern from "cliquer/graph.h":
    2     struct graph_t:
     2    ctypedef struct graph_t:
    33       pass
    44
    55cdef extern from "cliquer/cliquer.h":
    cdef extern from "cliquer/cl.h": 
    2323cdef extern from "cliquer/graph.h":
    2424     cdef graph_t * graph_new(int n)
    2525     cdef void graph_print(graph_t *g)
    26      cdef void parse_input(char *str,graph_t *g)
    2726     cdef void graph_free(graph_t *g)
     27     cdef void GRAPH_ADD_EDGE(graph_t *g, int, int)
    2828
  • src/sage/graphs/cliquer.pyx

    diff --git a/src/sage/graphs/cliquer.pyx b/src/sage/graphs/cliquer.pyx
    index de6c066..f89eccd 100644
    a b def max_clique(graph): 
    6565
    6666    cdef graph_t *g
    6767    g=graph_new(graph.order())
    68     buf="p edges %d %d" %(graph.order(),graph.size())
    69     parse_input(buf,g)
    70 
    7168    for e in graph.edge_iterator():
    7269        (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)
    7571
    7672    cdef int* list
    7773    cdef int size
    def all_max_clique(graph): 
    133129
    134130    cdef graph_t *g
    135131    g=graph_new(graph.order())
    136     buf="p edges %d %d" %(graph.order(),graph.size())
    137     parse_input(buf,g)
    138132
    139133    for e in graph.edge_iterator():
    140134        (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)
    143136
    144137    cdef int* list
    145138    cdef int size
    def clique_number(graph): 
    185178    graph=graph.relabel(inplace=False)
    186179    cdef graph_t *g
    187180    g=graph_new(graph.order())
    188     buf="p edges %d %d" %(graph.order(),graph.size())
    189     parse_input(buf,g)
    190181
    191182    for e in graph.edge_iterator():
    192183        (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)
    195185
    196186    cdef int c
    197187    sig_on()