const_var_set_destroy (factors);
free (glm.factor_vars);
+ for (i = 0 ; i < glm.n_interactions; ++i)
+ interaction_destroy (glm.interactions[i]);
+
free (glm.interactions);
free (glm.dep_vars);
static void
ssq_type1 (struct covariance *cov, gsl_vector *ssq, const struct glm_spec *cmd)
{
- gsl_matrix *cm = covariance_calculate_unnormalized (cov);
+ const gsl_matrix *cm = covariance_calculate_unnormalized (cov);
size_t i;
size_t k;
bool *model_dropped = xcalloc (covariance_dim (cov), sizeof (*model_dropped));
free (model_dropped);
free (submodel_dropped);
- gsl_matrix_free (cm);
}
/*
static void
ssq_type2 (struct covariance *cov, gsl_vector *ssq, const struct glm_spec *cmd)
{
- gsl_matrix *cm = covariance_calculate_unnormalized (cov);
+ const gsl_matrix *cm = covariance_calculate_unnormalized (cov);
size_t i;
size_t k;
bool *model_dropped = xcalloc (covariance_dim (cov), sizeof (*model_dropped));
free (model_dropped);
free (submodel_dropped);
- gsl_matrix_free (cm);
}
/*
static void
ssq_type3 (struct covariance *cov, gsl_vector *ssq, const struct glm_spec *cmd)
{
- gsl_matrix *cm = covariance_calculate_unnormalized (cov);
+ const gsl_matrix *cm = covariance_calculate_unnormalized (cov);
size_t i;
size_t k;
bool *model_dropped = xcalloc (covariance_dim (cov), sizeof (*model_dropped));
gsl_matrix_free (model_cov);
}
free (model_dropped);
-
- gsl_matrix_free (cm);
}
}
{
- gsl_matrix *cm = covariance_calculate_unnormalized (cov);
+ const gsl_matrix *ucm = covariance_calculate_unnormalized (cov);
+ gsl_matrix *cm = gsl_matrix_alloc (ucm->size1, ucm->size2);
+ gsl_matrix_memcpy (cm, ucm);
// dump_matrix (cm);
break;
}
// dump_matrix (cm);
-
gsl_matrix_free (cm);
}