comparison grid.mm @ 32:ab7c86d0f3d8

V0.3 SZBeta sent out. bristol tests.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 08 Mar 2013 14:54:55 +0000
parents ae4d2c3ce5e0
children 92dba082d957
comparison
equal deleted inserted replaced
31:23ef179c3748 32:ab7c86d0f3d8
69 ////////// gray code generation 69 ////////// gray code generation
70 ////// 70 //////
71 /// 71 ///
72 // TODO 5bit specific 72 // TODO 5bit specific
73 // transition sequence.... what a palaver! only need to do once though. 73 // transition sequence.... what a palaver! only need to do once though.
74
75 // max MRL
74 int trans[] = {0,1,2,3,0,4,2,1,0,3,2,1,0,4,2,3,0,1,2,3,0,4,2,1,0,3,2,1,0,4,2,3}; 76 int trans[] = {0,1,2,3,0,4,2,1,0,3,2,1,0,4,2,3,0,1,2,3,0,4,2,1,0,3,2,1,0,4,2,3};
75 77 // balanced
78 int transB[] = {1,2,3,4,5,1,5,2,3,5,2,4,2,3,4,1,4,3,2,3,1,5,3,4,1,5,2,5,3,4,1,3};
79 for(int i = 0; i<codeLength; i++){
80 transB[i] = transB[i] - 1;
81 }
76 82
77 int code[codeLength][paramsPerDim]; // start with normal array 83 int code[codeLength][paramsPerDim]; // start with normal array
78 84
79 85
80 86
81 for(int j=0; j<paramsPerDim; j++){ 87 for(int j=0; j<paramsPerDim; j++){
82 code[0][j] = 0; 88 code[0][j] = 0;
83 } 89 }
84 90
85 for(int i=0; i < codeLength-1; i++){ // TODO went off end?? 91 for(int i=0; i < codeLength-1; i++){ // don't need last 3
86 transSeq.push_back(trans[i]); // member vector 92 transSeq.push_back(trans[i]); // member vector
87 for(int j=0; j<paramsPerDim; j++){ 93 for(int j=0; j<paramsPerDim; j++){
88 94
89 if (j == abs(trans[i])){ 95 if (j == abs(trans[i])){
90 code[i+1][j] = !code[i][j]; 96 code[i+1][j] = !code[i][j];