summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/c/iVertcat.c
diff options
context:
space:
mode:
authorLeo Chan <leochanj@live.unc.edu>2020-10-22 01:53:21 -0400
committerJoshua Bakita <jbakita@cs.unc.edu>2020-10-22 01:56:35 -0400
commitd17b33131c14864bd1eae275f49a3f148e21cf29 (patch)
tree0d8f77922e8d193cb0f6edab83018f057aad64a0 /SD-VBS/common/c/iVertcat.c
parent601ed25a4c5b66cb75315832c15613a727db2c26 (diff)
Squashed commit of the sb-vbs branch.
Includes the SD-VBS benchmarks modified to: - Use libextra to loop as realtime jobs - Preallocate memory before starting their main computation - Accept input via stdin instead of via argc Does not include the SD-VBS matlab code. Fixes libextra execution in LITMUS^RT.
Diffstat (limited to 'SD-VBS/common/c/iVertcat.c')
-rw-r--r--SD-VBS/common/c/iVertcat.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/SD-VBS/common/c/iVertcat.c b/SD-VBS/common/c/iVertcat.c
new file mode 100644
index 0000000..2c2d857
--- /dev/null
+++ b/SD-VBS/common/c/iVertcat.c
@@ -0,0 +1,34 @@
1/********************************
2Author: Sravanthi Kota Venkata
3********************************/
4
5#include "sdvbs_common.h"
6
7I2D* iVertcat(I2D* matrix1, I2D* matrix2)
8{
9 I2D *outMatrix;
10 int row1, col1, row2, col2, i, j, k;
11
12 row1 = matrix1->height;
13 col1 = matrix1->width;
14
15 row2 = matrix2->height;
16 col2 = matrix2->width;
17
18 outMatrix = iMallocHandle(row1+row2, col1);
19
20 for( i=0; i<col1; i++)
21 {
22 for (j=0; j<row1; j++)
23 {
24 subsref(outMatrix,j,i) = subsref(matrix1,j,i);
25 }
26 for( k=0; k<row2; k++)
27 {
28 subsref(outMatrix,(k+row1),i) = subsref(matrix2,k,i);
29 }
30 }
31 return outMatrix;
32}
33
34