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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/high-to-mid/probe.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/high-to-mid/probe.sml

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

revision 2983, Fri Mar 6 23:16:15 2015 UTC revision 2984, Sat Mar 7 00:05:29 2015 UTC
# Line 14  Line 14 
14              v : ImageInfo.info,         (* summary info about image *)              v : ImageInfo.info,         (* summary info about image *)
15              h : Kernel.kernel,          (* reconstruction kernel *)              h : Kernel.kernel,          (* reconstruction kernel *)
16              k : int,                    (* number of levels of differentiation *)              k : int,                    (* number of levels of differentiation *)
17              pos : MidIL.var             (* probe position argument *)              pos : MidIL.var,            (* probe position argument *)
18                ctl : MidIL.var BorderCtl.ctl (* border-control for image indexing *)
19            } -> MidIL.assign list            } -> MidIL.assign list
20    
21    end = struct    end = struct
# Line 205  Line 206 
206            end            end
207    
208    (* generate code for probing the field (D^k (v * h)) at pos *)    (* generate code for probing the field (D^k (v * h)) at pos *)
209      fun expand {result, img, v, h, k, pos} = let      fun expand {result, img, v, h, k, pos, ctl} = let
210            val dim = ImageInfo.dim v            val dim = ImageInfo.dim v
211            val s = Kernel.support h            val s = Kernel.support h
212            val vecsTy = DstTy.vecTy(2*s) (* vectors of coefficients to cover support of kernel *)            val vecsTy = DstTy.vecTy(2*s) (* vectors of coefficients to cover support of kernel *)
# Line 242  Line 243 
243            in            in
244              case ImageInfo.voxelShape v              case ImageInfo.voxelShape v
245               of [] => toImgSpaceCode @ doVoxelSample (result, v, k, s, diffIter(), vars, 0)               of [] => toImgSpaceCode @ doVoxelSample (result, v, k, s, diffIter(), vars, 0)
 (*  
               | [d] => let  
                 (* the result will be a vector of k-order tensors; each element of the vector  
                  * has the sampleTy = tensor[dim,...,dim].  
                  *)  
                   val sampleTy = DstTy.TensorTy(List.tabulate(k, fn _ => dim))  
                   fun doSamples (offset, xs, code) = if (offset < 0)  
                         then code @ [cons(result, xs)]  
                         else let  
                           val res = DstV.new ("probe" ^ Int.toString offset, sampleTy)  
                           val code = doVoxelSample (res, v, k, s, diffIter(), vars, offset) @ code  
                           in  
                             doSamples (offset-1, res::xs, code)  
                           end  
                   in  
                     toImgSpaceCode @ doSamples (d-1, [], [])  
                   end  
 *)  
246                | shape => let                | shape => let
247                  (* the result will be a d1 x d2 matrix of k-order tensors; each element of the matrix                  (* the result will be a d1 x d2 matrix of k-order tensors; each element of the matrix
248                   * has the sampleTy = tensor[dim,...,dim].                   * has the sampleTy = tensor[dim,...,dim].

Legend:
Removed from v.2983  
changed lines
  Added in v.2984

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