#4968: switch Matrix_modn_dense from ints to CPU longs
----------------------------+-----------------------------------------------
 Reporter:  malb            |        Owner:  was          
     Type:  enhancement     |       Status:  new          
 Priority:  major           |    Milestone:  sage-wishlist
Component:  linear algebra  |   Resolution:               
 Keywords:                  |  
----------------------------+-----------------------------------------------
Comment (by was):

 > How about "long long" across the board?

 Won't that have negative implications. For example, on a 32-bit machine
 all matrices will take twice as much memory to store, and all arithmetic
 will be an order of magnitude slower.  That certainly wouldn't make me
 happy!


 {{{
 %cython
 def foo(n):
     cdef long long i = 10, j = 10093, k
     cdef int z
     for z in range(n):
         k += i*j
     return k
 ///
 }}}

 {{{
 %cython
 def bar(n):
     cdef int i = 10, j = 10093, k
     cdef int z
     for z in range(n):
         k += i*j
     return k
 ///
 }}}

 {{{
 time foo(10^8)
 ///

 587410688573299048L
 CPU time: 0.29 s,  Wall time: 0.29 s
 }}}

 {{{
 time bar(10^8)
 ///

 -171048080
 CPU time: 0.04 s,  Wall time: 0.04 s
 }}}

 {{{
 0.29/0.04
 ///

 7.25000000000000
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/4968#comment:3>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of 
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
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