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 2501, Mon Nov 4 17:23:39 2013 UTC revision 2502, Mon Nov 4 21:33:35 2013 UTC
# Line 28  Line 28 
28              }              }
29          end          end
30    
31        fun createVec(dim)=E.EIN{
32            params = [E.TEN], index = [dim],
33            body = E.Tensor(0, [E.V 0])
34            }
35    
36    
37    
38            (* just to test normalize
39        fun addTen(alpha)=let
40        val (index', expindex')= specialize(alpha,0)
41            in
42            E.EIN{
43            params = [E.TEN, E.TEN], index = index',
44            body = E.Add[E.Sum([(E.V 0,0,3)],E.Prod[E.Delta(E.V 1, E.V 0),E.Field(0, expindex')]),E.Add[E.Const 0.0, E.Tensor(1, expindex')]]
45            }
46            end
47           *)
48    
49       (* Subtracting tensors *)       (* Subtracting tensors *)
50       fun subTen(alpha)=let       fun subTen(alpha)=let
51          val (index', expindex')= specialize(alpha,0)          val (index', expindex')= specialize(alpha,0)
# Line 144  Line 162 
162      }      }
163    
164      (* Identiy: <\delta_{i j}>_{i j}  *)      (* Identiy: <\delta_{i j}>_{i j}  *)
165      fun identity([i,j]) =E.EIN{      fun identity(dim) =E.EIN{
166          params = [],          params = [],
167          index = [i,j],          index = [dim,dim],
168          body = E.Delta(E.V(0), E.V(1))          body = E.Delta(E.V(0), E.V(1))
169      }      }
170    
# Line 301  Line 319 
319          body = E.Prod[ E.Tensor(0, []), E.Tensor(1, [])]          body = E.Prod[ E.Tensor(0, []), E.Tensor(1, [])]
320      }      }
321    
322        (*Transform M_ij x_j+T*)
323        fun transform(i, j) = E.EIN{
324            params = [E.TEN, E.TEN, E.TEN],
325            index = [i],
326            body = E.Add
327                [E.Sum([(E.V 1, 1,j)],E.Prod[E.Tensor(0, [E.V 0, E.V 1]), E.Tensor(1, [E.V 1])]),
328                  E.Tensor(1,[E.V 0])]
329            }
330    
331    
332    end; (* local *)    end; (* local *)

Legend:
Removed from v.2501  
changed lines
  Added in v.2502

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