Andrew,

The attached dat file demonstrates a pbn.mod problem and the patch
fixes it. Briefly, some arrays have insufficient maximum size when a
dimension (rows/columns) has odd size.


Best Regards,

Chris Matrakidis
commit f0a3665baa89badbe8c635fddc9a8ec108359391
Author: Chris Matrakidis <[email protected]>
Date:   Sat May 20 13:34:46 2017 +0300

    fix off-by-one errors in pbn.mod

diff --git a/examples/pbn/pbn.mod b/examples/pbn/pbn.mod
index f9616f1..7fc1737 100644
--- a/examples/pbn/pbn.mod
+++ b/examples/pbn/pbn.mod
@@ -52,16 +52,16 @@ param m, integer, >= 1;
 param n, integer, >= 1;
 /* the number of columns */
 
-param row{i in 1..m, 1..n div 2}, integer, >= 0, default 0;
+param row{i in 1..m, 1..(n + 1) div 2}, integer, >= 0, default 0;
 /* the cluster-size sequence for row i (raw data) */
 
-param col{j in 1..n, 1..m div 2}, integer, >= 0, default 0;
+param col{j in 1..n, 1..(m + 1) div 2}, integer, >= 0, default 0;
 /* the cluster-size sequence for column j (raw data) */
 
-param kr{i in 1..m} := sum{t in 1..n div 2: row[i,t] > 0} 1;
+param kr{i in 1..m} := sum{t in 1..(n + 1) div 2: row[i,t] > 0} 1;
 /* the number of clusters in row i */
 
-param kc{j in 1..n} := sum{t in 1..m div 2: col[j,t] > 0} 1;
+param kc{j in 1..n} := sum{t in 1..(m + 1) div 2: col[j,t] > 0} 1;
 /* the number of clusters in column j */
 
 param sr{i in 1..m, t in 1..kr[i]} := row[i,t], integer, >= 1;

Attachment: pbn_bug.dat
Description: Binary data

_______________________________________________
Bug-glpk mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-glpk

Reply via email to