Changeset 3858


Ignore:
Timestamp:
Oct 25, 2006, 5:21:42 PM (18 years ago)
Author:
ole
Message:

Brought back single precision check in search functions. Machine precision is too severe and probably not warranted.

File:
1 edited

Legend:

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

    r3850 r3858  
    8484            sigma1 = dot((x-xi2), n1)/dot((xi1-xi2), n1)
    8585
    86             # Integrity check - machine precision is too hard, but at
    87             # least check that we are within a couple of orders of magnitude
    88             epsilon = get_machine_precision()
    89             msg = 'abs(sigma0+sigma1+sigma2-1) = %.15e, 100*eps = %.15e'\
    90                   %(abs(sigma0+sigma1+sigma2-1), 100*epsilon)
    91             assert abs(sigma0 + sigma1 + sigma2 - 1.0) < 100*epsilon, msg
     86            # Integrity check - machine precision is too hard.
     87            #epsilon = get_machine_precision()           
     88            # Use single precision as we used to here
     89            epsilon = 1.0e-6
     90            msg = 'abs(sigma0+sigma1+sigma2-1) = %.15e, eps = %.15e'\
     91                  %(abs(sigma0+sigma1+sigma2-1), epsilon)
     92            assert abs(sigma0 + sigma1 + sigma2 - 1.0) < epsilon, msg
    9293
    9394            #Check that this triangle contains the data point
Note: See TracChangeset for help on using the changeset viewer.