Changeset 1032
- Timestamp:
- Mar 8, 2005, 11:21:06 AM (20 years ago)
- Location:
- inundation/ga/storm_surge/pyvolution
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pyvolution/test_util.py
r1024 r1032 920 920 921 921 def test_outside_polygon(self): 922 923 922 U = [[0,0], [1,0], [1,1], [0,1]] #Unit square 923 924 924 assert not outside_polygon( [0.5, 0.5], U ) 925 925 #evaluate to False as the point 0.5, 0.5 is inside the unit square 926 926 927 927 assert outside_polygon( [1.5, 0.5], U ) 928 928 #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 9 9 // 10 10 // 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 11 15 12 16 #include "Python.h" … … 63 67 double* points, 64 68 double* polygon, 65 int* indices, // M-Array for storage indices69 long* indices, // M-Array for storage indices 66 70 int closed, 67 71 int verbose) { … … 227 231 228 232 //printf("M=%d, N=%d\n", M, N); 229 // 233 //Call underlying routine 230 234 count = _inside_polygon(M, N, 231 235 (double*) point -> data, 232 236 (double*) polygon -> data, 233 ( int*) indices -> data,237 (long*) indices -> data, 234 238 closed, verbose); 235 239
Note: See TracChangeset
for help on using the changeset viewer.