[Top][All Lists]

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

Re: [Help-glpk] Database connectivity in MathProg

From: Andrew Makhorin
Subject: Re: [Help-glpk] Database connectivity in MathProg
Date: Sun, 10 Feb 2008 01:43:52 +0300


Here is my proposals.

In general case the input table to be read from a database has the
following syntax (some elements may be omitted):

   table t IN "..." : [ i ~ I, j ~ J, ... ] s <- [k ~ K, ...],
      p[...] ~ P, q[...] ~ Q, ... ;

where t is a symbolic name of the data table; i, j, k, ... are dummy
indices; I, J, K, ... are column names for dummy indices; s is a set;
p, q, ... are symbolic names of parameters; P, Q, ... are column names
for parameters.

The statement 'read table' is equivalent to the following query:

   select I, J, K, ..., P, Q from ...

Once a next record has been read from the database, values of I, J, K,
... are assigned to the dummy indices i, j, k, ..., the corresponding
n-tuple is added to set s, indexing expressions are evaluated, and
values P, Q, ... are assigned to corresponding members of parameters
p, q, ... .

The output table to be written to a database has the following syntax:

   table t { ... } OUT "..." : expr ~ A, expr ~ B, ... ;

where { ... } is a domain, expr, ... are arbitrary expressions, and
A, B, ... are column names.

The statement 'write table' is equivalent to the following:

   drop ...
   create ...
   insert into ... (A, B, ...) values(...)
   insert into ... (A, B, ...) values(...)
   . . .

Expressions are evaluated over the specified domain and their values
are assigned to corresponding columns.

What do you think about that? It seems to me such subset is sufficient
in most cases.

Andrew Makhorin

reply via email to

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