help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] [Fwd: Get the MIp relative gap at the end of the optimiz


From: glpk xypron
Subject: Re: [Help-glpk] [Fwd: Get the MIp relative gap at the end of the optimization]
Date: Wed, 20 Jul 2011 08:16:04 +0200

Hello Olivier,

> > I'm using glpk 4.45 through a Java environnement (JRE 1.6.0_24).
> 
> I don't know details how the callback is implemented in the Java
> interface. In C its entry point address is passed to glp_intopt thru the
> glp_iocp control parameter block (2nd parameter).

GLPK for Java is available for download at
http://glpk-java.sourceforge.net
It comes with the following examples showing how to use callbacks:
examples\java\Gmpl.java
examples\java\GmplSwing.java

Documentation is provided in
doc\glpk-java.pdf

In GLPK for Java method GLPK.glp_init_iocp(iocp) presets
the address for the callback such that the C callback calls
Java method GlpkCallback.callback(long cPtr).

You need an object of a class implementing interface 
org.gnu.glpk.GlpkCallbackListener.

You register it with
GlpkCallback.addListener(listener);

When a callback occurs method callback of the listener is called.

To find out the reason why the callback is called use
int reason = GLPK.glp_ios_reason(tree);

You may compare it to constants like
GLPKConstants.GLP_IBINGO

To stop listening use
GlpkCallback.removeListener(listener);

Best regards

Xypron

-- 
NEU: FreePhone - 0ct/min Handyspartarif mit Geld-zurück-Garantie!               
Jetzt informieren: http://www.gmx.net/de/go/freephone



reply via email to

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