[Top][All Lists]

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

Re: [Help-glpk] mathprog component information

From: Andrew Makhorin
Subject: Re: [Help-glpk] mathprog component information
Date: Sun, 23 Apr 2006 12:39:35 +0400

> Thanks for the quick reply. From glpmpl.h, while I can get some hints,
> i can't really find exactly what I need.

The translator database is, generally speaking, a tree, which
completely inherits the syntactic structure of the model.

To translate the model and evaluate all model objects you need to
call the following routines:

mpl_read_data (if the data section is contained in a separate file);

A pointer returned by mpl_initialize() can be used to access the
translator database.

>  The essential information for
> this particular feature is:
> Which sets have been defined?

mpl->stmt points to a list of statements in the order in which they
appear in the model section. Walking through this list you find
a STATEMENT instance whose type is A_SET (set statement) and using
the member u.set you get access to the SET structure which describes
corresponding set.

The SET structure contains complete information about corresponding
set, e.g. the member 'name' contains its symbolic name, etc.

> What is their arity?

It is the member 'dim' in the SET structure.

> Once populated, what is their cardinality?

The member 'array' in the SET structure points to the ARRAY structure
which contains all members of corresponding set. The member 'size' of
the ARRAY structure contains the number of array elements, which is
the set cardinality.

> What params/vars/constraints/objs/ are indexed over which sets?

Using pointers grouped in the union 'u' in the STATEMENT structure
you get access to a structure describing corresponding model object.
For example, the PARAMETER structure describes a model parameter and
has the member 'domain' which points to the DOMAIN structure; the
latter describes indexing expressions used for the corresponding

> If that is available through the routines in glpmpl.h, could someone
> please point them out to me?

If you do not intend to modify the database, you do not need to call
any model translator routines. All information can be obtained via
direct access to the database structures through pointers.

Andrew Makhorin

reply via email to

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