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

SCM Repository

[diderot] Annotation of /branches/vis12/test/hlic/hlic-BUG1.diderot
ViewVC logotype

Annotation of /branches/vis12/test/hlic/hlic-BUG1.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1762 - (view) (download)

1 : jhr 1762 // this version hits the issue of a join node with zero predecessors
2 :     //
3 : glk 1741 int imgSize = 200;
4 :     real h = 0.3; // step size of integration
5 :     int stepNum = 2; // take this many steps both upstream and downstream
6 :    
7 :     field#1(2)[2] V = load("tor2slice-evec.nrrd") ⊛ ctmr;
8 :     field#0(2)[] R = load("tor2slice-rand.nrrd") ⊛ tent;
9 :    
10 :     strand LIC (int xi, int yi) {
11 :     real xx = lerp(0.0, 79.0, -0.5, real(xi), real(imgSize)-0.5);
12 :     real yy = lerp(0.0, 79.0, -0.5, real(yi), real(imgSize)-0.5);
13 :     vec2 pos0 = [xx,yy];
14 :     vec2 pos = pos0;
15 :     vec2 step = [0.0,0.0];
16 :     output vec3 out = [0.0,0.0,0.0];
17 :     real sum = 0.0;
18 :     int num = 0;
19 :     int mon = 0;
20 :     real dir = 1.0;
21 :    
22 :     update {
23 :     step = 0.5*h*dir*V(pos);
24 :     if (inside(pos + step, V)) {
25 :     step = h*dir*V(pos + step);
26 :     if (inside(pos + step, V)) {
27 :     pos += step;
28 :     }
29 :     }
30 :     if (num == stepNum) {
31 :     if (dir > 0.0) {
32 :     stabilize;
33 :     // BUG: error in cvtMethod(Update, ...)
34 :     //uncaught exception Fail [Fail: unimplemented]
35 :     // raised at common/phase-timer.sml:76.50-76.52
36 :     // raised at translate/translate.sml:363.110-363.112
37 :     // raised at translate/translate.sml:303.29-303.31
38 :     // raised at translate/translate.sml:303.29-303.31
39 :     // raised at translate/translate.sml:276.29-276.49
40 :     //make: *** [hlic.o] Error 1
41 :     num = 0;
42 :     pos = pos0;
43 :     dir = -1.0;
44 :     } else {
45 :     stabilize;
46 :     }
47 :     }
48 :     sum += R(pos);
49 :     num += 1;
50 :     mon += 1;
51 :    
52 :     if (7 == mon) {
53 :     stabilize;
54 :     }
55 :     }
56 :    
57 :     stabilize {
58 :     out = [real(num),sum,dir];
59 :     }
60 :     }
61 :    
62 :     initially [ LIC(xi, yi) | yi in 0..(imgSize-1), xi in 0..(imgSize-1) ];

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