[gecode-users] About posting Boolean expression
Christian Schulte
cschulte at kth.se
Mon Oct 19 15:41:58 CEST 2009
Write instead:
BoolVar tmp =post(*this, ~(a[j]==(i+1)),ICL_DEF);
What you did is posting the constraint that (a[j] == (i+1)) (and hence the
return type of post is void as the compiler tells you). What you apparently
wanted to do is to post a reified constraint which you get with ~ (and hence
the return type is BoolVar).
Cheers
Christian
--
Christian Schulte, www.ict.kth.se/~cschulte/
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Yong
Sent: Monday, October 19, 2009 3:26 PM
To: users at gecode.org
Subject: [gecode-users] About posting Boolean expression
Hi group,
A question about posting Boolean expression here. Any hint will be
appreciated!
My compiler will give "cannot convert from 'void' to 'Gecode::BoolVar'"
error on below code:
BoolVar tmp =post(*this,(a[j]==(i+1)),ICL_DEF);
Yong
ps: I'm using Gecode3.2.0 + VC++ 2008 Express Edition
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.ps.uni-sb.de/pipermail/users/attachments/20091019/813ce54a/attachment.htm>
More information about the gecode-users
mailing list