[petsc-users] matrix-matrix addition

Jed Brown jed at 59A2.org
Mon Sep 27 12:04:22 CDT 2010


On Mon, Sep 27, 2010 at 19:01, Barry Smith <bsmith at mcs.anl.gov> wrote:
> If you do not merge the column indices from A and B but simply count them all you will get over allocation, at worst a factor of two, though usually it would just be a little.

You count the number of *unique* entries.  You have two indices that
run through the arrays aj and bj, counting duplicates only once.  This
is easy to do since they are both sorted.

Jed


More information about the petsc-users mailing list