projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Barchart Dialog: Avoid initialising multiple times
[pspp]
/
src
/
math
/
box-whisker.c
diff --git
a/src/math/box-whisker.c
b/src/math/box-whisker.c
index 0d893cb80c14d98e4b7bf3c24c5603b4d23c5d27..c30be218fd433705193ee6f6c184c29f54a7b6ed 100644
(file)
--- a/
src/math/box-whisker.c
+++ b/
src/math/box-whisker.c
@@
-63,20
+63,28
@@
acc (struct statistic *s, const struct ccase *cx,
bool extreme;
struct outlier *o;
bool extreme;
struct outlier *o;
- if ( y < bw->hinges[2] + bw->step)
- bw->whiskers[1] = y;
+ if ( y > bw->hinges[2] + bw->step) /* Upper outlier */
+ {
+ extreme = (y > bw->hinges[2] + 2 * bw->step) ;
+ }
- if (bw->whiskers[0] == SYSMIS || bw->hinges[0] - bw->step > y)
- bw->whiskers[0] = y;
+ else if (y < bw->hinges[0] - bw->step) /* Lower outlier */
+ {
+ extreme = (y < bw->hinges[0] - 2 * bw->step) ;
+ }
- if ( y > bw->hinges[2] + bw->step)
- extreme = (y > bw->hinges[2] + 2 * bw->step) ;
+ else /* Not an outlier */
+ {
+ if (bw->whiskers[0] == SYSMIS)
+ bw->whiskers[0] = y;
- else if (y < bw->hinges[0] - bw->step)
- extreme = (y < bw->hinges[0] - 2 * bw->step) ;
+ if (y > bw->whiskers[1])
+ bw->whiskers[1] = y;
+
+ return;
+ }
- else
- return;
+ /* y is an outlier */
o = xzalloc (sizeof *o) ;
o->value = y;
o = xzalloc (sizeof *o) ;
o->value = y;