MatStash() use linked list of chunks

Richard Tran Mills rmills at ornl.gov
Tue Dec 13 12:22:06 CST 2005


I agree with Matt's take on this.  Having a linked-list to be used throughout 
PETSc as appropriate could be quite useful.

I am a fan of doubly-linked list implementations like the one described at:

   http://www.cs.utk.edu/~plank/plank/classes/cs360/360/notes/Dllists/

(This is part of Jim Plank's libFDR library, which also includes a nice 
red-black tree implementation.)

Jim's Dllist stuff stores "Jvals" which are a union of all intrinsic C data 
types -- that way you can stash whatever you want in a node of the list.  I 
don't know if an approach that general is needed in PETSc or not, but the 
flexibility is nice.

--Richard

Matthew Knepley wrote:

>      If we are really going to do this, shouldn't we approach it as a
> data structures problem? We need a certain structure, which here appears
> to be "vector", or maybe "list". We make a general interface, and then
> code up some implementation, like a linked list. Then we can use this
> interface/impl other places in the code, like the LU part, rather than
> rely on our old cut&paste strategy.
> 
>      Matt




More information about the petsc-dev mailing list