COIN-OR::LEMON - Graph Library

source: lemon-project-template-glpk/deps/glpk/examples/huge.mod

subpack-glpk
Last change on this file was 9:33de93886c88, checked in by Alpar Juttner <alpar@…>, 13 years ago

Import GLPK 4.47

File size: 548 bytes
Line 
1/*Arithmetic Mean of a large number of Integers
2  - or - solve a very large constraint matrix
3         over 1 million rows and columns
4  Nigel_Galloway@operamail.com
5  March 18th., 2008.
6*/
7
8param e := 20;
9/* set Sample := {-2**e..2**e-1}; */
10set Sample := {1..2**e-1};
11
12var Mean;
13var E{z in Sample};
14
15/* sum of variances is zero */
16zumVariance: sum{z in Sample} E[z] = 0;
17
18/* Mean + variance[n] = Sample[n] */
19variances{z in Sample}: Mean + E[z] = z;
20
21solve;
22
23printf "The arithmetic mean of the integers from 1 to %d is %f\n", 2**e-1, Mean;
24
25end;
Note: See TracBrowser for help on using the repository browser.