Sorry, you are totally on the wrong track here, please consult an example
(just search the mailing list for a discussion of this).

 

Constraints are implemented as propagators, and propagators use views not
variables.

 

Christian

 

 

From: users-boun...@gecode.org [mailto:users-boun...@gecode.org] On Behalf
Of amina kemmar
Sent: Saturday, August 29, 2009 12:23 PM
To: us...@gecode.org
Subject: [gecode-users] A constrain with 3 IntVar

 

Hi,

I am writing a new constraint "NewConstraint", which takes 3 IntVar as
arguments :

#include <algorithm>
#include <gecode/int.hh>

namespace Gecode {

  using namespace Int;

  void NewConstraint(Space& home, IntVar x0, IntVar x1, IntVar x3) {
    
    if (home.failed()) return;

    //  Creation of an array x, which contains the 3 variables x0,x1,x2;
    //  .....

    // ViewArray<IntView> xv(home,x); 
    // GECODE_ES_FAIL(home, NewConstraint::Diff<IntView>::post(home,xv)); 
  }
}

To post the constraint  i need to create a ViewArray, but i don't understand
how to create an IntVarArg  containing these variables ?

Thank you.

Amina

  _____  

Avec Windows Live, vous organisez, retouchez et partagez vos photos.
<http://www.microsoft.com/northafrica/windows/windowslive/products/photo-gal
lery-edit.aspx> 

_______________________________________________
Gecode users mailing list
us...@gecode.org
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to