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

SCM Repository

[diderot] Diff of /branches/charisee/src/compiler/ein/mkoperators.sml
ViewVC logotype

Diff of /branches/charisee/src/compiler/ein/mkoperators.sml

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

revision 2604, Fri Apr 25 18:23:44 2014 UTC revision 2605, Wed Apr 30 01:46:09 2014 UTC
# Line 102  Line 102 
102                  ])                  ])
103          }          }
104          end          end
105            | innerProduct _ = raise Fail "Wrong shape for inner product"
106    
107      (*<T_{\alpha i j} * B{i j \beta }>_\alpha \beta*)      (*<T_{\alpha i j} * B{i j \beta }>_\alpha \beta*)
108      fun doubleDot(shape1,i::j::beta) = let      fun doubleDot(shape1,i::j::beta) = let
# Line 120  Line 121 
121                  ])                  ])
122          }          }
123          end          end
124            | doubleDot _ = raise Fail "Wrong shape for double dot "
125    
126      (*Vector Examples : <T_i * T_j>_ij..t0⊗t1*)      (*Vector Examples : <T_i * T_j>_ij..t0⊗t1*)
127      fun outerProduct(dimA,dimB) =E.EIN{      fun outerProduct(dimA,dimB) =E.EIN{
# Line 133  Line 135 
135          params = [E.TEN(1,[i,j])], index= [j,i],          params = [E.TEN(1,[i,j])], index= [j,i],
136          body= E.Tensor(0, [E.V 1,E.V 0])          body= E.Tensor(0, [E.V 1,E.V 0])
137        }        }
138            | transpose _= raise Fail "too many indices for transpose"
139    
140    
141      fun modulate(dim) =E.EIN{      fun modulate(dim) =E.EIN{
# Line 224  Line 227 
227          end          end
228    
229      (*< d F /  d_i>_i  *)      (*< d F /  d_i>_i  *)
230          fun grad(a::alpha)=let          fun grad(alpha)=let
231          val (index', expindex')= specialize(a::alpha,0)          val a=List.hd(alpha)
232    
233            val (index', expindex')= specialize(alpha,0)
234          in E.EIN{          in E.EIN{
235              params = [E.FLD(a)],              params = [E.FLD(a)],
236              index =index',              index =index',
# Line 405  Line 410 
410                      E.Field(1, [s']@expindexB )  (* F'_{i \beta} *)                      E.Field(1, [s']@expindexB )  (* F'_{i \beta} *)
411                  ])}                  ])}
412              end              end
413             | innerProductField _ = raise Fail "Wrong shape for innerProductField"
414    
415      (*Field Cross Product*)      (*Field Cross Product*)
416           val crossProductField = E.EIN{           val crossProductField = E.EIN{

Legend:
Removed from v.2604  
changed lines
  Added in v.2605

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