CMS 3D CMS Logo

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
ArrayShape shape() const
Definition: ArrayRange.cc:78
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
void upperLimits(unsigned *limits, unsigned limitsLen) const
Definition: ArrayRange.cc:100
bool operator<(const ArrayRange &) const
Definition: ArrayRange.cc:34
void rangeLength(unsigned *range, unsigned rangeLen) const
Definition: ArrayRange.cc:114
bool isCompatible(const ArrayShape &shape) const
Definition: ArrayRange.cc:14
ArrayRange(unsigned dim, const Interval< unsigned > &r1)
Definition: ArrayRange.h:28
unsigned long rangeSize() const
Definition: ArrayRange.cc:67
ArrayRange & stripOuterLayer()
Definition: ArrayRange.cc:56
unsigned long dim() const
Definition: BoxND.h:54
void lowerLimits(unsigned *limits, unsigned limitsLen) const
Definition: ArrayRange.cc:86
Utilities for defining shapes of multidimensional arrays.
Template to represent rectangles, boxes, and hyperboxes.
ArrayRange(unsigned dim)
Definition: ArrayRange.h:25