[SciPy-user] Trace of a sparse matrix ?

Arnd Baecker arnd.baecker at web.de
Thu Feb 16 10:12:28 CST 2006


On Thu, 16 Feb 2006, Nils Wagner wrote:

> Hi all,
>
> Is it possible to compute the trace of a sparse matrix say A
> without detouring
>
> spur=trace(A.todense()) ?

what about summing up all diagonal elements which exist in A?

Arnd



More information about the SciPy-user mailing list