[sagemath] 01/01: Update Sage's planarity module to use API v3

Ximin Luo infinity0 at debian.org
Wed Jul 6 17:01:59 UTC 2016


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository sagemath.

commit f7298a61d21a006feb59c415f8835735830715b4
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Jul 6 19:01:47 2016 +0200

    Update Sage's planarity module to use API v3
---
 debian/patches/planarity-update.patch | 67 +++++++++++++++++++++++++++++++++++
 debian/patches/series                 |  1 +
 2 files changed, 68 insertions(+)

diff --git a/debian/patches/planarity-update.patch b/debian/patches/planarity-update.patch
new file mode 100644
index 0000000..4a3ed48
--- /dev/null
+++ b/debian/patches/planarity-update.patch
@@ -0,0 +1,67 @@
+Description: Update Sage's planarity module to use API v3
+ Sage uses 2.2.0 but the API difference from planarity 3 is not too bad.
+ So let's try this instead of backporting planarity 2.2.0 to Debian.
+Author: Ximin Luo <infinity0 at debian.org>
+Bug: TBD
+Forwarded: TBD
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+--- a/sage/src/sage/graphs/planarity.pyx
++++ b/sage/src/sage/graphs/planarity.pyx
+@@ -4,12 +4,12 @@
+ 
+ cdef extern from "planarity/graph.h":
+     ctypedef struct graphNode:
+-        int v
++        int index
+         int link[2]
+     ctypedef graphNode * graphNodeP
+ 
+     ctypedef struct BM_graph:
+-        graphNodeP G
++        graphNodeP V
+         int N
+     ctypedef BM_graph * graphP
+ 
+@@ -136,10 +136,10 @@
+         from sage.graphs.graph import Graph
+         for i from 0 <= i < theGraph.N:
+             linked_list = []
+-            j = theGraph.G[i].link[1]
++            j = theGraph.V[i].link[1]
+             while j >= theGraph.N:
+-                linked_list.append(to[theGraph.G[j].v])
+-                j = theGraph.G[j].link[1]
++                linked_list.append(to[theGraph.V[j].index])
++                j = theGraph.V[j].link[1]
+             if len(linked_list) > 0:
+                 g_dict[to[i]] = linked_list
+         G = Graph(g_dict)
+@@ -155,10 +155,10 @@
+                 #for i in range(theGraph.N):
+                 for i from 0 <= i < theGraph.N:
+                     linked_list = []
+-                    j = theGraph.G[i].link[1]
++                    j = theGraph.V[i].link[1]
+                     while j >= theGraph.N:
+-                        linked_list.append(to[theGraph.G[j].v])
+-                        j = theGraph.G[j].link[1]
++                        linked_list.append(to[theGraph.V[j].index])
++                        j = theGraph.V[j].link[1]
+                     emb_dict[to[i]] = linked_list
+                 g._embedding = emb_dict
+             if set_pos:
+@@ -176,10 +176,10 @@
+                 #for i in range(theGraph.N):
+                 for i from 0 <= i < theGraph.N:
+                     linked_list = []
+-                    j = theGraph.G[i].link[0]
++                    j = theGraph.V[i].link[0]
+                     while j >= theGraph.N:
+-                        linked_list.append(to[theGraph.G[j].v])
+-                        j = theGraph.G[j].link[0]
++                        linked_list.append(to[theGraph.V[j].index])
++                        j = theGraph.V[j].link[0]
+                     emb_dict[to[i]] = linked_list
+                 g._embedding = emb_dict
+         gp_Free(&theGraph)
diff --git a/debian/patches/series b/debian/patches/series
index 4636cf3..9574bd5 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -10,3 +10,4 @@ rubiks_executables_renames.patch
 python_installs_in_userdir.patch
 pari.patch
 nauty-bin-rename.patch
+planarity-update.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list