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

SCM Repository

[diderot] View of /branches/pure-cfg/test/fields.diderot
ViewVC logotype

View of /branches/pure-cfg/test/fields.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 985 - (download) (annotate)
Tue Apr 26 21:31:23 2011 UTC (8 years, 4 months ago) by jhr
File size: 1652 byte(s)
  Added note about bug

int imgSizeX = 300;
int imgSizeY = 200;

image(2)[2] Vimg = load("../data/vorttest.nrrd");

// HEY (BUG) I *can* say the following:
//   field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = -Vpos;
// but trying to do that with one statement, below, causes:
//  uncaught exception Fail [Fail: Error in compiling fneg.diderot]
//   raised at driver/main.sml:31.39-31.76
field#1(2)[2] V = -(Vimg ⊛ ctmr);

// HEY (BUG) I thought we had scalar multiplication of fields? this:
//field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = 1.0*Vpos;
// causes:
//   translate (V00E2, *001E, ...)
//   uncaught exception Fail [Fail: TranslateBasis.translate: unknown basis function *001E]
//     raised at translate/translate-basis.sml:192.41-192.43
//     raised at translate/translate-basis.sml:189.22-189.100
//
// should also have? field#1(2)[2] V = 1.0*(Vimg ⊛ ctmr);

// HEY (BUG): can't seem to even assign fields!  This also fails:
// field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = Vpos;

// HEY (BUG): I thought we had addition of fields?  This also fails:
//field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = Vpos + Vpos;

// NOTE: these bugs are a symptom of the mishandling of variable scoping.

image(2)[] Rimg = load("../data/vorttest-rand.nrrd");
field#0(2)[] R = Rimg ⊛ tent;

strand LIC (int xi, int yi) {
    real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);
    real yy = lerp(0.0, 2.0, -0.5, real(yi), real(imgSizeY)-0.5);
    vec2 pos = [xx,yy];
    output vec2 v = [0.0,0.0];

    update {
        v = V(pos);
        stabilize;
    }
}

initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];

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