Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
Merge branch 'develop' into ticket/16908-maxima-5.34.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbruin committed Sep 11, 2014
2 parents b8babff + 325da8b commit 5dc9973
Show file tree
Hide file tree
Showing 250 changed files with 11,660 additions and 5,849 deletions.
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Sage version 6.4.beta2, released 2014-08-28
Sage version 6.4.beta3, released 2014-09-10
29 changes: 29 additions & 0 deletions build/pkgs/buckygen/SPKG.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
= Buckygen =

== Description ==
Buckygen is a program for the efficient generation of all nonisomorphic fullerenes. These are triangulations where all vertices have degree 5 or 6. Or if the dual representation is used: cubic plane graphs where all faces are pentagons or hexagons.

== License ==
Buckygen is licensed under the GNU General Public License v3 ( June 2007 )

== SPKG Maintainers ==
Nico Van Cleemput (nico.vancleemput@gmail.com)

== Upstream Contact ==
Buckygen was mainly written by Jan Goedgebeur, jan.goedgebeur[at]ugent.be.
http://caagt.ugent.be/buckygen/

== Dependencies ==
* None

== Changelog ==

=== buckygen-1.0 (Nico Van Cleemput, 9th September 2014) ===
* #16945: Update for the sage-git directory layout.

=== buckygen-1.0 (Nico Van Cleemput, 3rd September 2013) ===
* Fixed error in license info.

=== buckygen-1.0 (Nico Van Cleemput, 25th May 2013) ===
* First release put into Sage.

4 changes: 4 additions & 0 deletions build/pkgs/buckygen/checksums.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tarball=buckygen-VERSION.tar.bz2
sha1=db4fe52211e25b8964308f8bea19db32242c1f1d
md5=d33ea8f76b95a69842a291f88ed501fb
cksum=1430056194
1 change: 1 addition & 0 deletions build/pkgs/buckygen/package-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.0
23 changes: 23 additions & 0 deletions build/pkgs/buckygen/spkg-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

if [ -z "$SAGE_LOCAL" ]; then
echo >&2 "SAGE_LOCAL undefined ... exiting"
echo >&2 "Maybe run 'sage --sh'?"
exit 1
fi

cd src

$MAKE
if [ $? -ne 0 ]; then
echo >&2 "Error building buckygen."
exit 1
fi

echo >&2 "Copying buckygen..."
cp buckygen $SAGE_LOCAL/bin/buckygen
if [ $? -ne 0 ]; then
echo >&2 "Error installing buckygen."
exit 1
fi

6 changes: 3 additions & 3 deletions build/pkgs/configure/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=configure-VERSION.tar.gz
sha1=9f52b9a8917273a8b29a40c8e517ebb099cc0537
md5=adfa272430f561682954687258364d5d
cksum=3677976078
sha1=deffea92fdb644888b8349efdc0a8c5da5b2690e
md5=d58250c470893500de6fb86f10ea61b1
cksum=3339214726
2 changes: 1 addition & 1 deletion build/pkgs/configure/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
46
47
8 changes: 4 additions & 4 deletions build/pkgs/cython/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=Cython-VERSION.tar.gz
sha1=e0f2c2094722bada54f24c33f5c792411778ba4f
md5=52431696c64e618036537c4d9aa79d99
cksum=3488695300
tarball=cython-VERSION.tar.gz
sha1=f5784539870715e33b51374e9c4451ff6ff21c7f
md5=6c9c4d19ba485fe8cd88e23b57ac7886
cksum=2221677113
2 changes: 1 addition & 1 deletion build/pkgs/cython/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.20.1
0.21
6 changes: 3 additions & 3 deletions build/pkgs/database_cremona_ellcurve/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=database_cremona_ellcurve-VERSION.tar.bz2
sha1=ab96f509574419c03d9f1c8820c4d96042a17a04
md5=56956829063534142f9f12bc1274c01c
cksum=2400753722
sha1=01360c8292b9d2fb60cd5e4cb84c84d368c4eda4
md5=627731f9fd5b0cc3e8a25dff329d2cbf
cksum=2933014536
2 changes: 1 addition & 1 deletion build/pkgs/database_cremona_ellcurve/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20140512
20140829
5 changes: 5 additions & 0 deletions build/pkgs/ipython/SPKG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ ipython-user@scipy.org
== Dependencies ==

* Python

== Patches ==

* github_pr_5874.patch: https://github.com/ipython/ipython/pull/5874

6 changes: 3 additions & 3 deletions build/pkgs/ipython/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
tarball=ipython-VERSION.tar.gz
sha1=e80c30388cbe576038a78fc8ebb159cddae84fb4
md5=785c7b6364c6a0dd34aa4ea970cf83b9
cksum=2529846191
sha1=ff8e3a2f756d62405f200a2c73aedfafd84076ac
md5=b91d3724f655a8e16d022772f696cfd5
cksum=2917965028
2 changes: 1 addition & 1 deletion build/pkgs/ipython/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
2.2.0
21 changes: 21 additions & 0 deletions build/pkgs/ipython/patches/github_pr_5874.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
From cb1986230f78a936a905378f1aed92a4c67dba6d Mon Sep 17 00:00:00 2001
From: Thomas Kluyver <takowl@gmail.com>
Date: Fri, 16 May 2014 15:57:03 -0700
Subject: [PATCH 2/2] Close database when HistorySavingThread stops

---
IPython/core/history.py | 1 +
1 file changed, 1 insertion(+)

diff --git a/IPython/core/history.py b/IPython/core/history.py
index da10813..c9b8435 100644
--- a/IPython/core/history.py
+++ b/IPython/core/history.py
@@ -775,6 +775,7 @@ def run(self):
while True:
self.history_manager.save_flag.wait()
if self.stop_now:
+ self.db.close()
return
self.history_manager.save_flag.clear()
self.history_manager.writeout_cache(self.db)
2 changes: 1 addition & 1 deletion build/pkgs/pari/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.1.p0
2.7.1.p1
2 changes: 2 additions & 0 deletions build/pkgs/pari/patches/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,5 @@ C files:
determinant(), only collect garbage once per outer loop iteration.
Better increase PARI stack size instead of collecting garbage too
often.
* nffactor.patch (Jeroen Demeyer, #16894): Fix an nffactor() bug, taken
from PARI git commit 7630f584371c3db43c5fd6f57900c70a2c832b8e.
59 changes: 59 additions & 0 deletions build/pkgs/pari/patches/nffactor.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
commit 7630f584371c3db43c5fd6f57900c70a2c832b8e
Author: Karim Belabas <Karim.Belabas@math.u-bordeaux1.fr>
Date: Tue Jun 17 13:24:37 2014 +0200

32- nffactor() could overflow the stack when default accuracy too low: e.g.
nffactor(y^2-22, x^2+926246528884912528275985458927067632*y-4344481316563541186659879867597013188)

due to logmax_modulus called with (approximate) polynomial T s.t. T(0) = 0

diff --git a/src/basemath/rootpol.c b/src/basemath/rootpol.c
index d63f8b3..f1ced73 100644
--- a/src/basemath/rootpol.c
+++ b/src/basemath/rootpol.c
@@ -652,7 +652,8 @@ lower_bound(GEN p, long *k, double eps)
avma = ltop; return R;
}

-/* log of modulus of the largest root of p with relative error tau */
+/* log of modulus of the largest root of p with relative error tau. Assume
+ * P(0) != 0 and P non constant */
static double
logmax_modulus(GEN p, double tau)
{
@@ -696,10 +697,12 @@ logmax_modulus(GEN p, double tau)
r = itor(r, DEFAULTPREC); shiftr_inplace(r, -M);
avma = ltop; return -rtodbl(r) * LOG2; /* -log(2) sum e_i 2^-i */
}
+/* assume P non constant */
GEN
logmax_modulus_bound(GEN P)
{
- return dblexp(logmax_modulus(P, 0.01) + 0.01);
+ (void)RgX_valrem_inexact(P,&P);
+ return lg(P)==3? gen_0: dblexp(logmax_modulus(P, 0.01) + 0.01);
}

/* log of modulus of the smallest root of p, with relative error tau */
diff --git a/src/test/32/nffactor b/src/test/32/nffactor
index 824ca6b..accbc30 100644
--- a/src/test/32/nffactor
+++ b/src/test/32/nffactor
@@ -729,4 +729,6 @@ x^6 + 10/7*x^5 - 867/49*x^4 - 76/245*x^3 + 3148/35*x^2 - 25944/245*x + 48771
10
10
[0]
-Total time spent: 1385595334334
+[x + (-314226370217524044*y + 1473852319020386314), x + (314226370217524044*
+y - 1473852319020386314)]~
+Total time spent: 8061
diff --git a/src/test/in/nffactor b/src/test/in/nffactor
index 0992107..a3579a0 100644
--- a/src/test/in/nffactor
+++ b/src/test/in/nffactor
@@ -104,3 +104,5 @@ test(polcyclo(503),3)
test(polcyclo(211),18446744073709551667)

nfroots(a^2+1,x^2)
+
+do(y^2-22,x^2+926246528884912528275985458927067632*y-4344481316563541186659879867597013188)
2 changes: 1 addition & 1 deletion src/bin/sage-banner
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
┌────────────────────────────────────────────────────────────────────┐
│ Sage Version 6.4.beta2, Release Date: 2014-08-28
│ Sage Version 6.4.beta3, Release Date: 2014-09-10
│ Type "notebook()" for the browser-based notebook interface. │
│ Type "help()" for help. │
└────────────────────────────────────────────────────────────────────┘
Expand Down
16 changes: 11 additions & 5 deletions src/bin/sage-preparse
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ AUTHOR:

