X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Flanguage%2Fdata-io%2Fmatrix-reader.h;h=5aec05e009f4a0f19bdb776b40aeef3b0168c764;hb=6d03bf519dac51a4869f9cc3ef71fef5778f1eed;hp=7a651d7866e2a320ee74a1203d9e5bef88687cf4;hpb=d4ff0e074d703dbeb8af5aa3ac470ddda5ebe301;p=pspp diff --git a/src/language/data-io/matrix-reader.h b/src/language/data-io/matrix-reader.h index 7a651d7866..5aec05e009 100644 --- a/src/language/data-io/matrix-reader.h +++ b/src/language/data-io/matrix-reader.h @@ -20,33 +20,54 @@ #include #include +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