HyperPlot  v1
Bin and visualise multidimensional datasets
Public Member Functions | Private Attributes | List of all members
HyperVolume Class Reference

Detailed Description

Definition at line 27 of file 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.
 
 HyperVolume (const HyperCuboid &cuboid1, const HyperCuboid &cuboid2)
 Constuctor that adds just two HyperCuboids to the HyperVolume.
 
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 HyperCuboidgetHyperCuboid (int i) const
 
const HyperCuboidat (int i) const
 
HyperCuboidat (int i)
 
int size () const
 
HyperVolumeoperator= (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
 

Constructor & Destructor Documentation

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 ( )

Destructor

Definition at line 249 of file HyperVolume.cpp.

Member Function Documentation

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)

add a HyperCuboid to the HyperVolume

Definition at line 98 of file HyperVolume.cpp.

HyperCuboid& HyperVolume::at ( int  i)
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.

const int& HyperVolume::getDimension ( ) const
inline

get the dimensionality of the HyperVolume

Definition at line 44 of file HyperVolume.h.

const std::vector<HyperCuboid>& HyperVolume::getHyperCuboids ( ) const
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

Find the Maximum value in a given dimension.

Definition at line 166 of file HyperVolume.cpp.

double HyperVolume::getMin ( int  dimension) const

Find the Minimum value in a given dimension.

Definition at line 148 of file HyperVolume.cpp.

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)

Overwrite this HyperVolume with another.

Definition at line 81 of file HyperVolume.cpp.

void HyperVolume::print ( std::ostream &  os = std::cout,
int  endline = 1 
) const

Print the HyperCuboids that define the HyperVolume

Definition at line 196 of file HyperVolume.cpp.

void HyperVolume::push_back ( const HyperCuboid hyperCuboid)

add a HyperCuboid to the HyperVolume

Definition at line 105 of file HyperVolume.cpp.

int HyperVolume::size ( ) const
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.

Member Data Documentation

int HyperVolume::_dimension
private

Dimensionality of the HyperVolume

Definition at line 31 of file HyperVolume.h.

std::vector<HyperCuboid> HyperVolume::_hyperCuboids
private

vector containing HyperCuboids that define the HyperVolume

Definition at line 33 of file HyperVolume.h.


The documentation for this class was generated from the following files: