projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
documentation
[pspp]
/
src
/
math
/
shapiro-wilk.c
diff --git
a/src/math/shapiro-wilk.c
b/src/math/shapiro-wilk.c
index f48156e97cfdd5605e36f98e9b00ebaa90971b7c..27ca1f0fb558adddc9c9d5af77a32580cf14a954 100644
(file)
--- a/
src/math/shapiro-wilk.c
+++ b/
src/math/shapiro-wilk.c
@@
-26,7
+26,6
@@
#include "libpspp/message.h"
#include "gettext.h"
#include "libpspp/message.h"
#include "gettext.h"
-#define _(msgid) gettext (msgid)
#define N_(msgid) msgid
/* Return the sum of coeff[i] * x^i for all i in the range [0,order).
#define N_(msgid) msgid
/* Return the sum of coeff[i] * x^i for all i in the range [0,order).
@@
-116,7
+115,10
@@
shapiro_wilk_calculate (const struct shapiro_wilk *sw)
struct shapiro_wilk *
shapiro_wilk_create (int n, double mean)
{
struct shapiro_wilk *
shapiro_wilk_create (int n, double mean)
{
- struct shapiro_wilk *sw = xzalloc (sizeof (*sw));
+ if (n < 3 || n > 5000)
+ return NULL;
+
+ struct shapiro_wilk *sw = XZALLOC (struct shapiro_wilk);
struct order_stats *os = &sw->parent;
struct statistic *stat = &os->parent;
struct order_stats *os = &sw->parent;
struct statistic *stat = &os->parent;
@@
-128,9
+130,6
@@
shapiro_wilk_create (int n, double mean)
sw->n = n;
sw->n = n;
- if (n < 3 || n > 5000)
- return NULL;
-
const double u = 1.0 / sqrt (sw->n);
double m = 0;
const double u = 1.0 / sqrt (sw->n);
double m = 0;