Changeset 7700


Ignore:
Timestamp:
Apr 29, 2010, 11:11:52 AM (14 years ago)
Author:
hudson
Message:

Ticket 327 - marginal 5% speed increase by removing is_inside_triangle wrapper to C function and just calling directly.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_core/source/anuga/fit_interpolate/search_functions.py

    r7276 r7700  
    88import time
    99
    10 from anuga.utilities.polygon import is_inside_triangle
     10from anuga.utilities import compile
     11if compile.can_use_C_extension('polygon_ext.c'):
     12    # Underlying C implementations can be accessed
     13    from polygon_ext import _is_inside_triangle 
     14       
     15#from anuga.utilities.polygon import is_inside_triangle
    1116from anuga.utilities.numerical_tools import get_machine_precision
    1217from anuga.config import max_float
     
    105110        # tri is a list of verts (x, y), representing a tringle
    106111        # Find triangle that contains x (if any) and interpolate
    107        
     112
    108113        # Input check disabled to speed things up.
    109         if is_inside_triangle(x, tri,
    110                               closed=True,
    111                               check_inputs=False):
     114        if _is_inside_triangle(x, tri,
     115                              int(True), 1.0e-12, 1.0e-12):
    112116           
    113117            n0, n1, n2 = tri_verts_norms[1]       
Note: See TracChangeset for help on using the changeset viewer.