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

SCM Repository

[diderot] Annotation of /branches/charisee/src/compiler/einTest/testOrder.sml
ViewVC logotype

Annotation of /branches/charisee/src/compiler/einTest/testOrder.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2502 - (view) (download)

1 : cchiw 2399 structure tOrder = struct
2 :    
3 :     local
4 :     structure E = Ein
5 :     structure P= Printer
6 :     structure O= OrderEin
7 : cchiw 2463 structure N = NormalizeEin
8 : cchiw 2399 in
9 :    
10 :    
11 : cchiw 2448 val line="-----------------------------------------------"
12 : cchiw 2496 fun testO(e)= (
13 : cchiw 2499 print line; print (P.printerE e ); print(" => "); let val u=(O.orderfn e)
14 : cchiw 2502 in (print(P.printerE(u));print(" => "); let val (u2,c)=N.normalize(u) in print(P.printerE(u2)) end ) end
15 : cchiw 2496 )
16 : cchiw 2399
17 : cchiw 2408
18 : cchiw 2448 fun createO(b)= testO(Ein.EIN{params=[], index=[], body=b})
19 : cchiw 2399
20 :    
21 :    
22 : cchiw 2499 val o1=E.Prod[E.Sum([(E.V 1,0,3)], E.Prod[E.Tensor(0,[E.V 1]), E.Tensor(1, [E.V 1])]),
23 :     E.Sum([(E.V 2,0,3), (E.V 3,0,3)], E.Prod[E.Epsilon(0,2,3), E.Tensor(2,[E.V 2]), E.Tensor(3, [E.V 3])])]
24 : cchiw 2399
25 : cchiw 2499 val o2 =E.Apply(E.Partial([E.V 1]),E.Sum([(E.V 1,0,3)],E.Prod[E.Sum([(E.V 3,0,3),( E.V 4,0,3)],E.Prod[E.Epsilon(2, 3, 4), E.Tensor(0, [E.V 3]), E.Tensor(1, [E.V 4])]) ,E.Epsilon(0,1,2)]))
26 : cchiw 2399
27 :    
28 :     (*S11(AxB) x (CxD)*)
29 : cchiw 2499 val o3=E.Prod[E.Sum([(E.V 1,0,3), (E.V 2,0,3)],
30 : cchiw 2448 E.Prod[E.Epsilon(0,1,2),
31 : cchiw 2499 E.Sum([(E.V 3,0,3), (E.V 4,0,3)],E.Prod[E.Epsilon(1,3,4),E.Tensor(0,[E.V 3]), E.Tensor(1, [E.V 4])]),
32 :     E.Sum([(E.V 5,0,3), (E.V 6,0,3)], E.Prod[E.Epsilon(2,5,6), E.Tensor(2,[E.V 5]), E.Tensor(3, [E.V 6]) ])]
33 : cchiw 2448 )]
34 : cchiw 2399
35 :    
36 : cchiw 2448 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)]
37 : cchiw 2399
38 : cchiw 2499 val o5=E.Prod[E.Sum([(E.V 5,0,3), (E.V 6,0,3)],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,0,3), (E.V 2,0,3)],E.Prod[E.Tensor(0,[E.V 1]),E.Epsilon(0,5,6)])]
39 : cchiw 2399
40 :    
41 : cchiw 2496 val o6=E.Prod[
42 : cchiw 2499 E.Sum([(E.V 5,0,3), (E.V 6,0,3)],
43 : cchiw 2496 E.Prod[E.Epsilon(2,0,3),E.Delta(E.V 1,E.V 2),E.Epsilon(1,5,6),E.Tensor(1,[E.V 0])]),
44 : cchiw 2499 E.Sum([(E.V 1,0,3), (E.V 2,0,3)],
45 : cchiw 2496 E.Prod[E.Tensor(0,[E.V 1]),E.Value(1), E.Tensor(1,[]),E.Epsilon(0,5,6)])]
46 : cchiw 2399
47 :    
48 : cchiw 2499 (*
49 :     val r=List.map createO [o1,o2,o3,o4,o5,o6]
50 : cchiw 2496 *)
51 : cchiw 2463
52 :    
53 : cchiw 2496
54 : cchiw 2399 end; (* local *)
55 :    
56 :     end (* local *)

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