Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/lamont/test/sum-reduction/sum-reduction.diderot
ViewVC logotype

Diff of /branches/lamont/test/sum-reduction/sum-reduction.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2547, Fri Feb 21 16:47:26 2014 UTC revision 2548, Wed Feb 26 14:22:24 2014 UTC
# Line 11  Line 11 
11   */   */
12  input int nNumbers;  input int nNumbers;
13  real gSum = 0;  real gSum = 0;
 real gMean = 0;  
14  int steps = 0;  int steps = 0;
15    
16  strand Reduction (int i, real number) {  strand Reduction (int i, real number) {
# Line 19  Line 18 
18      int id = i;      int id = i;
19      output real sum =0.0;      output real sum =0.0;
20      update {      update {
21          if(steps >= 1) {          if(steps >= 3) {
22              sum = gMean;              sum = gSum;
23                print("gSum =", sum, "\n");
24              stabilize;              stabilize;
25           }           }
26      }      }
# Line 30  Line 30 
30    
31  global {  global {
32    gSum = sum{S.num | S in Reduction.all};    gSum = sum{S.num | S in Reduction.all};
   gMean = sum{S.num + gSum | S in Reduction.all};  
33    steps+=1;    steps+=1;
34  }  }
35    

Legend:
Removed from v.2547  
changed lines
  Added in v.2548

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0