annotate pca.c @ 555:2fb78abcf725 libavutil

Make ff_pca_init() allocate it struct instead of letting the user provide one (more robust ABI wise).
author michael
date Sun, 17 Aug 2008 15:46:20 +0000
parents 29d015080b3d
children 9f3f45596ecf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
1 /*
200789f57b62 Principal component analysis
michael
parents:
diff changeset
2 * Principal component analysis
200789f57b62 Principal component analysis
michael
parents:
diff changeset
3 * Copyright (c) 2004 Michael Niedermayer <michaelni@gmx.at>
200789f57b62 Principal component analysis
michael
parents:
diff changeset
4 *
200789f57b62 Principal component analysis
michael
parents:
diff changeset
5 * This library is free software; you can redistribute it and/or
200789f57b62 Principal component analysis
michael
parents:
diff changeset
6 * modify it under the terms of the GNU Lesser General Public
200789f57b62 Principal component analysis
michael
parents:
diff changeset
7 * License as published by the Free Software Foundation; either
200789f57b62 Principal component analysis
michael
parents:
diff changeset
8 * version 2 of the License, or (at your option) any later version.
200789f57b62 Principal component analysis
michael
parents:
diff changeset
9 *
200789f57b62 Principal component analysis
michael
parents:
diff changeset
10 * This library is distributed in the hope that it will be useful,
200789f57b62 Principal component analysis
michael
parents:
diff changeset
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
200789f57b62 Principal component analysis
michael
parents:
diff changeset
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
200789f57b62 Principal component analysis
michael
parents:
diff changeset
13 * Lesser General Public License for more details.
200789f57b62 Principal component analysis
michael
parents:
diff changeset
14 *
200789f57b62 Principal component analysis
michael
parents:
diff changeset
15 * You should have received a copy of the GNU Lesser General Public
200789f57b62 Principal component analysis
michael
parents:
diff changeset
16 * License along with this library; if not, write to the Free Software
200789f57b62 Principal component analysis
michael
parents:
diff changeset
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
200789f57b62 Principal component analysis
michael
parents:
diff changeset
18 *
200789f57b62 Principal component analysis
michael
parents:
diff changeset
19 */
200789f57b62 Principal component analysis
michael
parents:
diff changeset
20
200789f57b62 Principal component analysis
michael
parents:
diff changeset
21 /**
200789f57b62 Principal component analysis
michael
parents:
diff changeset
22 * @file pca.c
200789f57b62 Principal component analysis
michael
parents:
diff changeset
23 * Principal component analysis
200789f57b62 Principal component analysis
michael
parents:
diff changeset
24 */
200789f57b62 Principal component analysis
michael
parents:
diff changeset
25
551
fe6d70cb51a6 fix includes
michael
parents: 550
diff changeset
26 #include "common.h"
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
27 #include "pca.h"
200789f57b62 Principal component analysis
michael
parents:
diff changeset
28
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
29 PCA *ff_pca_init(int n){
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
30 PCA *pca;
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
31 if(n<=0)
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
32 return NULL;
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
33
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
34 pca= av_mallocz(sizeof(PCA));
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
35 pca->n= n;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
36 pca->count=0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
37 pca->covariance= av_mallocz(sizeof(double)*n*n);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
38 pca->mean= av_mallocz(sizeof(double)*n);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
39
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
40 return pca;
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
41 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
42
200789f57b62 Principal component analysis
michael
parents:
diff changeset
43 void ff_pca_free(PCA *pca){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
44 av_freep(&pca->covariance);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
45 av_freep(&pca->mean);
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
46 av_free(pca);
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
47 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
48
200789f57b62 Principal component analysis
michael
parents:
diff changeset
49 void ff_pca_add(PCA *pca, double *v){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
50 int i, j;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
51 const int n= pca->n;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
52
200789f57b62 Principal component analysis
michael
parents:
diff changeset
53 for(i=0; i<n; i++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
54 pca->mean[i] += v[i];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
55 for(j=i; j<n; j++)
200789f57b62 Principal component analysis
michael
parents:
diff changeset
56 pca->covariance[j + i*n] += v[i]*v[j];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
57 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
58 pca->count++;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
59 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
60
200789f57b62 Principal component analysis
michael
parents:
diff changeset
61 int ff_pca(PCA *pca, double *eigenvector, double *eigenvalue){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
62 int i, j, k, pass;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
63 const int n= pca->n;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
64 double z[n];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
65
200789f57b62 Principal component analysis
michael
parents:
diff changeset
66 memset(eigenvector, 0, sizeof(double)*n*n);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
67
200789f57b62 Principal component analysis
michael
parents:
diff changeset
68 for(j=0; j<n; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
69 pca->mean[j] /= pca->count;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
70 eigenvector[j + j*n] = 1.0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
71 for(i=0; i<=j; i++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
72 pca->covariance[j + i*n] /= pca->count;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
73 pca->covariance[j + i*n] -= pca->mean[i] * pca->mean[j];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
74 pca->covariance[i + j*n] = pca->covariance[j + i*n];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
75 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
76 eigenvalue[j]= pca->covariance[j + j*n];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
77 z[j]= 0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
78 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
79
200789f57b62 Principal component analysis
michael
parents:
diff changeset
80 for(pass=0; pass < 50; pass++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
81 double sum=0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
82
200789f57b62 Principal component analysis
michael
parents:
diff changeset
83 for(i=0; i<n; i++)
200789f57b62 Principal component analysis
michael
parents:
diff changeset
84 for(j=i+1; j<n; j++)
200789f57b62 Principal component analysis
michael
parents:
diff changeset
85 sum += fabs(pca->covariance[j + i*n]);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
86
200789f57b62 Principal component analysis
michael
parents:
diff changeset
87 if(sum == 0){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
88 for(i=0; i<n; i++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
89 double maxvalue= -1;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
90 for(j=i; j<n; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
91 if(eigenvalue[j] > maxvalue){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
92 maxvalue= eigenvalue[j];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
93 k= j;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
94 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
95 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
96 eigenvalue[k]= eigenvalue[i];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
97 eigenvalue[i]= maxvalue;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
98 for(j=0; j<n; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
99 double tmp= eigenvector[k + j*n];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
100 eigenvector[k + j*n]= eigenvector[i + j*n];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
101 eigenvector[i + j*n]= tmp;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
102 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
103 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
104 return pass;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
105 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
106
200789f57b62 Principal component analysis
michael
parents:
diff changeset
107 for(i=0; i<n; i++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
108 for(j=i+1; j<n; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
109 double covar= pca->covariance[j + i*n];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
110 double t,c,s,tau,theta, h;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
111
200789f57b62 Principal component analysis
michael
parents:
diff changeset
112 if(pass < 3 && fabs(covar) < sum / (5*n*n)) //FIXME why pass < 3
200789f57b62 Principal component analysis
michael
parents:
diff changeset
113 continue;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
114 if(fabs(covar) == 0.0) //FIXME shouldnt be needed
200789f57b62 Principal component analysis
michael
parents:
diff changeset
115 continue;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
116 if(pass >=3 && fabs((eigenvalue[j]+z[j])/covar) > (1LL<<32) && fabs((eigenvalue[i]+z[i])/covar) > (1LL<<32)){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
117 pca->covariance[j + i*n]=0.0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
118 continue;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
119 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
120
200789f57b62 Principal component analysis
michael
parents:
diff changeset
121 h= (eigenvalue[j]+z[j]) - (eigenvalue[i]+z[i]);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
122 theta=0.5*h/covar;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
123 t=1.0/(fabs(theta)+sqrt(1.0+theta*theta));
200789f57b62 Principal component analysis
michael
parents:
diff changeset
124 if(theta < 0.0) t = -t;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
125
200789f57b62 Principal component analysis
michael
parents:
diff changeset
126 c=1.0/sqrt(1+t*t);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
127 s=t*c;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
128 tau=s/(1.0+c);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
129 z[i] -= t*covar;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
130 z[j] += t*covar;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
131
554
29d015080b3d Do not mix declarations and statements (by ramiro).
michael
parents: 553
diff changeset
132 #define ROTATE(a,i,j,k,l) {\
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
133 double g=a[j + i*n];\
200789f57b62 Principal component analysis
michael
parents:
diff changeset
134 double h=a[l + k*n];\
200789f57b62 Principal component analysis
michael
parents:
diff changeset
135 a[j + i*n]=g-s*(h+g*tau);\
554
29d015080b3d Do not mix declarations and statements (by ramiro).
michael
parents: 553
diff changeset
136 a[l + k*n]=h+s*(g-h*tau); }
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
137 for(k=0; k<n; k++) {
200789f57b62 Principal component analysis
michael
parents:
diff changeset
138 if(k!=i && k!=j){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
139 ROTATE(pca->covariance,FFMIN(k,i),FFMAX(k,i),FFMIN(k,j),FFMAX(k,j))
200789f57b62 Principal component analysis
michael
parents:
diff changeset
140 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
141 ROTATE(eigenvector,k,i,k,j)
200789f57b62 Principal component analysis
michael
parents:
diff changeset
142 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
143 pca->covariance[j + i*n]=0.0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
144 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
145 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
146 for (i=0; i<n; i++) {
200789f57b62 Principal component analysis
michael
parents:
diff changeset
147 eigenvalue[i] += z[i];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
148 z[i]=0.0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
149 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
150 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
151
200789f57b62 Principal component analysis
michael
parents:
diff changeset
152 return -1;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
153 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
154
553
288f054e06e8 put testing code under #ifdef TEST
michael
parents: 552
diff changeset
155 #ifdef TEST
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
156
200789f57b62 Principal component analysis
michael
parents:
diff changeset
157 #undef printf
552
e525876e4ddd Testing code uses random().
michael
parents: 551
diff changeset
158 #undef random
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
159 #include <stdio.h>
200789f57b62 Principal component analysis
michael
parents:
diff changeset
160 #include <stdlib.h>
200789f57b62 Principal component analysis
michael
parents:
diff changeset
161
200789f57b62 Principal component analysis
michael
parents:
diff changeset
162 int main(){
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
163 PCA *pca;
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
164 int i, j, k;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
165 #define LEN 8
200789f57b62 Principal component analysis
michael
parents:
diff changeset
166 double eigenvector[LEN*LEN];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
167 double eigenvalue[LEN];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
168
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
169 pca= ff_pca_init(LEN);
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
170
200789f57b62 Principal component analysis
michael
parents:
diff changeset
171 for(i=0; i<9000000; i++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
172 double v[2*LEN+100];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
173 double sum=0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
174 int pos= random()%LEN;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
175 int v2= (random()%101) - 50;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
176 v[0]= (random()%101) - 50;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
177 for(j=1; j<8; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
178 if(j<=pos) v[j]= v[0];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
179 else v[j]= v2;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
180 sum += v[j];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
181 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
182 /* for(j=0; j<LEN; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
183 v[j] -= v[pos];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
184 }*/
200789f57b62 Principal component analysis
michael
parents:
diff changeset
185 // sum += random()%10;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
186 /* for(j=0; j<LEN; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
187 v[j] -= sum/LEN;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
188 }*/
200789f57b62 Principal component analysis
michael
parents:
diff changeset
189 // lbt1(v+100,v+100,LEN);
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
190 ff_pca_add(pca, v);
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
191 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
192
200789f57b62 Principal component analysis
michael
parents:
diff changeset
193
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
194 ff_pca(pca, eigenvector, eigenvalue);
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
195 for(i=0; i<LEN; i++){
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
196 pca->count= 1;
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
197 pca->mean[i]= 0;
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
198
200789f57b62 Principal component analysis
michael
parents:
diff changeset
199 // (0.5^|x|)^2 = 0.5^2|x| = 0.25^|x|
200789f57b62 Principal component analysis
michael
parents:
diff changeset
200
200789f57b62 Principal component analysis
michael
parents:
diff changeset
201
200789f57b62 Principal component analysis
michael
parents:
diff changeset
202 // pca.covariance[i + i*LEN]= pow(0.5, fabs
200789f57b62 Principal component analysis
michael
parents:
diff changeset
203 for(j=i; j<LEN; j++){
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
204 printf("%f ", pca->covariance[i + j*LEN]);
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
205 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
206 printf("\n");
200789f57b62 Principal component analysis
michael
parents:
diff changeset
207 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
208
200789f57b62 Principal component analysis
michael
parents:
diff changeset
209 #if 1
200789f57b62 Principal component analysis
michael
parents:
diff changeset
210 for(i=0; i<LEN; i++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
211 double v[LEN];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
212 double error=0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
213 memset(v, 0, sizeof(v));
200789f57b62 Principal component analysis
michael
parents:
diff changeset
214 for(j=0; j<LEN; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
215 for(k=0; k<LEN; k++){
555
2fb78abcf725 Make ff_pca_init() allocate it struct instead of letting the user provide
michael
parents: 554
diff changeset
216 v[j] += pca->covariance[FFMIN(k,j) + FFMAX(k,j)*LEN] * eigenvector[i + k*LEN];
550
200789f57b62 Principal component analysis
michael
parents:
diff changeset
217 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
218 v[j] /= eigenvalue[i];
200789f57b62 Principal component analysis
michael
parents:
diff changeset
219 error += fabs(v[j] - eigenvector[i + j*LEN]);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
220 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
221 printf("%f ", error);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
222 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
223 printf("\n");
200789f57b62 Principal component analysis
michael
parents:
diff changeset
224 #endif
200789f57b62 Principal component analysis
michael
parents:
diff changeset
225 for(i=0; i<LEN; i++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
226 for(j=0; j<LEN; j++){
200789f57b62 Principal component analysis
michael
parents:
diff changeset
227 printf("%9.6f ", eigenvector[i + j*LEN]);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
228 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
229 printf(" %9.1f %f\n", eigenvalue[i], eigenvalue[i]/eigenvalue[0]);
200789f57b62 Principal component analysis
michael
parents:
diff changeset
230 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
231
200789f57b62 Principal component analysis
michael
parents:
diff changeset
232 return 0;
200789f57b62 Principal component analysis
michael
parents:
diff changeset
233 }
200789f57b62 Principal component analysis
michael
parents:
diff changeset
234 #endif