Boost logo

Ublas :

Subject: Re: [ublas] Question regarding sparse vector's nnz() method
From: Jesse Perla (jesseperla_at_[hidden])
Date: 2010-03-10 22:11:43

 <al-iyaz <at>> writes:
> To the best of my knowledge nnz() indeed stands for the Number of Non Zero
> entries of a sparse matrix. Checking boost/numeric/ublas/matrix_sparse.hpp,
> it does seem to be implemented accordingly.

One problem I ran into recently was when I was setting elements of the sparse
matrix to be 0.0. As far as I could tell, .nnz() picked these up
as zeros (probably as designed).... if you want to find out how many
of the elements in the matrix are filled in with something, then use .filled()