Ignore:
Timestamp:
Apr 11, 2009, 3:42:49 PM (16 years ago)
Author:
rwilson
Message:

Changes to make legacy Numeric API work in numpy.

Location:
branches/numpy/anuga/shallow_water
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/shallow_water/shallow_water_ext.c

    r6738 r6780  
    1818#include "math.h"
    1919#include <stdio.h>
     20
     21#include "numpy_shim.h"
    2022
    2123// Shared code snippets
     
    16261628  // Allocate space for return vector r (don't DECREF)
    16271629  dimensions[0] = 3;
    1628   r = (PyArrayObject *) PyArray_ZEROS(1, (npy_intp*) dimensions, PyArray_DOUBLE, 0);
     1630  r = (PyArrayObject *) anuga_FromDims(1, dimensions, PyArray_DOUBLE);
    16291631
    16301632  // Copy
  • branches/numpy/anuga/shallow_water/urs_ext.c

    r6738 r6780  
    1313#include <float.h>
    1414#include <time.h>
     15
     16#include "numpy_shim.h"
    1517
    1618#define MAX_FILE_NAME_LENGTH 128
     
    788790    dimensions[1] = num_ts + POFFSET;
    789791   
    790     pydata = (PyArrayObject*) PyArray_ZEROS(2, (npy_intp*) dimensions, PyArray_DOUBLE, 0);
     792    pydata = (PyArrayObject*) anuga_FromDims(2, dimensions, PyArray_DOUBLE);
    791793    if(pydata == NULL)
    792794    {
Note: See TracChangeset for help on using the changeset viewer.