OpenWalnut
1.5.0dev
|
This template should handly arbitrary N-dimensional histograms. More...
#include <WHistogramND.h>
Public Types | |
typedef boost::array< size_t, N > | SizeArray |
Shorthand for N-dimensional indices, counter, etc. More... | |
typedef boost::array< T, N > | TArray |
Shorthand for N-dimensional values of type T. More... | |
Public Member Functions | |
WHistogramND (TArray min, TArray max, SizeArray buckets) | |
Default constructor. More... | |
WHistogramND (const WHistogramND &hist) | |
Copy constructor. More... | |
virtual | ~WHistogramND () |
Default destructor. More... | |
virtual size_t | operator() (SizeArray index) const =0 |
Get the count of the specified bucket. More... | |
virtual size_t | size () const |
Returns the number of buckets in the HistogramND with the actual mapping. More... | |
virtual TArray | getMinima () const |
Returns the minimum value(s). More... | |
virtual TArray | getMaxima () const |
Returns the maximum value(s). More... | |
virtual T | getBucketSize (SizeArray index) const =0 |
Return the measure of one specific bucket. More... | |
virtual boost::array< std::pair< T, T >, N > | getIntervalForIndex (SizeArray index) const =0 |
Returns the actual (right-open) interval in each dimension associated with the given index. More... | |
Protected Member Functions | |
WHistogramND () | |
Default constructor is protected to allow subclassing constructors not to use initialization lists which would imply C++11 or GNU++11 style initializers for boost::array members. More... | |
void | reset (TArray min, TArray max, SizeArray buckets) |
Initializes all members. More... | |
Protected Attributes | |
TArray | m_min |
The smallest value in each dimension. More... | |
TArray | m_max |
The biggest value in each dimension. More... | |
SizeArray | m_buckets |
The number of buckets. More... | |
size_t | m_nbBuckets |
Total number of buckets. More... | |
This template should handly arbitrary N-dimensional histograms.
N | specifies the dimensionality |
T | specifies the type of data. Normally this should be double or float. Interface for an N-dimensional histogram. |
Definition at line 42 of file WHistogramND.h.
typedef boost::array< size_t, N > WHistogramND< N, T >::SizeArray |
Shorthand for N-dimensional indices, counter, etc.
Definition at line 48 of file WHistogramND.h.
typedef boost::array< T, N > WHistogramND< N, T >::TArray |
Shorthand for N-dimensional values of type T.
Definition at line 53 of file WHistogramND.h.
WHistogramND< N, T >::WHistogramND | ( | TArray | min, |
TArray | max, | ||
SizeArray | buckets | ||
) |
Default constructor.
Creates an empty N-dimensional histogram covering the specified min and max values with the specified number of buckets.
min | the smallest value(s) in each dimension |
max | the largest value(s) in each dimension |
buckets | the number of buckets in each direction (may be non uniform). |
Definition at line 172 of file WHistogramND.h.
WHistogramND< N, T >::WHistogramND | ( | const WHistogramND< N, T > & | hist | ) |
Copy constructor.
Creates a deep copy of the specified ND histogram.
hist | the HistogramND to copy. |
Definition at line 203 of file WHistogramND.h.
References WHistogramND< N, T >::m_buckets, WHistogramND< N, T >::m_max, WHistogramND< N, T >::m_min, and WHistogramND< N, T >::m_nbBuckets.
|
virtual |
Default destructor.
Definition at line 198 of file WHistogramND.h.
|
protected |
Default constructor is protected to allow subclassing constructors not to use initialization lists which would imply C++11 or GNU++11 style initializers for boost::array members.
To workaround, reset() member function is provided.
Definition at line 167 of file WHistogramND.h.
|
pure virtual |
Return the measure of one specific bucket.
For one dimensional Histograms this is the width of the bucket, for two dimensions this is the area, for three dims this is the volume, etc.
index | the measure for this bucket is queried. |
|
pure virtual |
Returns the actual (right-open) interval in each dimension associated with the given index.
index | for this bucket the intervals will be returned |
|
virtual |
|
virtual |
|
pure virtual |
Get the count of the specified bucket.
index | in each dimension |
|
protected |
Initializes all members.
This exists because to circumvent boost::array initializers in c'tor init lists and reduces code duplication, as it is used in this abstract class as well as in its base classes.
min | Minimal values in each dimension. |
max | Maximal values in each dimension. |
buckets | #buckets in each dimension. |
Definition at line 178 of file WHistogramND.h.
|
virtual |
Returns the number of buckets in the HistogramND with the actual mapping.
Definition at line 212 of file WHistogramND.h.
Referenced by WHistogram2DTest::testInitialization(), and WHistogram2DTest::testInsert().
|
protected |
The number of buckets.
Definition at line 156 of file WHistogramND.h.
Referenced by WHistogramND< N, T >::WHistogramND().
|
protected |
The biggest value in each dimension.
Definition at line 151 of file WHistogramND.h.
Referenced by WHistogramND< N, T >::WHistogramND().
|
protected |
The smallest value in each dimension.
Definition at line 146 of file WHistogramND.h.
Referenced by WHistogramND< N, T >::WHistogramND().
|
protected |
Total number of buckets.
Definition at line 161 of file WHistogramND.h.
Referenced by WHistogramND< N, T >::WHistogramND().