Changeset 6738
- Timestamp:
- Apr 7, 2009, 1:21:39 PM (16 years ago)
- Location:
- branches/numpy/anuga
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy/anuga/mesh_engine/mesh_engine_c_layer.c
r6410 r6738 269 269 dimensions[0] = out.numberoftriangles; 270 270 dimensions[1] = 3; 271 gentrianglelist = (PyArrayObject *) PyArray_ FromDimsAndData(2,272 dimensions,271 gentrianglelist = (PyArrayObject *) PyArray_SimpleNewFromData(2, 272 (npy_intp*) dimensions, 273 273 PyArray_INT, 274 274 (char*) out.trianglelist); … … 277 277 dimensions[0] = out.numberofpoints; 278 278 dimensions[1] = 2; 279 genpointlist = (PyArrayObject *) PyArray_ FromDimsAndData(2,280 dimensions,279 genpointlist = (PyArrayObject *) PyArray_SimpleNewFromData(2, 280 (npy_intp*) dimensions, 281 281 PyArray_DOUBLE, 282 282 (char*) out.pointlist); … … 285 285 /* Add point marker list */ 286 286 dimensions[0] = out.numberofpoints; 287 genpointmarkerlist = (PyArrayObject *) PyArray_ FromDimsAndData(1,288 dimensions,287 genpointmarkerlist = (PyArrayObject *) PyArray_SimpleNewFromData(1, 288 (npy_intp*) dimensions, 289 289 PyArray_INT, 290 290 (char*) out.pointmarkerlist); … … 293 293 dimensions[0] = out.numberofpoints; 294 294 dimensions[1] = out.numberofpointattributes; 295 genpointattributelist = (PyArrayObject *) PyArray_ FromDimsAndData(2,296 dimensions,295 genpointattributelist = (PyArrayObject *) PyArray_SimpleNewFromData(2, 296 (npy_intp*) dimensions, 297 297 PyArray_DOUBLE, 298 298 (char*) out.pointattributelist); … … 303 303 dimensions[0] = out.numberoftriangles; 304 304 dimensions[1] = out.numberoftriangleattributes; 305 gentriangleattributelist = (PyArrayObject *) PyArray_ FromDimsAndData(2,306 dimensions,305 gentriangleattributelist = (PyArrayObject *) PyArray_SimpleNewFromData(2, 306 (npy_intp*) dimensions, 307 307 PyArray_DOUBLE, 308 308 (char*)out.triangleattributelist); … … 311 311 dimensions[0] = out.numberofsegments; 312 312 dimensions[1] = 2; 313 gensegmentlist = (PyArrayObject *) PyArray_ FromDimsAndData(2,314 dimensions,313 gensegmentlist = (PyArrayObject *) PyArray_SimpleNewFromData(2, 314 (npy_intp*) dimensions, 315 315 PyArray_INT, 316 316 (char*)out.segmentlist); … … 319 319 /* Add segment marker list */ 320 320 dimensions[0] = out.numberofsegments; 321 gensegmentmarkerlist = (PyArrayObject *) PyArray_ FromDimsAndData(1,322 dimensions,321 gensegmentmarkerlist = (PyArrayObject *) PyArray_SimpleNewFromData(1, 322 (npy_intp*) dimensions, 323 323 PyArray_INT, 324 324 (char*)out.segmentmarkerlist); … … 328 328 dimensions[0] = out.numberoftriangles; 329 329 dimensions[1] = 3; 330 genneighborlist = (PyArrayObject *) PyArray_ FromDimsAndData(2,331 dimensions,330 genneighborlist = (PyArrayObject *) PyArray_SimpleNewFromData(2, 331 (npy_intp*) dimensions, 332 332 PyArray_INT, 333 333 (char*)out.neighborlist); … … 335 335 dimensions[0] = 0; 336 336 dimensions[1] = 0; 337 genneighborlist = (PyArrayObject *) PyArray_FromDims(2, 338 dimensions, 339 PyArray_INT); 337 genneighborlist = (PyArrayObject *) PyArray_ZEROS(2, 338 (npy_intp*) dimensions, 339 PyArray_INT, 340 0); 340 341 } 341 342 -
branches/numpy/anuga/shallow_water/shallow_water_ext.c
r6410 r6738 1626 1626 // Allocate space for return vector r (don't DECREF) 1627 1627 dimensions[0] = 3; 1628 r = (PyArrayObject *) PyArray_ FromDims(1, dimensions, PyArray_DOUBLE);1628 r = (PyArrayObject *) PyArray_ZEROS(1, (npy_intp*) dimensions, PyArray_DOUBLE, 0); 1629 1629 1630 1630 // Copy -
branches/numpy/anuga/shallow_water/urs_ext.c
r6553 r6738 788 788 dimensions[1] = num_ts + POFFSET; 789 789 790 pydata = (PyArrayObject*) PyArray_ FromDims(2, dimensions, PyArray_DOUBLE);790 pydata = (PyArrayObject*) PyArray_ZEROS(2, (npy_intp*) dimensions, PyArray_DOUBLE, 0); 791 791 if(pydata == NULL) 792 792 { -
branches/numpy/anuga/utilities/sparse_ext.c
r6304 r6738 136 136 //Allocate space for return vectors y (don't DECREF) 137 137 dimensions[0] = M; 138 y = (PyArrayObject *) PyArray_ FromDims(1, dimensions, PyArray_DOUBLE);138 y = (PyArrayObject *) PyArray_ZEROS(1, (npy_intp*) dimensions, PyArray_DOUBLE, 0); 139 139 140 140 err = _csr_mv(M, … … 159 159 dimensions[0] = M; //Number of rows in sparse matrix 160 160 dimensions[1] = columns; 161 y = (PyArrayObject *) PyArray_ FromDims(2, dimensions, PyArray_DOUBLE);161 y = (PyArrayObject *) PyArray_ZEROS(2, (npy_intp*) dimensions, PyArray_DOUBLE, 0); 162 162 163 163 err = _csr_mm(M, columns,
Note: See TracChangeset
for help on using the changeset viewer.