Changeset 13038 for issm/trunk-jpl/src/modules/Chaco/Chaco.cpp
- Timestamp:
- 08/14/12 17:12:51 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/modules/Chaco/Chaco.cpp
r13036 r13038 54 54 nvtxs = mxGetN(A_IN); 55 55 mwstart = mxGetJc(A_IN); 56 start= (int*)xmalloc((nvtxs+1)*sizeof(int));56 start=xNew<int>((nvtxs+1)); 57 57 for (i=0; i<nvtxs+1;i++)start[i]=(int)mwstart[i]; 58 58 59 59 mwadjacency = mxGetIr(A_IN); 60 adjacency = (int*)xmalloc(mxGetNzmax(A_IN)*sizeof(int));60 adjacency = xNew<int>(mxGetNzmax(A_IN)); 61 61 for (i=0; i<mxGetNzmax(A_IN); i++) adjacency[i]= (int)mwadjacency[i]; 62 62 63 63 nedges = start[nvtxs]; 64 64 if(!mxIsEmpty(EWGTS_IN)){ 65 ewgts = (float*)xcalloc(nedges, sizeof(float));65 ewgts = xNewZeroInit<float>(nedges); 66 66 doublepointer=mxGetPr(A_IN); 67 67 for (i = 0; i < nedges; i++)ewgts[i] = (float)doublepointer[i]; … … 77 77 for (i=0;i<(nterms<10?nterms:10);i++) options[i]=in_options[i]; //copy in_options into default options 78 78 FetchData(&npart,NPARTS_IN); 79 nparts= (int*)xmalloc(sizeof(int)); nparts[0]=npart; //weird Chacox interface ain't it?79 nparts=xNew<int>(1); nparts[0]=npart; //weird Chacox interface ain't it? 80 80 FetchData(&goal,&nterms,GOAL_IN); 81 81 … … 104 104 105 105 /*Allocate output: */ 106 assignment = (short*)xcalloc(nvtxs, sizeof(short));106 assignment = xNewZeroInit<short>(nvtxs); 107 107 108 108 /*Call core: */ … … 110 110 111 111 /*Output data: */ 112 doubleassignment= (double*)xmalloc(nvtxs*sizeof(double));112 doubleassignment=xNew<double>(nvtxs); 113 113 for(i=0;i<nvtxs;i++) doubleassignment[i]=(double)assignment[i]; 114 114 WriteData(ASSGN_OUT,doubleassignment,nvtxs);
Note:
See TracChangeset
for help on using the changeset viewer.