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 | |
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')
21 files changed, 574 insertions, 2 deletions
diff --git a/src/elementaryFunctions/Makefile b/src/elementaryFunctions/Makefile index 558216b1..4fb882aa 100644 --- a/src/elementaryFunctions/Makefile +++ b/src/elementaryFunctions/Makefile @@ -5,13 +5,15 @@ ## Made by Bruno JOFRET <bruno.jofret@inria.fr> ## ## Started on Tue Dec 5 09:19:53 2006 jofret -## Last update Fri Dec 8 14:05:32 2006 jofret +## Last update Fri Jan 5 16:12:42 2007 jofret ## ## Copyright INRIA 2006 ## DIRS = cos \ - sin #\ + sin \ + acos \ + asin#\ # cosh \ # sinh \ # tan \ 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)); +} diff --git a/src/elementaryFunctions/asin/Makefile b/src/elementaryFunctions/asin/Makefile new file mode 100644 index 00000000..adeafc2b --- /dev/null +++ b/src/elementaryFunctions/asin/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:13:51 2007 jofret +## +## Copyright INRIA 2007 +## + +NAME = ../../lib/libAsin.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 = sasins.c \ + dasins.c \ + casins.c \ + zasins.c \ + sasina.c \ + dasina.c \ + casina.c \ + zasina.c + +HEAD = asin.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/asin/asin.h b/src/elementaryFunctions/asin/asin.h new file mode 100644 index 00000000..cecf30df --- /dev/null +++ b/src/elementaryFunctions/asin/asin.h @@ -0,0 +1,57 @@ +/* +** -*- C -*- +** +** asin.h +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 10:20:35 2007 jofret +** Last update Fri Jan 5 16:22:36 2007 jofret +** +** Copyright INRIA 2007 +*/ + +/* +** Compute ArcSine for different types . +*/ + +/* +** \brief Float ArcSine function +*/ +float sasins(float); + +/* +** \brief Double ArcSine function +*/ +double dasins(double); + +/* +** \brief Float Complex ArcSine function +*/ +floatComplex casins(floatComplex); + +/* +** \brief Double Complex ArcSine function +*/ +doubleComplex zasins(doubleComplex); + +/* +** \brief Float Matrix ArcSine function +*/ +void sasina(float*, int, float*, int, int); + +/* +** \brief Double Matrix ArcSine function +*/ +void dasina(double*, int, double*, int, int); + +/* +** \brief Float Complex Matrix ArcSine function +*/ +void casina(floatComplex*, int, floatComplex*, int, int); + +/* +** \brief Double Complex Matrix ArcSine function +*/ +void zasina(doubleComplex*, int, doubleComplex*, int, int); + + diff --git a/src/elementaryFunctions/asin/casina.c b/src/elementaryFunctions/asin/casina.c new file mode 100644 index 00000000..8cbec360 --- /dev/null +++ b/src/elementaryFunctions/asin/casina.c @@ -0,0 +1,29 @@ +/* +** -*- C -*- +** +** casina.c +** 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 +** +** Copyright INRIA 2007 +*/ + + + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex casins(floatComplex); + +void casina(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = casins(x[i]); + } +} diff --git a/src/elementaryFunctions/asin/casins.c b/src/elementaryFunctions/asin/casins.c new file mode 100644 index 00000000..32cfbd59 --- /dev/null +++ b/src/elementaryFunctions/asin/casins.c @@ -0,0 +1,23 @@ +/* +** -*- C -*- +** +** casins.c +** 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 +** +** Copyright INRIA 2007 +*/ + +#ifndef STDC99 +#include "floatComplex.h" +#else +#include <complex.h> +typedef float complex floatComplex; +#endif + +floatComplex casins(floatComplex z) { + /* FIXME: Dummy... */ + return z; +} diff --git a/src/elementaryFunctions/asin/dasina.c b/src/elementaryFunctions/asin/dasina.c new file mode 100644 index 00000000..3854aeb3 --- /dev/null +++ b/src/elementaryFunctions/asin/dasina.c @@ -0,0 +1,21 @@ +/* +** -*- C -*- +** +** dasina.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 11:29:20 2007 jofret +** Last update Fri Jan 5 16:23:58 2007 jofret +** +** Copyright INRIA 2007 +*/ + + +double dasins(double); + +void dasina(double* x, int strideX, double* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = dasins(x[i]); + } +} diff --git a/src/elementaryFunctions/asin/dasins.c b/src/elementaryFunctions/asin/dasins.c new file mode 100644 index 00000000..d8c751ff --- /dev/null +++ b/src/elementaryFunctions/asin/dasins.c @@ -0,0 +1,18 @@ +/* +** -*- C -*- +** +** dasins.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 10:26:21 2007 jofret +** Last update Fri Jan 5 16:23:45 2007 jofret +** +** Copyright INRIA 2007 +*/ + + +#include <math.h> + +double dasins(double x) { + return (asin(x)); +} diff --git a/src/elementaryFunctions/asin/sasina.c b/src/elementaryFunctions/asin/sasina.c new file mode 100644 index 00000000..2b38a409 --- /dev/null +++ b/src/elementaryFunctions/asin/sasina.c @@ -0,0 +1,21 @@ +/* +** -*- C -*- +** +** sasina.c +** 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 +** +** Copyright INRIA 2007 +*/ + + +float sasins(float); + +void sasina(float* x, int strideX, float* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = sasins(x[i]); + } +} diff --git a/src/elementaryFunctions/asin/sasins.c b/src/elementaryFunctions/asin/sasins.c new file mode 100644 index 00000000..9e36879e --- /dev/null +++ b/src/elementaryFunctions/asin/sasins.c @@ -0,0 +1,17 @@ +/* +** -*- C -*- +** +** sasins.c +** Made by Bruno JOFRET <bruno.jofret@inria.fr> +** +** Started on Fri Jan 5 10:25:44 2007 jofret +** Last update Fri Jan 5 16:23:20 2007 jofret +** +** Copyright INRIA 2007 +*/ + +#include <math.h> + +float sasins(float x) { + return (asin(x)); +} diff --git a/src/elementaryFunctions/asin/zasina.c b/src/elementaryFunctions/asin/zasina.c new file mode 100644 index 00000000..c9e13f2d --- /dev/null +++ b/src/elementaryFunctions/asin/zasina.c @@ -0,0 +1,27 @@ +/* +** -*- C -*- +** +** zasina.c +** 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 +** +** Copyright INRIA 2007 +*/ + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + +doubleComplex zasins(doubleComplex); + +void zasina(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) { + int i = 0; + for (i = 0; i < size; ++i) { + y[i] = zasins(x[i]); + } +} diff --git a/src/elementaryFunctions/asin/zasins.c b/src/elementaryFunctions/asin/zasins.c new file mode 100644 index 00000000..9ffed91f --- /dev/null +++ b/src/elementaryFunctions/asin/zasins.c @@ -0,0 +1,25 @@ +/* +** -*- C -*- +** +** zasins.c +** 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 +** +** Copyright INRIA 2007 +*/ + + +#ifndef STDC99 +#include "doubleComplex.h" +#else +#include <complex.h> +typedef double complex doubleComplex; +#endif + + +doubleComplex zasins(doubleComplex z) { + /* FIXME: Dummy... */ + return (DoubleComplex(0,1)); +} |