Changeset 1032


Ignore:
Timestamp:
Mar 8, 2005, 11:21:06 AM (20 years ago)
Author:
ole
Message:

Changed int* to long* for use with 64 bit

Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/test_util.py

    r1024 r1032  
    920920
    921921    def test_outside_polygon(self):
    922 
    923922        U = [[0,0], [1,0], [1,1], [0,1]] #Unit square   
     923
    924924        assert not outside_polygon( [0.5, 0.5], U )
    925925        #evaluate to False as the point 0.5, 0.5 is inside the unit square
    926 
     926       
    927927        assert outside_polygon( [1.5, 0.5], U )
    928928        #evaluate to True as the point 1.5, 0.5 is outside the unit square
  • inundation/ga/storm_surge/pyvolution/util_ext.c

    r1020 r1032  
    99//
    1010// Ole Nielsen, GA 2004
     11//
     12//NOTE: On 64 bit systems use long* instead of int* for Numeric arrays
     13//this will also work on 32 bit systems
     14
    1115
    1216#include "Python.h"
     
    6367                    double* points,
    6468                    double* polygon,
    65                     int* indices,    // M-Array for storage indices
     69                    long* indices,    // M-Array for storage indices
    6670                    int closed,
    6771                    int verbose) {
     
    227231
    228232  //printf("M=%d, N=%d\n", M, N);
    229   // Call underlying routine
     233  //Call underlying routine
    230234  count = _inside_polygon(M, N,
    231235                          (double*) point -> data,
    232236                          (double*) polygon -> data,
    233                           (int*) indices -> data,
     237                          (long*) indices -> data,
    234238                          closed, verbose);
    235239
Note: See TracChangeset for help on using the changeset viewer.