Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/einTest/testOrder.sml
 [diderot] / branches / charisee / src / compiler / einTest / testOrder.sml

# Diff of /branches/charisee/src/compiler/einTest/testOrder.sml

revision 2408, Thu Aug 1 03:42:27 2013 UTC revision 2448, Tue Oct 1 00:57:08 2013 UTC
# Line 5  Line 5
5      structure EinOp = Operators      structure EinOp = Operators
6      structure P= Printer      structure P= Printer
7      structure O= OrderEin      structure O= OrderEin
structure N = NormalizeEin
8
9      in      in
10
11
12    val line="-----------------------------------------------"
13    fun testO(e)= (print line; P.printerE e ; print("     =>  "); P.printerE(O.orderfn e))
14
fun testO(rator, e)= print ""
15
16  (*(print" \n " ;print(P.printerE(e)); print("     =>  "); let val newbie=rator(e)  fun createO(b)= testO(Ein.EIN{params=[], index=[], body=b})
in print(P.printerE(newbie)); print(P.printerE(N.normalize(newbie))) end )
*)
fun createO(tester,b)= testO(tester, Ein.EIN{params=[], index=[], body=b})
17
18
19
20  val o2=createO(O.orderfn,E.Prod[E.Sum(1, E.Prod[E.Tensor(0,[1]), E.Tensor(1, [1])]),E.Sum(2, E.Prod[E.Epsilon(0,2,3), E.Tensor(2,[2]), E.Tensor(3, [3]) ])])  val o1=E.Prod[E.Sum([E.V 1], E.Prod[E.Tensor(0,[E.V 1]), E.Tensor(1, [E.V 1])]),
21                  E.Sum([E.V 2, E.V 3], E.Prod[E.Epsilon(0,2,3), E.Tensor(2,[E.V 2]), E.Tensor(3, [E.V 3])])]
22
23  val os7 =createO(O.orderfn,E.Apply(E.Partial([1]),E.Sum(2,E.Prod[E.Sum(2,E.Prod[E.Epsilon(2, 3, 4), E.Tensor(0, [3]), E.Tensor(1, [4])]) ,E.Epsilon(0,1,2)])))  val o2 =E.Apply(E.Partial([E.V 1]),E.Sum([E.V 1],E.Prod[E.Sum([E.V 3, E.V 4],E.Prod[E.Epsilon(2, 3, 4), E.Tensor(0, [E.V 3]), E.Tensor(1, [E.V 4])]) ,E.Epsilon(0,1,2)]))
24
25
26  (*S11(AxB) x (CxD)*)  (*S11(AxB) x (CxD)*)
27  val os11=createO(O.orderfn,E.Prod[E.Sum(2,E.Prod[E.Epsilon(0,1,2), E.Sum(2,E.Prod[E.Epsilon(1,3,4),E.Tensor(0,[3]), E.Tensor(1, [4])]), E.Sum(2, E.Prod[E.Epsilon(2,5,6), E.Tensor(2,[5]), E.Tensor(3, [6]) ])])])  val o3=E.Prod[E.Sum([E.V 1, E.V 2],
28        E.Prod[E.Epsilon(0,1,2),
29        E.Sum([E.V 3, E.V 4],E.Prod[E.Epsilon(1,3,4),E.Tensor(0,[E.V 3]), E.Tensor(1, [E.V 4])]),
30        E.Sum([E.V 5, E.V 6], E.Prod[E.Epsilon(2,5,6), E.Tensor(2,[E.V 5]), E.Tensor(3, [E.V 6]) ])]
31    )]
32
val eps= createO(O.orderfn,E.Prod[E.Epsilon(2,5,6),E.Epsilon(1,5,6),E.Epsilon(0,5,6)])
33
34    val o4=E.Prod[E.Epsilon(2,5,6),E.Delta(E.V 1,E.V 2),E.Epsilon(1,5,6),E.Tensor(0,[E.V 1]),E.Epsilon(0,5,6)]
35
36    val o5=E.Prod[E.Sum([E.V 5, E.V 6],E.Prod[E.Epsilon(2,5,6),E.Delta(E.V 1,E.V 2),E.Epsilon(1,5,6)]),E.Sum([E.V 1,E.V 2],E.Prod[E.Tensor(0,[E.V 1]),E.Epsilon(0,5,6)])]
37
38
39    val r=List.map createO [o1,o2,o3,o4,o5]
40
41
42
43

Legend:
 Removed from v.2408 changed lines Added in v.2448