#7199: inefficiency of creation of sparse matrices
------------------------------+---------------------------------------------
   Reporter:  zimmerma        |       Owner:  was       
       Type:  enhancement     |      Status:  new       
   Priority:  major           |   Milestone:  sage-4.1.3
  Component:  linear algebra  |    Keywords:            
Work_issues:                  |      Author:            
   Reviewer:                  |      Merged:            
------------------------------+---------------------------------------------

Comment(by zimmerma):

 Another example (still from David Monniaux):
 {{{
 sage: count2=1000
 sage: sparseflag=True
 sage: def vessai1():
 ....:         v = vector(QQ,dimen)
 ....:     v[0]=1
 ....:     compound = Matrix(QQ, [v for i in xrange(count2)],
 sparse=sparseflag)
 ....:
 sage: def vessai2():
 ....:         v = vector(QQ,dimen)
 ....:     v[0]=1
 ....:     compound = Matrix(QQ, count2, dimen, sparse=sparseflag)
 ....:     for i in xrange(count2):
 ....:             compound[i,:] = v
 sage: dimen=30
 sage: timeit('vessai1()')
 5 loops, best of 3: 168 ms per loop
 sage: timeit('vessai2()')
 25 loops, best of 3: 14.8 ms per loop
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7199#comment:1>
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