PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ quantile_llist_index_update()

static void quantile_llist_index_update ( struct quantile_llist qll,
struct quantile_llist_element qle,
uint32_t  idx 
)
static

Definition at line 898 of file rt_statistics.c.

References quantile_llist_index::element, quantile_llist::head, quantile_llist::index, quantile_llist_index::index, and quantile_llist::tail.

Referenced by rt_band_get_quantiles_stream().

898  {
899  uint32_t anchor = (uint32_t) floor(idx / 100);
900 
901  if (qll->tail == qle) return;
902 
903  if (
904  (anchor != 0) && (
905  NULL == qll->index[anchor].element ||
906  idx <= qll->index[anchor].index
907  )
908  ) {
909  qll->index[anchor].index = idx;
910  qll->index[anchor].element = qle;
911  }
912 
913  if (anchor != 0 && NULL == qll->index[0].element) {
914  qll->index[0].index = 0;
915  qll->index[0].element = qll->head;
916  }
917 }
struct quantile_llist_element * element
Definition: librtcore.h:2381
struct quantile_llist_element * tail
Definition: librtcore.h:2361
struct quantile_llist_index * index
Definition: librtcore.h:2365
struct quantile_llist_element * head
Definition: librtcore.h:2360
Here is the caller graph for this function: