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

SCM Repository

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

Annotation of /branches/vis12-cl/test/hlic/hlic-BUG10.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2402 - (view) (download)

1 : glk 1776 int imgSize = 200;
2 :     real h = 0.25; // step size of integration
3 :     int stepNum = 5; // take this many steps both upstream and downstream
4 :    
5 : jhr 1927 field#1(2)[2] V = image("tor2slice-vec0.nrrd") ⊛ ctmr;
6 :     field#0(2)[] R = image("tor2slice-rand.nrrd") ⊛ tent;
7 : glk 1776
8 :     strand LIC (int xi, int yi) {
9 :     vec2 pos0 = [lerp(0.0, 79.0, -0.5, real(xi), real(imgSize)-0.5),
10 :     lerp(0.0, 79.0, -0.5, real(yi), real(imgSize)-0.5)];
11 :     vec2 pos = pos0;
12 :     vec2 step = [0.0,0.0];
13 :     //output vec3 out = [0.0,0.0,0.0];
14 :     output real out = 0.0;
15 :     //BUG9: if out is type vec3, program works ok;
16 :     // if type is real; then program segfaults
17 : jhr 1779 // This issue was in main.c, which was coded to expect vec3 output (not real output)
18 : glk 1776 real sum = 0.0;
19 :     int num = 0;
20 :     real dir = 1.0;
21 :     print ("======== start starting at ", pos0, "\n");
22 : glk 1777 //BUG10: can't print in strand initialization
23 : jhr 1779 //this is because only declarations are allowed here, not statements
24 : glk 1776
25 :     update {
26 :     step = h*dir*V(pos);
27 :     if (inside(pos + step, V) && inside(pos + step, R)) {
28 :     pos += step;
29 :     }
30 :     if (num == stepNum && dir > 0.0) {
31 :     num = 0;
32 :     pos = pos0;
33 :     dir = -1.0;
34 :     }
35 :     if (num == stepNum && dir < 0.0) {
36 :     stabilize;
37 :     }
38 :     sum += R(pos);
39 :     num += 1;
40 :     }
41 :    
42 :     stabilize {
43 :     //out = [pos[0], pos[1], sum];
44 :     out = sum;
45 :     }
46 :     }
47 :    
48 :     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