[gecode-users] domain constraint

Guido Tack tack at gecode.org
Thu Nov 11 18:36:29 CET 2010


frank lemoine wrote:

> i'm sorry Guido, i think you've not undrestand my problem. i want to reproduce this:
> 
>   ""  IntVarArray x(*this,200,0,199);
>     Support::RandomGenerator rnd;
>     IntArgs a;
>     for (int i=10; i--;)
>       a << rnd(200);
>     dom(*this, x, IntSet(a));
>     std::cout << "t = " << t << std::endl; ""
>  
> without using the the domain constraint dom because when i run this code in a big "for loop" peak memory reach 2 GO.

What kind of for loop?  I'm trying to reproduce the problem, but the above code works fine.  You have to be clearer about what exactly you are doing.  Please come up with a simple piece of code that exhibits the problem, not some pseudo code that leaves out the details.  Obviously, if you run the above 1000 times, you allocate 200000 variables and that takes a lot of memory, but that's not what you said in the original message.  
Calling dom (as opposed to constraining the domains directly) is definitely not the problem here, it does not allocate any memory except for the domain itself.

Cheers,
	Guido

-- 
Guido Tack, http://people.cs.kuleuven.be/~guido.tack/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20101111/0da9892c/attachment.htm>


More information about the users mailing list