summaryrefslogtreecommitdiffstats
path: root/SD-VBS/benchmarks/multi_ncut/src/c/segment.h
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/benchmarks/multi_ncut/src/c/segment.h
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/benchmarks/multi_ncut/src/c/segment.h')
-rw-r--r--SD-VBS/benchmarks/multi_ncut/src/c/segment.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/multi_ncut/src/c/segment.h b/SD-VBS/benchmarks/multi_ncut/src/c/segment.h
new file mode 100644
index 0000000..73ed8de
--- /dev/null
+++ b/SD-VBS/benchmarks/multi_ncut/src/c/segment.h
@@ -0,0 +1,46 @@
1/********************************
2Author: Sravanthi Kota Venkata
3********************************/
4
5#ifndef SEGMENT
6#define SEGMENT
7
8#include "sdvbs_common.h"
9
10typedef struct
11{
12 float w;
13 int a, b;
14} edge;
15
16typedef struct
17{
18 int rank;
19 int p;
20 int size;
21} uni_elt;
22
23typedef struct
24{
25 uni_elt *elts;
26 int num;
27}universe;
28
29/* use imRef to access image data. */
30#define imRef(im, x, y) (im->data[y*im->width+x])
31
32I2D *segment_image(I2D *im, float sigma, float c, int min_size, int *num_ccs,
33 int* segments, edge* edges,
34 F2D* imageOut, F2D* tempOut, I2D* kernel, F2D* edgeWeights, F2D* in, I2D* ind,
35 universe* u,
36 I2D* output);
37universe *segment_graph(int num_vertices, int num_edges, edge *edges, float c, F2D* edgeWeights, F2D* in, I2D* ind,
38 universe* u);
39void join(universe* u, int x, int y);
40int find(universe* u, int x);
41float diff(F2D *r, int x1, int y1, int x2, int y2);
42
43
44#endif
45
46