Gaudi Framework, version v24r2
Home
Generated: Wed Dec 4 2013
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GaudiKernel
GaudiKernel
Lomont.h
Go to the documentation of this file.
1
// $Id: Lomont.h,v 1.2 2009/07/06 08:57:16 cattanem Exp $
2
// ============================================================================
3
#ifndef GAUDIKERNEL_LOMONT_H
4
#define GAUDIKERNEL_LOMONT_H 1
5
// ============================================================================
6
// Include file
7
// ============================================================================
8
// STD & STL
9
// ============================================================================
10
#include <
functional
>
11
// ============================================================================
12
// GaudiKernel
13
// ============================================================================
14
#include "
GaudiKernel/Kernel.h
"
15
// ============================================================================
16
namespace
Gaudi
17
{
18
// ==========================================================================
19
namespace
Math
20
{
21
// ========================================================================
40
template
<
class
TYPE>
class
Lomont
;
41
// ========================================================================
89
GAUDI_API
90
bool
lomont_compare_float
91
(
const
float
af ,
92
const
float
bf ,
93
const
unsigned
short
maxULPs ) ;
94
// ========================================================================
130
GAUDI_API
131
bool
lomont_compare_double
132
(
const
double
af ,
133
const
double
bf ,
134
const
unsigned
int
maxULPs ) ;
135
// ========================================================================
155
template
<>
156
class
Lomont
<float> :
public
std::binary_function
<float,float,bool>
157
{
158
// ======================================================================
159
public
:
160
// ======================================================================
162
Lomont
(
const
unsigned
short
ulps ) : m_ulps ( ulps ) {}
163
// ======================================================================
164
public
:
165
// ======================================================================
167
inline
bool
operator () (
const
float
a ,
const
float
b )
const
168
{
return
lomont_compare_float
( a , b , m_ulps ) ; }
169
// ======================================================================
170
private
:
171
// ======================================================================
173
Lomont
() ;
// the default constructor is disabled
174
// ======================================================================
175
private
:
176
// ======================================================================
178
unsigned
short
m_ulps
;
// the precision in "units in last place"
179
// ======================================================================
180
};
181
// ========================================================================
201
template
<>
202
class
Lomont
<double> :
public
std::binary_function
<double,double,bool>
203
{
204
// ======================================================================
205
public
:
206
// ======================================================================
208
Lomont
(
const
unsigned
int
ulps ) : m_ulps ( ulps ) {}
209
// ======================================================================
210
public
:
211
// ======================================================================
213
inline
bool
operator () (
const
double
a ,
const
double
b )
const
214
{
return
lomont_compare_double
( a , b , m_ulps ) ; }
215
// ======================================================================
216
private
:
217
// ======================================================================
219
Lomont
() ;
// the default constructor is disabled
220
// ======================================================================
221
private
:
222
// ======================================================================
224
unsigned
int
m_ulps
;
// the precision in "units in last place"
225
// ======================================================================
226
};
227
// ========================================================================
244
GAUDI_API
245
float
next_float
(
const
float
af ,
const
short
ulps ) ;
246
// ========================================================================
263
GAUDI_API
264
double
next_double
(
const
double
af ,
const
short
ulps ) ;
265
// ========================================================================
266
}
// end of namespace Gaudi::Math
267
// ==========================================================================
268
}
// end of namespace Gaudi
269
// ============================================================================
270
// The END
271
// ============================================================================
272
#endif // GAUDIKERNEL_LOMONT_H
273
// ============================================================================
Generated at Wed Dec 4 2013 14:33:09 for Gaudi Framework, version v24r2 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004