MINT2
HyperPointSet.h
Go to the documentation of this file.
1 
11 #ifndef HYPERPOINTSET_HH
12 #define HYPERPOINTSET_HH
13 
14 // HyperPlot includes
15 #include "Mint/MessageService.h"
16 #include "Mint/HyperPoint.h"
17 #include "Mint/StatisticsFinder.h"
18 
19 // Root includes
20 #include "TMatrixD.h"
21 #include "TFile.h"
22 #include "TTree.h"
23 
24 // std includes
25 #include <algorithm>
26 #include <functional>
27 //#include <array>
28 #include <iostream>
29 
30 
32 
33  int _dimension;
34  std::vector<HyperPoint> _points;
36  void save();
37 
38  public:
39 
40  const int& getDimension() const{return _dimension;}
42  bool compatible(const HyperPoint& other, bool printError = true) const;
43 
44  const HyperPoint& at(int i) const ;
45  HyperPoint& at(int i) ;
46  unsigned int size() const ;
47  void push_back(const HyperPoint& point);
48 
49  void addHyperPointSet(const HyperPointSet& other);
50  void removeDuplicates();
51  void sort();
52 
53  double getSumW() const;
54  double getSumW2() const;
55 
56  double getCorrelation(int i, int j) const;
57  TMatrixD getCorrelationMatrix() const;
58 
59  double getCovarience(int i, int j) const;
60  TMatrixD getCovarienceMatrix() const;
61 
62  HyperPoint getMin() const;
63  HyperPoint getMax() const;
64 
65  HyperPoint mean() const;
66  HyperPoint geometricMean() const;
67  HyperPoint harmonicMean() const;
68 
69  void save(TString path);
70  void load(TString path);
71 
72  void print(std::ostream& os = std::cout) const;
73 
74  HyperPointSet(int dimension);
75  HyperPointSet(const HyperPoint& point);
76  HyperPointSet(const HyperPoint& point1, const HyperPoint& point2);
77  HyperPointSet(const HyperPoint& point1, const HyperPoint& point2, const HyperPoint& point3);
78  HyperPointSet(int npoints, const HyperPoint& point);
79 
80  HyperPointSet(TString path);
81 
82  virtual ~HyperPointSet();
83 
84  //These last functions are more std::vector oriented (i.e. treating it as a set of HyperVectors
85  //rather than a set of HyperPoints)
86 
87  bool linearlyIndependant() const; //check that the std::vectors are L.I.
88 
89  // gramSchmidtProcess makes the hyperPoints into an orthanormal basis.
90  // Note that only the first dim points will be used.
91 
93 
94  void normalise();
95 
96 };
97 
98 
99 #endif
100 
bool linearlyIndependant() const
double getCorrelation(int i, int j) const
void load(TString path)
HyperPoint getMin() const
Get a HyperCuboid that surrounds the points.
HyperPoint geometricMean() const
double getSumW2() const
HyperPoint harmonicMean() const
TMatrixD getCorrelationMatrix() const
HyperPoint mean() const
virtual ~HyperPointSet()
const HyperPoint & at(int i) const
TMatrixD getCovarienceMatrix() const
HyperPointSet(int dimension)
std::vector< HyperPoint > _points
Definition: HyperPointSet.h:34
HyperPointSet gramSchmidtProcess() const
const int & getDimension() const
Definition: HyperPointSet.h:40
double getCovarience(int i, int j) const
unsigned int size() const
void print(std::ostream &os=std::cout) const
bool compatible(const HyperPoint &other, bool printError=true) const
void addHyperPointSet(const HyperPointSet &other)
HyperPoint getMax() const
Get a HyperPoint that gives the maximum in each dim.
void removeDuplicates()
void push_back(const HyperPoint &point)
double getSumW() const