[Cbc] Pass model and/or data to the executable via standard input

Pietro Scionti pietro.scionti at archinet.it
Tue Apr 16 09:22:23 EDT 2013


Hi,
i am learning CBC in order to transition to it from GLPK.
Since I cannot lose GMPL's capabilities but for various reasons I am constrained to use the unmodified executable, my modus operandi is
1) run GLPK with the "--wlp model.lp --check" option to make the mod-> lp transition
2) run cbc solving the .lp model
I would like to know, is there a way to pass the model to be solved via the console standard input? My models (all integer) get pretty big pretty fast, and I am concerned I might use a huge amount of disk space that I then need to clean up, while this could all be avoided if I could feed the model to cbc in memory.

If i was not clear, what I want to accomplish in GLPK can be done like this (language is C#, i am on Windows 7):

            System.Diagnostics.Process process = new System.Diagnostics.Process();
            process.StartInfo.UseShellExecute = false;
            process.StartInfo.FileName = glpsolPath;
            process.StartInfo.Arguments = String.Format("--math /dev/stdin --output {0} --log {1}", outputStreamPath, logPath);
            process.StartInfo.RedirectStandardInput = true;
            process.Start();
            StreamReader tr = new StreamReader(modelPath);
            process.StandardInput.Write(tr.ReadToEnd());


Thanks everyone,
Pietro Scionti

________________________________

Archimede S.r.l.
Sede Legale:
Via Manzoni, 82
Ponte S. Giovanni

P.IVA: 01992020543

Tel. 075 515 22 11
Fax. 075 515 22 99
www.archinet.it

**********************************************************************************************************************************************************************************************************************
La presente comunicazione, con le informazioni in essa contenute e ogni documento o file allegato, e' rivolta unicamente alla/e persona/e cui e' indirizzata ed alle altre da questa autorizzata/e a riceverla. Se non siete i destinatari/autorizzati siete avvisati che qualsiasi azione, copia, comunicazione, divulgazione o simili basate sul contenuto di tali informazioni e' vietata e potrebbe essere contro la legge (art. 616 C.P., D.Lgs n. 196/2003 Codice in materia di protezione dei dati personali). Se avete ricevuto questa comunicazione per errore, vi preghiamo di darne immediata notizia al mittente e di distruggere il messaggio originale e ogni file allegato senza farne copia alcuna o riprodurne in alcun modo il contenuto.

This e-mail and its attachments are intended for the addressee(s) only and are confidential and/or may contain legally privileged information. If you have received this message by mistake or are not one of the addressees above, you may take no action based on it, and you may not copy or show it to anyone; please reply to this e-mail and point out the error which has occurred.
**********************************************************************************************************************************************************************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20130416/276737b9/attachment.html>


More information about the Cbc mailing list