Changeset 4748
- Timestamp:
- 07/22/10 14:14:00 (15 years ago)
- Location:
- issm/trunk/src/mex/SparseToVector
- Files:
-
- 1 added
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk/src/mex/SparseToVector/SparseToVector.c
r4746 r4748 1 /*\file SparseToVector.cpp 2 *\brief: extract from a sparse matlab matrix ir, jc, and other information 3 */ 1 4 2 # define THISFUNCTION "SparseToVector"5 #include "./SparseToVector.h" 3 6 4 #include <stdio.h> 5 #include <string.h> /* strcasecmp */ 6 #include <time.h> /* clock,time,difftime */ 7 #include "mex.h" 8 9 10 /* Input Arguments */ 11 12 #define A_IN prhs[0] 13 14 /* Output Arguments */ 15 16 #define IR_OUT plhs[0] 17 #define JC_OUT plhs[1] 18 #define PR_OUT plhs[2] 19 #define M_OUT plhs[3] 20 #define N_OUT plhs[4] 21 #define NZMAX_OUT plhs[5] 22 23 24 void SparseToVectorUsage( void ); 25 26 27 void mexFunction( int nlhs, 28 mxArray *plhs[], 29 int nrhs, 30 const mxArray *prhs[] ) 31 { 32 mwIndex *ir =NULL,*jc =NULL; 33 double *ird=NULL,*jcd=NULL,*pr=NULL,*prd=NULL; 7 void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] ) { 8 34 9 int i; 10 11 /*Output: */ 12 mwIndex *ir =NULL; 13 mwIndex *jc =NULL; 14 double *ird=NULL; 15 double *jcd=NULL; 16 double *pr=NULL; 17 double *prd=NULL; 35 18 36 19 /* Check for proper number of arguments */ … … 48 31 49 32 if (!mxIsNumeric(A_IN) || !mxIsSparse(A_IN)) { 50 mexPrintf("%s -- Input matrix must be numeric and sparse.\n", THISFUNCTION);33 mexPrintf("%s -- Input matrix must be numeric and sparse.\n",__FUNCT__); 51 34 mexErrMsgTxt(" "); 52 35 } … … 95 78 } 96 79 mexPrintf("%s -- Input matrix is of size %d by %d with %d non-zeroes.\n", 97 THISFUNCTION,mxGetM(A_IN),mxGetN(A_IN),mxGetNzmax(A_IN));80 __FUNCT__,mxGetM(A_IN),mxGetN(A_IN),mxGetNzmax(A_IN)); 98 81 } 99 100 return;101 82 } 102 83 103 void SparseToVectorUsage( void ) 104 { 84 void SparseToVectorUsage( void ){ 105 85 106 86 mexPrintf("\n"); 107 87 mexPrintf("Usage: [ir,jc,pr,m,n,nzmax]=SparseToVector(a);\n"); 108 88 mexPrintf("\n"); 109 110 return;111 89 } 112 90
Note:
See TracChangeset
for help on using the changeset viewer.