#include <BoxNDScanner.h>
Public Member Functions | |
BoxNDScanner (const BoxND< Numeric > &box, const std::vector< unsigned > &shape) | |
BoxNDScanner (const BoxND< Numeric > &box, const unsigned *shape, const unsigned lenShape) | |
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 |
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 |
|
inline |
Dimensionality of the scan
Definition at line 58 of file BoxNDScanner.h.
References npstat::BoxNDScanner< Numeric >::box_.
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 cms::cuda::assert(), mps_fire::i, heavyIonCSV_trainingSettings::idx, and cmsLHEtoEOSManager::l.
void npstat::BoxNDScanner< Numeric >::getIndex | ( | unsigned * | index, |
unsigned | indexBufferLen | ||
) | const |
Retrieve current multidimensional index
Definition at line 150 of file BoxNDScanner.h.
References cms::cuda::assert(), mps_fire::i, heavyIonCSV_trainingSettings::idx, and cmsLHEtoEOSManager::l.
|
private |
Definition at line 107 of file BoxNDScanner.h.
References cms::cuda::assert(), and dqmiolumiharvest::j.
Referenced by npstat::BoxNDScanner< Numeric >::BoxNDScanner().
|
inline |
Returns false when iteration is complete
Definition at line 67 of file BoxNDScanner.h.
References 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 >::maxState_, npstat::BoxNDScanner< Numeric >::state(), 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_.
Referenced by npstat::BoxNDScanner< Numeric >::setState().
|
private |
Definition at line 94 of file BoxNDScanner.h.
Referenced by npstat::BoxNDScanner< Numeric >::dim().
|
private |
Definition at line 96 of file BoxNDScanner.h.
|
private |
Definition at line 98 of file BoxNDScanner.h.
Referenced by 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 >::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.