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

SCM Repository

[diderot] View of /trunk/test/bug-matrix.diderot
ViewVC logotype

View of /trunk/test/bug-matrix.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1115 - (download) (annotate)
Thu May 5 04:42:18 2011 UTC (8 years, 1 month ago) by jhr
File size: 1051 byte(s)
  More merging of pure-cfg back into trunk
/* 

If 3x3 matrix subtraction works, mip.txt will be:

0.928571 -0.142857 0.214286
-0.142857 0.714286 0.428571
0.214286 0.428571 0.357143
0.928571 -0.142857 0.214286
-0.142857 0.714286 0.428571
0.214286 0.428571 0.357143

That is, the same three lines, repeated twice.

*/

strand subtract (int bugvali) {
    output vec3 out = [0.0, 0.0, 0.0];
    int vali = bugvali;

    update {
       vec3 norm = normalize([1.0, 2.0, -3.0]);
       tensor[3,3] sub0 = identity[3] + (-1.0*norm⊗norm);
       tensor[3,3] sub1 = identity[3] - norm⊗norm;

       if (0 == vali) {
         out = sub0•[1.0, 0.0, 0.0];
       } else if (1 == vali) {
         out = sub0•[0.0, 1.0, 0.0];
       } else if (2 == vali) {
         out = sub0•[0.0, 0.0, 1.0];
       }
         else if (3 == vali) {
         out = sub1•[1.0, 0.0, 0.0];
       } else if (4 == vali) {
         out = sub1•[0.0, 1.0, 0.0];
       } else if (5 == vali) {
         out = sub1•[0.0, 0.0, 1.0];
       }

       stabilize;
    }
}

initially [ subtract(vali) | vali in 0..5 ];

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