#3436: random_matrix() with prescribed density buggy
----------------------------+-----------------------------------------------
Reporter: rpw | Owner: was
Type: defect | Status: new
Priority: major | Milestone: sage-4.1.1
Component: linear algebra | Keywords:
Reviewer: | Author:
Merged: |
----------------------------+-----------------------------------------------
Comment(by jason):
Some more examples with sage 4.1. The last few examples show that the
density is about an order of magnitude smaller than what we asked for.
{{{
sage: A=random_matrix(ZZ,1000,density=1e-3,sparse=True)
sage: RR(len(A.nonzero_positions()))/(A.nrows()*A.ncols())
0.000814000000000000
sage: A=random_matrix(ZZ,10000,density=1e-4,sparse=True)
sage: RR(len(A.nonzero_positions()))/(A.nrows()*A.ncols())
0.0000796700000000000
sage: A=random_matrix(ZZ,100000,density=1e-5,sparse=True)
sage: RR(len(A.nonzero_positions()))/(A.nrows()*A.ncols())
1.13230000000000e-6
sage: A=random_matrix(ZZ,100000,density=1e-6,sparse=True)
sage: RR(len(A.nonzero_positions()))/(A.nrows()*A.ncols())
1.12600000000000e-7
sage: A=random_matrix(ZZ,100000,density=1e-7,sparse=True)
sage: RR(len(A.nonzero_positions()))/(A.nrows()*A.ncols())
1.08000000000000e-8
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/3436#comment:3>
Sage <http://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
-~----------~----~----~----~------~----~------~--~---