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  {
23  inline ArrayRange() {}
24 
26  inline explicit ArrayRange(unsigned dim) : BoxND<unsigned>(dim) {}
27 
29  inline ArrayRange(unsigned dim, const Interval<unsigned>& r1)
30  : BoxND<unsigned>(dim, r1) {}
31 
33 
38  inline explicit ArrayRange(const ArrayShape& shape)
39  : BoxND<unsigned>(shape) {}
40  ArrayRange(const unsigned* shape, unsigned shapeLen);
42 
47  ArrayShape shape() const;
48 
50 
51  bool isCompatible(const ArrayShape& shape) const;
52  bool isCompatible(const unsigned* shape, unsigned shapeLen) const;
54 
56  unsigned long rangeSize() const;
57 
59  bool operator<(const ArrayRange&) const;
60 
67 
72  void lowerLimits(unsigned* limits, unsigned limitsLen) const;
73 
75  void upperLimits(unsigned* limits, unsigned limitsLen) const;
76 
78  void rangeLength(unsigned* range, unsigned rangeLen) const;
79  };
80 }
81 
82 #endif // NPSTAT_ARRAYRANGE_HH_
83 
ArrayRange(const ArrayShape &shape)
Definition: ArrayRange.h:38
void upperLimits(unsigned *limits, unsigned limitsLen) const
Definition: ArrayRange.cc:115
std::vector< unsigned > ArrayShape
Definition: ArrayShape.h:21
unsigned long dim() const
Definition: BoxND.h:57
ArrayShape shape() const
Definition: ArrayRange.cc:90
unsigned long rangeSize() const
Definition: ArrayRange.cc:77
ArrayRange(unsigned dim, const Interval< unsigned > &r1)
Definition: ArrayRange.h:29
bool isCompatible(const ArrayShape &shape) const
Definition: ArrayRange.cc:16
void rangeLength(unsigned *range, unsigned rangeLen) const
Definition: ArrayRange.cc:131
void lowerLimits(unsigned *limits, unsigned limitsLen) const
Definition: ArrayRange.cc:99
ArrayRange & stripOuterLayer()
Definition: ArrayRange.cc:64
bool operator<(const ArrayRange &) const
Definition: ArrayRange.cc:40
Utilities for defining shapes of multidimensional arrays.
Template to represent rectangles, boxes, and hyperboxes.
ArrayRange(unsigned dim)
Definition: ArrayRange.h:26