help-glpk
[Top][All Lists]
Advanced

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

Re: [Help-glpk] How to reuse a GlpkSolver in JNI


From: cgi2
Subject: Re: [Help-glpk] How to reuse a GlpkSolver in JNI
Date: Wed, 17 Mar 2004 15:24:26 -0800

You can add the delete_prob method to the JNI with the following changes:

1) Add the following line to GlpkSolver.java
        public native void deleteProb();
2) Add the following line into glpk.c:
JNIEXPORT void JNICALL
Java_org_gnu_glpk_GlpkSolver_deleteProb(JNIEnv *env, jobject obj) {
  lpx_delete_prob(get_lpx(env, obj));

and rebuild it.
May I suggest that this be added to the official distribution?


On Tue, 16 Mar 2004 21:34:12 -0700
"Welson Sun" <address@hidden> wrote:
>In the README file of JNI, it is said that:
>  All GLPK API functions in "lpx_" namespace are supported. Their respective
>  names and declarations are reformatted to fit the Java programming style.
>  You get full functionality of GLPK package available for Java program.
>  In addition added functionality allowing to disable printouts from
>  the GLPK library. 
> 
>But there are some memory bug in the 4.3 version ( I cannot build 4.4 JNI on
>Linux) of Glpk JNI package: if I create a lot of GlpkSolver in a loop, it
>will exit without any notification on Windows( on Linux, it will create a
>log file and says Java JVM error), but there is no corresponding
>"lpx_delete_prob" method in the JNI package. So I would like to reuse only
>one GlpkSolver in the whole loop, but I cannot find the "lpx_del_rows" and
>"lpx_del_cols" method either.
> 
>So has anybody experienced the same kind of errors? And how can I reuse a
>GlpkSolver in JNI? Or any other ideas?
> 
>Welson

          
________________________________________________
Don't E-Mail, ZipMail! http://www.zipmail.com/




reply via email to

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