summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/statisticsFunctions/strange
diff options
context:
space:
mode:
authorBrijeshcr2017-09-11 12:03:59 +0530
committerGitHub2017-09-11 12:03:59 +0530
commitb2518f279a3005536e87e45302d4e05d9aeb6d3d (patch)
tree007de2537151d82e75a6015f47f228402144763e /2.3-1/src/c/statisticsFunctions/strange
parenta7ca3ed26f1fa8f51c586aba300005bf4a700cc4 (diff)
parent75558fc35bebe72c6db7e1b3b0c7ae214aa4fc8e (diff)
downloadScilab2C-master.tar.gz
Scilab2C-master.tar.bz2
Scilab2C-master.zip
Merge pull request #29 from abhinavdronamraju/masterHEADmaster
Merged and added functions
Diffstat (limited to '2.3-1/src/c/statisticsFunctions/strange')
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/dstrangea.c60
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/dstrangecola.c37
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/dstrangerowa.c35
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/sstrangea.c60
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/sstrangecola.c37
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/sstrangerowa.c35
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/u16strangea.c60
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/u16strangecola.c37
-rw-r--r--2.3-1/src/c/statisticsFunctions/strange/u16strangerowa.c35
9 files changed, 396 insertions, 0 deletions
diff --git a/2.3-1/src/c/statisticsFunctions/strange/dstrangea.c b/2.3-1/src/c/statisticsFunctions/strange/dstrangea.c
new file mode 100644
index 00000000..9dc94fe0
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/dstrangea.c
@@ -0,0 +1,60 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+#include "subtraction.h"
+
+double dstrangea(double *in, int size)
+{
+ double a; double in_copy[size];
+
+ for(int i=0; i< size; i++)
+
+ {
+ in_copy[i]= in[i];
+
+ }
+
+
+
+ for (int i = 0; i < size; ++i)
+
+ {
+
+ for (int j = i + 1; j < size; ++j)
+
+ {
+
+ if (in_copy[i] > in_copy[j])
+
+ {
+
+ a = in_copy[i];
+
+ in_copy[i] = in_copy[j];
+
+ in_copy[j] = a;
+
+ }
+
+ }
+
+ }
+
+
+
+return ddiffs(in_copy[size-1],in_copy[0]);
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/strange/dstrangecola.c b/2.3-1/src/c/statisticsFunctions/strange/dstrangecola.c
new file mode 100644
index 00000000..d6a11e3d
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/dstrangecola.c
@@ -0,0 +1,37 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+#include "stdio.h"
+
+void dstrangecola(double *in, int row, int col, double* out)
+{
+ double inter[col];
+
+
+for(int i=0; i< row; i++)
+ {
+ for(int j=0 ; j< col; j++)
+ {
+ inter[j]= in[i+ (j*row)];
+
+ }
+
+ out[i]= dstrangea(inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/strange/dstrangerowa.c b/2.3-1/src/c/statisticsFunctions/strange/dstrangerowa.c
new file mode 100644
index 00000000..f63df35c
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/dstrangerowa.c
@@ -0,0 +1,35 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+
+void dstrangerowa(double *in, int row, int col, double* out)
+{
+ double inter[row];
+
+
+for(int i=0; i< col; i++)
+ {
+ for(int j=0 ; j< row; j++)
+ {
+ inter[j]= in[j+ (i*row)];
+
+ }
+
+ out[i]= dstrangea(inter, row);
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/strange/sstrangea.c b/2.3-1/src/c/statisticsFunctions/strange/sstrangea.c
new file mode 100644
index 00000000..f79b00af
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/sstrangea.c
@@ -0,0 +1,60 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+#include "subtraction.h"
+
+float sstrangea(float *in, int size)
+{
+ float a; float in_copy[size];
+
+ for(int i=0; i< size; i++)
+
+ {
+ in_copy[i]= in[i];
+
+ }
+
+
+
+ for (int i = 0; i < size; ++i)
+
+ {
+
+ for (int j = i + 1; j < size; ++j)
+
+ {
+
+ if (in_copy[i] > in_copy[j])
+
+ {
+
+ a = in_copy[i];
+
+ in_copy[i] = in_copy[j];
+
+ in_copy[j] = a;
+
+ }
+
+ }
+
+ }
+
+
+
+return sdiffs(in_copy[size-1],in_copy[0]);
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/strange/sstrangecola.c b/2.3-1/src/c/statisticsFunctions/strange/sstrangecola.c
new file mode 100644
index 00000000..4c8e90a4
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/sstrangecola.c
@@ -0,0 +1,37 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+#include "stdio.h"
+
+void sstrangecola(float *in, int row, int col, float* out)
+{
+ float inter[col];
+
+
+for(int i=0; i< row; i++)
+ {
+ for(int j=0 ; j< col; j++)
+ {
+ inter[j]= in[i+ (j*row)];
+
+ }
+
+ out[i]= sstrangea(inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/strange/sstrangerowa.c b/2.3-1/src/c/statisticsFunctions/strange/sstrangerowa.c
new file mode 100644
index 00000000..50c1165c
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/sstrangerowa.c
@@ -0,0 +1,35 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+
+void sstrangerowa(float *in, int row, int col, float* out)
+{
+ float inter[row];
+
+
+for(int i=0; i< col; i++)
+ {
+ for(int j=0 ; j< row; j++)
+ {
+ inter[j]= in[j+ (i*row)];
+
+ }
+
+ out[i]= sstrangea(inter, row);
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/strange/u16strangea.c b/2.3-1/src/c/statisticsFunctions/strange/u16strangea.c
new file mode 100644
index 00000000..66b31fb1
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/u16strangea.c
@@ -0,0 +1,60 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+#include "subtraction.h"
+
+uint16 u16strangea(uint16 *in, int size)
+{
+ uint16 a; uint16 in_copy[size];
+
+ for(int i=0; i< size; i++)
+
+ {
+ in_copy[i]= in[i];
+
+ }
+
+
+
+ for (int i = 0; i < size; ++i)
+
+ {
+
+ for (int j = i + 1; j < size; ++j)
+
+ {
+
+ if (in_copy[i] > in_copy[j])
+
+ {
+
+ a = in_copy[i];
+
+ in_copy[i] = in_copy[j];
+
+ in_copy[j] = a;
+
+ }
+
+ }
+
+ }
+
+
+
+return u16diffs(in_copy[size-1],in_copy[0]);
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/strange/u16strangecola.c b/2.3-1/src/c/statisticsFunctions/strange/u16strangecola.c
new file mode 100644
index 00000000..69783607
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/u16strangecola.c
@@ -0,0 +1,37 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+#include "stdio.h"
+
+void u16strangecola(uint16 *in, int row, int col, uint16* out)
+{
+ uint16 inter[col];
+
+
+for(int i=0; i< row; i++)
+ {
+ for(int j=0 ; j< col; j++)
+ {
+ inter[j]= in[i+ (j*row)];
+
+ }
+
+ out[i]= u16strangea(inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/strange/u16strangerowa.c b/2.3-1/src/c/statisticsFunctions/strange/u16strangerowa.c
new file mode 100644
index 00000000..b7f878d0
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/strange/u16strangerowa.c
@@ -0,0 +1,35 @@
+/* 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: Abhinav Dronamraju
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+
+#include "strange.h"
+#include "types.h"
+#include "uint16.h"
+
+void u16strangerowa(uint16 *in, int row, int col, uint16* out)
+{
+ uint16 inter[row];
+
+
+for(int i=0; i< col; i++)
+ {
+ for(int j=0 ; j< row; j++)
+ {
+ inter[j]= in[j+ (i*row)];
+
+ }
+
+ out[i]= u16strangea(inter, row);
+ }
+
+
+}