[gecode-users] Linear constraint on propagation level ILC_DOM infinite loop

David Rijsman davidrijsman at gmail.com
Mon Dec 10 17:14:54 CET 2007


In Gecode 2.0.0  the following code seems to get stuck in an infinite loop:

template <class Val, class View>  ExecStatus
DomEq<Val,View>::propagate(Space* home)

Am I missing something or doing something wrong, other propagation
levels seem to work correct.

---------------------------------------------------------

#include "gecode/minimodel.hh"

class TestCase : public Gecode::Space {
protected:
  const int n;
  Gecode::IntVarArray x;
public:

  /// Actual model
  TestCase()
    : n(3),
      x(this,n)
  {
    x[0].init( this, 0, 7*60*24 );
    x[1].init( this, 0, 7*60*24 );
    x[2].init( this, 0, 7*60*24 );

    Gecode::IntVarArgs variables( 3 );
    variables[0] = x[0];
    variables[1] = x[1];
    variables[2] = x[2];

    Gecode::IntArgs arguments( 3 );

    arguments[0] =  1;
    arguments[1] = -1;
    arguments[2] = -1;

    Gecode::linear( this, arguments, x, Gecode::IntRelType::IRT_EQ, 0,
Gecode::ICL_DOM);


    this->status();
  }

  TestCase(bool share, TestCase& s):
    Space(share,s), n(s.n)
  {
    x.update(this, share, s.x);
  }

  /// Perform copying during cloning
  virtual Space* copy(bool share)
  {
    return new TestCase(share,*this);
  }

};

int main(int argc, char** argv)
{
  TestCase();
  return 0;
}




More information about the gecode-users mailing list