lemon-project-template-glpk
diff deps/glpk/examples/huge.mod @ 9:33de93886c88
Import GLPK 4.47
author | Alpar Juttner <alpar@cs.elte.hu> |
---|---|
date | Sun, 06 Nov 2011 20:59:10 +0100 |
parents | |
children |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/deps/glpk/examples/huge.mod Sun Nov 06 20:59:10 2011 +0100 1.3 @@ -0,0 +1,25 @@ 1.4 +/*Arithmetic Mean of a large number of Integers 1.5 + - or - solve a very large constraint matrix 1.6 + over 1 million rows and columns 1.7 + Nigel_Galloway@operamail.com 1.8 + March 18th., 2008. 1.9 +*/ 1.10 + 1.11 +param e := 20; 1.12 +/* set Sample := {-2**e..2**e-1}; */ 1.13 +set Sample := {1..2**e-1}; 1.14 + 1.15 +var Mean; 1.16 +var E{z in Sample}; 1.17 + 1.18 +/* sum of variances is zero */ 1.19 +zumVariance: sum{z in Sample} E[z] = 0; 1.20 + 1.21 +/* Mean + variance[n] = Sample[n] */ 1.22 +variances{z in Sample}: Mean + E[z] = z; 1.23 + 1.24 +solve; 1.25 + 1.26 +printf "The arithmetic mean of the integers from 1 to %d is %f\n", 2**e-1, Mean; 1.27 + 1.28 +end;