diff options
author | jofret | 2007-01-05 15:29:03 +0000 |
---|---|---|
committer | jofret | 2007-01-05 15:29:03 +0000 |
commit | 840757ed3de8916bef4636e8011e4597733e2e92 (patch) | |
tree | 08668917029b233d1ef7deadb787082f497ba4a6 /src/elementaryFunctions/acos | |
parent | 06cff68b037ef9a3b9b78a40cd15e5bccfbe269d (diff) | |
download | scilab2c-840757ed3de8916bef4636e8011e4597733e2e92.tar.gz scilab2c-840757ed3de8916bef4636e8011e4597733e2e92.tar.bz2 scilab2c-840757ed3de8916bef4636e8011e4597733e2e92.zip |
ArcCosine and ArcSine functions in basic cases.
Diffstat (limited to 'src/elementaryFunctions/acos')
-rw-r--r-- | src/elementaryFunctions/acos/Makefile | 47 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/acos.h | 57 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/cacosa.c | 29 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/cacoss.c | 23 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/dacosa.c | 21 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/dacoss.c | 18 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/sacosa.c | 21 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/sacoss.c | 17 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/zacosa.c | 27 | ||||
-rw-r--r-- | src/elementaryFunctions/acos/zacoss.c | 25 |
10 files changed, 285 insertions, 0 deletions
diff --git a/src/elementaryFunctions/acos/Makefile b/src/elementaryFunctions/acos/Makefile new file mode 100644 index 00000000..aa981c04 --- /dev/null +++ b/src/elementaryFunctions/acos/Makefile @@ -0,0 +1,47 @@ +## +## -*- makefile -*- +## +## Makefile +## 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 +## +## Copyright INRIA 2007 +## + +NAME = ../../lib/libAcos.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 = sacoss.c \ + dacoss.c \ + cacoss.c \ + zacoss.c \ + sacosa.c \ + dacosa.c \ + cacosa.c \ + zacosa.c + +HEAD = acos.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/acos/acos.h b/src/elementaryFunctions/acos/acos.h new file mode 100644 index 00000000..2f45482c --- /dev/null +++ b/src/elementaryFunctions/acos/acos.h @@ -0,0 +1,57 @@ +/* +** -*- C -*- +** +** acos.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 10:20:35 2007 jofret +** Last update Fri Jan 5 10:21:28 2007 jofret +** +** Copyright INRIA 2007 +*/ + +/* +** Compute ArcCosine for different types . +*/ + +/* +** \brief Float ArcCosine function +*/ +float sacoss(float); + +/* +** \brief Double ArcCosine function +*/ +double dacoss(double); + +/* +** \brief Float Complex ArcCosine function +*/ +floatComplex cacoss(floatComplex); + +/* +** \brief Double Complex ArcCosine function +*/ +doubleComplex zacoss(doubleComplex); + +/* +** \brief Float Matrix ArcCosine function +*/ +void sacosa(float*, int, float*, int, int); + +/* +** \brief Double Matrix ArcCosine function +*/ +void dacosa(double*, int, double*, int, int); + +/* +** \brief Float Complex Matrix ArcCosine function +*/ +void cacosa(floatComplex*, int, floatComplex*, int, int); + +/* +** \brief Double Complex Matrix ArcCosine function +*/ +void zacosa(doubleComplex*, int, doubleComplex*, int, int); + + diff --git a/src/elementaryFunctions/acos/cacosa.c b/src/elementaryFunctions/acos/cacosa.c new file mode 100644 index 00000000..da1f5b69 --- /dev/null +++ b/src/elementaryFunctions/acos/cacosa.c @@ -0,0 +1,29 @@ +/* +** -*- C -*- +** +** cacosa.c +** 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 +** +** Copyright INRIA 2007 +*/ + + + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex cacoss(floatComplex); + +void cacosa(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = cacoss(x[i]); + } +} diff --git a/src/elementaryFunctions/acos/cacoss.c b/src/elementaryFunctions/acos/cacoss.c new file mode 100644 index 00000000..480b41e6 --- /dev/null +++ b/src/elementaryFunctions/acos/cacoss.c @@ -0,0 +1,23 @@ +/* +** -*- C -*- +** +** cacoss.c +** 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 +** +** Copyright INRIA 2007 +*/ + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex cacoss(floatComplex z) { + /* FIXME: Dummy... */ + return z; +} diff --git a/src/elementaryFunctions/acos/dacosa.c b/src/elementaryFunctions/acos/dacosa.c new file mode 100644 index 00000000..ba3aff1c --- /dev/null +++ b/src/elementaryFunctions/acos/dacosa.c @@ -0,0 +1,21 @@ +/* +** -*- C -*- +** +** dacosa.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 11:29:20 2007 jofret +** Last update Fri Jan 5 11:29:30 2007 jofret +** +** Copyright INRIA 2007 +*/ + + +double dacoss(double); + +void dacosa(double* x, int strideX, double* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dacoss(x[i]); + } +} diff --git a/src/elementaryFunctions/acos/dacoss.c b/src/elementaryFunctions/acos/dacoss.c new file mode 100644 index 00000000..799ee316 --- /dev/null +++ b/src/elementaryFunctions/acos/dacoss.c @@ -0,0 +1,18 @@ +/* +** -*- C -*- +** +** dacoss.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 10:26:21 2007 jofret +** Last update Fri Jan 5 10:26:28 2007 jofret +** +** Copyright INRIA 2007 +*/ + + +#include <math.h> + +double dacoss(double x) { + return (acos(x)); +} diff --git a/src/elementaryFunctions/acos/sacosa.c b/src/elementaryFunctions/acos/sacosa.c new file mode 100644 index 00000000..f33fc4da --- /dev/null +++ b/src/elementaryFunctions/acos/sacosa.c @@ -0,0 +1,21 @@ +/* +** -*- C -*- +** +** sacosa.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 10:25:57 2007 jofret +** Last update Fri Jan 5 10:26:07 2007 jofret +** +** Copyright INRIA 2007 +*/ + + +float sacoss(float); + +void sacosa(float* x, int strideX, float* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = sacoss(x[i]); + } +} diff --git a/src/elementaryFunctions/acos/sacoss.c b/src/elementaryFunctions/acos/sacoss.c new file mode 100644 index 00000000..d0d51262 --- /dev/null +++ b/src/elementaryFunctions/acos/sacoss.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** sacoss.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 10:25:44 2007 jofret +** Last update Fri Jan 5 10:25:52 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include <math.h> + +float sacoss(float x) { + return (acos(x)); +} diff --git a/src/elementaryFunctions/acos/zacosa.c b/src/elementaryFunctions/acos/zacosa.c new file mode 100644 index 00000000..e8c5387d --- /dev/null +++ b/src/elementaryFunctions/acos/zacosa.c @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** zacosa.c +** 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 +** +** Copyright INRIA 2007 +*/ + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + +doubleComplex zacoss(doubleComplex); + +void zacosa(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = zacoss(x[i]); + } +} diff --git a/src/elementaryFunctions/acos/zacoss.c b/src/elementaryFunctions/acos/zacoss.c new file mode 100644 index 00000000..1b197905 --- /dev/null +++ b/src/elementaryFunctions/acos/zacoss.c @@ -0,0 +1,25 @@ +/* +** -*- C -*- +** +** zacoss.c +** 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 +** +** Copyright INRIA 2007 +*/ + + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + + +doubleComplex zacoss(doubleComplex z) { + /* FIXME: Dummy... */ + return (DoubleComplex(0,1)); +} |