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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1030, Sun May 1 16:31:55 2011 UTC revision 1031, Sun May 1 17:39:05 2011 UTC
# Line 11  Line 11 
11  image(2)[2] Vimg = load("../data/vorttest.nrrd");  image(2)[2] Vimg = load("../data/vorttest.nrrd");
12    
13  // (1) HEY (BUG) I thought we had scalar multiplication of fields? this:  // (1) HEY (BUG) I thought we had scalar multiplication of fields? this:
14  field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = 1.0*Vpos;  field#1(2)[2] Vpos = Vimg ⊛ ctmr;
15    field#1(2)[2] V1 = -Vpos;
16  // causes:  // causes:
17  //   translate (V00E2, *001E, ...)  //   translate (V00E2, *001E, ...)
18  //   uncaught exception Fail [Fail: TranslateBasis.translate: unknown basis function *001E]  //   uncaught exception Fail [Fail: TranslateBasis.translate: unknown basis function *001E]
# Line 19  Line 20 
20  //     raised at translate/translate-basis.sml:189.22-189.100  //     raised at translate/translate-basis.sml:189.22-189.100
21  //  //
22  // (2) This also fails:  // (2) This also fails:
23  // field#1(2)[2] V = 1.0*(Vimg ⊛ ctmr);  field#1(2)[2] V2 = 1.0*(Vimg ⊛ ctmr);
24    
25  // (3) HEY (BUG): can't seem to even assign fields!  This also fails:  // (3) HEY (BUG): can't seem to even assign fields!  This also fails:
26  //field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = Vpos;  //field#1(2)[2] V3 = Vpos;
27    
28  // (4) HEY (BUG): I thought we had addition of fields?  This also fails:  // (4) HEY (BUG): I thought we had addition of fields?  This also fails:
29  //field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = Vpos + Vpos;  field#1(2)[2] V4 = Vpos + Vpos;
30    
31  // NOTE: these bugs are a symptom of the mishandling of variable scoping.  // NOTE: these bugs are a symptom of the mishandling of variable scoping.
32    
33  image(2)[] Rimg = load("../data/vorttest-rand.nrrd");  //image(2)[] Rimg = load("../data/vorttest-rand.nrrd");
34  field#0(2)[] R = Rimg ⊛ tent;  field#0(2)[] R = load("../data/vorttest-rand.nrrd") ⊛ tent;
35    
36  strand LIC (int xi, int yi) {  strand LIC (int xi, int yi) {
37      real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);      real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);
# Line 39  Line 40 
40      output vec2 v = [0.0,0.0];      output vec2 v = [0.0,0.0];
41    
42      update {      update {
43          v = V(pos);          v = (V1(pos) + V2(pos) /* + V3(pos)*/ + V4(pos)) * R(pos);
44          stabilize;          stabilize;
45      }      }
46  }  }

Legend:
Removed from v.1030  
changed lines
  Added in v.1031

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