13 |
19 Jun 03 |
daniel |
// $Id$ |
13 |
19 Jun 03 |
daniel |
2 |
|
675 |
10 Oct 06 |
jari |
3 |
/* |
831 |
27 Mar 07 |
peter |
Copyright (C) 2003 Daniel Dalevi |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2004 Jari Häkkinen |
831 |
27 Mar 07 |
peter |
Copyright (C) 2005 Peter Johansson |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2006 Jari Häkkinen |
2119 |
12 Dec 09 |
peter |
Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson |
2919 |
19 Dec 12 |
peter |
Copyright (C) 2012 Peter Johansson |
13 |
19 Jun 03 |
daniel |
10 |
|
1437 |
25 Aug 08 |
peter |
This file is part of the yat library, http://dev.thep.lu.se/yat |
675 |
10 Oct 06 |
jari |
12 |
|
675 |
10 Oct 06 |
jari |
The yat library is free software; you can redistribute it and/or |
675 |
10 Oct 06 |
jari |
modify it under the terms of the GNU General Public License as |
1486 |
09 Sep 08 |
jari |
published by the Free Software Foundation; either version 3 of the |
675 |
10 Oct 06 |
jari |
License, or (at your option) any later version. |
675 |
10 Oct 06 |
jari |
17 |
|
675 |
10 Oct 06 |
jari |
The yat library is distributed in the hope that it will be useful, |
675 |
10 Oct 06 |
jari |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
675 |
10 Oct 06 |
jari |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
675 |
10 Oct 06 |
jari |
General Public License for more details. |
675 |
10 Oct 06 |
jari |
22 |
|
675 |
10 Oct 06 |
jari |
You should have received a copy of the GNU General Public License |
1487 |
10 Sep 08 |
jari |
along with yat. If not, see <http://www.gnu.org/licenses/>. |
675 |
10 Oct 06 |
jari |
25 |
*/ |
675 |
10 Oct 06 |
jari |
26 |
|
2881 |
18 Nov 12 |
peter |
27 |
#include <config.h> |
2881 |
18 Nov 12 |
peter |
28 |
|
1243 |
16 Mar 08 |
peter |
29 |
#include "Suite.h" |
1243 |
16 Mar 08 |
peter |
30 |
|
1121 |
22 Feb 08 |
peter |
31 |
#include "yat/utility/Matrix.h" |
675 |
10 Oct 06 |
jari |
32 |
#include "yat/utility/PCA.h" |
675 |
10 Oct 06 |
jari |
33 |
|
285 |
21 Apr 05 |
peter |
34 |
#include <cmath> |
13 |
19 Jun 03 |
daniel |
35 |
#include <fstream> |
13 |
19 Jun 03 |
daniel |
36 |
#include <string> |
42 |
26 Feb 04 |
jari |
37 |
#include <vector> |
42 |
26 Feb 04 |
jari |
38 |
|
13 |
19 Jun 03 |
daniel |
39 |
|
1243 |
16 Mar 08 |
peter |
40 |
int main(int argc, char* argv[]) |
13 |
19 Jun 03 |
daniel |
41 |
{ |
1098 |
18 Feb 08 |
jari |
42 |
using namespace theplu::yat; |
1243 |
16 Mar 08 |
peter |
43 |
test::Suite suite(argc, argv); |
1121 |
22 Feb 08 |
peter |
44 |
utility::Matrix A( 3, 4 ); |
1098 |
18 Feb 08 |
jari |
45 |
for( size_t i = 0; i < 3; ++i ) |
285 |
21 Apr 05 |
peter |
46 |
for( size_t j = 0; j < 4; ++j ) |
285 |
21 Apr 05 |
peter |
47 |
A(i,j)= sin( static_cast<double>(i+j+2+(i+1)*(j+1)) ); |
829 |
24 Mar 07 |
jari |
48 |
A.transpose(); |
301 |
30 Apr 05 |
peter |
49 |
utility::PCA pca(A); |
1476 |
04 Sep 08 |
peter |
50 |
for (size_t i=1; i<pca.eigenvalues().size(); ++i) |
1476 |
04 Sep 08 |
peter |
51 |
if (!suite.add(pca.eigenvalues()(i-1)>=pca.eigenvalues()(i))) |
1476 |
04 Sep 08 |
peter |
52 |
suite.err() << "eigenvalues not in non-increasing order\n"; |
13 |
19 Jun 03 |
daniel |
53 |
|
1243 |
16 Mar 08 |
peter |
54 |
return suite.return_value(); |
13 |
19 Jun 03 |
daniel |
55 |
} |