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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (download) (annotate)
Tue Sep 27 20:54:47 2016 UTC (2 years, 8 months ago) by glk
File size: 1022 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:

gst2b.cxx:509:36: error: use of undeclared identifier 'l_iter_10'
   this->output() << "update(" << l_iter_10 << "): target = " << l_target_13 << "\n" << std::flush;
                                  ^
1 error generated.
uncaught exception Fail [Fail: error compiling/linking]
 raised at common/phase-timer.sml:78.57-78.59
 raised at common/phase-timer.sml:78.57-78.59
 raised at cxx-util/run-cc.sml:30.24-30.54
*/
/*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;
    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 {
  iter += 1;
  target = sum { p.e | p in S.all } / N;
  print("update(", iter, "): target = ", target, "\n");
}

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

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