PostGIS  2.5.7dev-r@@SVN_REVISION@@
rt_statistics.c File Reference
#include "librtcore.h"
#include "librtcore_internal.h"
Include dependency graph for rt_statistics.c:

Go to the source code of this file.

Macros

#define SWAP(x, y)   { double t; t = x; x = y; y = t; }
 
#define ORDER(x, y)   if (x > y) SWAP(x, y)
 

Functions

static double pivot (double *left, double *right)
 
static double * partition (double *left, double *right, double pivot)
 
static void quicksort (double *left, double *right)
 
rt_bandstats rt_band_get_summary_stats (rt_band band, int exclude_nodata_value, double sample, int inc_vals, uint64_t *cK, double *cM, double *cQ)
 Compute summary statistics for a band. More...
 
rt_histogram rt_band_get_histogram (rt_bandstats stats, uint32_t bin_count, double *bin_width, uint32_t bin_width_count, int right, double min, double max, uint32_t *rtn_count)
 Count the distribution of data. More...
 
rt_quantile rt_band_get_quantiles (rt_bandstats stats, double *quantiles, int quantiles_count, uint32_t *rtn_count)
 Compute the default set of or requested quantiles for a set of data the quantile formula used is same as Excel and R default method. More...
 
static struct quantile_llist_elementquantile_llist_search (struct quantile_llist_element *element, double needle)
 
static struct quantile_llist_elementquantile_llist_insert (struct quantile_llist_element *element, double value, uint32_t *idx)
 
static int quantile_llist_delete (struct quantile_llist_element *element)
 
int quantile_llist_destroy (struct quantile_llist **list, uint32_t list_count)
 
static void quantile_llist_index_update (struct quantile_llist *qll, struct quantile_llist_element *qle, uint32_t idx)
 
static void quantile_llist_index_delete (struct quantile_llist *qll, struct quantile_llist_element *qle)
 
static struct quantile_llist_elementquantile_llist_index_search (struct quantile_llist *qll, double value, uint32_t *index)
 
static void quantile_llist_index_reset (struct quantile_llist *qll)
 
rt_quantile rt_band_get_quantiles_stream (rt_band band, int exclude_nodata_value, double sample, uint64_t cov_count, struct quantile_llist **qlls, uint32_t *qlls_count, double *quantiles, uint32_t quantiles_count, uint32_t *rtn_count)
 Compute the default set of or requested quantiles for a coverage. More...
 
rt_valuecount rt_band_get_value_count (rt_band band, int exclude_nodata_value, double *search_values, uint32_t search_values_count, double roundto, uint32_t *rtn_total, uint32_t *rtn_count)
 Count the number of times provided value(s) occur in the band. More...