summaryrefslogtreecommitdiff
path: root/src/elementaryFunctions/asin
diff options
context:
space:
mode:
authorjofret2007-01-05 15:29:03 +0000
committerjofret2007-01-05 15:29:03 +0000
commit840757ed3de8916bef4636e8011e4597733e2e92 (patch)
tree08668917029b233d1ef7deadb787082f497ba4a6 /src/elementaryFunctions/asin
parent06cff68b037ef9a3b9b78a40cd15e5bccfbe269d (diff)
downloadscilab2c-840757ed3de8916bef4636e8011e4597733e2e92.tar.gz
scilab2c-840757ed3de8916bef4636e8011e4597733e2e92.tar.bz2
scilab2c-840757ed3de8916bef4636e8011e4597733e2e92.zip
ArcCosine and ArcSine functions in basic cases.
Diffstat (limited to 'src/elementaryFunctions/asin')
-rw-r--r--src/elementaryFunctions/asin/Makefile47
-rw-r--r--src/elementaryFunctions/asin/asin.h57
-rw-r--r--src/elementaryFunctions/asin/casina.c29
-rw-r--r--src/elementaryFunctions/asin/casins.c23
-rw-r--r--src/elementaryFunctions/asin/dasina.c21
-rw-r--r--src/elementaryFunctions/asin/dasins.c18
-rw-r--r--src/elementaryFunctions/asin/sasina.c21
-rw-r--r--src/elementaryFunctions/asin/sasins.c17
-rw-r--r--src/elementaryFunctions/asin/zasina.c27
-rw-r--r--src/elementaryFunctions/asin/zasins.c25
10 files changed, 285 insertions, 0 deletions
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));
+}