Changeset 6780
- Timestamp:
- Apr 11, 2009, 3:42:49 PM (16 years ago)
- Location:
- branches/numpy/anuga
- Files:
-
- 1 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/numpy/anuga/mesh_engine/mesh_engine_c_layer.c
r6738 r6780 61 61 62 62 #include "util_ext.h" 63 #include "numpy_shim.h" 63 64 64 65 … … 269 270 dimensions[0] = out.numberoftriangles; 270 271 dimensions[1] = 3; 271 gentrianglelist = (PyArrayObject *) PyArray_SimpleNewFromData(2,272 (npy_intp*)dimensions,272 gentrianglelist = (PyArrayObject *) anuga_FromDimsAndData(2, 273 dimensions, 273 274 PyArray_INT, 274 275 (char*) out.trianglelist); … … 277 278 dimensions[0] = out.numberofpoints; 278 279 dimensions[1] = 2; 279 genpointlist = (PyArrayObject *) PyArray_SimpleNewFromData(2,280 (npy_intp*)dimensions,280 genpointlist = (PyArrayObject *) anuga_FromDimsAndData(2, 281 dimensions, 281 282 PyArray_DOUBLE, 282 283 (char*) out.pointlist); … … 285 286 /* Add point marker list */ 286 287 dimensions[0] = out.numberofpoints; 287 genpointmarkerlist = (PyArrayObject *) PyArray_SimpleNewFromData(1,288 (npy_intp*)dimensions,288 genpointmarkerlist = (PyArrayObject *) anuga_FromDimsAndData(1, 289 dimensions, 289 290 PyArray_INT, 290 291 (char*) out.pointmarkerlist); … … 293 294 dimensions[0] = out.numberofpoints; 294 295 dimensions[1] = out.numberofpointattributes; 295 genpointattributelist = (PyArrayObject *) PyArray_SimpleNewFromData(2,296 (npy_intp*)dimensions,296 genpointattributelist = (PyArrayObject *) anuga_FromDimsAndData(2, 297 dimensions, 297 298 PyArray_DOUBLE, 298 299 (char*) out.pointattributelist); … … 303 304 dimensions[0] = out.numberoftriangles; 304 305 dimensions[1] = out.numberoftriangleattributes; 305 gentriangleattributelist = (PyArrayObject *) PyArray_SimpleNewFromData(2,306 (npy_intp*)dimensions,306 gentriangleattributelist = (PyArrayObject *) anuga_FromDimsAndData(2, 307 dimensions, 307 308 PyArray_DOUBLE, 308 309 (char*)out.triangleattributelist); … … 311 312 dimensions[0] = out.numberofsegments; 312 313 dimensions[1] = 2; 313 gensegmentlist = (PyArrayObject *) PyArray_SimpleNewFromData(2,314 (npy_intp*)dimensions,314 gensegmentlist = (PyArrayObject *) anuga_FromDimsAndData(2, 315 dimensions, 315 316 PyArray_INT, 316 317 (char*)out.segmentlist); … … 319 320 /* Add segment marker list */ 320 321 dimensions[0] = out.numberofsegments; 321 gensegmentmarkerlist = (PyArrayObject *) PyArray_SimpleNewFromData(1,322 (npy_intp*)dimensions,322 gensegmentmarkerlist = (PyArrayObject *) anuga_FromDimsAndData(1, 323 dimensions, 323 324 PyArray_INT, 324 325 (char*)out.segmentmarkerlist); … … 328 329 dimensions[0] = out.numberoftriangles; 329 330 dimensions[1] = 3; 330 genneighborlist = (PyArrayObject *) PyArray_SimpleNewFromData(2,331 (npy_intp*)dimensions,331 genneighborlist = (PyArrayObject *) anuga_FromDimsAndData(2, 332 dimensions, 332 333 PyArray_INT, 333 334 (char*)out.neighborlist); … … 335 336 dimensions[0] = 0; 336 337 dimensions[1] = 0; 337 genneighborlist = (PyArrayObject *) PyArray_ZEROS(2, 338 (npy_intp*) dimensions, 339 PyArray_INT, 340 0); 338 genneighborlist = (PyArrayObject *) anuga_FromDims(2, 339 dimensions, 340 PyArray_INT); 341 341 } 342 342 -
branches/numpy/anuga/shallow_water/shallow_water_ext.c
r6738 r6780 18 18 #include "math.h" 19 19 #include <stdio.h> 20 21 #include "numpy_shim.h" 20 22 21 23 // Shared code snippets … … 1626 1628 // Allocate space for return vector r (don't DECREF) 1627 1629 dimensions[0] = 3; 1628 r = (PyArrayObject *) PyArray_ZEROS(1, (npy_intp*) dimensions, PyArray_DOUBLE, 0);1630 r = (PyArrayObject *) anuga_FromDims(1, dimensions, PyArray_DOUBLE); 1629 1631 1630 1632 // Copy -
branches/numpy/anuga/shallow_water/urs_ext.c
r6738 r6780 13 13 #include <float.h> 14 14 #include <time.h> 15 16 #include "numpy_shim.h" 15 17 16 18 #define MAX_FILE_NAME_LENGTH 128 … … 788 790 dimensions[1] = num_ts + POFFSET; 789 791 790 pydata = (PyArrayObject*) PyArray_ZEROS(2, (npy_intp*) dimensions, PyArray_DOUBLE, 0);792 pydata = (PyArrayObject*) anuga_FromDims(2, dimensions, PyArray_DOUBLE); 791 793 if(pydata == NULL) 792 794 { -
branches/numpy/anuga/utilities/sparse_ext.c
r6738 r6780 14 14 #include "math.h" 15 15 #include "stdio.h" 16 #include "numpy_shim.h" 16 17 17 18 //Matrix-vector routine … … 136 137 //Allocate space for return vectors y (don't DECREF) 137 138 dimensions[0] = M; 138 y = (PyArrayObject *) PyArray_ZEROS(1, (npy_intp*) dimensions, PyArray_DOUBLE, 0);139 y = (PyArrayObject *) anuga_FromDims(1, dimensions, PyArray_DOUBLE); 139 140 140 141 err = _csr_mv(M, … … 159 160 dimensions[0] = M; //Number of rows in sparse matrix 160 161 dimensions[1] = columns; 161 y = (PyArrayObject *) PyArray_ZEROS(2, (npy_intp*) dimensions, PyArray_DOUBLE, 0);162 y = (PyArrayObject *) anuga_FromDims(2, dimensions, PyArray_DOUBLE); 162 163 163 164 err = _csr_mm(M, columns,
Note: See TracChangeset
for help on using the changeset viewer.