hi!

Q1:

I have a problem for which I want to get all solutions. I have departed from 
one of the examples, but now I'm subclassing from the object Space directly. 
I have the feeling I'm not doing things right:

class MyProblem : public Space 
{ /* ... */}

int
main(int argc, char* argv[]) 
{
   MyProblem* t = new MyProblem(args);
   d = new DFS<MyProblem>(t);
   while (t != NULL)
   {
        //t = d->next();        // with only this, it does not seem to release 
memory
        TestLinear* n = d->next();
        delete t;       // hum....
        t = n;
   }
   return 0;
}

Q2:

I'm registering a signal before the 'new MyProblem' line, to make gecode quit 
when I press Ctrl+C and show me the search statistics:

signal(SIGINT, atExit);

In the function atExit I use the methods from t and d (which I make global 
variables) to get the statistics. The last line of this function is a system 
call to exit(0).

It seems to work sometimes, but other times it just crashes on the exit(0). 
Obviously I'm forgeting something, so I guess the solution to this is simple. 
Otherwise I can provide more details.


Thanks!
Marco

-- 
Marco Correia <[EMAIL PROTECTED]>

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

Reply via email to