summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTravis Scrimshaw <tscrim at ucdavis.edu>2014-02-10 11:08:32 -0800
committerTravis Scrimshaw <tscrim at ucdavis.edu>2014-02-10 11:08:32 -0800
commit7f9b89ed07cb5053bce29a48748382da525f6d5c (patch)
treedf9f4d6e360787b8be1fd0ef43f0cac3b6d9ae93
parentWork on cleaning up documentation. (diff)
parentUpdated Sage version to 6.2.beta1 (diff)
Merge branch 'develop' into public/combinat/analytic-10519
-rw-r--r--README.txt23
-rw-r--r--VERSION.txt2
-rw-r--r--build/deps2
-rw-r--r--build/pkgs/configure/checksums.ini6
-rw-r--r--build/pkgs/configure/package-version.txt2
-rw-r--r--build/pkgs/flint/SPKG.txt223
-rw-r--r--build/pkgs/flint/checksums.ini8
-rw-r--r--build/pkgs/flint/package-version.txt2
-rw-r--r--build/pkgs/flint/patches/cflags.patch30
-rw-r--r--build/pkgs/flint/patches/dylib.patch17
-rw-r--r--build/pkgs/flint/patches/test_empty_string.patch19
-rw-r--r--build/pkgs/lcalc/SPKG.txt159
-rw-r--r--build/pkgs/lcalc/package-version.txt2
-rw-r--r--build/pkgs/lcalc/patches/init_stack.patch31
-rw-r--r--build/pkgs/lcalc/patches/pari-2.4.4.patch30
-rw-r--r--build/pkgs/ncurses/SPKG.txt17
-rw-r--r--build/pkgs/ncurses/patches/xopen_source.patch313
-rwxr-xr-xbuild/pkgs/pari/spkg-install2
-rw-r--r--build/pkgs/sagenb/checksums.ini6
-rw-r--r--build/pkgs/sagenb/package-version.txt2
-rw-r--r--src/bin/sage-banner2
-rwxr-xr-xsrc/bin/sage-spkg2
-rw-r--r--src/bin/sage-version.sh4
-rw-r--r--src/c_lib/SConstruct4
-rw-r--r--src/doc/en/bordeaux_2008/elliptic_curves.rst1
-rw-r--r--src/doc/en/reference/coercion/index.rst4
-rw-r--r--src/doc/en/reference/libs/index.rst1
-rw-r--r--src/doc/en/thematic_tutorials/coercion_and_categories.rst4
-rw-r--r--src/sage/algebras/group_algebra.py2
-rw-r--r--src/sage/algebras/hall_algebra.py4
-rw-r--r--src/sage/algebras/iwahori_hecke_algebra.py2
-rw-r--r--src/sage/all.py2
-rw-r--r--src/sage/categories/examples/finite_enumerated_sets.py2
-rw-r--r--src/sage/categories/facade_sets.py2
-rw-r--r--src/sage/categories/fields.py2
-rw-r--r--src/sage/categories/functor.pyx2
-rw-r--r--src/sage/categories/morphism.pyx2
-rw-r--r--src/sage/categories/quotient_fields.py42
-rw-r--r--src/sage/coding/binary_code.pyx2
-rw-r--r--src/sage/combinat/abstract_tree.py1233
-rw-r--r--src/sage/combinat/binary_tree.py2045
-rw-r--r--src/sage/combinat/cluster_algebra_quiver/mutation_class.py2
-rw-r--r--src/sage/combinat/cluster_algebra_quiver/quiver_mutation_type.py2
-rw-r--r--src/sage/combinat/composition.py86
-rw-r--r--src/sage/combinat/crystals/tensor_product.py2
-rw-r--r--src/sage/combinat/designs/block_design.py22
-rw-r--r--src/sage/combinat/designs/ext_rep.py2
-rw-r--r--src/sage/combinat/designs/incidence_structures.py104
-rw-r--r--src/sage/combinat/free_module.py8
-rw-r--r--src/sage/combinat/integer_vectors_mod_permgroup.py12
-rw-r--r--src/sage/combinat/kazhdan_lusztig.py2
-rw-r--r--src/sage/combinat/matrices/latin.py36
-rw-r--r--src/sage/combinat/ncsf_qsym/generic_basis_code.py65
-rw-r--r--src/sage/combinat/ncsf_qsym/ncsf.py1234
-rw-r--r--src/sage/combinat/ncsf_qsym/qsym.py489
-rw-r--r--src/sage/combinat/ncsf_qsym/tutorial.py22
-rw-r--r--src/sage/combinat/ordered_tree.py98
-rw-r--r--src/sage/combinat/partition.py239
-rw-r--r--src/sage/combinat/permutation.py17
-rw-r--r--src/sage/combinat/permutation_cython.pyx2
-rw-r--r--src/sage/combinat/posets/poset_examples.py2
-rw-r--r--src/sage/combinat/posets/posets.py2
-rw-r--r--src/sage/combinat/rigged_configurations/bij_type_B.py2
-rw-r--r--src/sage/combinat/root_system/branching_rules.py4
-rw-r--r--src/sage/combinat/root_system/cartan_matrix.py20
-rw-r--r--src/sage/combinat/root_system/cartan_type.py2
-rw-r--r--src/sage/combinat/root_system/dynkin_diagram.py30
-rw-r--r--src/sage/combinat/root_system/root_system.py2
-rw-r--r--src/sage/combinat/root_system/weyl_characters.py2
-rw-r--r--src/sage/combinat/root_system/weyl_group.py2
-rw-r--r--src/sage/combinat/sf/classical.py2
-rw-r--r--src/sage/combinat/sf/sfa.py440
-rw-r--r--src/sage/combinat/skew_partition.py129
-rw-r--r--src/sage/combinat/sloane_functions.py2
-rw-r--r--src/sage/combinat/species/series.py2
-rw-r--r--src/sage/combinat/species/stream.py2
-rw-r--r--src/sage/combinat/tableau.py10
-rw-r--r--src/sage/combinat/tools.py24
-rw-r--r--src/sage/combinat/words/alphabet.py154
-rw-r--r--src/sage/combinat/words/finite_word.py4
-rw-r--r--src/sage/combinat/words/morphism.py2
-rw-r--r--src/sage/combinat/words/shuffle_product.py124
-rw-r--r--src/sage/crypto/classical.py22
-rw-r--r--src/sage/crypto/classical_cipher.py2
-rw-r--r--src/sage/crypto/stream.py4
-rw-r--r--src/sage/databases/sql_db.py6
-rw-r--r--src/sage/doctest/control.py2
-rw-r--r--src/sage/doctest/reporting.py2
-rw-r--r--src/sage/functions/generalized.py10
-rw-r--r--src/sage/functions/orthogonal_polys.py4
-rw-r--r--src/sage/functions/special.py2
-rw-r--r--src/sage/graphs/base/c_graph.pyx27
-rw-r--r--src/sage/graphs/base/sparse_graph.pyx112
-rw-r--r--src/sage/graphs/bipartite_graph.py50
-rw-r--r--src/sage/graphs/digraph.py8
-rw-r--r--src/sage/graphs/dot2tex_utils.py2
-rw-r--r--src/sage/graphs/generators/random.py2
-rw-r--r--src/sage/graphs/generic_graph.py35
-rw-r--r--src/sage/graphs/graph.py4
-rw-r--r--src/sage/graphs/graph_latex.py4
-rw-r--r--src/sage/graphs/planarity.pyx10
-rw-r--r--src/sage/graphs/schnyder.py2
-rw-r--r--src/sage/groups/generic.py12
-rw-r--r--src/sage/groups/perm_gps/permgroup.py6
-rw-r--r--src/sage/gsl/ode.pyx4
-rw-r--r--src/sage/gsl/probability_distribution.pyx22
-rw-r--r--src/sage/homology/chain_complex.py2
-rw-r--r--src/sage/homology/simplicial_complex.py80
-rw-r--r--src/sage/interacts/debugger.py2
-rw-r--r--src/sage/interfaces/axiom.py2
-rw-r--r--src/sage/interfaces/expect.py6
-rw-r--r--src/sage/interfaces/giac.py2
-rw-r--r--src/sage/interfaces/interface.py4
-rw-r--r--src/sage/interfaces/macaulay2.py2
-rw-r--r--src/sage/interfaces/magma.py2
-rw-r--r--src/sage/interfaces/maple.py2
-rw-r--r--src/sage/interfaces/mathematica.py2
-rw-r--r--src/sage/interfaces/phc.py2
-rw-r--r--src/sage/interfaces/tests.py2
-rw-r--r--src/sage/lfunctions/lcalc.py3
-rw-r--r--src/sage/libs/lcalc/lcalc_Lfunction.pxd8
-rw-r--r--src/sage/libs/lcalc/lcalc_Lfunction.pyx408
-rw-r--r--src/sage/libs/ntl/ntl_lzz_p.pyx2
-rw-r--r--src/sage/libs/ntl/ntl_lzz_pX.pyx2
-rw-r--r--src/sage/libs/pari/gen.pyx78
-rw-r--r--src/sage/libs/polybori/pb_wrap.h (renamed from src/c_lib/include/pb_wrap.h)0
-rw-r--r--src/sage/matrix/constructor.py2
-rw-r--r--src/sage/matrix/matrix2.pyx56
-rw-r--r--src/sage/matrix/matrix_double_dense.pyx2
-rw-r--r--src/sage/matrix/operation_table.py6
-rw-r--r--src/sage/misc/attached_files.py4
-rw-r--r--src/sage/misc/explain_pickle.py2
-rw-r--r--src/sage/misc/functional.py13
-rw-r--r--src/sage/misc/getusage.py2
-rw-r--r--src/sage/misc/latex.py3
-rw-r--r--src/sage/misc/lazy_list.pyx12
-rw-r--r--src/sage/misc/log.py2
-rw-r--r--src/sage/misc/misc.py2
-rw-r--r--src/sage/misc/random_testing.py6
-rw-r--r--src/sage/misc/sage_extension.py4
-rw-r--r--src/sage/misc/sageinspect.py8
-rw-r--r--src/sage/modular/arithgroup/congroup_pyx.pyx2
-rw-r--r--src/sage/modular/modform/element.py6
-rw-r--r--src/sage/modules/vector_double_dense.pyx2
-rw-r--r--src/sage/monoids/string_monoid_element.py2
-rw-r--r--src/sage/plot/all.py2
-rw-r--r--src/sage/plot/animate.py470
-rw-r--r--src/sage/plot/graphics.py85
-rw-r--r--src/sage/plot/line.py1
-rw-r--r--src/sage/plot/matrix_plot.py2
-rw-r--r--src/sage/plot/plot3d/base.pyx22
-rw-r--r--src/sage/plot/plot3d/implicit_surface.pyx2
-rw-r--r--src/sage/plot/plot3d/tachyon.py77
-rw-r--r--src/sage/quadratic_forms/extras.py2
-rw-r--r--src/sage/quadratic_forms/quadratic_form.py14
-rw-r--r--src/sage/quadratic_forms/quadratic_form__automorphisms.py4
-rw-r--r--src/sage/quadratic_forms/quadratic_form__genus.py4
-rw-r--r--src/sage/quadratic_forms/quadratic_form__local_normal_form.py2
-rw-r--r--src/sage/quadratic_forms/quadratic_form__variable_substitutions.py2
-rw-r--r--src/sage/quadratic_forms/random_quadraticform.py4
-rw-r--r--src/sage/rings/complex_mpc.pyx2
-rw-r--r--src/sage/rings/finite_rings/integer_mod.pyx34
-rw-r--r--src/sage/rings/fraction_field_element.pyx2
-rw-r--r--src/sage/rings/homset.py8
-rw-r--r--src/sage/rings/integer.pyx2
-rw-r--r--src/sage/rings/morphism.pyx6
-rw-r--r--src/sage/rings/number_field/morphism.py2
-rw-r--r--src/sage/rings/number_field/totallyreal_rel.py6
-rw-r--r--src/sage/rings/polynomial/cyclotomic.pyx2
-rw-r--r--src/sage/rings/polynomial/groebner_fan.py4
-rw-r--r--src/sage/rings/polynomial/infinite_polynomial_element.py12
-rw-r--r--src/sage/rings/polynomial/infinite_polynomial_ring.py18
-rw-r--r--src/sage/rings/polynomial/multi_polynomial_ideal.py115
-rw-r--r--src/sage/rings/polynomial/multi_polynomial_libsingular.pyx290
-rw-r--r--src/sage/rings/polynomial/pbori.pyx8
-rw-r--r--src/sage/rings/polynomial/polynomial_ring.py10
-rw-r--r--src/sage/rings/polynomial/symmetric_ideal.py4
-rw-r--r--src/sage/rings/polynomial/term_order.py6
-rw-r--r--src/sage/rings/polynomial/toy_variety.py6
-rw-r--r--src/sage/rings/power_series_ring_element.pyx2
-rw-r--r--src/sage/rings/rational.pyx2
-rw-r--r--src/sage/rings/real_lazy.pyx2
-rw-r--r--src/sage/rings/residue_field.pyx11
-rw-r--r--src/sage/schemes/affine/affine_morphism.py2
-rw-r--r--src/sage/schemes/affine/affine_rational_point.py2
-rw-r--r--src/sage/schemes/elliptic_curves/ell_field.py6
-rw-r--r--src/sage/schemes/elliptic_curves/ell_finite_field.py2
-rw-r--r--src/sage/schemes/elliptic_curves/ell_point.py4
-rw-r--r--src/sage/schemes/elliptic_curves/ell_rational_field.py2
-rw-r--r--src/sage/schemes/elliptic_curves/ell_tate_curve.py2
-rw-r--r--src/sage/schemes/elliptic_curves/gal_reps.py2
-rw-r--r--src/sage/schemes/elliptic_curves/lseries_ell.py6
-rw-r--r--src/sage/schemes/projective/projective_space.py2
-rw-r--r--src/sage/server/support.py2
-rw-r--r--src/sage/sets/family.py166
-rw-r--r--src/sage/sets/totally_ordered_finite_set.py2
-rw-r--r--src/sage/structure/category_object.pyx2
-rw-r--r--src/sage/structure/coerce.pyx8
-rw-r--r--src/sage/structure/coerce_maps.pyx12
-rw-r--r--src/sage/structure/element.pyx2
-rw-r--r--src/sage/structure/factorization.py4
-rw-r--r--src/sage/structure/parent.pyx8
-rw-r--r--src/sage/structure/parent_old.pyx4
-rw-r--r--src/sage/structure/sage_object.pyx4
-rw-r--r--src/sage/symbolic/constants_c.pxd2
-rw-r--r--src/sage/symbolic/constants_c.pyx2
-rw-r--r--src/sage/symbolic/expression.pxd2
-rw-r--r--src/sage/symbolic/expression.pyx13
-rw-r--r--src/sage/symbolic/function.pyx4
-rw-r--r--src/sage/symbolic/getitem.pyx2
-rw-r--r--src/sage/symbolic/ginac.pxd (renamed from src/sage/libs/ginac.pxd)0
-rw-r--r--src/sage/symbolic/ginac_wrap.h (renamed from src/c_lib/include/ginac_wrap.h)0
-rw-r--r--src/sage/symbolic/pynac.pyx10
-rw-r--r--src/sage/symbolic/relation.py8
-rw-r--r--src/sage/symbolic/ring.pyx2
-rw-r--r--src/sage/version.py4
216 files changed, 8094 insertions, 2214 deletions
diff --git a/README.txt b/README.txt
index eb614bd..b4bbee9 100644
--- a/README.txt
+++ b/README.txt
@@ -75,12 +75,23 @@ Installation Guide:
"Precise"), you need the dpkg-dev package.
OS X: Xcode. Make sure you have installed the most recent version
- of Xcode. For pre-Lion versions of OS X, you can download Xcode
- from http://developer.apple.com/downloads/. For OS X Lion, you can
- install it using the App Store. With Xcode 4.3 or later, you need
- to install the "Command Line Tools": from the File menu, choose
- "Preferences", then the "Downloads" tab, and then "Install" the
- Command Line Tools.
+ of Xcode. With recent versions of OS X (OS X Lion or later), you
+ can install Xcode for free from the App Store. For pre-Lion
+ versions of OS X, you can download Xcode from
+ http://developer.apple.com/downloads/.
+
+ With OS X, you also need to install the "command line tools". When
+ using OS X Mavericks, after installing Xcode, run this command from
+ a terminal window:
+
+ xcode-select --install
+
+ Then click "Install" in the pop-up window.
+
+ When using OS X Mountain Lion or earlier, you need to install the
+ command line tools from Xcode: run Xcode; then from the File
+ menu, choose "Preferences", then the "Downloads" tab, and then
+ "Install" the Command Line Tools.
Other platforms: See detailed instructions below.
diff --git a/VERSION.txt b/VERSION.txt
index 1c3c3ec..0f3dc25 100644
--- a/VERSION.txt
+++ b/VERSION.txt
@@ -1 +1 @@
-Sage version 6.2.beta0, released 2014-02-02
+Sage version 6.2.beta1, released 2014-02-07
diff --git a/build/deps b/build/deps
index aceb6da..b27ddb3 100644
--- a/build/deps
+++ b/build/deps
@@ -476,8 +476,6 @@ $(INST)/csage: $(INST)/$(SCONS) \
$(INST)/$(MPIR) \
$(INST)/$(NTL) \
$(INST)/$(PARI) \
- $(INST)/$(POLYBORI) \
- $(INST)/$(PYNAC) \
$(INST)/$(PYTHON)
if [ -z "$$SAGE_INSTALL_FETCH_ONLY" ]; then \
cd $(SAGE_SRC) && source bin/sage-env && cd c_lib && \
diff --git a/build/pkgs/configure/checksums.ini b/build/pkgs/configure/checksums.ini
index 2018f8c..6f3ab7e 100644
--- a/build/pkgs/configure/checksums.ini
+++ b/build/pkgs/configure/checksums.ini
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
-sha1=fe9add8a54ba26a8073f083b53a381e205da52bd
-md5=9c311beb40f324c1f8d3fe681f8417e4
-cksum=3541167752
+sha1=e0f0951560918d79141995852f276ac3e99a42f4
+md5=33b6cac80bafecc0ad880fd68cf258e6
+cksum=3483617699
diff --git a/build/pkgs/configure/package-version.txt b/build/pkgs/configure/package-version.txt
index ec63514..b4de394 100644
--- a/build/pkgs/configure/package-version.txt
+++ b/build/pkgs/configure/package-version.txt
@@ -1 +1 @@
-9
+11
diff --git a/build/pkgs/flint/SPKG.txt b/build/pkgs/flint/SPKG.txt
index 6dca0b9..fdf022b 100644
--- a/build/pkgs/flint/SPKG.txt
+++ b/build/pkgs/flint/SPKG.txt
@@ -26,224 +26,7 @@ FLINT is licensed GPL v2+.
* MPFR
* NTL
-== Patches ==
-
- * dylib.patch: patch configure so that the shared library is called
- libflint.dylib on Darwin.
- * cflags.patch: patch configure so that "-m64" (and other potentially
- unwanted cflags) is not added on PowerPC G5. Also add -fno-common
- on Darwin, which is needed for OS X 10.4 and doesn't hurt on other
- systems.
-
-== Changelog ==
-
-=== flint-2.3.p1 (Jean-Pierre Flori, 8 May 2013) ===
- * Trac #12173: add dylib.patch and cflags.patch
-
-=== flint-2.3 (Mike Hansen, Fredrik Johansson, Jean-Pierre Flori, May 2012-March 2013) ===
- * Trac #12173: Update FLINT to version 2.3.
- * Removed obsolete patches.
- * Cleanup spkg-install and spkg-check scripts.
- * Removed Cygwin hack for libntl.a made useless by #9050.
- * Removed now useless patch --binary flag on Cygwin.
- * Only build shared library on Cygwin.
-
-=== flint-1.5.2.p3 (Timo Kluck, 7 March 2013) ===
- * #14241: Fix double // path separators in longlong.patch
-
-=== flint-1.5.2.p2 (Paul-Olivier Dehaye, 16 October 2012) ===
- * #9697: Remove the file 'src/zn_poly/demo/bernoulli/.DS_Store'
-
-=== flint-1.5.2.p1 (Jean-Pierre Flori, 3 August 2012) ===
- * #13330: Pass --binary flag to patch on Cygwin to deal with file terminators
- mess.
-
-=== flint-1.5.2.p0 (Dima Pasechnik, March 24th 2012) ===
- * bumped up the version to reflect the fact that we patch the source
-
-=== flint-1.5.2 (Julien Puydt, William Stein, December 21st 2011) ===
- * #10328: enable ARM support; longlong.patch removes non-working
- asm code for 32-bit ARM
-
-=== flint-1.5.0.p10 (Leif Leonhardy, October 11th 2011) ===
- * #9858: Add an upstream patch from FLINT 1.5.2 to make FLINT's test suite
- build (when `SAGE_CHECK=yes`) with MPIR 1.3.x, 2.x (cf. #8664) and GMP 5.x.
- The patch just substitutes deprecated random functions in one file
- (`fmpz-test.c`) which have been removed from the mentioned GMP / MPIR
- versions.
-
-=== flint-1.5.0.p9 (Karl-Dieter Crisman, Dima Pasechnik, 25 August 2011) ===
- * Fix DOS file endings introduced in p7 which made patch fail on some systems
-
-=== flint-1.5.0.p8 (Karl-Dieter Crisman, 12th July 2011) ===
- * Enable both libflint.dll and .so on Cygwin (see Trac 11547).
- * Use 'cp' rather than '$CP' (affects only Cygwin).
- * Remove '.svn' directories from upstream.
-
-=== flint-1.5.0.p7 (Jeroen Demeyer, 6 July 2011) ===
- * Trac #11246: remove check for gcc version since we require gcc >= 4.0.1
- for Sage anyway.
- * Use `patch` instead of `cp` for patching the makefile
- * Remove test_gcc_version.sh and the horrible makepatchfiles
- * Check that `patch` succeeded in spkg-install, apply patches at -p1 level
- * Remove obsolete dist/debian directory
-
-=== flint-1.5.0.p6 (Dima Pasechnik, 25th April 2011) ===
- * removed extraneous #include statements in ZmodF_mul.c, ZmodF_poly.c, and, mpn_extras.h, which
- triggered a clash of typedef for ulong in sys/types.h and #define ulong in flint.h
- on Cygwin (trac ticket 11246).
-
-=== flint-1.5.0.p5 (David Kirkby, 19th June 2010) ===
- * #9277 Add -m64 flag when building the Flint test suite
- if SAGE64 is set to "yes". Otherwise it builds 32-bit
- objects and so the test files are not built, but instead
- generating the usual "WRONG ELF CLASS" error.
- * Remove a couple of lines which call spkg-check from
- spkg-install if SAGE_CHECK is set to "yes". Otherwise,
- spkg-check gets called twice, which is a waste of time.
- I'm afraid to say it was probably me that put those couple
- of lines in a year or two ago, before I realised how
- spkg-check was supposed to be called.
-
-=== flint-1.5.0.p4 (Jaap Spies, Feb 23th, 2010) ===
- * #8112 Pass CFLAG64 to FLINT_TUNE if set for a 64 bit build.
-
-=== flint-1.5.0.p3 (David Kirkby, January 2nd, 2010) ===
- * #7815 Changed makes and spkg-install so that the flag -m64 got
- added with a 64-bit build.
-
-=== flint-1.5.0.p1 (William Stein, September 25th, 2009) ===
- * Included a cygwin fix that involves naming the library .dll instead of .so.
-
-=== flint-1.5.0.p0 (Mike Hansen, September 25th, 2009) ===
- * Updated to 1.5.0.
-
-=== flint-1.3.0p3 (Ondrej Certik, September 20th, 2009) ===
- * Move libntl.a out of the way temporarily on CYGWIN (this makes the package
- built, because it will link to the .so lib instead)
-
-=== flint-1.3.0p2 (David Kirkby, June 30th, 2009) ===
- * Change '-a' to '-p' option spkg-install so flint installs
- on Solaris too. The usual GNUism. Only one byte is changed!
-
-=== flint-1.3.0 (Nick Alexander, June 9th, 2009) ===
- * Update to latest upstream FLINT, 1.3.0.
-
-=== flint-1.3.0 (Nick Alexander, June 9th, 2009) ===
- * Update to latest upstream FLINT, 1.3.0.
-
-=== flint-1.2.5.p0 (Mike Hansen, June 4th, 2009) ===
- * Fix build issues found in #6209.
-
-=== flint-1.2.5 (Michael Abshoff, April 29th, 2009) ===
- * Update to latest upstream FLINT with reenabled znpoly 0.9.
-
-=== flint-1.2.4.p1 (William Stein, April 8th, 2009) ===
- * Disable znpoly.
-
-=== flint-1.2.4.p0 (Michael Abshoff, April 5th, 2009) ===
- * Build the OSX dylibs with CPP instead of CC
-
-=== flint-1.2.4 (Michael Abshoff, April 3rd, 2009) ===
- * Upgraded to newest stable version
- * remove soname hack on Linux
- * build all tests with CPP since otherwise linker failures due to the NTL interface happen on OSX
-
-=== flint-1.2.3 (Michael Abshoff, April 2nd, 2009) ===
- * Upgraded to newest stable version
-
-=== flint-1.2.2 (Burcin Erocal, March 31st, 2009) ===
- * Upgraded to newest stable version
-
-=== flint-1.2.1 (Burcin Erocal, March 15th, 2009) ===
- * Upgraded to newest stable version
- * delay deleting library in local/lib until build is complete
- * added zmod_mat-test and NTL-interface-test to spkg-check
- * spkg-check now exits on error
- * enabled tests
-
-=== flint-1.1.2 (William Stein, March 1st, 2009) ===
- * Upgraded to newest stable version
-
-=== flint-1.1.1 (William Stein, February 28th, 2009) ===
- * Upgraded to newest stable version
-
-=== flint-1.0.21.0 (Michael Abshoff, January 2nd, 2009) ===
- * do not run the test suite automatically
-
-=== flint-1.0.21 (Michael Abshoff, December 23rd, 2008) ===
- * Upgrade to latest upstream (#4879)
-
-=== flint-1.0.20 (Michael Abshoff, December 23rd, 2008) ===
- * Upgrade to latest upstream (#4861)
- * clean up SPKG.txt
-
-=== flint-1.0.13.p0 (Michael Abshoff, August 18th, 2008) ===
- * Add 64 bit OSX support
-
-=== flint-1.0.13 (Michael Abshoff, July 21st, 2008) ===
- * Update FLINT to 1.0.13 release
-
-=== flint-1.011.p0 (William Stein, July 9th, 2008) ===
- * Fixed trac #3627: another FLINT BUG (in in ZmodF_poly_pointwise_mul): illegal instruction on modular/modsym/subspace.py on P4 3.4Ghz with 3.0.4.rc0
-
-=== flint-1.011 (Michael Abshoff, July 9th, 2008) ===
- * update FLINT to 1.0.11 release (fixes a critical Itanium bug - thanks to Bill Hart)
- * turn on spkg-check per default
- * add additional tests to spkg-check as instructed by Bill Hart
-
-=== flint-1.010.p0 (Michael Abshoff, July 6th, 2008) ===
- * Only check major and minor gcc release number, not tiny (fixes #3528)
-
-=== flint-1.010 (William Stein and Craig Citro, June 30, 2008) ===
- * upgrade to version 1.0.10
-
-=== flint-1.06.p3 (Michael Abshoff, April 1st, 2008) ===
- * import shared library versioning for flint (Tim Abbott, #3259)
- * create proper link, fix bash shebang
- * make sure $SAGE_LOCAL is defined (#633)
-
-=== flint-1.06.p2 (Michael Abshoff, April 1st, 2008) ===
- * Debian amd64 fixes for FLINT (Tim Abbott, #2762)
- * Debian Copyright patch for FLINT (Tim Abbott, #2199)
-
-=== flint-1.06.p0 (Michael Abshoff, February 2nd, 2008) ===
- * disable mandatory check
-
-=== flint-1.06 (Michael Abshoff, January 19th, 2008) ===
- * update to FLINT 1.0.6 release
- * turn make check on again per default
-
-=== flint-1.05.p0 (Michael Abshoff, January 17th, 2008) ===
- * disable mandatory check
-
-=== flint-1.05 (Michael Abshoff) ===
- * update to FLINT 1.05
-
-2007-12-19 (Michael Abshoff):
- + update to FLINT 1.03
- + reenable mandatory "make check"
-
-2007-12-16 (Michael Abshoff):
- + disable mandatory "make check"
- + remove -B flag in make check since it breaks make 2.79 and earlier
-
-2007-12-10 (Michael Abshoff): Update to FLINT 1.02
-
-2007-12-08 (Michael Abshoff): Update to FLINT 1.01
-
-2007-12-06 (Michael Abshoff): Update to FLINT 1.00
-
-2007-11-25 (Michael Abshoff): add "flint_stack_release();" in fmpz_poly.c:1485
- to avoid a memory leak. Deteced and fixed by Bill Hart
-
-2007-11-24 (Michael Abshoff): upgraded to svn r1075
-
-2007-10-02 (William Stein): upgraded to svn 1012
-
-2007-10-02 (Robert Bradshaw): upgraded to svn r1068
-
-Obtained from:
- svn export https://flint.svn.sourceforge.net/svnroot/flint/trunk
-
+== Special Update/Build Instructions ==
+=== Patches ===
+ * test_empty_string.patch: fix test for empty string in Makefile.in.
diff --git a/build/pkgs/flint/checksums.ini b/build/pkgs/flint/checksums.ini
index 825e003..ce64bd5 100644
--- a/build/pkgs/flint/checksums.ini
+++ b/build/pkgs/flint/checksums.ini
@@ -1,4 +1,4 @@
-tarball=flint-VERSION.tar.bz2
-sha1=03cb7f95b960cb64693d01a8c0b6243e64aca74c
-md5=932e1c8790b3c761eb0bc058cfdcc50b
-cksum=970975353
+tarball=flint-VERSION.tar.gz
+sha1=b506c3870a3d976796ec0b6224659e9c82dcceae
+md5=3b9bc754ef9e974ad4d0cf808d9809df
+cksum=1290600232
diff --git a/build/pkgs/flint/package-version.txt b/build/pkgs/flint/package-version.txt
index 3b11617..2cf4320 100644
--- a/build/pkgs/flint/package-version.txt
+++ b/build/pkgs/flint/package-version.txt
@@ -1 +1 @@
-2.3.p1
+2.4.1.p0
diff --git a/build/pkgs/flint/patches/cflags.patch b/build/pkgs/flint/patches/cflags.patch
deleted file mode 100644
index 55ce02a..0000000
--- a/build/pkgs/flint/patches/cflags.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff -ru src/configure b/configure
---- src/configure 2012-11-09 21:42:47.000000000 +0100
-+++ b/configure 2013-05-08 12:12:08.233238871 +0200
-@@ -262,13 +262,7 @@
- #various tuning parameters
-
- if [ -z "$FLINT_TUNE" ]; then
-- if [ "$KERNEL" = "Linux" -a "$ARCH" = "x86_64" ]; then
-- FLINT_TUNE="-funroll-loops"
-- elif [ "$KERNEL" = "Darwin" -a "$ARCH" = "ppc" ]; then
-- FLINT_TUNE=" -funroll-loops"
-- elif [ "`uname -p`" = "powerpc" ]; then
-- FLINT_TUNE="-m64 -mcpu=970 -mtune=970 -mpowerpc64 -falign-loops=16 -falign-functions=16 -falign-labels=16 -falign-jumps=16"
-- elif [ "$ARCH" = "ia64" ]; then
-+ if [ "$ARCH" = "ia64" ]; then
- # -funroll-loops crashes the build on itanium under GCC-4.2.1, as reported by
- # Kate Minola.
- FLINT_TUNE=""
-@@ -325,6 +319,11 @@
- CFLAGS="-O2 -g -ansi -pedantic -Wall $POPCNT_FLAG $ABI_FLAG"
- fi
-
-+# Old Darwin versions (OS X 10.4) require -fno-common
-+if [ "$KERNEL" = Darwin ]; then
-+ CFLAGS="-fno-common $CFLAGS"
-+fi
-+
- #add tuning parameters to CFLAGS
-
- CFLAGS="$CFLAGS $FLINT_TUNE"
diff --git a/build/pkgs/flint/patches/dylib.patch b/build/pkgs/flint/patches/dylib.patch
deleted file mode 100644
index b7be024..0000000
--- a/build/pkgs/flint/patches/dylib.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-diff -druN src.orig/configure src/configure
---- src.orig/configure 2012-11-09 21:42:47.000000000 +0100
-+++ src/configure 2013-03-06 18:21:03.644037750 +0100
-@@ -225,12 +225,7 @@
- if [ -z "$FLINT_LIB" ]; then
- case $OS in
- Darwin)
-- case $MACHINE in
-- *64)
-- FLINT_LIB="libflint.dylib64";;
-- *)
-- FLINT_LIB="libflint.dylib";;
-- esac;;
-+ FLINT_LIB="libflint.dylib";;
- CYGWIN | MINGW*)
- FLINT_LIB="libflint.dll";;
- *)
diff --git a/build/pkgs/flint/patches/test_empty_string.patch b/build/pkgs/flint/patches/test_empty_string.patch
new file mode 100644
index 0000000..b407392
--- /dev/null
+++ b/build/pkgs/flint/patches/test_empty_string.patch
@@ -0,0 +1,19 @@
+commit 81c820b73dc0208f107629d7658f4f0642ca64e8
+Author: Jean-Pierre Flori <jean-pierre.flori@ssi.gouv.fr>
+Date: Mon Feb 3 15:02:22 2014 +0100
+
+ Fix test for empty string in install target.
+
+diff --git a/Makefile.in b/Makefile.in
+index 0fa717b..19caed2 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -178,7 +178,7 @@ install: library
+ cp libflint.a $(DESTDIR)$(PREFIX)/lib; \
+ fi
+ cp $(HEADERS) $(DESTDIR)$(PREFIX)/include/flint
+- $(AT)if [ ! -z $(EXT_HEADERS) ]; then \
++ $(AT)if [ ! -z "$(EXT_HEADERS)" ]; then \
+ cp $(EXT_HEADERS) $(DESTDIR)$(PREFIX)/include/flint; \
+ fi
+ mkdir -p $(DESTDIR)$(FLINT_CPIMPORT_DIR)
diff --git a/build/pkgs/lcalc/SPKG.txt b/build/pkgs/lcalc/SPKG.txt
index 8c70e38..67f8dd8 100644
--- a/build/pkgs/lcalc/SPKG.txt
+++ b/build/pkgs/lcalc/SPKG.txt
@@ -81,162 +81,13 @@ http://code.google.com/p/l-calc/
to not redefine the double() cast, thats just fragile and will sooner or
later again fail inside some system headers.
* pari-2.4.4.patch:
- (Patches src/src/Lcommandline.cc and src/src/Lcommandline_elliptic.cc)
- Use allocatemem() instead of allocatemoremem() which the new PARI no
- longer supports. Also replace lgeti() by (long)cgeti().
+ Replace obsolete lgeti() by (long)cgeti().
+ * init_stack.patch:
+ Replace obsolete allocatemoremem() by a direct call to the private
+ function pari_init_stack(). The public function allocatemem() prints
+ useless warnings and is by definition treated as an error.
* time.h.patch:
(Patches src/include/Lcommandline_numbertheory.h)
Include also <time.h> in Lcommandline_numbertheory.h (at least required
on Cygwin, cf. #9845).
This should get reported upstream.
-
-== Changelog ==
-
-=== lcalc-1.23.p11 (Jean-Pierre Flori, 8 August 2012) ===
- * #13351: modify Makefile to define binaries and libraries extension
- according to host system. As a side effect, this let
- sage.libs.lcalc.lcal_Lfunction be imported on Cygwin.
-
-=== lcalc-1.23.p10 (Leif Leonhardy, March 17th 2012) ===
- * #12681: Fix hard-coded 'g++'.
- The (patched) Makefile now uses $(CXX) (which *defaults* to 'g++')
- for compiling and linking C++, $(CC) (which *defaults* to 'gcc') for
- compiling C, although the latter is [currently] hardly used.
- See also "Special Update/Build Instructions" above. (We could now also
- set `INSTALL_DIR` and use 'make install'...)
-
-=== lcalc-1.23.p9 (Jeroen Demeyer, Leif Leonhardy, 6 October 2011) ===
- * Trac #11321: Add a patch for PARI-2.4.4 (use allocatemem() instead of
- allocatemoremem())
- * Remove unused patch Lcommandline_elliptic.cc.cygwin.diff
- * Use `patch` for patching instead of `cp`.
- * Restore upstream sources (src/src/Makefile was edited) but remove
- garbage files mentioned above.
- * Remove date from spkg version string
- * Various clean-up in spkg-install
-
-=== lcalc-20100428-1.23.p6 (Volker Braun, March 8, 2011) ===
- * upstream commented out lcalc_to_double(long double), but this is
- now required with gcc-4.6. Comment back in!
-
-=== lcalc-20100428-1.23.p5 (Jeroen Demeyer, September 19, 2010) ===
- * Remove dist directory
- * Put back SAGE_LOCAL sanity check in spkg-install
- * Change "make" to "$MAKE"
-
-=== lcalc-20100428-1.23.p4 (Mike Hansen, William Stein, September 2, 2010) ===
- * Add time.h include to Lcommandline_numbertheory.h (this should get upstreamed)
-
-=== lcalc-20100428-1.23.p3 (Mike Hansen, August 21, 2010) ===
- * Update to work on Cygwin.
- * #9775: lcalc should make a .dll file on Cygwin instead of .so file
-
-=== lcalc-20100428-1.23.p2 (John Cremona, August 13 2010 following Jeroen Demeyer, July 24, 2010) ===
- * Upgrade to PARI/GP 2.4.3 (#9343 and #9592).
- * Removed some code from spkg-install made redundant when upgrading to 1.23
- in March 2010.
-
-=== lcalc-20100428-1.23.p1 (Rishikesh, 2nd Aug 2010) ===
- * Detect OS X 10.4 and copy to libLfunction.dylib instead of libLfunction.so
-
-=== lcalc-20100428-1.23.p0 (David Kirkby, 27th May 2010) ===
- * See: #9043 - lcalc failing to build on OpenSolaris x64.
- * Force 64-bit build if SAGE64 is set to "yes" and not "yes"
- and "1" as before, since an early part of Sage ensures SAGE64
- can only be "yes" or "no", so it is pointless to check for "1" too.
- * Added a variable CXXFLAG64 to spkg-install, which defaults to
- -m64, but can be set as an environment variable to whatever flag
- is needed by the C++ compiler.
- * Export CXXFLAG64 if SAGE64 is set to "yes".
- * Added {$CXXFLAG64} to patches/Makefile.sage, so that the right flag
- is added for a 64-bit build at the link phase.
- * It should be noted the Makefile makes extensive use of $(FOOBAR),
- but such variables only work internally to the Makefile. If they need
- to be inported, then it needs to be ${FOOBAR}, and not $(FOOBAR).
- * Removed these 4 files from the source, since they serve no useful
- purpose (see note in Special Build Instructions).
- ./src/src/.Makefile.old.swp
- ./src/src/.Lcommandline.ggo.swp
- ./src/include/.Lvalue.h.swp
- ./src/include/.Lexplicit_formula.h.swp
-
-=== lcalc-20100428-1.23 (Rishikesh, 24th March 2010) ===
- * changed spkg-install to change location of header files (#4793)
- * changed compile flags so that lcalc compiles on OSX (#4793)
-
-=== lcalc-20100428-1.23 (Rishikesh, 9th March 2010) ===
- * Changed makefile to compile on solaris (#5396)
- * For lcalc wrapper, changed so that the library is copied(#5396)
- * Replace the hard coded path to pari makefile to the $SAGE_LOCAL(#5396)
-
-=== lcalc-20080205.p3 (David kirkby, 15th September, 2009) ===
- * A general tidy-up/improvement in many ways, including:
- * Force an exit on errors with 'set -e'
- * Check for SAGE_LOCAL in a better way
- * Build with debug flags as default, but allow them to be removed
- * Add flags to generate all warnings messages on both Sun and GNU compilers.
- This causes tons of warning messages from lcacl.
- * Check that the C, C++ and Fortran compilers are not a mix of Sun and GNU
- * Remove the flags which were sent directly to the assembler to
- suppress warnings. The -W flag, which works on the GNU assembler,
- is not portable and fails with Sun's assembler.
- * All tests performed in what I believe is the safest and most
- portable way, such as using || instead of -o in tests.
- * Changed the Makefile to use CXXFLAGS rather than CFLAGS, as the
- source is C++ not C, and the compiler used is the C++ compiler,
- which will ignore CFLAGS.
- * Added appropiate options to FCFLAGS. Not needed for 'lcalc', but I
- hope to use this as a template for more widespread use in Sage. It
- may however need more work, particularly in handling Fortran (There
- may be specific issues when the Fortran compiler is f90.)
- * Print variable names, to aid debugging.
- * Allow debug information to be removed from file, if
- SAGE_DEBUG is set to 'no', 'false' or '0'
- By default, debugging information will be supplied.
-
-=== lcalc-20080205.p2 (Michael Abshoff, July 15th, 2008) ===
- * remove "-static-libgcc" from CFLAGS (fixes #3647)
-
-=== lcalc-20080205.p1 (Michael Abshoff, May 18th, 2008) ===
- * add 64 bit OSX build support
-
-=== lcalc-20080205.p0 (Michael Abshoff, April 19th, 2008) ===
- * Apply Tim Abbott's Debian build fix (#2967)
-
-=== lcalc-20080205 (Michael Abshoff, April 13th, 2008) ===
- * update to lcalc 1.11 (2008-Feb-05)
- * Apply all three patches from patches directory
- * fix gcc 4.3 build issues
- * fix Solaris build
- * do not strip the lcalc binary
-
-=== lcalc-20070105 ===
- * modified Lcommandline_elliptic.cc to work with Cygwin
- by defining a certain macro. *** carry this change over when
- updating the package *** and of course backport it upstream.
-
-* New version from Mike R. on 2006-12-05.
-
-* I replaced the included Makefile with my own, since I'm only interested
- in building lcalc and not the library. Also, since I'm not doing
- development on lcalc, the dependencies aren't needed in order
- to minimize build time.
-
-
-* 2006-09-15: Fix to spkg-install suggested by Kate Minola:
-In lcalc-2006.03.05/spkg-install there is
-: CFLAGS="$CFLAGS -O2 -g -Wa,-W -fno-exceptions -Wno-deprecated"
-:
-: cd src
-:
-: echo "Building Rubinstein's lcalc program using $CXX..."
-:
-: make lcalc
-but since the environment variable CFLAGS is never exported, the subshell
-entered with 'make lcalc' does not pick up the new CFLAGS. You need to
-add
- export CFLAGS
-after the new definition of CLAGS.
-
-* Kate Minola:
- Added -static-libgcc
diff --git a/build/pkgs/lcalc/package-version.txt b/build/pkgs/lcalc/package-version.txt
index c63180d..a7292bf 100644
--- a/build/pkgs/lcalc/package-version.txt
+++ b/build/pkgs/lcalc/package-version.txt
@@ -1 +1 @@
-1.23.p11
+1.23.p12
diff --git a/build/pkgs/lcalc/patches/init_stack.patch b/build/pkgs/lcalc/patches/init_stack.patch
new file mode 100644
index 0000000..e9e0237
--- /dev/null
+++ b/build/pkgs/lcalc/patches/init_stack.patch
@@ -0,0 +1,31 @@
+diff -ru src/include/Lcommandline.h b/include/Lcommandline.h
+--- src/include/Lcommandline.h 2012-08-08 23:21:55.000000000 +0200
++++ b/include/Lcommandline.h 2014-01-06 14:04:55.981027532 +0100
+@@ -40,12 +40,7 @@
+ #include "Lcommandline_globals.h" //command line global variables
+ #ifdef INCLUDE_PARI
+ #include "pari.h" //for pari's elliptic curve functions
+-#undef init //pari has a '#define init pari_init' which
+- //causes trouble with the stream.h init.
+- //pari also causes trouble with things like abs.
+- //we place the pari include first since otherwise it
+- //messes up.
+-
++#include "paripriv.h" //for pari_init_stack()
+ #endif //ifdef INCLUDE_PARI
+
+
+diff -ru src/src/Lcommandline.cc b/src/Lcommandline.cc
+--- src/src/Lcommandline.cc 2012-08-08 23:21:56.000000000 +0200
++++ b/src/Lcommandline.cc 2014-01-06 14:02:19.463388366 +0100
+@@ -473,7 +473,9 @@
+
+ #ifdef INCLUDE_PARI
+ if(do_elliptic_curve){
+- allocatemoremem((int) N_terms*16+1000000); //XXXXXXXXX this should depend on whether we're double or long double or mpfr double
++ // Reallocate PARI stack
++ pari_init_stack((size_t)N_terms*16 + 1000000, top-bot); //XXXXXXXXX this should depend on whether we're double or long double or mpfr double
++
+ if (my_verbose>0) cout << "Will precompute " << N_terms << " elliptic L-function dirichlet coefficients..." << endl;
+ initialize_new_L(a1,a2,a3,a4,a6,N_terms);
+ }
diff --git a/build/pkgs/lcalc/patches/pari-2.4.4.patch b/build/pkgs/lcalc/patches/pari-2.4.4.patch
index 13ecf1b..cee0351 100644
--- a/build/pkgs/lcalc/patches/pari-2.4.4.patch
+++ b/build/pkgs/lcalc/patches/pari-2.4.4.patch
@@ -1,33 +1,3 @@
---- src/src/Lcommandline.cc 2010-01-31 16:16:45.000000000 +0100
-+++ src/src/Lcommandline.cc 2011-05-10 17:22:10.000000000 +0200
-@@ -31,6 +31,12 @@
- #include "Lcommandline.h"
- #include "cmdline.h"
-
-+/* No-operation error recovery routine for PARI. This is needed for
-+ * allocatemem(), which calls the error recovery routine (because
-+ * allocatemem() destroys the PARI stack).
-+ */
-+void pari_err_recover_nop(long errnum) {return;}
-+
- int main (int argc, char *argv[])
- {
-
-@@ -473,7 +479,13 @@
-
- #ifdef INCLUDE_PARI
- if(do_elliptic_curve){
-- allocatemoremem((int) N_terms*16+1000000); //XXXXXXXXX this should depend on whether we're double or long double or mpfr double
-+ /* allocatemem() calls the callback function cb_pari_err_recover(),
-+ * which we temporarily change to do nothing. */
-+ void (*saved_err_recover)(long) = cb_pari_err_recover;
-+ cb_pari_err_recover = pari_err_recover_nop;
-+ allocatemem(N_terms*16 + 1000000); //XXXXXXXXX this should depend on whether we're double or long double or mpfr double
-+ cb_pari_err_recover = saved_err_recover;
-+
- if (my_verbose>0) cout << "Will precompute " << N_terms << " elliptic L-function dirichlet coefficients..." << endl;
- initialize_new_L(a1,a2,a3,a4,a6,N_terms);
- }
--- src/src/Lcommandline_elliptic.cc 2010-01-31 16:16:45.000000000 +0100
+++ src/src/Lcommandline_elliptic.cc 2011-05-10 17:08:10.000000000 +0200
@@ -121,11 +121,11 @@
diff --git a/build/pkgs/ncurses/SPKG.txt b/build/pkgs/ncurses/SPKG.txt
index 2c62aa5..ee995e9 100644
--- a/build/pkgs/ncurses/SPKG.txt
+++ b/build/pkgs/ncurses/SPKG.txt
@@ -44,19 +44,6 @@ None
=== Patches ===
- * None.
+ * xopen_source.patch: remove harmful check from aclocal.m4 which may
+ reintroduce XOPEN_SOURCE on systems where it should not be used.
-== Changelog ==
-
-=== ncurses-5.9-20131221 (Jean-Pierre Flori, 1 January 2014) ===
- * #15617: Update ncurses to dev version 5.9-20131221.
-
-=== ncurses-5.9.p2 (Jean-Pierre Flori, 4 November 2013) ===
- * #15268: Let ncurses build on Solaris.
- * Build without ADA support.
-
-=== ncurses-5.9.p1 (Volker Braun, 22 Aug 2013) ===
- * Build narrow and wide versions (#15080)
-
-=== ncurses-5.9 (Volker Braun, 3 April 2013) ===
- * Initial version
diff --git a/build/pkgs/ncurses/patches/xopen_source.patch b/build/pkgs/ncurses/patches/xopen_source.patch
new file mode 100644
index 0000000..cbb128b
--- /dev/null
+++ b/build/pkgs/ncurses/patches/xopen_source.patch
@@ -0,0 +1,313 @@
+diff -druN ncurses-5.9.20131221.orig/aclocal.m4 ncurses-5.9.20131221/aclocal.m4
+--- ncurses-5.9.20131221.orig/aclocal.m4 2013-11-23 10:20:50.000000000 -0800
++++ ncurses-5.9.20131221/aclocal.m4 2014-02-07 06:00:43.277597929 -0800
+@@ -7198,32 +7198,3 @@
+ CF_ADD_CFLAGS($cf_xopen_source)
+ fi
+
+-dnl In anything but the default case, we may have system-specific setting
+-dnl which is still not guaranteed to provide all of the entrypoints that
+-dnl _XOPEN_SOURCE would yield.
+-if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
+- AC_MSG_CHECKING(if _XOPEN_SOURCE really is set)
+- AC_TRY_COMPILE([#include <stdlib.h>],[
+-#ifndef _XOPEN_SOURCE
+-make an error
+-#endif],
+- [cf_XOPEN_SOURCE_set=yes],
+- [cf_XOPEN_SOURCE_set=no])
+- AC_MSG_RESULT($cf_XOPEN_SOURCE_set)
+- if test $cf_XOPEN_SOURCE_set = yes
+- then
+- AC_TRY_COMPILE([#include <stdlib.h>],[
+-#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
+-make an error
+-#endif],
+- [cf_XOPEN_SOURCE_set_ok=yes],
+- [cf_XOPEN_SOURCE_set_ok=no])
+- if test $cf_XOPEN_SOURCE_set_ok = no
+- then
+- AC_MSG_WARN(_XOPEN_SOURCE is lower than requested)
+- fi
+- else
+- CF_TRY_XOPEN_SOURCE
+- fi
+-fi
+-])
+diff -druN ncurses-5.9.20131221.orig/configure ncurses-5.9.20131221/configure
+--- ncurses-5.9.20131221.orig/configure 2013-12-14 16:44:11.000000000 -0800
++++ ncurses-5.9.20131221/configure 2014-02-07 06:01:25.747602176 -0800
+@@ -8119,273 +8119,6 @@
+
+ fi
+
+-if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
+- echo "$as_me:8123: checking if _XOPEN_SOURCE really is set" >&5
+-echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6
+- cat >conftest.$ac_ext <<_ACEOF
+-#line 8126 "configure"
+-#include "confdefs.h"
+-#include <stdlib.h>
+-int
+-main ()
+-{
+-
+-#ifndef _XOPEN_SOURCE
+-make an error
+-#endif
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:8141: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
+- ac_status=$?
+- echo "$as_me:8144: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:8147: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:8150: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- cf_XOPEN_SOURCE_set=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-cat conftest.$ac_ext >&5
+-cf_XOPEN_SOURCE_set=no
+-fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
+- echo "$as_me:8159: result: $cf_XOPEN_SOURCE_set" >&5
+-echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6
+- if test $cf_XOPEN_SOURCE_set = yes
+- then
+- cat >conftest.$ac_ext <<_ACEOF
+-#line 8164 "configure"
+-#include "confdefs.h"
+-#include <stdlib.h>
+-int
+-main ()
+-{
+-
+-#if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
+-make an error
+-#endif
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:8179: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
+- ac_status=$?
+- echo "$as_me:8182: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:8185: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:8188: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- cf_XOPEN_SOURCE_set_ok=yes
+-else
+- echo "$as_me: failed program was:" >&5
+-cat conftest.$ac_ext >&5
+-cf_XOPEN_SOURCE_set_ok=no
+-fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
+- if test $cf_XOPEN_SOURCE_set_ok = no
+- then
+- { echo "$as_me:8199: WARNING: _XOPEN_SOURCE is lower than requested" >&5
+-echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;}
+- fi
+- else
+-
+-echo "$as_me:8204: checking if we should define _XOPEN_SOURCE" >&5
+-echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6
+-if test "${cf_cv_xopen_source+set}" = set; then
+- echo $ECHO_N "(cached) $ECHO_C" >&6
+-else
+-
+- cat >conftest.$ac_ext <<_ACEOF
+-#line 8211 "configure"
+-#include "confdefs.h"
+-
+-#include <stdlib.h>
+-#include <string.h>
+-#include <sys/types.h>
+-
+-int
+-main ()
+-{
+-
+-#ifndef _XOPEN_SOURCE
+-make an error
+-#endif
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:8230: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
+- ac_status=$?
+- echo "$as_me:8233: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:8236: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:8239: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- cf_cv_xopen_source=no
+-else
+- echo "$as_me: failed program was:" >&5
+-cat conftest.$ac_ext >&5
+-cf_save="$CPPFLAGS"
+- CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+- cat >conftest.$ac_ext <<_ACEOF
+-#line 8248 "configure"
+-#include "confdefs.h"
+-
+-#include <stdlib.h>
+-#include <string.h>
+-#include <sys/types.h>
+-
+-int
+-main ()
+-{
+-
+-#ifdef _XOPEN_SOURCE
+-make an error
+-#endif
+- ;
+- return 0;
+-}
+-_ACEOF
+-rm -f conftest.$ac_objext
+-if { (eval echo "$as_me:8267: \"$ac_compile\"") >&5
+- (eval $ac_compile) 2>&5
+- ac_status=$?
+- echo "$as_me:8270: \$? = $ac_status" >&5
+- (exit $ac_status); } &&
+- { ac_try='test -s conftest.$ac_objext'
+- { (eval echo "$as_me:8273: \"$ac_try\"") >&5
+- (eval $ac_try) 2>&5
+- ac_status=$?
+- echo "$as_me:8276: \$? = $ac_status" >&5
+- (exit $ac_status); }; }; then
+- cf_cv_xopen_source=no
+-else
+- echo "$as_me: failed program was:" >&5
+-cat conftest.$ac_ext >&5
+-cf_cv_xopen_source=$cf_XOPEN_SOURCE
+-fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
+- CPPFLAGS="$cf_save"
+-
+-fi
+-rm -f conftest.$ac_objext conftest.$ac_ext
+-
+-fi
+-echo "$as_me:8291: result: $cf_cv_xopen_source" >&5
+-echo "${ECHO_T}$cf_cv_xopen_source" >&6
+-
+-if test "$cf_cv_xopen_source" != no ; then
+-
+-CFLAGS=`echo "$CFLAGS" | \
+- sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
+- -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
+-
+-CPPFLAGS=`echo "$CPPFLAGS" | \
+- sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \
+- -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'`
+-
+- cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
+-
+-cf_fix_cppflags=no
+-cf_new_cflags=
+-cf_new_cppflags=
+-cf_new_extra_cppflags=
+-
+-for cf_add_cflags in $cf_temp_xopen_source
+-do
+-case $cf_fix_cppflags in
+-no)
+- case $cf_add_cflags in #(vi
+- -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
+- case $cf_add_cflags in
+- -D*)
+- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'`
+-
+- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+- && test -z "${cf_tst_cflags}" \
+- && cf_fix_cppflags=yes
+-
+- if test $cf_fix_cppflags = yes ; then
+- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+- continue
+- elif test "${cf_tst_cflags}" = "\"'" ; then
+- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+- continue
+- fi
+- ;;
+- esac
+- case "$CPPFLAGS" in
+- *$cf_add_cflags) #(vi
+- ;;
+- *) #(vi
+- case $cf_add_cflags in #(vi
+- -D*)
+- cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
+-
+-CPPFLAGS=`echo "$CPPFLAGS" | \
+- sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \
+- -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'`
+-
+- ;;
+- esac
+- cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
+- ;;
+- esac
+- ;;
+- *)
+- cf_new_cflags="$cf_new_cflags $cf_add_cflags"
+- ;;
+- esac
+- ;;
+-yes)
+- cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
+-
+- cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'`
+-
+- test "${cf_add_cflags}" != "${cf_tst_cflags}" \
+- && test -z "${cf_tst_cflags}" \
+- && cf_fix_cppflags=no
+- ;;
+-esac
+-done
+-
+-if test -n "$cf_new_cflags" ; then
+-
+- CFLAGS="$CFLAGS $cf_new_cflags"
+-fi
+-
+-if test -n "$cf_new_cppflags" ; then
+-
+- CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
+-fi
+-
+-if test -n "$cf_new_extra_cppflags" ; then
+-
+- EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
+-fi
+-
+-fi
+-
+- fi
+-fi
+-
+ # Work around breakage on OS X
+
+ echo "$as_me:8391: checking if SIGWINCH is defined" >&5
diff --git a/build/pkgs/pari/spkg-install b/build/pkgs/pari/spkg-install
index 00586e2..fce58d3 100755
--- a/build/pkgs/pari/spkg-install
+++ b/build/pkgs/pari/spkg-install
@@ -33,8 +33,6 @@ set_environment()
# This is needed or there are weird locale problems involving rpath
# with building Sage:
- LC_ALL=C
- export LC_ALL
LANG=C
export LANG
diff --git a/build/pkgs/sagenb/checksums.ini b/build/pkgs/sagenb/checksums.ini
index 8c71604..ed1581b 100644
--- a/build/pkgs/sagenb/checksums.ini
+++ b/build/pkgs/sagenb/checksums.ini
@@ -1,4 +1,4 @@
tarball=sagenb-VERSION.tar
-sha1=17ae39492a1176efbc62006315afb025c4b19d92
-md5=23b448c9d5207bfa017640d32a013b6f
-cksum=2809114274
+sha1=89f92fa00102aa5c9080e0517c374fa6ebf11999
+md5=0504ae7be62b739f13cf80118983ab5e
+cksum=1132378659
diff --git a/build/pkgs/sagenb/package-version.txt b/build/pkgs/sagenb/package-version.txt
index 1a46c7f..34537b9 100644
--- a/build/pkgs/sagenb/package-version.txt
+++ b/build/pkgs/sagenb/package-version.txt
@@ -1 +1 @@
-0.10.8
+0.10.8.2
diff --git a/src/bin/sage-banner b/src/bin/sage-banner
index 2b19500..1130cab 100644
--- a/src/bin/sage-banner
+++ b/src/bin/sage-banner
@@ -1,5 +1,5 @@
┌────────────────────────────────────────────────────────────────────┐
-│ Sage Version 6.2.beta0, Release Date: 2014-02-02 │
+│ Sage Version 6.2.beta1, Release Date: 2014-02-07 │
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
diff --git a/src/bin/sage-spkg b/src/bin/sage-spkg
index 82d71ab..13adc92 100755
--- a/src/bin/sage-spkg
+++ b/src/bin/sage-spkg
@@ -54,6 +54,8 @@
# http://www.gnu.org/licenses/
#*****************************************************************************
+# Avoid surprises with character ranges [a-z] in regular expressions
+export LC_ALL=C
# error_msg(header, command)
# This is for printing an error message if something went wrong.
diff --git a/src/bin/sage-version.sh b/src/bin/sage-version.sh
index d968846..d818fa4 100644
--- a/src/bin/sage-version.sh
+++ b/src/bin/sage-version.sh
@@ -1,4 +1,4 @@
# Sage version information for shell scripts
# This file is auto-generated by the sage-update-version script, do not edit!
-SAGE_VERSION='6.2.beta0'
-SAGE_RELEASE_DATE='2014-02-02'
+SAGE_VERSION='6.2.beta1'
+SAGE_RELEASE_DATE='2014-02-07'
diff --git a/src/c_lib/SConstruct b/src/c_lib/SConstruct
index 1813de8..2c3c06e 100644
--- a/src/c_lib/SConstruct
+++ b/src/c_lib/SConstruct
@@ -132,9 +132,9 @@ cFiles = Split( "convert.c interrupt.c memory.c mpn_pylong.c mpz_pylong.c")
Split( "mpz_longlong.c stdsage.c gmp_globals.c" )
cppFiles = Split( "ZZ_pylong.cpp ntl_wrap.cpp" )
srcFiles = cFiles + cppFiles
-incFiles = Split( "ccobject.h convert.h ginac_wrap.h gmp_globals.h" ) + \
+incFiles = Split( "ccobject.h convert.h gmp_globals.h" ) + \
Split( "interrupt.h memory.h mpn_pylong.h mpz_longlong.h" ) + \
- Split( "mpz_pylong.h ntl_wrap.h pb_wrap.h stdsage.h ZZ_pylong.h" )
+ Split( "mpz_pylong.h ntl_wrap.h stdsage.h ZZ_pylong.h" )
lib = env.SharedLibrary( "csage", [ "src/" + x for x in srcFiles ],
LIBS=['ntl', 'pari', 'gmp', 'python$PYV'],
diff --git a/src/doc/en/bordeaux_2008/elliptic_curves.rst b/src/doc/en/bordeaux_2008/elliptic_curves.rst
index 8176059..eec9bb6 100644
--- a/src/doc/en/bordeaux_2008/elliptic_curves.rst
+++ b/src/doc/en/bordeaux_2008/elliptic_curves.rst
@@ -369,7 +369,6 @@ where :math:`E` is still the rank :math:`2` curve 389a.
::
sage: L.zeros(10)
- *** Warning: new stack size = ...
[0.000000000, 0.000000000, 2.87609907, 4.41689608, 5.79340263,
6.98596665, 7.47490750, 8.63320525, 9.63307880, 10.3514333]
diff --git a/src/doc/en/reference/coercion/index.rst b/src/doc/en/reference/coercion/index.rst
index 933098a..59c80fb 100644
--- a/src/doc/en/reference/coercion/index.rst
+++ b/src/doc/en/reference/coercion/index.rst
@@ -222,11 +222,11 @@ be obtained and queried.
sage: cm.explain(ZZ['x','y'], QQ['x'])
Coercion on left operand via
- Call morphism:
+ Conversion map:
From: Multivariate Polynomial Ring in x, y over Integer Ring
To: Multivariate Polynomial Ring in x, y over Rational Field
Coercion on right operand via
- Call morphism:
+ Conversion map:
From: Univariate Polynomial Ring in x over Rational Field
To: Multivariate Polynomial Ring in x, y over Rational Field
Arithmetic performed after coercions.
diff --git a/src/doc/en/reference/libs/index.rst b/src/doc/en/reference/libs/index.rst
index 7081b20..729fe5e 100644
--- a/src/doc/en/reference/libs/index.rst
+++ b/src/doc/en/reference/libs/index.rst
@@ -27,6 +27,7 @@ to be aware of the modules described in this chapter.
sage/libs/gap/element
sage/libs/flint/fmpz_poly
sage/libs/libecm
+ sage/libs/lcalc/lcalc_Lfunction
sage/libs/lrcalc/lrcalc
sage/libs/ntl/all
sage/libs/mwrank/all
diff --git a/src/doc/en/thematic_tutorials/coercion_and_categories.rst b/src/doc/en/thematic_tutorials/coercion_and_categories.rst
index 1a31e7a..6b5a02d 100644
--- a/src/doc/en/thematic_tutorials/coercion_and_categories.rst
+++ b/src/doc/en/thematic_tutorials/coercion_and_categories.rst
@@ -751,7 +751,7 @@ thus have::
sage: P1.has_coerce_map_from(P2)
True
sage: P1.coerce_map_from(P2)
- Call morphism:
+ Conversion map:
From: Multivariate Polynomial Ring in w, v over Integer Ring
To: Multivariate Polynomial Ring in v, w over Rational Field
@@ -759,7 +759,7 @@ While there is a conversion from `P_1` to `P_2` (namely restricted to
polynomials with integral coefficients), this conversion is not a coercion::
sage: P2.convert_map_from(P1)
- Call morphism:
+ Conversion map:
From: Multivariate Polynomial Ring in v, w over Rational Field
To: Multivariate Polynomial Ring in w, v over Integer Ring
sage: P2.has_coerce_map_from(P1)
diff --git a/src/sage/algebras/group_algebra.py b/src/sage/algebras/group_algebra.py
index caca0de..5195f6b 100644
--- a/src/sage/algebras/group_algebra.py
+++ b/src/sage/algebras/group_algebra.py
@@ -222,7 +222,7 @@ class GroupAlgebra(Algebra):
(self.base_ring().random_element(), self.group().random_element()),
(self.base_ring().random_element(), self.group().random_element()),
]))
- except StandardError: # base ring or group might not implement .random_element()
+ except Exception: # base ring or group might not implement .random_element()
return self(self._formal_sum_module([ (self.base_ring().an_element(), self.group().an_element()) ]))
def __call__(self, x, check=True):
diff --git a/src/sage/algebras/hall_algebra.py b/src/sage/algebras/hall_algebra.py
index f987f93..847bf41 100644
--- a/src/sage/algebras/hall_algebra.py
+++ b/src/sage/algebras/hall_algebra.py
@@ -228,7 +228,7 @@ class HallAlgebra(CombinatorialFreeModule):
hopf_structure = False
else:
hopf_structure = True
- except StandardError:
+ except Exception:
hopf_structure = False
if hopf_structure:
category = HopfAlgebrasWithBasis(base_ring)
@@ -549,7 +549,7 @@ class HallAlgebraMonomials(CombinatorialFreeModule):
hopf_structure = False
else:
hopf_structure = True
- except StandardError:
+ except Exception:
hopf_structure = False
if hopf_structure:
category = HopfAlgebrasWithBasis(base_ring)
diff --git a/src/sage/algebras/iwahori_hecke_algebra.py b/src/sage/algebras/iwahori_hecke_algebra.py
index ac7f349..9c48845 100644
--- a/src/sage/algebras/iwahori_hecke_algebra.py
+++ b/src/sage/algebras/iwahori_hecke_algebra.py
@@ -1270,7 +1270,7 @@ class IwahoriHeckeAlgebra(Parent, UniqueRepresentation):
# avoids accidental coercion into a field of fractions.
i1 = normalized_laurent_polynomial(A._base, A._q1.__pow__(-1))
i2 = normalized_laurent_polynomial(A._base, A._q2.__pow__(-1))
- except StandardError:
+ except Exception:
raise ValueError("%s and %s must be invertible."%(A._q1, A._q2))
return (-i1*i2)*self.algebra_generator(i)+(i1+i2)
diff --git a/src/sage/all.py b/src/sage/all.py
index bc18bb5..5c46bfc 100644
--- a/src/sage/all.py
+++ b/src/sage/all.py
@@ -210,7 +210,7 @@ del message, name
#try:
# import resource # unix only...
# resource.setrlimit(resource.RLIMIT_AS, (-1,-1))
-#except StandardError:
+#except Exception:
# pass
# very useful 2-letter shortcuts
diff --git a/src/sage/categories/examples/finite_enumerated_sets.py b/src/sage/categories/examples/finite_enumerated_sets.py
index f6463aa..2f2b368 100644
--- a/src/sage/categories/examples/finite_enumerated_sets.py
+++ b/src/sage/categories/examples/finite_enumerated_sets.py
@@ -195,5 +195,5 @@ class IsomorphicObjectOfFiniteEnumeratedSet(UniqueRepresentation, Parent):
"""
try:
return self.lift(x) in self.ambient()
- except StandardError:
+ except Exception:
return False
diff --git a/src/sage/categories/facade_sets.py b/src/sage/categories/facade_sets.py
index c2bbed0..647cbf3 100644
--- a/src/sage/categories/facade_sets.py
+++ b/src/sage/categories/facade_sets.py
@@ -206,7 +206,7 @@ class FacadeSets(Category_singleton):
for parent in self.facade_for():
try:
return parent(element)
- except StandardError:
+ except Exception:
pass
raise ValueError, "Can't coerce `%s` in any parent `%s` is a facade for"%(element, self)
diff --git a/src/sage/categories/fields.py b/src/sage/categories/fields.py
index 9591cf2..e1547f6 100644
--- a/src/sage/categories/fields.py
+++ b/src/sage/categories/fields.py
@@ -106,7 +106,7 @@ class Fields(Category_singleton):
"""
try:
return self._contains_helper(x) or sage.rings.ring._is_Field(x)
- except StandardError:
+ except Exception:
return False
@lazy_class_attribute
diff --git a/src/sage/categories/functor.pyx b/src/sage/categories/functor.pyx
index 8ce2813..512b679 100644
--- a/src/sage/categories/functor.pyx
+++ b/src/sage/categories/functor.pyx
@@ -253,7 +253,7 @@ cdef class Functor(SageObject):
"""
try:
return self(f.domain()).hom(f, self(f.codomain()))
- except StandardError:
+ except Exception:
raise TypeError, 'unable to transform %s into a morphism in %s'%(f,self.codomain())
def _coerce_into_domain(self, x):
diff --git a/src/sage/categories/morphism.pyx b/src/sage/categories/morphism.pyx
index 47aa188..8ed524a 100644
--- a/src/sage/categories/morphism.pyx
+++ b/src/sage/categories/morphism.pyx
@@ -389,7 +389,7 @@ cdef class SetMorphism(Morphism):
"""
try:
return self._function(x, *args, **kwds)
- except StandardError:
+ except Exception:
raise TypeError, "Underlying map %s does not accept additional arguments"%type(self._function)
cdef _extra_slots(self, _slots):
diff --git a/src/sage/categories/quotient_fields.py b/src/sage/categories/quotient_fields.py
index 06c72dd..f58a35a 100644
--- a/src/sage/categories/quotient_fields.py
+++ b/src/sage/categories/quotient_fields.py
@@ -266,6 +266,48 @@ class QuotientFields(Category_singleton):
sage: sum(parts) == q
True
+ We can decompose over a given algebraic extension::
+
+ sage: R.<x> = QQ[sqrt(2)][]
+ sage: r = 1/(x^4+1)
+ sage: r.partial_fraction_decomposition()
+ (0,
+ [(-1/4*sqrt2*x + 1/2)/(x^2 - sqrt2*x + 1),
+ (1/4*sqrt2*x + 1/2)/(x^2 + sqrt2*x + 1)])
+
+ sage: R.<x> = QQ[I][] # of QQ[sqrt(-1)]
+ sage: r = 1/(x^4+1)
+ sage: r.partial_fraction_decomposition()
+ (0, [(-1/2*I)/(x^2 - I), 1/2*I/(x^2 + I)])
+
+ We can also ask Sage to find the least extension where the
+ denominator factors in linear terms::
+
+ sage: R.<x> = QQ[]
+ sage: r = 1/(x^4+2)
+ sage: N = r.denominator().splitting_field('a')
+ sage: N
+ Number Field in a with defining polynomial x^8 - 8*x^6 + 28*x^4 + 16*x^2 + 36
+ sage: R1.<x1>=N[]
+ sage: r1 = 1/(x1^4+2)
+ sage: r1.partial_fraction_decomposition()
+ (0,
+ [(-1/224*a^6 + 13/448*a^4 - 5/56*a^2 - 25/224)/(x1 - 1/28*a^6 + 13/56*a^4 - 5/7*a^2 - 25/28),
+ (1/224*a^6 - 13/448*a^4 + 5/56*a^2 + 25/224)/(x1 + 1/28*a^6 - 13/56*a^4 + 5/7*a^2 + 25/28),
+ (-5/1344*a^7 + 43/1344*a^5 - 85/672*a^3 - 31/672*a)/(x1 - 5/168*a^7 + 43/168*a^5 - 85/84*a^3 - 31/84*a),
+ (5/1344*a^7 - 43/1344*a^5 + 85/672*a^3 + 31/672*a)/(x1 + 5/168*a^7 - 43/168*a^5 + 85/84*a^3 + 31/84*a)])
+
+ Or we may work directly over an algebraically closed field::
+
+ sage: R.<x> = QQbar[]
+ sage: r = 1/(x^4+1)
+ sage: r.partial_fraction_decomposition()
+ (0,
+ [(-0.1767766952966369? - 0.1767766952966369?*I)/(x - 0.7071067811865475? - 0.7071067811865475?*I),
+ (-0.1767766952966369? + 0.1767766952966369?*I)/(x - 0.7071067811865475? + 0.7071067811865475?*I),
+ (0.1767766952966369? - 0.1767766952966369?*I)/(x + 0.7071067811865475? - 0.7071067811865475?*I),
+ (0.1767766952966369? + 0.1767766952966369?*I)/(x + 0.7071067811865475? + 0.7071067811865475?*I)])
+
We do the best we can over inexact fields::
sage: R.<x> = RealField(20)[]
diff --git a/src/sage/coding/binary_code.pyx b/src/sage/coding/binary_code.pyx
index a5eab65..5286fb3 100644
--- a/src/sage/coding/binary_code.pyx
+++ b/src/sage/coding/binary_code.pyx
@@ -1526,7 +1526,7 @@ cdef class PartitionStack:
self.nrows = <int> arg1
self.nwords = 1 << self.nrows
self.ncols = <int> arg2
- except StandardError:
+ except Exception:
other = arg1
self.nrows = other.nrows
self.nwords = other.nwords
diff --git a/src/sage/combinat/abstract_tree.py b/src/sage/combinat/abstract_tree.py
index 411fd7b..8badc3b 100644
--- a/src/sage/combinat/abstract_tree.py
+++ b/src/sage/combinat/abstract_tree.py
@@ -44,10 +44,10 @@ by a word describing a path from the root node.
**Canonical labellings**
-Equality between instances of classes extending both of :class:`AbstractTree`
+Equality between instances of classes extending both :class:`AbstractTree`
and ``A`` is entirely defined by the equality defined on the elements of
-``A``. A canonical labelling of such a tree however, should be such that two
-trees ``a`` and ``b`` satisfying ``a == b`` should have the same canonical
+``A``. A canonical labelling of such a tree, however, should be such that
+two trees ``a`` and ``b`` satisfying ``a == b`` have the same canonical
labellings. On the other hand, the canonical labellings of trees ``a`` and
``b`` satisfying ``a != b`` are expected to be different.
@@ -67,17 +67,18 @@ from sage.structure.list_clone import ClonableArray
from sage.rings.integer import Integer
from sage.misc.misc_c import prod
+
# Unfortunately Cython forbids multiple inheritance. Therefore, we do not
-# inherits from SageObject to be able to inherits from Element or a subclass
+# inherit from SageObject to be able to inherit from Element or a subclass
# of it later.
class AbstractTree(object):
"""
- Abstract Tree
+ Abstract Tree.
There is no data structure defined here, as this class is meant to be
extended, not instantiated.
- .. rubric:: How should this class be extended ?
+ .. rubric:: How should this class be extended?
A class extending :class:`AbstractTree
<sage.combinat.abstract_tree.AbstractTree>` should respect several
@@ -90,7 +91,7 @@ class AbstractTree(object):
<AbstractTree.canonical_labelling>` method
should return the same value for trees that are considered equal (see the
"canonical labellings" section in the documentation of the
- :class:`AbstractTree <sage.combinat.abstract_tree.AbstractTree>` module).
+ :class:`AbstractTree <sage.combinat.abstract_tree.AbstractTree>` class).
* For a tree ``T`` the call ``T.parent().labelled_trees()`` should return
a parent for labelled trees of the same kind: for example,
@@ -106,12 +107,641 @@ class AbstractTree(object):
sage: TestSuite(OrderedTree()).run()
sage: TestSuite(BinaryTree()).run()
"""
+ def pre_order_traversal_iter(self):
+ r"""
+ The depth-first pre-order traversal iterator.
+
+ This method iters each node following the depth-first pre-order
+ traversal algorithm (recursive implementation). The algorithm
+ is::
+
+ yield the root (in the case of binary trees, if it is not
+ a leaf);
+ then explore each subtree (by the algorithm) from the
+ leftmost one to the rightmost one.
+
+ EXAMPLES:
+
+ For example, on the following binary tree `b`::
+
+ | ___3____ |
+ | / \ |
+ | 1 _7_ |
+ | \ / \ |
+ | 2 5 8 |
+ | / \ |
+ | 4 6 |
+
+ (only the nodes shown), the depth-first pre-order traversal
+ algorithm explores `b` in the following order of nodes:
+ `3,1,2,7,5,4,6,8`.
+
+ Another example::
+
+ | __1____ |
+ | / / / |
+ | 2 6 8_ |
+ | | | / / |
+ | 3_ 7 9 10 |
+ | / / |
+ | 4 5 |
+
+ The algorithm explores this labelled tree in the following
+ order: `1,2,3,4,5,6,7,8,9,10`.
+
+ TESTS::
+
+ sage: b = BinaryTree([[None,[]],[[[],[]],[]]]).canonical_labelling()
+ sage: ascii_art([b])
+ [ ___3____ ]
+ [ / \ ]
+ [ 1 _7_ ]
+ [ \ / \ ]
+ [ 2 5 8 ]
+ [ / \ ]
+ [ 4 6 ]
+ sage: [n.label() for n in b.pre_order_traversal_iter()]
+ [3, 1, 2, 7, 5, 4, 6, 8]
+
+ sage: t = OrderedTree([[[[],[]]],[[]],[[],[]]]).canonical_labelling()
+ sage: ascii_art([t])
+ [ __1____ ]
+ [ / / / ]
+ [ 2 6 8_ ]
+ [ | | / / ]
+ [ 3_ 7 9 10 ]
+ [ / / ]
+ [ 4 5 ]
+ sage: [n.label() for n in t.pre_order_traversal_iter()]
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+
+ sage: [n for n in BinaryTree(None).pre_order_traversal_iter()]
+ []
+
+ The following test checks that things do not go wrong if some among
+ the descendants of the tree are equal or even identical::
+
+ sage: u = BinaryTree(None)
+ sage: v = BinaryTree([u, u])
+ sage: w = BinaryTree([v, v])
+ sage: t = BinaryTree([w, w])
+ sage: t.node_number()
+ 7
+ sage: l = [1 for i in t.pre_order_traversal_iter()]
+ sage: len(l)
+ 7
+ """
+ if self.is_empty():
+ return
+ yield self
+ # TODO:: PYTHON 3
+ # import itertools
+ # yield from itertools.chain(map(
+ # lambda c: c.pre_order_traversal_iter(),
+ # self
+ # ))
+ for children in self:
+ for node in children.pre_order_traversal_iter():
+ yield node
+
+ def iterative_pre_order_traversal(self, action=None):
+ r"""
+ Run the depth-first pre-order traversal algorithm (iterative
+ implementation) and subject every node encountered
+ to some procedure ``action``. The algorithm is::
+
+ manipulate the root with function `action` (in the case
+ of a binary tree, only if the root is not a leaf);
+ then explore each subtree (by the algorithm) from the
+ leftmost one to the rightmost one.
+
+ INPUT:
+
+ - ``action`` -- (optional) a function which takes a node as
+ input, and does something during the exploration
+
+ OUTPUT:
+
+ ``None``. (This is *not* an iterator.)
+
+ .. SEEALSO::
+
+ - :meth:`~sage.combinat.abstract_tree.AbstractTree.pre_order_traversal_iter()`
+ - :meth:`~sage.combinat.abstract_tree.AbstractTree.pre_order_traversal()`
+
+ TESTS::
+
+ sage: l = []
+ sage: b = BinaryTree([[None,[]],[[[],[]],[]]]).canonical_labelling()
+ sage: b
+ 3[1[., 2[., .]], 7[5[4[., .], 6[., .]], 8[., .]]]
+ sage: b.iterative_pre_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [3, 1, 2, 7, 5, 4, 6, 8]
+
+ sage: t = OrderedTree([[[[],[]]],[[]],[[],[]]]).canonical_labelling()
+ sage: t
+ 1[2[3[4[], 5[]]], 6[7[]], 8[9[], 10[]]]
+ sage: l = []
+ sage: t.iterative_pre_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ sage: l = []
+
+ sage: BinaryTree().canonical_labelling().\
+ ....: pre_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ []
+ sage: OrderedTree([]).canonical_labelling().\
+ ....: iterative_pre_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [1]
+
+ The following test checks that things do not go wrong if some among
+ the descendants of the tree are equal or even identical::
+
+ sage: u = BinaryTree(None)
+ sage: v = BinaryTree([u, u])
+ sage: w = BinaryTree([v, v])
+ sage: t = BinaryTree([w, w])
+ sage: t.node_number()
+ 7
+ sage: l = []
+ sage: t.iterative_pre_order_traversal(lambda node: l.append(1))
+ sage: len(l)
+ 7
+ """
+ if self.is_empty():
+ return
+ if action is None:
+ action = lambda x: None
+ stack = []
+ stack.append(self)
+ while len(stack) > 0:
+ node = stack.pop()
+ action(node)
+ for i in range(len(node)):
+ subtree = node[-i - 1]
+ if not subtree.is_empty():
+ stack.append(subtree)
+
+ def pre_order_traversal(self, action=None):
+ r"""
+ Run the depth-first pre-order traversal algorithm (recursive
+ implementation) and subject every node encountered
+ to some procedure ``action``. The algorithm is::
+
+ manipulate the root with function `action` (in the case
+ of a binary tree, only if the root is not a leaf);
+ then explore each subtree (by the algorithm) from the
+ leftmost one to the rightmost one.
+
+ INPUT:
+
+ - ``action`` -- (optional) a function which takes a node as
+ input, and does something during the exploration
+
+ OUTPUT:
+
+ ``None``. (This is *not* an iterator.)
+
+ EXAMPLES:
+
+ For example, on the following binary tree `b`::
+
+ | ___3____ |
+ | / \ |
+ | 1 _7_ |
+ | \ / \ |
+ | 2 5 8 |
+ | / \ |
+ | 4 6 |
+
+ the depth-first pre-order traversal algorithm explores `b` in the
+ following order of nodes: `3,1,2,7,5,4,6,8`.
+
+ Another example::
+
+ | __1____ |
+ | / / / |
+ | 2 6 8_ |
+ | | | / / |
+ | 3_ 7 9 10 |
+ | / / |
+ | 4 5 |
+
+ The algorithm explores this tree in the following order:
+ `1,2,3,4,5,6,7,8,9,10`.
+
+ .. SEEALSO::
+
+ - :meth:`~sage.combinat.abstract_tree.AbstractTree.pre_order_traversal_iter()`
+ - :meth:`~sage.combinat.abstract_tree.AbstractTree.iterative_pre_order_traversal()`
+
+ TESTS::
+
+ sage: l = []
+ sage: b = BinaryTree([[None,[]],[[[],[]],[]]]).canonical_labelling()
+ sage: b
+ 3[1[., 2[., .]], 7[5[4[., .], 6[., .]], 8[., .]]]
+ sage: b.pre_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [3, 1, 2, 7, 5, 4, 6, 8]
+ sage: li = []
+ sage: b.iterative_pre_order_traversal(lambda node: li.append(node.label()))
+ sage: l == li
+ True
+
+ sage: t = OrderedTree([[[[],[]]],[[]],[[],[]]]).canonical_labelling()
+ sage: t
+ 1[2[3[4[], 5[]]], 6[7[]], 8[9[], 10[]]]
+ sage: l = []
+ sage: t.pre_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
+ sage: li = []
+ sage: t.iterative_pre_order_traversal(lambda node: li.append(node.label()))
+ sage: l == li
+ True
+
+ sage: l = []
+ sage: BinaryTree().canonical_labelling().\
+ ....: pre_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ []
+ sage: OrderedTree([]).canonical_labelling().\
+ ....: pre_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [1]
+
+ The following test checks that things do not go wrong if some among
+ the descendants of the tree are equal or even identical::
+
+ sage: u = BinaryTree(None)
+ sage: v = BinaryTree([u, u])
+ sage: w = BinaryTree([v, v])
+ sage: t = BinaryTree([w, w])
+ sage: t.node_number()
+ 7
+ sage: l = []
+ sage: t.pre_order_traversal(lambda node: l.append(1))
+ sage: len(l)
+ 7
+ """
+ if action is None:
+ action = lambda x: None
+ for node in self.pre_order_traversal_iter():
+ action(node)
+
+ def post_order_traversal_iter(self):
+ r"""
+ The depth-first post-order traversal iterator.
+
+ This method iters each node following the depth-first post-order
+ traversal algorithm (recursive implementation). The algorithm
+ is::
+
+ explore each subtree (by the algorithm) from the
+ leftmost one to the rightmost one;
+ then yield the root (in the case of binary trees, only if
+ it is not a leaf).
+
+ EXAMPLES:
+
+ For example on the following binary tree `b`::
+
+ | ___3____ |
+ | / \ |
+ | 1 _7_ |
+ | \ / \ |
+ | 2 5 8 |
+ | / \ |
+ | 4 6 |
+
+ (only the nodes are shown), the depth-first post-order traversal
+ algorithm explores `b` in the following order of nodes:
+ `2,1,4,6,5,8,7,3`.
+
+ For another example, consider the labelled tree::
+
+ | __1____ |
+ | / / / |
+ | 2 6 8_ |
+ | | | / / |
+ | 3_ 7 9 10 |
+ | / / |
+ | 4 5 |
+
+ The algorithm explores this tree in the following order:
+ `4,5,3,2,7,6,9,10,8,1`.
+
+ TESTS::
+
+ sage: b = BinaryTree([[None,[]],[[[],[]],[]]]).canonical_labelling()
+ sage: ascii_art([b])
+ [ ___3____ ]
+ [ / \ ]
+ [ 1 _7_ ]
+ [ \ / \ ]
+ [ 2 5 8 ]
+ [ / \ ]
+ [ 4 6 ]
+ sage: [node.label() for node in b.post_order_traversal_iter()]
+ [2, 1, 4, 6, 5, 8, 7, 3]
+
+ sage: t = OrderedTree([[[[],[]]],[[]],[[],[]]]).canonical_labelling()
+ sage: ascii_art([t])
+ [ __1____ ]
+ [ / / / ]
+ [ 2 6 8_ ]
+ [ | | / / ]
+ [ 3_ 7 9 10 ]
+ [ / / ]
+ [ 4 5 ]
+ sage: [node.label() for node in t.post_order_traversal_iter()]
+ [4, 5, 3, 2, 7, 6, 9, 10, 8, 1]
+
+ sage: [node.label() for node in BinaryTree().canonical_labelling().\
+ ....: post_order_traversal_iter()]
+ []
+ sage: [node.label() for node in OrderedTree([]).\
+ ....: canonical_labelling().post_order_traversal_iter()]
+ [1]
+
+ The following test checks that things do not go wrong if some among
+ the descendants of the tree are equal or even identical::
+
+ sage: u = BinaryTree(None)
+ sage: v = BinaryTree([u, u])
+ sage: w = BinaryTree([v, v])
+ sage: t = BinaryTree([w, w])
+ sage: t.node_number()
+ 7
+ sage: l = [1 for i in t.post_order_traversal_iter()]
+ sage: len(l)
+ 7
+ """
+ if self.is_empty():
+ return
+ # TODO:: PYTHON 3
+ # import itertools
+ # yield from itertools.chain(map(
+ # lambda c: c.post_order_traversal_iter(),
+ # self
+ # ))
+ for children in self:
+ for node in children.post_order_traversal_iter():
+ yield node
+ yield self
+
+ def post_order_traversal(self, action=None):
+ r"""
+ Run the depth-first post-order traversal algorithm (recursive
+ implementation) and subject every node encountered
+ to some procedure ``action``. The algorithm is::
+
+ explore each subtree (by the algorithm) from the
+ leftmost one to the rightmost one;
+ then manipulate the root with function `action` (in the
+ case of a binary tree, only if the root is not a leaf).
+
+ INPUT:
+
+ - ``action`` -- (optional) a function which takes a node as
+ input, and does something during the exploration
+
+ OUTPUT:
+
+ ``None``. (This is *not* an iterator.)
+
+ .. SEEALSO::
+
+ - :meth:`~sage.combinat.abstract_tree.AbstractTree.post_order_traversal_iter()`
+ - :meth:`~sage.combinat.abstract_tree.AbstractTree.iterative_post_order_traversal()`
+
+ TESTS::
+
+ sage: l = []
+ sage: b = BinaryTree([[None,[]],[[[],[]],[]]]).canonical_labelling()
+ sage: b
+ 3[1[., 2[., .]], 7[5[4[., .], 6[., .]], 8[., .]]]
+ sage: b.post_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [2, 1, 4, 6, 5, 8, 7, 3]
+
+ sage: t = OrderedTree([[[[],[]]],[[]],[[],[]]]).\
+ ....: canonical_labelling(); t
+ 1[2[3[4[], 5[]]], 6[7[]], 8[9[], 10[]]]
+ sage: l = []
+ sage: t.post_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [4, 5, 3, 2, 7, 6, 9, 10, 8, 1]
+
+ sage: l = []
+ sage: BinaryTree().canonical_labelling().\
+ ....: post_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ []
+ sage: OrderedTree([]).canonical_labelling().\
+ ....: post_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [1]
+
+ The following test checks that things do not go wrong if some among
+ the descendants of the tree are equal or even identical::
+
+ sage: u = BinaryTree(None)
+ sage: v = BinaryTree([u, u])
+ sage: w = BinaryTree([v, v])
+ sage: t = BinaryTree([w, w])
+ sage: t.node_number()
+ 7
+ sage: l = []
+ sage: t.post_order_traversal(lambda node: l.append(1))
+ sage: len(l)
+ 7
+ """
+ if action is None:
+ action = lambda x: None
+ for node in self.post_order_traversal_iter():
+ action(node)
+
+ def iterative_post_order_traversal(self, action=None):
+ r"""
+ Run the depth-first post-order traversal algorithm (iterative
+ implementation) and subject every node encountered
+ to some procedure ``action``. The algorithm is::
+
+ explore each subtree (by the algorithm) from the
+ leftmost one to the rightmost one;
+ then manipulate the root with function `action` (in the
+ case of a binary tree, only if the root is not a leaf).
+
+ INPUT:
+
+ - ``action`` -- (optional) a function which takes a node as
+ input, and does something during the exploration
+
+ OUTPUT:
+
+ ``None``. (This is *not* an iterator.)
+
+ .. SEEALSO::
+
+ - :meth:`~sage.combinat.abstract_tree.AbstractTree.post_order_traversal_iter()`
+
+ TESTS::
+
+ sage: l = []
+ sage: b = BinaryTree([[None,[]],[[[],[]],[]]]).canonical_labelling()
+ sage: b
+ 3[1[., 2[., .]], 7[5[4[., .], 6[., .]], 8[., .]]]
+ sage: b.iterative_post_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [2, 1, 4, 6, 5, 8, 7, 3]
+
+ sage: t = OrderedTree([[[[],[]]],[[]],[[],[]]]).canonical_labelling()
+ sage: t
+ 1[2[3[4[], 5[]]], 6[7[]], 8[9[], 10[]]]
+ sage: l = []
+ sage: t.iterative_post_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [4, 5, 3, 2, 7, 6, 9, 10, 8, 1]
+
+ sage: l = []
+ sage: BinaryTree().canonical_labelling().\
+ ....: iterative_post_order_traversal(
+ ....: lambda node: l.append(node.label()))
+ sage: l
+ []
+ sage: OrderedTree([]).canonical_labelling().\
+ ....: iterative_post_order_traversal(
+ ....: lambda node: l.append(node.label()))
+ sage: l
+ [1]
+
+ The following test checks that things do not go wrong if some among
+ the descendants of the tree are equal or even identical::
+
+ sage: u = BinaryTree(None)
+ sage: v = BinaryTree([u, u])
+ sage: w = BinaryTree([v, v])
+ sage: t = BinaryTree([w, w])
+ sage: t.node_number()
+ 7
+ sage: l = []
+ sage: t.iterative_post_order_traversal(lambda node: l.append(1))
+ sage: len(l)
+ 7
+ """
+ if self.is_empty():
+ return
+ if action is None:
+ action = lambda x: None
+ stack = [self]
+ while len(stack) > 0:
+ node = stack[-1]
+ if node != None:
+ # A "None" on the stack means that the node right before
+ # it on the stack has already been "exploded" into
+ # subtrees, and should not be exploded again, but instead
+ # should be manipulated and removed from the stack.
+ stack.append(None)
+ for i in range(len(node)):
+ subtree = node[-i - 1]
+ if not subtree.is_empty():
+ stack.append(subtree)
+ else:
+ stack.pop()
+ node = stack.pop()
+ action(node)
+
+ def breadth_first_order_traversal(self, action=None):
+ r"""
+ Run the breadth-first post-order traversal algorithm
+ and subject every node encountered to some procedure
+ ``action``. The algorithm is::
+
+ queue <- [ root ];
+ while the queue is not empty:
+ node <- pop( queue );
+ manipulate the node;
+ prepend to the queue the list of all subtrees of
+ the node (from the rightmost to the leftmost).
+
+ INPUT:
+
+ - ``action`` -- (optional) a function which takes a node as
+ input, and does something during the exploration
+
+ OUTPUT:
+
+ ``None``. (This is *not* an iterator.)
+
+ EXAMPLES:
+
+ For example, on the following binary tree `b`::
+
+ | ___3____ |
+ | / \ |
+ | 1 _7_ |
+ | \ / \ |
+ | 2 5 8 |
+ | / \ |
+ | 4 6 |
+
+ the breadth-first order traversal algorithm explores `b` in the
+ following order of nodes: `3,1,7,2,5,8,4,6`.
+
+ TESTS::
+
+ sage: b = BinaryTree([[None,[]],[[[],[]],[]]]).canonical_labelling()
+ sage: l = []
+ sage: b.breadth_first_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [3, 1, 7, 2, 5, 8, 4, 6]
+
+ sage: t = OrderedTree([[[[],[]]],[[]],[[],[]]]).canonical_labelling()
+ sage: t
+ 1[2[3[4[], 5[]]], 6[7[]], 8[9[], 10[]]]
+ sage: l = []
+ sage: t.breadth_first_order_traversal(lambda node: l.append(node.label()))
+ sage: l
+ [1, 2, 6, 8, 3, 7, 9, 10, 4, 5]
+
+ sage: l = []
+ sage: BinaryTree().canonical_labelling().\
+ ....: breadth_first_order_traversal(
+ ....: lambda node: l.append(node.label()))
+ sage: l
+ []
+ sage: OrderedTree([]).canonical_labelling().\
+ ....: breadth_first_order_traversal(
+ ....: lambda node: l.append(node.label()))
+ sage: l
+ [1]
+ """
+ if self.is_empty():
+ return
+ if action is None:
+ action = lambda x: None
+ queue = []
+ queue.append(self)
+ while len(queue) > 0:
+ node = queue.pop()
+ action(node)
+ for subtree in node:
+ if not subtree.is_empty():
+ queue.insert(0, subtree)
def subtrees(self):
"""
- Returns a generator for all subtrees of ``self``
+ Return a generator for all nonempty subtrees of ``self``.
- The number of subtrees of a tree is its number of elements.
+ The number of nonempty subtrees of a tree is its number of
+ nodes. (The word "nonempty" makes a difference only in the
+ case of binary trees. For ordered trees, for example, all
+ trees are nonempty.)
EXAMPLES::
@@ -120,9 +750,16 @@ class AbstractTree(object):
sage: list(OrderedTree([[],[[]]]).subtrees())
[[[], [[]]], [], [[]], []]
+ sage: list(OrderedTree([[],[[]]]).canonical_labelling().subtrees())
+ [1[2[], 3[4[]]], 2[], 3[4[]], 4[]]
+
sage: list(BinaryTree([[],[[],[]]]).subtrees())
[[[., .], [[., .], [., .]]], [., .], [[., .], [., .]], [., .], [., .]]
+ sage: v = BinaryTree([[],[]])
+ sage: list(v.canonical_labelling().subtrees())
+ [2[1[., .], 3[., .]], 1[., .], 3[., .]]
+
TESTS::
sage: t = OrderedTree([[], [[], [[], []], [[], []]], [[], []]])
@@ -134,23 +771,21 @@ class AbstractTree(object):
sage: bt.node_number() == len(list(bt.subtrees()))
True
"""
- if not self.is_empty():
- yield self
- for i in self:
- for t in i.subtrees():
- yield t
+ return self.pre_order_traversal_iter()
def paths(self):
"""
- Returns a generator for all paths to nodes of ``self``
+ Return a generator for all paths to nodes of ``self``.
OUTPUT:
This method returns a list of sequences of integers. Each of these
- sequences represents a path from the root node to another one : `(1, 3,
- 2, 5, 3)` represents the node obtained by chosing the 1st children of
- the root node (in the ordering returned by ``iter``), then the 3rd of
- its children, then the 2nd of this element, etc.
+ sequences represents a path from the root node to some node. For
+ instance, `(1, 3, 2, 5, 0, 3)` represents the node obtained by
+ choosing the 1st child of the root node (in the ordering returned
+ by ``iter``), then the 3rd child of its child, then the 2nd child
+ of the latter, etc. (where the labelling of the children is
+ zero-based).
The root element is represented by the empty tuple ``()``.
@@ -183,7 +818,7 @@ class AbstractTree(object):
def node_number(self):
"""
- The number of nodes of ``self``
+ The number of nodes of ``self``.
EXAMPLES::
@@ -198,7 +833,7 @@ class AbstractTree(object):
sage: OrderedTree([[], [[], [[], []], [[], []]], [[], []]]).node_number()
13
- EXAMPLE::
+ EXAMPLES::
sage: BinaryTree(None).node_number()
0
@@ -216,7 +851,7 @@ class AbstractTree(object):
def depth(self):
"""
- The depth of ``self``
+ The depth of ``self``.
EXAMPLES::
@@ -354,7 +989,7 @@ class AbstractTree(object):
def canonical_labelling(self,shift=1):
"""
- Returns a labelled version of ``self``
+ Returns a labelled version of ``self``.
The actual canonical labelling is currently unspecified. However, it
is guaranteed to have labels in `1...n` where `n` is the number of
@@ -431,7 +1066,7 @@ class AbstractTree(object):
def tree_factorial(self):
"""
- Returns the tree-factorial of ``self``
+ Return the tree-factorial of ``self``.
Definition:
@@ -456,134 +1091,420 @@ class AbstractTree(object):
nb = self.node_number()
if nb <= 1:
return 1
- else:
- return nb*prod(s.tree_factorial() for s in self)
-
- latex_unit_length = "4mm"
- latex_node_diameter = "0.5"
- latex_root_diameter = "0.7"
+ return nb * prod(s.tree_factorial() for s in self)
def _latex_(self):
- """
- Returns a LaTeX version of ``self``
-
- EXAMPLES::
-
- sage: print(OrderedTree([[],[]])._latex_())
- \vcenter{\hbox{{\setlength\unitlength{4mm}
- \begin{picture}(4,3)
- \put(1,1){\circle*{0.5}}
- \put(2,2){\circle*{0.5}}
- \put(3,1){\circle*{0.5}}
- \put(2,2){\line(-1,-1){1}}
- \put(2,2){\line(1,-1){1}}
- \put(2,2){\circle*{0.7}}
- \end{picture}}}}
+ r"""
+ Generate `\LaTeX` output which can be easily modified.
TESTS::
- sage: OrderedTree([])._latex_()
- '\\vcenter{\\hbox{{\\setlength\\unitlength{4mm}\n\\begin{picture}(2,2)\n\\put(1,1){\\circle*{0.5}}\n\\put(1,1){\\circle*{0.7}}\n\\end{picture}}}}'
- sage: OrderedTree([[]])._latex_()
- '\\vcenter{\\hbox{{\\setlength\\unitlength{4mm}\n\\begin{picture}(2,3)\n\\put(1,1){\\circle*{0.5}}\n\\put(1,2){\\circle*{0.5}}\n\\put(1,2){\\line(0,-1){1}}\n\\put(1,2){\\circle*{0.7}}\n\\end{picture}}}}'
- sage: OrderedTree([[], [[], [[], []], [[], []]], [[], []]])._latex_()
- '\\vcenter{\\hbox{{\\setlength\\unitlength{4mm}\n\\begin{picture}(12,5)\n\\put(1,3){\\circle*{0.5}}\n\\put(2,2){\\circle*{0.5}}\n\\put(3,1){\\circle*{0.5}}\n\\put(4,2){\\circle*{0.5}}\n\\put(5,1){\\circle*{0.5}}\n\\put(4,2){\\line(-1,-1){1}}\n\\put(4,2){\\line(1,-1){1}}\n\\put(4,3){\\circle*{0.5}}\n\\put(6,1){\\circle*{0.5}}\n\\put(7,2){\\circle*{0.5}}\n\\put(8,1){\\circle*{0.5}}\n\\put(7,2){\\line(-1,-1){1}}\n\\put(7,2){\\line(1,-1){1}}\n\\put(4,3){\\line(-2,-1){2}}\n\\put(4,3){\\line(0,-1){1}}\n\\put(4,3){\\line(3,-1){3}}\n\\put(4,4){\\circle*{0.5}}\n\\put(9,2){\\circle*{0.5}}\n\\put(10,3){\\circle*{0.5}}\n\\put(11,2){\\circle*{0.5}}\n\\put(10,3){\\line(-1,-1){1}}\n\\put(10,3){\\line(1,-1){1}}\n\\put(4,4){\\line(-3,-1){3}}\n\\put(4,4){\\line(0,-1){1}}\n\\put(4,4){\\line(6,-1){6}}\n\\put(4,4){\\circle*{0.7}}\n\\end{picture}}}}'
+ sage: latex(BinaryTree([[[],[]],[[],None]]))
+ { \newcommand{\nodea}{\node[draw,circle] (a) {$$}
+ ;}\newcommand{\nodeb}{\node[draw,circle] (b) {$$}
+ ;}\newcommand{\nodec}{\node[draw,circle] (c) {$$}
+ ;}\newcommand{\noded}{\node[draw,circle] (d) {$$}
+ ;}\newcommand{\nodee}{\node[draw,circle] (e) {$$}
+ ;}\newcommand{\nodef}{\node[draw,circle] (f) {$$}
+ ;}\begin{tikzpicture}[auto]
+ \matrix[column sep=.3cm, row sep=.3cm,ampersand replacement=\&]{
+ \& \& \& \nodea \& \& \& \\
+ \& \nodeb \& \& \& \& \nodee \& \\
+ \nodec \& \& \noded \& \& \nodef \& \& \\
+ };
+ <BLANKLINE>
+ \path[ultra thick, red] (b) edge (c) edge (d)
+ (e) edge (f)
+ (a) edge (b) edge (e);
+ \end{tikzpicture}}
"""
+ ###############################################################################
+ # # use to load tikz in the preamble (one for *view* and one for *notebook*)
from sage.misc.latex import latex
- drawing = [""] # allows modification of in rec...
- x = [1] # allows modification of x[0] in rec...
- max_label_width = [0] # allows modification of x[0] in rec...
- maxy = self.depth()
-
- def rec(t, y):
- """
- Draw the subtree t on the drawing, below y (included) and to
- the right of x[0] (included). Update x[0]. Returns the horizontal
- position of the root
- """
- if t.node_number() == 0 : return -1
- n = len(t)
- posChild = [rec(t[i], y+1) for i in range(n // 2)]
- i = n // 2
- if n % 2 == 1:
- xc = rec(t[i], y+1)
- posChild.append(xc)
- i += 1
- else:
- xc = x[0]
- x[0] +=1
- drawing[0] = drawing[0] + "\\put(%s,%s){\\circle*{%s}}\n"%(
- xc, maxy-y, self.latex_node_diameter)
- try:
- lbl = t.label()
- except AttributeError:
- pass
+ latex.add_package_to_preamble_if_available("tikz")
+ latex.add_to_mathjax_avoid_list("tikz")
+ ###############################################################################
+ # latex environnement : TikZ
+ begin_env = "\\begin{tikzpicture}[auto]\n"
+ end_env = "\\end{tikzpicture}"
+ # it uses matrix trick to place each node
+ matrix_begin = "\\matrix[column sep=.3cm, row sep=.3cm,ampersand replacement=\&]{\n"
+ matrix_end = "\\\\\n};\n"
+ # a basic path to each edges
+ path_begin = "\\path[ultra thick, red] "
+ path_end = ";\n"
+ # to make a pretty output, it creates one LaTeX command for
+ # each node
+ cmd = "\\node"
+ new_cmd1 = "\\newcommand{" + cmd
+ new_cmd2 = "}{\\node[draw,circle] ("
+ new_cmd3 = ") {$"
+ new_cmd4 = "$}\n;}"
+ # some variables to simplify code
+ sep = "\\&"
+ space = " "*9
+ sep