|
Boost : |
From: Joerg Walter (jhr.walter_at_[hidden])
Date: 2002-04-16 15:30:25
Hi Peter,
you wrote:
> 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.
Yes, this touched the problem: it could be difficult to decide, whether
pointer based or index based iterating over a referenced sparse matrix is
more efficient. Furthermore pointer based iterating is difficult enough to
implement, so I've already renounced to use it in vector_slice/matrix_slice
;-)
Best regards
Joerg
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk