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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2449 - (view) (download)

1 : cchiw 2399 (*Test transform function*)
2 :     structure tNormalize = struct
3 :    
4 :     local
5 :     structure E = Ein
6 :     structure P= Printer
7 :     structure N = NormalizeEin
8 : cchiw 2449 (* structure ExN =ExamplesN*)
9 : cchiw 2399 in
10 :    
11 :    
12 :    
13 : cchiw 2449 fun test(e)= (print"------------------ " ; P.printerE(e); let val n=N.normalize(e) in (*P.printerE*) n end ;print" \n ------------------------")
14 : cchiw 2399
15 :    
16 : cchiw 2437 fun create(b)= E.EIN{params=[], index=[], body=b}
17 : cchiw 2399
18 :    
19 :     (*-----Test more complicated terms in Normalize Function:normalize.sml---------------*)
20 : cchiw 2449 val R10=(E.Sum([E.V 0, E.V 1, E.V 2, E.V 3, E.V 4],E.Prod[E.Epsilon(0,1,2),E.Epsilon(0,3,4),E.Tensor(0,[E.V 3]), E.Tensor(1,[E.V 4]),E.Tensor(2,[E.V 1]), E.Tensor(3,[E.V 2]) ]))
21 : cchiw 2399
22 : cchiw 2449 val R10b=(E.Sum([E.V 9, E.V 8, E.V 0, E.V 1, E.V 2, E.V 3, E.V 4],E.Prod[E.Epsilon(9,8,7),E.Epsilon(0,1,2),E.Epsilon(0,3,4),E.Tensor(0,[E.V 3]), E.Tensor(1,[E.V 4]),E.Tensor(2,[E.V 1]), E.Tensor(3,[E.V 2]) ]))
23 :    
24 :     val R10c=(E.Sum([E.V 0, E.V 1, E.V 2, E.V 3, E.V 4],E.Prod[E.Epsilon(0,1,2),E.Epsilon(8,9,11),E.Epsilon(0,3,4),E.Tensor(0,[E.V 3]), E.Tensor(1,[E.V 4]),E.Tensor(2,[E.V 1]), E.Tensor(3,[E.V 2]) ]))
25 :    
26 :     val R10d=(E.Sum([E.V 0, E.V 1, E.V 2, E.V 3, E.V 4],E.Prod[E.Epsilon(0,1,2),E.Epsilon(8,9,11),E.Epsilon(0,3,4),E.Tensor(0,[E.V 3]),E.Prod[E.Tensor(1,[E.V 4]),E.Add[E.Tensor(2,[E.V 1]), E.Tensor(3,[E.V 2]) ]] ] ))
27 :    
28 :    
29 : cchiw 2437 fun run set=
30 :     let
31 :     val base=[]
32 : cchiw 2406
33 : cchiw 2449 val r0=List.map create[R10,R10b, R10c,R10d]
34 :     (* val r1= List.map create [ExN.R1,ExN.R2,ExN.R3, ExN.R4,ExN.R5,ExN.R7, ExN.R8, ExN.R9]
35 : cchiw 2437 (*Test R5 change eps to delts*)
36 :     val r2= List.map create [ExN.R10, ExN.R10b,ExN.R10c,ExN.R10d, ExN.R10e, ExN.R10f]
37 :     (*dels*)
38 :     val r3=List.map create [ExN.R11, ExN.R11b, ExN.R11c, ExN.R11d, ExN.R11e, ExN.R11f, ExN.R11g, ExN.R11h, ExN.R11i, ExN.R11j, ExN.R11k ,ExN.R11l, ExN.R11m, ExN.R11n, ExN.R11o ,ExN.R11p, ExN.R11q, ExN.R11r]
39 :     val r4=List.map create [ExN.sR12,ExN.sR13,ExN.sR14, ExN.sR14b, ExN.sR14c]
40 : cchiw 2399
41 : cchiw 2437 val s1= [ExN.dotGrad, ExN.dotCross,ExN.crossGrad,ExN.curlCurl]
42 :     val s2=[ ExN.S6, ExN.S7]
43 : cchiw 2449 val s3=[ExN.S8,ExN.S9, ExN.S10,ExN.S11, ExN.S12]*)
44 : cchiw 2399
45 : cchiw 2437 in
46 : cchiw 2449 List.map test r0
47 :     (* if(set=0) then List.map test base
48 : cchiw 2437 else if(set=1) then List.map test r1
49 :     else if(set=2) then List.map test r2
50 :     else if(set=3) then List.map test r3
51 :     else if(set=4) then List.map test r4
52 : cchiw 2399
53 : cchiw 2437 else if(set=5) then List.map test s1
54 :     else if(set=6) then List.map test s2
55 :     else if(set=7) then List.map test s3
56 : cchiw 2449 else List.map test base*)
57 : cchiw 2437 end
58 : cchiw 2399
59 : cchiw 2449 val r=run 2
60 : cchiw 2399
61 : cchiw 2437
62 :    
63 :    
64 :    
65 :    
66 : cchiw 2399 end; (* local *)
67 :    
68 :     end (* local *)

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