summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/elementaryFunctions
diff options
context:
space:
mode:
authorAbhinav Dronamraju2017-07-17 22:03:40 +0530
committerAbhinav Dronamraju2017-07-17 22:03:40 +0530
commitecbb528a2b7823d0512f3869f4d220e568c10025 (patch)
treeca35baab9f80f50bfdce12ffd00257e3b297df95 /2.3-1/src/c/elementaryFunctions
parent83869364b668666f317b348aca35a940e010761d (diff)
parent966afe93dbda0568dc376534ac94704ebbfb0329 (diff)
downloadScilab2C-ecbb528a2b7823d0512f3869f4d220e568c10025.tar.gz
Scilab2C-ecbb528a2b7823d0512f3869f4d220e568c10025.tar.bz2
Scilab2C-ecbb528a2b7823d0512f3869f4d220e568c10025.zip
Merged fossee master
Diffstat (limited to '2.3-1/src/c/elementaryFunctions')
-rw-r--r--2.3-1/src/c/elementaryFunctions/includes/isequal.h38
-rw-r--r--2.3-1/src/c/elementaryFunctions/interfaces/int_isequal.h35
-rw-r--r--2.3-1/src/c/elementaryFunctions/isequal/disequala.c39
-rw-r--r--2.3-1/src/c/elementaryFunctions/isequal/disequals.c24
-rw-r--r--2.3-1/src/c/elementaryFunctions/isequal/sisequala.c39
-rw-r--r--2.3-1/src/c/elementaryFunctions/isequal/sisequals.c24
-rw-r--r--2.3-1/src/c/elementaryFunctions/isequal/u16isequala.c40
-rw-r--r--2.3-1/src/c/elementaryFunctions/isequal/u16isequals.c25
-rw-r--r--2.3-1/src/c/elementaryFunctions/isequal/zisequala.c40
-rw-r--r--2.3-1/src/c/elementaryFunctions/isequal/zisequals.c25
10 files changed, 329 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/includes/isequal.h b/2.3-1/src/c/elementaryFunctions/includes/isequal.h
new file mode 100644
index 00000000..d22a8047
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/includes/isequal.h
@@ -0,0 +1,38 @@
+ /* 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 __ISEQUAL_H__
+#define __ISEQUAL_H__
+#include "types.h"
+#include "doubleComplex.h"
+#include "floatComplex.h"
+#include "uint16.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+char disequals(double inp1, double inp2);
+char disequala(double* inp1, int size1r, int size1c, double* inp2, int size2r, int size2c);
+char sisequals(float inp1, float inp2);
+char sisequala(float* inp1, int size1r, int size1c, float* inp2, int size2r, int size2c);
+char zisequals(doubleComplex inp1, doubleComplex inp2);
+char zisequala(doubleComplex* inp1, int size1r, int size1c, doubleComplex* inp2, int size2r, int size2c);
+char u16isequals(uint16 inp1, uint16 inp2);
+char u16isequala(uint16* inp1, int size1r, int size1c, uint16* inp2, int size2r, int size2c);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__ISEQUAL_H__*/
diff --git a/2.3-1/src/c/elementaryFunctions/interfaces/int_isequal.h b/2.3-1/src/c/elementaryFunctions/interfaces/int_isequal.h
new file mode 100644
index 00000000..d22ab65d
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/interfaces/int_isequal.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 __INT_ISEQUAL_H__
+#define __INT_ISEQUAL_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+
+#define d0d0isequalg0(in1,in2) disequals(in1,in2)
+#define d2d2isequalg0(in1, s1, in2, s2) disequala(in1, s1[0], s1[1], in2, s2[0], s2[1])
+#define s0s0isequalg0(in1,in2) sisequals(in1,in2)
+#define s2s2isequalg0(in1, s1, in2, s2) sisequala(in1, s1[0], s1[1], in2, s2[0], s2[1])
+#define z0z0isequalg0(in1,in2) zisequals(in1,in2)
+#define z2z2isequalg0(in1, s1, in2, s2) zisequala(in1, s1[0], s1[1], in2, s2[0], s2[1])
+#define u160u160isequalg0(in1,in2) u16isequals(in1,in2)
+#define u162u162isequalg0(in1, s1, in2, s2) u16isequala(in1, s1[0], s1[1], in2, s2[0], s2[1])
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__INT_ISEQUAL_H__*/
diff --git a/2.3-1/src/c/elementaryFunctions/isequal/disequala.c b/2.3-1/src/c/elementaryFunctions/isequal/disequala.c
new file mode 100644
index 00000000..8781ac7b
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/isequal/disequala.c
@@ -0,0 +1,39 @@
+/* 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 <isreal.h>
+
+char disequala(double* inp1, int size1r, int size1c, double* inp2, int size2r, int size2c)
+{
+ if ((size1r != size2r) && (size1c != size2c))
+ return 'F';
+ else
+ {
+ int i, f = 0;
+ for (i = 0; i<size1r*size1c; i++)
+ {
+ if (inp1[i] != inp2[i])
+ {
+ f = 1;
+ break;
+ }
+ }
+
+ if (f == 1)
+ return 'F';
+ else
+ return 'T';
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/isequal/disequals.c b/2.3-1/src/c/elementaryFunctions/isequal/disequals.c
new file mode 100644
index 00000000..319c3308
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/isequal/disequals.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 <isreal.h>
+
+char disequals(double inp1, double inp2)
+{
+ if (inp1 == inp2)
+ return 'T';
+ else
+ return 'F';
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/isequal/sisequala.c b/2.3-1/src/c/elementaryFunctions/isequal/sisequala.c
new file mode 100644
index 00000000..2634efd5
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/isequal/sisequala.c
@@ -0,0 +1,39 @@
+/* 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 <isreal.h>
+
+char sisequala(float* inp1, int size1r, int size1c, float* inp2, int size2r, int size2c)
+{
+ if ((size1r != size2r) && (size1c != size2c))
+ return 'F';
+ else
+ {
+ int i, f = 0;
+ for (i = 0; i<size1r*size1c; i++)
+ {
+ if (inp1[i] != inp2[i])
+ {
+ f = 1;
+ break;
+ }
+ }
+
+ if (f == 1)
+ return 'F';
+ else
+ return 'T';
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/isequal/sisequals.c b/2.3-1/src/c/elementaryFunctions/isequal/sisequals.c
new file mode 100644
index 00000000..66bef36d
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/isequal/sisequals.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 <isreal.h>
+
+char sisequals(float inp1, float inp2)
+{
+ if (inp1 == inp2)
+ return 'T';
+ else
+ return 'F';
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/isequal/u16isequala.c b/2.3-1/src/c/elementaryFunctions/isequal/u16isequala.c
new file mode 100644
index 00000000..62de1e86
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/isequal/u16isequala.c
@@ -0,0 +1,40 @@
+/* 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 <isreal.h>
+#include "uint16.h"
+
+char u16isequala(uint16* inp1, int size1r, int size1c, uint16* inp2, int size2r, int size2c)
+{
+ if ((size1r != size2r) && (size1c != size2c))
+ return 'F';
+ else
+ {
+ int i, f = 0;
+ for (i = 0; i<size1r*size1c; i++)
+ {
+ if (inp1[i] != inp2[i])
+ {
+ f = 1;
+ break;
+ }
+ }
+
+ if (f == 1)
+ return 'F';
+ else
+ return 'T';
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/isequal/u16isequals.c b/2.3-1/src/c/elementaryFunctions/isequal/u16isequals.c
new file mode 100644
index 00000000..4f797d40
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/isequal/u16isequals.c
@@ -0,0 +1,25 @@
+/* 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 <isreal.h>
+#include "uint16.h"
+
+char u16isequals(uint16 inp1, uint16 inp2)
+{
+ if (inp1 == inp2)
+ return 'T';
+ else
+ return 'F';
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/isequal/zisequala.c b/2.3-1/src/c/elementaryFunctions/isequal/zisequala.c
new file mode 100644
index 00000000..13d241fe
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/isequal/zisequala.c
@@ -0,0 +1,40 @@
+/* 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 <isreal.h>
+#include "doubleComplex.h"
+
+char zisequala(doubleComplex* inp1, int size1r, int size1c, doubleComplex* inp2, int size2r, int size2c)
+{
+ if ((size1r != size2r) && (size1c != size2c))
+ return 'F';
+ else
+ {
+ int i, f = 0;
+ for (i = 0; i<size1r*size1c; i++)
+ {
+ if (!(zisequals(inp1[i],inp2[i])))
+ {
+ f = 1;
+ break;
+ }
+ }
+
+ if (f == 1)
+ return 'F';
+ else
+ return 'T';
+ }
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/isequal/zisequals.c b/2.3-1/src/c/elementaryFunctions/isequal/zisequals.c
new file mode 100644
index 00000000..6914dc87
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/isequal/zisequals.c
@@ -0,0 +1,25 @@
+/* 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 <isreal.h>
+#include "doubleComplex.h"
+
+char zisequals(doubleComplex inp1, doubleComplex inp2)
+{
+ if ((zreals(inp1) == zreals(inp2)) && (zimags(inp1) == zimags(inp2)))
+ return 'T';
+ else
+ return 'F';
+}
+