Boost logo

Boost :

From: boost (boost_at_[hidden])
Date: 2002-04-16 08:43:00


Salut,
On Tuesday 16 April 2002 11:24, Kresimir Fresl wrote:

> Since Joerg didn't reply, I will quote his earlier comment
> on this topic (thread: `slicing and ranges of matrices', Jan. 24th):
>
> ``I believe, that it's difficult to estimate the complexity of
> operations on such a view for sparse matrices (in other words: they
> could be rather inefficient). May be we currently should be more
> interested in some gather and scatter functionality for sparse
> matrices.''
>

At least you could test a simple class, were you implement the
element look up using your indices.

T& matrix_view< matrix< double > >::operator( const int index1, const int
index2 )
{
        return matrix_reference( rows[index1], columns[index2] );
}

where matrix_view<> has a reference to a matrix, and the desired rows and
columns vectors a private members. Maybe the performance is sufficient,
since the access of the underlying (sparse) matrix is probably much more
expensive.

Best wishes,
Peter


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk