12 static int dcmp(
const void *aa,
const void *bb)
24 static double mode(
double *value,
int argc)
35 qsort(value, argc,
sizeof(
double), dcmp);
37 for (i = 0; i < argc;) {
41 for (i++; i < argc; i++) {
57 int f_mode(
int argc,
const int *argt,
void **args)
60 static int value_size;
61 int size = argc *
sizeof(double);
67 for (i = 1; i <= argc; i++)
68 if (argt[i] != argt[0])
71 if (size > value_size) {
84 for (j = 0; j < argc && !nv; j++) {
88 value[j] = (double)argv[j][i];
94 res[i] = (
CELL)mode(value, argc);
102 for (i = 0; i <
columns; i++) {
105 for (j = 0; j < argc && !nv; j++) {
109 value[j] = (double)argv[j][i];
115 res[i] = (
FCELL)mode(value, argc);
120 DCELL *res = args[0];
123 for (i = 0; i <
columns; i++) {
126 for (j = 0; j < argc && !nv; j++) {
130 value[j] = (double)argv[j][i];
136 res[i] = (
DCELL)mode(value, argc);
int f_mode(int argc, const int *argt, void **args)