Boost logo

Ublas :

Subject: Re: [ublas] Element-wise operations are really slow
From: Vardan Akopian (vakopian_at_[hidden])
Date: 2010-04-27 17:35:27


On Tue, Apr 27, 2010 at 2:26 PM, Gunter Winkler <guwi17_at_[hidden]> wrote:

> xiss burg schrieb:
> >
> >
> > Gunter,
> >
> > I gave a try to coordinate_matrix with push_back in my sample, and it
> > runs 10 times slower than a simple ublas::matrix. :/
> >
> yes, that's correct because I suggested to use append_element instead.
>

BTW, Xiss, if you do try append_element() as Gunter suggested, you'll also
need to do
K.clear() as the first statement in your outermost loop, otherwise it'll run
out of memory very quickly.
And to have an apples-to-apples comparison for timings, you should assign K
to a compressed_matrix (or at least do K.sort()) at the end of the same
outer loop.

-Vardan