4 #include <grass/stats.h>
6 void c_quant(DCELL * result, DCELL * values,
int n,
const void *closure)
8 double quant = *(
const double *)closure;
25 : values[i0] * (i1 - k) + values[i1] * (k - i0);
28 void c_quart1(DCELL * result, DCELL * values,
int n,
const void *closure)
30 static const double q = 0.25;
34 void c_quart3(DCELL * result, DCELL * values,
int n,
const void *closure)
36 static const double q = 0.75;
40 void c_perc90(DCELL * result, DCELL * values,
int n,
const void *closure)
42 static const double q = 0.90;
46 void w_quant(DCELL * result, DCELL(*values)[2],
int n,
const void *closure)
48 double quant = *(
const double *)closure;
61 for (i = 0; i <
n; i++)
62 total += values[i][1];
65 for (i = 0; i <
n; i++) {
67 if (k >= total * quant)
71 *result = values[i][0];
74 void w_quart1(DCELL * result, DCELL(*values)[2],
int n,
const void *closure)
76 static const double q = 0.25;
80 void w_quart3(DCELL * result, DCELL(*values)[2],
int n,
const void *closure)
82 static const double q = 0.75;
86 void w_perc90(DCELL * result, DCELL(*values)[2],
int n,
const void *closure)
88 static const double q = 0.90;
void c_quart1(DCELL *result, DCELL *values, int n, const void *closure)
void c_quart3(DCELL *result, DCELL *values, int n, const void *closure)
int sort_cell_w(DCELL(*array)[2], int n)
void G_set_d_null_value(DCELL *dcellVals, int numVals)
void w_quant(DCELL *result, DCELL(*values)[2], int n, const void *closure)
void c_perc90(DCELL *result, DCELL *values, int n, const void *closure)
void c_quant(DCELL *result, DCELL *values, int n, const void *closure)
void w_perc90(DCELL *result, DCELL(*values)[2], int n, const void *closure)
int sort_cell(DCELL *array, int n)
void w_quart3(DCELL *result, DCELL(*values)[2], int n, const void *closure)
void w_quart1(DCELL *result, DCELL(*values)[2], int n, const void *closure)