PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ minheap_pop()

static areanode* minheap_pop ( MINHEAP tree,
areanode arealist 
)
static

Get a reference to the point with the smallest effective area from the root of the min heap.

Definition at line 199 of file effectivearea.c.

References down(), MINHEAP::key_array, LWDEBUG, window::res, areanode::treeindex, and MINHEAP::usedSize.

Referenced by tune_areas().

200 {
201  LWDEBUG(2, "Entered minheap_pop");
202  areanode *res = tree->key_array[0];
203 
204  /*put last value first*/
205  tree->key_array[0]=tree->key_array[(tree->usedSize)-1];
206  ((areanode*) tree->key_array[0])->treeindex=0;
207 
208  tree->usedSize--;
209  down(tree,arealist,0);
210  return res;
211 }
tuple res
Definition: window.py:78
This structure is placed in an array with one member per point.
Definition: effectivearea.h:38
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:83
int treeindex
Definition: effectivearea.h:41
int usedSize
Definition: effectivearea.h:55
areanode ** key_array
Definition: effectivearea.h:56
static void down(MINHEAP *tree, areanode *arealist, int parent)
Sift Down.
Here is the call graph for this function:
Here is the caller graph for this function: