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 2845, Fri Dec 12 06:46:23 2014 UTC revision 2847, Mon Dec 15 02:17:32 2014 UTC
# Line 439  Line 439 
439      | innerProductField _ = raise Fail "Wrong shape for innerProductField"      | innerProductField _ = raise Fail "Wrong shape for innerProductField"
440    
441      (*Field Cross Product*)      (*Field Cross Product*)
442      val crossProductField = E.EIN{      val crossProductField2d = E.EIN{
443                params = [E.FLD(2), E.FLD(2)],
444                index= [],
445                body=E.Sum([(E. V 0,0,2),(E.V 1,0,1)],
446                E.Prod[ E.Eps2(0, 1), E.Field(0, [E.V 0]),  E.Field(1, [E.V 1]) ])
447             }
448    
449            (*Field Cross Product*)
450        val crossProductField3d = E.EIN{
451              params = [E.FLD(3), E.FLD(3)],              params = [E.FLD(3), E.FLD(3)],
452              index= [3],              index= [3],
453              body=E.Sum([(E. V 1,0,2),(E.V 2,0,2)],              body=E.Sum([(E. V 1,0,2),(E.V 2,0,2)],
# Line 482  Line 490 
490      | doubleDotField _ = raise Fail "Wrong shape for double dot "      | doubleDotField _ = raise Fail "Wrong shape for double dot "
491    
492    
493        fun slice (argTy,mask,const,rstTy) =let
494            fun iter ([],_,cnt)=[]
495              |iter(true::es,c::cs,cnt)=[E.C c]@iter(es,cs,cnt)
496              |iter(false::es,cs,cnt)=[E.V cnt]@iter(es,cs,cnt+1)
497            val ix=iter(mask,const,0)
498            in
499                E.EIN{
500                    params = [E.TEN(1,argTy)],
501                    index = rstTy,
502                    body = E.Tensor(0, ix)
503                }
504            end
505    
506    
507    end; (* local *)    end; (* local *)
508    
509      end (* local *)      end (* local *)

Legend:
Removed from v.2845  
changed lines
  Added in v.2847

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