help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] Re: Compiling glpsol.java using glpk_java


From: Chris Wolf
Subject: Re: [Help-glpk] Re: Compiling glpsol.java using glpk_java
Date: Wed, 03 Mar 2010 18:15:08 -0500
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2

Xypron,

For implementing exceptions in C you might consider the standard C library
routine, setjmp, to implement asynchronous exceptions. (i.e. throw/try/catch)

I've been involved with implementing this in at least one commercial product
and it works well.   You might look at this paper, although it's about 
using SWIG to interface to Python, the setjmp idea would work as well
with Java.

http://www.swig.org/papers/Py97/beazley.html

Regards,

   -Chris

On 3/3/10 5:11 PM, glpk xypron wrote:
> Hello Nigel,
> 
> thank you for your suggestion.
> 
> Your appendix looks like the coding at
> http://www.swig.org/Doc1.3/Java.html#converting_java_string_arrays
> 
> Probably malloc should be replaced by xmalloc to avoid memory
> leaks in the case of an error in glp_main.
> 
> I guess the major problem with pointers of pointers is in
> structure _glp_graph. This is where I would appreciate
> assistance.
> 
> Currently I am working on the following:
> - Use glp_error_hook to add exception based error handling.
> - Create a listener interface to allow using the MIP callback
>   functionality.
> 
> Best regards
> 
> Xypron
> 
> 
> -------- Original-Nachricht --------
>> Datum: Wed, 3 Mar 2010 18:27:30 +0100
>> Von: "Nigel Galloway"
>> Betreff: Compiling glpsol.java using glpk_java
> 
>> Xypron,
>>
>> The glpk_java distribution provides a Java interface to most of the
>> glpk API. I think some improvements are needed to access glp_main and
>> hence write glpsol in Java.
>>
>> Attched is glpsol.java, the comments indicate the changes needed to
>> swig.i to enable it to function.
>>
>> If you are willing to make these enhancements please feel free to
>> include glpsol.java in the glpk_java examples.
>>
>> If you wish to include glpsol.class in the glpk_java jar then
>> something similar to the following is possible:
>>
> 




reply via email to

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