void CtcQInter::contract(IntervalVector& box) { Array<IntervalVector> refs(list.size()); for (int i=0; i<list.size(); i++) { boxes[i]=box; list[i].contract(boxes[i]); refs.set_ref(i,boxes[i]); } box = qinter(refs,q); }
void CtcQInter::contract(IntervalVector& box) { Array<IntervalVector> refs(list.size()); for (int i=0; i<list.size(); i++) { try { boxes[i]=box; list[i].contract(boxes[i]); } catch(EmptyBoxException&) { assert(boxes[i].is_empty()); } refs.set_ref(i,boxes[i]); } box = qinter(refs,q); if (box.is_empty()) throw EmptyBoxException(); }
void CtcQInter::contract(IntervalVector& box, ContractContext& context) { Array<IntervalVector> refs(list.size()); for (int i=0; i<list.size(); i++) { boxes[i]=box; ContractContext c_context(boxes[i], context); list[i].contract(boxes[i], c_context); refs.set_ref(i,boxes[i]); } box = qinter(refs,q); context.prop.update(BoxEvent(box,BoxEvent::CONTRACT)); }