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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (view) (download)

1 : glk 4640 #version 2
2 :    
3 :     /*
4 :     Compiling with vis15 r4464 the attached program generates:
5 :    
6 :     [gst2a.diderot:29.8-10] Warning: local variable 'dd' is unused
7 :     uncaught exception Fail [Fail: unknown or incorrect operator Strands<id(S),all>]
8 :     raised at common/phase-timer.sml:78.57-78.59
9 :     raised at cxx-util/tree-to-cxx.sml:229.26-231.20
10 :     */
11 :     int N = 10;
12 :     real target = 0.0;
13 :    
14 :     strand S (int i) {
15 :     output real e = i;
16 :     real delta = 0;
17 :    
18 :     update {
19 :     delta = (target - e)/2;
20 :     print (i, ": e = ", e, ", delta = ", delta, "\n");
21 :     if (|delta| < 0.001) {
22 :     stabilize;
23 :     } else {
24 :     e += delta;
25 :     }
26 :     }
27 :    
28 :     }
29 :    
30 :     start {
31 :     target = mean { p.e | p in S.all };
32 :     print("initially: target = ", target, "\n");
33 :     }
34 :    
35 :     update {
36 :     target = sum { p.e | p in S.all } / N;
37 :     real dd = mean { p.delta | p in S.all };
38 :     print("update: target = ", target, "\n");
39 :     print("update: dd = ", dd, "\n");
40 :     }
41 :    
42 :     create_collection { S(i) | i in 1..N }

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