[petsc-users] Efficient computation of A'*A

Jed Brown jed at 59A2.org
Wed Jun 15 12:46:44 CDT 2011


On Wed, Jun 15, 2011 at 19:35, Alexander Grayver <agrayver at gfz-potsdam.de>wrote:

> Actually, I'm going to use this product as a part of the following
> expressions:
>
> v'*A'*A*v
>
A'*A*v
>

Two choices here

w = A*v
result1 = norm(w)
result2 = A'*w

preprocess: B = A'*A
w = B*v
result1 = dot(v,w)
result2 = w


Note that B will require a bit more storage it is less sparse. It is
probably problem-dependent which of these is faster.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110615/93516b31/attachment-0001.htm>


More information about the petsc-users mailing list