Subject: Re: [ublas] axpy_prod Weirdness
From: Vardan Akopian (vakopian_at_[hidden])
Date: 2010-08-23 21:50:25
On Mon, Aug 23, 2010 at 3:35 PM, Jane Shevtsov <jane.eco_at_[hidden]> wrote:
> 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])?
For small matrices like in your example, I doubt axpy_prod will give
you any benefits.
axpy_prod is good primarily for large sparse matrices.
But of course you can always profile and see.
> 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);
>> ublas mailing list
>> Sent to: jane.eco_at_[hidden]
> Jane Shevtsov
> Ecology Ph.D. candidate, University of Georgia
> co-founder, <www.worldbeyondborders.org>
> Check out my blog, <http://perceivingwholes.blogspot.com>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
> ublas mailing list
> Sent to: vakopian_at_[hidden]