/* mult_by_table.c ../potential/tables */ /******************************************/ /* 6 input & 1 output */ /* Big table [0] */ /* Big domain [1] */ /* big sizes [2] */ /* Small table [3] */ /* small domain [4] */ /* small sizes [5] */ /* */ /* New big table[0] */ /******************************************/ #include "mex.h" void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]){ int i, j, count, NB, NS, siz_b, siz_s, ndim, temp; int *mask, *sx, *sy, *cpsy, *subs, *s, *cpsy2; double *pbDomain, *psDomain, *sp, *zp, *bs; plhs[0] = mxDuplicateArray(prhs[0]); zp = mxGetPr(plhs[0]); siz_b = mxGetNumberOfElements(prhs[1]); siz_s = mxGetNumberOfElements(prhs[4]); pbDomain = mxGetPr(prhs[1]); psDomain = mxGetPr(prhs[4]); NB = mxGetNumberOfElements(prhs[0]); NS = mxGetNumberOfElements(prhs[3]); sp = mxGetPr(prhs[3]); bs = mxGetPr(prhs[2]); if(NS == 1){ for(i=0; i