Boost logo

Ublas :

Subject: Re: [ublas] axpy_prod Weirdness
From: Jane Shevtsov (jane.eco_at_[hidden])
Date: 2010-08-23 18:35:16

Thanks, I figured that was probably it. Maybe this info should be
added to the documentation.

Given the extra initialization and swap in your code, do you think
there's be any advantage to using it as opposed to the current Gprod =
prod(Gprod, Garr[i+j])?


On Mon, Aug 23, 2010 at 3:11 PM, Vardan Akopian <vakopian_at_[hidden]> wrote:
> You should not be passing the same matrix as the first and third
> argument to axpy_prod, since axpy_prod uses the third argument as
> output. For example with init = true, it will start by clearing your
> Gprod matrix first, thus the result you're seeing.
> One way to fix would be:
> matrix<double> tmp(matSize, matSize);
> axpy_prod(Gprod, Garr[i+j], tmp, true);
> Gprod.swap(tmp);
> _______________________________________________
> ublas mailing list
> ublas_at_[hidden]
> Sent to: jane.eco_at_[hidden]

Jane Shevtsov
Ecology Ph.D. candidate, University of Georgia
co-founder, <>
Check out my blog, <>Perceiving Wholes
"The whole person must have both the humility to nurture the
Earth and the pride to go to Mars." --Wyn Wachhorst, The Dream
of Spaceflight