MINT2
|
#include <HyperVolume.h>
Public Member Functions | |
HyperVolume (int dimension) | |
HyperVolume (const HyperPoint &lowCorner, const HyperPoint &highCorner) | |
HyperVolume (const HyperCuboid &cuboid) | |
Constuctor that adds just one HyperCuboid to the HyperVolume. More... | |
HyperVolume (const HyperCuboid &cuboid1, const HyperCuboid &cuboid2) | |
Constuctor that adds just two HyperCuboids to the HyperVolume. More... | |
const int & | getDimension () const |
void | addHyperCuboid (const HyperPoint &lowCorner, const HyperPoint &highCorner) |
void | addHyperCuboid (const HyperCuboid &hyperCuboid) |
void | push_back (const HyperCuboid &hyperCuboid) |
const std::vector< HyperCuboid > & | getHyperCuboids () const |
const HyperCuboid & | getHyperCuboid (int i) const |
const HyperCuboid & | at (int i) const |
HyperCuboid & | at (int i) |
int | size () const |
HyperVolume & | operator= (const HyperVolume &other) |
HyperVolume | operator+ (const HyperVolume &other) const |
HyperPoint | getAverageCenter () const |
void | print (std::ostream &os=std::cout, int endline=1) const |
bool | inVolume (const HyperPoint &coords) const |
bool | inVolume (const HyperPointSet &coords) const |
double | volume () const |
HyperVolume | slice (const HyperPoint &coords, std::vector< int > dims) const |
double | getMin (int dimension) const |
double | getMax (int dimension) const |
HyperCuboid | getLimits () const |
HyperVolume | splitAll (int dimension, double fractionalSplitPoint) |
~HyperVolume () | |
Private Attributes | |
int | _dimension |
std::vector< HyperCuboid > | _hyperCuboids |
Definition at line 27 of file HyperVolume.h.
HyperVolume::HyperVolume | ( | int | dimension | ) |
Simple constuctor that only takes the dimensionality of the HyperVolume.
Definition at line 6 of file HyperVolume.cpp.
HyperVolume::HyperVolume | ( | const HyperPoint & | lowCorner, |
const HyperPoint & | highCorner | ||
) |
Constuctor that adds just one HyperCuboid to the HyperVolume, defined by its upper and lower corners.
Definition at line 13 of file HyperVolume.cpp.
HyperVolume::HyperVolume | ( | const HyperCuboid & | cuboid | ) |
Constuctor that adds just one HyperCuboid to the HyperVolume.
Definition at line 21 of file HyperVolume.cpp.
HyperVolume::HyperVolume | ( | const HyperCuboid & | cuboid1, |
const HyperCuboid & | cuboid2 | ||
) |
Constuctor that adds just two HyperCuboids to the HyperVolume.
Definition at line 30 of file HyperVolume.cpp.
HyperVolume::~HyperVolume | ( | ) |
void HyperVolume::addHyperCuboid | ( | const HyperPoint & | lowCorner, |
const HyperPoint & | highCorner | ||
) |
add a HyperCuboid (defined by upper and lower HyperPoints) to the HyperVolume
Definition at line 91 of file HyperVolume.cpp.
void HyperVolume::addHyperCuboid | ( | const HyperCuboid & | hyperCuboid | ) |
|
inline |
Definition at line 55 of file HyperVolume.h.
|
inline |
return one of the HyperCuboids
Definition at line 56 of file HyperVolume.h.
HyperPoint HyperVolume::getAverageCenter | ( | ) | const |
Find the center of mass of the HyperVolume, assuming the mass is proportional to volume.
Definition at line 114 of file HyperVolume.cpp.
|
inline |
get the dimensionality of the HyperVolume
Definition at line 44 of file HyperVolume.h.
|
inline |
Definition at line 54 of file HyperVolume.h.
|
inline |
return the std::vector containing the HyperCuboids
Definition at line 51 of file HyperVolume.h.
HyperCuboid HyperVolume::getLimits | ( | ) | const |
get the limits of the HyperVolume
Definition at line 184 of file HyperVolume.cpp.
double HyperVolume::getMax | ( | int | dimension | ) | const |
double HyperVolume::getMin | ( | int | dimension | ) | const |
bool HyperVolume::inVolume | ( | const HyperPoint & | coords | ) | const |
Check to see if a HyperPoint is within the HyperVolume
Definition at line 39 of file HyperVolume.cpp.
bool HyperVolume::inVolume | ( | const HyperPointSet & | coords | ) | const |
Check to see if all the HyperPoint in a HyperPointSet are within the HyperVolume.
Definition at line 51 of file HyperVolume.cpp.
HyperVolume HyperVolume::operator+ | ( | const HyperVolume & | other | ) | const |
Make a HyperVolume that contains the HyperCuboids from both HyperVolumes.
Definition at line 63 of file HyperVolume.cpp.
HyperVolume & HyperVolume::operator= | ( | const HyperVolume & | other | ) |
void HyperVolume::print | ( | std::ostream & | os = std::cout , |
int | endline = 1 |
||
) | const |
void HyperVolume::push_back | ( | const HyperCuboid & | hyperCuboid | ) |
add a HyperCuboid to the HyperVolume
Definition at line 105 of file HyperVolume.cpp.
|
inline |
return the number of HyperCuboids that make up the HyperVolume
Definition at line 60 of file HyperVolume.h.
HyperVolume HyperVolume::slice | ( | const HyperPoint & | coords, |
std::vector< int > | dims | ||
) | const |
Used for taking a slice through a HyperVolume. Pick a HyperPoint 'coords' e.g coords =(-1,5,4) then pick the dimensions you wish to slice through e.g. dims = (0). You can then imagine the plane defined by x_0 = -1, which intersects your HyperVolume. The 2D shape of this intersection is what will be returned. Further if you were to set dims = (0,1) you would get the 1D bin boundarys defined by the intersection of the line (x_0 = -1, x_1 = 5) and the HyperVolume.
Definition at line 210 of file HyperVolume.cpp.
HyperVolume HyperVolume::splitAll | ( | int | dimension, |
double | fractionalSplitPoint | ||
) |
Split all of the HyperCuboids within the HyperVolume in the dimension given, and at the fractionalSplitPoint given.
Definition at line 233 of file HyperVolume.cpp.
double HyperVolume::volume | ( | ) | const |
Find the volume of the HyperVolume (sum of the volume of the HyperCuboids, doesn't consider overlap).
Definition at line 136 of file HyperVolume.cpp.
|
private |
Dimensionality of the HyperVolume
Definition at line 31 of file HyperVolume.h.
|
private |
vector containing HyperCuboids that define the HyperVolume
Definition at line 33 of file HyperVolume.h.