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

SCM Repository

[diderot] View of /branches/lamont/test/reduction/reduction.diderot
ViewVC logotype

View of /branches/lamont/test/reduction/reduction.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3282 - (download) (annotate)
Tue Oct 13 19:46:34 2015 UTC (4 years, 3 months ago) by lamonts
File size: 648 byte(s)
Fixed bug with dead strands appearing in query lists
/*! \file reduction-test.diderot
 *
 * \author Lamont Samuels
 *
 * This example tests the global reductions. 
 */

/*
 * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 */
int steps = 0; 
int nNumbers = 10;
real gVar = 0; 

strand Reduction (int i, real number) {
    real num = number; 
    output real out = 0; 
    int id = i; 
    update {
      if(real(id) % 2 == 0) {   
        out = gMean;
        stabilize;
      }

    }
} 



global {   
   gVar  = variance{S.num | S in Reduction.all};
   gVar -= 24.0;  
   steps+=1;  
} 

initially { Reduction(vi,vi) | vi in 1..nNumbers}; 

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