const struct variable *weight, enum mv_class exclude)
{
size_t i;
- struct covariance *cov = xmalloc (sizeof *cov);
+ struct covariance *cov = xzalloc (sizeof *cov);
cov->passes = 1;
cov->state = 0;
cov->n_cm = (n_vars * (n_vars - 1) ) / 2;
- cov->cm = xcalloc (sizeof *cov->cm, cov->n_cm);
+ if (cov->n_cm > 0)
+ cov->cm = xcalloc (sizeof *cov->cm, cov->n_cm);
cov->categoricals = NULL;
return cov;
return categoricals_get_binary_by_subscript (cov->categoricals, i - cov->n_vars, c);
}
+#if 0
void
dump_matrix (const gsl_matrix *m)
{
printf ("\n");
}
}
+#endif
/* Call this function for every case in the data set */
void
covariance_calculate_single_pass_unnormalized (struct covariance *cov)
{
size_t i, j;
- size_t m;
for (i = 0 ; i < cov->dim; ++i)
{