summaryrefslogtreecommitdiff
path: root/src/c/statisticsFunctions/strange
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/statisticsFunctions/strange')
-rw-r--r--src/c/statisticsFunctions/strange/dstrangea.c60
-rw-r--r--src/c/statisticsFunctions/strange/dstrangecola.c37
-rw-r--r--src/c/statisticsFunctions/strange/dstrangerowa.c35
-rw-r--r--src/c/statisticsFunctions/strange/sstrangea.c60
-rw-r--r--src/c/statisticsFunctions/strange/sstrangecola.c37
-rw-r--r--src/c/statisticsFunctions/strange/sstrangerowa.c35
-rw-r--r--src/c/statisticsFunctions/strange/u16strangea.c60
-rw-r--r--src/c/statisticsFunctions/strange/u16strangecola.c37
-rw-r--r--src/c/statisticsFunctions/strange/u16strangerowa.c35
9 files changed, 396 insertions, 0 deletions
diff --git a/src/c/statisticsFunctions/strange/dstrangea.c b/src/c/statisticsFunctions/strange/dstrangea.c
new file mode 100644
index 0000000..9dc94fe
--- /dev/null
+++ b/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/src/c/statisticsFunctions/strange/dstrangecola.c b/src/c/statisticsFunctions/strange/dstrangecola.c
new file mode 100644
index 0000000..d6a11e3
--- /dev/null
+++ b/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/src/c/statisticsFunctions/strange/dstrangerowa.c b/src/c/statisticsFunctions/strange/dstrangerowa.c
new file mode 100644
index 0000000..f63df35
--- /dev/null
+++ b/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/src/c/statisticsFunctions/strange/sstrangea.c b/src/c/statisticsFunctions/strange/sstrangea.c
new file mode 100644
index 0000000..f79b00a
--- /dev/null
+++ b/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/src/c/statisticsFunctions/strange/sstrangecola.c b/src/c/statisticsFunctions/strange/sstrangecola.c
new file mode 100644
index 0000000..4c8e90a
--- /dev/null
+++ b/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/src/c/statisticsFunctions/strange/sstrangerowa.c b/src/c/statisticsFunctions/strange/sstrangerowa.c
new file mode 100644
index 0000000..50c1165
--- /dev/null
+++ b/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/src/c/statisticsFunctions/strange/u16strangea.c b/src/c/statisticsFunctions/strange/u16strangea.c
new file mode 100644
index 0000000..66b31fb
--- /dev/null
+++ b/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/src/c/statisticsFunctions/strange/u16strangecola.c b/src/c/statisticsFunctions/strange/u16strangecola.c
new file mode 100644
index 0000000..6978360
--- /dev/null
+++ b/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/src/c/statisticsFunctions/strange/u16strangerowa.c b/src/c/statisticsFunctions/strange/u16strangerowa.c
new file mode 100644
index 0000000..b7f878d
--- /dev/null
+++ b/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);
+ }
+
+
+}