[gecode-users] Heap memory exhausted when copying a model

Guido Tack tack at gecode.org
Sun Sep 29 19:01:18 CEST 2013


Hi,

you cannot call the copy constructor directly.  Just change the line where you're trying to make the copy into

  SendMoreMoney* m2 = static_cast<SendMoreMoney*>(m->clone(true));

and it will work.  (It's a little unfortunate that there is no better error message, but if you call "internal" functionality in Gecode things like this can happen.)

Cheers,
Guido

-- 
Guido Tack
http://www.csse.monash.edu/~guidot/



On 29/09/2013, at 5:37 PM, kTorpi <ktorpi at gmail.com> wrote:

> Hello,
> 
> In my application i'm building a model through a long process, and in the middle of the process I'd like to make a copy of the actual model, post some constraints to the copied and get the solution.
> But when I make a copy of the model with is copy constructor and than I create the DFS object I get a Gecode::MemoryExhausted exception.
> Please, help me. I attached a small example that reproduces the error.
> 
> Thanks you,
> Steve
> <send-more-money-de-mystified.cpp>_______________________________________________
> Gecode users mailing list
> users at gecode.org
> https://www.gecode.org/mailman/listinfo/gecode-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.gecode.org/pipermail/users/attachments/20130929/009f6bbc/attachment.html>


More information about the users mailing list