From f618466c25d43f3bae9e40920273bf77de1e1149 Mon Sep 17 00:00:00 2001 From: leochanj105 Date: Mon, 19 Oct 2020 23:09:30 -0400 Subject: initial sd-vbs initial sd-vbs add sd-vbs sd-vbs --- SD-VBS/benchmarks/svm/src/c/cal_learned_func.c | 42 ++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 SD-VBS/benchmarks/svm/src/c/cal_learned_func.c (limited to 'SD-VBS/benchmarks/svm/src/c/cal_learned_func.c') diff --git a/SD-VBS/benchmarks/svm/src/c/cal_learned_func.c b/SD-VBS/benchmarks/svm/src/c/cal_learned_func.c new file mode 100644 index 0000000..79fdd68 --- /dev/null +++ b/SD-VBS/benchmarks/svm/src/c/cal_learned_func.c @@ -0,0 +1,42 @@ +/******************************** +Author: Sravanthi Kota Venkata +********************************/ + +#include "svm.h" + +float cal_learned_func(int k, F2D* a, float* b, int N, F2D* Y, F2D* X, int dim) +{ + float s, ret; + int i, j, m, n; + F2D *temp, *temp1; + + s=0; + for(i=0; i 0) + { + temp = fMallocHandle(1, X->width); + temp1 = fMallocHandle(1, X->width); + + for(m=0; mwidth; m++) + { + asubsref(temp,m) = subsref(X,i,m); + asubsref(temp1,m) = subsref(X,k,m); + } + + s += asubsref(a,i) * asubsref(Y,i) * polynomial(3, temp, temp1, dim); + + free(temp); + free(temp1); + } + } + + s = s- arrayref(b,0); + ret = s; + + return ret; +} + + + + -- cgit v1.2.2