Constness
[pspp] / src / math / covariance.h
1 /* PSPP - a program for statistical analysis.
2    Copyright (C) 2009 Free Software Foundation, Inc.
3
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.
8
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.
13
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/>. */
16
17
18 #ifndef COVARIANCE_H
19 #define COVARIANCE_H
20
21 #include <stddef.h>
22
23 #include <data/missing-values.h>
24 #include <gsl/gsl_matrix.h>
25
26 struct covariance;
27 struct variable;
28 struct ccase ;
29
30 struct covariance * covariance_1pass_create (size_t n_vars, const struct variable *const *vars, 
31                                              const struct variable *wv, enum mv_class excl);
32
33 struct covariance *
34 covariance_2pass_create (size_t n_vars, const struct variable *const *vars,
35                          size_t n_catvars, const struct variable *const *catvars, 
36                          const struct variable *wv, enum mv_class excl);
37
38 void covariance_accumulate (struct covariance *, const struct ccase *);
39 void covariance_accumulate_pass1 (struct covariance *, const struct ccase *);
40 void covariance_accumulate_pass2 (struct covariance *, const struct ccase *);
41
42 const gsl_matrix * covariance_calculate (struct covariance *cov);
43 const gsl_matrix * covariance_calculate_unnormalized (struct covariance *);
44
45 void covariance_destroy (struct covariance *cov);
46
47 const gsl_matrix *covariance_moments (const struct covariance *cov, int m);
48
49 const struct categoricals * covariance_get_categoricals (const struct covariance *cov);
50
51 #endif