13 static int icmp(
const void *aa,
const void *bb)
21 static int fcmp(
const void *aa,
const void *bb)
33 static int dcmp(
const void *aa,
const void *bb)
45 int f_nmedian(
int argc,
const int *argt,
void **args)
55 for (i = 1; i <= argc; i++)
56 if (argt[i] != argt[0])
75 for (j = 0; j < argc; j++) {
86 qsort(a, n,
sizeof(
CELL), icmp);
91 *resc = (*resc + a1) / 2;
105 for (i = 0; i <
columns; i++) {
108 for (j = 0; j < argc; j++) {
119 qsort(a, n,
sizeof(
FCELL), fcmp);
124 *resc = (*resc + a1) / 2;
132 DCELL *res = args[0];
138 for (i = 0; i <
columns; i++) {
141 for (j = 0; j < argc; j++) {
152 qsort(a, n,
sizeof(
DCELL), dcmp);
157 *resc = (*resc + a1) / 2;
size_t Rast_cell_size(RASTER_MAP_TYPE)
Returns size of a raster cell in bytes.