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

SCM Repository

[diderot] Diff of /branches/vis12/src/compiler/mid-il/check-mid-il.sml
ViewVC logotype

Diff of /branches/vis12/src/compiler/mid-il/check-mid-il.sml

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

revision 1955, Sun Jul 8 09:13:35 2012 UTC revision 1956, Sun Jul 8 12:17:56 2012 UTC
# Line 49  Line 49 
49              | Op.MulMatMat(d1, d2, d3) => (Ty.TensorTy[d1, d3], [Ty.TensorTy[d1, d2], Ty.TensorTy[d2, d3]])              | Op.MulMatMat(d1, d2, d3) => (Ty.TensorTy[d1, d3], [Ty.TensorTy[d1, d2], Ty.TensorTy[d2, d3]])
50              | Op.MulVecTen3(d1, d2, d3) => (Ty.TensorTy[d2, d3], [Ty.vecTy d1, Ty.TensorTy[d1, d2, d3]])              | Op.MulVecTen3(d1, d2, d3) => (Ty.TensorTy[d2, d3], [Ty.vecTy d1, Ty.TensorTy[d1, d2, d3]])
51              | Op.MulTen3Vec(d1, d2, d3) => (Ty.TensorTy[d1, d2], [Ty.TensorTy[d1, d2, d3], Ty.vecTy d3])              | Op.MulTen3Vec(d1, d2, d3) => (Ty.TensorTy[d1, d2], [Ty.TensorTy[d1, d2, d3], Ty.vecTy d3])
52                | Op.ColonMul(ty1 as Ty.TensorTy dd1, ty2 as Ty.TensorTy(d21::d22::dd2)) => let
53                    fun last2 ([d1, d2], prefix) = (prefix, d1, d2)
54                      | last2 (d::dd, prefix) = last2(dd, d::prefix)
55                      | last2 _ = raise Fail("sigOf: invalid operator " ^ Op.toString rator)
56                    val (prefix, d11, d12) = last2 (dd1, [])
57                    in
58                      if (d11 <> d21) orelse (d12 <> d22)
59                        then raise Fail("sigOf: invalid operator " ^ Op.toString rator)
60                        else (Ty.TensorTy(List.revAppend(prefix, dd2)), [ty1, ty2])
61                    end
62              | Op.Cross => (vec3Ty, [vec3Ty, vec3Ty])              | Op.Cross => (vec3Ty, [vec3Ty, vec3Ty])
63              | Op.Norm(ty as Ty.TensorTy _) => (Ty.realTy, [ty])              | Op.Norm(ty as Ty.TensorTy _) => (Ty.realTy, [ty])
64              | Op.Normalize d => (Ty.vecTy d, [Ty.vecTy d])              | Op.Normalize d => (Ty.vecTy d, [Ty.vecTy d])

Legend:
Removed from v.1955  
changed lines
  Added in v.1956

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