File indexing completed on 2024-04-06 12:19:19
0001 #ifndef NPSTAT_ARRAYRANGE_HH_
0002 #define NPSTAT_ARRAYRANGE_HH_
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "JetMETCorrections/InterpolationTables/interface/ArrayShape.h"
0015 #include "JetMETCorrections/InterpolationTables/interface/BoxND.h"
0016
0017 namespace npstat {
0018
0019
0020
0021 struct ArrayRange : public BoxND<unsigned> {
0022 inline ArrayRange() {}
0023
0024
0025 inline explicit ArrayRange(unsigned dim) : BoxND<unsigned>(dim) {}
0026
0027
0028 inline ArrayRange(unsigned dim, const Interval<unsigned>& r1) : BoxND<unsigned>(dim, r1) {}
0029
0030
0031
0032
0033
0034
0035
0036 inline explicit ArrayRange(const ArrayShape& shape) : BoxND<unsigned>(shape) {}
0037 ArrayRange(const unsigned* shape, unsigned shapeLen);
0038
0039
0040
0041
0042
0043
0044 ArrayShape shape() const;
0045
0046
0047
0048 bool isCompatible(const ArrayShape& shape) const;
0049 bool isCompatible(const unsigned* shape, unsigned shapeLen) const;
0050
0051
0052
0053 unsigned long rangeSize() const;
0054
0055
0056 bool operator<(const ArrayRange&) const;
0057
0058
0059
0060
0061
0062
0063 ArrayRange& stripOuterLayer();
0064
0065
0066
0067
0068
0069 void lowerLimits(unsigned* limits, unsigned limitsLen) const;
0070
0071
0072 void upperLimits(unsigned* limits, unsigned limitsLen) const;
0073
0074
0075 void rangeLength(unsigned* range, unsigned rangeLen) const;
0076 };
0077 }
0078
0079 #endif