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>
31 const struct dictionary *dict;
32 struct casegrouper *grouper;
34 /* Variables in 'dict'. */
35 const struct variable **svars; /* Split variables. */
37 const struct variable *rowtype; /* ROWTYPE_. */
38 const struct variable **fvars; /* Factor variables. */
40 const struct variable *varname; /* VARNAME_. */
41 const struct variable **cvars; /* Continuous variables. */
45 struct matrix_material
47 gsl_matrix *corr; /* The correlation matrix */
48 gsl_matrix *cov; /* The covariance matrix */
51 gsl_matrix *n; /* MOMENT 0 */
52 gsl_matrix *mean_matrix; /* MOMENT 1 */
53 gsl_matrix *var_matrix; /* MOMENT 2 */
56 #define MATRIX_MATERIAL_INIT { .corr = NULL }
57 void matrix_material_uninit (struct matrix_material *);
59 struct matrix_reader *matrix_reader_create (const struct dictionary *,
62 bool matrix_reader_destroy (struct matrix_reader *mr);
64 bool matrix_reader_next (struct matrix_material *mm, struct matrix_reader *mr,
65 struct casereader **groupp);
67 struct substring matrix_reader_get_string (const struct ccase *,
68 const struct variable *);
69 void matrix_reader_set_string (struct ccase *, const struct variable *,