[gecode-users] A constrain with 3 IntVar
Christian Schulte
cschulte at kth.se
Sat Aug 29 12:54:58 CEST 2009
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-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of amina kemmar
Sent: Saturday, August 29, 2009 12:23 PM
To: users at 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>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20090829/a18f3129/attachment.htm>
More information about the gecode-users
mailing list