diff options
author | Leo Chan <leochanj@live.unc.edu> | 2020-10-22 01:53:21 -0400 |
---|---|---|
committer | Joshua Bakita <jbakita@cs.unc.edu> | 2020-10-22 01:56:35 -0400 |
commit | d17b33131c14864bd1eae275f49a3f148e21cf29 (patch) | |
tree | 0d8f77922e8d193cb0f6edab83018f057aad64a0 /SD-VBS/benchmarks/svm/src/c/svm.h | |
parent | 601ed25a4c5b66cb75315832c15613a727db2c26 (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/svm/src/c/svm.h')
-rw-r--r-- | SD-VBS/benchmarks/svm/src/c/svm.h | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/SD-VBS/benchmarks/svm/src/c/svm.h b/SD-VBS/benchmarks/svm/src/c/svm.h new file mode 100644 index 0000000..9675371 --- /dev/null +++ b/SD-VBS/benchmarks/svm/src/c/svm.h | |||
@@ -0,0 +1,38 @@ | |||
1 | /******************************** | ||
2 | Author: Sravanthi Kota Venkata | ||
3 | ********************************/ | ||
4 | |||
5 | #ifndef _SCRIPT_SVM_ | ||
6 | #define _SCRIPT_SVM_ | ||
7 | |||
8 | #include "sdvbs_common.h" | ||
9 | |||
10 | typedef struct | ||
11 | { | ||
12 | F2D* a; | ||
13 | float b; | ||
14 | float C; | ||
15 | int d; | ||
16 | int dim; | ||
17 | F2D* e; | ||
18 | float eps; | ||
19 | F2D* a_result; | ||
20 | F2D* b_result; | ||
21 | F2D* X; | ||
22 | F2D *Y; | ||
23 | float tolerance; | ||
24 | int ret; | ||
25 | |||
26 | }alphaRet; | ||
27 | |||
28 | alphaRet* getAlphaFromTrainSet(int N, F2D* trn1, F2D* trn2, int iterations); | ||
29 | float polynomial(int d, F2D* a, F2D* b, int dim); | ||
30 | float cal_learned_func(int k, F2D* a, float* b, int N, F2D* Y, F2D* X, int dim); | ||
31 | int examineExample(int i, F2D* a, float* b, float C, F2D* e, F2D* X, F2D* Y, float tolerance, int N, float eps, int dim); | ||
32 | int takeStep(int i, int j, F2D* a, float C, F2D* e, F2D* Y, F2D* X, float eps, float* b, int N, int dim); | ||
33 | F2D* usps_read_partial(F2D* dcell1, F2D* dcell2, int idx, int opt, int dim, int iterations); | ||
34 | int script_svm(); | ||
35 | |||
36 | #endif | ||
37 | |||
38 | |||