X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fmath%2Fcovariance.c;h=d60d609e45681ffc7858abb83490b0b07b09fb46;hb=a741cf4e8348e478ec5e8658cebeb80dc0376b1a;hp=c247148ee9f88d64a29edf36e087d79ab21e95cd;hpb=5055ec22100c84153e76662bae23063408a6a935;p=pspp-builds.git diff --git a/src/math/covariance.c b/src/math/covariance.c index c247148e..d60d609e 100644 --- a/src/math/covariance.c +++ b/src/math/covariance.c @@ -338,7 +338,9 @@ covariance_accumulate_pass2 (struct covariance *cov, const struct ccase *c) assert (cov->state == 1); cov->state = 2; - cov->dim = cov->n_vars + categoricals_total (cov->categoricals); + cov->dim = cov->n_vars + + categoricals_total (cov->categoricals) - categoricals_get_n_variables (cov->categoricals); + cov->n_cm = (cov->dim * (cov->dim - 1) ) / 2; cov->cm = xcalloc (sizeof *cov->cm, cov->n_cm);