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

◆ pivot()

static double pivot ( double *  left,
double *  right 
)
static

Definition at line 41 of file rt_statistics.c.

41 {
42 double l, m, r, *p;
43
44 l = *left;
45 m = *(left + (right - left) / 2);
46 r = *right;
47
48 /* order */
49 ORDER(l, m);
50 ORDER(l, r);
51 ORDER(m, r);
52
53 /* pivot is higher of two values */
54 if (l < m) return m;
55 if (m < r) return r;
56
57 /* find pivot that isn't left */
58 for (p = left + 1; p <= right; ++p) {
59 if (*p != *left)
60 return (*p < *left) ? *left : *p;
61 }
62
63 /* all values are same */
64 return -1;
65}
char * r
Definition cu_in_wkt.c:24
#define ORDER(x, y)

References ORDER, and r.

Referenced by lwgeom_subdivide_recursive(), partition(), and quicksort().

Here is the caller graph for this function: