MINT2
HyperCuboid.h
Go to the documentation of this file.
1 
10 #ifndef HYPERCUBOID_HH
11 #define HYPERCUBOID_HH
12 
13 class HyperCuboid;
14 
15 // HyperPlot includes
16 #include "Mint/MessageService.h"
17 #include "Mint/HyperPoint.h"
18 #include "Mint/HyperPlane.h"
19 #include "Mint/HyperLine.h"
20 #include "Mint/HyperVolume.h"
21 
22 // Root includes
23 
24 // std includes
25 #include <bitset>
26 
27 
28 class HyperCuboid {
29 
30  private:
31 
32  int _dimension;
39  mutable std::vector<HyperPlane> _faces;
40 
41  void updateFaceCash() const;
42 
43  public:
44 
45  const int& getDimension () const {return _dimension;}
48  HyperCuboid(int dimension);
49  HyperCuboid(const HyperPoint& lowCorner, const HyperPoint& highCorner);
50  HyperCuboid(int dimension, double low, double high);
51 
52  void print(std::ostream& os = std::cout, int endline=1) const;
53 
54  HyperPoint getCenter() const;
55  bool inVolume(const HyperPoint& coords) const;
56 
57  const HyperCuboid& inflateCuboid(double percent);
58 
59  double volume() const;
60 
61  double getPositiveIntersectionParameter(const HyperLine& line) const;
63 
64  double getNegativeIntersectionParameter(const HyperLine& line) const;
66 
67  //pick a random point from within the hypercuboid
68  HyperPoint getRandomPoint(TRandom* random = gRandom) const;
69  HyperPointSet getRandomPoints(int nPoints = 100, TRandom* random = gRandom) const;
70 
71  std::vector<HyperPlane> getConnectedHyperPlanes(const HyperPoint& point) const;
72  std::vector<HyperPlane> getConnectedHyperPlanes(const HyperPointSet& point) const;
73  std::vector<HyperPlane> getBoundaryHyperPlanes() const;
74 
75  HyperPoint getOppositePoint(const HyperPoint& point) const;
76  HyperPointSet getConnectedVerticies(const HyperPointSet& pointSet) const;
78  HyperPointSet getVertices() const;
79 
81 
82 
83  HyperCuboid project (std::vector<int> dims) const;
84  HyperCuboid projectOpposite(std::vector<int> dims) const;
85  bool inVolume(const HyperPoint& coords, std::vector<int> dims) const;
86 
87  const HyperPoint& getLowCorner () const{ return _lowCorner ; }
89  const HyperPoint& getHighCorner() const{ return _highCorner; }
97  HyperCuboid splitAbove(int dimension, double fractionalSplitPoint) const;
98  HyperCuboid splitBelow(int dimension, double fractionalSplitPoint) const;
99  HyperVolume split(int dimension, double fractionalSplitPoint) const;
100  void split(int dimension, double fractionalSplitPoint, HyperVolume& set) const;
101 
102  HyperPoint getWidth() const;
103  double getWidth(int dim) const;
104 
105  bool setCorners(const HyperPoint& lowCorner, const HyperPoint& highCorner);
106 
107  bool operator ==(const HyperCuboid& other) const;
108  bool operator !=(const HyperCuboid& other) const;
109 
110  ~HyperCuboid();
111 
112 };
113 
114 
115 
116 #endif
117 
HyperPoint & getLowCorner()
Definition: HyperCuboid.h:91
HyperPointSet getVertices() const
HyperPoint getRandomPoint(TRandom *random=gRandom) const
HyperPoint getOppositePoint(const HyperPoint &point) const
HyperCuboid splitAbove(int dimension, double fractionalSplitPoint) const
HyperPoint _lowCorner
Definition: HyperCuboid.h:34
HyperPointSet getConnectedVerticies(const HyperPointSet &pointSet) const
double volume() const
HyperPoint getNegativeIntersectionPoint(const HyperLine &line) const
double getNegativeIntersectionParameter(const HyperLine &line) const
int _dimension
Definition: HyperCuboid.h:32
HyperPointSet getEdgeCenters() const
HyperCuboid(int dimension)
Definition: HyperCuboid.cpp:6
bool setCorners(const HyperPoint &lowCorner, const HyperPoint &highCorner)
bool operator !=(const HyperCuboid &other) const
Definition: HyperCuboid.cpp:65
const int & getDimension() const
Definition: HyperCuboid.h:45
HyperPointSet getRandomPoints(int nPoints=100, TRandom *random=gRandom) const
void updateFaceCash() const
HyperPoint getCenter() const
Definition: HyperCuboid.cpp:93
const HyperPoint & getHighCorner() const
Definition: HyperCuboid.h:89
std::vector< HyperPlane > _faces
Definition: HyperCuboid.h:39
double getPositiveIntersectionParameter(const HyperLine &line) const
HyperPoint & getHighCorner()
Definition: HyperCuboid.h:93
HyperPoint getWidth() const
void print(std::ostream &os=std::cout, int endline=1) const
Definition: HyperCuboid.cpp:99
HyperPoint getPositiveIntersectionPoint(const HyperLine &line) const
bool operator==(const HyperCuboid &other) const
Definition: HyperCuboid.cpp:53
const HyperPoint & getLowCorner() const
Definition: HyperCuboid.h:87
std::vector< HyperPlane > getBoundaryHyperPlanes() const
HyperCuboid splitBelow(int dimension, double fractionalSplitPoint) const
HyperCuboid projectOpposite(std::vector< int > dims) const
std::vector< HyperPlane > getConnectedHyperPlanes(const HyperPoint &point) const
HyperPoint _highCorner
Definition: HyperCuboid.h:35
HyperVolume split(int dimension, double fractionalSplitPoint) const
const HyperCuboid & inflateCuboid(double percent)
Definition: HyperCuboid.cpp:80
HyperCuboid project(std::vector< int > dims) const
bool inVolume(const HyperPoint &coords) const