[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Re: Hello,Nigel, I have some questions about GLPK
From: |
Nigel Galloway |
Subject: |
[Help-glpk] Re: Hello,Nigel, I have some questions about GLPK |
Date: |
Fri, 28 Nov 2008 13:47:23 +0100 |
I would of course reccomend users to be able to compile glpk themselves exactly
as required, but to get started a binary version is a good introduction. Visual
Basic 2008 is a .NET language and so works just like C# with a slightly
different syntax. VB6 and other earlier versions of Visual Basic are dead
languages.
To use glpk with C#, you probably want to build it with database support so
using the Build_GLPK_with_VC9 with Makefile_VC6_MT_DLL is probably best:
rem Build GLPK with Microsoft Visual Studio Express 2008
rem NOTE: Make sure that HOME variable specifies correct path.
set HOME="C:\Program Files\Microsoft Visual Studio 9.0\VC"
call %HOME%\bin\vcvars32.bat
copy config_VC9 config.h
%HOME%\bin\nmake.exe /f Makefile_VC6_MT_DLL
%HOME%\bin\nmake.exe /f Makefile_VC6_MT_DLL check
Produces the following two files which are useful:
27/11/2008 20:23 913,408 glpk_4_33.dll
27/11/2008 20:23 36,864 glpsol.exe
C:\Users\Nigel\glpk-4.33>glpsol.exe --math huge.mod
Reading model section from huge.mod...
25 lines were read
Generating zumVariance...
Generating variances...
Model has been successfully generated
glp_simplex: original LP has 1048576 rows, 1048576 columns, 3145725 non-zeros
glp_simplex: presolved LP has 1048576 rows, 1048576 columns, 3145725 non-zeros
Scaling...
A: min|aij| = 1.000e+000 max|aij| = 1.000e+000 ratio = 1.000e+000
Problem data seem to be well scaled
Crashing...
Size of triangular part = 1048575
0: obj = 0.000000000e+000 infeas = 5.498e+011 (1)
* 1: obj = 0.000000000e+000 infeas = 0.000e+000 (0)
OPTIMAL SOLUTION FOUND
Time used: 64.6 secs
Memory used: 1694.9 Mb (1777205948 bytes)
The arithmetic mean of the integers from 1 to 1048575 is 524288.000000
Model has been successfully processed
Whilst the output has changed from previous versions it seems to work, and use
less memory. I guess 'Crashing...' has a special glpk meaning and isn't as
worrying as it is.
The real test is can we now compile examples\t1.cs
C:\Users\Nigel\glpk-4.33>csc /unsafe t1.cs
Microsoft (R) Visual C# 2008 Compiler version 3.5.21022.8
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.
We can. What follows is probably not the Makefiles fault.
C:\Users\Nigel\glpk-4.33>t1 2424 772
a = 2424, b = 772
Hello Nigel
Trying 772
0: obj = 0.000000000e+000 infeas = 1.000e+000 (0)
* 1: obj = 0.000000000e+000 infeas = 0.000e+000 (0)
OPTIMAL SOLUTION FOUND
Integer optimization begins...
+ 1: mip = not found yet >= -inf (1; 0)
Assertion failed: type != type
Error detected in file ..\src\glpios03.c at line 758
Assertion failed: lp->tree == NULL
Error detected in file ..\src\glpapi01.c at line 1365
The offending code is:
/* determine new bounds of x[j] for down- and up-branches */
new_ub = floor(beta);
new_lb = ceil(beta);
switch (type)
{ case GLP_LO:
xassert(lb <= new_ub);
dn_type = (lb == new_ub ? GLP_FX : GLP_DB);
xassert(lb + 1.0 <= new_lb);
up_type = GLP_LO;
break;
case GLP_DB:
xassert(lb <= new_ub && new_ub <= ub - 1.0);
dn_type = (lb == new_ub ? GLP_FX : GLP_DB);
xassert(lb + 1.0 <= new_lb && new_lb <= ub);
up_type = (new_lb == ub ? GLP_FX : GLP_DB);
break;
default:
/* other cases are not tested yet */
xassert(type != type);
}
This code was not exercised in 4.32 (compiled without db support).
> ----- Original Message -----
> From: "glpk xypron" <address@hidden>
> To: "Nigel Galloway" <address@hidden>, address@hidden
> Cc: address@hidden
> Subject: Re: Hello,Nigel, I have some questions about GLPK
> Date: Thu, 27 Nov 2008 14:19:16 +0100
>
>
> Hello Nigel,
>
> I can add those files to http://winglpk.sourceforge.net
>
> how should the dll be compiled?
>
> Does the Build_GLPK_with_VC6_MT_DLL.bat produce a usable dll for
> your purposes?
> Which calling convention should be used (standard call?)? At least
> for Excel VBA standard call is needed. I do not know what .NET
> needs.
>
> Do you have any experience compiling the dll with Visual Studio Express 2008?
> Maybe a adapted makefile should be added to the distribution.
>
> How about a 64bit dll? Currently there is not makefile for it.
>
> Best regards
>
> Xypron
>
>
> -------- Original-Nachricht --------
> > Datum: Thu, 27 Nov 2008 12:13:37 +0000
> > Von: "Nigel Galloway" <address@hidden>
> > An: "bo liu" <address@hidden>
> > CC: address@hidden, address@hidden
> > Betreff: Re: Hello,Nigel, I have some questions about GLPK
>
> > The tar.gz file is probably more suited to Unix. The zip file contains
> > glpsol.exe only which is enough if you just want to run examples written
> > in Mathprog. To be really useful as a Windows release the zip file should
> > contain a .Lib file which contains metadata about the glpk library.
> > glpsol.exe compiled against the .Lib file, which will be a lot smaller
> > than 800K. and a .dll file which is the shared library for Windows which
> > is needed for .Net applications.
> >
> > ----- Original Message -----
> > From: "bo liu"
> > To: "Nigel Galloway"
> > Subject: Re: Hello,Nigel, I have some questions about GLPK
> > Date: Wed, 26 Nov 2008 21:36:44 +0800
> >
> >
> > dear sir£¬
> >
> > i'm sorry to borther you that i download glpk-4.33.tar.gz from this
> > page
> >
> > http://sourceforge.net/project/showfiles.php?group_id=244007&package_id=297428&release_id=638021
> > ,but i do not know how to install it. There is no exe files in it.I
> > have read the glpk-4.33.pdf but i still don't know.My os is windows
> > xp sp2.i want to use the glpk to solve LP problems.Should i have to
> > download the glpsol-4.33.zip ?Hope you can help me . Best Wishes Bo
> > Leo
> >
> > -- _______________________________________________
> > Surf the Web in a faster, safer and easier way:
> > Download Opera 9 at http://www.opera.com
> >
> > Powered by Outblaze
>
> --
> Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit
> allen: http://www.gmx.net/de/go/multimessenger
>
--
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com
Powered by Outblaze