For every matrix dimension there is a parent (MatrixSpace). You are most 
likely seeing those. Use @fork / @parallel.






On Monday, July 13, 2015 at 9:44:01 AM UTC+2, Jori Mäntysalo wrote:
>
> I was asked to make a code that iterates over all matrices of given type 
> and size. And once again I see a memory leak. Here's an example code 
>
> n = 7 
> m = Integer(n*(n-1)/2) 
> for i in IntegerRange(2^m): 
>      d = i.digits(base=2, padto=m) 
>      l = [[1]+[0]*(n-1)] 
>      for j in range(n-1): 
>          l.append( d[(j+1)*j/2:(j+1)*(j+2)/2]+ [1] + [0]*(n-j-2) ) 
>      M = Matrix(l) 
>      eig = sorted((M*M.transpose()).eigenvalues())[0] 
>      if eig <= 0: 
>          print "Foobar" 
>
> These kind of codes, where I make millions of small objects, compute 
> something and discard the object, seems to eat memory. Not much, but so 
> much that otherwise reasonable computable thing - say, something to run 
> for two days - will be impossible to do directly. 
>
> Is there anything I can do for these? (Other than running the code 
> part-by-part.) 
>
> This was ran on newest beta version. 
>
> -- 
> Jori Mäntysalo 
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to