summaryrefslogtreecommitdiff
path: root/src/elementaryFunctions/tan
diff options
context:
space:
mode:
Diffstat (limited to 'src/elementaryFunctions/tan')
-rw-r--r--src/elementaryFunctions/tan/Makefile47
-rw-r--r--src/elementaryFunctions/tan/ctana.c28
-rw-r--r--src/elementaryFunctions/tan/ctans.c23
-rw-r--r--src/elementaryFunctions/tan/dtana.c20
-rw-r--r--src/elementaryFunctions/tan/dtans.c17
-rw-r--r--src/elementaryFunctions/tan/stana.c20
-rw-r--r--src/elementaryFunctions/tan/stans.c17
-rw-r--r--src/elementaryFunctions/tan/tan.h57
-rw-r--r--src/elementaryFunctions/tan/ztana.c27
-rw-r--r--src/elementaryFunctions/tan/ztans.c24
10 files changed, 280 insertions, 0 deletions
diff --git a/src/elementaryFunctions/tan/Makefile b/src/elementaryFunctions/tan/Makefile
new file mode 100644
index 00000000..3f22534d
--- /dev/null
+++ b/src/elementaryFunctions/tan/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 Mon Jan 29 16:08:57 2007 jofret
+##
+## Copyright INRIA 2006
+##
+
+NAME = ../../lib/libTan.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 = stans.c \
+ dtans.c \
+ ctans.c \
+ ztans.c \
+ stana.c \
+ dtana.c \
+ ctana.c \
+ ztana.c
+
+HEAD = tan.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/tan/ctana.c b/src/elementaryFunctions/tan/ctana.c
new file mode 100644
index 00000000..77a6df0c
--- /dev/null
+++ b/src/elementaryFunctions/tan/ctana.c
@@ -0,0 +1,28 @@
+/*
+** -*- C -*-
+**
+** ctana.c
+** 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
+**
+** Copyright INRIA 2006
+*/
+
+
+#ifndef STDC99
+#include "floatComplex.h"
+#else
+#include <complex.h>
+typedef float complex floatComplex;
+#endif
+
+floatComplex ctans(floatComplex);
+
+void ctana(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = ctans(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/tan/ctans.c b/src/elementaryFunctions/tan/ctans.c
new file mode 100644
index 00000000..a1d4a81e
--- /dev/null
+++ b/src/elementaryFunctions/tan/ctans.c
@@ -0,0 +1,23 @@
+/*
+** -*- C -*-
+**
+** ctans.c
+** 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
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "floatComplex.h"
+#else
+#include <complex.h>
+typedef float complex floatComplex;
+#endif
+
+floatComplex ctans(floatComplex z) {
+ /* FIXME: Dummy... */
+ return z;
+}
diff --git a/src/elementaryFunctions/tan/dtana.c b/src/elementaryFunctions/tan/dtana.c
new file mode 100644
index 00000000..42e85490
--- /dev/null
+++ b/src/elementaryFunctions/tan/dtana.c
@@ -0,0 +1,20 @@
+/*
+** -*- C -*-
+**
+** dtana.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 14:54:56 2006 jofret
+** Last update Mon Jan 29 16:12:12 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+double dtans(double);
+
+void dtana(double* x, int strideX, double* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = dtans(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/tan/dtans.c b/src/elementaryFunctions/tan/dtans.c
new file mode 100644
index 00000000..c4ce0346
--- /dev/null
+++ b/src/elementaryFunctions/tan/dtans.c
@@ -0,0 +1,17 @@
+/*
+** -*- C -*-
+**
+** dtans.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 12:02:41 2006 jofret
+** Last update Mon Jan 29 16:12:01 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#include <math.h>
+
+double dtans(double x) {
+ return (tan(x));
+}
diff --git a/src/elementaryFunctions/tan/stana.c b/src/elementaryFunctions/tan/stana.c
new file mode 100644
index 00000000..44058c44
--- /dev/null
+++ b/src/elementaryFunctions/tan/stana.c
@@ -0,0 +1,20 @@
+/*
+** -*- C -*-
+**
+** stana.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 16:03:27 2006 jofret
+** Last update Mon Jan 29 16:11:44 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+float stans(float);
+
+void stana(float* x, int strideX, float* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = stans(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/tan/stans.c b/src/elementaryFunctions/tan/stans.c
new file mode 100644
index 00000000..afea84a4
--- /dev/null
+++ b/src/elementaryFunctions/tan/stans.c
@@ -0,0 +1,17 @@
+/*
+** -*- C -*-
+**
+** stans.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Thu Dec 7 11:05:37 2006 jofret
+** Last update Mon Jan 29 16:11:29 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#include <math.h>
+
+float stans(float x) {
+ return (tan(x));
+}
diff --git a/src/elementaryFunctions/tan/tan.h b/src/elementaryFunctions/tan/tan.h
new file mode 100644
index 00000000..62309c9e
--- /dev/null
+++ b/src/elementaryFunctions/tan/tan.h
@@ -0,0 +1,57 @@
+/*
+** -*- C -*-
+**
+** tan.h
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Tue Dec 5 15:49:18 2006 jofret
+** Last update Mon Jan 29 16:10:30 2007 jofret
+**
+** Copyright INRIA 2006
+*/
+
+/*
+** Compute Tangeant for different types .
+*/
+
+/*
+** \brief Float Tangeant function
+*/
+float stans(float);
+
+/*
+** \brief Double Tangeant function
+*/
+double dtans(double);
+
+/*
+** \brief Float Complex Tangeant function
+*/
+floatComplex ctans(floatComplex);
+
+/*
+** \brief Double Complex Tangeant function
+*/
+doubleComplex ztans(doubleComplex);
+
+/*
+** \brief Float Matrix Tangeant function
+*/
+void stana(float*, int, float*, int, int);
+
+/*
+** \brief Double Matrix Tangeant function
+*/
+void dtana(double*, int, double*, int, int);
+
+/*
+** \brief Float Complex Matrix Tangeant function
+*/
+void ctana(floatComplex*, int, floatComplex*, int, int);
+
+/*
+** \brief Double Complex Matrix Tangeant function
+*/
+void ztana(doubleComplex*, int, doubleComplex*, int, int);
+
+
diff --git a/src/elementaryFunctions/tan/ztana.c b/src/elementaryFunctions/tan/ztana.c
new file mode 100644
index 00000000..a815e58b
--- /dev/null
+++ b/src/elementaryFunctions/tan/ztana.c
@@ -0,0 +1,27 @@
+/*
+** -*- C -*-
+**
+** ztana.c
+** 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
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "doubleComplex.h"
+#else
+#include <complex.h>
+typedef double complex doubleComplex;
+#endif
+
+doubleComplex ztans(doubleComplex);
+
+void ztana(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = ztans(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/tan/ztans.c b/src/elementaryFunctions/tan/ztans.c
new file mode 100644
index 00000000..9c37fdc5
--- /dev/null
+++ b/src/elementaryFunctions/tan/ztans.c
@@ -0,0 +1,24 @@
+/*
+** -*- C -*-
+**
+** ztans.c
+** 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
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "doubleComplex.h"
+#else
+#include <complex.h>
+typedef double complex doubleComplex;
+#endif
+
+
+doubleComplex ztans(doubleComplex z) {
+ /* FIXME: Dummy... */
+ return (DoubleComplex(0,1));
+}