[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic allocation of Non zeros?





   Zhifeng,

We already do this; it helps with the time, but still results in very inefficient runs if your preallocation is zero entries.

Perhaps you could describe how your matrix entries are generated and we can suggest a
preallocation scheme?


   Barry


On Nov 1, 2007, at 7:52 AM, Zhifeng Sheng wrote:

Dear all

It is always not easy to determine the number of nonzeros in a row without any cost.

I wonder if I can make dynamic allocation, for instance, if one found the nonzeros of a row overflow the pre-allocated space, then the space shall be doubled.

This may waste some memory but it may not be that bad. Or maybe this is already done in Petsc?

Could please tell what happens if I assign the nozero number in rows to be zeros and let the programme fills in the nonzeros ?

Best regards
Zhifeng Sheng