projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed bug in oneway /descriptives subcommand vs. weights.
[pspp]
/
src
/
math
/
tukey-hinges.c
diff --git
a/src/math/tukey-hinges.c
b/src/math/tukey-hinges.c
index 95a79c1d30026da280cbc6fa2542518c0ff4ad1f..22ab45210c38c98066eb4bb654663114cb496ddd 100644
(file)
--- a/
src/math/tukey-hinges.c
+++ b/
src/math/tukey-hinges.c
@@
-1,5
+1,5
@@
/* PSPP - a program for statistical analysis.
/* PSPP - a program for statistical analysis.
- Copyright (C) 2008 Free Software Foundation, Inc.
+ Copyright (C) 2008
, 2009
Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@
-20,6
+20,7
@@
#include <gl/xalloc.h>
#include <libpspp/assertion.h>
#include <gl/xalloc.h>
#include <libpspp/assertion.h>
+#include <libpspp/cast.h>
#include <math.h>
void
#include <math.h>
void
@@
-59,19
+60,20
@@
tukey_hinges_calculate (const struct tukey_hinges *th, double hinge[3])
static void
destroy (struct statistic *s)
{
static void
destroy (struct statistic *s)
{
- struct order_stats *os = (struct order_stats *) s;
+ struct tukey_hinges *th = UP_CAST (s, struct tukey_hinges, parent.parent);
+ struct order_stats *os = &th->parent;
free (os->k);
free (s);
};
free (os->k);
free (s);
};
-struct
statistic
*
+struct
tukey_hinges
*
tukey_hinges_create (double W, double c_min)
{
double d;
struct tukey_hinges *th = xzalloc (sizeof (*th));
tukey_hinges_create (double W, double c_min)
{
double d;
struct tukey_hinges *th = xzalloc (sizeof (*th));
- struct order_stats *os =
(struct order_stats *) th
;
- struct statistic *stat =
(struct statistic *) th
;
+ struct order_stats *os =
&th->parent
;
+ struct statistic *stat =
&os->parent
;
assert (c_min >= 0);
assert (c_min >= 0);
@@
-97,5
+99,5
@@
tukey_hinges_create (double W, double c_min)
stat->destroy = destroy;
stat->destroy = destroy;
- return
stat
;
+ return
th
;
}
}