First working version of CORRELATIONS.
[pspp-builds.git] / 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_create (size_t n_vars, const struct variable **vars, 
31                                        const struct variable *wv, enum mv_class excl);
32
33 void covariance_accumulate (struct covariance *, const struct ccase *);
34
35 const gsl_matrix * covariance_calculate (struct covariance *cov);
36
37 void covariance_destroy (struct covariance *cov);
38
39 const gsl_matrix *covariance_moments (const struct covariance *cov, int m);
40
41 #endif