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

SCM Repository

[diderot] View of /tests/vis12-bugs/src/bug010.diderot
ViewVC logotype

View of /tests/vis12-bugs/src/bug010.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4640 - (download) (annotate)
Tue Sep 27 20:54:47 2016 UTC (2 years, 10 months ago) by glk
File size: 1839 byte(s)
initial result of svn export --username anonsvn --password=anonsvn https://svn.smlnj-gforge.cs.uchicago.edu/svn/diderot/branches/vis15/src/tests/
// this version hits the issue of a join node with zero predecessors
// (This is a simplified version of branches/vis12/test/hlic/hlic-BUG1.diderot
//  from which the comment above originates)

//
int imgSize = 200;
real h = 0.3;    // step size of integration
int stepNum = 2; // take this many steps both upstream and downstream

strand LIC (int xi, int yi) {
    real xx = lerp(0.0, 79.0, -0.5, real(xi), real(imgSize)-0.5);
    real yy = lerp(0.0, 79.0, -0.5, real(yi), real(imgSize)-0.5);
    vec2 pos0 = [xx,yy];
    vec2 pos = pos0;
    vec2 step = [0.0,0.0];
    output vec3 out = [0.0,0.0,0.0];
    real sum = 0.0;
    int num = 0;
    int mon = 0;
    real dir = 1.0;

    update {
      step = 0.5*h*dir*pos;
      pos += step;
      if (num == stepNum) {
        if (dir > 0.0) {
          stabilize;
          // [bug010.diderot:27.11-28.0] Warning: statements following "stabilize" statment are unreachable
          // [bug010.diderot:26.9-42.0] Warning: unreachable statements after "if-then-else" statement
          // error in cvtMethod(Update, ...)
          // uncaught exception Fail [Fail: unimplemented]
          //   raised at common/phase-timer.sml:76.50-76.52
          //   raised at translate/translate.sml:380.110-380.112
          //   raised at translate/translate.sml:320.29-320.31
          //   raised at translate/translate.sml:320.29-320.31
          //   raised at translate/translate.sml:293.29-293.49
          //make: *** [hlic.o] Error 1
          num = 0;
          pos = pos0;
          dir = -1.0;
        } else {
          stabilize;
        }
      }
      sum += |pos|;
      num += 1;
      mon += 1;

      if (7 == mon) {
        stabilize;
      }
    }

    stabilize {
      out = [real(num),sum,dir];
    }
}

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