[petsc-dev] VecAXPY() in loops in TS

Jed Brown jed at 59A2.org
Fri Feb 18 17:03:20 CST 2011

On Fri, Feb 18, 2011 at 19:48, Barry Smith <bsmith at mcs.anl.gov> wrote:

> Can some of the VecAXPY() calls in loops in TS be replaced with single
> VecMAXPY() calls? For example
>  for (j=0; j<r; j++) {
>          ierr = VecAXPY(gl->Z,-shift*u[i*r+j],X[j]);CHKERRQ(ierr);
>        }

They can, but we would have to create a temporary array to hold the
coefficients and run the loop to fill the coefficients into that array. I
recall intending to do that when I first wrote this, but clearly it never
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-dev/attachments/20110219/196076e7/attachment.html>

More information about the petsc-dev mailing list