diff options
Diffstat (limited to 'src')
60 files changed, 440 insertions, 240 deletions
diff --git a/src/Makefile b/src/Makefile index c43e281f..e32310ed 100644 --- a/src/Makefile +++ b/src/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Tue Dec 5 09:19:53 2006 jofret -## Last update Fri Dec 8 17:01:06 2006 jofret +## Last update Wed Jan 31 12:04:05 2007 jofret ## ## Copyright INRIA 2006 ## @@ -16,6 +16,12 @@ DIRS = type \ all: recure +stdc99: + @for i in $(DIRS); \ + do cd $$i && make STANDARD=-std=c99; \ + cd .. ;\ + done + recure: @for i in $(DIRS); \ do cd $$i && make; \ @@ -40,5 +46,6 @@ test: all @cd test && make $@; cd .. todo: - @grep -R FIXME --exclude="*svn*" * > TODO - @cat TODO
\ No newline at end of file + @grep -R FIXME --exclude="*svn*" --exclude="Makefile" * > TODO + @cat TODO + diff --git a/src/elementaryFunctions/Makefile b/src/elementaryFunctions/Makefile index 2e505d6f..73e2c6b6 100644 --- a/src/elementaryFunctions/Makefile +++ b/src/elementaryFunctions/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Tue Dec 5 09:19:53 2006 jofret -## Last update Mon Jan 29 17:06:19 2007 jofret +## Last update Wed Jan 31 09:22:09 2007 jofret ## ## Copyright INRIA 2006 ## @@ -17,8 +17,8 @@ DIRS = cos \ cosh \ sinh \ tan \ - tanh #\ -# exp \ + tanh \ + exp #\ # log all: recure diff --git a/src/elementaryFunctions/acos/Makefile b/src/elementaryFunctions/acos/Makefile index aa981c04..78456138 100644 --- a/src/elementaryFunctions/acos/Makefile +++ b/src/elementaryFunctions/acos/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Fri Jan 5 10:19:16 2007 jofret -## Last update Fri Jan 5 16:07:42 2007 jofret +## Last update Wed Jan 31 11:59:19 2007 jofret ## ## Copyright INRIA 2007 ## @@ -16,7 +16,7 @@ RM = rm -f CC = gcc INCLUDE = ../../type LINK = ../../lib -CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) AR = ar cru RANLIB = ranlib diff --git a/src/elementaryFunctions/acos/cacosa.c b/src/elementaryFunctions/acos/cacosa.c index da1f5b69..3db39792 100644 --- a/src/elementaryFunctions/acos/cacosa.c +++ b/src/elementaryFunctions/acos/cacosa.c @@ -5,19 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 10:23:49 2007 jofret -** Last update Fri Jan 5 10:24:21 2007 jofret +** Last update Wed Jan 31 11:16:23 2007 jofret ** ** Copyright INRIA 2007 */ - - -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex cacoss(floatComplex); diff --git a/src/elementaryFunctions/acos/cacoss.c b/src/elementaryFunctions/acos/cacoss.c index 480b41e6..61a90bd3 100644 --- a/src/elementaryFunctions/acos/cacoss.c +++ b/src/elementaryFunctions/acos/cacoss.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 11:29:45 2007 jofret -** Last update Fri Jan 5 11:29:55 2007 jofret +** Last update Wed Jan 31 11:16:14 2007 jofret ** ** Copyright INRIA 2007 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex cacoss(floatComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/acos/zacosa.c b/src/elementaryFunctions/acos/zacosa.c index e8c5387d..3bad836c 100644 --- a/src/elementaryFunctions/acos/zacosa.c +++ b/src/elementaryFunctions/acos/zacosa.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 10:25:14 2007 jofret -** Last update Fri Jan 5 10:25:34 2007 jofret +** Last update Wed Jan 31 11:15:58 2007 jofret ** ** Copyright INRIA 2007 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex zacoss(doubleComplex); diff --git a/src/elementaryFunctions/acos/zacoss.c b/src/elementaryFunctions/acos/zacoss.c index 1b197905..8cbc4c60 100644 --- a/src/elementaryFunctions/acos/zacoss.c +++ b/src/elementaryFunctions/acos/zacoss.c @@ -5,19 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 10:24:38 2007 jofret -** Last update Fri Jan 5 10:25:02 2007 jofret +** Last update Wed Jan 31 11:15:51 2007 jofret ** ** Copyright INRIA 2007 */ - -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif - doubleComplex zacoss(doubleComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/asin/Makefile b/src/elementaryFunctions/asin/Makefile index adeafc2b..01f11596 100644 --- a/src/elementaryFunctions/asin/Makefile +++ b/src/elementaryFunctions/asin/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Fri Jan 5 10:19:16 2007 jofret -## Last update Fri Jan 5 16:13:51 2007 jofret +## Last update Wed Jan 31 11:59:14 2007 jofret ## ## Copyright INRIA 2007 ## @@ -16,7 +16,7 @@ RM = rm -f CC = gcc INCLUDE = ../../type LINK = ../../lib -CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) AR = ar cru RANLIB = ranlib diff --git a/src/elementaryFunctions/asin/casina.c b/src/elementaryFunctions/asin/casina.c index 8cbec360..c9493012 100644 --- a/src/elementaryFunctions/asin/casina.c +++ b/src/elementaryFunctions/asin/casina.c @@ -5,19 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 10:23:49 2007 jofret -** Last update Fri Jan 5 16:24:19 2007 jofret +** Last update Wed Jan 31 11:15:40 2007 jofret ** ** Copyright INRIA 2007 */ - - -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex casins(floatComplex); diff --git a/src/elementaryFunctions/asin/casins.c b/src/elementaryFunctions/asin/casins.c index 32cfbd59..fa668316 100644 --- a/src/elementaryFunctions/asin/casins.c +++ b/src/elementaryFunctions/asin/casins.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 11:29:45 2007 jofret -** Last update Fri Jan 5 16:24:08 2007 jofret +** Last update Wed Jan 31 11:15:31 2007 jofret ** ** Copyright INRIA 2007 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex casins(floatComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/asin/sasina.c b/src/elementaryFunctions/asin/sasina.c index 2b38a409..9cc177d4 100644 --- a/src/elementaryFunctions/asin/sasina.c +++ b/src/elementaryFunctions/asin/sasina.c @@ -5,12 +5,11 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 10:25:57 2007 jofret -** Last update Fri Jan 5 16:23:34 2007 jofret +** Last update Wed Jan 31 11:15:18 2007 jofret ** ** Copyright INRIA 2007 */ - float sasins(float); void sasina(float* x, int strideX, float* y, int strideY, int size) { diff --git a/src/elementaryFunctions/asin/zasina.c b/src/elementaryFunctions/asin/zasina.c index c9e13f2d..b3dc3603 100644 --- a/src/elementaryFunctions/asin/zasina.c +++ b/src/elementaryFunctions/asin/zasina.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 10:25:14 2007 jofret -** Last update Fri Jan 5 16:23:01 2007 jofret +** Last update Wed Jan 31 11:15:10 2007 jofret ** ** Copyright INRIA 2007 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex zasins(doubleComplex); diff --git a/src/elementaryFunctions/asin/zasins.c b/src/elementaryFunctions/asin/zasins.c index 9ffed91f..30bf7a9f 100644 --- a/src/elementaryFunctions/asin/zasins.c +++ b/src/elementaryFunctions/asin/zasins.c @@ -5,19 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Jan 5 10:24:38 2007 jofret -** Last update Fri Jan 5 16:22:49 2007 jofret +** Last update Wed Jan 31 11:15:02 2007 jofret ** ** Copyright INRIA 2007 */ - -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif - doubleComplex zasins(doubleComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/cos/Makefile b/src/elementaryFunctions/cos/Makefile index 0c18a80f..118716cc 100644 --- a/src/elementaryFunctions/cos/Makefile +++ b/src/elementaryFunctions/cos/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Thu Nov 30 16:33:40 2006 jofret -## Last update Thu Dec 7 15:25:32 2006 jofret +## Last update Wed Jan 31 11:57:33 2007 jofret ## ## Copyright INRIA 2006 ## @@ -16,7 +16,7 @@ RM = rm -f CC = gcc INCLUDE = ../../type LINK = ../../lib -CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) AR = ar cru RANLIB = ranlib diff --git a/src/elementaryFunctions/cos/ccosa.c b/src/elementaryFunctions/cos/ccosa.c index 9859ea3d..4c49b29b 100644 --- a/src/elementaryFunctions/cos/ccosa.c +++ b/src/elementaryFunctions/cos/ccosa.c @@ -5,18 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 14:54:24 2006 jofret -** Last update Thu Dec 7 17:15:29 2006 jofret +** Last update Wed Jan 31 11:14:50 2007 jofret ** ** Copyright INRIA 2006 */ - -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex ccoss(floatComplex); diff --git a/src/elementaryFunctions/cos/ccoss.c b/src/elementaryFunctions/cos/ccoss.c index 8162d102..79c18fb4 100644 --- a/src/elementaryFunctions/cos/ccoss.c +++ b/src/elementaryFunctions/cos/ccoss.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 12:04:28 2006 jofret -** Last update Fri Dec 8 12:05:56 2006 jofret +** Last update Wed Jan 31 10:19:53 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex ccoss(floatComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/cos/zcosa.c b/src/elementaryFunctions/cos/zcosa.c index 9e76b850..525c04d5 100644 --- a/src/elementaryFunctions/cos/zcosa.c +++ b/src/elementaryFunctions/cos/zcosa.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 16:12:02 2006 jofret -** Last update Thu Dec 7 17:18:38 2006 jofret +** Last update Wed Jan 31 10:19:21 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex zcoss(doubleComplex); diff --git a/src/elementaryFunctions/cos/zcoss.c b/src/elementaryFunctions/cos/zcoss.c index b921a9c9..f12391de 100644 --- a/src/elementaryFunctions/cos/zcoss.c +++ b/src/elementaryFunctions/cos/zcoss.c @@ -5,18 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 12:05:48 2006 jofret -** Last update Thu Dec 7 16:43:16 2006 jofret +** Last update Wed Jan 31 10:19:12 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif - doubleComplex zcoss(doubleComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/cosh/Makefile b/src/elementaryFunctions/cosh/Makefile index 66c22a5f..6bdb078e 100644 --- a/src/elementaryFunctions/cosh/Makefile +++ b/src/elementaryFunctions/cosh/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Thu Nov 30 16:33:40 2006 jofret -## Last update Fri Jan 19 14:54:57 2007 jofret +## Last update Wed Jan 31 11:59:11 2007 jofret ## ## Copyright INRIA 2006 ## @@ -16,7 +16,7 @@ RM = rm -f CC = gcc INCLUDE = ../../type LINK = ../../lib -CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) AR = ar cru RANLIB = ranlib diff --git a/src/elementaryFunctions/cosh/ccosha.c b/src/elementaryFunctions/cosh/ccosha.c index 7d3f0ba5..7de4fd4d 100644 --- a/src/elementaryFunctions/cosh/ccosha.c +++ b/src/elementaryFunctions/cosh/ccosha.c @@ -5,18 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 14:54:24 2006 jofret -** Last update Fri Jan 19 14:55:22 2007 jofret +** Last update Wed Jan 31 11:14:37 2007 jofret ** ** Copyright INRIA 2006 */ - -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex ccoshs(floatComplex); diff --git a/src/elementaryFunctions/cosh/ccoshs.c b/src/elementaryFunctions/cosh/ccoshs.c index d6dfa47c..bfeac33a 100644 --- a/src/elementaryFunctions/cosh/ccoshs.c +++ b/src/elementaryFunctions/cosh/ccoshs.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 12:04:28 2006 jofret -** Last update Fri Jan 19 14:56:26 2007 jofret +** Last update Wed Jan 31 11:14:28 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex ccoshs(floatComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/cosh/zcosha.c b/src/elementaryFunctions/cosh/zcosha.c index 05ba2487..fdfe3d3c 100644 --- a/src/elementaryFunctions/cosh/zcosha.c +++ b/src/elementaryFunctions/cosh/zcosha.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 16:12:02 2006 jofret -** Last update Fri Jan 19 14:53:42 2007 jofret +** Last update Wed Jan 31 11:14:15 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex zcoshs(doubleComplex); diff --git a/src/elementaryFunctions/cosh/zcoshs.c b/src/elementaryFunctions/cosh/zcoshs.c index 05697977..c9436928 100644 --- a/src/elementaryFunctions/cosh/zcoshs.c +++ b/src/elementaryFunctions/cosh/zcoshs.c @@ -5,18 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 12:05:48 2006 jofret -** Last update Fri Jan 19 14:53:12 2007 jofret +** Last update Wed Jan 31 11:14:07 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif - doubleComplex zcoshs(doubleComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/exp/Makefile b/src/elementaryFunctions/exp/Makefile new file mode 100644 index 00000000..8738b977 --- /dev/null +++ b/src/elementaryFunctions/exp/Makefile @@ -0,0 +1,47 @@ +## +## -*- makefile -*- +## +## Makefile +## Made by Bruno JOFRET <bruno.jofret@inria.fr> +## +## Started on Thu Nov 30 16:33:40 2006 jofret +## Last update Wed Jan 31 11:59:06 2007 jofret +## +## Copyright INRIA 2006 +## + +NAME = ../../lib/libExp.a + +RM = rm -f +CC = gcc +INCLUDE = ../../type +LINK = ../../lib +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) +AR = ar cru +RANLIB = ranlib + +SRC = sexps.c \ + dexps.c \ + cexps.c \ + zexps.c \ + sexpa.c \ + dexpa.c \ + cexpa.c \ + zexpa.c + +HEAD = exp.h +OBJ = $(SRC:.c=.o) + +all: $(NAME) + +$(NAME) : $(HEAD) $(OBJ) + $(AR) $@ $(OBJ) + $(RANLIB) $@ + +clean: + $(RM) $(OBJ) + +distclean: clean + $(RM) $(NAME) + +re: clean all diff --git a/src/elementaryFunctions/exp/cexpa.c b/src/elementaryFunctions/exp/cexpa.c new file mode 100644 index 00000000..eec3a98c --- /dev/null +++ b/src/elementaryFunctions/exp/cexpa.c @@ -0,0 +1,22 @@ +/* +** -*- C -*- +** +** cexpa.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 14:54:24 2006 jofret +** Last update Wed Jan 31 11:13:51 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "floatComplex.h" + +floatComplex cexps(floatComplex); + +void cexpa(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = cexps(x[i]); + } +} diff --git a/src/elementaryFunctions/exp/cexps.c b/src/elementaryFunctions/exp/cexps.c new file mode 100644 index 00000000..23863f4d --- /dev/null +++ b/src/elementaryFunctions/exp/cexps.c @@ -0,0 +1,18 @@ +/* +** -*- C -*- +** +** cexps.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 12:04:28 2006 jofret +** Last update Wed Jan 31 11:13:43 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "floatComplex.h" + +floatComplex cexps(floatComplex z) { + /* FIXME: Dummy... */ + return z; +} diff --git a/src/elementaryFunctions/exp/dexpa.c b/src/elementaryFunctions/exp/dexpa.c new file mode 100644 index 00000000..8d80ea06 --- /dev/null +++ b/src/elementaryFunctions/exp/dexpa.c @@ -0,0 +1,20 @@ +/* +** -*- C -*- +** +** dexpa.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 14:54:56 2006 jofret +** Last update Wed Jan 31 09:20:51 2007 jofret +** +** Copyright INRIA 2006 +*/ + +double dexps(double); + +void dexpa(double* x, int strideX, double* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dexps(x[i]); + } +} diff --git a/src/elementaryFunctions/exp/dexps.c b/src/elementaryFunctions/exp/dexps.c new file mode 100644 index 00000000..952cf0e2 --- /dev/null +++ b/src/elementaryFunctions/exp/dexps.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** dexps.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 12:02:41 2006 jofret +** Last update Wed Jan 31 09:20:40 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <math.h> + +double dexps(double x) { + return (exp(x)); +} diff --git a/src/elementaryFunctions/exp/exp.h b/src/elementaryFunctions/exp/exp.h new file mode 100644 index 00000000..ed2aa79d --- /dev/null +++ b/src/elementaryFunctions/exp/exp.h @@ -0,0 +1,57 @@ +/* +** -*- C -*- +** +** exp.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Tue Dec 5 15:49:18 2006 jofret +** Last update Wed Jan 31 09:07:56 2007 jofret +** +** Copyright INRIA 2006 +*/ + +/* +** Compute Exponential for different types . +*/ + +/* +** \brief Float Exponential function +*/ +float sexps(float); + +/* +** \brief Double Exponential function +*/ +double dexps(double); + +/* +** \brief Float Complex Exponential function +*/ +floatComplex cexps(floatComplex); + +/* +** \brief Double Complex Exponential function +*/ +doubleComplex zexps(doubleComplex); + +/* +** \brief Float Matrix Exponential function +*/ +void sexpa(float*, int, float*, int, int); + +/* +** \brief Double Matrix Exponential function +*/ +void dexpa(double*, int, double*, int, int); + +/* +** \brief Float Complex Matrix Exponential function +*/ +void cexpa(floatComplex*, int, floatComplex*, int, int); + +/* +** \brief Double Complex Matrix Exponential function +*/ +void zexpa(doubleComplex*, int, doubleComplex*, int, int); + + diff --git a/src/elementaryFunctions/exp/sexpa.c b/src/elementaryFunctions/exp/sexpa.c new file mode 100644 index 00000000..fe7d0a2e --- /dev/null +++ b/src/elementaryFunctions/exp/sexpa.c @@ -0,0 +1,20 @@ +/* +** -*- C -*- +** +** sexpa.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 16:03:27 2006 jofret +** Last update Wed Jan 31 09:20:32 2007 jofret +** +** Copyright INRIA 2006 +*/ + +float sexps(float); + +void sexpa(float* x, int strideX, float* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = sexps(x[i]); + } +} diff --git a/src/elementaryFunctions/exp/sexps.c b/src/elementaryFunctions/exp/sexps.c new file mode 100644 index 00000000..f8f8e8d3 --- /dev/null +++ b/src/elementaryFunctions/exp/sexps.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** sexps.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 11:05:37 2006 jofret +** Last update Wed Jan 31 09:20:21 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <math.h> + +float sexps(float x) { + return (exp(x)); +} diff --git a/src/elementaryFunctions/exp/zexpa.c b/src/elementaryFunctions/exp/zexpa.c new file mode 100644 index 00000000..a22f381c --- /dev/null +++ b/src/elementaryFunctions/exp/zexpa.c @@ -0,0 +1,22 @@ +/* +** -*- C -*- +** +** zexpa.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 16:12:02 2006 jofret +** Last update Wed Jan 31 11:13:29 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "doubleComplex.h" + +doubleComplex zexps(doubleComplex); + +void zexpa(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = zexps(x[i]); + } +} diff --git a/src/elementaryFunctions/exp/zexps.c b/src/elementaryFunctions/exp/zexps.c new file mode 100644 index 00000000..5ee39ac9 --- /dev/null +++ b/src/elementaryFunctions/exp/zexps.c @@ -0,0 +1,18 @@ +/* +** -*- C -*- +** +** zexps.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 12:05:48 2006 jofret +** Last update Wed Jan 31 11:13:19 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include "doubleComplex.h" + +doubleComplex zexps(doubleComplex z) { + /* FIXME: Dummy... */ + return (DoubleComplex(0,1)); +} diff --git a/src/elementaryFunctions/sin/Makefile b/src/elementaryFunctions/sin/Makefile index b37931d5..1cfcc0fd 100644 --- a/src/elementaryFunctions/sin/Makefile +++ b/src/elementaryFunctions/sin/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Thu Nov 30 16:33:40 2006 jofret -## Last update Fri Dec 8 16:38:48 2006 jofret +## Last update Wed Jan 31 11:58:56 2007 jofret ## ## Copyright INRIA 2006 ## @@ -16,7 +16,7 @@ RM = rm -f CC = gcc INCLUDE = ../../type LINK = ../../lib -CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) AR = ar cru RANLIB = ranlib diff --git a/src/elementaryFunctions/sin/csina.c b/src/elementaryFunctions/sin/csina.c index 76e669dc..6c458c8e 100644 --- a/src/elementaryFunctions/sin/csina.c +++ b/src/elementaryFunctions/sin/csina.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 13:07:37 2006 jofret -** Last update Fri Dec 8 14:01:46 2006 jofret +** Last update Wed Jan 31 11:13:10 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex csins(floatComplex); diff --git a/src/elementaryFunctions/sin/csins.c b/src/elementaryFunctions/sin/csins.c index 0b9ff889..eb6cab04 100644 --- a/src/elementaryFunctions/sin/csins.c +++ b/src/elementaryFunctions/sin/csins.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 12:04:39 2006 jofret -** Last update Fri Dec 8 13:11:14 2006 jofret +** Last update Wed Jan 31 11:13:02 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex csins(floatComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/sin/zsina.c b/src/elementaryFunctions/sin/zsina.c index 838487d4..87c72535 100644 --- a/src/elementaryFunctions/sin/zsina.c +++ b/src/elementaryFunctions/sin/zsina.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 14:02:04 2006 jofret -** Last update Fri Dec 8 14:04:27 2006 jofret +** Last update Wed Jan 31 11:12:12 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex zsins(doubleComplex); diff --git a/src/elementaryFunctions/sin/zsins.c b/src/elementaryFunctions/sin/zsins.c index 80544ea9..c256db48 100644 --- a/src/elementaryFunctions/sin/zsins.c +++ b/src/elementaryFunctions/sin/zsins.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 12:06:35 2006 jofret -** Last update Fri Dec 8 13:02:34 2006 jofret +** Last update Wed Jan 31 11:12:02 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex zsins(doubleComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/sinh/Makefile b/src/elementaryFunctions/sinh/Makefile index 1841fc26..97e5fa2d 100644 --- a/src/elementaryFunctions/sinh/Makefile +++ b/src/elementaryFunctions/sinh/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Thu Nov 30 16:33:40 2006 jofret -## Last update Fri Jan 19 15:20:12 2007 jofret +## Last update Wed Jan 31 11:59:02 2007 jofret ## ## Copyright INRIA 2006 ## @@ -16,7 +16,7 @@ RM = rm -f CC = gcc INCLUDE = ../../type LINK = ../../lib -CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) AR = ar cru RANLIB = ranlib diff --git a/src/elementaryFunctions/sinh/csinha.c b/src/elementaryFunctions/sinh/csinha.c index e55292de..1e271767 100644 --- a/src/elementaryFunctions/sinh/csinha.c +++ b/src/elementaryFunctions/sinh/csinha.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 13:07:37 2006 jofret -** Last update Fri Jan 19 15:20:58 2007 jofret +** Last update Wed Jan 31 11:12:52 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex csinhs(floatComplex); diff --git a/src/elementaryFunctions/sinh/csinhs.c b/src/elementaryFunctions/sinh/csinhs.c index 6bac5cb3..4cac792b 100644 --- a/src/elementaryFunctions/sinh/csinhs.c +++ b/src/elementaryFunctions/sinh/csinhs.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 12:04:39 2006 jofret -** Last update Fri Jan 19 15:20:48 2007 jofret +** Last update Wed Jan 31 11:12:44 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex csinhs(floatComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/sinh/zsinha.c b/src/elementaryFunctions/sinh/zsinha.c index a7488378..730baf1a 100644 --- a/src/elementaryFunctions/sinh/zsinha.c +++ b/src/elementaryFunctions/sinh/zsinha.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 14:02:04 2006 jofret -** Last update Fri Jan 19 15:18:16 2007 jofret +** Last update Wed Jan 31 11:12:30 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex zsinhs(doubleComplex); diff --git a/src/elementaryFunctions/sinh/zsinhs.c b/src/elementaryFunctions/sinh/zsinhs.c index 6820fb39..7fc3b23f 100644 --- a/src/elementaryFunctions/sinh/zsinhs.c +++ b/src/elementaryFunctions/sinh/zsinhs.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 12:06:35 2006 jofret -** Last update Fri Jan 19 15:18:06 2007 jofret +** Last update Wed Jan 31 11:12:22 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex zsinhs(doubleComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/tan/Makefile b/src/elementaryFunctions/tan/Makefile index 3f22534d..7e216db8 100644 --- a/src/elementaryFunctions/tan/Makefile +++ b/src/elementaryFunctions/tan/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Thu Nov 30 16:33:40 2006 jofret -## Last update Mon Jan 29 16:08:57 2007 jofret +## Last update Wed Jan 31 11:58:47 2007 jofret ## ## Copyright INRIA 2006 ## @@ -16,7 +16,7 @@ RM = rm -f CC = gcc INCLUDE = ../../type LINK = ../../lib -CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) AR = ar cru RANLIB = ranlib diff --git a/src/elementaryFunctions/tan/ctana.c b/src/elementaryFunctions/tan/ctana.c index 77a6df0c..4cbf11cb 100644 --- a/src/elementaryFunctions/tan/ctana.c +++ b/src/elementaryFunctions/tan/ctana.c @@ -5,18 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 14:54:24 2006 jofret -** Last update Mon Jan 29 16:12:36 2007 jofret +** Last update Wed Jan 31 11:11:52 2007 jofret ** ** Copyright INRIA 2006 */ - -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex ctans(floatComplex); diff --git a/src/elementaryFunctions/tan/ctans.c b/src/elementaryFunctions/tan/ctans.c index a1d4a81e..c6795c7e 100644 --- a/src/elementaryFunctions/tan/ctans.c +++ b/src/elementaryFunctions/tan/ctans.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 12:04:28 2006 jofret -** Last update Mon Jan 29 16:12:26 2007 jofret +** Last update Wed Jan 31 11:11:43 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex ctans(floatComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/tan/ztana.c b/src/elementaryFunctions/tan/ztana.c index a815e58b..91e05fb5 100644 --- a/src/elementaryFunctions/tan/ztana.c +++ b/src/elementaryFunctions/tan/ztana.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 16:12:02 2006 jofret -** Last update Mon Jan 29 16:11:17 2007 jofret +** Last update Wed Jan 31 10:55:53 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex ztans(doubleComplex); diff --git a/src/elementaryFunctions/tan/ztans.c b/src/elementaryFunctions/tan/ztans.c index 9c37fdc5..b15ad177 100644 --- a/src/elementaryFunctions/tan/ztans.c +++ b/src/elementaryFunctions/tan/ztans.c @@ -5,18 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 12:05:48 2006 jofret -** Last update Mon Jan 29 16:10:46 2007 jofret +** Last update Wed Jan 31 10:55:44 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif - doubleComplex ztans(doubleComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/tanh/Makefile b/src/elementaryFunctions/tanh/Makefile index 81c83d42..1da672a6 100644 --- a/src/elementaryFunctions/tanh/Makefile +++ b/src/elementaryFunctions/tanh/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Thu Nov 30 16:33:40 2006 jofret -## Last update Mon Jan 29 16:46:38 2007 jofret +## Last update Wed Jan 31 11:58:52 2007 jofret ## ## Copyright INRIA 2006 ## @@ -16,7 +16,7 @@ RM = rm -f CC = gcc INCLUDE = ../../type LINK = ../../lib -CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) $(STANDARD) AR = ar cru RANLIB = ranlib diff --git a/src/elementaryFunctions/tanh/ctanha.c b/src/elementaryFunctions/tanh/ctanha.c index 5224de9c..86871d97 100644 --- a/src/elementaryFunctions/tanh/ctanha.c +++ b/src/elementaryFunctions/tanh/ctanha.c @@ -5,18 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 14:54:24 2006 jofret -** Last update Mon Jan 29 17:05:40 2007 jofret +** Last update Wed Jan 31 11:11:30 2007 jofret ** ** Copyright INRIA 2006 */ - -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex ctanhs(floatComplex); diff --git a/src/elementaryFunctions/tanh/ctanhs.c b/src/elementaryFunctions/tanh/ctanhs.c index 8eb8e6ee..6eb84827 100644 --- a/src/elementaryFunctions/tanh/ctanhs.c +++ b/src/elementaryFunctions/tanh/ctanhs.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 12:04:28 2006 jofret -** Last update Mon Jan 29 17:05:27 2007 jofret +** Last update Wed Jan 31 10:56:39 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "floatComplex.h" -#else -#include <complex.h> -typedef float complex floatComplex; -#endif floatComplex ctanhs(floatComplex z) { /* FIXME: Dummy... */ diff --git a/src/elementaryFunctions/tanh/ztanha.c b/src/elementaryFunctions/tanh/ztanha.c index 36aaeb38..ff22d6a9 100644 --- a/src/elementaryFunctions/tanh/ztanha.c +++ b/src/elementaryFunctions/tanh/ztanha.c @@ -5,17 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 16:12:02 2006 jofret -** Last update Mon Jan 29 17:04:42 2007 jofret +** Last update Wed Jan 31 10:56:20 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif doubleComplex ztanhs(doubleComplex); diff --git a/src/elementaryFunctions/tanh/ztanhs.c b/src/elementaryFunctions/tanh/ztanhs.c index aad50c83..0e11adfb 100644 --- a/src/elementaryFunctions/tanh/ztanhs.c +++ b/src/elementaryFunctions/tanh/ztanhs.c @@ -5,18 +5,12 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Dec 7 12:05:48 2006 jofret -** Last update Mon Jan 29 17:04:29 2007 jofret +** Last update Wed Jan 31 10:56:10 2007 jofret ** ** Copyright INRIA 2006 */ -#ifndef STDC99 #include "doubleComplex.h" -#else -#include <complex.h> -typedef double complex doubleComplex; -#endif - doubleComplex ztanhs(doubleComplex z) { /* FIXME: Dummy... */ diff --git a/src/test/Makefile b/src/test/Makefile index 951a1272..b9e8e291 100644 --- a/src/test/Makefile +++ b/src/test/Makefile @@ -5,7 +5,7 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Thu Nov 30 16:33:40 2006 jofret -## Last update Mon Jan 29 17:17:19 2007 jofret +## Last update Wed Jan 31 09:27:59 2007 jofret ## ## Copyright INRIA 2006 ## @@ -19,7 +19,8 @@ LINK = ../lib LIBS = -lm \ -lCos -lCosh \ -lSin -lSinh \ - -lTan -lTanh + -lTan -lTanh \ + -lExp CFLAGS = -Werror -Wall -pedantic -ansi CLFLAGS = -I$(INCLUDE) -L$(LINK) $(LIBS) AR = ar cru @@ -31,6 +32,7 @@ SRC = testCos.c \ testSinh.c \ testTan.c \ testTanh.c \ + testExp.c \ test.c HEAD = test.h diff --git a/src/test/test.c b/src/test/test.c index ffeeeb2a..ecf6e246 100644 --- a/src/test/test.c +++ b/src/test/test.c @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 14:53:51 2006 jofret -** Last update Mon Jan 29 17:24:07 2007 jofret +** Last update Wed Jan 31 09:27:26 2007 jofret ** ** Copyright INRIA 2006 */ @@ -21,6 +21,7 @@ int main(int argc, char** argv) { int cosStatus, coshStatus = 0; int sinStatus, sinhStatus = 0; int tanStatus, tanhStatus = 0; + int expStatus = 0; printf("-*- -> Begin test sequence <- -*-"); @@ -38,11 +39,14 @@ int main(int argc, char** argv) { tanStatus = testTan(); /* Test Hyperbolic Tangeant stuffs */ tanhStatus = testTanh(); + /* Test Exponential stuffs */ + expStatus = testExp(); printf("-*- -> End test sequence <- -*-"); newline(); return (cosStatus+coshStatus+ sinStatus+sinhStatus+ - tanStatus+tanhStatus); + tanStatus+tanhStatus+ + expStatus); } diff --git a/src/test/test.h b/src/test/test.h index 3b0d3e09..475c1ebb 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Fri Dec 8 15:00:40 2006 jofret -** Last update Mon Jan 29 17:16:36 2007 jofret +** Last update Wed Jan 31 09:26:21 2007 jofret ** ** Copyright INRIA 2006 */ @@ -40,3 +40,7 @@ int testTan(); */ int testTanh(); +/* +** \brief Exponential Test +*/ +int testExp(); diff --git a/src/test/testExp.c b/src/test/testExp.c new file mode 100644 index 00000000..8f6c921b --- /dev/null +++ b/src/test/testExp.c @@ -0,0 +1,56 @@ +/* +** -*- C -*- +** +** testExp.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 15:05:44 2006 jofret +** Last update Wed Jan 31 09:25:30 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <stdio.h> + +#define PI 3.1415826535 + +float sexps(float); +double dexps(double); + + +void sexpsTest() { + printf(">> Float scalar\n"); + printf("sexps(0) = %f\n", sexps((float) 0)); + printf("sexps(PI) = %f\n", sexps(PI)); + printf("sexps(PI/2) = %f\n", sexps(PI/2)); + printf("sexps(PI/3) = %f\n", sexps(PI/3)); + printf("sexps(PI/4) = %f\n", sexps(PI/4)); + printf("sexps(PI/6) = %f\n", sexps(PI/6)); + printf("sexps(-PI) = %f\n", sexps(-PI)); + printf("sexps(-PI/2) = %f\n", sexps(-PI/2)); + printf("sexps(-PI/3) = %f\n", sexps(-PI/3)); + printf("sexps(-PI/4) = %f\n", sexps(-PI/4)); + printf("sexps(-PI/6) = %f\n", sexps(-PI/6)); +} + +void dexpsTest() { + printf(">> Double scalar\n"); + printf("dexps(0) = %e\n", dexps((double) 0)); + printf("dexps(PI) = %e\n", dexps(PI)); + printf("dexps(PI/2) = %e\n", dexps(PI/2)); + printf("dexps(PI/3) = %e\n", dexps(PI/3)); + printf("dexps(PI/4) = %e\n", dexps(PI/4)); + printf("dexps(PI/6) = %e\n", dexps(PI/6)); + printf("dexps(-PI) = %e\n", dexps(-PI)); + printf("dexps(-PI/2) = %e\n", dexps(-PI/2)); + printf("dexps(-PI/3) = %e\n", dexps(-PI/3)); + printf("dexps(-PI/4) = %e\n", dexps(-PI/4)); + printf("dexps(-PI/6) = %e\n", dexps(-PI/6)); +} + +int testExp() { + printf(">>>> Exponential Tests\n"); + sexpsTest(); + dexpsTest(); + return 0; +} diff --git a/src/type/doubleComplex.c b/src/type/doubleComplex.c index a985acbf..717d2c4d 100644 --- a/src/type/doubleComplex.c +++ b/src/type/doubleComplex.c @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Nov 30 16:27:08 2006 jofret -** Last update Thu Dec 7 11:44:05 2006 jofret +** Last update Wed Jan 31 16:11:51 2007 jofret ** ** Copyright INRIA 2006 */ diff --git a/src/type/doubleComplex.h b/src/type/doubleComplex.h index 7441da1f..3f73f169 100644 --- a/src/type/doubleComplex.h +++ b/src/type/doubleComplex.h @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Nov 30 16:50:08 2006 jofret -** Last update Thu Dec 7 11:44:08 2006 jofret +** Last update Wed Jan 31 10:14:18 2007 jofret ** ** Copyright INRIA 2006 */ @@ -13,6 +13,11 @@ #ifndef __DOUBLECOMPLEX_H__ #define __DOUBLECOMPLEX_H__ +#ifndef STDC99 +/* +** Hand made Double Complex definition +** { +*/ #include <stdbool.h> struct double_complex @@ -28,5 +33,23 @@ double imag(doubleComplex); doubleComplex DoubleComplex(double, double); bool isreal(doubleComplex); bool isimag(doubleComplex); +/* +** } +*/ + +#else + +/* +** Use standard C99 Double Complex definition +** { +*/ +#include <complex.h> + +typedef double complex doubleComplex; +/* +** } +*/ + +#endif /* !STDC99 */ #endif /* !__DOUBLECOMPLEX_H__ */ diff --git a/src/type/floatComplex.h b/src/type/floatComplex.h index aa2aab04..abfcb602 100644 --- a/src/type/floatComplex.h +++ b/src/type/floatComplex.h @@ -5,7 +5,7 @@ ** Made by Bruno JOFRET <bruno.jofret@inria.fr> ** ** Started on Thu Nov 30 16:50:08 2006 jofret -** Last update Thu Dec 7 11:44:08 2006 jofret +** Last update Wed Jan 31 10:14:20 2007 jofret ** ** Copyright INRIA 2006 */ @@ -13,6 +13,11 @@ #ifndef __FLOATCOMPLEX_H__ #define __FLOATCOMPLEX_H__ +#ifndef STDC99 +/* +** Hand made Float Complex definition +** { +*/ #include <stdbool.h> struct float_complex @@ -28,5 +33,23 @@ float imag(floatComplex); floatComplex FloatComplex(float, float); bool isreal(floatComplex); bool isimag(floatComplex); +/* +** } +*/ + +#else + +/* +** Use standard C99 Double Complex definition +** { +*/ +#include <complex.h> + +typedef double complex doubleComplex; +/* +** } +*/ + +#endif /* !STDC99 */ #endif /* !__FLOATCOMPLEX_H__ */ |