MINT2
HyperVolume.h
Go to the documentation of this file.
1 
11 #ifndef HYPERVOLUME_HH
12 #define HYPERVOLUME_HH
13 
14 class HyperVolume;
15 
16 // HyperPlot includes
17 #include "Mint/MessageService.h"
18 #include "Mint/HyperPoint.h"
19 #include "Mint/HyperPointSet.h"
20 #include "Mint/HyperCuboid.h"
21 
22 // Root includes
23 
24 // std includes
25 
26 
27 class HyperVolume {
28 
29  private:
30 
31  int _dimension;
33  std::vector<HyperCuboid> _hyperCuboids;
36  public:
37 
38  HyperVolume(int dimension);
39  HyperVolume(const HyperPoint& lowCorner, const HyperPoint& highCorner);
40  HyperVolume(const HyperCuboid& cuboid);
41  HyperVolume(const HyperCuboid& cuboid1, const HyperCuboid& cuboid2);
42 
43 
44  const int& getDimension () const {return _dimension;}
47  void addHyperCuboid(const HyperPoint& lowCorner, const HyperPoint& highCorner);
48  void addHyperCuboid(const HyperCuboid& hyperCuboid);
49  void push_back(const HyperCuboid& hyperCuboid);
50 
51  const std::vector<HyperCuboid>& getHyperCuboids() const{return _hyperCuboids; }
54  const HyperCuboid& getHyperCuboid(int i) const{return _hyperCuboids.at(i);}
55  const HyperCuboid& at (int i) const{return _hyperCuboids.at(i);}
56  HyperCuboid& at (int i){return _hyperCuboids.at(i);}
57 
60  int size() const { return _hyperCuboids.size();}
63  HyperVolume & operator= (const HyperVolume & other);
64  HyperVolume operator+ (const HyperVolume & other) const;
65 
67 
68  void print(std::ostream& os = std::cout, int endline=1) const;
69 
70  bool inVolume(const HyperPoint& coords) const;
71  bool inVolume(const HyperPointSet& coords) const;
72  double volume() const;
73 
74  HyperVolume slice(const HyperPoint& coords, std::vector<int> dims) const;
75 
76  double getMin(int dimension) const;
77  double getMax(int dimension) const;
78 
79  HyperCuboid getLimits() const;
80 
81 
82  HyperVolume splitAll(int dimension, double fractionalSplitPoint);
83 
84  ~HyperVolume();
85 
86 };
87 
88 
89 
90 #endif
91 
HyperVolume splitAll(int dimension, double fractionalSplitPoint)
const HyperCuboid & at(int i) const
Definition: HyperVolume.h:55
int size() const
Definition: HyperVolume.h:60
double getMin(int dimension) const
void push_back(const HyperCuboid &hyperCuboid)
bool inVolume(const HyperPoint &coords) const
Definition: HyperVolume.cpp:39
HyperCuboid getLimits() const
HyperCuboid & at(int i)
Definition: HyperVolume.h:56
HyperVolume operator+(const HyperVolume &other) const
Definition: HyperVolume.cpp:63
HyperVolume & operator=(const HyperVolume &other)
Definition: HyperVolume.cpp:81
const int & getDimension() const
Definition: HyperVolume.h:44
std::vector< HyperCuboid > _hyperCuboids
Definition: HyperVolume.h:33
HyperVolume(int dimension)
Definition: HyperVolume.cpp:6
double volume() const
int _dimension
Definition: HyperVolume.h:31
const std::vector< HyperCuboid > & getHyperCuboids() const
Definition: HyperVolume.h:51
void addHyperCuboid(const HyperPoint &lowCorner, const HyperPoint &highCorner)
Definition: HyperVolume.cpp:91
HyperVolume slice(const HyperPoint &coords, std::vector< int > dims) const
const HyperCuboid & getHyperCuboid(int i) const
Definition: HyperVolume.h:54
void print(std::ostream &os=std::cout, int endline=1) const
HyperPoint getAverageCenter() const
double getMax(int dimension) const