| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

LHCbMath.cpp

Go to the documentation of this file.
00001 // $Id: LHCbMath.cpp,v 1.1 2008/04/03 11:26:18 cattanem Exp $
00002 // ============================================================================
00003 // Include files
00004 // ============================================================================
00005 // GSL 
00006 // ============================================================================
00007 #include "gsl/gsl_sys.h"
00008 // ============================================================================
00009 // Local
00010 // ============================================================================
00011 #include "LHCbMath/LHCbMath.h"
00012 // ============================================================================
00018 // ============================================================================
00019 /*  compare two double numbers with the relative
00020  *  precision   'epsilon'
00021  *
00022  *  Essentially it is a wrapper to gsl_fcmp function 
00023  *  from GSL library
00024  *
00025  *  See D.E.Knuth, "Seminumerical Algorithms", section 4.2.2
00026  *  
00027  *  @author Vanya BELYAEV ibelyaev@physics.syr.edu
00028  *  @date 2007-11-27
00029  */
00030 // ============================================================================
00031 bool LHCb::Math::equal_to_double
00032 ( const double value1  , 
00033   const double value2  , 
00034   const double epsilon ) 
00035 {
00036   return 
00037     !epsilon    ? 0 == gsl_fcmp ( value1 , value2 , 1.0e-6  ) : 
00038     0 < epsilon ? 0 == gsl_fcmp ( value1 , value2 , epsilon ) : 
00039     0 == gsl_fcmp ( value1 , value2 , -epsilon ) ;
00040 }
00041 // ============================================================================
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:02:57 2011 for LHCbMath by doxygen 1.4.7