summaryrefslogtreecommitdiff
path: root/src/c/elementaryFunctions/nancumsum
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/elementaryFunctions/nancumsum')
-rw-r--r--src/c/elementaryFunctions/nancumsum/dnancumsuma.c38
-rw-r--r--src/c/elementaryFunctions/nancumsum/dnancumsumcola.c43
-rw-r--r--src/c/elementaryFunctions/nancumsum/dnancumsumrowa.c45
-rw-r--r--src/c/elementaryFunctions/nancumsum/snancumsuma.c38
-rw-r--r--src/c/elementaryFunctions/nancumsum/snancumsumcola.c43
-rw-r--r--src/c/elementaryFunctions/nancumsum/snancumsumrowa.c44
-rw-r--r--src/c/elementaryFunctions/nancumsum/znancumsuma.c39
-rw-r--r--src/c/elementaryFunctions/nancumsum/znancumsumcola.c44
-rw-r--r--src/c/elementaryFunctions/nancumsum/znancumsumrowa.c45
9 files changed, 379 insertions, 0 deletions
diff --git a/src/c/elementaryFunctions/nancumsum/dnancumsuma.c b/src/c/elementaryFunctions/nancumsum/dnancumsuma.c
new file mode 100644
index 0000000..135ab4b
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/dnancumsuma.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 "nancumsum.h"
+#include "types.h"
+#include "uint16.h"
+#include "addition.h"
+
+void dnancumsuma(double *in, int size, double* out)
+{
+ double fin=0;
+
+
+
+ for (int i = 0; i < size; ++i)
+
+ {
+ if(!(isnan(in[i])))
+ {
+ fin= dadds(fin, in[i]);
+
+ }
+ out[i]= fin;
+
+ }
+
+
+}
diff --git a/src/c/elementaryFunctions/nancumsum/dnancumsumcola.c b/src/c/elementaryFunctions/nancumsum/dnancumsumcola.c
new file mode 100644
index 0000000..a49b394
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/dnancumsumcola.c
@@ -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
+*/
+
+
+#include "nancumsum.h"
+#include "types.h"
+#include "uint16.h"
+#include "addition.h"
+
+void dnancumsumcola(double *in, int row, int col, double* out)
+{
+ double fin=0;
+
+for(int i=0; i< row; i++)
+ {
+
+ for(int j= 0; j< col; j ++)
+ {
+ if(!(isnan(in[i+j*row])))
+
+ {
+
+ fin = dadds(fin, in[i+j*row]);
+
+
+
+ }
+ out[i+j*row]= fin;
+
+ }
+ fin=0;
+
+ }
+}
diff --git a/src/c/elementaryFunctions/nancumsum/dnancumsumrowa.c b/src/c/elementaryFunctions/nancumsum/dnancumsumrowa.c
new file mode 100644
index 0000000..45ce1ca
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/dnancumsumrowa.c
@@ -0,0 +1,45 @@
+/* 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 "nancumsum.h"
+#include "types.h"
+#include "uint16.h"
+#include "addition.h"
+
+void dnancumsumrowa(double *in, int row, int col, double* out)
+{
+
+ double fin=0;
+
+
+for(int i=0; i< col; i++)
+ {
+
+ for(int j= 0; j< row; j ++)
+ {
+ if(!(isnan(in[j+i*row])))
+
+ {
+
+ fin = dadds(fin, in[j+i*row]);
+
+
+
+ }
+ out[j+i*row]= fin;
+
+ }
+ fin=0;
+
+ }
+}
diff --git a/src/c/elementaryFunctions/nancumsum/snancumsuma.c b/src/c/elementaryFunctions/nancumsum/snancumsuma.c
new file mode 100644
index 0000000..56d1633
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/snancumsuma.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 "nancumsum.h"
+#include "types.h"
+#include "uint16.h"
+#include "addition.h"
+
+void snancumsuma(float *in, int size, float* out)
+{
+ float fin=0;
+
+
+
+ for (int i = 0; i < size; ++i)
+
+ {
+ if(!(isnan(in[i])))
+ {
+ fin= sadds(fin, in[i]);
+
+ }
+ out[i]= fin;
+
+ }
+
+
+}
diff --git a/src/c/elementaryFunctions/nancumsum/snancumsumcola.c b/src/c/elementaryFunctions/nancumsum/snancumsumcola.c
new file mode 100644
index 0000000..3b96ef0
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/snancumsumcola.c
@@ -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
+*/
+
+
+#include "nancumsum.h"
+#include "types.h"
+#include "uint16.h"
+#include "addition.h"
+
+void snancumsumcola(float *in, int row, int col, float* out)
+{
+ float fin=0;
+
+for(int i=0; i< row; i++)
+ {
+
+ for(int j= 0; j< col; j ++)
+ {
+ if(!(isnan(in[i+j*row])))
+
+ {
+
+ fin = sadds(fin, in[i+j*row]);
+
+
+
+ }
+ out[i+j*row]= fin;
+
+ }
+ fin=0;
+
+ }
+}
diff --git a/src/c/elementaryFunctions/nancumsum/snancumsumrowa.c b/src/c/elementaryFunctions/nancumsum/snancumsumrowa.c
new file mode 100644
index 0000000..7eef386
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/snancumsumrowa.c
@@ -0,0 +1,44 @@
+/* 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 "nancumsum.h"
+#include "types.h"
+#include "uint16.h"
+#include "addition.h"
+
+void snancumsumrowa(float *in, int row, int col, float* out)
+{
+ float fin=0;
+
+
+for(int i=0; i< col; i++)
+ {
+
+ for(int j= 0; j< row; j ++)
+ {
+ if(!(isnan(in[j+i*row])))
+
+ {
+
+ fin = sadds(fin, in[j+i*row]);
+
+
+
+ }
+ out[j+i*row]= fin;
+
+ }
+ fin=0;
+
+ }
+}
diff --git a/src/c/elementaryFunctions/nancumsum/znancumsuma.c b/src/c/elementaryFunctions/nancumsum/znancumsuma.c
new file mode 100644
index 0000000..fd0a1e3
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/znancumsuma.c
@@ -0,0 +1,39 @@
+/* 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 "nancumsum.h"
+#include "types.h"
+#include "uint16.h"
+#include "doubleComplex.h"
+#include "addition.h"
+
+void znancumsuma(doubleComplex *in, int size, doubleComplex* out)
+{
+ doubleComplex fin=0;
+
+
+
+ for (int i = 0; i < size; ++i)
+
+ {
+ if(!(isnan(zreals(in[i]))) && !(isnan(zimags(in[i]))) )
+ {
+ fin= zadds(fin, in[i]);
+
+ }
+ out[i]= fin;
+
+ }
+
+
+}
diff --git a/src/c/elementaryFunctions/nancumsum/znancumsumcola.c b/src/c/elementaryFunctions/nancumsum/znancumsumcola.c
new file mode 100644
index 0000000..c1ca16b
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/znancumsumcola.c
@@ -0,0 +1,44 @@
+/* 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 "nancumsum.h"
+#include "types.h"
+#include "uint16.h"
+#include "addition.h"
+#include "doubleComplex.h"
+
+void znancumsumcola(doubleComplex* in, int row, int col, doubleComplex* out)
+{
+ doubleComplex fin= 0;
+
+for(int i=0; i< row; i++)
+ {
+
+ for(int j= 0; j< col; j ++)
+ {
+ if( !(isnan(zreals(in[i+j*row]))) && !(isnan(zimags(in[i+j*row]))) )
+
+ {
+
+ fin = zadds(fin, in[i+j*row]);
+
+
+
+ }
+ out[i+j*row]= fin;
+
+ }
+ fin= 0;
+
+ }
+}
diff --git a/src/c/elementaryFunctions/nancumsum/znancumsumrowa.c b/src/c/elementaryFunctions/nancumsum/znancumsumrowa.c
new file mode 100644
index 0000000..be04a4a
--- /dev/null
+++ b/src/c/elementaryFunctions/nancumsum/znancumsumrowa.c
@@ -0,0 +1,45 @@
+/* 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 "nancumsum.h"
+#include "types.h"
+#include "doubleComplex.h"
+#include "uint16.h"
+#include "addition.h"
+
+void znancumsumrowa(doubleComplex *in, int row, int col, doubleComplex* out)
+{
+ doubleComplex fin=0;
+
+
+for(int i=0; i< col; i++)
+ {
+
+ for(int j= 0; j< row; j ++)
+ {
+ if(!(isnan(zreals(in[j+i*row]))) && !(isnan(zimags(in[j+i*row]))) )
+
+ {
+
+ fin = zadds(fin, in[j+i*row]);
+
+
+
+ }
+ out[j+i*row]= fin;
+
+ }
+ fin=0;
+
+ }
+}