PostGIS  2.2.7dev-r@@SVN_REVISION@@
static void up ( MINHEAP tree,
areanode arealist,
int  c 
)
static

Sift Up.

Definition at line 155 of file effectivearea.c.

References area(), MINHEAP::key_array, LWDEBUG, and areanode::treeindex.

Referenced by minheap_update().

156 {
157  LWDEBUG(2, "Entered up");
158  void *tmp;
159 
160  areanode **treearray=tree->key_array;
161 
162  int parent=floor((c-1)/2);
163 
164  while(((areanode*) treearray[c])->area<((areanode*) treearray[parent])->area)
165  {
166  /*ok, we have to swap*/
167  tmp=treearray[parent];
168  treearray[parent]=treearray[c];
169  /*Update reference*/
170  ((areanode*) treearray[parent])->treeindex=parent;
171  treearray[c]=tmp;
172  /*Update reference*/
173  ((areanode*) treearray[c])->treeindex=c;
174  c=parent;
175  parent=floor((c-1)/2);
176  }
177  return;
178 }
This structure is placed in an array with one member per point.
Definition: effectivearea.h:24
Datum area(PG_FUNCTION_ARGS)
#define LWDEBUG(level, msg)
Definition: lwgeom_log.h:50
int treeindex
Definition: effectivearea.h:27
areanode ** key_array
Definition: effectivearea.h:42

Here is the call graph for this function:

Here is the caller graph for this function: