On Oct 24, 7:00 pm, "William Stein" <[EMAIL PROTECTED]> wrote:
> On 10/24/07, Jaap Spies <[EMAIL PROTECTED]> wrote:
>
>
>
> > It is not in matrix2.pyx, It is on the bottom of my first message and here 
> > below.
>
> > It uses some functions/methods present in matrix2.pyx:
> > rook_vector, permanental_minor, prod_of_row_sums, permanent.
>
> I think you should submit a patch to Sage so that this code gets
> included standard.  It could go somewhere in the combinat directory.
> Is it a sloane sequences?   It shouldn't be in sage.all by default,
> but should be easy for users to import.
>
>
>
>
>
> > >>>> increase the amount of swap you have in that box. Adding more physical
> > >>>> RAM will probably makes the problem go away, too.
> > >>> I rebooted with no succes. Same error using 50-60% of 1 GB memory.
> > >>> Swap space is 5 GB.
> > >>> Jaap
>
> > > Ok, I will investigate on a 32 bit box then. Could you give us
> > > distribution/gcc and so on please? It might be related to specific
> > > compilers.
>
> > Linux paix 2.6.22.9-91.fc7 #1 SMP Thu Sep 27 23:10:59 EDT 2007 i686 i686 
> > i386 GNU/Linux
>
> > gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-27)
>
> > Jaap
>
> > -------
>
> > ##########################################################################
> > #  Copyright (C) 2006 Jaap Spies, [EMAIL PROTECTED]
> > #
> > #  Distributed under the terms of the GNU General Public License (GPL):
> > #
> > #                  http://www.gnu.org/licenses/
> > ##########################################################################
>
> > """
> >           Usage from sage
>
> >           sage: attach 'dancing.sage'
>
> >           sage: dance(4)
> >           h^4 - 2*h^3 + 9*h^2 - 8*h + 6
>
> > """
>
> > # use variable 'h' in the polynomial ring over the rationals
>
> > h = QQ['h'].gen()
>
> > def dance(m):
> >       """
> >           Generates the polynomial solutions of the Dancing School Problem
> >           Based on a modification of theorem 7.2.1 from Brualdi and Ryser,
> >           Combinatorial Matrix Theory.
>
> >           See NAW 5/7 nr. 4 december 2006 p. 285
>
> >           INPUT: integer m
>
> >           OUTPUT: polynomial in 'h'
>
> >           EXAMPLE:
> >               sage: dance(4)
> >               h^4 - 2*h^3 + 9*h^2 - 8*h + 6
>
> >           AUTHOR: Jaap Spies (2006)
> >       """
> >       n = 2*m-2
> >       M = MatrixSpace(ZZ, m, n)
> >       A = M([0 for i in range(m*n)])
> >       for i in range(m):
> >           for j in range(n):
> >               if i > j or j > i + n - m:
> >                   A[i,j] = 1
> >       rv = A.rook_vector()
> > #   print rv
> >       s = sum([(-1)^k*rv[k]*falling_factorial(m+h-k, m-k) for k in 
> > range(m+1)])
> >       print s
>

Hello folks,

over night I got a better bt on my local 32 bit FC 7 box:

sage: time dance(10)

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1208650048 (LWP 3143)]
0x00786473 in strlen () from /lib/libc.so.6
(gdb)
(gdb) bt
#0  0x00786473 in strlen () from /lib/libc.so.6
#1  0x0809354f in PyString_FromFormatV (format=0x811ef6c "'%.200s'
object cannot be interpreted as an index",
    vargs=<value optimized out>) at Objects/stringobject.c:202
#2  0x080d4ee0 in PyErr_Format (exception=0x813b560, format=0x811ef6c
"'%.200s' object cannot be interpreted as an index")
    at Python/errors.c:522
#3  0x0805d578 in PyNumber_Index (item=0x0) at Objects/abstract.c:965
#4  0x011ac5ee in
__pyx_f_py_20matrix_integer_dense_20Matrix_integer_dense_prod_of_row_sums
(__pyx_v_self=0xa4a8104,
    __pyx_v_cols=0xaf96ecc) at sage/matrix/matrix_integer_dense.c:
