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

Method fill

gecode/kernel/trace/filter.cpp:154–181  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152 forceinline
153 TraceFilter::TFO::StackFrame::StackFrame(void) {}
154 forceinline
155 TraceFilter::TFO::StackFrame::StackFrame(TFE::Node* n0, bool neg0)
156 : n(n0), neg(neg0) {}
157
158 void
159 TraceFilter::TFO::fill(TFE::Node* n) {
160 Region region;
161 Support::DynamicStack<StackFrame,Region> next(region);
162 int i=0;
163 next.push(StackFrame(n,false));
164 do {
165 StackFrame s = next.pop();
166 switch (s.n->t) {
167 case TFE::NT_GROUP:
168 f[i].g = s.n->g; f[i].neg = s.neg; f[i].what=s.n->w;
169 i++;
170 break;
171 case TFE::NT_NEGATE:
172 next.push(StackFrame(s.n->l,!s.neg));
173 break;
174 case TFE::NT_ADD:
175 next.push(StackFrame(s.n->l,s.neg));
176 next.push(StackFrame(s.n->r,s.neg));
177 break;
178 default: GECODE_NEVER;
179 }
180 } while (!next.empty());
181 }
182
183 TraceFilter::TFO::~TFO(void) {
184 heap.free<Filter>(f,n);

Callers

nothing calls this directly

Calls 4

StackFrameClass · 0.85
pushMethod · 0.45
popMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected