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

SCM Repository

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

Diff of /branches/pure-cfg/test/zslice-hess.diderot

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

revision 734, Sat Apr 2 10:30:30 2011 UTC revision 823, Thu Apr 14 14:28:33 2011 UTC
# Line 4  Line 4 
4  vec3 orig = [0.0, 0.0, 5.0];  vec3 orig = [0.0, 0.0, 5.0];
5  vec3 cVec = [0.0, 1.0, 0.0];  vec3 cVec = [0.0, 1.0, 0.0];
6  vec3 rVec = [1.0, 0.0, 0.0];  vec3 rVec = [1.0, 0.0, 0.0];
7  image(3)[] img = load("../data/zimg112.nrrd");  image(3)[] img = load("../data/zimg11.nrrd");
8  field#2(3)[] F = img ⊛ bspln3;  field#2(3)[] F = img ⊛ bspln3;
9    
10  strand RayCast (int row, int col)  strand RayCast (int row, int col)
11  {  {
12      real rr = real(dataSize)*(real(row)+0.5)/real(imgSize) - 0.5;      real rr = lerp(-0.5, real(dataSize)-0.5, -0.5, real(row), real(imgSize)-0.5);
13      real cc = real(dataSize)*(real(col)+0.5)/real(imgSize) - 0.5;      real cc = lerp(-0.5, real(dataSize)-0.5, -0.5, real(col), real(imgSize)-0.5);
14      vec3 pos = orig + rr*rVec + cc*cVec;      vec3 pos = orig + rr*rVec + cc*cVec;
15      output real val = 0.0;      output real val = 0.0;
16    
17      update      update
18      {      {
19          if (inside (pos,F)) {          if (inside (pos,F)) {
20             // HEY (bug?) is this the way to take the trace of the Hessian?              tensor[3,3] H = ∇(∇F)@pos;
21             // currently this causes:  //          val = trace(∇(∇F)@pos);
22             //   uncaught exception Fail [Fail: sigOf: invalid operator Trace<tensor[3,3]>]              val = H[0,0] + H[1,1] + H[2,2];  // test subscripting
            //   raised at high-il/check-high-il.sml:68.19-68.71  
            val = trace(∇∇F@pos);  
23          }          }
24          stabilize;          stabilize;
25      }      }

Legend:
Removed from v.734  
changed lines
  Added in v.823

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