summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/statisticsFunctions/nanmedian
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/src/c/statisticsFunctions/nanmedian')
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/dnanmediana.c51
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/dnanmediancola.c35
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/dnanmedianrowa.c36
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/snanmediana.c49
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/snanmediancola.c36
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/snanmedianrowa.c37
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/znanmediana.c51
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/znanmediancola.c37
-rw-r--r--2.3-1/src/c/statisticsFunctions/nanmedian/znanmedianrowa.c38
9 files changed, 370 insertions, 0 deletions
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmediana.c b/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmediana.c
new file mode 100644
index 00000000..0fb7de12
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmediana.c
@@ -0,0 +1,51 @@
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmedian.h"
+#include "median.h"
+#include "types.h"
+double dnanmediana(double* in, int size)
+{
+
+double temp[size];
+double out;
+int j=0;
+
+double a= 0.0/0.0;
+
+
+
+ for(int i=0; i< size; i++)
+ {
+ if( !(isnan(in[i])) )
+ {
+ temp[j]= in[i];
+ j=j+1;
+
+
+ }
+
+
+ }
+
+
+out= dmediana(temp, j);
+
+if(j=0)
+return a;
+else
+return out;
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmediancola.c b/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmediancola.c
new file mode 100644
index 00000000..37b3f128
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmediancola.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 "nanmedian.h"
+#include "types.h"
+#include "uint16.h"
+
+void dnanmediancola(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]= dnanmediana( inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmedianrowa.c b/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmedianrowa.c
new file mode 100644
index 00000000..d24ba828
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/dnanmedianrowa.c
@@ -0,0 +1,36 @@
+/* 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 "nanmedian.h"
+#include "types.h"
+#include "uint16.h"
+
+void dnanmedianrowa(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]= dnanmediana( inter, row);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/snanmediana.c b/2.3-1/src/c/statisticsFunctions/nanmedian/snanmediana.c
new file mode 100644
index 00000000..cddb990e
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/snanmediana.c
@@ -0,0 +1,49 @@
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmedian.h"
+#include "median.h"
+#include "types.h"
+float snanmediana(float* in, int size)
+{
+
+float temp[size];
+float out;
+int j=0;
+
+float a= 0.0/0.0;
+
+ for(int i=0; i< size; i++)
+ {
+ if( !(isnan(in[i])) )
+ {
+ temp[j]= in[i];
+ j=j+1;
+
+
+ }
+
+
+ }
+
+
+out= smediana(temp, j);
+
+if(j=0)
+return a;
+else
+return out;
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/snanmediancola.c b/2.3-1/src/c/statisticsFunctions/nanmedian/snanmediancola.c
new file mode 100644
index 00000000..a8077f19
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/snanmediancola.c
@@ -0,0 +1,36 @@
+/* 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 "nanmedian.h"
+#include "mean.h"
+#include "types.h"
+#include "uint16.h"
+
+void snanmediancola(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]= snanmediana( inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/snanmedianrowa.c b/2.3-1/src/c/statisticsFunctions/nanmedian/snanmedianrowa.c
new file mode 100644
index 00000000..47425e0f
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/snanmedianrowa.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 "nanmedian.h"
+#include "mean.h"
+#include "types.h"
+#include "uint16.h"
+
+void snanmedianrowa(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]= snanmediana( inter, row);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/znanmediana.c b/2.3-1/src/c/statisticsFunctions/nanmedian/znanmediana.c
new file mode 100644
index 00000000..bfc1fe46
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/znanmediana.c
@@ -0,0 +1,51 @@
+/* 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 <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmedian.h"
+#include "median.h"
+#include "types.h"
+#include "doubleComplex.h"
+
+doubleComplex znanmediana(doubleComplex* in, int size)
+{
+
+doubleComplex temp[size];
+doubleComplex out;
+int j=0;
+
+float a= 0.0/0.0;
+
+ for(int i=0; i< size; i++)
+ {
+ if( !(zreals(in[i])) && !(zimags(in[i])) )
+ {
+ temp[j]= in[i];
+ j=j+1;
+
+
+ }
+
+
+ }
+
+
+out= zmediana(temp, j);
+
+if(j=0)
+return a;
+else
+return out;
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/znanmediancola.c b/2.3-1/src/c/statisticsFunctions/nanmedian/znanmediancola.c
new file mode 100644
index 00000000..0aaeba02
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/znanmediancola.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 "nanmedian.h"
+#include "mean.h"
+#include "types.h"
+#include "uint16.h"
+#include "doubleComplex.h"
+
+void znanmediancola(doubleComplex *in, int row, int col, doubleComplex* out)
+{
+ doubleComplex inter[col];
+
+
+for(int i=0; i< row; i++)
+ {
+ for(int j=0 ; j< col; j++)
+ {
+ inter[j]= in[i+ (j*row)];
+
+ }
+ out[i]= znanmediana( inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/statisticsFunctions/nanmedian/znanmedianrowa.c b/2.3-1/src/c/statisticsFunctions/nanmedian/znanmedianrowa.c
new file mode 100644
index 00000000..d0e470fa
--- /dev/null
+++ b/2.3-1/src/c/statisticsFunctions/nanmedian/znanmedianrowa.c
@@ -0,0 +1,38 @@
+/* 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 "nanmedian.h"
+#include "mean.h"
+#include "types.h"
+#include "uint16.h"
+#include "doubleComplex.h"
+
+void znanmedianrowa(doubleComplex* in, int row, int col, doubleComplex* out)
+{
+ doubleComplex inter[row];
+
+
+
+for(int i=0; i< col; i++)
+ {
+ for(int j=0 ; j< row; j++)
+ {
+ inter[j]= in[j+ (i*row)];
+
+ }
+ out[i]= znanmediana( inter, row);
+
+ }
+
+
+}