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

SCM Repository

[diderot] View of /branches/charisee/test/t1.diderot
ViewVC logotype

View of /branches/charisee/test/t1.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2504 - (download) (annotate)
Mon Nov 4 22:12:04 2013 UTC (5 years, 9 months ago) by cchiw
File size: 1019 byte(s)
 divide field
// 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]];

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


//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;

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



tensor[4,4] I=identity[4];

strand tensorTest (int row)
{


    update
    {  /* tensor[3,4] p= h+h;*/}
}

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

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