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

SCM Repository

[diderot] Diff of /branches/ein16/synth/d2/symb/symb_fm2x2d3.diderot
ViewVC logotype

Diff of /branches/ein16/synth/d2/symb/symb_fm2x2d3.diderot

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

revision 4455, Wed Aug 24 23:39:30 2016 UTC revision 4456, Thu Aug 25 04:03:27 2016 UTC
# Line 65  Line 65 
65  vec3 orig = -(edge0*(sz0-1) + edge1*(sz1-1) + edge2*(sz2-1))/2 + offws;  vec3 orig = -(edge0*(sz0-1) + edge1*(sz1-1) + edge2*(sz2-1))/2 + offws;
66    
67  //-- field defined by coefficients --  //-- field defined by coefficients --
68  // z=1  input tensor[4] setA1_z0 =[0,0,0,0];
69  input vec2 base1_z0 = [0, 0];    // b*x, c*y  input tensor[4] setB1_z0 =[0,0,0,0];
70  input vec2 xsq1_z0 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC1_z0 =[0,0,0,0];
71  input vec2 ysq1_z0 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD1_z0 =[0,0,0,0];
72  input vec3 diag1_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
73  // z=z  input tensor[4] setA1_z1 =[0,0,0,0];
74  input vec2 base1_z1 = [0, 0];    // b*x, c*y  input tensor[4] setB1_z1 =[0,0,0,0];
75  input vec2 xsq1_z1 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC1_z1 =[0,0,0,0];
76  input vec2 ysq1_z1 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD1_z1 =[0,0,0,0];
77  input vec3 diag1_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
78  // z=z*z  input tensor[4] setA1_z2 =[0,0,0,0];
79  input vec2 base1_z2 = [0, 0];    // b*x, c*y  input tensor[4] setB1_z2 =[0,0,0,0];
80  input vec2 xsq1_z2 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setC1_z2 =[0,0,0,0];
81  input vec2 ysq1_z2 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setD1_z2 =[0,0,0,0];
82  input vec3 diag1_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  
83    
84  //-- field defined by coefficients --  input tensor[4] setA2_z0 =[0,0,0,0];
85  // z=1  input tensor[4] setB2_z0 =[0,0,0,0];
86  input vec2 base2_z0 = [0, 0];    // b*x, c*y  input tensor[4] setC2_z0 =[0,0,0,0];
87  input vec2 xsq2_z0 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setD2_z0 =[0,0,0,0];
88  input vec2 ysq2_z0 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setA2_z1 =[0,0,0,0];
89  input vec3 diag2_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setB2_z1 =[0,0,0,0];
90  // z=z  input tensor[4] setC2_z1 =[0,0,0,0];
91  input vec2 base2_z1 = [0, 0];    // b*x, c*y  input tensor[4] setD2_z1 =[0,0,0,0];
92  input vec2 xsq2_z1 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setA2_z2 =[0,0,0,0];
93  input vec2 ysq2_z1 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setB2_z2 =[0,0,0,0];
94  input vec3 diag2_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setC2_z2 =[0,0,0,0];
95  // z=z*z  input tensor[4] setD2_z2 =[0,0,0,0];
96  input vec2 base2_z2 = [0, 0];    // b*x, c*y  
97  input vec2 xsq2_z2 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setA3_z0 =[0,0,0,0];
98  input vec2 ysq2_z2 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setB3_z0 =[0,0,0,0];
99  input vec3 diag2_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setC3_z0 =[0,0,0,0];
100    input tensor[4] setD3_z0 =[0,0,0,0];
101  //-- field defined by coefficients --  input tensor[4] setA3_z1 =[0,0,0,0];
102  // z=1  input tensor[4] setB3_z1 =[0,0,0,0];
103  input vec2 base3_z0 = [0, 0];    // b*x, c*y  input tensor[4] setC3_z1 =[0,0,0,0];
104  input vec2 xsq3_z0 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setD3_z1 =[0,0,0,0];
105  input vec2 ysq3_z0 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setA3_z2 =[0,0,0,0];
106  input vec3 diag3_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setB3_z2 =[0,0,0,0];
107  // z=z  input tensor[4] setC3_z2 =[0,0,0,0];
108  input vec2 base3_z1 = [0, 0];    // b*x, c*y  input tensor[4] setD3_z2 =[0,0,0,0];
109  input vec2 xsq3_z1 = [0, 0];     // d*x^2, g*y*x^2  
110  input vec2 ysq3_z1 = [0, 0];     // f*y^2, h*x*y^2  
111  input vec3 diag3_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setA4_z0 =[0,0,0,0];
112  // z=z*z  input tensor[4] setB4_z0 =[0,0,0,0];
113  input vec2 base3_z2 = [0, 0];    // b*x, c*y  input tensor[4] setC4_z0 =[0,0,0,0];
114  input vec2 xsq3_z2 = [0, 0];     // d*x^2, g*y*x^2  input tensor[4] setD4_z0 =[0,0,0,0];
115  input vec2 ysq3_z2 = [0, 0];     // f*y^2, h*x*y^2  input tensor[4] setA4_z1 =[0,0,0,0];
116  input vec3 diag3_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2  input tensor[4] setB4_z1 =[0,0,0,0];
117    input tensor[4] setC4_z1 =[0,0,0,0];
118    input tensor[4] setD4_z1 =[0,0,0,0];
119    input tensor[4] setA4_z2 =[0,0,0,0];
120  //-- field defined by coefficients --  input tensor[4] setB4_z2 =[0,0,0,0];
121  // z=1  input tensor[4] setC4_z2 =[0,0,0,0];
122  input vec2 base4_z0 = [0, 0];    // b*x, c*y  input tensor[4] setD4_z2 =[0,0,0,0];
123  input vec2 xsq4_z0 = [0, 0];     // d*x^2, g*y*x^2  
124  input vec2 ysq4_z0 = [0, 0];     // f*y^2, h*x*y^2  function real cvt(real x, real y, real z, tensor[4] setA, tensor[4] setB, tensor[4] setC, tensor[4] setD) {
125  input vec3 diag4_z0 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2      real a = setA[0];
126  // z=z      real b = setA[1];
127  input vec2 base4_z1 = [0, 0];    // b*x, c*y      real c = setA[2];
128  input vec2 xsq4_z1 = [0, 0];     // d*x^2, g*y*x^2      real d = setA[3];
129  input vec2 ysq4_z1 = [0, 0];     // f*y^2, h*x*y^2      real e = setB[0];
130  input vec3 diag4_z1 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2      real f = setB[1];
131  // z=z*z      real g = setB[2];
132  input vec2 base4_z2 = [0, 0];    // b*x, c*y      real h = setB[3];
133  input vec2 xsq4_z2 = [0, 0];     // d*x^2, g*y*x^2      real i = setC[0];
134  input vec2 ysq4_z2 = [0, 0];     // f*y^2, h*x*y^2      real j = setC[1];
135  input vec3 diag4_z2 = [0, 0, 0];    // a, e*x*y,  i*y^2*x^2      real k = setC[2];
136  input int cat=0;      real l = setC[3];
137        real m = setD[0];
138        real n = setD[1];
139        real o = setD[2];
140  function real cvt(real x, real y, real z, vec2 base, vec2 xsq, vec2 ysq, vec3 diag){      real p = setD[3];
141      real b = base[0];  
142      real c = base[1];      // as intended to be represented
143      real d = xsq[0];      real tA = a + b*y + c*x*y+ d*x;
144      real g = xsq[1];      real tB = ((e+f*x+g*(x*x))*y*y) + (h*(x*x)*y);
145      real f = ysq[0];      real tC = i*(x*x) + (j+k*x+l*(x*x))*y*y*y;
146      real h = ysq[1];      real tD = (x*x*x)*((m*y*y*y)+(n*y*y)+(o*y)+p);
147      real a = diag[0];      return  z*(tA+tB+tC+tD);
     real e = diag[1];  
     real i = diag[2];  
     real t0 = b*x + c*y;  
     real t1 = d*x^2 + g*y*x^2;  
     real t2 = f*y^2 + h*x*y^2;  
     real t3 = a + e*x*y + i*(y^2)*(x^2);  
     return z*(t0+t1+t2+t3);  
148  }  }
149    
150    
# Line 160  Line 153 
153     real y = pos[1];     real y = pos[1];
154     real z = pos[2];     real z = pos[2];
155    
156        real axis1_z0 = cvt(x,y,1, setA1_z0, setB1_z0, setC1_z0, setD1_z0);
157      real axis1_z0 = cvt(x,y,1,base1_z0,xsq1_z0,ysq1_z0,diag1_z0);      real axis1_z1 = cvt(x,y,z, setA1_z1, setB1_z1, setC1_z1, setD1_z1);
158      real axis1_z1 = cvt(x,y,z,base1_z1,xsq1_z1,ysq1_z1,diag1_z1);      real axis1_z2 = cvt(x,y,z*z,setA1_z2, setB1_z2, setC1_z2, setD1_z2);
159      real axis1_z2 = cvt(x,y,z*z,base1_z2,xsq1_z2,ysq1_z2,diag1_z2);      real axis1= axis1_z0+axis1_z1+axis1_z2;
160      real axis1_val = axis1_z0+axis1_z1+axis1_z2;  
161      real axis2_z0 = cvt(x,y,1,base2_z0,xsq2_z0,ysq2_z0,diag2_z0);      real axis2_z0 = cvt(x,y,1, setA2_z0, setB2_z0, setC2_z0, setD2_z0);
162      real axis2_z1 = cvt(x,y,z,base2_z1,xsq2_z1,ysq2_z1,diag2_z1);      real axis2_z1 = cvt(x,y,z, setA2_z1, setB2_z1, setC2_z1, setD2_z1);
163      real axis2_z2 = cvt(x,y,z*z,base2_z2,xsq2_z2,ysq2_z2,diag2_z2);      real axis2_z2 = cvt(x,y,z*z,setA2_z2, setB2_z2, setC2_z2, setD2_z2);
164      real axis2_val = axis2_z0+axis2_z1+axis2_z2;      real axis2= axis2_z0+axis2_z1+axis2_z2;
165      real axis3_z0 = cvt(x,y,1,base3_z0,xsq3_z0,ysq3_z0,diag3_z0);  
166      real axis3_z1 = cvt(x,y,z,base3_z1,xsq3_z1,ysq3_z1,diag3_z1);      real axis3_z0 = cvt(x,y,1, setA3_z0, setB3_z0, setC3_z0, setD3_z0);
167      real axis3_z2 = cvt(x,y,z*z,base3_z2,xsq3_z2,ysq3_z2,diag3_z2);      real axis3_z1 = cvt(x,y,z, setA3_z1, setB3_z1, setC3_z1, setD3_z1);
168      real axis3_val = axis3_z0+axis3_z1+axis3_z2;      real axis3_z2 = cvt(x,y,z*z,setA3_z2, setB3_z2, setC3_z2, setD3_z2);
169      real axis4_z0 = cvt(x,y,1,base4_z0,xsq4_z0,ysq4_z0,diag4_z0);      real axis3= axis3_z0+axis3_z1+axis3_z2;
170      real axis4_z1 = cvt(x,y,z,base4_z1,xsq4_z1,ysq4_z1,diag4_z1);  
171      real axis4_z2 = cvt(x,y,z*z,base4_z2,xsq4_z2,ysq4_z2,diag4_z2);      real axis4_z0 = cvt(x,y,1, setA4_z0, setB4_z0, setC4_z0, setD4_z0);
172      real axis4_val = axis4_z0+axis4_z1+axis4_z2;      real axis4_z1 = cvt(x,y,z, setA4_z1, setB4_z1, setC4_z1, setD4_z1);
173      return [[axis1_val, axis2_val],[axis3_val, axis4_val]];      real axis4_z2 = cvt(x,y,z*z,setA4_z2, setB4_z2, setC4_z2, setD4_z2);
174        real axis4= axis4_z0+axis4_z1+axis4_z2;
175        return [[axis1, axis2], [axis3, axis4]];
176    
177  }  }
178    
# Line 185  Line 180 
180    
181    
182     output tensor [2, 2] out = [[0,0],[0,0]];     output tensor [2, 2] out = [[0,0],[0,0]];
   
183     update {     update {
184    
185    
# Line 215  Line 209 
209           print("byte skip: -1\n");           print("byte skip: -1\n");
210        }        }
211        out = func(orig + idx0*edge0 + idx1*edge1 + idx2*edge2);        out = func(orig + idx0*edge0 + idx1*edge1 + idx2*edge2);
   
212        stabilize;        stabilize;
213     }     }
214  }  }

Legend:
Removed from v.4455  
changed lines
  Added in v.4456

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