13576
#5  0x0805a277 in PyObject_Call (func=0x0, arg=0xa4a048c, kw=0x0) at
Objects/abstract.c:1860
#6  0x080be7cc in PyEval_CallObjectWithKeywords (func=0xaf9b62c,
arg=0xa4a048c, kw=0x0) at Python/ceval.c:3433
#7  0x0805a490 in PyObject_CallObject (o=0xaf9b62c, a=0xa4a048c) at
Objects/abstract.c:1851
#8  0x07db98c6 in __pyx_f_py_7matrix2_6Matrix_permanent
(__pyx_v_self=0xa4a8104, unused=0x0) at sage/matrix/matrix2.c:1657
#9  0x0805a277 in PyObject_Call (func=0x0, arg=0xb7f1702c, kw=0x0) at
Objects/abstract.c:1860
#10 0x080be7cc in PyEval_CallObjectWithKeywords (func=0xaf9694c,
arg=0xb7f1702c, kw=0x0) at Python/ceval.c:3433
#11 0x0805a490 in PyObject_CallObject (o=0xaf9694c, a=0x0) at Objects/
abstract.c:1851
#12 0x07db8711 in __pyx_f_py_7matrix2_6Matrix_permanental_minor
(__pyx_v_self=0xa4a8a94, __pyx_arg_k=0x97f8ee4)
    at sage/matrix/matrix2.c:2077
#13 0x0805a277 in PyObject_Call (func=0x0, arg=0xa41c44c, kw=0x0) at
Objects/abstract.c:1860
#14 0x080be7cc in PyEval_CallObjectWithKeywords (func=0xaf87cec,
arg=0xa41c44c, kw=0x0) at Python/ceval.c:3433
#15 0x0805a490 in PyObject_CallObject (o=0xaf87cec, a=0xa41c44c) at
Objects/abstract.c:1851
#16 0x07daf6e2 in __pyx_f_py_7matrix2_6Matrix_rook_vector
(__pyx_v_self=0xa4a8a94, __pyx_args=0xb7f1702c, __pyx_kwds=0x0)
    at sage/matrix/matrix2.c:2402
#17 0x080c539c in PyEval_EvalFrameEx (f=0xb00497c, throwflag=0) at
Python/ceval.c:3564
#18 0x080c57c5 in PyEval_EvalFrameEx (f=0xb004814, throwflag=0) at
Python/ceval.c:3650
#19 0x080c65d5 in PyEval_EvalCodeEx (co=0xa4a8338, globals=0xaf1035c,
locals=0xaf1035c, args=0x0, argcount=0, kws=0x0,
    kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:
2831
#20 0x080c6647 in PyEval_EvalCode (co=0xa4a8338, globals=0xaf1035c,
locals=0xaf1035c) at Python/ceval.c:494
#21 0x080bdc01 in builtin_eval (self=0x0, args=0xaf96c8c) at Python/
bltinmodule.c:571
#22 0x080c539c in PyEval_EvalFrameEx (f=0xb00466c, throwflag=0) at
Python/ceval.c:3564
#23 0x080c65d5 in PyEval_EvalCodeEx (co=0x9a345c0, globals=0x9a2c3e4,
locals=0x0, args=0xb00463c, argcount=2,
    kws=0xb004644, kwcount=0, defs=0x9a4a8d8, defcount=1, closure=0x0)
at Python/ceval.c:2831
#24 0x080c4a89 in PyEval_EvalFrameEx (f=0xb0044ec, throwflag=0) at
Python/ceval.c:3660
#25 0x080c57c5 in PyEval_EvalFrameEx (f=0xb004394, throwflag=0) at
Python/ceval.c:3650
#26 0x080c65d5 in PyEval_EvalCodeEx (co=0xa4a8218, globals=0xaf1035c,
locals=0xaf1035c, args=0x0, argcount=0, kws=0x0,
    kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:
