help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Glpk JNI


From: phalkone
Subject: [Help-glpk] Glpk JNI
Date: Tue, 18 Mar 2008 08:58:28 -0700 (PDT)

I'm using the Glpk JNI download from  http://bjoern.dapnet.de/glpk/index.htm
http://bjoern.dapnet.de/glpk/index.htm . My trimmed java code looks like:

public class TestGlpk {
        private void run(){
                GlpkSolver solver = new GlpkSolver();
                Hook hook = new Hook();
                solver.setHook(hook);
                //Describe objective function
                //Load Columns
                //Load Rows
                //Load Matrix
                solver.simplex();
                double Z = solver.getObjVal();
                System.out.println("Z = "+Z);
                solver.deleteProb();
        }
        
        public static void main(String[] args){
                new TestGlpk().run();
        }
        
        public class Hook implements GlpkHookIFC{

                public void fault(String s) {
                        JOptionPane.showMessageDialog(null,s);  
                }

                public void print(String s) {
                        JOptionPane.showMessageDialog(null,s);
                }
                
        }
}

The main problems I'm having are:
1. GlpkHookIFC is not working and I have no idea why. Printing and fault
messages are not shown in a MessageDialog (this is just for test purposes).
I would really like to capture all of the glpk output to display in my java
program.
2. When Glpk encounters an error, for instance duplicate indices, then my
whole java program crashes.
3. I don't know how to interrupt the solver.

Thanks a lot,

Phalkone
-- 
View this message in context: 
http://www.nabble.com/Glpk-JNI-tp16124276p16124276.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.





reply via email to

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