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

SCM Repository

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

View of /branches/pure-cfg/test/zslice-hess2.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 805 - (download) (annotate)
Tue Apr 12 06:16:19 2011 UTC (8 years, 6 months ago) by glk
File size: 1301 byte(s)
new test programs
int dataSize = 11;
int imgSize = 200;
vec3 orig = [0.0, 0.0, 5.0];
vec3 cVec = [0.0, 1.0, 0.0];
vec3 rVec = [1.0, 0.0, 0.0];
image(3)[] img = load("../data/zimg11.nrrd");
field#2(3)[] F = img ⊛ bspln3;

strand RayCast (int row, int col)
{
    real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
    real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
    vec3 pos = orig + rr*rVec + cc*cVec;
    output real val = 0.0; 

    update
    {
        if (inside (pos,F)) {
           tensor[3,3] G = [[0.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0]];
           if (1 > 0) {
             tensor[3,3] H = [[1.0,0.0,0.0],[0.0,0.0,0.0],[0.0,0.0,0.0]];
             // HEY BUG (which goes away if these statements are not wrapped in "if (1 > 0)"
             // zslice-hess2.c: In function ‘RayCast_update’:
             // zslice-hess2.c:83: error: incompatible types in assignment
             // zslice-hess2.c:86: error: incompatible types in assignment
             // uncaught exception Fail [Fail: error compiling/linking]
             //   raised at c-target/c-target.sml:682.17-682.47
             G = H;
           }
           val = trace(G);
	}
        stabilize;
    }
}

initially [ RayCast(r, c) | r in 0..(imgSize-1), c in 0..(imgSize-1) ];

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