Which is the closer-to-be-officially-endorsed Java (jni) GLPK interface?

View: New views
6 Messages — Rating Filter:   Alert me  

Which is the closer-to-be-officially-endorsed Java (jni) GLPK interface?

by Giampaolo Tomassoni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everybody,

I'm looking one more time for a Java interface to the GLPK library and I
would like to select one which the GLPK team feels it could easily be
endorsed.

The purpose is to use it as a MIP solver from the new version of the Stan
package (which is probably quite unknown to most of you. See
http://sourceforge.net/projects/stan/ if you like to know more). The Stan
package already ships with its own jni interface to GLPK (of course, yet
another proprietary version). However, we would like to dismiss it in order
to cut most of the efforts we have to spend when the GLPK API changes. Stan
uses a very limited subset of the GLPK API.

Simply looking at 'java glpk' in Google I get a lot of edible projects, but
which is the one working better and better tracking any GLPK API change?

These are some:

        http://bjoern.dapnet.de/glpk/
        http://sourceforge.net/projects/glpk-java/
        https://gnu-glpk.dev.java.net/

Please also note that Stan is a Java product running on a few hardware and
software environments (mostly Win on x86_32 and x86_64, MacOS X on PowerPC,
x86_32 and x86_64). This means that:

- the glpk-jni-java makeup should work on these platforms;

- we would prefer a solution shipping binaries too, or else have access to a
compile farm (SourceForge dismissed its own). By the way, do you know of any
available?

Thank you,

Giampaolo



_______________________________________________
Help-glpk mailing list
Help-glpk@...
http://lists.gnu.org/mailman/listinfo/help-glpk

Re: Which is the closer-to-be-officially-endorsed Java (jni) GLPK interface?

by xypron :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Giampaolo,

https://gnu-glpk.dev.java.net/
is not providing a JNI interface for GLPK but allows to run GLPK on the
Sun Grid Computing Utility.

The JNI interface for GLPK published at
http://bjoern.dapnet.de/glpk/ 
has not been updated since version 4.8 of GLPK.

There has been a discussion to include the necessary files to build a JNI interface
into GLPK:
http://lists.gnu.org/archive/html/help-glpk/2009-01/msg00068.html
http://lists.gnu.org/archive/html/help-glpk/2009-02/msg00001.html

Andrew Makhorin the maintainer of GLPK decided not to include this feature into
his distribution.

Hence I set up the glpk-java project at sourceforge
http://sourceforge.net/projects/glpk-java/
and kept it in synch with the development of GLPK.

glpk-java is using SWIG to create the JNI wrapper classes. Therefore it is
easy to upgrade to any future version of GLPK.
(SWIG is hosted at http://www.swig.org .)

Makefiles for Windows 32bit and 64bit and for POSIX (Linux, ...) are
supplied.

Binaries for Windows are published at
http://sourceforge.net/projects/winglpk/.

A package for Debian Sid has been set up
http://packages.debian.org/unstable/java/libglpk-java

glpk-java currently currently does not support callback routines. I would
welcome contributions to add this feature.

Best regards

Xypron

Giampaolo Tomassoni wrote:
Hi everybody,

I'm looking one more time for a Java interface to the GLPK library and I
would like to select one which the GLPK team feels it could easily be
endorsed.

The purpose is to use it as a MIP solver from the new version of the Stan
package (which is probably quite unknown to most of you. See
http://sourceforge.net/projects/stan/ if you like to know more). The Stan
package already ships with its own jni interface to GLPK (of course, yet
another proprietary version). However, we would like to dismiss it in order
to cut most of the efforts we have to spend when the GLPK API changes. Stan
uses a very limited subset of the GLPK API.

Simply looking at 'java glpk' in Google I get a lot of edible projects, but
which is the one working better and better tracking any GLPK API change?

These are some:

        http://bjoern.dapnet.de/glpk/
        http://sourceforge.net/projects/glpk-java/
        https://gnu-glpk.dev.java.net/

Please also note that Stan is a Java product running on a few hardware and
software environments (mostly Win on x86_32 and x86_64, MacOS X on PowerPC,
x86_32 and x86_64). This means that:

- the glpk-jni-java makeup should work on these platforms;

- we would prefer a solution shipping binaries too, or else have access to a
compile farm (SourceForge dismissed its own). By the way, do you know of any
available?

Thank you,

Giampaolo



_______________________________________________
Help-glpk mailing list
Help-glpk@gnu.org
http://lists.gnu.org/mailman/listinfo/help-glpk

RE: Which is the closer-to-be-officially-endorsed Java (jni) GLPK interface?

by Giampaolo Tomassoni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Hello Giampaolo,
>
> https://gnu-glpk.dev.java.net/
> is not providing a JNI interface for GLPK but allows to run GLPK on the
> Sun Grid Computing Utility.
>
> The JNI interface for GLPK published at
> http://bjoern.dapnet.de/glpk/
> has not been updated since version 4.8 of GLPK.
>
> There has been a discussion to include the necessary files to build a
> JNI
> interface
> into GLPK:
> http://lists.gnu.org/archive/html/help-glpk/2009-01/msg00068.html
> http://lists.gnu.org/archive/html/help-glpk/2009-02/msg00001.html
>
> Andrew Makhorin the maintainer of GLPK decided not to include this
> feature
> into
> his distribution.
>
> Hence I set up the glpk-java project at sourceforge
> http://sourceforge.net/projects/glpk-java/
> and kept it in synch with the development of GLPK.

This is what I was looking for: a project tightly coupled with GNU GLPK.


> glpk-java is using SWIG to create the JNI wrapper classes. Therefore it
> is
> easy to upgrade to any future version of GLPK.
> (SWIG is hosted at http://www.swig.org .)

Right. I see, however, that swig tends to add some burden in the Java side.
In example, I see that constants from glpk.h are converted into methods. Am
I right or it is just I don't know almost anything about swig?


> Makefiles for Windows 32bit and 64bit and for POSIX (Linux, ...) are
> supplied.
>
> Binaries for Windows are published at
> http://sourceforge.net/projects/winglpk/.
>
> A package for Debian Sid has been set up
> http://packages.debian.org/unstable/java/libglpk-java

Xypron, may I ask why there is a specific project for the win binaries? And
why the Debian package shows autoconf/automake capabilities which are
missing in the glpk-java project? Can't they be back-ported?


> glpk-java currently currently does not support callback routines. I
> would
> welcome contributions to add this feature.

Ah, you see the GlpkHookIFC interface in the stan's glpk-jni subproject,
isn't it?

I may attempt to port something like that in the glpk-java project, provided
I get enough knowledge about swing.


> Best regards
>
> Xypron

Thank you very much for your reply,

Giampaolo



_______________________________________________
Help-glpk mailing list
Help-glpk@...
http://lists.gnu.org/mailman/listinfo/help-glpk

Parent Message unknown RE: Which is the closer-to-be-officially-endorsed Java (jni) GLPK interface?

by Nigel Galloway :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Little burden is added to the Java side solving the constraint (I promise I'll never misspell that again) matrix. Usually setting up the constraint matrix will be a small percentage of the time spent solving it. Therefore a little overhead setting up the constrain (I lied) matrix will not be noticed.


> ----- Original Message -----
> From: "Giampaolo Tomassoni" <g.tomassoni@...>
> To: Help-glpk@...
> Subject: RE: [Help-glpk] Which is the closer-to-be-officially-endorsed Java (jni) GLPK interface?
> Date: Thu, 5 Nov 2009 11:59:04 +0100
>
>
> > Hello Giampaolo,
> >
> > https://gnu-glpk.dev.java.net/
> > is not providing a JNI interface for GLPK but allows to run GLPK on the
> > Sun Grid Computing Utility.
> >
> > The JNI interface for GLPK published at
> > http://bjoern.dapnet.de/glpk/
> > has not been updated since version 4.8 of GLPK.
> >
> > There has been a discussion to include the necessary files to build a
> > JNI
> > interface
> > into GLPK:
> > http://lists.gnu.org/archive/html/help-glpk/2009-01/msg00068.html
> > http://lists.gnu.org/archive/html/help-glpk/2009-02/msg00001.html
> >
> > Andrew Makhorin the maintainer of GLPK decided not to include this
> > feature
> > into
> > his distribution.
> >
> > Hence I set up the glpk-java project at sourceforge
> > http://sourceforge.net/projects/glpk-java/
> > and kept it in synch with the development of GLPK.
>
> This is what I was looking for: a project tightly coupled with GNU GLPK.
>
>
> > glpk-java is using SWIG to create the JNI wrapper classes. Therefore it
> > is
> > easy to upgrade to any future version of GLPK.
> > (SWIG is hosted at http://www.swig.org .)
>
> Right. I see, however, that swig tends to add some burden in the Java side.
> In example, I see that constants from glpk.h are converted into methods. Am
> I right or it is just I don't know almost anything about swig?
>
>
> > Makefiles for Windows 32bit and 64bit and for POSIX (Linux, ...) are
> > supplied.
> >
> > Binaries for Windows are published at
> > http://sourceforge.net/projects/winglpk/.
> >
> > A package for Debian Sid has been set up
> > http://packages.debian.org/unstable/java/libglpk-java
>
> Xypron, may I ask why there is a specific project for the win binaries? And
> why the Debian package shows autoconf/automake capabilities which are
> missing in the glpk-java project? Can't they be back-ported?
>
>
> > glpk-java currently currently does not support callback routines. I
> > would
> > welcome contributions to add this feature.
>
> Ah, you see the GlpkHookIFC interface in the stan's glpk-jni subproject,
> isn't it?
>
> I may attempt to port something like that in the glpk-java project, provided
> I get enough knowledge about swing.
>
>
> > Best regards
> >
> > Xypron
>
> Thank you very much for your reply,
>
> Giampaolo
>
>
>
> _______________________________________________
> Help-glpk mailing list
> Help-glpk@...
> http://lists.gnu.org/mailman/listinfo/help-glpk

>


--
_______________________________________________
Surf the Web in a faster, safer and easier way:
Download Opera 9 at http://www.opera.com

Powered by Outblaze


_______________________________________________
Help-glpk mailing list
Help-glpk@...
http://lists.gnu.org/mailman/listinfo/help-glpk

RE: Which is the closer-to-be-officially-endorsed Java (jni) GLPK interface?

by Giampaolo Tomassoni :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

> Little burden is added to the Java side solving the constraint (I
> promise I'll never misspell that again) matrix. Usually setting up the
> constraint matrix will be a small percentage of the time spent solving
> it. Therefore a little overhead setting up the constrain (I lied)
> matrix will not be noticed.

I agree with you: the most use cases wouldn't suffer of any noticeable
overhead.

Nevertheless, it makes GLPK look a bit clumsy to a Java developer. They (we)
are used to cleaner APIs...

By the way, is all this swing and Java talking a bit OT here? Do we have to
move in some other place?

Giampaolo


> > ----- Original Message -----
> > From: "Giampaolo Tomassoni" <g.tomassoni@...>
> > To: Help-glpk@...
> > Subject: RE: [Help-glpk] Which is the closer-to-be-officially-
> endorsed Java (jni) GLPK interface?
> > Date: Thu, 5 Nov 2009 11:59:04 +0100
> >
> >
> > > Hello Giampaolo,
> > >
> > > https://gnu-glpk.dev.java.net/
> > > is not providing a JNI interface for GLPK but allows to run GLPK on
> the
> > > Sun Grid Computing Utility.
> > >
> > > The JNI interface for GLPK published at
> > > http://bjoern.dapnet.de/glpk/
> > > has not been updated since version 4.8 of GLPK.
> > >
> > > There has been a discussion to include the necessary files to build
> a
> > > JNI
> > > interface
> > > into GLPK:
> > > http://lists.gnu.org/archive/html/help-glpk/2009-01/msg00068.html
> > > http://lists.gnu.org/archive/html/help-glpk/2009-02/msg00001.html
> > >
> > > Andrew Makhorin the maintainer of GLPK decided not to include this
> > > feature
> > > into
> > > his distribution.
> > >
> > > Hence I set up the glpk-java project at sourceforge
> > > http://sourceforge.net/projects/glpk-java/
> > > and kept it in synch with the development of GLPK.
> >
> > This is what I was looking for: a project tightly coupled with GNU
> GLPK.
> >
> >
> > > glpk-java is using SWIG to create the JNI wrapper classes.
> Therefore it
> > > is
> > > easy to upgrade to any future version of GLPK.
> > > (SWIG is hosted at http://www.swig.org .)
> >
> > Right. I see, however, that swig tends to add some burden in the Java
> side.
> > In example, I see that constants from glpk.h are converted into
> methods. Am
> > I right or it is just I don't know almost anything about swig?
> >
> >
> > > Makefiles for Windows 32bit and 64bit and for POSIX (Linux, ...)
> are
> > > supplied.
> > >
> > > Binaries for Windows are published at
> > > http://sourceforge.net/projects/winglpk/.
> > >
> > > A package for Debian Sid has been set up
> > > http://packages.debian.org/unstable/java/libglpk-java
> >
> > Xypron, may I ask why there is a specific project for the win
> binaries? And
> > why the Debian package shows autoconf/automake capabilities which are
> > missing in the glpk-java project? Can't they be back-ported?
> >
> >
> > > glpk-java currently currently does not support callback routines. I
> > > would
> > > welcome contributions to add this feature.
> >
> > Ah, you see the GlpkHookIFC interface in the stan's glpk-jni
> subproject,
> > isn't it?
> >
> > I may attempt to port something like that in the glpk-java project,
> provided
> > I get enough knowledge about swing.
> >
> >
> > > Best regards
> > >
> > > Xypron
> >
> > Thank you very much for your reply,
> >
> > Giampaolo
> >
> >
> >
> > _______________________________________________
> > Help-glpk mailing list
> > Help-glpk@...
> > http://lists.gnu.org/mailman/listinfo/help-glpk
>
> >
>
>
> --
> _______________________________________________
> Surf the Web in a faster, safer and easier way:
> Download Opera 9 at http://www.opera.com
>
> Powered by Outblaze



_______________________________________________
Help-glpk mailing list
Help-glpk@...
http://lists.gnu.org/mailman/listinfo/help-glpk

RE: Which is the closer-to-be-officially-endorsed Java (jni) GLPK interface?

by xypron :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Giampaolo,

>> glpk-java is using SWIG to create the JNI wrapper classes. Therefore it
>> is
>> easy to upgrade to any future version of GLPK.
>> (SWIG is hosted at http://www.swig.org .)
>
>Right. I see, however, that swig tends to add some burden in the Java side.
>In example, I see that constants from glpk.h are converted into methods. Am
>I right or it is just I don't know almost anything about swig?

Let us have a look at the code:

public interface GLPKConstants {
  public final static int GLP_MAJOR_VERSION = GLPKJNI.GLP_MAJOR_VERSION_get();
  public final static int GLP_MINOR_VERSION = GLPKJNI.GLP_MINOR_VERSION_get();
  public final static int GLP_MIN = GLPKJNI.GLP_MIN_get();
  public final static int GLP_MAX = GLPKJNI.GLP_MAX_get();

Obviously methods are only called during the initialization of class GLPKConstants,
the runtime compiler could do this during compilation.

Your coding will use the public member:
  // set solver parameters
  iocp = new glp_iocp();
  GLPK.glp_init_iocp(iocp);
  iocp.setPresolve(GLPKConstants.GLP_ON);

Have a look at the examples provided with glpk-java.

> Xypron, may I ask why there is a specific project for the win binaries? And
> why the Debian package shows autoconf/automake capabilities which are
> missing in the glpk-java project? Can't they be back-ported?
For Linux glpk binaries are distributed as packages, e.g. in Debian.
Project gnuwin32 does not update glpk Windows binaries frequently.
Hence I set up a Sourceforge project to provide current executables for glpk.
GLPK-Java is integrated as a bonus.

>> glpk-java currently currently does not support callback routines. I
>> would
>> welcome contributions to add this feature.
>Ah, you see the GlpkHookIFC interface in the stan's glpk-jni subproject,
>isn't it?
For reference look at chapter 5.1.1 "Using the callback routine" of doc/glpk.pdf.

What is needed is a java method to which you can path the java listener and
a variable of structure glpk_iocp. This method should fill parameter cb_func
with a reference to a C routine and cb_info with a reference to the java
listener.

Best regards

Xypron