stat_vector_3d.h
Go to the documentation of this file.
1 /*
2  * Three dimensional statistic vector for use with the
3  * for ROS Node which interfaces with a wiimote control unit.
4  * Copyright (c) 2016, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13  * more details.
14  */
15 
16 /*
17  * Initial C++ implementation by
18  * Mark Horn <mark.d.horn@intel.com>
19  *
20  * Revisions:
21  *
22  */
23 
24 #pragma once
25 #ifndef WIIMOTE_STAT_VECTOR_3D_H
26 #define WIIMOTE_STAT_VECTOR_3D_H
27 
28 #include <vector>
29 #include <numeric>
30 #include <algorithm>
31 #include <math.h>
32 
33 // The vector of 3 values collected to generate:
34 // mean, standard deviation, and variance.
35 
36 typedef std::vector<double> TVectorDouble;
37 
39 {
40 public:
41  StatVector3d();
42  StatVector3d(int x, int y, int z);
43 
44  void clear();
45 
46  int size();
47  void addData(int x, int y, int z);
48 
50  TVectorDouble getMeanScaled(double scale);
52  TVectorDouble getVarianceScaled(double scale);
55 
56 private:
57  int count_;
58  std::vector<int> x_;
59  std::vector<int> y_;
60  std::vector<int> z_;
61 };
62 
63 #endif // WIIMOTE_STAT_VECTOR_3D_H
void addData(int x, int y, int z)
TVectorDouble getStandardDeviationRaw()
TVectorDouble getMeanScaled(double scale)
TVectorDouble getVarianceRaw()
std::vector< int > x_
std::vector< int > y_
std::vector< int > z_
TVectorDouble getMeanRaw()
TVectorDouble getVarianceScaled(double scale)
TVectorDouble getStandardDeviationScaled(double scale)
std::vector< double > TVectorDouble


wiimote
Author(s): Andreas Paepcke, Melonee Wise, Mark Horn
autogenerated on Fri Jun 7 2019 22:01:33