----- Boyce Griffith <griffith at cims.nyu.edu> wrote: > > > On 9/27/10 5:28 PM, Shri wrote: > > Barry, > > I've modified MatAXPY_SeqAIJ as follows when > > DIFFERENT_NONZERO_STRUCTURE flag is true (i) create a new matrix and do > > preallocation for it. For determining the number of nonzeros per row in the > > new matrix, i've used the number of nonzeros in the original two matrices. > > This is the piece of code which computes the nnz per row in the new matrix > > for(i = 0;i< m;i++) { > > nzx = xi[i+1] - xi[i]; nzy = yi[i+1] - yi[i]; > > if (nzx> nzy) nnz[i] = nzy + (nzx - nzy); > > else nnz[i] = nzx + (nzy - nzx); > > } > > I don't understand why this is the right thing to do. My apologies,the above code snippet is incorrect. Jed has already pushed a fix for this and i'm working on it too. Sorry about the confusion.
Shri It seems like > this either sets nnz in the new matrix to be nzx or nzy, whichever is > smaller. Am I misreading this code snippet? > > -- Boyce