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

SCM Repository

[diderot] View of /branches/vis15/src/tests/new-tests/global-sum-test.diderot
ViewVC logotype

View of /branches/vis15/src/tests/new-tests/global-sum-test.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4328 - (download) (annotate)
Sun Jul 31 20:46:18 2016 UTC (2 years, 10 months ago) by jhr
File size: 565 byte(s)
new test
/* global-sum-test.diderot
 *
 * This program tests the use of global reductions in a program.
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2016 The University of Chicago
 * All rights reserved.
 */

real total = 0.0;

strand S (int i) {
  output real e = i;

  update {
    real e' = real(i) / total;
    if (e == e') {
	stabilize;
    } else {
	e = e';
    }
  }

}

collection { S(i) | i in 1..10 }

initially {
  total = sum { p.e | p in S.all };
}

update {
  total = sum { p.e | p in S.all };
}

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