[Coin-discuss] Question about the bcp_main() function

Laszlo Ladanyi ladanyi at us.ibm.com
Thu Aug 2 08:53:31 EDT 2007


It's a "feature"... BCP was originally written as the main function, and the
user only provided functions (classes) to compile the whole thing together.  
Later, for compilation convenience, bcp_main was created, so that BCP can be
compiled as a library, but still, BCP acts as if it were the main function and
exits upon finishing the work. This could be changed; the user would have to
create a BCP_tm_prob object, populate it properly, then invoke bcp_main. Not
too difficult, but does require some thought on what to expose. 
For now the easiest solution is to write your code to solve the problem only
once, then invoke your code from a shell script several times with different
parameters.

--Laci

On Thu, 2 Aug 2007 diarrass at isima.fr wrote:

> Hi.
> I am a new user of Coin-Or Bcp module. I send this e-mail because I found
> a problem when developping a program using BCP. In fact, in this program I
> have to solve a series of integer programs using the
> branch-and-cut method and each integer program depends on an integer
> parameter v going from 0 to N (The main() function of this program is
> given below).
> I tried to call several times the bcp_main() function in a loop from 0 to
> N but this loop only executes the first iteration (giving the correct
> result) and exits. It appears that the program exits just after the first
> call of the bcp_main() function.
> Is this a bug in BCP or is their a way or a new version of BCP to correct it?
> 
> int main(int argc, char* argv[])
> {
>         int v;
> 
>         //Lancement de la boucle sur v
>         for(v=0;v<10;v++)
>         {
>                 cout << "BB_TM V == " << v << endl;
> 
>                 BB_init bb_init(&v);
>                 int res = bcp_main(argc, argv, &bb_init);
> 
>                 cout << "APRES BCP_MAIN RES = " << res << endl;
>         }
> 
>         cout << "FIN DE L'OPTIMISATION" << endl;
> 
>         return(0);
> }
> 
> 
> 
> 
> 
> _______________________________________________
> Coin-discuss mailing list
> Coin-discuss at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/coin-discuss
> 




More information about the Coin-discuss mailing list