Heap and Eikonal eqn

Zachary Pincus zachary.pincus at yale.edu
Wed Jun 19 15:07:17 EDT 2013


> Hi Stefan,
> 
> Thanks I'll check it out. Though, I will need to store 3 values in the heap. I see that BinaryHeap takes just a float value. I'll try and see if it can take a list perhaps.

No, it can't I'm afraid -- the heap stores a flat C-style float* array internally. Your best option is to use the heap cython code as a starting point and either add two more flat arrays of floats, or change it to an array of pointers to some other data structure.

If you don't want to hack on cython code just now, you could instead maintain three heaps (one for each value). This is obviously suboptimal, but at least it'll work with only constant-time slowdown so you can use it as a proof of concept.

Zach



More information about the scikit-image mailing list