#10628: initialization of matrices from vectors or list of lists can be way 
faster
------------------------------+---------------------------------------------
   Reporter:  mderickx        |          Owner:  jason, was                 
       Type:  enhancement     |         Status:  positive_review            
   Priority:  major           |      Milestone:  sage-5.0                   
  Component:  linear algebra  |       Keywords:                             
Work_issues:                  |       Upstream:  N/A                        
   Reviewer:  Simon King      |         Author:  Maarten Derickx, Simon King
     Merged:                  |   Dependencies:                             
------------------------------+---------------------------------------------
Changes (by mderickx):

  * status:  needs_review => positive_review


Old description:

> This is demonstrated by the code below:
> {{{
> sage: M=MatrixSpace(GF(46337),400)
> sage: m=M.random_element()
> sage: m1=m.columns()
> sage: time M(m1)
> CPU times: user 3.06 s, sys: 0.44 s, total: 3.49 s
> Wall time: 3.70 s
> 400 x 400 dense matrix over Finite Field of size 46337
> sage: x=[]
> sage: time map(x.extend,m1)
> CPU times: user 0.81 s, sys: 0.02 s, total: 0.83 s
> sage: time M(x)
> CPU times: user 0.01 s, sys: 0.00 s, total: 0.01 s
> Wall time: 0.01 s
> 400 x 400 dense matrix over Finite Field of size 46337
> sage: M(x)==M(m1)
> True
> }}}
>
> Apply both patches.

New description:

 This is demonstrated by the code below:
 {{{
 sage: M=MatrixSpace(GF(46337),400)
 sage: m=M.random_element()
 sage: m1=m.columns()
 sage: time M(m1)
 CPU times: user 3.06 s, sys: 0.44 s, total: 3.49 s
 Wall time: 3.70 s
 400 x 400 dense matrix over Finite Field of size 46337
 sage: x=[]
 sage: time map(x.extend,m1)
 CPU times: user 0.81 s, sys: 0.02 s, total: 0.83 s
 sage: time M(x)
 CPU times: user 0.01 s, sys: 0.00 s, total: 0.01 s
 Wall time: 0.01 s
 400 x 400 dense matrix over Finite Field of size 46337
 sage: M(x)==M(m1)
 True
 }}}

 Apply:
 1. [attachment:10628-speedup-matrix-creation]
 2. [attachment:10628-stacked-matrix-creation.patch]

--

Comment:

 I noticed that I didn't actually put it to positive review. I tested if
 the patches applied to the new 5.0.beta1, and they did so with fuzz. I
 rebased them and they now apply without fuzz, all tests still pass hence
 now really a positive review.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10628#comment:26>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to