summaryrefslogtreecommitdiff
path: root/src/c/matrixOperations/cumprod
diff options
context:
space:
mode:
Diffstat (limited to 'src/c/matrixOperations/cumprod')
-rw-r--r--src/c/matrixOperations/cumprod/dcolumncumproda.c38
-rw-r--r--src/c/matrixOperations/cumprod/dcumproda.c30
-rw-r--r--src/c/matrixOperations/cumprod/drowcumproda.c37
-rw-r--r--src/c/matrixOperations/cumprod/i16columncumproda.c38
-rw-r--r--src/c/matrixOperations/cumprod/i16cumproda.c30
-rw-r--r--src/c/matrixOperations/cumprod/i16rowcumproda.c37
-rw-r--r--src/c/matrixOperations/cumprod/i8columncumproda.c38
-rw-r--r--src/c/matrixOperations/cumprod/i8cumproda.c30
-rw-r--r--src/c/matrixOperations/cumprod/i8rowcumproda.c37
-rw-r--r--src/c/matrixOperations/cumprod/scolumncumproda.c38
-rw-r--r--src/c/matrixOperations/cumprod/scumproda.c30
-rw-r--r--src/c/matrixOperations/cumprod/srowcumproda.c37
-rw-r--r--src/c/matrixOperations/cumprod/u16columncumproda.c38
-rw-r--r--src/c/matrixOperations/cumprod/u16cumproda.c30
-rw-r--r--src/c/matrixOperations/cumprod/u16rowcumproda.c37
-rw-r--r--src/c/matrixOperations/cumprod/u8columncumproda.c38
-rw-r--r--src/c/matrixOperations/cumprod/u8cumproda.c30
-rw-r--r--src/c/matrixOperations/cumprod/u8rowcumproda.c37
18 files changed, 630 insertions, 0 deletions
diff --git a/src/c/matrixOperations/cumprod/dcolumncumproda.c b/src/c/matrixOperations/cumprod/dcolumncumproda.c
new file mode 100644
index 0000000..7bed70b
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/dcolumncumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void dcolumncumproda(double *in1, int row, int column, double *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //Assign elements in first column as it is
+ for(row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ out[row_cnt] = in1[row_cnt];
+ }
+
+ //For second column onwards
+ for (row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ for ( col_cnt = 1; col_cnt < column; col_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[(col_cnt-1)*row+row_cnt];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/dcumproda.c b/src/c/matrixOperations/cumprod/dcumproda.c
new file mode 100644
index 0000000..0a40868
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/dcumproda.c
@@ -0,0 +1,30 @@
+// 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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void dcumproda(double *in1, int row, int column, double *out)
+{
+ int row_cnt, col_cnt = 0;
+ double cumprod = 1;
+ for (col_cnt = 0; col_cnt < row; col_cnt++)
+ {
+ for ( row_cnt = 0; row_cnt < column; row_cnt++)
+ {
+ cumprod *= in1[col_cnt*column+row_cnt];
+ out[col_cnt*column+row_cnt] = cumprod;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/drowcumproda.c b/src/c/matrixOperations/cumprod/drowcumproda.c
new file mode 100644
index 0000000..74b2bfc
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/drowcumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void drowcumproda(double *in1, int row, int column, double *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //assign elements in first row as it is
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ out[col_cnt*row] = in1[col_cnt*row];
+ }
+ //For second row onwards
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ for ( row_cnt = 1; row_cnt < row; row_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[col_cnt*row+row_cnt -1];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/i16columncumproda.c b/src/c/matrixOperations/cumprod/i16columncumproda.c
new file mode 100644
index 0000000..3c64477
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/i16columncumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void i16columncumproda(int16 *in1, int row, int column, int16 *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //Assign elements in first column as it is
+ for(row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ out[row_cnt] = in1[row_cnt];
+ }
+
+ //For second column onwards
+ for (row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ for ( col_cnt = 1; col_cnt < column; col_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[(col_cnt-1)*row+row_cnt];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/i16cumproda.c b/src/c/matrixOperations/cumprod/i16cumproda.c
new file mode 100644
index 0000000..8352f41
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/i16cumproda.c
@@ -0,0 +1,30 @@
+// 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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void i16cumproda(int16 *in1, int row, int column, int16 *out)
+{
+ int row_cnt, col_cnt = 0;
+ int16 cumprod = 1;
+ for (col_cnt = 0; col_cnt < row; col_cnt++)
+ {
+ for ( row_cnt = 0; row_cnt < column; row_cnt++)
+ {
+ cumprod *= in1[col_cnt*column+row_cnt];
+ out[col_cnt*column+row_cnt] = cumprod;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/i16rowcumproda.c b/src/c/matrixOperations/cumprod/i16rowcumproda.c
new file mode 100644
index 0000000..35ab6d4
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/i16rowcumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void i16rowcumproda(int16 *in1, int row, int column, int16 *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //assign elements in first row as it is
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ out[col_cnt*row] = in1[col_cnt*row];
+ }
+ //For second row onwards
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ for ( row_cnt = 1; row_cnt < row; row_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[col_cnt*row+row_cnt -1];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/i8columncumproda.c b/src/c/matrixOperations/cumprod/i8columncumproda.c
new file mode 100644
index 0000000..df9109d
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/i8columncumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void i8columncumproda(int8 *in1, int row, int column, int8 *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //Assign elements in first column as it is
+ for(row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ out[row_cnt] = in1[row_cnt];
+ }
+
+ //For second column onwards
+ for (row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ for ( col_cnt = 1; col_cnt < column; col_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[(col_cnt-1)*row+row_cnt];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/i8cumproda.c b/src/c/matrixOperations/cumprod/i8cumproda.c
new file mode 100644
index 0000000..ba502ba
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/i8cumproda.c
@@ -0,0 +1,30 @@
+// 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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void i8cumproda(int8 *in1, int row, int column, int8 *out)
+{
+ int row_cnt, col_cnt = 0;
+ int8 cumprod = 1;
+ for (col_cnt = 0; col_cnt < row; col_cnt++)
+ {
+ for ( row_cnt = 0; row_cnt < column; row_cnt++)
+ {
+ cumprod *= in1[col_cnt*column+row_cnt];
+ out[col_cnt*column+row_cnt] = cumprod;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/i8rowcumproda.c b/src/c/matrixOperations/cumprod/i8rowcumproda.c
new file mode 100644
index 0000000..20b4126
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/i8rowcumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void i8rowcumproda(int8 *in1, int row, int column, int8 *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //assign elements in first row as it is
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ out[col_cnt*row] = in1[col_cnt*row];
+ }
+ //For second row onwards
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ for ( row_cnt = 1; row_cnt < row; row_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[col_cnt*row+row_cnt -1];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/scolumncumproda.c b/src/c/matrixOperations/cumprod/scolumncumproda.c
new file mode 100644
index 0000000..5c2c0c3
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/scolumncumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void scolumncumproda(float *in1, int row, int column, float *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //Assign elements in first column as it is
+ for(row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ out[row_cnt] = in1[row_cnt];
+ }
+
+ //For second column onwards
+ for (row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ for ( col_cnt = 1; col_cnt < column; col_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[(col_cnt-1)*row+row_cnt];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/scumproda.c b/src/c/matrixOperations/cumprod/scumproda.c
new file mode 100644
index 0000000..b50ea63
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/scumproda.c
@@ -0,0 +1,30 @@
+// 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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void scumproda(float *in1, int row, int column, float *out)
+{
+ int row_cnt, col_cnt = 0;
+ float cumprod = 1;
+ for (col_cnt = 0; col_cnt < row; col_cnt++)
+ {
+ for ( row_cnt = 0; row_cnt < column; row_cnt++)
+ {
+ cumprod += in1[col_cnt*column+row_cnt];
+ out[col_cnt*column+row_cnt] = cumprod;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/srowcumproda.c b/src/c/matrixOperations/cumprod/srowcumproda.c
new file mode 100644
index 0000000..e3d146a
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/srowcumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void srowcumproda(float *in1, int row, int column, float *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //assign elements in first row as it is
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ out[col_cnt*row] = in1[col_cnt*row];
+ }
+ //For second row onwards
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ for ( row_cnt = 1; row_cnt < row; row_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[col_cnt*row+row_cnt -1];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/u16columncumproda.c b/src/c/matrixOperations/cumprod/u16columncumproda.c
new file mode 100644
index 0000000..a0e821f
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/u16columncumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void u16columncumproda(uint16 *in1, int row, int column, uint16 *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //Assign elements in first column as it is
+ for(row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ out[row_cnt] = in1[row_cnt];
+ }
+
+ //For second column onwards
+ for (row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ for ( col_cnt = 1; col_cnt < column; col_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[(col_cnt-1)*row+row_cnt];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/u16cumproda.c b/src/c/matrixOperations/cumprod/u16cumproda.c
new file mode 100644
index 0000000..de969fb
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/u16cumproda.c
@@ -0,0 +1,30 @@
+// 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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void u16cumproda(uint16 *in1, int row, int column, uint16 *out)
+{
+ int row_cnt, col_cnt = 0;
+ uint16 cumprod = 1;
+ for (col_cnt = 0; col_cnt < row; col_cnt++)
+ {
+ for ( row_cnt = 0; row_cnt < column; row_cnt++)
+ {
+ cumprod *= in1[col_cnt*column+row_cnt];
+ out[col_cnt*column+row_cnt] = cumprod;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/u16rowcumproda.c b/src/c/matrixOperations/cumprod/u16rowcumproda.c
new file mode 100644
index 0000000..1ea4468
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/u16rowcumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void u16rowcumproda(uint16 *in1, int row, int column, uint16 *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //assign elements in first row as it is
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ out[col_cnt*row] = in1[col_cnt*row];
+ }
+ //For second row onwards
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ for ( row_cnt = 1; row_cnt < row; row_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[col_cnt*row+row_cnt -1];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/u8columncumproda.c b/src/c/matrixOperations/cumprod/u8columncumproda.c
new file mode 100644
index 0000000..70eb058
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/u8columncumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void u8columncumproda(uint8 *in1, int row, int column, uint8 *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //Assign elements in first column as it is
+ for(row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ out[row_cnt] = in1[row_cnt];
+ }
+
+ //For second column onwards
+ for (row_cnt = 0; row_cnt < row; row_cnt++)
+ {
+ for ( col_cnt = 1; col_cnt < column; col_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[(col_cnt-1)*row+row_cnt];
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/u8cumproda.c b/src/c/matrixOperations/cumprod/u8cumproda.c
new file mode 100644
index 0000000..048b26f
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/u8cumproda.c
@@ -0,0 +1,30 @@
+// 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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void u8cumproda(uint8 *in1, int row, int column, uint8 *out)
+{
+ int row_cnt, col_cnt = 0;
+ uint8 cumprod = 1;
+ for (col_cnt = 0; col_cnt < row; col_cnt++)
+ {
+ for ( row_cnt = 0; row_cnt < column; row_cnt++)
+ {
+ cumprod *= in1[col_cnt*column+row_cnt];
+ out[col_cnt*column+row_cnt] = cumprod;
+ }
+ }
+
+} \ No newline at end of file
diff --git a/src/c/matrixOperations/cumprod/u8rowcumproda.c b/src/c/matrixOperations/cumprod/u8rowcumproda.c
new file mode 100644
index 0000000..fb500c7
--- /dev/null
+++ b/src/c/matrixOperations/cumprod/u8rowcumproda.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: Siddhesh Wani
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+
+//Function returns cumulative sum of members of array/matrix
+
+#include "cumprod.h"
+#include "types.h"
+
+void u8rowcumproda(uint8 *in1, int row, int column, uint8 *out)
+{
+ int row_cnt, col_cnt = 0;
+
+ //assign elements in first row as it is
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ out[col_cnt*row] = in1[col_cnt*row];
+ }
+ //For second row onwards
+ for (col_cnt = 0; col_cnt < column; col_cnt++)
+ {
+ for ( row_cnt = 1; row_cnt < row; row_cnt++)
+ {
+
+ out[col_cnt*row+row_cnt] = in1[col_cnt*row+row_cnt] \
+ * out[col_cnt*row+row_cnt -1];
+ }
+ }
+
+} \ No newline at end of file