#include <BoxNDScanner.h>
Public Member Functions | |
unsigned | dim () const |
void | getCoords (Numeric *x, unsigned nx) const |
void | getIndex (unsigned *index, unsigned indexBufferLen) const |
bool | isValid () const |
unsigned long | maxState () const |
BoxNDScanner & | operator++ () |
void | operator++ (int) |
void | reset () |
void | setState (const unsigned long state) |
unsigned long | state () const |
BoxNDScanner (const BoxND< Numeric > &box, const std::vector< unsigned > &shape) | |
BoxNDScanner (const BoxND< Numeric > &box, const unsigned *shape, const unsigned lenShape) | |
Private Member Functions | |
BoxNDScanner () | |
void | initialize (const unsigned *shape, unsigned lenShape) |
Private Attributes | |
BoxND< Numeric > | box_ |
std::vector< double > | bw_ |
unsigned long | maxState_ |
unsigned long | state_ |
std::vector< unsigned long > | strides_ |
A class for iterating over all coordinates in a multidimensional box (but not a full-fledeged iterator). The expected usage pattern is as follows:
The coordinates will be in the middle of the bins (imagine a multivariate histogram with boundaries defined by the given box).
Definition at line 38 of file BoxNDScanner.h.
|
inline |
Constructor from a bounding box and a multidimensional array shape
Definition at line 46 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::initialize().
|
inline |
Definition at line 52 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::initialize().
|
private |
Referenced by npstat::BoxNDScanner< Numeric >::setState().
|
inline |
Dimensionality of the scan
Definition at line 58 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::box_.
Referenced by npstat::BoxNDScanner< Numeric >::getCoords(), npstat::BoxNDScanner< Numeric >::getIndex(), and npstat::BoxNDScanner< Numeric >::initialize().
void npstat::BoxNDScanner< Numeric >::getCoords | ( | Numeric * | x, |
unsigned | nx | ||
) | const |
Retrieve current coordinates inside the box
Definition at line 130 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::box_, npstat::BoxNDScanner< Numeric >::bw_, npstat::BoxNDScanner< Numeric >::dim(), mps_fire::i, training_settings::idx, checklumidiff::l, npstat::BoxNDScanner< Numeric >::maxState_, npstat::BoxNDScanner< Numeric >::state_, and npstat::BoxNDScanner< Numeric >::strides_.
Referenced by npstat::BoxNDScanner< Numeric >::isValid().
void npstat::BoxNDScanner< Numeric >::getIndex | ( | unsigned * | index, |
unsigned | indexBufferLen | ||
) | const |
Retrieve current multidimensional index
Definition at line 150 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::dim(), mps_fire::i, training_settings::idx, checklumidiff::l, npstat::BoxNDScanner< Numeric >::maxState_, npstat::BoxNDScanner< Numeric >::state_, and npstat::BoxNDScanner< Numeric >::strides_.
Referenced by npstat::BoxNDScanner< Numeric >::isValid().
|
private |
Definition at line 107 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::box_, npstat::BoxNDScanner< Numeric >::bw_, npstat::BoxNDScanner< Numeric >::dim(), npstat::BoxNDScanner< Numeric >::maxState_, and npstat::BoxNDScanner< Numeric >::strides_.
Referenced by npstat::BoxNDScanner< Numeric >::BoxNDScanner(), and npstat::BoxNDScanner< Numeric >::setState().
|
inline |
Returns false when iteration is complete
Definition at line 67 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::getCoords(), npstat::BoxNDScanner< Numeric >::getIndex(), diffTreeTool::index, npstat::BoxNDScanner< Numeric >::maxState_, and npstat::BoxNDScanner< Numeric >::state_.
Referenced by ntupleDataFormat._Object::_checkIsValid(), and core.AutoHandle.AutoHandle::ReallyLoad().
|
inline |
Maximum possible state (i.e., linear index of the scan)
Definition at line 64 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::maxState_.
|
inline |
Prefix increment
Definition at line 79 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::maxState_, and npstat::BoxNDScanner< Numeric >::state_.
|
inline |
Postfix increment (distinguished by the dummy "int" parameter)
Definition at line 83 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::maxState_, and npstat::BoxNDScanner< Numeric >::state_.
|
inline |
Reset the state (as if the object has just been constructed)
Definition at line 76 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::state_.
|
inline |
Set the state directly
Definition at line 86 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::BoxNDScanner(), npstat::BoxNDScanner< Numeric >::initialize(), npstat::BoxNDScanner< Numeric >::maxState_, and npstat::BoxNDScanner< Numeric >::state_.
|
inline |
Retrieve current state (i.e., linear index of the scan)
Definition at line 61 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::state_.
|
private |
Definition at line 94 of file BoxNDScanner.h.
Referenced by npstat::BoxNDScanner< Numeric >::dim(), npstat::BoxNDScanner< Numeric >::getCoords(), and npstat::BoxNDScanner< Numeric >::initialize().
|
private |
Definition at line 96 of file BoxNDScanner.h.
Referenced by npstat::BoxNDScanner< Numeric >::getCoords(), and npstat::BoxNDScanner< Numeric >::initialize().
|
private |
Definition at line 98 of file BoxNDScanner.h.
Referenced by npstat::BoxNDScanner< Numeric >::getCoords(), npstat::BoxNDScanner< Numeric >::getIndex(), npstat::BoxNDScanner< Numeric >::initialize(), npstat::BoxNDScanner< Numeric >::isValid(), npstat::BoxNDScanner< Numeric >::maxState(), npstat::BoxNDScanner< Numeric >::operator++(), and npstat::BoxNDScanner< Numeric >::setState().
|
private |
Definition at line 97 of file BoxNDScanner.h.
Referenced by npstat::BoxNDScanner< Numeric >::getCoords(), npstat::BoxNDScanner< Numeric >::getIndex(), npstat::BoxNDScanner< Numeric >::isValid(), npstat::BoxNDScanner< Numeric >::operator++(), npstat::BoxNDScanner< Numeric >::reset(), npstat::BoxNDScanner< Numeric >::setState(), and npstat::BoxNDScanner< Numeric >::state().
|
private |
Definition at line 95 of file BoxNDScanner.h.
Referenced by npstat::BoxNDScanner< Numeric >::getCoords(), npstat::BoxNDScanner< Numeric >::getIndex(), and npstat::BoxNDScanner< Numeric >::initialize().