/* En entree : XYZva, XYZvb, trib, weight, defl En sortie : Cii siga==sig[0], sigb==sig[1], sigc==sig[2], sigd==sig[3] weight=(sig[0]-sig[1])/((sig[2]+sig[3])*2.*pi) ; */ #include #include "mex.h" void Cij_lin(double C[], double XYZva[], int Nverta, double XYZvb[], int Nvertb, double trib[], int Ntrib, double weight, double defl) { double dO, dO1, dO2, dO3 ; double si[3], r1[3], r2[3], r3[3], det, den, d1, d2, d3 ; double r21[3], r32[3], r13[3], l21, l32, l13 ; double g1, g2 ,g3, Ome[3], z1[3], z2[3], z3[3] ; double tmp[3], n[3], nn, beta, ideuxA ; int i, j, u, v, w ; printf("Nverta = %d\n",Nverta); printf("Ntrib = %d\n",Ntrib); for (i=0;i1) { mexErrMsgTxt("1 Output : Cii") ; } mXYZva=mxGetM(prhs[0]) ; nXYZva=mxGetN(prhs[0]) ; if (!mxIsNumeric(prhs[0]) || mxIsComplex(prhs[0]) || mxIsSparse(prhs[0]) || (nXYZva!=3)) { mexErrMsgTxt("XYZva must be a matrix : Nverta x 3") ; } mXYZvb=mxGetM(prhs[1]) ; nXYZvb=mxGetN(prhs[1]) ; if (!mxIsNumeric(prhs[1]) || mxIsComplex(prhs[1]) || mxIsSparse(prhs[1]) || (nXYZvb!=3)) { mexErrMsgTxt("XYZvb must be a matrix : Nvertb x 3") ; } mtrib=mxGetM(prhs[2]) ; ntrib=mxGetN(prhs[2]) ; if (!mxIsNumeric(prhs[2]) || mxIsComplex(prhs[2]) || mxIsSparse(prhs[2]) || !(ntrib==3)) { mexErrMsgTxt("trib must be a matrix : Ntrb x 3") ; } if (!mxIsNumeric(prhs[3]) || mxIsComplex(prhs[3]) || mxIsSparse(prhs[3]) || !mxIsDouble(prhs[3]) || mxGetN(prhs[3])*mxGetM(prhs[3])!=1 ) { mexErrMsgTxt("weight must be a scalar") ; } if (!mxIsNumeric(prhs[4]) || mxIsComplex(prhs[4]) || mxIsSparse(prhs[4]) || !mxIsDouble(prhs[4]) || mxGetN(prhs[4])*mxGetM(prhs[4])!=1 ) { mexErrMsgTxt("defl must be a scalar") ; } plhs[0]=mxCreateDoubleMatrix(mXYZva,mXYZvb,mxREAL) ; C=mxGetPr(plhs[0]) ; XYZva=mxGetPr(prhs[0]) ; XYZvb=mxGetPr(prhs[1]) ; trib=mxGetPr(prhs[2]) ; weight = mxGetScalar(prhs[3]) ; defl = mxGetScalar(prhs[4]) ; Cij_lin(C,XYZva,mXYZva,XYZvb,mXYZvb,trib,mtrib,weight,defl) ; mxSetPr(plhs[0],C) ; }