MatConvert was slow when I tested 10 days ago, because was not preallocating the new matrix (see initial part of this thread). I was trying to find a work around. Unless you already fixed this, did you?... I haven't reinstalled petsc from then
I need the final Dual Graph (the filtered matrix) in Adj mat format. I will extract indices from the AIJ matrix (the matrix to filter), and I I will create a new Adj (avoiding to do an in-place operation as you suggested) Thanks Paolo On Fri, Nov 15, 2013 at 7:34 PM, Jed Brown <[email protected]> wrote: > Paolo Orsini <[email protected]> writes: > > > Hi Jed, > > > > I am back to work on this now... > > > > Thanks for explaining how I can do this. it makes perfectly sense: > > > > A. Assign entries values = 1, when forming the Adj matrix, > > > > B. Convert the Adj matrix to AIJ matrix, so I can use MatMatTransposeMult > > (or form AIJ directly): can I preallocate AIJ before calling MatConvert? > To > > avoid slow performance? Is there any conflict between the preallocoation > > functions and MatConvert? > > MatConvert() should be fast. > > > C. Filter AIJ, to remove entries with values <3 (for 3d problems). What > > function shall I use to do this operation? > > Don't try to do it in-place. Do you want the result in a matrix or in > another data structure? Anyway, I would just walk along calling > MatGetRow() and picking out the column indices that have values of at > least 3. >
