PostGIS  2.1.10dev-r@@SVN_REVISION@@
static double pivot ( double *  left,
double *  right 
)
static

Definition at line 142 of file rt_api.c.

References ORDER, and r.

Referenced by quicksort().

142  {
143  double l, m, r, *p;
144 
145  l = *left;
146  m = *(left + (right - left) / 2);
147  r = *right;
148 
149  /* order */
150  ORDER(l, m);
151  ORDER(l, r);
152  ORDER(m, r);
153 
154  /* pivot is higher of two values */
155  if (l < m) return m;
156  if (m < r) return r;
157 
158  /* find pivot that isn't left */
159  for (p = left + 1; p <= right; ++p) {
160  if (*p != *left)
161  return (*p < *left) ? *left : *p;
162  }
163 
164  /* all values are same */
165  return -1;
166 }
char * r
Definition: cu_in_wkt.c:25
#define ORDER(x, y)
Definition: rt_api.c:140

Here is the caller graph for this function: