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

SCM Repository

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

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

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

revision 698, Fri Mar 25 18:53:13 2011 UTC revision 723, Fri Apr 1 22:55:25 2011 UTC
# Line 1  Line 1 
1  // rsmp2d  // rsmp2d
2  //  //
3  // demos 2D convolution, when it is implemented  // demos 2D convolution
4    
5  string dataFile = "../data/pix1-11.nrrd";  string dataFile = "../data/pix1-11.nrrd";
6  int dataSize = 11;  int dataSize = 11;
# Line 13  Line 13 
13      real uu = real(dataSize)*(real(ui)+0.5)/real(imgSize) - 0.5;      real uu = real(dataSize)*(real(ui)+0.5)/real(imgSize) - 0.5;
14      real vv = real(dataSize)*(real(vi)+0.5)/real(imgSize) - 0.5;      real vv = real(dataSize)*(real(vi)+0.5)/real(imgSize) - 0.5;
15      vec2 pos = [uu,vv];      vec2 pos = [uu,vv];
16      output real val = 0.0;      //output real val = -∞;
17        output vec3 vxy = [0.0,0.0,0.0];
18    
19      update      update
20      {      {
21          val = F@pos if inside(pos,F)          if (inside(pos,F)) {
22                      else -∞;            real f = F@pos;
23              vec2 grad = ∇F@pos;
24              // HEY (BUG) what happened to vector indexing?
25              //vxy = [0.1 if f > 0.01 else 0.0, grad[0], grad[1]];
26              vxy = [0.1 if f > 0.01 else 0.0, dot(grad, [1.0,0.0]), dot(grad, [0.0,1.0])];
27            }
28          stabilize;          stabilize;
29      }      }
30  }  }

Legend:
Removed from v.698  
changed lines
  Added in v.723

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