summaryrefslogtreecommitdiff
path: root/src/c/statisticsFunctions
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/statisticsFunctions')
-rw-r--r--src/c/statisticsFunctions/includes/mvcorrel.h37
-rw-r--r--src/c/statisticsFunctions/includes/strange.h43
-rw-r--r--src/c/statisticsFunctions/interfaces/int_mvcorrel.h33
-rw-r--r--src/c/statisticsFunctions/interfaces/int_strange.h26
-rw-r--r--src/c/statisticsFunctions/mvcorrel/dmvcorrel1a.c34
-rw-r--r--src/c/statisticsFunctions/mvcorrel/dmvcorrela.c87
-rw-r--r--src/c/statisticsFunctions/mvcorrel/smvcorrel1a.c34
-rw-r--r--src/c/statisticsFunctions/mvcorrel/smvcorrela.c87
-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
17 files changed, 777 insertions, 0 deletions
diff --git a/src/c/statisticsFunctions/includes/mvcorrel.h b/src/c/statisticsFunctions/includes/mvcorrel.h
new file mode 100644
index 0000000..f1ed94c
--- /dev/null
+++ b/src/c/statisticsFunctions/includes/mvcorrel.h
@@ -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
+*/
+
+
+#ifndef __MVCORREL_H__
+#define __MVCORREL_H__
+
+#include "types.h"
+#include "doubleComplex.h"
+#include "uint16.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+void dmvcorrela(double* , int, int, double* );
+double dmvcorrel1a( int, int);
+
+void smvcorrela(float* , int, int, float* );
+float smvcorrel1a( int, int);
+
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__MVCORREL_H__*/
diff --git a/src/c/statisticsFunctions/includes/strange.h b/src/c/statisticsFunctions/includes/strange.h
new file mode 100644
index 0000000..0c783ad
--- /dev/null
+++ b/src/c/statisticsFunctions/includes/strange.h
@@ -0,0 +1,43 @@
+/* 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
+*/
+
+#ifndef __STRANGE_H__
+#define __STRANGE_H__
+
+
+#include "types.h"
+#include "doubleComplex.h"
+#include "floatComplex.h"
+#include "uint16.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+double dstrangea (double* , int);
+void dstrangerowa (double*, int , int, double*);
+void dstrangecola (double*, int , int, double*);
+
+float sstrangea (float* , int);
+void sstrangerowa (float*, int , int, float*);
+void sstrangecola (float*, int , int, float*);
+
+uint16 u16strangea (uint16* , int);
+void u16strangerowa (uint16*, int , int, uint16*);
+void u16strangecola (uint16*, int , int, uint16*);
+
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif
diff --git a/src/c/statisticsFunctions/interfaces/int_mvcorrel.h b/src/c/statisticsFunctions/interfaces/int_mvcorrel.h
new file mode 100644
index 0000000..481841f
--- /dev/null
+++ b/src/c/statisticsFunctions/interfaces/int_mvcorrel.h
@@ -0,0 +1,33 @@
+/* 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
+*/
+
+#ifndef __INT_MVCORREL_H__
+#define __INT_MVCORREL_H__
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#define d2mvcorreld2(in1, size, out) dmvcorrela(in1, size[0] ,size[1], out)
+#define d2mvcorreld0(in1, size) dmvcorrel1a( size[0], size[1] )
+#define d0mvcorreld0(in1) dmvcorrel1a( 1,1 )
+
+#define s2mvcorrels2(in1, size, out) smvcorrela(in1, size[0] ,size[1], out)
+#define s2mvcorrels0(in1, size) smvcorrel1a( size[0], size[1] )
+#define s0mvcorrels0(in1) smvcorrel1a( 1,1 )
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#endif /*__INT_MVCORREL_H__*/
diff --git a/src/c/statisticsFunctions/interfaces/int_strange.h b/src/c/statisticsFunctions/interfaces/int_strange.h
new file mode 100644
index 0000000..133ec2b
--- /dev/null
+++ b/src/c/statisticsFunctions/interfaces/int_strange.h
@@ -0,0 +1,26 @@
+ /*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
+*/
+
+
+
+#ifndef __INT_STRANGE_H__
+#define __INT_STRANGE_H__
+
+#define d2stranged0(in1, size) dstrangea(in1,size[0]* size[1])
+#define d2g2stranged2(in1, size1, in2, size2, out) (in2[0]=='r') ? dstrangerowa(in1, size1[0], size1[1], out) : dstrangecola(in1, size1[0] , size1[1], out)
+
+#define s2stranges0(in1, size) sstrangea(in1,size[0]* size[1])
+#define s2g2stranges2(in1, size1, in2, size2, out) (in2[0]=='r') ? sstrangerowa(in1, size1[0], size1[1], out) : sstrangecola(in1, size1[0] , size1[1], out)
+
+#define u162strangeu160(in1, size) u16strangea(in1,size[0]* size[1])
+#define u162g2strangeu162(in1, size1, in2, size2, out) (in2[0]=='r') ? u16strangerowa(in1, size1[0], size1[1], out) : u16strangecola(in1, size1[0] , size1[1], out)
+
+
+#endif
diff --git a/src/c/statisticsFunctions/mvcorrel/dmvcorrel1a.c b/src/c/statisticsFunctions/mvcorrel/dmvcorrel1a.c
new file mode 100644
index 0000000..9971e0f
--- /dev/null
+++ b/src/c/statisticsFunctions/mvcorrel/dmvcorrel1a.c
@@ -0,0 +1,34 @@
+/* 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 "mvcorrel.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "types.h"
+#include "uint16.h"
+#include "zeros.h"
+#include "sum.h"
+#include "ones.h"
+#include "matrixMultiplication.h"
+#include "matrixTranspose.h"
+#include "subtraction.h"
+#include "division.h"
+
+double dmvcorrel1a(int lx, int cx)
+{
+ if(lx==1 && cx==1)
+ return 0;
+
+ else
+ return 1;
+}
diff --git a/src/c/statisticsFunctions/mvcorrel/dmvcorrela.c b/src/c/statisticsFunctions/mvcorrel/dmvcorrela.c
new file mode 100644
index 0000000..a1bacfd
--- /dev/null
+++ b/src/c/statisticsFunctions/mvcorrel/dmvcorrela.c
@@ -0,0 +1,87 @@
+/* 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 "mvcorrel.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "pow.h"
+#include "division.h"
+#include "types.h"
+#include "uint16.h"
+#include "zeros.h"
+#include "sum.h"
+#include "ones.h"
+#include "matrixMultiplication.h"
+#include "matrixTranspose.h"
+#include "subtraction.h"
+#include "division.h"
+
+void dmvcorrela(double *in, int lx, int cx, double* r)
+{
+ double temp1[1* cx];
+ double xbar[1* cx];
+ double temp2[lx*1];
+ double temp3[lx*cx];
+ double temp4[lx*cx];
+ double temp4_trans[cx*lx];
+ double temp5[1* cx];
+ double temp6[lx*cx];
+ double std[1*cx];
+ double std_trans[cx*1];
+ double temp7[cx*cx];
+ double temp8[cx*cx];
+
+ donesa ( temp2 , lx , 1 ); //temp2= ones(lx,1)
+
+ if(lx==1)
+ {
+ dzerosa ( r , cx ,cx ); //out= zeros(lx,cx)
+
+ }
+
+ else
+ {
+
+ drowsuma(in, lx, cx, temp1); //temp1= sum(x, "r")
+
+ for(int i=0; i< 1*cx; i++)
+ xbar[i]= drdivs(temp1[i], lx); // xbar= sum(x, "r")/ lx
+/* //Debug Only*/
+/* for(int i= 0; i< 1*cx; i++)*/
+/* printf("xbar[%d]= %lf\t", i, xbar[i]);*/
+/* printf("\n");*/
+
+ dmulma(temp2, lx,1, xbar, 1, cx, temp3 ); //temp3= ones(lx,1)*xbar
+ ddiffa(in, lx*cx, temp3, lx*cx, temp4); //temp4= r= x-ones(lx,1)*xbar
+ for(int i=0; i< lx*cx; i++)
+ temp6[i]= dpows(temp4[i], 2); //temp6= r.^2
+ drowsuma(temp6, lx, cx, temp5); //temp5= sum(r.^2, "r")
+ for(int i=0; i< 1*cx; i++)
+ std[i]= dpows(temp5[i], 0.5); //std=(sum(r .^2,"r")) .^ (0.5)
+/* //Debug Only*/
+/* for(int i= 0; i< 1*cx; i++)*/
+/* printf("std[%d]= %lf\t", i, std[i]);*/
+/* printf("\n"); */
+ dtransposea ( temp4 , lx , cx, temp4_trans); //temp4_trans= r'
+ dtransposea ( std , 1 , cx, std_trans); //std_trans= std'
+ dmulma(temp4_trans, cx,lx, temp4, lx, cx, temp7 ); //temp7= r'*r
+ dmulma(std_trans, cx, 1, std, 1,cx, temp8); //temp8= std'*std
+
+ drdiva (temp7, temp8, cx*cx, r); // r=(r'*r) ./ (std'*std)
+
+
+ }
+
+
+
+}
diff --git a/src/c/statisticsFunctions/mvcorrel/smvcorrel1a.c b/src/c/statisticsFunctions/mvcorrel/smvcorrel1a.c
new file mode 100644
index 0000000..345ce60
--- /dev/null
+++ b/src/c/statisticsFunctions/mvcorrel/smvcorrel1a.c
@@ -0,0 +1,34 @@
+/* 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 "mvcorrel.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "types.h"
+#include "uint16.h"
+#include "zeros.h"
+#include "sum.h"
+#include "ones.h"
+#include "matrixMultiplication.h"
+#include "matrixTranspose.h"
+#include "subtraction.h"
+#include "division.h"
+
+float smvcorrel1a(int lx, int cx)
+{
+ if(lx==1 && cx==1)
+ return 0;
+
+ else
+ return 1;
+}
diff --git a/src/c/statisticsFunctions/mvcorrel/smvcorrela.c b/src/c/statisticsFunctions/mvcorrel/smvcorrela.c
new file mode 100644
index 0000000..8894cee
--- /dev/null
+++ b/src/c/statisticsFunctions/mvcorrel/smvcorrela.c
@@ -0,0 +1,87 @@
+/* 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 "mvcorrel.h"
+#include "stdlib.h"
+#include "stdio.h"
+#include "types.h"
+#include "pow.h"
+#include "uint16.h"
+#include "zeros.h"
+#include "sum.h"
+#include "ones.h"
+#include "matrixMultiplication.h"
+#include "division.h"
+#include "matrixTranspose.h"
+#include "subtraction.h"
+#include "division.h"
+
+void smvcorrela(float *in, int lx, int cx, float* r)
+{
+ float temp1[1* cx];
+ float xbar[1* cx];
+ float temp2[lx*1];
+ float temp3[lx*cx];
+ float temp4[lx*cx];
+ float temp4_trans[cx*lx];
+ float temp5[1* cx];
+ float temp6[lx*cx];
+ float std[1*cx];
+ float std_trans[cx*1];
+ float temp7[cx*cx];
+ float temp8[cx*cx];
+
+ sonesa ( temp2 , lx , 1 ); //temp2= ones(lx,1)
+
+ if(lx==1)
+ {
+ szerosa ( r , cx ,cx ); //out= zeros(lx,cx)
+
+ }
+
+ else
+ {
+
+ srowsuma(in, lx, cx, temp1); //temp1= sum(x, "r")
+
+ for(int i=0; i< 1*cx; i++)
+ xbar[i]= srdivs(temp1[i], lx); // xbar= sum(x, "r")/ lx
+/* //Debug Only*/
+/* for(int i= 0; i< 1*cx; i++)*/
+/* printf("xbar[%d]= %lf\t", i, xbar[i]);*/
+/* printf("\n");*/
+
+ smulma(temp2, lx,1, xbar, 1, cx, temp3 ); //temp3= ones(lx,1)*xbar
+ sdiffa(in, lx*cx, temp3, lx*cx, temp4); //temp4= r= x-ones(lx,1)*xbar
+ for(int i=0; i< lx*cx; i++)
+ temp6[i]= spows(temp4[i], 2); //temp6= r.^2
+ srowsuma(temp6, lx, cx, temp5); //temp5= sum(r.^2, "r")
+ for(int i=0; i< 1*cx; i++)
+ std[i]= spows(temp5[i], 0.5); //std=(sum(r .^2,"r")) .^ (0.5)
+/* //Debug Only*/
+/* for(int i= 0; i< 1*cx; i++)*/
+/* printf("std[%d]= %lf\t", i, std[i]);*/
+/* printf("\n"); */
+ stransposea ( temp4 , lx , cx, temp4_trans); //temp4_trans= r'
+ stransposea ( std , 1 , cx, std_trans); //std_trans= std'
+ smulma(temp4_trans, cx,lx, temp4, lx, cx, temp7 ); //temp7= r'*r
+ smulma(std_trans, cx, 1, std, 1,cx, temp8); //temp8= std'*std
+
+ srdiva (temp7, temp8, cx*cx, r); // r=(r'*r) ./ (std'*std)
+
+
+ }
+
+
+
+}
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);
+ }
+
+
+}