summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/elementaryFunctions')
-rw-r--r--src/c/elementaryFunctions/includes/isinf.h35
-rw-r--r--src/c/elementaryFunctions/includes/sind.h37
-rw-r--r--src/c/elementaryFunctions/includes/tand (copy).h37
-rw-r--r--src/c/elementaryFunctions/includes/tand.h37
-rw-r--r--src/c/elementaryFunctions/interfaces/int_isinf.h20
-rw-r--r--src/c/elementaryFunctions/interfaces/int_sind.h23
-rw-r--r--src/c/elementaryFunctions/interfaces/int_tand.h23
-rw-r--r--src/c/elementaryFunctions/isinf/disinfs.c24
-rw-r--r--src/c/elementaryFunctions/isinf/sisinfs.c24
-rw-r--r--src/c/elementaryFunctions/sind/dsinda.c20
-rw-r--r--src/c/elementaryFunctions/sind/dsinds.c18
-rw-r--r--src/c/elementaryFunctions/sind/ssinda.c19
-rw-r--r--src/c/elementaryFunctions/sind/ssinds.c19
-rw-r--r--src/c/elementaryFunctions/tand/dtanda.c19
-rw-r--r--src/c/elementaryFunctions/tand/dtands.c18
-rw-r--r--src/c/elementaryFunctions/tand/standa.c19
-rw-r--r--src/c/elementaryFunctions/tand/stands.c19
17 files changed, 411 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/includes/isinf.h b/src/c/elementaryFunctions/includes/isinf.h
new file mode 100644
index 0000000..6752c37
--- /dev/null
+++ b/src/c/elementaryFunctions/includes/isinf.h
@@ -0,0 +1,35 @@
+ /* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __ISINF_H__
+#define __ISINF_H__
+
+#include "dynlib_elementaryfunctions.h"
+#include "floatComplex.h"
+#include "doubleComplex.h"
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char disinfs(double x);
+char sisinfs(float x);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* !__ISINF_H__ */
+
diff --git a/src/c/elementaryFunctions/includes/sind.h b/src/c/elementaryFunctions/includes/sind.h
new file mode 100644
index 0000000..d98bd68
--- /dev/null
+++ b/src/c/elementaryFunctions/includes/sind.h
@@ -0,0 +1,37 @@
+ /* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __SIND_H__
+#define __SIND_H__
+
+#include "dynlib_elementaryfunctions.h"
+#include "floatComplex.h"
+#include "doubleComplex.h"
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double dsinds(double x);
+float ssinds(float x);
+void dsinda(double* x, int size, double* y);
+void ssinda(float* x, int size, double* y);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* !__SIND_H__ */
+
diff --git a/src/c/elementaryFunctions/includes/tand (copy).h b/src/c/elementaryFunctions/includes/tand (copy).h
new file mode 100644
index 0000000..918d43a
--- /dev/null
+++ b/src/c/elementaryFunctions/includes/tand (copy).h
@@ -0,0 +1,37 @@
+ /* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __TAND_H__
+#define __TAND_H__
+
+#include "dynlib_elementaryfunctions.h"
+#include "floatComplex.h"
+#include "doubleComplex.h"
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+double dtands(double x);
+float stands(float x);
+void dtanda(double* x, int size, double* y);
+void standa(float* x, int size, double* y);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* !__TAND_H__ */
+
diff --git a/src/c/elementaryFunctions/includes/tand.h b/src/c/elementaryFunctions/includes/tand.h
new file mode 100644
index 0000000..918d43a
--- /dev/null
+++ b/src/c/elementaryFunctions/includes/tand.h
@@ -0,0 +1,37 @@
+ /* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __TAND_H__
+#define __TAND_H__
+
+#include "dynlib_elementaryfunctions.h"
+#include "floatComplex.h"
+#include "doubleComplex.h"
+#include "types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+double dtands(double x);
+float stands(float x);
+void dtanda(double* x, int size, double* y);
+void standa(float* x, int size, double* y);
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+
+#endif /* !__TAND_H__ */
+
diff --git a/src/c/elementaryFunctions/interfaces/int_isinf.h b/src/c/elementaryFunctions/interfaces/int_isinf.h
new file mode 100644
index 0000000..9eefa65
--- /dev/null
+++ b/src/c/elementaryFunctions/interfaces/int_isinf.h
@@ -0,0 +1,20 @@
+ /* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_ISINF_H__
+#define __INT_ISINF_H__
+
+#define d0isinfg0(in) disinfs(in)
+#define s0isinfg0(in) sisinfs(in)
+
+
+#endif /* !__INT_ISINF_H__ */
diff --git a/src/c/elementaryFunctions/interfaces/int_sind.h b/src/c/elementaryFunctions/interfaces/int_sind.h
new file mode 100644
index 0000000..780a696
--- /dev/null
+++ b/src/c/elementaryFunctions/interfaces/int_sind.h
@@ -0,0 +1,23 @@
+ /* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_SIND_H__
+#define __INT_SIND_H__
+
+#define d0sindd0(in) dsinds(in)
+#define s0sinds0(in) ssinds(in)
+#define s0sindd0(in) ssinds(in)
+#define d2sindd2(in, size1, out) dsinda(in, size1[0]*size1[1], out)
+#define s2sinds2(in, size1, out) ssinda(in, size1[0]*size1[1], out)
+#define s2sindd2(in, size1, out) ssinda(in, size1[0]*size1[1], out)
+
+#endif /* !__INT_SIND_H__ */
diff --git a/src/c/elementaryFunctions/interfaces/int_tand.h b/src/c/elementaryFunctions/interfaces/int_tand.h
new file mode 100644
index 0000000..d2fb30e
--- /dev/null
+++ b/src/c/elementaryFunctions/interfaces/int_tand.h
@@ -0,0 +1,23 @@
+ /* Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+ */
+
+#ifndef __INT_TAND_H__
+#define __INT_TAND_H__
+
+#define d0tandd0(in) dtands(in)
+#define s0tands0(in) stands(in)
+#define s0tandd0(in) stands(in)
+#define d2tandd2(in, size1, out) dtanda(in, size1[0]*size1[1], out)
+#define s2tands2(in, size1, out) standa(in, size1[0]*size1[1], out)
+#define s2tandd2(in, size1, out) standa(in, size1[0]*size1[1], out)
+
+#endif /* !__INT_TAND_H__ */
diff --git a/src/c/elementaryFunctions/isinf/disinfs.c b/src/c/elementaryFunctions/isinf/disinfs.c
new file mode 100644
index 0000000..1d94005
--- /dev/null
+++ b/src/c/elementaryFunctions/isinf/disinfs.c
@@ -0,0 +1,24 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "isinf.h"
+
+char disinfs(double x)
+{
+ char o = 'F';
+ if (x == INFINITY || x == - INFINITY)
+ o = 'T';
+ return o;
+}
diff --git a/src/c/elementaryFunctions/isinf/sisinfs.c b/src/c/elementaryFunctions/isinf/sisinfs.c
new file mode 100644
index 0000000..c36c0a5
--- /dev/null
+++ b/src/c/elementaryFunctions/isinf/sisinfs.c
@@ -0,0 +1,24 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "isinf.h"
+
+char sisinfs(float x)
+{
+ char o = 'F';
+ if (x == INFINITY || x == - INFINITY)
+ o = 'T';
+ return o;
+}
diff --git a/src/c/elementaryFunctions/sind/dsinda.c b/src/c/elementaryFunctions/sind/dsinda.c
new file mode 100644
index 0000000..c13fa0c
--- /dev/null
+++ b/src/c/elementaryFunctions/sind/dsinda.c
@@ -0,0 +1,20 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include "sind.h"
+
+void dsinda(double* x, int size, double* y) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = dsinds(x[i]);
+ }
+}
diff --git a/src/c/elementaryFunctions/sind/dsinds.c b/src/c/elementaryFunctions/sind/dsinds.c
new file mode 100644
index 0000000..f7dc54f
--- /dev/null
+++ b/src/c/elementaryFunctions/sind/dsinds.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include <math.h>
+#include "sind.h"
+#define PI 3.1415927
+
+double dsinds(double x) {
+ return sin(x*PI/180);
+}
diff --git a/src/c/elementaryFunctions/sind/ssinda.c b/src/c/elementaryFunctions/sind/ssinda.c
new file mode 100644
index 0000000..baefd68
--- /dev/null
+++ b/src/c/elementaryFunctions/sind/ssinda.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include "sind.h"
+
+void ssinda(float* x, int size, double* y) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = ssinds(x[i]);
+ }
+}
diff --git a/src/c/elementaryFunctions/sind/ssinds.c b/src/c/elementaryFunctions/sind/ssinds.c
new file mode 100644
index 0000000..9d5bf0e
--- /dev/null
+++ b/src/c/elementaryFunctions/sind/ssinds.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include <math.h>
+#include "sind.h"
+#include "sin.h"
+#define PI 3.1415927
+
+float ssinds(float x) {
+ return ssins(x*PI/180);
+}
diff --git a/src/c/elementaryFunctions/tand/dtanda.c b/src/c/elementaryFunctions/tand/dtanda.c
new file mode 100644
index 0000000..e5d56a8
--- /dev/null
+++ b/src/c/elementaryFunctions/tand/dtanda.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include "tand.h"
+
+void dtanda(double* x, int size, double* y) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = dtands(x[i]);
+ }
+}
diff --git a/src/c/elementaryFunctions/tand/dtands.c b/src/c/elementaryFunctions/tand/dtands.c
new file mode 100644
index 0000000..6fda5b7
--- /dev/null
+++ b/src/c/elementaryFunctions/tand/dtands.c
@@ -0,0 +1,18 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include <math.h>
+#include "tand.h"
+#define PI 3.1415927
+
+double dtands(double x) {
+ return tan(x*PI/180);
+}
diff --git a/src/c/elementaryFunctions/tand/standa.c b/src/c/elementaryFunctions/tand/standa.c
new file mode 100644
index 0000000..e37f5a0
--- /dev/null
+++ b/src/c/elementaryFunctions/tand/standa.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include "tand.h"
+
+void standa(float* x, int size, double* y) {
+ int i = 0;
+ for (i = 0; i < size; ++i) {
+ y[i] = stands(x[i]);
+ }
+}
diff --git a/src/c/elementaryFunctions/tand/stands.c b/src/c/elementaryFunctions/tand/stands.c
new file mode 100644
index 0000000..4d66701
--- /dev/null
+++ b/src/c/elementaryFunctions/tand/stands.c
@@ -0,0 +1,19 @@
+/* Copyright (C) 2016 - IIT Bombay - FOSSEE
+
+ This file must be used under the terms of the CeCILL.
+ This source file is licensed as described in the file COPYING, which
+ you should have received as part of this distribution. The terms
+ are also available at
+ http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ Author: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+#include <math.h>
+#include "tand.h"
+#include "tan.h"
+#define PI 3.1415927
+
+float stands(float x) {
+ return stans(x*PI/180);
+}