From 8070dc963753142bb86c4ed698d91fd623ed28e7 Mon Sep 17 00:00:00 2001 From: ziejd2 Date: Thu, 28 Sep 2017 15:04:40 -0500 Subject: BNW using Octave instead of Matlab. This version of BNW should perform the same as the original version. The only difference is that it uses Octave instead of Matlab when running BayesNet Toolbox during parameter learning. I am calling this BNW_1.02. It can be accessed at: compbio.uthsc.edu/BNW_1.02 --- sourcecodes/bnt-master/KPMtools/max_mult.c | 46 ++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 sourcecodes/bnt-master/KPMtools/max_mult.c (limited to 'sourcecodes/bnt-master/KPMtools/max_mult.c') diff --git a/sourcecodes/bnt-master/KPMtools/max_mult.c b/sourcecodes/bnt-master/KPMtools/max_mult.c new file mode 100644 index 00000000..204fd956 --- /dev/null +++ b/sourcecodes/bnt-master/KPMtools/max_mult.c @@ -0,0 +1,46 @@ +/* C mex version of max_mult.m in BPMRF2 directory */ +/* gcc -Wall -I/mit/matlab_v6.5/distrib/bin/glnx86 -c max_mult.c */ + +#include +#include "mex.h" + +void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) +{ + int rows,cols,common,m,n,p; + double y1, y2; + double *arr1, *arr2, *arr3; + + + if (nrhs!=2 || nlhs>1) + mexErrMsgTxt("max_mult requires two inputs and one output"); + if (mxIsChar(prhs[0]) || mxIsClass(prhs[0], "sparse") || mxIsComplex(prhs[0]) + || mxIsChar(prhs[1]) || mxIsClass(prhs[1], "sparse") || mxIsComplex(prhs[1])) + mexErrMsgTxt("Inputs must be real, full, and nonstring"); + if (mxGetN(prhs[0])!=mxGetM(prhs[1])) + mexErrMsgTxt("The number of columns of A must be the same as the number of rows of x"); + + + arr1=mxGetPr(prhs[0]); + arr2=mxGetPr(prhs[1]); + p=mxGetN(prhs[0]); + m=mxGetM(prhs[0]); + n=mxGetN(prhs[1]); + plhs[0]=mxCreateDoubleMatrix(m, n, mxREAL); + arr3=mxMalloc(m*n*sizeof(double)); + + for (rows=0; rowsy1) + y1=y2; + } + arr3[rows+cols*m]=y1; + } + + mxSetPr(plhs[0], arr3); + +} -- cgit 1.4.1