Thanks, it makes sense, though in practice this didn't perform so
well. assign() can't take advantage of sparseness.

After throwing in some caching and other improvements performance is,
well, bad in my book but not awful. It's perhaps the price of the
distributed nature of this computation -- or else I'm doing something
wrong.

I think it's working enough for my purposes at the moment.

On Sat, Dec 12, 2009 at 7:48 PM, Ted Dunning <[email protected]> wrote:
> If the vector matrix product is done like this:
>
>      Vector w = v.like();
>      MultiplyAdd scale = new MultiplyAdd();
>      while (v.iterateNonZero().hasNext()) {
>        Vector.Element element = v.iterateNonZero().next();
>        scale.setScale(element.get());
>        w.assign(getColumn(element.index()), scale);
>      }
>

Reply via email to