summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjofret2006-12-08 16:02:20 +0000
committerjofret2006-12-08 16:02:20 +0000
commit67967f518d88e77869b0f434f5c15d0778915f00 (patch)
tree0efca247f67a003bc78e60492bbb3a8c9510f6cb /src
parent62cf055a899adcc2678fd8bd72f7dbb633d1b8da (diff)
downloadscilab2c-67967f518d88e77869b0f434f5c15d0778915f00.tar.gz
scilab2c-67967f518d88e77869b0f434f5c15d0778915f00.tar.bz2
scilab2c-67967f518d88e77869b0f434f5c15d0778915f00.zip
adding Sine functions
but still some work to do
Diffstat (limited to 'src')
-rw-r--r--src/elementaryFunctions/sin/Makefile47
-rw-r--r--src/elementaryFunctions/sin/csina.c27
-rw-r--r--src/elementaryFunctions/sin/csins.c23
-rw-r--r--src/elementaryFunctions/sin/dsina.c20
-rw-r--r--src/elementaryFunctions/sin/dsins.c17
-rw-r--r--src/elementaryFunctions/sin/sin.h57
-rw-r--r--src/elementaryFunctions/sin/ssina.c20
-rw-r--r--src/elementaryFunctions/sin/ssins.c17
-rw-r--r--src/elementaryFunctions/sin/zsina.c27
-rw-r--r--src/elementaryFunctions/sin/zsins.c23
10 files changed, 278 insertions, 0 deletions
diff --git a/src/elementaryFunctions/sin/Makefile b/src/elementaryFunctions/sin/Makefile
new file mode 100644
index 00000000..b37931d5
--- /dev/null
+++ b/src/elementaryFunctions/sin/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 Dec 8 16:38:48 2006 jofret
+##
+## Copyright INRIA 2006
+##
+
+NAME = ../../lib/libSin.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 = ssins.c \
+ dsins.c \
+ csins.c \
+ zsins.c \
+ ssina.c \
+ dsina.c \
+ csina.c \
+ zsina.c
+
+HEAD = sin.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/sin/csina.c b/src/elementaryFunctions/sin/csina.c
new file mode 100644
index 00000000..76e669dc
--- /dev/null
+++ b/src/elementaryFunctions/sin/csina.c
@@ -0,0 +1,27 @@
+/*
+** -*- C -*-
+**
+** csina.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Fri Dec 8 13:07:37 2006 jofret
+** Last update Fri Dec 8 14:01:46 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "floatComplex.h"
+#else
+#include <complex.h>
+typedef float complex floatComplex;
+#endif
+
+floatComplex csins(floatComplex);
+
+void csina(floatComplex* x, int strideX, floatComplex* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = csins(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/sin/csins.c b/src/elementaryFunctions/sin/csins.c
new file mode 100644
index 00000000..0b9ff889
--- /dev/null
+++ b/src/elementaryFunctions/sin/csins.c
@@ -0,0 +1,23 @@
+/*
+** -*- C -*-
+**
+** csins.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Fri Dec 8 12:04:39 2006 jofret
+** Last update Fri Dec 8 13:11:14 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "floatComplex.h"
+#else
+#include <complex.h>
+typedef float complex floatComplex;
+#endif
+
+floatComplex csins(floatComplex z) {
+ /* FIXME: Dummy... */
+ return z;
+}
diff --git a/src/elementaryFunctions/sin/dsina.c b/src/elementaryFunctions/sin/dsina.c
new file mode 100644
index 00000000..b8d6b9e9
--- /dev/null
+++ b/src/elementaryFunctions/sin/dsina.c
@@ -0,0 +1,20 @@
+/*
+** -*- C -*-
+**
+** dsina.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Fri Dec 8 11:02:19 2006 jofret
+** Last update Fri Dec 8 11:04:08 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+double dsins(double);
+
+void dsina(double* x, int strideX, double* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = dsins(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/sin/dsins.c b/src/elementaryFunctions/sin/dsins.c
new file mode 100644
index 00000000..6abb410b
--- /dev/null
+++ b/src/elementaryFunctions/sin/dsins.c
@@ -0,0 +1,17 @@
+/*
+** -*- C -*-
+**
+** dsins.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Fri Dec 8 10:50:58 2006 jofret
+** Last update Fri Dec 8 10:51:45 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#include <math.h>
+
+double dsins(double x) {
+ return (sin(x));
+}
diff --git a/src/elementaryFunctions/sin/sin.h b/src/elementaryFunctions/sin/sin.h
new file mode 100644
index 00000000..75ca0bd9
--- /dev/null
+++ b/src/elementaryFunctions/sin/sin.h
@@ -0,0 +1,57 @@
+/*
+** -*- C -*-
+**
+** sin.h
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Tue Dec 5 15:49:18 2006 jofret
+** Last update Fri Dec 8 10:10:07 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+/*
+** Compute Sine for different types .
+*/
+
+/*
+** \brief Float Sine function
+*/
+float ssins(float);
+
+/*
+** \brief Double Sine function
+*/
+double dsins(double);
+
+/*
+** \brief Float Complex Sine function
+*/
+floatComplex csins(floatComplex);
+
+/*
+** \brief Double Complex Sine function
+*/
+doubleComplex zsins(doubleComplex);
+
+/*
+** \brief Float Matrix Sine function
+*/
+void ssina(float*, int, float*, int, int);
+
+/*
+** \brief Double Matrix Sine function
+*/
+void dsina(double*, int, double*, int, int);
+
+/*
+** \brief Float Complex Matrix Sine function
+*/
+void csina(floatComplex*, int, floatComplex*, int, int);
+
+/*
+** \brief Double Complex Matrix Sine function
+*/
+void zsina(doubleComplex*, int, doubleComplex*, int, int);
+
+
diff --git a/src/elementaryFunctions/sin/ssina.c b/src/elementaryFunctions/sin/ssina.c
new file mode 100644
index 00000000..17411df7
--- /dev/null
+++ b/src/elementaryFunctions/sin/ssina.c
@@ -0,0 +1,20 @@
+/*
+** -*- C -*-
+**
+** ssina.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Fri Dec 8 10:52:14 2006 jofret
+** Last update Fri Dec 8 11:01:32 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+float ssins(float);
+
+void ssina(float* x, int strideX, float* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = ssins(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/sin/ssins.c b/src/elementaryFunctions/sin/ssins.c
new file mode 100644
index 00000000..93eae5aa
--- /dev/null
+++ b/src/elementaryFunctions/sin/ssins.c
@@ -0,0 +1,17 @@
+/*
+** -*- C -*-
+**
+** ssins.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Fri Dec 8 10:45:34 2006 jofret
+** Last update Fri Dec 8 10:46:23 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#include <math.h>
+
+float ssins(float x) {
+ return (sin(x));
+}
diff --git a/src/elementaryFunctions/sin/zsina.c b/src/elementaryFunctions/sin/zsina.c
new file mode 100644
index 00000000..838487d4
--- /dev/null
+++ b/src/elementaryFunctions/sin/zsina.c
@@ -0,0 +1,27 @@
+/*
+** -*- C -*-
+**
+** zsina.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Fri Dec 8 14:02:04 2006 jofret
+** Last update Fri Dec 8 14:04:27 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "doubleComplex.h"
+#else
+#include <complex.h>
+typedef double complex doubleComplex;
+#endif
+
+doubleComplex zsins(doubleComplex);
+
+void zsina(doubleComplex* x, int strideX, doubleComplex* y, int strideY, int size) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = zsins(x[i]);
+ }
+}
diff --git a/src/elementaryFunctions/sin/zsins.c b/src/elementaryFunctions/sin/zsins.c
new file mode 100644
index 00000000..80544ea9
--- /dev/null
+++ b/src/elementaryFunctions/sin/zsins.c
@@ -0,0 +1,23 @@
+/*
+** -*- C -*-
+**
+** zsins.c
+** Made by Bruno JOFRET <bruno.jofret@inria.fr>
+**
+** Started on Fri Dec 8 12:06:35 2006 jofret
+** Last update Fri Dec 8 13:02:34 2006 jofret
+**
+** Copyright INRIA 2006
+*/
+
+#ifndef STDC99
+#include "doubleComplex.h"
+#else
+#include <complex.h>
+typedef double complex doubleComplex;
+#endif
+
+doubleComplex zsins(doubleComplex z) {
+ /* FIXME: Dummy... */
+ return z;
+}