gsl_matrix *mean_vectors;
gsl_matrix *var_vectors;
- gsl_matrix *correlation;
- gsl_matrix *covariance;
+ // gsl_matrix *correlation;
+ // gsl_matrix *covariance;
};
struct matrix_reader *
gsl_matrix_free (mr->n_vectors);
gsl_matrix_free (mr->mean_vectors);
gsl_matrix_free (mr->var_vectors);
- gsl_matrix_free (mr->correlation);
- gsl_matrix_free (mr->covariance);
if (!casegrouper_get_next_group (mr->grouper, &group))
return false;
mm->mean_matrix = mr->mean_vectors;
mm->var_matrix = mr->var_vectors;
- mr->correlation = NULL;
- mr->covariance = NULL;
-
// FIXME: Make this into a hash table.
unsigned long *table = xmalloc (sizeof (*table) * n_vars);
int i;
for (i = 0; i < n_vars; ++i)
{
const int w = var_get_width (mr->varname);
- uint8_t s[w];
+ char s[w];
memset (s, 0, w);
const char *name = var_get_name (vars[i]);
strcpy (s, name);
int col, row;
for (col = 0; col < n_vars; ++col)
{
- const struct variable *cv
- = vars ? vars[col] : dict_get_var (mr->dict, var_get_dict_index (mr->varname) + 1 + col);
+ const struct variable *cv = vars[col];
double x = case_data (c, cv)->f;
if (0 == strncasecmp ((char *)value_str (uv, 8), "N ", 8))
for (row = 0; row < n_vars; ++row)
if (mrow == -1)
continue;
-
if (0 == strncasecmp ((char *) value_str (uv, 8), "CORR ", 8))
{
- matrix_fill_row (&mr->correlation, c, mrow, vars, n_vars);
+ matrix_fill_row (&mm->corr, c, mrow, vars, n_vars);
}
else if (0 == strncasecmp ((char *) value_str (uv, 8), "COV ", 8))
{
- matrix_fill_row (&mr->covariance, c, mrow, vars, n_vars);
+ matrix_fill_row (&mm->cov, c, mrow, vars, n_vars);
}
}
casereader_destroy (group);
- mm->cov = mr->covariance;
- mm->corr = mr->correlation;
-
free (table);
return true;