help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] adding --csv output


From: Xypron
Subject: Re: [Help-glpk] adding --csv output
Date: Thu, 13 Jan 2011 21:25:25 +0100
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20101123 SeaMonkey/2.0.11

Hello Kevin,

thank you for the submitted enhancement of GLPK.

I compiled the patched version of GLPK-4.45 without problems. Running the following command
./glpsol -m tsp.mod --csv test.csv -o test.txt
resulted in the appended files.

The csv file contains just about the same information that is the txt file. I observed two differences:

test.csv:
Status:,UNDEFINED
test.txt:
Status:     INTEGER OPTIMAL

test.csv:
Columns:,480
test.txt:
Columns:    480 (240 integer, 240 binary)

>> I had need of an unambiguous version
A parser may be easier to write for CSV then for a fixed field length file. The text file is unambiguous too.

I would like to better understand the user benefit of the patch:

   * Why do you prefer to write a file and do not use the library, to
     avoid unnecessary file handling altogether? This might have
     required less code than your patch.
   * Is there information you are missing in the API but see in the file?
   * Is a GLPK binding missing for the language of the target application?

>> I would much appreciate a code review.
glp_csv_mip seems to be short of a copy of glp_print_mip. Enabling xfprintf to write in CSV format depending on flag type in structure XFILE could be a viable alternative to replicating a lot of code. Gzipped files are already handled using this flag.

Best regards

Xypron


Kevin Hunter wrote:
Hullo Andrew, List,

I had need of an unambiguous version (for machine parsing) of the output provided by the glp_print_* functions. Consequently, I've created an equivalent set of glp_csv_* functions. With this patch, one can use a --csv <file> flag:

$ glpsol --lp test.lp --csv solution.csv

This patch adds three glp_csv_{sol,ipt,mip} functions and a couple of miscellaneous helper functions to the glpk-4.45 tarball.

I'm rather new to GLPK's code base, but I think I've my ducks in a row. Specifically, Xypron, if you have some time, I would much appreciate a code review.

Thanks, and I hope this proves useful to others.

Cheers,

Kevin


_______________________________________________
Help-glpk mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/help-glpk

Attachment: test.tar.gz
Description: GNU Zip compressed data


reply via email to

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