summaryrefslogtreecommitdiff
path: root/2005/i/robert/src/ovision/see/test_hotelling.cc
diff options
context:
space:
mode:
authorgaillaro2005-04-10 11:22:09 +0000
committergaillaro2005-04-10 11:22:09 +0000
commit976b5047eef9b56956ef5bcc392c0c2730f4f331 (patch)
tree9fac6baa35881042db6df293dd7cd533fe1ad13e /2005/i/robert/src/ovision/see/test_hotelling.cc
parent2092461fd47d0cbab749529ba18ee894e1fe6e50 (diff)
calcul des eigenvalues et eigenvectors finis
Diffstat (limited to '2005/i/robert/src/ovision/see/test_hotelling.cc')
-rw-r--r--2005/i/robert/src/ovision/see/test_hotelling.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/2005/i/robert/src/ovision/see/test_hotelling.cc b/2005/i/robert/src/ovision/see/test_hotelling.cc
new file mode 100644
index 0000000..5288e73
--- /dev/null
+++ b/2005/i/robert/src/ovision/see/test_hotelling.cc
@@ -0,0 +1,46 @@
+// 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 ("rc/vision.conf");
+ }
+ 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 ();
+}
+