Boost logo

Ublas :

From: Michael Stevens (mail_at_[hidden])
Date: 2005-11-06 13:46:15


On Thursday, 3. November 2005 16:31, Angus Leeming wrote:
> It appears that mapped_matrix has no non_zeros() member function, yet
> the constructors of other matrix types (say, compressed_matrix) have
> a field for this information.

The 'nnz' and function replaces 'non_zeros'.

> What is the recommended way, therefore to create a compressed_matrix
> from a mapped_matrix?

I would simply use the general expression constructor with an non_zeros
parameter.
 compressed_matrix c (m, m.nnz() );

The efficiency will non be as great as a specialised constructor but should be
OK.

Michael

-- 
___________________________________
Michael Stevens Systems Engineering
34128 Kassel, Germany
Phone/Fax: +49 561 5218038
Navigation Systems, Estimation  and
                 Bayesian Filtering
    http://bayesclasses.sf.net
___________________________________