[Top][All Lists]

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

RE: Re[2]: [Help-glpk] [feature] defining sets of dynamic dimensi ons?

From: Sebastien . deMentendeHorne
Subject: RE: Re[2]: [Help-glpk] [feature] defining sets of dynamic dimensi ons?
Date: Thu, 22 Jul 2004 11:34:39 +0200

> >However, it may be very difficult to implement this as, 
> currently, no link
> >is kept between the model expressed in the language and the 
> underlying GLPK
> >C structure.
> In principle, it is not so difficult to carry out main objects used in
> the glpk mathprog translator to make them available as 
> C++-like classes.
> However, this would assume that the user describes his model entirely
> in C using no interface between C program and the translator 
> data base.


I have difficulties to understand this last statement. Do you mean that you
must do all your model declarations and manipulations exclusively in C ?
I was thinking to a scheme like (mpg_ is used as prefix for the mathprog
API) :

1) Initialise the mathprog translator/database with an initial Mathprog code
        e.g. mpg_read_code(mathprog_pointer, filename);

2) Add new set/equation/constraint/variable with Mathprog code like in 1)
but dynamically in the code
        e.g. mpg_append_code(mathprog_pointer, "set I;\nparam a{i in I};");
or via an API style
        e.g. mpg_add_set(mathprog_pointer, name_of_set)

3) Access the mathprog structures with the API and modify them:
        e.g. id = mpg_get_object_id(mathprog_pointer, name_of_set);
           mpg_get_set_size(mathprog_pointer, id);

4) Get the link between mathprog equations/variables and LP column/row

I fear this is not a minor piece of code to design ...
However, if you see an easier way to do it by restricting the creation and
edition of the model in C, it would be always quite useful (as FLOPC++ is).



reply via email to

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