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 2975, Fri Mar 6 16:31:31 2015 UTC revision 2976, Fri Mar 6 16:37:08 2015 UTC
# Line 371  Line 371 
371    
372      fun magnitudeFF(dim,[]) =      fun magnitudeFF(dim,[]) =
373          E.EIN{params = [E.FLD(dim)],index = [],body =  E.Field(0, [])}          E.EIN{params = [E.FLD(dim)],index = [],body =  E.Field(0, [])}
374        | magnitudeFF(dim,shape1 as i::beta) = let         | magnitudeFF(dim,[i]) =
         val alpha= List.take(shape1,(length(shape1))-1)  
         val alphan=length(alpha)  
         val betan=length(beta)  
         val expindexA= specialize(alpha,0)  
         val expindexB= specialize(beta,alphan)  
         val sid=E.V(alphan+ betan)  
         in  
375              E.EIN{              E.EIN{
376                  params = [E.FLD(dim) ,E.FLD(dim)],                  params = [E.FLD(dim) ,E.FLD(dim)],
377                  index = alpha@beta,                  index = [],
378                  body = E.Sqrt(E.Sum([(sid,0,i-1)], E.Prod[                  body = E.Sqrt(E.Sum([(E.V 0,0,i-1)],
379                      E.Field(0, expindexA@[sid]),                      E.Prod[E.Field(0, [E.V 0]),E.Field(1, [E.V 0])]
380                      E.Field(1, [sid]@expindexB )                      ))
381                      ]))              }
382            | magnitudeFF(dim,[i,j]) =
383                E.EIN{
384                    params = [E.FLD(dim) ,E.FLD(dim)],
385                    index = [],
386                    body = E.Sqrt(E.Sum([(E.V 0,0,i-1),(E.V 1,0,j-1)],
387                        E.Prod[ E.Field(0, [E.V 0,E.V 1]), E.Field(1, [E.V 0,E.V 1])]
388                        ))
389              }              }
          end  
390    
391      fun normalizeFF(dim,[i]) = let      fun normalizeFF(dim,[i]) = let
392          val sx=[(E.V 0,0,i-1)]          val sx=[(E.V 0,0,i-1)]

Legend:
Removed from v.2975  
changed lines
  Added in v.2976

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