diff options
author | torset | 2009-01-22 14:59:46 +0000 |
---|---|---|
committer | torset | 2009-01-22 14:59:46 +0000 |
commit | 0c5bf074de6c7fb62ca335ded0011642c3f044d1 (patch) | |
tree | 706cc39712c08193bb687eb4a1824c1973b6b95e /src/string | |
parent | bb85b3eb51a4861d7862061f21541c062c359f9a (diff) | |
download | scilab2c-0c5bf074de6c7fb62ca335ded0011642c3f044d1.tar.gz scilab2c-0c5bf074de6c7fb62ca335ded0011642c3f044d1.tar.bz2 scilab2c-0c5bf074de6c7fb62ca335ded0011642c3f044d1.zip |
update
Diffstat (limited to 'src/string')
-rw-r--r-- | src/string/disp/cdispa.c | 11 | ||||
-rw-r--r-- | src/string/disp/cdisps.c | 7 | ||||
-rw-r--r-- | src/string/disp/ddispa.c | 11 | ||||
-rw-r--r-- | src/string/disp/ddisps.c | 2 | ||||
-rw-r--r-- | src/string/disp/sdispa.c | 10 | ||||
-rw-r--r-- | src/string/disp/sdisps.c | 2 | ||||
-rw-r--r-- | src/string/disp/testDisp.c | 8 | ||||
-rw-r--r-- | src/string/disp/zdispa.c | 11 | ||||
-rw-r--r-- | src/string/disp/zdisps.c | 4 | ||||
-rw-r--r-- | src/string/includes/disp.h | 12 |
10 files changed, 40 insertions, 38 deletions
diff --git a/src/string/disp/cdispa.c b/src/string/disp/cdispa.c index 5aa62c61..0b7df2b4 100644 --- a/src/string/disp/cdispa.c +++ b/src/string/disp/cdispa.c @@ -12,11 +12,12 @@ #include "disp.h" -double cdispa (floatComplex* (in), int size) { - int i = 0; - for (i = 0; i < size; ++i) { - cdisps (in[i]); +double cdispa (floatComplex* (in), int rows, int columns) { + int i = 0,j = 0; + + for (i = 0; i < rows; ++i) { + for (j=0;j<columns;j++) printf(" %f + %fi " ,creals(in[i+j*rows]) ,cimags(in[i+j*rows])); + printf("\n"); } - printf("\n"); return 0; } diff --git a/src/string/disp/cdisps.c b/src/string/disp/cdisps.c index ee676e51..1d2f4d36 100644 --- a/src/string/disp/cdisps.c +++ b/src/string/disp/cdisps.c @@ -13,11 +13,8 @@ #include "disp.h" double cdisps (floatComplex in){ - - float RealIn = creals(in); - float ImgIn = cimags(in); - - printf(" %f + %fi " ,RealIn ,ImgIn); + + printf(" %f + %fi \n" ,creals(in) ,cimags(in)); return 0; } diff --git a/src/string/disp/ddispa.c b/src/string/disp/ddispa.c index 5ffa5643..59a73755 100644 --- a/src/string/disp/ddispa.c +++ b/src/string/disp/ddispa.c @@ -12,11 +12,12 @@ #include "disp.h" -double ddispa (double* in, int size) { - int i = 0; - for (i = 0; i < size; ++i) { - ddisps (in[i]); +double ddispa (double* in, int rows, int columns){ + int i = 0,j = 0; + + for (i = 0; i < rows; ++i) { + for (j=0;j<columns;j++) printf (" %f ", in[i+j*rows]); + printf("\n"); } - printf("\n"); return 0; } diff --git a/src/string/disp/ddisps.c b/src/string/disp/ddisps.c index 315d6114..e13ce95f 100644 --- a/src/string/disp/ddisps.c +++ b/src/string/disp/ddisps.c @@ -13,6 +13,6 @@ #include "disp.h" double ddisps (double in) { - printf (" %f ", in); + printf (" %f \n", in); return 0; } diff --git a/src/string/disp/sdispa.c b/src/string/disp/sdispa.c index 944ff839..d2859187 100644 --- a/src/string/disp/sdispa.c +++ b/src/string/disp/sdispa.c @@ -12,12 +12,12 @@ #include "disp.h" -double sdispa (float* in, int size){ - int i = 0; +double sdispa (float* in, int rows, int columns){ + int i = 0,j = 0; - for (i = 0; i < size; ++i) { - sdisps (in[i]); + for (i = 0; i < rows; ++i) { + for (j=0;j<columns;j++) printf (" %f ", in[i+j*rows]); + printf("\n"); } - printf("\n"); return 0; } diff --git a/src/string/disp/sdisps.c b/src/string/disp/sdisps.c index 648cfe82..98b04a6f 100644 --- a/src/string/disp/sdisps.c +++ b/src/string/disp/sdisps.c @@ -13,6 +13,6 @@ #include "disp.h" double sdisps (float in) { - printf(" %f ",in);
+ printf(" %f \n",in);
return 0; } diff --git a/src/string/disp/testDisp.c b/src/string/disp/testDisp.c index 8ac9735e..a06fb421 100644 --- a/src/string/disp/testDisp.c +++ b/src/string/disp/testDisp.c @@ -29,7 +29,7 @@ static void sdispaTest (void) { tabF[i] = (float) rand () ; } - sdispa ( tabF, SIZE ); + sdispa ( tabF, 1, SIZE ); } /* @@ -46,7 +46,7 @@ static void ddispaTest (void) { tabD[i] = (double) rand () ; } - ddispa ( tabD, SIZE ) ; + ddispa ( tabD, 1, SIZE ) ; } @@ -64,7 +64,7 @@ static void cdispaTest (void) { tabF[i] = FloatComplex ((float) rand (), (float) rand()); } - cdispa ( tabF, SIZE ) ; + cdispa ( tabF, 1, SIZE ) ; } @@ -82,7 +82,7 @@ static void zdispaTest (void) { tabD[i] = DoubleComplex ((double) rand (), (double) rand()); } - zdispa ( tabD, SIZE ) ; + zdispa ( tabD, 1, SIZE ) ; } diff --git a/src/string/disp/zdispa.c b/src/string/disp/zdispa.c index 3a6085a4..731fac6f 100644 --- a/src/string/disp/zdispa.c +++ b/src/string/disp/zdispa.c @@ -12,11 +12,12 @@ #include "disp.h" -double zdispa (doubleComplex* in, int size) { - int i = 0; - for (i = 0; i < size; ++i) { - zdisps (in[i]); +double zdispa (doubleComplex* in, int rows, int columns){ + int i = 0,j = 0; + + for (i = 0; i < rows; ++i) { + for (j=0;j<columns;j++) printf(" %f + %fi " ,zreals(in[i+j*rows]) ,zimags(in[i+j*rows])); + printf("\n"); } - printf("\n"); return 0; } diff --git a/src/string/disp/zdisps.c b/src/string/disp/zdisps.c index d7efaf83..7b952dad 100644 --- a/src/string/disp/zdisps.c +++ b/src/string/disp/zdisps.c @@ -13,9 +13,7 @@ #include "disp.h" double zdisps (doubleComplex in) { - double RealIn = zreals(in); - double ImgIn = zimags(in); - printf(" %f + %fi " ,RealIn ,ImgIn); + printf(" %f + %fi \n" ,zreals(in) ,zimags(in)); return 0; } diff --git a/src/string/includes/disp.h b/src/string/includes/disp.h index 6506bb0c..63cde2ad 100644 --- a/src/string/includes/disp.h +++ b/src/string/includes/disp.h @@ -44,27 +44,31 @@ double zdisps (doubleComplex in); ** \param in the float scalar array to display ** \param size the size of the array */ -double sdispa (float* in, int size); +double sdispa (float* in, int rows, int columns); /* ** \brief display of a double scalar array ** \param in the double scalar array to display ** \param size the size of the array */ -double ddispa (double* in, int size); +double ddispa (double* in, int rows, int columns); /* ** \brief display of a float complex array ** \param in the float complex array to display ** \param size the size of the array */ -double cdispa (floatComplex* in, int size); +double cdispa (floatComplex* in, int rows, int columns); /* ** \brief display of a double complex array ** \param in the double complex array to display ** \param size the size of the array */ -double zdispa (doubleComplex* in, int size); +double zdispa (doubleComplex* in, int rows, int columns); + + +double g2dispd0(char *array,int* tmparraysize); + #endif /* !__DISP_H__ */ |