Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Diff of /branches/staging/src/include/Diderot/inline-tensor3.h
ViewVC logotype

Diff of /branches/staging/src/include/Diderot/inline-tensor3.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1943, Thu Jul 5 16:29:06 2012 UTC revision 1944, Thu Jul 5 17:19:46 2012 UTC
# Line 63  Line 63 
63      return SQRT(sumSq);      return SQRT(sumSq);
64  }  }
65    
66    // tensor times matrix ":" product
67    STATIC_INLINE Diderot_vec2_t ddotTen2x2x2Mat2x2 (Diderot_Ten2x2x2_t T, Diderot_Mat2x2_t m)
68    {
69        return vec2(
70            dot2(T[0][0].v, m[0].v) + dot2(T[0][1].v, m[1].v),
71            dot2(T[1][0].v, m[0].v) + dot2(T[1][1].v, m[1].v));
72    }
73    
74    // matrix times tensor ":" product
75    STATIC_INLINE Diderot_vec2_t ddotMat2x2Ten2x2x2 (Diderot_Mat2x2_t m, Diderot_Ten2x2x2_t T)
76    {
77        return vec2(
78            m[0].r[0]*T[0][0].r[0] + m[1].r[1]*T[1][1].r[0],
79            m[0].r[0]*T[0][0].r[1] + m[1].r[1]*T[1][1].r[1]);
80    }
81    
82    // tensor times tensor ":" product
83    STATIC_INLINE void ddotTen2x2x2Ten2x2x2 (Diderot_Mat2x2_t dst, Diderot_Ten2x2x2_t T1, Diderot_Ten2x2x2_t T2)
84    {
85        dst[0].v = vec2(
86            T1[0][0].r[0]*T2[0][0].r[0] + T1[0][1].r[1]*T2[1][1].r[0],
87            T1[0][0].r[0]*T2[0][0].r[1] + T1[0][1].r[1]*T2[1][1].r[1]);
88        dst[1].v = vec2(
89            T1[1][0].r[0]*T2[0][0].r[0] + T1[1][1].r[1]*T2[1][1].r[0],
90            T1[1][0].r[0]*T2[0][0].r[1] + T1[1][1].r[1]*T2[1][1].r[1]);
91    }
92    
93  /********** 3x3x3 tensor functions **********/  /********** 3x3x3 tensor functions **********/
94    
95  STATIC_INLINE void copyTen3x3x3 (Diderot_Ten3x3x3_t dst, Diderot_Ten3x3x3_t src)  STATIC_INLINE void copyTen3x3x3 (Diderot_Ten3x3x3_t dst, Diderot_Ten3x3x3_t src)

Legend:
Removed from v.1943  
changed lines
  Added in v.1944

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