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

SCM Repository

[diderot] View of /branches/vis12/test/hlic/hlic-BUG4.diderot
ViewVC logotype

View of /branches/vis12/test/hlic/hlic-BUG4.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1756 - (download) (annotate)
Wed Mar 21 07:50:26 2012 UTC (7 years, 9 months ago) by jhr
File size: 1863 byte(s)
  Fixed BUG4
int imgSize = 200;
real h = 0.25;    // step size of integration
int stepNum = 15; // take this many steps both upstream and downstream

field#1(2)[2] V = load("tor2slice-evec.nrrd") ⊛ ctmr;
field#0(2)[] R = load("tor2slice-rand.nrrd") ⊛ tent;

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 real out = 0.0;
    real sum = 0.0;
    int num = 0;
    real dir = 1.0;
    vec2 vecA = [0.0,0.0];
    vec2 vecB = [0.0,0.0];
    tensor[2,2] tt = zeros[2,2];

    update {
      step = h*dir*V(pos);
      if (inside(pos + step, V)) {
        pos += step;
      }
      if (num == stepNum) {
        if (dir > 0.0) {
          num = 0;
          pos = pos0;
          dir = -1.0;
        }
      }
      if (num == stepNum && dir < 0.0) {
        stabilize;
      }
      tt = zeros[2,2];
// FIXED in r1754
      // BUG?:  why can't I assign to a tensor?
      // hlic.c:254:21: error: array type 'Diderot_Mat2x2_t' (aka 'union2f_t [2]') is not assignable
      //        selfOut->tt = selfIn->tt;
      //        ~~~~~~~~~~~ ^
      //hlic.c:292:17: error: array type 'Diderot_Mat2x2_t' (aka 'union2f_t [2]') is not assignable
      //    selfOut->tt = selfIn->tt;
      //    ~~~~~~~~~~~ ^
      //2 errors generated.
      //uncaught exception Fail [Fail: error compiling/linking]
      //  raised at common/phase-timer.sml:76.50-76.52
      //  raised at common/phase-timer.sml:76.50-76.52
      //  raised at common/phase-timer.sml:76.50-76.52
      //  raised at c-util/run-cc.sml:28.17-28.47
      //
      sum += R(pos);
      num += 1;
    }

    stabilize {
      out = sum;
    }
}

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