summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorAntonio Rojas2019-01-13 08:51:59 +0000
committerAntonio Rojas2019-01-13 08:51:59 +0000
commit0d93c577796185e7b537b2f8506f9edcc9d555f3 (patch)
tree21786cefe6caf4b84c8359c5ae0729d5b3b36206
parentc53c51b496753121148f90c504c3bb524ce97439 (diff)
downloadaur-0d93c577796185e7b537b2f8506f9edcc9d555f3.tar.gz
Update patches
-rw-r--r--.SRCINFO10
-rw-r--r--PKGBUILD12
-rw-r--r--sagemath-cypari2.patch2
-rw-r--r--sagemath-ecl-sigfpe.patch154
-rw-r--r--sagemath-env.patch6
-rw-r--r--sagemath-networkx-2.2.patch395
6 files changed, 151 insertions, 428 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 70ffe9cc626f..6f49ef99116b 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = sagemath-git
pkgdesc = Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab
- pkgver = 8.6.beta0.r0.g2639857771
+ pkgver = 8.6.rc1.r0.g62fe3948ea
pkgrel = 1
url = http://www.sagemath.org
arch = x86_64
@@ -105,12 +105,11 @@ pkgbase = sagemath-git
source = sagemath-threejs.patch
source = sagemath-cremona.patch
source = sagemath-sphinx-1.8.patch
- source = sagemath-networkx-2.2.patch
source = sagemath-cypari2.patch
source = sagemath-singular-4.1.1.p4.patch
source = sagemath-ecl-sigfpe.patch
sha256sums = SKIP
- sha256sums = f26ab0f22d7d916a621f02b9d9fc806eb6825f8d34cdf45accb0e2601c82f049
+ sha256sums = de6e38462ef1848778fbc23a63529fbee9229dbb245bb653f58a0d834a634c04
sha256sums = 960afe4fcbffe2762b66119b8f14355386ced0d8ee52b535d0dac1dba90d365b
sha256sums = ef265f88ceb6caf4aac2d86ea74850861d99a63d11c94fc52b2ce88053c26d1e
sha256sums = bd2744c6564bbf71bd6ea3cd7b9031e2126cc1423bcdc1fcc258d90d750a129d
@@ -119,10 +118,9 @@ pkgbase = sagemath-git
sha256sums = f6b48abf34f64ea3fc092b0f0179e89633f7d3ecc0d62c2acacbfa1217751d63
sha256sums = 4c6df9e4e5a7b29ecf6189eda3e5a79f69b6e1b4d29c1b9559663149b8c0af96
sha256sums = 22f5e44a42c8276025b8512f45cac1c36d576c29c7fd9d36fde8b19ff87867d8
- sha256sums = 6ff08c4cdf468179618dd2d5428bcb8575308bc69dab2550c277d0beb2419f4f
- sha256sums = 1677bcaa3fe19bf978b6ffaae7b64b7ec32df63fa3d0e28b179cfa831fcfa896
+ sha256sums = 73e31973893f99d112249df1db6e0784fc4c5b0b0c3513139f0994d60369fb40
sha256sums = 482887fe43d89cef3270e89300ab9e2238fa74cd5b7c875688b68fb1b10c4fdf
- sha256sums = 87bf055de0a233e9599c59a86f64b4502be31fda53ba0a426f94f25f17ca76df
+ sha256sums = a42f3b152b1aedb8abf16bc70971419919d1fe30328574e7fef8305f9d07d938
pkgname = sagemath-git
optdepends = cython2: to compile cython code
diff --git a/PKGBUILD b/PKGBUILD
index baef49c8476e..b4846b068cca 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -7,7 +7,7 @@
pkgbase=sagemath-git
pkgname=(sagemath-git sagemath-jupyter-git)
-pkgver=8.6.beta0.r0.g2639857771
+pkgver=8.6.rc1.r0.g62fe3948ea
pkgrel=1
pkgdesc="Open Source Mathematics Software, free alternative to Magma, Maple, Mathematica, and Matlab"
arch=(x86_64)
@@ -44,12 +44,11 @@ source=(git://git.sagemath.org/sage.git#branch=develop
sagemath-threejs.patch
sagemath-cremona.patch
sagemath-sphinx-1.8.patch
- sagemath-networkx-2.2.patch
sagemath-cypari2.patch
sagemath-singular-4.1.1.p4.patch
sagemath-ecl-sigfpe.patch)
sha256sums=('SKIP'
- 'f26ab0f22d7d916a621f02b9d9fc806eb6825f8d34cdf45accb0e2601c82f049'
+ 'de6e38462ef1848778fbc23a63529fbee9229dbb245bb653f58a0d834a634c04'
'960afe4fcbffe2762b66119b8f14355386ced0d8ee52b535d0dac1dba90d365b'
'ef265f88ceb6caf4aac2d86ea74850861d99a63d11c94fc52b2ce88053c26d1e'
'bd2744c6564bbf71bd6ea3cd7b9031e2126cc1423bcdc1fcc258d90d750a129d'
@@ -58,10 +57,9 @@ sha256sums=('SKIP'
'f6b48abf34f64ea3fc092b0f0179e89633f7d3ecc0d62c2acacbfa1217751d63'
'4c6df9e4e5a7b29ecf6189eda3e5a79f69b6e1b4d29c1b9559663149b8c0af96'
'22f5e44a42c8276025b8512f45cac1c36d576c29c7fd9d36fde8b19ff87867d8'
- '6ff08c4cdf468179618dd2d5428bcb8575308bc69dab2550c277d0beb2419f4f'
- '1677bcaa3fe19bf978b6ffaae7b64b7ec32df63fa3d0e28b179cfa831fcfa896'
+ '73e31973893f99d112249df1db6e0784fc4c5b0b0c3513139f0994d60369fb40'
'482887fe43d89cef3270e89300ab9e2238fa74cd5b7c875688b68fb1b10c4fdf'
- '87bf055de0a233e9599c59a86f64b4502be31fda53ba0a426f94f25f17ca76df')
+ 'a42f3b152b1aedb8abf16bc70971419919d1fe30328574e7fef8305f9d07d938')
pkgver() {
cd sage
@@ -92,8 +90,6 @@ prepare(){
patch -p1 -i ../fes02.patch
# use Features to detect Cremona databases https://trac.sagemath.org/ticket/25825
patch -p1 -i ../sagemath-cremona.patch
-# Fix graph generators with networkx 2.2 https://trac.sagemath.org/ticket/26326
- patch -p1 -i ../sagemath-networkx-2.2.patch
# Fix build with cypari 2.0 https://trac.sagemath.org/ticket/26442
patch -p1 -i ../sagemath-cypari2.patch
# Fixes for singular 4.1.1p4 https://trac.sagemath.org/ticket/25993
diff --git a/sagemath-cypari2.patch b/sagemath-cypari2.patch
index f622bd3ba3d4..6ed6a5783c2a 100644
--- a/sagemath-cypari2.patch
+++ b/sagemath-cypari2.patch
@@ -28,7 +28,7 @@ diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/p
index 2b5504a..8bd32dd 100644
--- a/src/sage/rings/polynomial/polynomial_element.pyx
+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -4364,8 +4364,7 @@ cdef class Polynomial(CommutativeAlgebraElement):
+@@ -4363,8 +4363,7 @@ cdef class Polynomial(CommutativeAlgebraElement):
sage: G.prod() == g
True
"""
diff --git a/sagemath-ecl-sigfpe.patch b/sagemath-ecl-sigfpe.patch
index f3d06fdd972e..f0984acebc67 100644
--- a/sagemath-ecl-sigfpe.patch
+++ b/sagemath-ecl-sigfpe.patch
@@ -1,23 +1,147 @@
diff --git a/src/sage/libs/ecl.pyx b/src/sage/libs/ecl.pyx
-index 1fafb6c..4f730ad 100644
+index e408866..fa24ac0 100644
--- a/src/sage/libs/ecl.pyx
+++ b/src/sage/libs/ecl.pyx
-@@ -321,6 +321,7 @@ def init_ecl():
+@@ -16,7 +16,7 @@ from __future__ import print_function, absolute_import
+ #adapted to work with pure Python types.
+
+ from libc.stdlib cimport abort
+-from libc.signal cimport SIGINT, SIGBUS, SIGSEGV, SIGCHLD
++from libc.signal cimport SIGINT, SIGBUS, SIGSEGV, SIGCHLD, SIGFPE
+ from libc.signal cimport raise_ as signal_raise
+ from posix.signal cimport sigaction, sigaction_t
+ cimport cysignals.signals
+@@ -48,9 +48,14 @@ cdef extern from "eclsig.h":
+ void ecl_sig_off()
+ cdef sigaction_t ecl_sigint_handler
+ cdef sigaction_t ecl_sigbus_handler
++ cdef sigaction_t ecl_sigfpe_handler
+ cdef sigaction_t ecl_sigsegv_handler
+ cdef mpz_t ecl_mpz_from_bignum(cl_object obj)
+ cdef cl_object ecl_bignum_from_mpz(mpz_t num)
++ cdef int fegetexcept()
++ cdef int feenableexcept(int)
++ cdef int fedisableexcept(int)
++ cdef int ecl_feflags
+
+ cdef cl_object string_to_object(char * s):
+ return ecl_read_from_cstring(s)
+@@ -239,6 +244,7 @@ def init_ecl():
+ global ecl_has_booted
+ cdef char *argv[1]
+ cdef sigaction_t sage_action[32]
++ cdef int sage_fpes
+ cdef int i
+
+ if ecl_has_booted:
+@@ -258,6 +264,8 @@ def init_ecl():
+ for i in range(1,32):
+ sigaction(i, NULL, &sage_action[i])
+
++ sage_fpes = fegetexcept()
++
+ #initialize ECL
+ ecl_set_option(ECL_OPT_SIGNAL_HANDLING_THREAD, 0)
+ cl_boot(1, argv)
+@@ -265,8 +273,12 @@ def init_ecl():
+ #save signal handler from ECL
+ sigaction(SIGINT, NULL, &ecl_sigint_handler)
+ sigaction(SIGBUS, NULL, &ecl_sigbus_handler)
++ sigaction(SIGFPE, NULL, &ecl_sigfpe_handler)
+ sigaction(SIGSEGV, NULL, &ecl_sigsegv_handler)
+
++ #save ECL's floating point exception flags
++ ecl_feflags = fegetexcept()
++
+ #verify that no SIGCHLD handler was installed
+ cdef sigaction_t sig_test
+ sigaction(SIGCHLD, NULL, &sig_test)
+@@ -277,6 +289,9 @@ def init_ecl():
+ for i in range(1,32):
+ sigaction(i, &sage_action[i], NULL)
+
++ fedisableexcept(ecl_feflags)
++ feenableexcept(sage_fpes)
++
+ #initialise list of objects and bind to global variable
+ # *SAGE-LIST-OF-OBJECTS* to make it rooted in the reachable tree for the GC
+ list_of_objects=cl_cons(Cnil,cl_cons(Cnil,Cnil))
+@@ -320,7 +335,6 @@ def init_ecl():
+ (values nil (princ-to-string cnd)))))
"""))
safe_funcall_clobj=cl_eval(string_to_object(b"(symbol-function 'sage-safe-funcall)"))
-
-+ cl_eval(string_to_object("(si::trap-fpe T NIL)"))
+-
ecl_has_booted = 1
cdef cl_object ecl_safe_eval(cl_object form) except NULL:
---- sage-8.5/src/sage/interfaces/maxima_lib.py.orig 2018-12-23 21:59:46.431420340 +0000
-+++ sage-8.5/src/sage/interfaces/maxima_lib.py 2018-12-23 22:00:05.494568891 +0000
-@@ -107,6 +107,7 @@
- else:
- ecl_eval("(require 'maxima)")
- ecl_eval("(in-package :maxima)")
-+ecl_eval("(si::trap-fpe 'floating-point-overflow nil)")
- ecl_eval("(setq $nolabels t))")
- ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
- ecl_eval("(set-locale-subdir)")
-
+diff --git a/src/sage/libs/eclsig.h b/src/sage/libs/eclsig.h
+index f9f2690..a7e1f40 100644
+--- a/src/sage/libs/eclsig.h
++++ b/src/sage/libs/eclsig.h
+@@ -9,24 +9,66 @@
+
+
+ #include <signal.h>
++
++/* Rummage around to determine how ECL was configured */
++#define ECL_AVOID_FPE_H /* Prevent some local includes */
++#include <ecl/config-internal.h>
++
++#ifdef HAVE_FENV_H
++#include <fenv.h>
++#ifndef FE_ALL_EXCEPT
++#define FE_ALL_EXCEPT FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW | FE_INVALID
++#endif
++#else
++#ifndef FE_ALL_EXCEPT
++#define FE_ALL_EXCEPT 0
++#endif
++#define feclearexcept(flags) do {} while (0)
++#endif
++
++#ifndef HAVE_FEENABLEEXCEPT
++/* These are GNU extensions */
++#define fegetexcept() 0
++#define feenablexcept(flags) do {} while (0)
++#define fdisableexcept(flags) do {} while (0)
++#endif
++
+ static struct sigaction ecl_sigint_handler;
+ static struct sigaction ecl_sigbus_handler;
++static struct sigaction ecl_sigfpe_handler;
+ static struct sigaction ecl_sigsegv_handler;
+ static struct sigaction sage_sigint_handler;
+ static struct sigaction sage_sigbus_handler;
++static struct sigaction sage_sigfpe_handler;
+ static struct sigaction sage_sigsegv_handler;
++static int ecl_feflags;
++static int sage_feflags;
+
+ static inline void set_ecl_signal_handler(void)
+ {
+ sigaction(SIGINT, &ecl_sigint_handler, &sage_sigint_handler);
+ sigaction(SIGBUS, &ecl_sigbus_handler, &sage_sigbus_handler);
++ sigaction(SIGFPE, &ecl_sigfpe_handler, &sage_sigfpe_handler);
+ sigaction(SIGSEGV, &ecl_sigsegv_handler, &sage_sigsegv_handler);
++
++ /* first clear pending floating point exceptions, if any */
++ feclearexcept(FE_ALL_EXCEPT);
++
++ /* sage_feflags should be 0; we don't set them otherwise */
++ sage_feflags = fedisableexcept(FE_ALL_EXCEPT);
++ feenableexcept(ecl_feflags);
+ }
+
+ static inline void unset_ecl_signal_handler(void)
+ {
++ /* clear pending exceptions and restore previous exception mask */
++ feclearexcept(FE_ALL_EXCEPT);
++ ecl_feflags = fedisableexcept(FE_ALL_EXCEPT);
++ feenableexcept(sage_feflags);
++
+ sigaction(SIGINT, &sage_sigint_handler, NULL);
+ sigaction(SIGBUS, &sage_sigbus_handler, NULL);
++ sigaction(SIGFPE, &sage_sigfpe_handler, NULL);
+ sigaction(SIGSEGV, &sage_sigsegv_handler, NULL);
+ }
+
diff --git a/sagemath-env.patch b/sagemath-env.patch
index 787775214379..ba95ba9564e9 100644
--- a/sagemath-env.patch
+++ b/sagemath-env.patch
@@ -90,7 +90,7 @@
export SAGE_DOC="$SAGE_SHARE/doc/sage"
if [ -z "${SAGE_ORIG_PATH_SET}" ]; then
-@@ -403,29 +403,8 @@
+@@ -409,29 +409,8 @@
export SAGE_STARTUP_FILE
fi
@@ -122,7 +122,7 @@
LDFLAGS="-L$SAGE_LOCAL/lib -Wl,-rpath,$SAGE_LOCAL/lib $LDFLAGS"
export LDFLAGS
-@@ -489,8 +489,6 @@
+@@ -495,8 +495,6 @@
fi
fi
@@ -131,7 +131,7 @@
PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB
-@@ -601,9 +601,6 @@
+@@ -607,9 +607,6 @@
LD_LIBRARY_PATH="$SAGE_LOCAL/bin:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH
fi
diff --git a/sagemath-networkx-2.2.patch b/sagemath-networkx-2.2.patch
deleted file mode 100644
index 9a1e29b24e71..000000000000
--- a/sagemath-networkx-2.2.patch
+++ /dev/null
@@ -1,395 +0,0 @@
-diff --git a/src/sage/graphs/digraph_generators.py b/src/sage/graphs/digraph_generators.py
-index 204c013..af4d8ea 100644
---- a/src/sage/graphs/digraph_generators.py
-+++ b/src/sage/graphs/digraph_generators.py
-@@ -64,6 +64,7 @@ Functions and methods
- from six.moves import range
- from sage.cpython.string import bytes_to_str
-
-+import sys
- from sage.misc.randstate import current_randstate
- from sage.graphs.digraph import DiGraph
-
-@@ -1101,18 +1102,19 @@ class DiGraphGenerators():
- INPUT:
-
-
-- - ``n`` - number of vertices.
-+ - ``n`` - number of vertices.
-
-- - ``kernel`` - the attachment kernel
-+ - ``kernel`` - the attachment kernel.
-
-- - ``seed`` - for the random number generator
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-
-
- EXAMPLES::
-
- sage: D = digraphs.RandomDirectedGN(25)
- sage: D.edges(labels=False)
-- [(1, 0), (2, 0), (3, 1), (4, 0), (5, 0), (6, 1), (7, 0), (8, 3), (9, 0), (10, 8), (11, 3), (12, 9), (13, 8), (14, 0), (15, 11), (16, 11), (17, 5), (18, 11), (19, 6), (20, 5), (21, 14), (22, 5), (23, 18), (24, 11)]
-+ [(1, 0), (2, 1), (3, 0), (4, 2), (5, 0), (6, 2), (7, 3), (8, 2), (9, 3), (10, 4), (11, 5), (12, 9), (13, 2), (14, 2), (15, 5), (16, 2), (17, 15), (18, 1), (19, 5), (20, 2), (21, 5), (22, 1), (23, 5), (24, 14)]
- sage: D.show() # long time
-
- REFERENCE:
-@@ -1121,7 +1123,7 @@ class DiGraphGenerators():
- Random Networks, Phys. Rev. E vol. 63 (2001), p. 066123.
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return DiGraph(networkx.gn_graph(n, kernel, seed=seed))
-
-@@ -1159,7 +1162,7 @@ class DiGraphGenerators():
- Copying, Phys. Rev. E vol. 71 (2005), p. 036118.
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return DiGraph(networkx.gnc_graph(n, seed=seed))
-
-@@ -1372,7 +1376,7 @@ class DiGraphGenerators():
- Random Networks, Phys. Rev. E vol. 63 (2001), p. 066123.
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return DiGraph(networkx.gnr_graph(n, p, seed=seed))
-
-diff --git a/src/sage/graphs/generators/degree_sequence.py b/src/sage/graphs/generators/degree_sequence.py
-index bcea8db..0d85654 100644
---- a/src/sage/graphs/generators/degree_sequence.py
-+++ b/src/sage/graphs/generators/degree_sequence.py
-@@ -16,6 +16,8 @@ The methods defined here appear in :mod:`sage.graphs.graph_generators`.
- # (at your option) any later version.
- # https://www.gnu.org/licenses/
- # ****************************************************************************
-+
-+import sys
- from sage.graphs.graph import Graph
- from sage.misc.randstate import current_randstate
-
-@@ -142,10 +144,11 @@ def DegreeSequenceConfigurationModel(deg_sequence, seed=None):
-
- INPUT:
-
-- - ``deg_sequence`` - a list of integers with each
-- entry corresponding to the expected degree of a different vertex.
-+ - ``deg_sequence`` - a list of integers with each entry corresponding to the
-+ expected degree of a different vertex.
-
-- - ``seed`` - for the random number generator.
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-
-
- EXAMPLES::
-@@ -172,7 +175,7 @@ def DegreeSequenceConfigurationModel(deg_sequence, seed=None):
- networks, SIAM Review vol. 45, no. 2 (2003), pp. 167-256.
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return Graph(networkx.configuration_model([int(i) for i in deg_sequence], seed=seed), loops=True, multiedges=True, sparse=True)
-
-@@ -210,17 +213,18 @@ def DegreeSequenceExpected(deg_sequence, seed=None):
-
- INPUT:
-
-- - ``deg_sequence`` - a list of integers with each
-- entry corresponding to the expected degree of a different vertex.
-+ - ``deg_sequence`` - a list of integers with each entry corresponding to the
-+ expected degree of a different vertex.
-
-- - ``seed`` - for the random number generator.
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-
-
- EXAMPLES::
-
- sage: G = graphs.DegreeSequenceExpected([1,2,3,2,3])
- sage: G.edges(labels=False)
-- [(0, 2), (0, 3), (1, 1), (1, 4), (2, 3), (2, 4), (3, 4), (4, 4)]
-+ [(0, 3), (1, 4), (2, 2), (2, 3), (2, 4), (4, 4)]
- sage: G.show() # long time
-
- REFERENCE:
-@@ -230,6 +234,6 @@ def DegreeSequenceExpected(deg_sequence, seed=None):
- Ann. Combinatorics (6), 2002 pp. 125-145.
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return Graph(networkx.expected_degree_graph([int(i) for i in deg_sequence], seed=seed), loops=True)
-diff --git a/src/sage/graphs/generators/random.py b/src/sage/graphs/generators/random.py
-index 06a5203..5cbf5e9 100644
---- a/src/sage/graphs/generators/random.py
-+++ b/src/sage/graphs/generators/random.py
-@@ -14,6 +14,7 @@ The methods defined here appear in :mod:`sage.graphs.graph_generators`.
- # http://www.gnu.org/licenses/
- ###########################################################################
- from six.moves import range
-+import sys
- # import from Sage library
- from sage.graphs.graph import Graph
- from sage.misc.randstate import current_randstate
-@@ -30,7 +31,8 @@ def RandomGNP(n, p, seed=None, fast=True, algorithm='Sage'):
-
- - ``p`` -- probability of an edge
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-
- - ``fast`` -- boolean set to True (default) to use the algorithm with
- time complexity in `O(n+m)` proposed in [BatBra2005]_. It is designed
-@@ -98,7 +100,7 @@ def RandomGNP(n, p, seed=None, fast=True, algorithm='Sage'):
- sage: graphs.RandomGNP(50,.2, algorithm="Sage").size()
- 243
- sage: graphs.RandomGNP(50,.2, algorithm="networkx").size()
-- 258
-+ 245
- """
- if n < 0:
- raise ValueError("The number of nodes must be positive or null.")
-@@ -106,7 +108,7 @@ def RandomGNP(n, p, seed=None, fast=True, algorithm='Sage'):
- raise ValueError("The probability p must be in [0..1].")
-
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- if p == 1:
- from sage.graphs.generators.basic import CompleteGraph
- return CompleteGraph(n)
-@@ -140,7 +142,9 @@ def RandomBarabasiAlbert(n, m, seed=None):
-
- - ``m`` - number of edges to attach from each new node
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-+
-
- EXAMPLES:
-
-@@ -149,7 +153,7 @@ def RandomBarabasiAlbert(n, m, seed=None):
- ::
-
- sage: graphs.RandomBarabasiAlbert(6,2).edges(labels=False)
-- [(0, 2), (0, 3), (0, 4), (1, 2), (2, 3), (2, 4), (2, 5), (3, 5)]
-+ [(0, 2), (0, 3), (1, 2), (1, 4), (1, 5), (2, 3), (2, 4), (3, 5)]
-
- We plot a random graph on 12 nodes with m = 3.
-
-@@ -175,7 +179,7 @@ def RandomBarabasiAlbert(n, m, seed=None):
-
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return Graph(networkx.barabasi_albert_graph(n,m,seed=seed))
-
-@@ -625,7 +629,9 @@ def RandomGNM(n, m, dense=False, seed=None):
- - ``dense`` - whether to use NetworkX's
- dense_gnm_random_graph or gnm_random_graph
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-+
-
- EXAMPLES: We show the edge list of a random graph on 5 nodes with
- 10 edges.
-@@ -658,7 +664,7 @@ def RandomGNM(n, m, dense=False, seed=None):
- sage: G.show() # long time
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- if dense:
- return Graph(networkx.dense_gnm_random_graph(n, m, seed=seed))
-@@ -688,13 +694,15 @@ def RandomNewmanWattsStrogatz(n, k, p, seed=None):
- - ``p`` - the probability of adding a new edge for
- each edge
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-+
-
- EXAMPLES: We show the edge list of a random graph on 7 nodes with 2
- "nearest neighbors" and probability `p = 0.2`::
-
- sage: graphs.RandomNewmanWattsStrogatz(7, 2, 0.2).edges(labels=False)
-- [(0, 1), (0, 2), (0, 3), (0, 6), (1, 2), (2, 3), (2, 4), (3, 4), (3, 6), (4, 5), (5, 6)]
-+ [(0, 1), (0, 4), (0, 6), (1, 2), (1, 4), (2, 3), (3, 4), (4, 5), (5, 6)]
-
- ::
-
-@@ -708,7 +716,7 @@ def RandomNewmanWattsStrogatz(n, k, p, seed=None):
- 99, 2566-2572.
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return Graph(networkx.newman_watts_strogatz_graph(n, k, p, seed=seed))
-
-@@ -728,7 +736,9 @@ def RandomHolmeKim(n, m, p, seed=None):
- - ``p`` - probability of adding a triangle after
- adding a random edge.
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-+
-
- From the NetworkX documentation: The average clustering has a hard
- time getting above a certain cutoff that depends on m. This cutoff
-@@ -750,8 +760,7 @@ def RandomHolmeKim(n, m, p, seed=None):
- ::
-
- sage: graphs.RandomHolmeKim(8, 2, 0.5).edges(labels=False)
-- [(0, 2), (0, 5), (1, 2), (1, 3), (2, 3), (2, 4), (2, 6), (2, 7),
-- (3, 4), (3, 6), (3, 7), (4, 5)]
-+ [(0, 2), (0, 3), (0, 4), (0, 5), (0, 7), (1, 2), (1, 3), (1, 6), (2, 4), (2, 6), (3, 5), (4, 7)]
-
- ::
-
-@@ -764,7 +773,7 @@ def RandomHolmeKim(n, m, p, seed=None):
- with tunable clustering, Phys. Rev. E (2002). vol 65, no 2, 026107.
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return Graph(networkx.powerlaw_cluster_graph(n, m, p, seed=seed))
-
-@@ -1239,13 +1248,15 @@ def RandomLobster(n, p, q, seed=None):
- - ``q`` - probability of adding an edge (claw) to the
- arms
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-+
-
- EXAMPLES: We show the edge list of a random graph with 3 backbone
- nodes and probabilities `p = 0.7` and `q = 0.3`::
-
- sage: graphs.RandomLobster(3, 0.7, 0.3).edges(labels=False)
-- [(0, 1), (1, 2)]
-+ [(0, 1), (0, 5), (1, 2), (1, 6), (2, 3), (2, 7), (3, 4), (3, 8)]
-
- ::
-
-@@ -1253,7 +1264,7 @@ def RandomLobster(n, p, q, seed=None):
- sage: G.show() # long time
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return Graph(networkx.random_lobster(n, p, q, seed=seed))
-
-@@ -1325,7 +1336,7 @@ def RandomTree(n):
-
- return g
-
--def RandomTreePowerlaw(n, gamma=3, tries=100, seed=None):
-+def RandomTreePowerlaw(n, gamma=3, tries=1000, seed=None):
- """
- Returns a tree with a power law degree distribution. Returns False
- on failure.
-@@ -1344,15 +1355,17 @@ def RandomTreePowerlaw(n, gamma=3, tries=100, seed=None):
- - ``tries`` - number of attempts to adjust sequence to
- make a tree
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-+
-
- EXAMPLES: We show the edge list of a random graph with 10 nodes and
- a power law exponent of 2.
-
- ::
-
-- sage: graphs.RandomTreePowerlaw(10, 2).edges(labels=False)
-- [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (6, 8), (6, 9)]
-+ sage: graphs.RandomTreePowerlaw(10, 3).edges(labels=False)
-+ [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (5, 8), (6, 7), (6, 9)]
-
- ::
-
-@@ -1361,7 +1374,7 @@ def RandomTreePowerlaw(n, gamma=3, tries=100, seed=None):
- ....: G.show() # random output, long time
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- try:
- return Graph(networkx.random_powerlaw_tree(n, gamma, seed=seed, tries=tries))
-@@ -1382,7 +1395,8 @@ def RandomRegular(d, n, seed=None):
-
- - ``d`` - degree
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-
-
- EXAMPLES: We show the edge list of a random graph with 8 nodes each
-@@ -1391,7 +1405,7 @@ def RandomRegular(d, n, seed=None):
- ::
-
- sage: graphs.RandomRegular(3, 8).edges(labels=False)
-- [(0, 1), (0, 4), (0, 7), (1, 5), (1, 7), (2, 3), (2, 5), (2, 6), (3, 4), (3, 6), (4, 5), (6, 7)]
-+ [(0, 3), (0, 5), (0, 6), (1, 2), (1, 3), (1, 7), (2, 4), (2, 6), (3, 6), (4, 5), (4, 7), (5, 7)]
-
- ::
-
-@@ -1410,7 +1424,7 @@ def RandomRegular(d, n, seed=None):
- regular graphs quickly. Prob. and Comp. 8 (1999), pp 377-396.
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- try:
- N = networkx.random_regular_graph(d, n, seed=seed)
-@@ -1435,17 +1449,19 @@ def RandomShell(constructor, seed=None):
- - ``d`` - the ratio of inter (next) shell edges to
- intra shell edges
-
-- - ``seed`` -- integer seed for random number generator (default ``None``).
-+ - ``seed`` - a ``random.Random`` seed or a Python ``int`` for the random
-+ number generator (default: ``None``).
-+
-
- EXAMPLES::
-
- sage: G = graphs.RandomShell([(10,20,0.8),(20,40,0.8)])
- sage: G.edges(labels=False)
-- [(0, 3), (0, 7), (0, 8), (1, 2), (1, 5), (1, 8), (1, 9), (3, 6), (3, 11), (4, 6), (4, 7), (4, 8), (4, 21), (5, 8), (5, 9), (6, 9), (6, 10), (7, 8), (7, 9), (8, 18), (10, 11), (10, 13), (10, 19), (10, 22), (10, 26), (11, 18), (11, 26), (11, 28), (12, 13), (12, 14), (12, 28), (12, 29), (13, 16), (13, 21), (13, 29), (14, 18), (16, 20), (17, 18), (17, 26), (17, 28), (18, 19), (18, 22), (18, 27), (18, 28), (19, 23), (19, 25), (19, 28), (20, 22), (24, 26), (24, 27), (25, 27), (25, 29)]
-+ [(0, 7), (0, 8), (0, 9), (1, 3), (1, 4), (1, 5), (1, 7), (1, 9), (1, 27), (2, 5), (2, 9), (2, 15), (2, 21), (3, 6), (3, 8), (3, 9), (4, 6), (4, 7), (6, 7), (8, 21), (10, 26), (12, 17), (12, 18), (12, 20), (12, 25), (12, 26), (13, 14), (13, 19), (14, 16), (14, 18), (14, 19), (14, 22), (14, 24), (15, 21), (16, 17), (16, 25), (16, 26), (16, 28), (17, 19), (17, 29), (18, 24), (18, 26), (19, 28), (20, 27), (20, 29), (22, 24), (22, 27), (22, 29), (23, 24), (23, 26), (24, 27), (26, 29)]
- sage: G.show() # long time
- """
- if seed is None:
-- seed = current_randstate().long_seed()
-+ seed = int(current_randstate().long_seed() % sys.maxint)
- import networkx
- return Graph(networkx.random_shell_graph(constructor, seed=seed))
-
-