id	summary	reporter	owner	description	type	status	priority	milestone	component	resolution	keywords	cc	work_issues	upstream	reviewer	author	merged	dependencies	stopgaps
12499	The density() function of a sparse matrix looks at every matrix entry	jason	jason, was	"The implementation of the density method for a sparse matrix is insane.  It loops through every single index possible and asks if each entry is zero or nonzero:

{{{
sage: A=matrix(5000,5000,{(1,2): 1})
sage: A.density()
1/25000000
}}}

An implementation that instead relied on `A.nonzero_positions()` would be orders of magnitude faster.

'''Apply:'''
  1.  [attachment:trac_12499-faster-sparse-matrix-density.patch]"	defect	closed	major	sage-5.0	linear algebra	fixed	rd2	rbeezer		N/A	Rob Beezer	Punarbasu Purkayastha	sage-5.0.beta10		
