Rev | Line | |
---|
[2994] | 1 | /*\file Test.c
|
---|
| 2 | *\brief: test module. do whatever you want in here
|
---|
| 3 | */
|
---|
| 4 |
|
---|
| 5 | #include "./Test.h"
|
---|
| 6 |
|
---|
| 7 | void mexFunction( int nlhs, mxArray* plhs[], int nrhs, const mxArray* prhs[]){
|
---|
| 8 |
|
---|
| 9 | /*Boot module: */
|
---|
| 10 | MODULEBOOT();
|
---|
| 11 |
|
---|
| 12 | /*checks on arguments on the matlab side: */
|
---|
| 13 | CheckNumMatlabArguments(nlhs,NLHS,nrhs,NRHS,__FUNCT__,&TestUsage);
|
---|
| 14 |
|
---|
| 15 | double* pr=mxGetPr(prhs[0]);
|
---|
| 16 | int M=mxGetM(prhs[0]);
|
---|
| 17 | int N=mxGetM(prhs[0]);
|
---|
| 18 | mwIndex* ir=mxGetIr(prhs[0]);
|
---|
| 19 | mwIndex* jc=mxGetJc(prhs[0]);
|
---|
| 20 | int nzmax=(int)mxGetNzmax(prhs[0]);
|
---|
| 21 |
|
---|
| 22 | int i;
|
---|
| 23 | printf("nzmax %i\n",nzmax);
|
---|
| 24 | printf("jc:\n");
|
---|
| 25 | for(i=0;i<N+1;i++){
|
---|
| 26 | printf("%i\n",jc[i]);
|
---|
| 27 | }
|
---|
| 28 | printf("ir vale:\n");
|
---|
| 29 | for(i=0;i<nzmax;i++){
|
---|
| 30 | printf("%i %g\n",ir[i],pr[i]);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 |
|
---|
| 34 | /*end module: */
|
---|
| 35 | MODULEEND();
|
---|
| 36 | }
|
---|
| 37 |
|
---|
| 38 | void TestUsage(void)
|
---|
| 39 | {
|
---|
| 40 | _printf_("\n");
|
---|
| 41 | _printf_(" usage: %s(whatever in here);\n",__FUNCT__);
|
---|
| 42 | _printf_("\n");
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.