summaryrefslogtreecommitdiffstats
path: root/SD-VBS/common/c/horzcat.c
diff options
context:
space:
mode:
Diffstat (limited to 'SD-VBS/common/c/horzcat.c')
-rw-r--r--SD-VBS/common/c/horzcat.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/SD-VBS/common/c/horzcat.c b/SD-VBS/common/c/horzcat.c
new file mode 100644
index 0000000..2041396
--- /dev/null
+++ b/SD-VBS/common/c/horzcat.c
@@ -0,0 +1,48 @@
1/********************************
2Author: Sravanthi Kota Venkata
3********************************/
4
5#include "sdvbs_common.h"
6
7F2D* horzcat(F2D* a, F2D* b, F2D* c)
8{
9 F2D *out;
10 int rows=0, cols=0, i, j, k, c_1, c_2, r_3, c_3;
11
12 c_1 = a->width;
13 cols += c_1;
14
15 c_2 = b->width;
16 cols += c_2;
17
18 r_3 = c->height;
19 c_3 = c->width;
20 cols += c_3;
21 rows = r_3;
22
23 out = fMallocHandle(rows, cols);
24
25 for(i=0; i<rows; i++)
26 {
27 k = 0;
28 for(j=0; j<c_1; j++)
29 {
30 subsref(out,i,k) = subsref(a,i,j);
31 k++;
32 }
33 for(j=0; j<c_2; j++)
34 {
35 subsref(out,i,k) = subsref(b,i,j);
36 k++;
37 }
38 for(j=0; j<c_3; j++)
39 {
40 subsref(out,i,k) = subsref(c,i,j);
41 k++;
42 }
43 }
44
45 return out;
46}
47
48