projects
/
pspp-builds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add new dependency to gui-tools
[pspp-builds.git]
/
src
/
math
/
percentiles.c
diff --git
a/src/math/percentiles.c
b/src/math/percentiles.c
index 53d704d623036981d99ae49d49677498542e010a..bf99de163ffbaafe2af8711685e9a640a0256784 100644
(file)
--- a/
src/math/percentiles.c
+++ b/
src/math/percentiles.c
@@
-47,6
+47,8
@@
percentile_calculate (const struct percentile *ptl, enum pc_alg alg)
struct percentile *mutable = (struct percentile *) ptl;
const struct order_stats *os = &ptl->parent;
struct percentile *mutable = (struct percentile *) ptl;
const struct order_stats *os = &ptl->parent;
+ assert (os->cc == ptl->w);
+
if ( ptl->g1 == SYSMIS)
mutable->g1 = (os->k[0].tc - os->k[0].cc) / os->k[0].c_p1;
if ( ptl->g1 == SYSMIS)
mutable->g1 = (os->k[0].tc - os->k[0].cc) / os->k[0].c_p1;
@@
-169,6
+171,7
@@
percentile_create (double p, double W)
assert (p <= 1.0);
ptl->ptile = p;
assert (p <= 1.0);
ptl->ptile = p;
+ ptl->w = W;
os->n_k = 2;
os->k = xcalloc (sizeof (*os->k), 2);
os->n_k = 2;
os->k = xcalloc (sizeof (*os->k), 2);
@@
-186,15
+189,3
@@
percentile_create (double p, double W)
return os;
}
return os;
}
-#if 0
-void
-percentile_dump (const struct percentile *ptl)
-{
- printf ("Percentile %g:\n\tk1: ", ptl->ptile);
-
- dump_os_k1 ((const struct os *)ptl);
- printf ("\tk2: ");
- dump_os_k2 ((const struct os *)ptl);
- printf ("\n");
-}
-#endif