help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Problems with Connecting GLPK to Excel


From: glpk xypron
Subject: Re: [Help-glpk] Problems with Connecting GLPK to Excel
Date: Wed, 04 Aug 2010 07:50:44 +0200

Hello Aly

> 1. I was not able to do the update part in your example. What's that "diff 
> X[p]"?? As it gives me a syntax error??

diff is an operator for sets.

(A diff B) returns a set containing those elements of A that are not
elements of B.

See glpk-4.44/doc/gmpl.pdf

> 2. Is there a way not ti write back zero valued variables?? I tried to
> insert an "if" condition in the SQL statement of writing values back to
> Access, but with no luck.

Please, add the condition in the domain definition of the
table statement. 
": d > 0" in the example below:

table ti {(p,t,d) in D : d > 0} OUT
  'ODBC' 'DSN=glpk;UID=glpk;PWD=gnu'
  'INSERT INTO tbl (p, t, d, s)'
  '  VALUES (?, ?, ?, 0);' :
  p, t, d;

> 3. Would the GLPK syntax (including the model, reading and writing to
> Access) work directly on AMPL (as I read that GLPK is part of AMPL) or
> I do have to do many modifications?

GLPK has a syntax close to that of AMPL.

The AMPL table statement is only a definition. A separate "read table"
or "write table" statement is needed. The AMPL table statement can
combine IN and OUT definitions.

See the examples in 
http://www.ampl.com/NEW/tables.html
e.g.
http://www.ampl.com/NEW/TABLES/diet.mdb.run

> 4. Is there a way to connect GLPK to MS SQL 64 bit?

Yes, using ODBC.

If using 64-bit Windows, both 32-bit and 64-bit data sources can exist.
For editing 64-bit data sources, call
c:\WINDOWS\system32\odbcad32.exe.
And for editing 32-bit data sources, call
c:\WINDOWS\syswow64\odbcad32.exe.

It depends on your GLPK executable if you need a 32 bit or 64 bit data
source. WinGLPK contains both 32bit and 64bit executables.
see
http://winglpk.sourceforge.net.

> 5. Is there a way to connect to MySQL under Unix?
You can use ODBC using either the iODBC or the unixODBC
library, or you can use the native MySQL driver.

See examples in glpk-4.44/examples/sql.

For compiling with both iODBC and MySQL support
./configure --enable-dl --enable-odbc --enable-mysql

You will need the respective development packages installed,
see glpk-4.44/doc/tables.pdf

Best regards

Xypron
-- 
GMX DSL: Internet-, Telefon- und Handy-Flat ab 19,99 EUR/mtl.  
Bis zu 150 EUR Startguthaben inklusive! http://portal.gmx.net/de/go/dsl



reply via email to

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