[gecode-users] Bug when I sort variables

Guido Tack tack at gecode.org
Tue Mar 5 11:32:32 CET 2013


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/






More information about the users mailing list