MCPcopy Create free account
hub / github.com/Gecode/gecode / ConstSetView

Method ConstSetView

gecode/set/view/const.hpp:83–99  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81 ConstSetView::ConstSetView(void) : ranges(nullptr), size(0), domSize(0) {}
82
83 forceinline
84 ConstSetView::ConstSetView(Space& home, const IntSet& dom) {
85 size = dom.ranges();
86 domSize = 0;
87 if (size > 0) {
88 ranges = home.alloc<int>(2*size);
89 IntSetRanges dr(dom);
90 for (int i=0; dr(); ++dr, i+=2) {
91 int min = dr.min(); int max = dr.max();
92 ranges[i] = min;
93 ranges[i+1] = max;
94 domSize += static_cast<unsigned int>(max-min+1);
95 }
96 } else {
97 ranges = nullptr;
98 }
99 }
100
101 forceinline unsigned int
102 ConstSetView::glbSize(void) const { return domSize; }

Callers

nothing calls this directly

Calls 3

rangesMethod · 0.45
minMethod · 0.45
maxMethod · 0.45

Tested by

no test coverage detected