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

Method propagate

gecode/int/sequence/view.hpp:385–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383
384 template<class View,class Val,bool iss>
385 forceinline ExecStatus
386 ViewValSupport<View,Val,iss>::propagate(Space& home,ViewArray<View>& a,Val s,int i,int q,int l,int u) {
387 if ( !retired() ) {
388 if ( conlusion_scheduled() ) {
389 return conclude(home,a,s,i);
390 }
391
392 while (has_potential_violation()) {
393 int j = next_potential_violation();
394 if (violated(j,q,l,u)) {
395 int forced_to_s = values(j,q);
396 if (forced_to_s < l) {
397 if (!pushup(a,s,i,q,j+q,l-forced_to_s))
398 return conclude(home,a,s,i);
399 } else {
400 if (!pushup(a,s,i,q,j,forced_to_s-u))
401 return conclude(home,a,s,i);
402 }
403 if (violated(j,q,l,u))
404 return conclude(home,a,s,i);
405 }
406 }
407 }
408 return ES_OK;
409 }
410
411 template<class View,class Val,bool iss>
412 ViewValSupportArray<View,Val,iss>::ViewValSupportArray(void) : xs(nullptr), n(0) {

Callers

nothing calls this directly

Calls 1

valuesFunction · 0.85

Tested by

no test coverage detected