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

SCM Repository

[diderot] Diff of /branches/pure-cfg/src/compiler/simplify/eval.sml
ViewVC logotype

Diff of /branches/pure-cfg/src/compiler/simplify/eval.sml

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

revision 516, Wed Feb 9 23:10:31 2011 UTC revision 517, Thu Feb 10 11:45:00 2011 UTC
# Line 14  Line 14 
14        | IV of IntInf.int        | IV of IntInf.int
15        | TV of (int list * real list)    (* tensors *)        | TV of (int list * real list)    (* tensors *)
16        | ImgV of ImageInfo.info * Var.var        | ImgV of ImageInfo.info * Var.var
       | KV of Kernel.kernel  
17    
18      val evalStatics : Var.Set.set * Simple.block -> value Var.Map.map      val evalStatics : Var.Set.set * Simple.block -> value Var.Map.map
19    
# Line 33  Line 32 
32        | IV of IntInf.int        | IV of IntInf.int
33        | TV of (int list * real list)    (* tensors *)        | TV of (int list * real list)    (* tensors *)
34        | ImgV of ImageInfo.info * Var.var        | ImgV of ImageInfo.info * Var.var
       | KV of Kernel.kernel  
35    
36      fun RV r = TV([], [r])      fun RV r = TV([], [r])
37    
# Line 43  Line 41 
41        | toString (TV(s, v)) = "tensor"        | toString (TV(s, v)) = "tensor"
42  (* FIXME: should include x in output *)  (* FIXME: should include x in output *)
43        | toString (ImgV(info, x)) = ImageInfo.toString info        | toString (ImgV(info, x)) = ImageInfo.toString info
       | toString (KV h) = Kernel.toString h  
44    
45      val tbl : (value list -> value) VTbl.hash_table = let      val tbl : (value list -> value) VTbl.hash_table = let
46            val tbl = VTbl.mkTable (128, Fail "Eval table")            val tbl = VTbl.mkTable (128, Fail "Eval table")
# Line 56  Line 53 
53            fun realCmp rator [TV([], [a]), TV([], [b])] = BV(rator(a, b))            fun realCmp rator [TV([], [a]), TV([], [b])] = BV(rator(a, b))
54            fun boolCmp rator [BV a, BV b] = BV(rator(a, b))            fun boolCmp rator [BV a, BV b] = BV(rator(a, b))
55            fun stringCmp rator [SV a, SV b] = BV(rator(a, b))            fun stringCmp rator [SV a, SV b] = BV(rator(a, b))
           fun kernel h [] = KV h  
56            in            in
57              List.app (VTbl.insert tbl) [              List.app (VTbl.insert tbl) [
58                  (BV.add_ii,             intBinOp (op +)),                  (BV.add_ii,             intBinOp (op +)),
# Line 117  Line 113 
113                  (BV.fn_principleEvec,   vectorOp Op.PrincipleEvec),                  (BV.fn_principleEvec,   vectorOp Op.PrincipleEvec),
114  *)  *)
115                  (BV.fn_sin,             realUnOp Math.sin),                  (BV.fn_sin,             realUnOp Math.sin),
116    (*
117                  (BV.kn_bspln3,          kernel Kernel.bspln3),                  (BV.kn_bspln3,          kernel Kernel.bspln3),
118                  (BV.kn_bspln5,          kernel Kernel.bspln5),                  (BV.kn_bspln5,          kernel Kernel.bspln5),
119                  (BV.kn_ctmr,            kernel Kernel.ctmr),                  (BV.kn_ctmr,            kernel Kernel.ctmr),
120                  (BV.kn_tent,            kernel Kernel.tent),                  (BV.kn_tent,            kernel Kernel.tent),
121    *)
122                  (BV.i2r,                fn [IV i] => RV(real(IntInf.toInt i)))                  (BV.i2r,                fn [IV i] => RV(real(IntInf.toInt i)))
123                ];                ];
124              tbl              tbl
# Line 178  Line 176 
176              | S.E_Cons xs => raise Fail "TODO: E_Cons"              | S.E_Cons xs => raise Fail "TODO: E_Cons"
177              | S.E_Slice(e, indices, _) => raise Fail "TODO: E_Slice"              | S.E_Slice(e, indices, _) => raise Fail "TODO: E_Slice"
178              | S.E_Input(ty, name, optDefault) => raise Fail "impossible"              | S.E_Input(ty, name, optDefault) => raise Fail "impossible"
             | S.E_Kernel _ => raise Fail "E_Kernel"  
179              | S.E_LoadImage info => SOME(ImgV info)              | S.E_LoadImage info => SOME(ImgV info)
180            (* end case *))            (* end case *))
181    

Legend:
Removed from v.516  
changed lines
  Added in v.517

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