diff options
author | jofret | 2008-05-13 16:41:02 +0000 |
---|---|---|
committer | jofret | 2008-05-13 16:41:02 +0000 |
commit | c264597fc3d7a0c24fa19cafd4b065da618e6b23 (patch) | |
tree | bf4aec23274f757812a0ff1b9e321b3c408c5361 /src/type/testDoubleComplex.c | |
parent | e9d706092d7a0a294b1dcbc62dd40f83341a2e50 (diff) | |
download | scilab2c-c264597fc3d7a0c24fa19cafd4b065da618e6b23.tar.gz scilab2c-c264597fc3d7a0c24fa19cafd4b065da618e6b23.tar.bz2 scilab2c-c264597fc3d7a0c24fa19cafd4b065da618e6b23.zip |
Adding double complex matrix constructor
Diffstat (limited to 'src/type/testDoubleComplex.c')
-rw-r--r-- | src/type/testDoubleComplex.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/type/testDoubleComplex.c b/src/type/testDoubleComplex.c index 4e3d94f3..1a2a0ada 100644 --- a/src/type/testDoubleComplex.c +++ b/src/type/testDoubleComplex.c @@ -14,7 +14,28 @@ #include <assert.h> #include "doubleComplex.h" -int main(void) { +int matrixCreation(void); +int addAndDiff(void); + +int matrixCreation(void) { + double real[6] = {1., 2., 3., 4., 5., 6.}; + double imag[6] = {6., 5., 4., 3., 2., 1.}; + + doubleComplex *Z = DoubleComplexMatrix(real, imag, 6); + + int i = 0; + + for (i = 0; i < 6; ++i) + { + printf("Partie reelle = %f\n", zreals(Z[i])); + printf("Partie imaginaire = %f\n", zimags(Z[i])); + } + + + return 0; +} + +int addAndDiff(void) { /* z = -3 + 25*%i */ doubleComplex z = DoubleComplex(3,-25); /* y = -3.123456 + 25.123456*%i */ @@ -50,3 +71,9 @@ int main(void) { assert(zimags(u) == (double)-25 - (double)25.123456); return 0; } + +int main(void) { + addAndDiff(); + matrixCreation(); + return 0; +} |