diff options
author | jofret | 2009-06-10 06:43:32 +0000 |
---|---|---|
committer | jofret | 2009-06-10 06:43:32 +0000 |
commit | 5e361d5c5f8796e98f14b3c65c1d8ae7782166f4 (patch) | |
tree | 44e50e9059d9addada65360c6f0738b25f98308e /src/c/operations/multiplication | |
parent | 60c710c861f493b7ac0bc0be5d7bc36b811d8389 (diff) | |
download | scilab2c-5e361d5c5f8796e98f14b3c65c1d8ae7782166f4.tar.gz scilab2c-5e361d5c5f8796e98f14b3c65c1d8ae7782166f4.tar.bz2 scilab2c-5e361d5c5f8796e98f14b3c65c1d8ae7782166f4.zip |
cleaning
Diffstat (limited to 'src/c/operations/multiplication')
-rw-r--r-- | src/c/operations/multiplication/Makefile.am | 1 | ||||
-rw-r--r-- | src/c/operations/multiplication/Makefile.in | 1 | ||||
-rw-r--r-- | src/c/operations/multiplication/ctimess.c | 41 | ||||
-rw-r--r-- | src/c/operations/multiplication/testMultiplication.c | 41 | ||||
-rw-r--r-- | src/c/operations/multiplication/ztimess.c | 40 |
5 files changed, 2 insertions, 122 deletions
diff --git a/src/c/operations/multiplication/Makefile.am b/src/c/operations/multiplication/Makefile.am index 7d06081c..764663c5 100644 --- a/src/c/operations/multiplication/Makefile.am +++ b/src/c/operations/multiplication/Makefile.am @@ -37,6 +37,7 @@ check_PROGRAMS = testMultiplication check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ $(top_builddir)/src/c/type/libFloatComplex.la \ + $(top_builddir)/src/c/operations/addition/libAddition.la \ libMultiplication.la check_INCLUDES = -I $(top_builddir)/src/c/type \ diff --git a/src/c/operations/multiplication/Makefile.in b/src/c/operations/multiplication/Makefile.in index e3f388ad..13987ad1 100644 --- a/src/c/operations/multiplication/Makefile.in +++ b/src/c/operations/multiplication/Makefile.in @@ -235,6 +235,7 @@ libMultiplication_la_SOURCES = $(HEAD) \ check_LDADD = $(top_builddir)/src/c/type/libDoubleComplex.la \ $(top_builddir)/src/c/type/libFloatComplex.la \ + $(top_builddir)/src/c/operations/addition/libAddition.la \ libMultiplication.la check_INCLUDES = -I $(top_builddir)/src/c/type \ diff --git a/src/c/operations/multiplication/ctimess.c b/src/c/operations/multiplication/ctimess.c deleted file mode 100644 index 3c7ae867..00000000 --- a/src/c/operations/multiplication/ctimess.c +++ /dev/null @@ -1,41 +0,0 @@ - -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif - -#include "floatComplex.h" -#include "multiplication.h" - - - -/* -** \function ctimess -** \brief Multiply 2 Complex numbers. -*/ -floatComplex ctimess(floatComplex z1, floatComplex z2) { -#ifndef STDC99 - return FloatComplex(z1.real*z2.real - z1.imag*z2.imag, - z1.real*z2.imag + z2.real*z1.imag); -#else - return z1 * z2; -#endif -} diff --git a/src/c/operations/multiplication/testMultiplication.c b/src/c/operations/multiplication/testMultiplication.c index cd3de179..92839b80 100644 --- a/src/c/operations/multiplication/testMultiplication.c +++ b/src/c/operations/multiplication/testMultiplication.c @@ -1244,45 +1244,6 @@ -static void ztimessTest(void) { - double P1_R[] = ZR1; - double P1_I[] = ZI1; - double P2_R[] = ZR2; - double P2_I[] = ZI2; - double Res_R[] = ZResR; - double Res_I[] = ZResI; - int i=0; - doubleComplex in1,in2,out; - - for (i=0;i<200;i++){ - in1=DoubleComplex(P1_R[i],P1_I[i]); - in2=DoubleComplex(P2_R[i],P2_I[i]); - out=ztimess(in1,in2); - assert( ( fabs(zreals(out)-Res_R[i]) / fabs(zreals(out)) ) <3e-16); - assert( ( fabs(zimags(out)-Res_I[i]) / fabs(zimags(out)) ) <3e-16); - } -} - -static void ctimessTest(void) { - float P1_R[] = CR1; - float P1_I[] = CI1; - float P2_R[] = CR2; - float P2_I[] = CI2; - float Res_R[] = CResR; - float Res_I[] = CResI; - int i=0; - floatComplex in1,in2,out; - - for (i=0;i<200;i++){ - in1=FloatComplex(P1_R[i],P1_I[i]); - in2=FloatComplex(P2_R[i],P2_I[i]); - out=ctimess(in1,in2); - assert( ( fabs(creals(out)-Res_R[i]) / fabs(creals(out)) ) <3e-6); - assert( ( fabs(cimags(out)-Res_I[i]) / fabs(cimags(out)) ) <1e-6); - } -} - - static void smulsTest(void){ float P1[]=FP1; float P2[]=FP2; @@ -1427,8 +1388,6 @@ static void zmulaTest(void){ static int testMult(void) { - ztimessTest(); - ctimessTest(); smulsTest(); dmulsTest(); cmulsTest(); diff --git a/src/c/operations/multiplication/ztimess.c b/src/c/operations/multiplication/ztimess.c deleted file mode 100644 index ce5dda0c..00000000 --- a/src/c/operations/multiplication/ztimess.c +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab - * Copyright (C) 2008-2008 - INRIA - Arnaud TORSET - * - * This file must be used under the terms of the CeCILL. - * This source file is licensed as described in the file COPYING, which - * you should have received as part of this distribution. The terms - * are also available at - * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - * - */ - -#ifdef __STDC_VERSION__ -# ifndef STDC -# define STDC -# endif -# if __STDC_VERSION__ >= 199901L -# ifndef STDC99 -# define STDC99 -# endif -# endif -#endif - -#include "doubleComplex.h" -#include "multiplication.h" - - -/* -** \function ztimess -** \brief Multiply 2 Complex numbers. -*/ -doubleComplex ztimess(doubleComplex z1, doubleComplex z2) { -#ifndef STDC99 - return DoubleComplex(z1.real*z2.real - z1.imag*z2.imag, - z1.real*z2.imag + z2.real*z1.imag); -#else - return z1 * z2; -#endif -} - |