summaryrefslogtreecommitdiff
path: root/2.3-1/src/c/elementaryFunctions/nanmean
diff options
context:
space:
mode:
Diffstat (limited to '2.3-1/src/c/elementaryFunctions/nanmean')
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/cnanmeana.c37
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/cnanmeancola.c37
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/cnanmeanrowa.c37
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/dnanmeana.c33
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/dnanmeancola.c36
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/dnanmeanrowa.c36
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/snanmeana.c33
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/snanmeancola.c35
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/snanmeanrowa.c35
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/znanmeana.c37
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/znanmeancola.c37
-rw-r--r--2.3-1/src/c/elementaryFunctions/nanmean/znanmeanrowa.c37
12 files changed, 430 insertions, 0 deletions
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeana.c b/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeana.c
new file mode 100644
index 00000000..eaca1e79
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeana.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+#include "doubleComplex.h"
+#include "floatComplex.h"
+
+
+floatComplex cnanmeana(floatComplex* in, int size)
+{
+ floatComplex sum = 0;
+ double count = 0;
+
+ for(int i = 0; i<size; i++)
+ {
+ if(!(isnan(zreals(in[i]))) && !(isnan(zimags(in[i]))))
+ {
+ count++;
+ sum += in[i];
+ }
+ }
+
+ return sum/count;
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeancola.c b/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeancola.c
new file mode 100644
index 00000000..7f643a65
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeancola.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+#include "doubleComplex.h"
+#include "floatComplex.h"
+
+void cnanmeancola(floatComplex *in, int row, int col, floatComplex* out)
+{
+ floatComplex inter[col];
+
+
+for(int i=0; i< row; i++)
+ {
+ for(int j=0 ; j< col; j++)
+ {
+ inter[j]= in[i+ (j*row)];
+
+ }
+ out[i]= cnanmeana( inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeanrowa.c b/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeanrowa.c
new file mode 100644
index 00000000..05aa7e93
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/cnanmeanrowa.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+#include "doubleComplex.h"
+#include "floatComplex.h"
+
+void cnanmeanrowa(floatComplex *in, int row, int col, floatComplex* out)
+{
+ floatComplex inter[row];
+
+
+for(int i=0; i< col; i++)
+ {
+ for(int j=0 ; j< row; j++)
+ {
+ inter[j]= in[j+ (i*row)];
+
+ }
+ out[i]= cnanmeana( inter, row);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeana.c b/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeana.c
new file mode 100644
index 00000000..40f9ac6f
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeana.c
@@ -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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+
+double dnanmeana(double* in, int size)
+{
+ double count = 0, sum = 0;
+
+ for(int i = 0; i<size; i++)
+ {
+ if(!(isnan(in[i])))
+ {
+ count++;
+ sum += in[i];
+ }
+ }
+
+ return sum/count;
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeancola.c b/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeancola.c
new file mode 100644
index 00000000..81ed5338
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeancola.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+
+void dnanmeancola(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]= dnanmeana( inter, col);
+
+ }
+
+
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeanrowa.c b/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeanrowa.c
new file mode 100644
index 00000000..1ac02f5f
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/dnanmeanrowa.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+
+void dnanmeanrowa(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]= dnanmeana( inter, row);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/snanmeana.c b/2.3-1/src/c/elementaryFunctions/nanmean/snanmeana.c
new file mode 100644
index 00000000..aecf6984
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/snanmeana.c
@@ -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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+
+float snanmeana(float* in, int size)
+{
+ float count = 0, sum = 0;
+
+ for(int i = 0; i<size; i++)
+ {
+ if(!(isnan(in[i])))
+ {
+ count++;
+ sum += in[i];
+ }
+ }
+
+ return sum/count;
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/snanmeancola.c b/2.3-1/src/c/elementaryFunctions/nanmean/snanmeancola.c
new file mode 100644
index 00000000..68df77b8
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/snanmeancola.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+
+void snanmeancola(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]= snanmeana( inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/snanmeanrowa.c b/2.3-1/src/c/elementaryFunctions/nanmean/snanmeanrowa.c
new file mode 100644
index 00000000..1664aa4e
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/snanmeanrowa.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+
+void snanmeanrowa(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]= snanmeana( inter, row);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/znanmeana.c b/2.3-1/src/c/elementaryFunctions/nanmean/znanmeana.c
new file mode 100644
index 00000000..366657a5
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/znanmeana.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+#include "doubleComplex.h"
+#include "floatComplex.h"
+
+
+doubleComplex znanmeana(doubleComplex* in, int size)
+{
+ doubleComplex sum = 0;
+ double count = 0;
+
+ for(int i = 0; i<size; i++)
+ {
+ if(!(isnan(zreals(in[i]))) && !(isnan(zimags(in[i]))))
+ {
+ count++;
+ sum += in[i];
+ }
+ }
+
+ return sum/count;
+}
+
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/znanmeancola.c b/2.3-1/src/c/elementaryFunctions/nanmean/znanmeancola.c
new file mode 100644
index 00000000..28743e3f
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/znanmeancola.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+#include "doubleComplex.h"
+#include "floatComplex.h"
+
+void znanmeancola(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]= znanmeana( inter, col);
+
+ }
+
+
+}
diff --git a/2.3-1/src/c/elementaryFunctions/nanmean/znanmeanrowa.c b/2.3-1/src/c/elementaryFunctions/nanmean/znanmeanrowa.c
new file mode 100644
index 00000000..8d80c779
--- /dev/null
+++ b/2.3-1/src/c/elementaryFunctions/nanmean/znanmeanrowa.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: Brijesh Gupta C R
+ Organization: FOSSEE, IIT Bombay
+ Email: toolbox@scilab.in
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include "nanmean.h"
+#include "doubleComplex.h"
+#include "floatComplex.h"
+
+void znanmeanrowa(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]= znanmeana( inter, row);
+
+ }
+
+
+}