help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] Passing command line paramters to GLPK


From: xypron
Subject: Re: [Help-glpk] Passing command line paramters to GLPK
Date: Thu, 15 May 2008 11:43:43 -0700 (PDT)

Hello Andrew,

for using SQL queries the database password must be used in the GLPK model.
It is unwise to save passwords in unencrypted files. In business
environments regulation often explicitly forbids such behavior.

The solution you kindly suggested would leave the password on the harddisk.

Being able to use additional command line parameters would allow to
circumvent the problem.

Best regards

Xypron


Andrew Makhorin wrote:
> 
>> data bases will often contain multiple problem instances. Currently
>> to select a problem instance it is necessary to edit the model or the
>> data file passed to GLPSOL. It would be useful if the problem instance
>> could be passed on the command line.
> 
>> My implementation idea is to add an option -v to be used as follows:
> 
>> ./glpsol -m model.mod -v var1=val1 -v var2=val2 ...
> 
>> Internally this should create a set
>> set _ARGV := var1 var2;
>> and a parameter
>> param _ARGP := 
>>   [var1] val1
>>   [var2] val2;
> 
>> A usage example is:
> 
>> table ti IN
>>   'MySQL'
>>   'Database=glpk;UID=glpk;PWD=gnu'
>>   'SELECT COL, LIN, VAL FROM sudoku WHERE ID = ' & _ARGP['ID'] :
>>   FIELDS <- [COL, LIN], givens ~ VAL;
> 
> All necessary substitutions can be made with the C preprocessor.
> For example:
> 
>    gcc -E -Dfoo1=bar1 -Dfoo2=bar2 model.txt > model.mod
>    glpsol -m model.mod
> 
> Another way is to use, say, sed. One could even write a shell script
> to make that more convenient.
> 
> 
> 
> _______________________________________________
> Help-glpk mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/help-glpk
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Passing-command-line-paramters-to-GLPK-tp15780513p17259814.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]