bug-glpk
[Top][All Lists]
Advanced

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

Re: [Bug-glpk] problem name in call back function


From: glpk xypron
Subject: Re: [Bug-glpk] problem name in call back function
Date: Sun, 28 Feb 2010 21:53:10 +0100

Hello Andrew,

I have implemented support for the callback function for the
Java wrapper GLPK-Java.

I try to avoid assigning new memory in the wrapper function
to avoid possible memory leaks. Hence I use glp_iocp->cb_info
for the pointer to the Java environment.

When glp_init_iocp is called I set a link to a callback function
which calls a Java class. The Java program can add a listener to
the Java class if it wants to act on the callback.

If in a program multiple problems exist, like in column 
generation, it is usefull if the call back listener can
identify which problem is being solved. Even if the
presolver changes some columns the name information is 
valuable. This is why I would like to see the name
of the original problem passed to glp_int_opt also
in the problem available during the callback function. 
NULL returned now does not convey valuable information.

---

By the way, I have also been able adjust the wrapper 
generation by Swig to use glp_error_hook. Hence in the
next release of GLPK-Java a failure in a GLPK function 
will not break the Java application but instead create
an exception that can be caught.

Best regards

Xypron


-------- Original-Nachricht --------
> Datum: Sun, 28 Feb 2010 13:04:16 +0300
> Von: Andrew Makhorin <address@hidden>
> An: "glpk xypron" <address@hidden>
> CC: address@hidden
> Betreff: Re: [Bug-glpk] (no subject)

> > Why does glp_prob_name(tree) not return the same
> > pointer as the one passed to glp_int_opt?
> 
> Because you enabled the mip presolver (iocp.presolve = GLP_ON) in
> which case glp_intopt created an internal glp_prob object corresponding
> to a presolved mip. This is explained in the reference manual.
> 
> > Please, change the code to provide the problem name
> > in the call back function.
> 
> It would be possible to copy symbolic names from the original problem
> object, however, it does not have much sense, because the presolved mip
> may significantly differ from the original one. Probably there must be
> a flag in glp_iocp indicating which names to copy.

-- 
GMX DSL: Internet, Telefon und Entertainment für nur 19,99 EUR/mtl.!
http://portal.gmx.net/de/go/dsl02




reply via email to

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