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

SCM Repository

[diderot] View of /branches/vis15/src/tests/vis15-bugs/gst2c.diderot
ViewVC logotype

View of /branches/vis15/src/tests/vis15-bugs/gst2c.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4497 - (download) (annotate)
Sat Sep 3 14:12:36 2016 UTC (2 years, 9 months ago) by jhr
File size: 743 byte(s)
  working on merge: updating tests with new version 2 syntax
#version 2

/*
Compiling the attached program with vis15 r4464, it seems at the "iter += 1;" in the global update is not getting executed.
The per-strand print statements show that iter is stuck at 0.
*/
/*const*/ int N = 10;
real target = 0.0;
int iter = 0;

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

  update {
    real delta = (target - e)/2 + iter;
    print (i, "(", iter, "): e = ", e, ", delta = ", delta, "\n");
    if (|delta| < 0.001) {
	stabilize;
    } else {
	e += delta;
    }
  }

}

create_collection { S(i) | i in 1..N }

start {
  target = mean { p.e | p in S.all };
  print("initially: target = ", target, "\n");
}

update {
  iter += 1;
  target = sum { p.e | p in S.all } / N;
  print("update: target = ", target, "\n");
}

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