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

Method prune

gecode/int/trace/int-trace-view.hpp:70–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68 }
69
70 forceinline void
71 IntTraceView::prune(Space& home, IntView y, const Delta& d) {
72 if (y.range() && (dom->next() == nullptr)) {
73 dom->min(y.min()); dom->max(y.max());
74 } else if (!y.any(d) && (y.max(d)+1 == y.min())) {
75 // The lower bound has been adjusted
76 if (y.min() > dom->max()) {
77 RangeList* p = dom;
78 RangeList* l = p->next();
79 while ((l != nullptr) && (l->max() < y.min())) {
80 p=l; l=l->next();
81 }
82 dom->dispose(home,p);
83 dom = l;
84 }
85 dom->min(y.min());
86 } else if (!y.any(d) && (y.max()+1 == y.min(d))) {
87 // upper bound has been adjusted
88 if ((y.max() <= dom->max()) && (dom->next() == nullptr)) {
89 dom->max(y.max());
90 } else {
91 RangeList* p = dom;
92 RangeList* l = p->next();
93 while ((l != nullptr) && (l->min() <= y.max())) {
94 p=l; l=l->next();
95 }
96 p->max(y.max());
97 if (p->next() != nullptr)
98 p->next()->dispose(home);
99 p->next(nullptr);
100 }
101 } else {
102 // Just copy the domain
103 ViewRanges<IntView> yr(y);
104 RangeList::overwrite(home,dom,yr);
105 }
106 }
107
108 forceinline void
109 IntTraceView::update(Space& home, IntTraceView y) {

Callers

nothing calls this directly

Calls 6

rangeMethod · 0.45
nextMethod · 0.45
minMethod · 0.45
maxMethod · 0.45
anyMethod · 0.45
disposeMethod · 0.45

Tested by

no test coverage detected