CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ArrayRange.h
Go to the documentation of this file.
1 #ifndef NPSTAT_ARRAYRANGE_HH_
2 #define NPSTAT_ARRAYRANGE_HH_
3 
16 
17 namespace npstat {
21  struct ArrayRange : public BoxND<unsigned> {
22  inline ArrayRange() {}
23 
25  inline explicit ArrayRange(unsigned dim) : BoxND<unsigned>(dim) {}
26 
28  inline ArrayRange(unsigned dim, const Interval<unsigned>& r1) : BoxND<unsigned>(dim, r1) {}
29 
31 
36  inline explicit ArrayRange(const ArrayShape& shape) : BoxND<unsigned>(shape) {}
37  ArrayRange(const unsigned* shape, unsigned shapeLen);
39 
44  ArrayShape shape() const;
45 
47 
48  bool isCompatible(const ArrayShape& shape) const;
49  bool isCompatible(const unsigned* shape, unsigned shapeLen) const;
51 
53  unsigned long rangeSize() const;
54 
56  bool operator<(const ArrayRange&) const;
57 
64 
69  void lowerLimits(unsigned* limits, unsigned limitsLen) const;
70 
72  void upperLimits(unsigned* limits, unsigned limitsLen) const;
73 
75  void rangeLength(unsigned* range, unsigned rangeLen) const;
76  };
77 } // namespace npstat
78 
79 #endif // NPSTAT_ARRAYRANGE_HH_
ArrayRange(const ArrayShape &shape)
Definition: ArrayRange.h:36
void upperLimits(unsigned *limits, unsigned limitsLen) const
Definition: ArrayRange.cc:100
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
const uint16_t range(const Frame &aFrame)
unsigned long dim() const
Definition: BoxND.h:54
ArrayShape shape() const
Definition: ArrayRange.cc:78
unsigned long rangeSize() const
Definition: ArrayRange.cc:67
ArrayRange(unsigned dim, const Interval< unsigned > &r1)
Definition: ArrayRange.h:28
bool isCompatible(const ArrayShape &shape) const
Definition: ArrayRange.cc:14
void rangeLength(unsigned *range, unsigned rangeLen) const
Definition: ArrayRange.cc:114
void lowerLimits(unsigned *limits, unsigned limitsLen) const
Definition: ArrayRange.cc:86
ArrayRange & stripOuterLayer()
Definition: ArrayRange.cc:56
bool operator<(const ArrayRange &) const
Definition: ArrayRange.cc:34
Utilities for defining shapes of multidimensional arrays.
Template to represent rectangles, boxes, and hyperboxes.
ArrayRange(unsigned dim)
Definition: ArrayRange.h:25