PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ up()

static void up ( MINHEAP tree,
__attribute__((__unused__)) areanode e,
int  c 
)
static

Sift Up.

Definition at line 169 of file effectivearea.c.

170{
171 LWDEBUG(2, "Entered up");
172 void *tmp;
173
174 areanode **treearray=tree->key_array;
175
176 int parent=floor((c-1)/2);
177
178 while(((areanode*) treearray[c])->area<((areanode*) treearray[parent])->area)
179 {
180 /*ok, we have to swap*/
181 tmp=treearray[parent];
182 treearray[parent]=treearray[c];
183 /*Update reference*/
184 ((areanode*) treearray[parent])->treeindex=parent;
185 treearray[c]=tmp;
186 /*Update reference*/
187 ((areanode*) treearray[c])->treeindex=c;
188 c=parent;
189 parent=floor((c-1)/2);
190 }
191 return;
192}
#define LWDEBUG(level, msg)
Definition lwgeom_log.h:101
areanode ** key_array
This structure is placed in an array with one member per point.

References MINHEAP::key_array, LWDEBUG, and areanode::treeindex.

Referenced by minheap_update().

Here is the caller graph for this function: