SCM Repository
View of /branches/vis12/bugs/resolved/bug009.diderot
Parent Directory
|
Revision Log
Revision 2685 -
(download)
(annotate)
Mon Aug 25 18:58:33 2014 UTC (6 years, 7 months ago) by jhr
File size: 1107 byte(s)
Mon Aug 25 18:58:33 2014 UTC (6 years, 7 months ago) by jhr
File size: 1107 byte(s)
Fix for bug009; this change requires updating to SML/NJ 110.77.
int imgSize = 400; real hh = 0.4; // step size of integration int stepNum = 30; // take at most this many steps // BUG or at least a strangeness in the how a syntax error is reported: // [bug009.diderot:9.10] Error: syntax error; try inserting "vec4" // // The function is missing the return type; why suggest vec4? // // Because vec4 is a type and inserting it will fix the syntax error. // function align (vec2 vv, vec2 ref) = vv; strand HLIC (real sign, vec2 pos0) { vec2 lastdir = pos0; vec2 pos = pos0; vec2 step = [0.0,0.0]; output real out = 0.0; real sum = 0.0; int stepIdx = 0; vec2 dir = [0.0,0.0]; update { dir = align(pos, lastdir); pos += hh*dir; sum += |pos|; stepIdx += 1; lastdir = dir; if (stepIdx == stepNum) { stabilize; } } stabilize { out = sum; } } initially [ HLIC(lerp(-1, 1, 0, si, 1), [lerp(0.0, 81.0, -0.5, xi, imgSize-0.5), lerp(0.0, 81.0, -0.5, yi, imgSize-0.5)]) | 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 |