Skip to content

Commit 8e9f5a4

Browse files
author
Daniel J. Greenhoe
committed
archive
1 parent d3265ed commit 8e9f5a4

File tree

2 files changed

+79
-11
lines changed

2 files changed

+79
-11
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#--------------------------------------
2020
# Project
2121
#--------------------------------------
22-
project( opseq
22+
project( ssp
2323
VERSION 0
2424
DESCRIPTION "Symbolic Sequence Processing"
2525
#HOMEPAGE https://github.com/dgreenhoe/
@@ -49,13 +49,13 @@
4949
set( FLAGS_COMPILE
5050
#-v
5151
-Wall
52-
-Werror
52+
#-Werror
5353
)
5454

5555
set( FLAGS_LINK
5656
#-v
5757
-Wall
58-
-Werror
58+
#-Werror
5959
#-lgtest -lgtest_main
6060
)
6161

main.cpp

Lines changed: 76 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,81 @@
1919
//-------------------------------------
2020
int main(int argc, char *argv[])
2121
{
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+
}}
3086
}
3187

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

Comments
 (0)