Print

Print



Aleksandar Donev wrote:

> Hi all,
>
> This is not really a Fortran question, but maybe comebody can help me.
> The most common vector update operation in numerical methods is the
> axpy:
> y<--y+alpha*x
> So the BLAS provides this as a level 1 routine.
>
> But what happens if I need (as I do in my project):
> y<--beta*y+x
> or the most general gaxpy:
> y<--beta*y+alpha*x
>
> Why aren't these in the BLAS? How can I emulate them most efficiently
> with the level 1 routines?

The most obvious (don't know if the most efficient) is scal (sp?) followed
by axpy...

y = beta * y ==> scal
y = y + x ==> axypy with alpha = 1.0

...but it's been a while since I dealt with the BLAS.  My apologies if I'm
being naive in my understanding of your problem - do you need it to be
only one call?I don't think you can do that... In any case, you are
reusing y, so no additional space is needed.

As for the gaxpy (again, my syntax may be transposed)

call scal (beta,y)
call axpy(alpha,x)
where alpha is now some number not necessarily = 1.0.

Alvaro Fernandez




%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%