help-glpk
[Top][All Lists]
Advanced

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

[Help-glpk] Callback using IAJAAR (Python and Java examples)


From: Nigel Galloway
Subject: [Help-glpk] Callback using IAJAAR (Python and Java examples)
Date: Tue, 1 Feb 2011 14:04:49 +0100

Who so beset me round with dismal stories.

The Python and Java examples described below can be compiled using the swig 
input file:

http://master.dl.sourceforge.net/project/iajaarh/Callback_examples/IAJAAR_H.swg.xps

test.py 
http://master.dl.sourceforge.net/project/iajaarh/Callback_examples/test.py.xps 
defines class foo_bar which extends IAJAAR_CALLBACK (lines 6 to 15)defined in 
IAJAAR_H.hpp.

http://master.dl.sourceforge.net/project/iajaarh/Callback_examples/IAJAAR_H.hpp.xps

When run with info (line 59) uncommented it produces:

GLPK Integer Optimizer, v4.45
2 rows, 2 columns, 4 non-zeros
2 integer variables, none of which are binary
Preprocessing...
1 constraint coefficient(s) were reduced
2 rows, 2 columns, 4 non-zeros
2 integer variables, one of which is binary
Scaling...
 A: min|aij| = 1.000e+000  max|aij| = 7.000e+000  ratio = 7.000e+000
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part = 2
Solving LP relaxation...
GLPK Simplex Optimizer, v4.45
2 rows, 2 columns, 4 non-zeros
*     0: obj =  0.000000000e+000  infeas = 0.000e+000 (0)
*     3: obj =  6.000000000e+001  infeas = 0.000e+000 (0)
OPTIMAL SOLUTION FOUND
Integer optimization begins...
Python called: Nigel is Best!!!
+     3: mip =     not found yet <=              +inf        (1; 0)
Python called: Nigel is Best!!!
Python called: Nigel is Best!!!
+     3: >>>>>  6.000000000e+001 <=  6.000000000e+001   0.0% (1; 0)
Python called: Nigel is Best!!!
+     3: mip =  6.000000000e+001 <=     tree is empty   0.0% (0; 1)
INTEGER OPTIMAL SOLUTION FOUND
Pretend printing of solution
Callback::~Callback()

when run without info it produces:

GLPK Integer Optimizer, v4.45
2 rows, 2 columns, 4 non-zeros
2 integer variables, none of which are binary
Preprocessing...
1 constraint coefficient(s) were reduced
2 rows, 2 columns, 4 non-zeros
2 integer variables, one of which is binary
Scaling...
 A: min|aij| = 1.000e+000  max|aij| = 7.000e+000  ratio = 7.000e+000
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part = 2
Solving LP relaxation...
GLPK Simplex Optimizer, v4.45
2 rows, 2 columns, 4 non-zeros
*     0: obj =  0.000000000e+000  infeas = 0.000e+000 (0)
*     3: obj =  6.000000000e+001  infeas = 0.000e+000 (0)
OPTIMAL SOLUTION FOUND
Integer optimization begins...
Python called: nothing said about Nigel
+     3: mip =     not found yet <=              +inf        (1; 0)
Python called: nothing said about Nigel
Python called: nothing said about Nigel
+     3: >>>>>  6.000000000e+001 <=  6.000000000e+001   0.0% (1; 0)
Python called: nothing said about Nigel
+     3: mip =  6.000000000e+001 <=     tree is empty   0.0% (0; 1)
INTEGER OPTIMAL SOLUTION FOUND
Pretend printing of solution
Callback::~Callback()

Similarly for Java:

http://master.dl.sourceforge.net/project/iajaarh/Callback_examples/cb.java.xps

with info:

GLPK Integer Optimizer, v4.45
2 rows, 2 columns, 4 non-zeros
2 integer variables, none of which are binary
Preprocessing...
1 constraint coefficient(s) were reduced
2 rows, 2 columns, 4 non-zeros
2 integer variables, one of which is binary
Scaling...
 A: min|aij| = 1.000e+000  max|aij| = 7.000e+000  ratio = 7.000e+000
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part = 2
Solving LP relaxation...
GLPK Simplex Optimizer, v4.45
2 rows, 2 columns, 4 non-zeros
*     0: obj =  0.000000000e+000  infeas = 0.000e+000 (0)
*     3: obj =  6.000000000e+001  infeas = 0.000e+000 (0)
OPTIMAL SOLUTION FOUND
Integer optimization begins...
Java called: Nigel is Best!!!
+     3: mip =     not found yet <=              +inf        (1; 0)
Java called: Nigel is Best!!!
Java called: Nigel is Best!!!
+     3: >>>>>  6.000000000e+001 <=  6.000000000e+001   0.0% (1; 0)
Java called: Nigel is Best!!!
+     3: mip =  6.000000000e+001 <=     tree is empty   0.0% (0; 1)
INTEGER OPTIMAL SOLUTION FOUND
Pretend printing of solution

and without info:

GLPK Integer Optimizer, v4.45
2 rows, 2 columns, 4 non-zeros
2 integer variables, none of which are binary
Preprocessing...
1 constraint coefficient(s) were reduced
2 rows, 2 columns, 4 non-zeros
2 integer variables, one of which is binary
Scaling...
 A: min|aij| = 1.000e+000  max|aij| = 7.000e+000  ratio = 7.000e+000
Problem data seem to be well scaled
Constructing initial basis...
Size of triangular part = 2
Solving LP relaxation...
GLPK Simplex Optimizer, v4.45
2 rows, 2 columns, 4 non-zeros
*     0: obj =  0.000000000e+000  infeas = 0.000e+000 (0)
*     3: obj =  6.000000000e+001  infeas = 0.000e+000 (0)
OPTIMAL SOLUTION FOUND
Integer optimization begins...
Java called: nothing said about Nigel
+     3: mip =     not found yet <=              +inf        (1; 0)
Java called: nothing said about Nigel
Java called: nothing said about Nigel
+     3: >>>>>  6.000000000e+001 <=  6.000000000e+001   0.0% (1; 0)
Java called: nothing said about Nigel
+     3: mip =  6.000000000e+001 <=     tree is empty   0.0% (0; 1)
INTEGER OPTIMAL SOLUTION FOUND
Pretend printing of solution



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




reply via email to

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