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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1019 - (view) (download)

1 : glk 933
2 :    
3 :     int imgSizeX = 300;
4 :     int imgSizeY = 200;
5 :    
6 :     image(2)[2] Vimg = load("../data/vorttest.nrrd");
7 :    
8 :     // HEY (BUG) I thought we had scalar multiplication of fields? this:
9 : glk 1019 field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = 1.0*Vpos;
10 : glk 933 // causes:
11 :     // translate (V00E2, *001E, ...)
12 :     // uncaught exception Fail [Fail: TranslateBasis.translate: unknown basis function *001E]
13 :     // raised at translate/translate-basis.sml:192.41-192.43
14 :     // raised at translate/translate-basis.sml:189.22-189.100
15 :     //
16 : glk 1019 // This also fails:
17 :     // field#1(2)[2] V = 1.0*(Vimg ⊛ ctmr);
18 : glk 933
19 :     // HEY (BUG): can't seem to even assign fields! This also fails:
20 : glk 1019 //field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = Vpos;
21 : glk 933
22 :     // HEY (BUG): I thought we had addition of fields? This also fails:
23 :     //field#1(2)[2] Vpos = Vimg ⊛ ctmr; field#1(2)[2] V = Vpos + Vpos;
24 :    
25 : jhr 985 // NOTE: these bugs are a symptom of the mishandling of variable scoping.
26 :    
27 : glk 933 image(2)[] Rimg = load("../data/vorttest-rand.nrrd");
28 :     field#0(2)[] R = Rimg ⊛ tent;
29 :    
30 :     strand LIC (int xi, int yi) {
31 :     real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);
32 :     real yy = lerp(0.0, 2.0, -0.5, real(yi), real(imgSizeY)-0.5);
33 :     vec2 pos = [xx,yy];
34 :     output vec2 v = [0.0,0.0];
35 :    
36 :     update {
37 :     v = V(pos);
38 :     stabilize;
39 :     }
40 :     }
41 :    
42 :     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