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

SCM Repository

[diderot] View of /tests/vis15-bugs/gst2a.diderot
ViewVC logotype

View of /tests/vis15-bugs/gst2a.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (download) (annotate)
Tue Sep 27 20:54:47 2016 UTC (2 years, 11 months ago) by glk
File size: 893 byte(s)
initial result of svn export --username anonsvn --password=anonsvn https://svn.smlnj-gforge.cs.uchicago.edu/svn/diderot/branches/vis15/src/tests/
#version 2

/*
Compiling with vis15 r4464 the attached program generates:

[gst2a.diderot:29.8-10] Warning: local variable 'dd' is unused
uncaught exception Fail [Fail: unknown or incorrect operator Strands<id(S),all>]
 raised at common/phase-timer.sml:78.57-78.59
 raised at cxx-util/tree-to-cxx.sml:229.26-231.20
*/
int N = 10;
real target = 0.0;

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

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

}

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

update {
  target = sum { p.e | p in S.all } / N;
  real dd = mean { p.delta | p in S.all };
  print("update: target = ", target, "\n");
  print("update: dd = ", dd, "\n");
}

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

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