[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Yann
On Oct 23, 2:21 pm, Simon King wrote: > On 23 Okt., 14:15, Yann wrote: > > > this is now ticket #10158 > > Thanks! > Simon And ready for review... Yann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr.

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Simon King
On 23 Okt., 14:15, Yann wrote: > this is now ticket #10158 Thanks! Simon -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Yann
this is now ticket #10158 Yann -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagema

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Simon King
Hi Yann! On 23 Okt., 13:32, Yann wrote: > ... > In the matrix constructor (matrix in sage/matrix/constructor.py): > > entries = sum([list(v) for v in args[0]], [])    <--- this is bad > (quadratic in the length of argv[0] which is the number of rows here) I guess this line will only be executed

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Yann
> In the matrix constructor (matrix in sage/matrix/constructor.py): > > entries = sum([list(v) for v in args[0]], [])    <--- this is bad > (quadratic in the length of argv[0] which is the number of rows here) and to be complete, this could be replaced by: entries = [] for v in args[0]: entries.e

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Yann
On Oct 23, 12:20 pm, Simon King wrote: > Hi! > > On 23 Okt., 11:59, Simon King wrote: > > > So, one should create an empty matrix and then insert the elements row > > by row. > > It it also more efficient on a smaller skale (and does the right > thing): > > sage: MS = MatrixSpace(ZZ,100,50) > s

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Simon King
Hi! On 23 Okt., 11:59, Simon King wrote: > So, one should create an empty matrix and then insert the elements row > by row. It it also more efficient on a smaller skale (and does the right thing): sage: MS = MatrixSpace(ZZ,100,50) sage: L = [[ZZ.random_element() for _ in range(50)] for __ in ra

[sage-support] Re: Creating large matrix hangs

2010-10-23 Thread Simon King
Hi Robert! On 23 Okt., 10:18, Robert Bradshaw wrote: > Can you run top() and see (1) how much CPU it's using and (2) how much > memory it's using (compared to your free memory). I doubt that memory is the problem. The following is on sage.math (thus, with plenty of memory): sage: %time L = [[ZZ