diff options
author | Brijeshcr | 2017-07-07 22:29:47 +0530 |
---|---|---|
committer | Brijeshcr | 2017-07-07 22:29:47 +0530 |
commit | 6ff1c85175485eafabb6a943bc47f30d20ff8382 (patch) | |
tree | 181f6cc180e69088e5ccd5b605314d71f70cbe06 /2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c | |
parent | 1df1fd26cfd7b19dda4b7a572687c863b530b380 (diff) | |
download | Scilab2C-6ff1c85175485eafabb6a943bc47f30d20ff8382.tar.gz Scilab2C-6ff1c85175485eafabb6a943bc47f30d20ff8382.tar.bz2 Scilab2C-6ff1c85175485eafabb6a943bc47f30d20ff8382.zip |
Changes to Toeplitz
Diffstat (limited to '2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c')
-rw-r--r-- | 2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c b/2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c index d47c5e15..117f8189 100644 --- a/2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c +++ b/2.3-1/src/c/matrixOperations/toeplitz/ztoeplitza.c @@ -11,14 +11,14 @@ void ztoeplitza(doubleComplex* inp1,int size1,doubleComplex* inp2,int size2,doubleComplex* oup) { - if (inp1[0]!=inp2[0]) + if ((zreals(inp1[0])!=zreals(inp2[0]))&&(zimags(inp1[0])!=zimags(inp2[0]))) { printf("Error!The first elements of the Vectors are not equal."); // First element of both input vectors must be equal for Toeplitz. return; } int i, j; - for(i=0;i<size1*size2;i++) oup[i] = DoubleComplex(0,0); // Initializing the output matrix with zeros. + for(i=0;i<size1*size2;i++) oup[i] = 0; // Initializing the output matrix with zeros. for (i = 0; i<size1; i++) { @@ -30,7 +30,7 @@ void ztoeplitza(doubleComplex* inp1,int size1,doubleComplex* inp2,int size2,doub } for (i = size2+1; i<size1*size2; i++) // Loop to build the rest of the Toeplitz matrix. { - if (oup[i] == DoubleComplex(0,0)) + if (zreals(oup[i]) == 0 && zimags(oup[i]) == 0) oup[i] = oup[i-size2-1]; } } |