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 --- .../texture_synthesis/src/MEX/innerProd.c | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100755 SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd.c (limited to 'SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd.c') diff --git a/SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd.c b/SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd.c new file mode 100755 index 0000000..9649dda --- /dev/null +++ b/SD-VBS/benchmarks/texture_synthesis/src/MEX/innerProd.c @@ -0,0 +1,52 @@ +/* +RES = innerProd(MAT); + Computes mat'*mat + Odelia Schwartz, 8/97. +*/ + +#define V4_COMPAT +#include + +#include +#include +#include +#include +#include + +void mexFunction(int nlhs, /* Num return vals on lhs */ + Matrix *plhs[], /* Matrices on lhs */ + int nrhs, /* Num args on rhs */ + Matrix *prhs[] /* Matrices on rhs */ + ) +{ + register double *res, *mat, tmp; + register int len, wid, i, k, j, jlen, ilen, imat, jmat; + Matrix *arg; + + /* get matrix input argument */ + /* should be matrix in which num rows >= num columns */ + arg=prhs[0]; + mat= mxGetPr(arg); + len = (int) mxGetM(arg); + wid = (int) mxGetN(arg); + if ( wid > len ) + printf("innerProd: Warning: width %d is greater than length %d.\n",wid,len); + plhs[0] = (Matrix *) mxCreateFull(wid,wid,REAL); + if (plhs[0] == NULL) + mexErrMsgTxt(sprintf("Error allocating %dx%d result matrix",wid,wid)); + res = mxGetPr(plhs[0]); + + for(i=0, ilen=0; i