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

SCM Repository

[diderot] View of /branches/charisee/test/E-tensor.diderot
ViewVC logotype

View of /branches/charisee/test/E-tensor.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2603 - (download) (annotate)
Thu Apr 24 03:58:37 2014 UTC (7 years, 3 months ago) by cchiw
File size: 1022 byte(s)
Added Lift Constructor
// t1-test translate

vec3 t0 = [0.0, 0.0, 5.0];
vec3 t1 = [0.0, 1.0, 0.0];
vec3 t2 = [1.0, 0.0, 0.0];
vec4 t3 = [1.0, 0.0, 0.0,7.8];

tensor[3,4] h = [[2.0,0.0,0.0,3.0],   // analytic hessian
                [0.0,2.0,0.0,1.0],
                [0.0,0.0,2.0,8.9]];

tensor[4,4] M = [[2.0,0.0,0.0,3.0],[0.0,2.0,0.0,1.0],
                [0.0,0.0,2.0,8.9],[0.0,0.0,2.0,8.9]];

//scalars
real addScalar=4+7;
real subScalar=9 - 9;
real divScalar=14/2;
real prodScalar=9*2;



//simple tensor operations
vec3 addTen= t0 + t1;
vec3 subTen= t0 - t1;
vec3 divTen=t1/2;
real r=trace(M);
tensor[3,4] negTen= -h ; 
tensor[4,4] I=identity[4];



//inner product
real s2=t0•t1;
vec4 t4=t1•h;
vec3 t5=h•t3;
tensor[3,4] t6=h•M;

//double dot
real s3=h:h;


tensor[4,3] hT= transpose(h);
vec3 t7= modulate(t0,t1);
vec3 t8=t0 × t1;
tensor [3,3] t9=t0⊗t1;
tensor [3,4] t10=t0⊗t3;


vec3 Q1=t0 × t1;
vec3 Q3=Q1 × Q1;



strand tensorTest (int row)
{
vec3 Q6=Q3;


    update
    {  }
}

initially [ tensorTest(r) | r in 0..1];

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