On Wed, Apr 9, 2008 at 2:17 AM, Malcolm Ryan <[EMAIL PROTECTED]> wrote:
>  On 09/04/2008, at 2:04 AM, Christian Schulte wrote:
>  > I know that C++ sounds less appealing but Gecode is first and foremost
>  > geared to be good as a C++ library.
>
>  Yes. I guess I have to bite the bullet and move to C++.

One very good thing about using Gecode instead of Gecode/J is that
there is operator overloading in C++, leading to much more readable
models. For example, a quite common expression like (s1+d1>=s2 or
s2+d2>=s1) is hard to read and cumbersome in Java
    post(this, new BExpr(new Expr(s1).plus(d1), IRT_GQ, s2).or(new
Expr(s2).plus(d2), IRT_GQ, s1);
while it is quite straightforward in C++
    post(this, tt(~(s1+d1>=s2) || ~(s2+d2>=s1)));
where ~ is used as a reification operator, and tt indicates that the
expression should hold.

Cheers,
Mikael


-- 
Mikael Zayenz Lagerkvist, http://www.ict.kth.se/~zayenz/

_______________________________________________
Gecode users mailing list
[EMAIL PROTECTED]
https://www.gecode.org/mailman/listinfo/gecode-users

Reply via email to