import os, sys, re

from sage.misc.preparser import preparse_file
from sage.misc.temporary_file import atomic_write

# The spkg/bin/sage script passes the files to be preparsed as
# arguments (but remove sys.argv[0]).
files = sys.argv[1:]
Expand Down Expand Up @@ -115,7 +118,6 @@ def do_preparse(f, files_before=[]):
F = '\n'.join(lines[:num] + lines[(num+1):])

# Preparse it
from sage.misc.preparser import preparse_file
G = preparse_file(F)

# Check for load/attach commands.
Expand All @@ -129,8 +131,10 @@ def do_preparse(f, files_before=[]):
i = find_position_right_after_module_docstring(G)
G = coding + G[:i] + insert + G[i:]

# Finally, write out the result.
open(fname, 'w').write(G)
# Finally, write out the result. We use atomic_write to avoid
# race conditions (for example, the file will never be half written).
with atomic_write(fname) as f:
f.write(G)

def find_position_right_after_module_docstring(G):
"""
Expand Down Expand Up @@ -215,9 +219,11 @@ def do_load_and_attach(G, file, files_before):
continue
if name.endswith('.sage'):
do_preparse(name, files_before + [file])
s += lws + 'execfile("%s.py")\n'%name[:-5]
s += lws + "exec(compile(open({0}.py).read(), {0}.py, \
'exec'))\n".format(name[:-5])
elif name.endswith('.py'):
s += lws + 'execfile("%s")\n'%name
s += lws + "exec(compile(open({0}).read(), {0}, \
'exec'))\n".format(name)
else:
s += t + '\n'
return s
Expand Down
9 changes: 4 additions & 5 deletions src/bin/sage-run
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,12 @@ if fn.startswith('-'):
print "Try 'sage -h' for more information."
sys.exit(1)

binpath = os.path.join(os.environ['SAGE_LOCAL'], 'bin')

if fn.endswith('.sage'):
if call(['sage', '-preparse', fn]) != 0:
if call(['sage-preparse', fn]) != 0:
sys.exit(1)
os.execv(os.path.join(binpath, 'sage-python'), ['sage-python', fn[:-5] + '.py'] + opts)
os.execvp('sage-python', ['sage-python', fn[:-5] + '.py'] + opts)
elif fn.endswith('.pyx') or fn.endswith('.spyx'):
os.execv(os.path.join(binpath, 'sage-run-cython'), ['sage-run-cython', fn] + opts)
os.execvp('sage-run-cython', ['sage-run-cython', fn] + opts)
else:
os.execv(os.path.join(binpath, 'sage-python'), ['sage-python', fn] + opts)
os.execvp('sage-python', ['sage-python', fn] + opts)
4 changes: 2 additions & 2 deletions src/bin/sage-version.sh
Original file line number Diff line number Diff line change
@@ -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.4.beta2'
SAGE_RELEASE_DATE='2014-08-28'
SAGE_VERSION='6.4.beta3'
SAGE_RELEASE_DATE='2014-09-10'
2 changes: 1 addition & 1 deletion src/c_lib/SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ cppFiles = Split( "ZZ_pylong.cpp ntl_wrap.cpp" )
srcFiles = cFiles + cppFiles
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 stdsage.h ZZ_pylong.h" )
Split( "mpz_pylong.h ntl_wrap.h parisage.h stdsage.h ZZ_pylong.h" )

lib = env.SharedLibrary( "csage", [ "src/" + x for x in srcFiles ],
LIBS=['ntl', 'pari', 'gmp', 'python$PYV'],
Expand Down
6 changes: 3 additions & 3 deletions src/c_lib/include/ntl_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ struct ZZ;

EXTERN int ZZ_to_int(const struct ZZ* x);
EXTERN struct ZZ* int_to_ZZ(int value);
EXTERN void ZZ_to_mpz(mpz_t* output, const struct ZZ* x);
EXTERN void mpz_to_ZZ(struct ZZ *output, const mpz_t* x);
EXTERN void ZZ_to_mpz(mpz_t output, const struct ZZ* x);
EXTERN void mpz_to_ZZ(struct ZZ *output, const mpz_t x);
EXTERN void ZZ_set_from_int(struct ZZ* x, int value);
/*Random-number generation */
//EXTERN void setSeed(const struct ZZ* n);
Expand Down Expand Up @@ -88,7 +88,7 @@ EXTERN char* ZZX_repr(struct ZZX* x);
EXTERN struct ZZX* ZZX_copy(struct ZZX* x);
EXTERN void ZZX_setitem_from_int(struct ZZX* x, long i, int value);
EXTERN int ZZX_getitem_as_int(struct ZZX* x, long i);
EXTERN void ZZX_getitem_as_mpz(mpz_t* output, struct ZZX* x, long i);
EXTERN void ZZX_getitem_as_mpz(mpz_t output, struct ZZX* x, long i);
EXTERN struct ZZX* ZZX_div(struct ZZX* x, struct ZZX* y, int* divisible);
EXTERN void ZZX_quo_rem(struct ZZX* x, struct ZZX* other, struct ZZX** r, struct ZZX** q);
EXTERN struct ZZX* ZZX_square(struct ZZX* x);
Expand Down
5 changes: 5 additions & 0 deletions src/c_lib/include/parisage.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/* Include the relevant PARI includes in a safe way */
#include <pari/paricfg.h>
#include <pari/pari.h>

#undef coeff /* Conflicts with NTL */
4 changes: 2 additions & 2 deletions src/c_lib/src/ZZ_pylong.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ PyObject * ZZ_get_pylong(ZZ &z)
mpz_t temp;
PyObject *val;
mpz_init(temp);
ZZ_to_mpz( &temp, &z );
ZZ_to_mpz( temp, &z );
val = mpz_get_pylong( temp );
mpz_clear( temp );
return val;
Expand All @@ -35,7 +35,7 @@ int ZZ_set_pylong(ZZ &z, PyObject * ll)
mpz_t temp;
mpz_init(temp);
mpz_set_pylong( temp, ll );
mpz_to_ZZ( &z, &temp );
mpz_to_ZZ( &z, temp );
mpz_clear( temp );
return 0;
}
17 changes: 8 additions & 9 deletions src/c_lib/src/ntl_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ struct ZZ* int_to_ZZ(int value)
Assumes output has been mpz_init'd.
AUTHOR: David Harvey
Joel B. Mohler moved the ZZX_getitem_as_mpz code out to this function (2007-03-13) */
void ZZ_to_mpz(mpz_t* output, const struct ZZ* x)
void ZZ_to_mpz(mpz_t output, const struct ZZ* x)
{
unsigned char stack_bytes[4096];
int use_heap;
unsigned long size = NumBytes(*x);
use_heap = (size > sizeof(stack_bytes));
unsigned char* bytes = use_heap ? (unsigned char*) malloc(size) : stack_bytes;
BytesFromZZ(bytes, *x, size);
mpz_import(*output, size, -1, 1, 0, 0, bytes);
mpz_import(output, size, -1, 1, 0, 0, bytes);
if (sign(*x) < 0)
mpz_neg(*output, *output);
mpz_neg(output, output);
if (use_heap)
free(bytes);
}
Expand All @@ -61,19 +61,18 @@ void ZZ_to_mpz(mpz_t* output, const struct ZZ* x)

/* Copies the mpz_t into the ZZ
AUTHOR: Joel B. Mohler (2007-03-15) */
// This should be changed to an mpz_t not an mpz_t*
void mpz_to_ZZ(struct ZZ* output, const mpz_t *x)
void mpz_to_ZZ(struct ZZ* output, const mpz_t x)
{
unsigned char stack_bytes[4096];
int use_heap;
size_t size = (mpz_sizeinbase(*x, 2) + bits_in_byte-1) / bits_in_byte;
size_t size = (mpz_sizeinbase(x, 2) + bits_in_byte-1) / bits_in_byte;
use_heap = (size > sizeof(stack_bytes));
void* bytes = use_heap ? malloc(size) : stack_bytes;
size_t words_written;
mpz_export(bytes, &words_written, -1, 1, 0, 0, *x);
mpz_export(bytes, &words_written, -1, 1, 0, 0, x);
clear(*output);
ZZFromBytes(*output, (unsigned char *)bytes, words_written);
if (mpz_sgn(*x) < 0)
if (mpz_sgn(x) < 0)
NTL::negate(*output, *output);
if (use_heap)
free(bytes);
Expand Down Expand Up @@ -246,7 +245,7 @@ int ZZX_getitem_as_int(struct ZZX* x, long i)
/* Copies ith coefficient of x to output.
Assumes output has been mpz_init'd.
AUTHOR: David Harvey (2007-02) */
void ZZX_getitem_as_mpz(mpz_t* output, struct ZZX* x, long i)
void ZZX_getitem_as_mpz(mpz_t output, struct ZZX* x, long i)
{
const ZZ& z = coeff(*x, i);
ZZ_to_mpz(output, &z);
Expand Down

0 comments on commit 5dc9973

Please sign in to comment.