Home My Page Projects Code Snippets Project Openings diderot

# SCM Repository

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

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

revision 2928, Wed Mar 4 01:39:07 2015 UTC revision 2929, Wed Mar 4 03:59:46 2015 UTC
# Line 286  Line 286
286              end              end
287      | innerFF _ = raise Fail "Wrong shape for innerProductField"      | innerFF _ = raise Fail "Wrong shape for innerProductField"
288
289
290           fun innerFT(shape1,dim,i::beta) = let
291            val alpha= List.take(shape1,length(shape1)-1)
292            val expindexA= specialize(alpha,0)
293            val expindexB= specialize(beta,(length(alpha)))
294            val sid=E.V(length(alpha)+ length(beta))
295            in E.EIN{
296            params = [E.FLD(dim),E.TEN(1,i::beta)],
297            index = alpha@beta,
298            body = E.Sum([(sid,0,i-1)],
299            E.Prod[
300                E.Field(0, expindexA@[sid]),   (* F_{\alpha i} *)
301                E.Lift(E.Tensor(1, [sid]@expindexB ))  (* F'_{i \beta} *)
302            ])}
303            end
304            | innerFT _ = raise Fail "Wrong shape for innerProductFieldTensor"
305
306
307            fun innerTF(shape1,dim,i::beta) = let
308            val alpha= List.take(shape1,length(shape1)-1)
309            val expindexA= specialize(alpha,0)
310            val expindexB= specialize(beta,(length(alpha)))
311            val sid=E.V(length(alpha)+ length(beta))
312            in E.EIN{
313                params = [E.TEN(1,shape1),E.FLD(dim)],index = alpha@beta,
314                body = E.Sum([(sid,0,i-1)],
315                    E.Prod[E.Lift(E.Tensor(0, expindexA@[sid])),   (* F_{\alpha i} *)
316                           E.Field(1, [sid]@expindexB )  (* F'_{i \beta} *)
317                    ])}
318            end
319            | innerTF _ = raise Fail "Wrong shape for innerProductTensorField"
320
321
322
323      (*************************** colon product **********************************)      (*************************** colon product **********************************)
324      (*<T_{\alpha i j} * B{i j \beta }>_\alpha \beta*)      (*<T_{\alpha i j} * B{i j \beta }>_\alpha \beta*)
325      fun colonTT(shape1,i::j::beta) = let      fun colonTT(shape1,i::j::beta) = let

Legend:
 Removed from v.2928 changed lines Added in v.2929