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_nmode(
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; j++) {
87 value[n++] = (double)argv[j][i];
93 res[i] = (
CELL)mode(value, n);
101 for (i = 0; i <
columns; i++) {
104 for (j = 0; j < argc; j++) {
107 value[n++] = (double)argv[j][i];
113 res[i] = (
FCELL)mode(value, n);
118 DCELL *res = args[0];
121 for (i = 0; i <
columns; i++) {
124 for (j = 0; j < argc; j++) {
127 value[n++] = (double)argv[j][i];
133 res[i] = (
DCELL)mode(value, n);
int f_nmode(int argc, const int *argt, void **args)