void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray*prhs[] ) { enum{ P1i , P2i , t1i , typei }; enum{ feat1i , feat2i }; oliCheckArgNumber(nrhs,4,nlhs,2); int nP1,nP2,nT1; double* pP1 = oliCheckArg(prhs,P1i,2,&nP1,oliDouble); double* pP2 = oliCheckArg(prhs,P2i,2,&nP2,oliDouble); int* pT1 = (int*)oliCheckArg(prhs,t1i,3,&nT1,oliInt); const int nFeature=3; plhs[feat1i] = mxCreateDoubleMatrix(nFeature, nT1, mxREAL); double* pF1 = mxGetPr(plhs[feat1i]); plhs[feat2i] = mxCreateDoubleMatrix(nFeature, nP2*nP2*nP2, mxREAL); double* pF2 = mxGetPr(plhs[feat2i]); computeFeature(pP1,nP1,pP2,nP2,pT1,nT1,pF1,pF2); }
void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { enum{match, aff1, aff2, bSing, bRefl}; enum{dist, flip}; oliCheckArgNumber(nrhs,5,nlhs,2); int nMatch, nFeat1, nFeat2; int* pMatch = (int*)oliCheckArg(prhs,match,&nMatch,2,oliInt); double* pAff1 = oliCheckArg(prhs,aff1,&nFeat1,9,oliDouble); double* pAff2 = oliCheckArg(prhs,aff2,&nFeat2,9,oliDouble); double* pBoolSing = oliCheckArg(prhs,bSing,1,1,oliDouble); double* pBoolRefl = oliCheckArg(prhs,bRefl,1,1,oliDouble); plhs[dist] = mxCreateDoubleMatrix(nMatch, nMatch, mxREAL); double* pDist = mxGetPr(plhs[dist]); plhs[flip] = mxCreateDoubleMatrix(nMatch, nMatch, mxREAL); double* pFlip = mxGetPr(plhs[flip]); affTransDist(pMatch, nMatch, pAff1, nFeat1, pAff2, nFeat2, pBoolSing, pBoolRefl, pDist, pFlip); }