help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Loading model files


From: Andrew Makhorin
Subject: Re: [Help-glpk] Loading model files
Date: Wed, 17 Feb 2010 20:04:39 +0300

> I have my source code written in AMPL for Cplex, and I am currently
> porting it GLPK.

> The models don #39;t work as is, since the original source code has
> some AMPL/CPlex specific commands.

> Besides, I am more comfortable writing scripts in C++ than with
> scripting in AMPL; however, I find that writing models in AMPL is
> easier.

> I have been able to convert most of my models to GLPK my adding
> rows, columns and generating the model row by row, column by column.

> I also saw in the manual that there is a function to load models and
> data files, however, I want to generate data on the fly i.e. I just
> want to load a model, and then generate data segments in the code. The
> requirement is such because I have a custom Branch and Price routine,
> and have two independent models for the #39;master #39; and the
> #39;slave #39;. 

> What is the preferred way to do this, since I wasn #39;t able to
> set the values of the parameters from the C++ code :

You could write the data section generated in a file and then call
the mathprog translator api routines. Note, however, that once the
model has been generated, it is impossible to change the data section,
i.e. you need to call the translator every time you provide new data.
Another way is to generate the model using some basic data section
and then change model components (e.g. objective coefficients and/or
right-hand sides) directly with glpk api using row/column names.





reply via email to

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