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

SCM Repository

[diderot] Diff of /branches/femprime/src/compiler/ein/ein-pp.sml
ViewVC logotype

Diff of /branches/femprime/src/compiler/ein/ein-pp.sml

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

revision 5047, Wed Jul 12 22:46:18 2017 UTC revision 5048, Thu Jul 13 01:09:59 2017 UTC
# Line 34  Line 34 
34        | border E.Mirror =" Mirror"        | border E.Mirror =" Mirror"
35        | border E.Wrap = "Wrap"        | border E.Wrap = "Wrap"
36        | border E.None = raise Fail "unexpected"        | border E.None = raise Fail "unexpected"
37        fun deriv [] = ""
38          | deriv alpha = concat["∇",multiIndex2s alpha]
39      fun expToString e = (case e      fun expToString e = (case e
40             of E.Const r => i2s r             of E.Const r => i2s r
41              | E.ConstR r => Rational.toString r              | E.ConstR r => Rational.toString r
42              | E.Tensor(id, []) => "T" ^ i2s id              | E.Tensor(id, []) => "T" (*^ i2s id*)
43              | E.Tensor(id, alpha) => concat["T", i2s id, multiIndex2s alpha]              | E.Tensor(id, alpha) => concat["T", i2s id, multiIndex2s alpha]
44              | E.Zero(alpha) => concat["Z", multiIndex2s alpha]              | E.Zero(alpha) => concat["Z", multiIndex2s alpha]
45              | E.Delta ix => delta ix              | E.Delta ix => delta ix
# Line 113  Line 114 
114                  in                  in
115                    concat[f, "(", expToString e, ")"]                    concat[f, "(", expToString e, ")"]
116                  end                  end
117             | E.Op2(E.Sub, e1, e2) => concat ["(S", expToString e1, ") - (", expToString e2, ")"]             | E.Op2(E.Sub, e1, e2) => concat ["(", expToString e1, ") - (", expToString e2, ")"]
118             | E.Op2(E.Div, e1, e2) => concat ["(D", expToString e1, ") / ( ", expToString e2, ")"]             | E.Op2(E.Div, e1, e2) => concat ["(", expToString e1, ") / ( ", expToString e2, ")"]
119             | E.Opn(E.Add, el) => concat["(A", String.concatWithMap " + " expToString el,")"]             | E.Opn(E.Add, el) => concat["\n(", String.concatWithMap "\n + " expToString el,")"]
120             | E.Opn(E.Prod, el) => concat["(P", String.concatWithMap " * " expToString el, ")"]             | E.Opn(E.Prod, el) => concat["(", String.concatWithMap " * " expToString el, ")"]
121               | E.BigF  (id, alpha) => concat [deriv alpha, "ϝ"(*,i2s id*)]
122               | E.Basis (id, alpha) => concat [deriv alpha,"ϕ"(*,i2s id,*)]
123               | E.Inverse (e) => concat ["(", expToString e, ")","¯¹"]
124               | E.EvalFem [e1,e2] => concat [expToString e1,"[",expToString e2,"]" ]
125               | E.EvalFem [e1,e2,e3] =>  concat [expToString e1,"[",expToString e2,"[",expToString e3,"]","]" ]
126            (* end case *))            (* end case *))
127    
128      fun toString (Ein.EIN{params, index, body}) = let      fun toString (Ein.EIN{params, index, body}) = let

Legend:
Removed from v.5047  
changed lines
  Added in v.5048

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