[Top][All Lists]

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

[Help-glpk] xBASE table support added to MathProg

From: Andrew Makhorin
Subject: [Help-glpk] xBASE table support added to MathProg
Date: Tue, 19 Feb 2008 17:51:58 +0300

I have added xBASE table support to the GNU MathProg language.
To make it working please replace file src/glpmpl05.c in glpk 4.26
by a new version (see the attachment) and then rebuild the package as

To read/write .dbf files in MathProg models the first argument passed
to the table driver should be specified as "xBASE" and the second
argument should contain corresponding file name. For the output table
there should be the third argument specifying the table format in the
form "FF...F", where F is either C(n), which specifies a character
field of length n, or N(n[,p]), which specifies a numeric field of
length n and precision p (by default p is 0). Below here is a simple
example which illustrates creating and reading a .dbf file.

table tab1{i in 1..10} OUT "xBASE" "foo.dbf" "N(5)N(10,4)C(1)C(10)":
      2*i+1 ~ B, Uniform(-20,+20) ~ A, "?" ~ FOO, "[ " & i & " ]" ~ C;

set S, dimen 4;

table tab2 IN "xBASE" "foo.dbf" : S <- [ B, C, RECNO, A ];

display S;


Andrew Makhorin

Attachment: glpmpl05.c.gz
Description: GNU Zip compressed data

reply via email to

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