|
19 | 19 | //------------------------------------- |
20 | 20 | int main(int argc, char *argv[]) |
21 | 21 | { |
22 | | - printf("This is opseq.exe by Daniel J. Greenhoe \n"); |
23 | | - //printf(" for support of version 0.50 (2016 July 04 Monday) of the text \n"); |
24 | | - //printf(" \"A book concerning symbolic sequence processing\" \n"); |
25 | | - //printf(" by Daniel J. Greenhoe \n"); |
26 | | - |
27 | | - //bspline_Sdat(); |
28 | | - testing::InitGoogleTest(&argc, argv); |
29 | | - return RUN_ALL_TESTS(); |
| 22 | + const int N = 8; |
| 23 | + const int M = 2*N-1; |
| 24 | + const int p = 3; |
| 25 | + const double x[p][N] = { -1, -1, 2, 3, 0, -1, -1, -1, |
| 26 | + -1, -1, -1, -1, -1, 2, 3, 0, |
| 27 | + -1, 2, 3, 0, -1, -1, -1, -1 }; |
| 28 | + const double y[p][N] = { -1, -1, 2, 3, 0, -1, -1, -1, |
| 29 | + -1, -1, -1, -1, -1, 2, 3, 0, |
| 30 | + -1, 2, 3, 0, -1, -1, -1, -1 }; |
| 31 | + const double z[p][N] = { -1, -1, -1, 2, 3, 0, -1, -1, |
| 32 | + 0, -1, -1, -1, -1, -1, 2, 3, |
| 33 | + -1, -1, 2, 3, 0, -1, -1, -1 }; |
| 34 | + double xval; |
| 35 | + double Rxy[p][M]; |
| 36 | + int row, col, index, m, m1, m2, m3, n1, n2, n3; |
| 37 | + |
| 38 | + printf("\nsequence x:"); |
| 39 | + for(row=0; row<p; row++) { |
| 40 | + printf("\n"); |
| 41 | + for(col=0; col<N; col++){ |
| 42 | + printf("%2.0lf ",x[row][col]); |
| 43 | + }} |
| 44 | + |
| 45 | + printf("\nsequence y:"); |
| 46 | + for(row=0; row<p; row++) { |
| 47 | + printf("\n"); |
| 48 | + for(col=0; col<N; col++){ |
| 49 | + printf("%2.0lf ",y[row][col]); |
| 50 | + }} |
| 51 | + |
| 52 | + for(row=0; row<p; row++){ |
| 53 | + for(col=0; col<M; col++){ |
| 54 | + Rxy[row][col] = 0; |
| 55 | + }} |
| 56 | + |
| 57 | + for(m=0; m<M; m++){ |
| 58 | + for(n1=0; n1<N; n1++) { |
| 59 | + for(n2=0; n2<N; n2++) { |
| 60 | + for(n3=0; n3<N; n3++) { |
| 61 | + index = m+n1-N; |
| 62 | + if(index<0) xval = 0; |
| 63 | + else if(index>(N-1)) xval = 0; |
| 64 | + else xval = x[0][index]; |
| 65 | + Rxy[0][m] += xval * y[0][n1]; /* dimension-1 */ |
| 66 | + |
| 67 | + index = m+n2-N; |
| 68 | + if(index<0) xval = 0; |
| 69 | + else if(index>(N-1)) xval = 0; |
| 70 | + else xval = x[0][index]; |
| 71 | + Rxy[1][m] += xval *y[1][n2]; /* dimension-2 */ |
| 72 | + |
| 73 | + index = m+n3-N; |
| 74 | + if(index<0) xval = 0; |
| 75 | + else if(index>(N-1)) xval = 0; |
| 76 | + else xval = x[0][index]; |
| 77 | + Rxy[2][m] += xval *y[2][n3]; /* dimension-3 */ |
| 78 | + }}}} |
| 79 | + |
| 80 | + printf("\nestimated Rxy:"); |
| 81 | + for(row=0; row<p; row++) { |
| 82 | + printf("\n"); |
| 83 | + for(col=0; col<M; col++){ |
| 84 | + printf("%5.0lf ",Rxy[row][col]); |
| 85 | + }} |
30 | 86 | } |
31 | 87 |
|
| 88 | +//int main(int argc, char *argv[]) |
| 89 | +//{ |
| 90 | +// printf("This is opseq.exe by Daniel J. Greenhoe \n"); |
| 91 | +// //printf(" for support of version 0.50 (2016 July 04 Monday) of the text \n"); |
| 92 | +// //printf(" \"A book concerning symbolic sequence processing\" \n"); |
| 93 | +// //printf(" by Daniel J. Greenhoe \n"); |
| 94 | +// |
| 95 | +// //bspline_Sdat(); |
| 96 | +// testing::InitGoogleTest(&argc, argv); |
| 97 | +// return RUN_ALL_TESTS(); |
| 98 | +//} |
| 99 | + |
0 commit comments