#include <gsl/gsl_matrix.h>
#include <stdbool.h>
+struct casereader;
+struct ccase;
+struct dictionary;
+struct matrix_reader;
+struct variable;
+
+struct matrix_reader
+ {
+ const struct dictionary *dict;
+ struct casegrouper *grouper;
+
+ /* Variables in 'dict'. */
+ const struct variable **svars; /* Split variables. */
+ size_t n_svars;
+ const struct variable *rowtype; /* ROWTYPE_. */
+ const struct variable **fvars; /* Factor variables. */
+ size_t n_fvars;
+ const struct variable *varname; /* VARNAME_. */
+ const struct variable **cvars; /* Continuous variables. */
+ size_t n_cvars;
+ };
+
struct matrix_material
{
- gsl_matrix *corr ; /* The correlation matrix */
- gsl_matrix *cov ; /* The covariance matrix */
+ gsl_matrix *corr; /* The correlation matrix */
+ gsl_matrix *cov; /* The covariance matrix */
/* Moment matrices */
- const gsl_matrix *n ; /* MOMENT 0 */
- const gsl_matrix *mean_matrix; /* MOMENT 1 */
- const gsl_matrix *var_matrix; /* MOMENT 2 */
+ gsl_matrix *n; /* MOMENT 0 */
+ gsl_matrix *mean_matrix; /* MOMENT 1 */
+ gsl_matrix *var_matrix; /* MOMENT 2 */
};
-struct dictionary;
-struct variable;
-struct casereader;
-
+#define MATRIX_MATERIAL_INIT { .corr = NULL }
+void matrix_material_uninit (struct matrix_material *);
-struct matrix_reader;
+struct matrix_reader *matrix_reader_create (const struct dictionary *,
+ struct casereader *);
-struct matrix_reader *create_matrix_reader_from_case_reader (const struct dictionary *dict,
- struct casereader *in_reader,
- const struct variable ***vars, size_t *n_vars);
+bool matrix_reader_destroy (struct matrix_reader *mr);
-bool destroy_matrix_reader (struct matrix_reader *mr);
+bool matrix_reader_next (struct matrix_material *mm, struct matrix_reader *mr,
+ struct casereader **groupp);
-bool next_matrix_from_reader (struct matrix_material *mm,
- struct matrix_reader *mr,
- const struct variable **vars, int n_vars);
+struct substring matrix_reader_get_string (const struct ccase *,
+ const struct variable *);
+void matrix_reader_set_string (struct ccase *, const struct variable *,
+ struct substring);
#endif