[gecode-users] External input and outputs in GECODE ....

Guido Tack tack at gecode.org
Thu Apr 22 11:37:04 CEST 2010


Claudio Cesar de Sá wrote:
> For the extensive tests in a Gecode program, two doubts:
> 
> 1. For data input I will be using an external file. Such the execution in Linux console works like:
>  
> claudio at goedel:~$ ./my-executable < input.txt
> 
> I have the idea how it works in C. Any modification in main( .... argc , argv ....) for Gecode to use it?

That's not really a Gecode question.  The main function doesn't work any differently from any other C or C++ program, so you can do the same things there.

> 2. In my program I need all the outputs.
>  opt.solutions(0); //  all solutions ===> OK  it's fine
> but I would like to collect them, one by one, and processing them.
> 
> I think to process them inside on  print(std::ostream& os) const  ... is it correct?
> 
> Should be best to write in a file and following by a pos processing or filtering, in another program ?
> 
> Surely someone already done it before.

You can either print all solutions and post process them, or use the search engines directly without the Driver infrastructure (see the tutorial documentation, Section 2.2 and 9.4).

Cheers,
	Guido

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




More information about the users mailing list