COIN-OR::LEMON - Graph Library

source: glpk-cmake/examples/huge.mod @ 1:c445c931472f

Last change on this file since 1:c445c931472f was 1:c445c931472f, checked in by Alpar Juttner <alpar@…>, 13 years ago

Import glpk-4.45

  • Generated files and doc/notes are removed
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.