diff options
author | jofret | 2007-01-19 14:25:46 +0000 |
---|---|---|
committer | jofret | 2007-01-19 14:25:46 +0000 |
commit | c24d5795ea30345dee4cb5f308de7021ba0ef00b (patch) | |
tree | 6e4dba02fe462d6273586ebd37875f26dbad45bf /src/elementaryFunctions | |
parent | 6bc12ca25073f62907a115793b1c29cd8af155c3 (diff) | |
download | scilab2c-c24d5795ea30345dee4cb5f308de7021ba0ef00b.tar.gz scilab2c-c24d5795ea30345dee4cb5f308de7021ba0ef00b.tar.bz2 scilab2c-c24d5795ea30345dee4cb5f308de7021ba0ef00b.zip |
Adding Hyperbolic Cosine and Sine functions
Diffstat (limited to 'src/elementaryFunctions')
21 files changed, 562 insertions, 4 deletions
diff --git a/src/elementaryFunctions/Makefile b/src/elementaryFunctions/Makefile index 4fb882aa..b7f62ed9 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 Fri Jan 5 16:12:42 2007 jofret +## Last update Fri Jan 19 15:17:32 2007 jofret ## ## Copyright INRIA 2006 ## @@ -13,9 +13,9 @@ DIRS = cos \ sin \ acos \ - asin#\ -# cosh \ -# sinh \ + asin \ + cosh \ + sinh #\ # tan \ # tanh \ # exp \ diff --git a/src/elementaryFunctions/cosh/Makefile b/src/elementaryFunctions/cosh/Makefile new file mode 100644 index 00000000..66c22a5f --- /dev/null +++ b/src/elementaryFunctions/cosh/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 Fri Jan 19 14:54:57 2007 jofret +## +## Copyright INRIA 2006 +## + +NAME = ../../lib/libCosh.a + +RM = rm -f +CC = gcc +INCLUDE = ../../type +LINK = ../../lib +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +AR = ar cru +RANLIB = ranlib + +SRC = scoshs.c \ + dcoshs.c \ + ccoshs.c \ + zcoshs.c \ + scosha.c \ + dcosha.c \ + ccosha.c \ + zcosha.c + +HEAD = cosh.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/cosh/ccosha.c b/src/elementaryFunctions/cosh/ccosha.c new file mode 100644 index 00000000..7d3f0ba5 --- /dev/null +++ b/src/elementaryFunctions/cosh/ccosha.c @@ -0,0 +1,28 @@ +/* +** -*- C -*- +** +** ccosha.c +** 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 +** +** Copyright INRIA 2006 +*/ + + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex ccoshs(floatComplex); + +void ccosha(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = ccoshs(x[i]); + } +} diff --git a/src/elementaryFunctions/cosh/ccoshs.c b/src/elementaryFunctions/cosh/ccoshs.c new file mode 100644 index 00000000..d6dfa47c --- /dev/null +++ b/src/elementaryFunctions/cosh/ccoshs.c @@ -0,0 +1,23 @@ +/* +** -*- C -*- +** +** ccoshs.c +** 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 +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex ccoshs(floatComplex z) { + /* FIXME: Dummy... */ + return z; +} diff --git a/src/elementaryFunctions/cosh/cosh.h b/src/elementaryFunctions/cosh/cosh.h new file mode 100644 index 00000000..c0e3ef54 --- /dev/null +++ b/src/elementaryFunctions/cosh/cosh.h @@ -0,0 +1,57 @@ +/* +** -*- C -*- +** +** cosh.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Tue Dec 5 15:49:18 2006 jofret +** Last update Fri Jan 19 14:52:47 2007 jofret +** +** Copyright INRIA 2006 +*/ + +/* +** Compute Cosine for different types . +*/ + +/* +** \brief Float Cosine function +*/ +float scoshs(float); + +/* +** \brief Double Cosine function +*/ +double dcoshs(double); + +/* +** \brief Float Complex Cosine function +*/ +floatComplex ccoshs(floatComplex); + +/* +** \brief Double Complex Cosine function +*/ +doubleComplex zcoshs(doubleComplex); + +/* +** \brief Float Matrix Cosine function +*/ +void scosha(float*, int, float*, int, int); + +/* +** \brief Double Matrix Cosine function +*/ +void dcosha(double*, int, double*, int, int); + +/* +** \brief Float Complex Matrix Cosine function +*/ +void ccosha(floatComplex*, int, floatComplex*, int, int); + +/* +** \brief Double Complex Matrix Cosine function +*/ +void zcosha(doubleComplex*, int, doubleComplex*, int, int); + + diff --git a/src/elementaryFunctions/cosh/dcosha.c b/src/elementaryFunctions/cosh/dcosha.c new file mode 100644 index 00000000..828499b0 --- /dev/null +++ b/src/elementaryFunctions/cosh/dcosha.c @@ -0,0 +1,20 @@ +/* +** -*- C -*- +** +** dcosha.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 14:54:56 2006 jofret +** Last update Fri Jan 19 14:56:10 2007 jofret +** +** Copyright INRIA 2006 +*/ + +double dcoshs(double); + +void dcosha(double* x, int strideX, double* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dcoshs(x[i]); + } +} diff --git a/src/elementaryFunctions/cosh/dcoshs.c b/src/elementaryFunctions/cosh/dcoshs.c new file mode 100644 index 00000000..fd8e47b2 --- /dev/null +++ b/src/elementaryFunctions/cosh/dcoshs.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** dcoshs.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 12:02:41 2006 jofret +** Last update Fri Jan 19 14:56:01 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <math.h> + +double dcoshs(double x) { + return (cosh(x)); +} diff --git a/src/elementaryFunctions/cosh/scosha.c b/src/elementaryFunctions/cosh/scosha.c new file mode 100644 index 00000000..10f30267 --- /dev/null +++ b/src/elementaryFunctions/cosh/scosha.c @@ -0,0 +1,20 @@ +/* +** -*- C -*- +** +** scosa.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 16:03:27 2006 jofret +** Last update Fri Jan 19 14:55:49 2007 jofret +** +** Copyright INRIA 2006 +*/ + +float scoshs(float); + +void scosha(float* x, int strideX, float* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = scoshs(x[i]); + } +} diff --git a/src/elementaryFunctions/cosh/scoshs.c b/src/elementaryFunctions/cosh/scoshs.c new file mode 100644 index 00000000..e868d35d --- /dev/null +++ b/src/elementaryFunctions/cosh/scoshs.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** scoshs.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Thu Dec 7 11:05:37 2006 jofret +** Last update Fri Jan 19 14:53:58 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <math.h> + +float scoshs(float x) { + return (cosh(x)); +} diff --git a/src/elementaryFunctions/cosh/zcosha.c b/src/elementaryFunctions/cosh/zcosha.c new file mode 100644 index 00000000..05ba2487 --- /dev/null +++ b/src/elementaryFunctions/cosh/zcosha.c @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** zcosha.c +** 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 +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + +doubleComplex zcoshs(doubleComplex); + +void zcosha(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = zcoshs(x[i]); + } +} diff --git a/src/elementaryFunctions/cosh/zcoshs.c b/src/elementaryFunctions/cosh/zcoshs.c new file mode 100644 index 00000000..05697977 --- /dev/null +++ b/src/elementaryFunctions/cosh/zcoshs.c @@ -0,0 +1,24 @@ +/* +** -*- C -*- +** +** zcoshs.c +** 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 +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + + +doubleComplex zcoshs(doubleComplex z) { + /* FIXME: Dummy... */ + return (DoubleComplex(0,1)); +} diff --git a/src/elementaryFunctions/sinh/Makefile b/src/elementaryFunctions/sinh/Makefile new file mode 100644 index 00000000..1841fc26 --- /dev/null +++ b/src/elementaryFunctions/sinh/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 Fri Jan 19 15:20:12 2007 jofret +## +## Copyright INRIA 2006 +## + +NAME = ../../lib/libSinh.a + +RM = rm -f +CC = gcc +INCLUDE = ../../type +LINK = ../../lib +CFLAGS = -Werror -Wall -pedantic -ansi -I $(INCLUDE) -L $(LINK) +AR = ar cru +RANLIB = ranlib + +SRC = ssinhs.c \ + dsinhs.c \ + csinhs.c \ + zsinhs.c \ + ssinha.c \ + dsinha.c \ + csinha.c \ + zsinha.c + +HEAD = sinh.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/sinh/csinha.c b/src/elementaryFunctions/sinh/csinha.c new file mode 100644 index 00000000..e55292de --- /dev/null +++ b/src/elementaryFunctions/sinh/csinha.c @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** csinha.c +** 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 +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex csinhs(floatComplex); + +void csinha(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = csinhs(x[i]); + } +} diff --git a/src/elementaryFunctions/sinh/csinhs.c b/src/elementaryFunctions/sinh/csinhs.c new file mode 100644 index 00000000..6bac5cb3 --- /dev/null +++ b/src/elementaryFunctions/sinh/csinhs.c @@ -0,0 +1,23 @@ +/* +** -*- C -*- +** +** csinhs.c +** 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 +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex csinhs(floatComplex z) { + /* FIXME: Dummy... */ + return z; +} diff --git a/src/elementaryFunctions/sinh/dsinha.c b/src/elementaryFunctions/sinh/dsinha.c new file mode 100644 index 00000000..ba24e112 --- /dev/null +++ b/src/elementaryFunctions/sinh/dsinha.c @@ -0,0 +1,20 @@ +/* +** -*- C -*- +** +** dsinha.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 11:02:19 2006 jofret +** Last update Fri Jan 19 15:20:32 2007 jofret +** +** Copyright INRIA 2006 +*/ + +double dsinhs(double); + +void dsinha(double* x, int strideX, double* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dsinhs(x[i]); + } +} diff --git a/src/elementaryFunctions/sinh/dsinhs.c b/src/elementaryFunctions/sinh/dsinhs.c new file mode 100644 index 00000000..1bfefcb6 --- /dev/null +++ b/src/elementaryFunctions/sinh/dsinhs.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** dsinhs.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 10:50:58 2006 jofret +** Last update Fri Jan 19 15:20:23 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <math.h> + +double dsinhs(double x) { + return (sinh(x)); +} diff --git a/src/elementaryFunctions/sinh/sinh.h b/src/elementaryFunctions/sinh/sinh.h new file mode 100644 index 00000000..be4343d0 --- /dev/null +++ b/src/elementaryFunctions/sinh/sinh.h @@ -0,0 +1,57 @@ +/* +** -*- C -*- +** +** sinh.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Tue Dec 5 15:49:18 2006 jofret +** Last update Fri Jan 19 15:19:49 2007 jofret +** +** Copyright INRIA 2006 +*/ + +/* +** Compute Sine for different types . +*/ + +/* +** \brief Float Sine function +*/ +float ssinhs(float); + +/* +** \brief Double Sine function +*/ +double dsinhs(double); + +/* +** \brief Float Complex Sine function +*/ +floatComplex csinhs(floatComplex); + +/* +** \brief Double Complex Sine function +*/ +doubleComplex zsinhs(doubleComplex); + +/* +** \brief Float Matrix Sine function +*/ +void ssinha(float*, int, float*, int, int); + +/* +** \brief Double Matrix Sine function +*/ +void dsinha(double*, int, double*, int, int); + +/* +** \brief Float Complex Matrix Sine function +*/ +void csinha(floatComplex*, int, floatComplex*, int, int); + +/* +** \brief Double Complex Matrix Sine function +*/ +void zsinha(doubleComplex*, int, doubleComplex*, int, int); + + diff --git a/src/elementaryFunctions/sinh/ssinha.c b/src/elementaryFunctions/sinh/ssinha.c new file mode 100644 index 00000000..aa74d5a5 --- /dev/null +++ b/src/elementaryFunctions/sinh/ssinha.c @@ -0,0 +1,20 @@ +/* +** -*- C -*- +** +** ssinha.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 10:52:14 2006 jofret +** Last update Fri Jan 19 15:19:28 2007 jofret +** +** Copyright INRIA 2006 +*/ + +float ssinhs(float); + +void ssinha(float* x, int strideX, float* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = ssinhs(x[i]); + } +} diff --git a/src/elementaryFunctions/sinh/ssinhs.c b/src/elementaryFunctions/sinh/ssinhs.c new file mode 100644 index 00000000..39582780 --- /dev/null +++ b/src/elementaryFunctions/sinh/ssinhs.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** ssinhs.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Dec 8 10:45:34 2006 jofret +** Last update Fri Jan 19 15:19:18 2007 jofret +** +** Copyright INRIA 2006 +*/ + +#include <math.h> + +float ssinhs(float x) { + return (sinh(x)); +} diff --git a/src/elementaryFunctions/sinh/zsinha.c b/src/elementaryFunctions/sinh/zsinha.c new file mode 100644 index 00000000..a7488378 --- /dev/null +++ b/src/elementaryFunctions/sinh/zsinha.c @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** zsinha.c +** 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 +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + +doubleComplex zsinhs(doubleComplex); + +void zsinha(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = zsinhs(x[i]); + } +} diff --git a/src/elementaryFunctions/sinh/zsinhs.c b/src/elementaryFunctions/sinh/zsinhs.c new file mode 100644 index 00000000..6820fb39 --- /dev/null +++ b/src/elementaryFunctions/sinh/zsinhs.c @@ -0,0 +1,23 @@ +/* +** -*- C -*- +** +** zsinhs.c +** 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 +** +** Copyright INRIA 2006 +*/ + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + +doubleComplex zsinhs(doubleComplex z) { + /* FIXME: Dummy... */ + return z; +} |