PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ minheap_update()

static void minheap_update ( MINHEAP tree,
areanode arealist,
int  idx 
)
static

The member of the minheap at index idx is changed.

Update the tree and make restore the heap property

Definition at line 218 of file effectivearea.c.

References area(), down(), MINHEAP::key_array, and up().

Referenced by tune_areas().

219 {
220  areanode **treearray=tree->key_array;
221  int parent=floor((idx-1)/2);
222 
223  if(((areanode*) treearray[idx])->area<((areanode*) treearray[parent])->area)
224  up(tree,arealist,idx);
225  else
226  down(tree,arealist,idx);
227  return;
228 }
This structure is placed in an array with one member per point.
Definition: effectivearea.h:38
Datum area(PG_FUNCTION_ARGS)
static void up(MINHEAP *tree, areanode *arealist, int c)
Sift Up.
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: