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 2869, Thu Feb 12 16:14:22 2015 UTC revision 2870, Wed Feb 25 21:47:43 2015 UTC
# Line 554  Line 554 
554              }              }
555          end          end
556    
557            fun normalizeFldVec(dim,[]) =raise Fail"normalize of a scalar"
558              | normalizeFldVec(dim,[i]) = let
559                val sx=[(E.V 0,0,i-1)]
560                val f=E.Field(0, [E.V 0])
561                in E.EIN{
562                    params = [E.FLD(dim) ,E.FLD(dim)],
563                    index = [dim],
564                    body = E.Prod[f,
565                        E.Div(E.Const 1,
566                            E.Sqrt(E.Sum(sx, E.Prod[f,f]))
567                        )]
568                }
569                end
570    
571    
572            fun sqrt dim=
573                E.EIN{
574                    params = [E.FLD(dim)],
575                    index = [],
576                    body = E.Sqrt(E.Field(0, []))
577                }
578    
579    
580    
581    end; (* local *)    end; (* local *)
582    

Legend:
Removed from v.2869  
changed lines
  Added in v.2870

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