summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/test_hotelling.cc
blob: 4edacb3bb9168bcac9460076387177f9508f0fa2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
// test_hotelling.cc
// robert - Programme du robot APBteam
// Copyright (C) 2005 Olivier Gaillard

#include <iostream>
#include <vector>
#include <string>

#include "oconfig.hh"
#include "hotelling.hh"

int 
main(int argc, char **argv) 
{
    /////////////////////////////////////////////////////////////////////////////////////////
    /// Initialisation de oconfig
    OConfig *oconfig_;
    try
      {
	oconfig_ = new OConfig;
      }
    catch (std::string &e)
      {
	std::cerr << e << std::endl;
	return 1;
      }
    /////////////////////////////////////////////////////////////////////////////////////////
    /// Initialisation des donn�es
    const int dataSize = 10;
    double t [] = {2.5, 2.4, 0.5, 0.7, 2.2, 2.9, 1.9, 2.2, 3.1, 3.0,
		   2.3, 2.7, 2, 1.6, 1, 1.1, 1.5, 1.6, 1.1, 0.9};
    Hpoint d;
    std::vector<Hpoint> list;
    for (int i=0; i<dataSize; ++i)
      {
	d.set (t[i*2], t[i*2+1]);
	list.push_back (d);
      }
    /////////////////////////////////////////////////////////////////////////////////////////
    /// Appel de la classe hotelling
    Hotelling hote (list);
    hote.eigenVectors ();
    hote.showCovMatrix ();
    hote.showEigenVectors ();

    delete oconfig_;
}