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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/high-il/rewrite-ein.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/high-il/rewrite-ein.sml

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

revision 2413, Mon Aug 12 17:36:05 2013 UTC revision 2414, Mon Aug 19 05:02:14 2013 UTC
# Line 38  Line 38 
38            val subst = Vector.fromList ids            val subst = Vector.fromList ids
39            fun substIdx id = Vector.sub(subst, id)            fun substIdx id = Vector.sub(subst, id)
40              handle ex => (print(concat["substIdx ([|", String.concatWith "," (List.map Int.toString ids), "|],", Int.toString id, ")\n"]); raise ex)              handle ex => (print(concat["substIdx ([|", String.concatWith "," (List.map Int.toString ids), "|],", Int.toString id, ")\n"]); raise ex)
41              fun rewriteDel(i,j)=(substIdx i, substIdx j)
42            fun apply e = (case e            fun apply e = (case e
43                   of Ein.Const _ => e                   of Ein.Const _ => e
44                    | Ein.Tensor(id, mx) => Ein.Tensor(id, List.map substIdx mx)                    | Ein.Tensor(id, mx) => Ein.Tensor(id, List.map substIdx mx)
# Line 50  Line 51 
51                    | Ein.Neg e => Ein.Neg(apply e)                    | Ein.Neg e => Ein.Neg(apply e)
52                    | Ein.Delta(i, j) => Ein.Delta(substIdx i, substIdx j)                    | Ein.Delta(i, j) => Ein.Delta(substIdx i, substIdx j)
53                    | Ein.Epsilon(i, j, k) => Ein.Epsilon(substIdx i, substIdx j, substIdx k)                    | Ein.Epsilon(i, j, k) => Ein.Epsilon(substIdx i, substIdx j, substIdx k)
54                    | Ein.Conv(v, dx, h, i) => Ein.Conv(v,dx, h, substIdx i)                    | Ein.Conv(h, deltas) => Ein.Conv(apply h,(List.map rewriteDel deltas))
55                    | Ein.Partial mx => Ein.Partial mx                    | Ein.Partial mx => Ein.Partial mx
56                    | Ein.Probe(e, id) => Ein.Probe(apply e, id)                    | Ein.Probe(e, id) => Ein.Probe(apply e, id)
57    
# Line 89  Line 90 
90                    | Ein.Neg e => Ein.Neg(apply e)                    | Ein.Neg e => Ein.Neg(apply e)
91                    | Ein.Delta _ => e                    | Ein.Delta _ => e
92                    | Ein.Epsilon _ => e                    | Ein.Epsilon _ => e
93                    | Ein.Conv _ => e                    | Ein.Conv(h, deltas) => Ein.Conv(apply h,deltas)
94                    | Ein.Partial _ => e                    | Ein.Partial _ => e
95                    | Ein.Probe(e, id) => Ein.Probe(apply e, id)                    | Ein.Probe(e, id) => Ein.Probe(apply e, id)
96    

Legend:
Removed from v.2413  
changed lines
  Added in v.2414

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