2831
#27 0x080c5852 in PyEval_EvalFrameEx (f=0xaff7aec, throwflag=0) at
Python/ceval.c:494
---Type <return> to continue, or q <return> to quit---
#28 0x080c65d5 in PyEval_EvalCodeEx (co=0x99ebad0, globals=0x99ddacc,
locals=0x0, args=0xaff7ab8, argcount=2,
    kws=0xaff7ac0, kwcount=0, defs=0x0, defcount=0, closure=0x0) at
Python/ceval.c:2831
#29 0x080c4a89 in PyEval_EvalFrameEx (f=0xaff796c, throwflag=0) at
Python/ceval.c:3660
#30 0x080c65d5 in PyEval_EvalCodeEx (co=0x99eba40, globals=0x99ddacc,
locals=0x0, args=0xaff7944, argcount=3,
    kws=0xaff7950, kwcount=0, defs=0x9a5a338, defcount=2, closure=0x0)
at Python/ceval.c:2831
#31 0x080c4a89 in PyEval_EvalFrameEx (f=0xaff77fc, throwflag=0) at
Python/ceval.c:3660
#32 0x080c57c5 in PyEval_EvalFrameEx (f=0xafc9604, throwflag=0) at
Python/ceval.c:3650
#33 0x080c65d5 in PyEval_EvalCodeEx (co=0x99eb7b8, globals=0x99ddacc,
locals=0x0, args=0xaf85b7c, argcount=2,
    kws=0xaf85b84, kwcount=0, defs=0x9a5a698, defcount=1, closure=0x0)
at Python/ceval.c:2831
#34 0x080c4a89 in PyEval_EvalFrameEx (f=0xaf85a3c, throwflag=0) at
Python/ceval.c:3660
#35 0x080c65d5 in PyEval_EvalCodeEx (co=0x99eb6e0, globals=0x99ddacc,
locals=0x0, args=0x98c98f0, argcount=2,
    kws=0x98c98f8, kwcount=0, defs=0x9a5a678, defcount=1, closure=0x0)
at Python/ceval.c:2831
#36 0x080c4a89 in PyEval_EvalFrameEx (f=0x98c97ac, throwflag=0) at
Python/ceval.c:3660
#37 0x080c65d5 in PyEval_EvalCodeEx (co=0x999a410, globals=0x99988ac,
locals=0x0, args=0x980366c, argcount=1,
    kws=0x9803670, kwcount=2, defs=0x99c1c38, defcount=2, closure=0x0)
at Python/ceval.c:2831
#38 0x080c4a89 in PyEval_EvalFrameEx (f=0x9803534, throwflag=0) at
Python/ceval.c:3660
#39 0x080c65d5 in PyEval_EvalCodeEx (co=0xb7edd5c0,
globals=0xb7f2facc, locals=0xb7f2facc, args=0x0, argcount=0, kws=0x0,
    kwcount=0, defs=0x0, defcount=0, closure=0x0) at Python/ceval.c:
2831
#40 0x080c6647 in PyEval_EvalCode (co=0xb7edd5c0, globals=0xb7f2facc,
locals=0xb7f2facc) at Python/ceval.c:494
#41 0x080e52c8 in PyRun_FileExFlags (fp=0x982c788,
    filename=0xbff57c9e "/tmp/Work/sage-2.8.9.alpha0/local/bin/sage-
gdb-pythonstartup", start=257, globals=0xb7f2facc,
    locals=0xb7f2facc, closeit=0, flags=0xbff55698) at Python/
pythonrun.c:1271
#42 0x080e5557 in PyRun_SimpleFileExFlags (fp=0x982c788,
    filename=0xbff57c9e "/tmp/Work/sage-2.8.9.alpha0/local/bin/sage-
gdb-pythonstartup", closeit=0, flags=0xbff55698)
    at Python/pythonrun.c:877
#43 0x080571a6 in Py_Main (argc=0, argv=0xbff55764) at Modules/main.c:
134
#44 0x08056432 in main (argc=Cannot access memory at address 0x0
) at ./Modules/python.c:23
(gdb)

I will have a look into this later. Any help is appreciated ;)

Cheers,

Michael

> --
> William Stein
> Associate Professor of Mathematics
> University of Washingtonhttp://wstein.org


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to