/* En entree : ind_tr, XYZv, weight, defl En Sortie : Cii_cog weight=(sig[0]-sig[1])/((sig[0]+sig[1])*2.*pi) ; */ #include #include "mex.h" void Cii_cog(double C[], double ind_tr[], int Ntri, double XYZv[], int Nvert, double weight, double defl) { double dO ; double si[3], su[3], sv[3], sw[3] ; double r1[3], r2[3], r3[3], det, den, d1, d2, d3 ; int i, j, u, v, w ; printf("Ntri = %d\n",Ntri); printf("weight = %f , defl = %f \n",weight,defl) ; for (i=0;i1) { mexErrMsgTxt("1 Output : Cii_cog") ; } mind=mxGetM(prhs[0]) ; nind=mxGetN(prhs[0]) ; if (!mxIsNumeric(prhs[0]) || mxIsComplex(prhs[0]) || mxIsSparse(prhs[0]) || !(nind==3)) { mexErrMsgTxt("tri must be a matrix : Ntri x 3") ; } mXYZv=mxGetM(prhs[1]) ; nXYZv=mxGetN(prhs[1]) ; if (!mxIsNumeric(prhs[1]) || mxIsComplex(prhs[1]) || mxIsSparse(prhs[1]) || (nXYZv!=3) ) { mexErrMsgTxt("X must be a matrix : Nvert x 3") ; } if (!mxIsNumeric(prhs[2]) || mxIsComplex(prhs[2]) || mxIsSparse(prhs[2]) || !mxIsDouble(prhs[2]) || mxGetN(prhs[2])*mxGetM(prhs[2])!=1 ) { mexErrMsgTxt("weight must be a scalar") ; } if (!mxIsNumeric(prhs[3]) || mxIsComplex(prhs[3]) || mxIsSparse(prhs[3]) || !mxIsDouble(prhs[3]) || mxGetN(prhs[3])*mxGetM(prhs[3])!=1 ) { mexErrMsgTxt("defl must be a scalar") ; } plhs[0]=mxCreateDoubleMatrix(mind,mind,mxREAL) ; Cii=mxGetPr(plhs[0]) ; ind_tr=mxGetPr(prhs[0]) ; XYZv=mxGetPr(prhs[1]) ; weight = mxGetScalar(prhs[2]) ; defl = mxGetScalar(prhs[3]) ; Cii_cog(Cii, ind_tr, mind, XYZv, mXYZv, weight, defl) ; mxSetPr(plhs[0],Cii) ; }