1 /* PSPP - a program for statistical analysis.
2 Copyright (C) 2017 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef MATRIX_READER_H
18 #define MATRIX_READER_H
20 #include <gsl/gsl_matrix.h>
23 struct matrix_material
25 gsl_matrix *corr; /* The correlation matrix */
26 gsl_matrix *cov; /* The covariance matrix */
29 gsl_matrix *n; /* MOMENT 0 */
30 gsl_matrix *mean_matrix; /* MOMENT 1 */
31 gsl_matrix *var_matrix; /* MOMENT 2 */
34 #define MATRIX_MATERIAL_INIT { .corr = NULL }
35 void matrix_material_uninit (struct matrix_material *);
44 struct matrix_reader *create_matrix_reader_from_case_reader (const struct dictionary *dict,
45 struct casereader *in_reader,
46 const struct variable ***vars, size_t *n_vars);
48 bool destroy_matrix_reader (struct matrix_reader *mr);
50 bool next_matrix_from_reader (struct matrix_material *mm,
51 struct matrix_reader *mr,
52 const struct variable **vars, int n_vars);