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

SCM Repository

[diderot] Annotation of /branches/vis12/bugs/bug009.diderot
ViewVC logotype

Annotation of /branches/vis12/bugs/bug009.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2176 - (view) (download)

1 : glk 2176
2 :     int imgSize = 400;
3 :     real hh = 0.4; // step size of integration
4 :     int stepNum = 30; // take at most this many steps
5 :    
6 :     // BUG or at least a strangeness in the how a syntax error is reported:
7 :     // The function is missing the return type; why suggest vec4?
8 :     // [bug009.diderot:9.10] Error: syntax error; try inserting "vec4"
9 :     function align (vec2 vv, vec2 ref) = vv;
10 :    
11 :     strand HLIC (real sign, vec2 pos0) {
12 :     vec2 lastdir = pos0;
13 :     vec2 pos = pos0;
14 :     vec2 step = [0.0,0.0];
15 :     output real out = 0.0;
16 :     real sum = 0.0;
17 :     int stepIdx = 0;
18 :     vec2 dir = [0.0,0.0];
19 :    
20 :     update {
21 :     dir = align(pos, lastdir);
22 :     pos += hh*dir;
23 :     sum += |pos|;
24 :     stepIdx += 1;
25 :     lastdir = dir;
26 :     if (stepIdx == stepNum) {
27 :     stabilize;
28 :     }
29 :     }
30 :    
31 :     stabilize {
32 :     out = sum;
33 :     }
34 :     }
35 :    
36 :     initially [ HLIC(lerp(-1, 1, 0, si, 1),
37 :     [lerp(0.0, 81.0, -0.5, xi, imgSize-0.5),
38 :     lerp(0.0, 81.0, -0.5, yi, imgSize-0.5)])
39 :     | si in 0..1, yi in 0..imgSize-1, xi in 0..imgSize-1];

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