lemon-project-template-glpk

annotate 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
rev   line source
alpar@9 1 /*Arithmetic Mean of a large number of Integers
alpar@9 2 - or - solve a very large constraint matrix
alpar@9 3 over 1 million rows and columns
alpar@9 4 Nigel_Galloway@operamail.com
alpar@9 5 March 18th., 2008.
alpar@9 6 */
alpar@9 7
alpar@9 8 param e := 20;
alpar@9 9 /* set Sample := {-2**e..2**e-1}; */
alpar@9 10 set Sample := {1..2**e-1};
alpar@9 11
alpar@9 12 var Mean;
alpar@9 13 var E{z in Sample};
alpar@9 14
alpar@9 15 /* sum of variances is zero */
alpar@9 16 zumVariance: sum{z in Sample} E[z] = 0;
alpar@9 17
alpar@9 18 /* Mean + variance[n] = Sample[n] */
alpar@9 19 variances{z in Sample}: Mean + E[z] = z;
alpar@9 20
alpar@9 21 solve;
alpar@9 22
alpar@9 23 printf "The arithmetic mean of the integers from 1 to %d is %f\n", 2**e-1, Mean;
alpar@9 24
alpar@9 25 end;