CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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  {
23  inline ArrayRange() {}
24 
26  inline 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 ArrayRange(const ArrayShape& shape) : BoxND<unsigned>(shape) {}
39  ArrayRange(const unsigned* shape, unsigned shapeLen);
41 
46  ArrayShape shape() const;
47 
49 
50  bool isCompatible(const ArrayShape& shape) const;
51  bool isCompatible(const unsigned* shape, unsigned shapeLen) const;
53 
55  unsigned long rangeSize() const;
56 
58  bool operator<(const ArrayRange&) const;
59 
66 
71  void lowerLimits(unsigned* limits, unsigned limitsLen) const;
72 
74  void upperLimits(unsigned* limits, unsigned limitsLen) const;
75 
77  void rangeLength(unsigned* range, unsigned rangeLen) const;
78  };
79 }
80 
81 #endif // NPSTAT_ARRAYRANGE_HH_
82 
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