projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Clean up and improve case code.
[pspp]
/
src
/
math
/
factor-stats.h
diff --git
a/src/math/factor-stats.h
b/src/math/factor-stats.h
index 6fa8650b261c31425b2ebd420f23bdf747e718b1..562ac45d4ca20994fff35c3d29c4d7e2ccc8c7b3 100644
(file)
--- a/
src/math/factor-stats.h
+++ b/
src/math/factor-stats.h
@@
-1,7
+1,6
@@
/* PSPP - A program for statistical analysis . -*-c-*-
Copyright (C) 2004 Free Software Foundation, Inc.
/* PSPP - A program for statistical analysis . -*-c-*-
Copyright (C) 2004 Free Software Foundation, Inc.
-Author: John Darrington 2004
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
@@
-22,11
+21,11
@@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
#define FACTOR_STATS
#define FACTOR_STATS
-/* FIXME: These things should probably be amalgamated with the
+/* FIXME: These things should probably be amalgamated with the
group_statistics struct */
group_statistics struct */
-#include
"hash.h"
-#include
"value.h"
+#include
<libpspp/hash.h>
+#include
<data/value.h>
#include <string.h>
#include <gsl/gsl_histogram.h>
#include "percentiles.h"
#include <string.h>
#include <gsl/gsl_histogram.h>
#include "percentiles.h"
@@
-39,13
+38,13
@@
struct metrics
double n;
double n_missing;
double n;
double n_missing;
-
+
double min;
double max;
double mean;
double min;
double max;
double mean;
-
+
double se_mean;
double var;
double se_mean;
double var;
@@
-90,7
+89,7
@@
struct metrics * metrics_create(void);
void metrics_precalc(struct metrics *m);
void metrics_precalc(struct metrics *m);
-void metrics_calc(struct metrics *m, const union value *f, double weight,
+void metrics_calc(struct metrics *m, const union value *f, double weight,
int case_no);
void metrics_postcalc(struct metrics *m);
int case_no);
void metrics_postcalc(struct metrics *m);
@@
-106,7
+105,7
@@
struct case_node
struct case_node *next;
};
struct case_node *next;
};
-struct weighted_value
+struct weighted_value
{
union value v;
{
union value v;
@@
-114,14
+113,14
@@
struct weighted_value
double w;
/* The cumulative weight */
double w;
/* The cumulative weight */
- double cc;
+ double cc;
/* The rank */
double rank;
/* Linked list of cases nos which have this value */
struct case_node *case_nos;
/* The rank */
double rank;
/* Linked list of cases nos which have this value */
struct case_node *case_nos;
-
+
};
};
@@
-134,7
+133,7
@@
void weighted_value_free(struct weighted_value *wv);
struct factor_statistics {
/* The values of the independent variables */
struct factor_statistics {
/* The values of the independent variables */
- union value id[2];
+ union value
*
id[2];
/* The an array stats for this factor, one for each dependent var */
struct metrics *m;
/* The an array stats for this factor, one for each dependent var */
struct metrics *m;
@@
-146,8
+145,9
@@
struct factor_statistics {
/* Create a factor statistics object with for N dependent vars
and ID as the value of the independent variable */
/* Create a factor statistics object with for N dependent vars
and ID as the value of the independent variable */
-struct factor_statistics *
-create_factor_statistics (int n, union value *id0, union value *id1);
+struct factor_statistics * create_factor_statistics (int n,
+ union value *id0,
+ union value *id1);
void factor_statistics_free(struct factor_statistics *f);
void factor_statistics_free(struct factor_statistics *f);
@@
-155,13
+155,11
@@
void factor_statistics_free(struct factor_statistics *f);
/* Compare f0 and f1.
width is the width of the independent variable */
/* Compare f0 and f1.
width is the width of the independent variable */
-int
+int
factor_statistics_compare(const struct factor_statistics *f0,
const struct factor_statistics *f1, int width);
factor_statistics_compare(const struct factor_statistics *f0,
const struct factor_statistics *f1, int width);
-
-
-unsigned int
+unsigned int
factor_statistics_hash(const struct factor_statistics *f, int width);
#endif
factor_statistics_hash(const struct factor_statistics *f, int width);
#endif