/* PSPP - a program for statistical analysis.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
{
struct ccase *c;
const gsl_matrix *var_matrix, *samples_matrix, *mean_matrix;
- const gsl_matrix *cov_matrix;
+ gsl_matrix *cov_matrix;
gsl_matrix *corr_matrix;
struct covariance *cov = covariance_2pass_create (corr->n_vars_total, corr->vars,
NULL,
covariance_destroy (cov);
gsl_matrix_free (corr_matrix);
+ gsl_matrix_free (cov_matrix);
}
int
opts.statistics = 0;
/* Parse CORRELATIONS. */
- while (lex_token (lexer) != '.')
+ while (lex_token (lexer) != T_ENDCMD)
{
- lex_match (lexer, '/');
+ lex_match (lexer, T_SLASH);
if (lex_match_id (lexer, "MISSING"))
{
- lex_match (lexer, '=');
- while (lex_token (lexer) != '.' && lex_token (lexer) != '/')
+ lex_match (lexer, T_EQUALS);
+ while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH)
{
if (lex_match_id (lexer, "PAIRWISE"))
opts.missing_type = CORR_PAIRWISE;
lex_error (lexer, NULL);
goto error;
}
- lex_match (lexer, ',');
+ lex_match (lexer, T_COMMA);
}
}
else if (lex_match_id (lexer, "PRINT"))
{
- lex_match (lexer, '=');
- while (lex_token (lexer) != '.' && lex_token (lexer) != '/')
+ lex_match (lexer, T_EQUALS);
+ while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH)
{
if ( lex_match_id (lexer, "TWOTAIL"))
opts.tails = 2;
goto error;
}
- lex_match (lexer, ',');
+ lex_match (lexer, T_COMMA);
}
}
else if (lex_match_id (lexer, "STATISTICS"))
{
- lex_match (lexer, '=');
- while (lex_token (lexer) != '.' && lex_token (lexer) != '/')
+ lex_match (lexer, T_EQUALS);
+ while (lex_token (lexer) != T_ENDCMD && lex_token (lexer) != T_SLASH)
{
if ( lex_match_id (lexer, "DESCRIPTIVES"))
opts.statistics = STATS_DESCRIPTIVES;
goto error;
}
- lex_match (lexer, ',');
+ lex_match (lexer, T_COMMA);
}
}
else
{
if (lex_match_id (lexer, "VARIABLES"))
{
- lex_match (lexer, '=');
+ lex_match (lexer, T_EQUALS);
}
corr = xrealloc (corr, sizeof (*corr) * (n_corrs + 1));