[gecode-users] Bug when I sort variables
Christian Schulte
cschulte at kth.se
Tue Mar 5 13:31:10 CET 2013
Gecode 4 will allow to disable branchers. The release should be out in a
week or so.
Christian
--
Christian Schulte, Professor of Computer Science, KTH,
www.ict.kth.se/~cschulte/
From: users-bounces at gecode.org [mailto:users-bounces at gecode.org] On Behalf
Of Mohamed Rezgui
Sent: Tuesday, March 05, 2013 11:58 AM
To: Guido Tack
Cc: users at gecode.org
Subject: Re: [gecode-users] Bug when I sort variables
Hi Guido,
It is fine I found my bug, it is about the sharing of data between 2 spaces
: one with branchers and the other without.
I must do not share the structures because in the space without branchers I
put other branchers and constraints.
Have you an interface to handle branchers and disable them when needed ? I
know I can use filterbranch but I would like having a dynamic filter
(because the branch filter is copied in branch method)
I am on the latest revision 13433
Best Regards,
Mohamed REZGUI
2013/3/5 Guido Tack <tack at gecode.org>
>From the code you sent it's impossible to tell anything. If you want us to
help you, you have to first make sure the bug's not in your own code (use a
debugger!) and then send us something we can actually reproduce (including
which version of gecode etc).
Guido
On 05/03/2013, at 19:13 , Mohamed Rezgui <kyo.alone at gmail.com> wrote:
> Hi,
>
> I found a bug when I sort variables iv of FlatZincSpace.
>
> <code>
> template<class Var, bool Less=true>
> class VarCompare {
> public:
> bool operator ()(const Var& lhs, const Var& rhs) {
> return Less ? lhs.size() < rhs.size() : lhs.size() > rhs.size();
> }
> };
>
>
> IntVarArgs iva(iv.size());
> for(int i = 0; i < iv.size(); i++) {
> iva[i] = iv[i];
> }
>
> std::stable_sort(iva.begin(), iva.end(), VarCompare<Gecode::IntVar>());
>
> //Update index optVar
> ....
>
> iv = IntVarArray(*this, iva);
>
> </code>
>
> I get this assertion when I resolve the problem in parallel :
> Assertion failed: (i>=0) && (i<n), file
C:\Users\REZGUI\gecode\gecode/kernel/shared-array.hpp, line 202
>
> --
> Best Regards,
> Mohamed REZGUI
> _______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users
--
Guido Tack,
http://www.csse.monash.edu/~guidot/
--
Cordialement,
Mohamed REZGUI
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20130305/744d3bc4/attachment.html>
More information about the users
mailing list