[petsc-users] matrix-matrix addition

Barry Smith bsmith at mcs.anl.gov
Mon Sep 27 12:06:58 CDT 2010


On Sep 27, 2010, at 12:04 PM, Jed Brown wrote:

> 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.

   Yes, sounds like it could work and definitely better than my suggestion.
 
  Shri, can you try this?

   Barry

> 
> Jed



More information about the petsc-users mailing list