VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Common
Core
vtkMathUtilities.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkMathUtilities.h
5
6
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7
All rights reserved.
8
See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9
10
This software is distributed WITHOUT ANY WARRANTY; without even
11
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12
PURPOSE. See the above copyright notice for more information.
13
14
=========================================================================*/
15
29
#ifndef __vtkMathUtilities_h
30
#define __vtkMathUtilities_h
31
32
#include <cmath>
33
#include <limits>
34
35
namespace
vtkMathUtilities
36
{
37
39
40
template
<
class
A>
41
bool
FuzzyCompare
(A a, A b)
42
{
43
return
fabs(a - b) < std::numeric_limits<A>::epsilon();
44
}
46
48
50
template
<
class
A>
51
bool
FuzzyCompare
(A a, A b, A epsilon)
52
{
53
return
fabs(a - b) < epsilon;
54
}
56
57
}
// End vtkMathUtilities namespace.
58
59
#endif // __vtkMathUtilities_h
60
// VTK-HeaderTest-Exclude: vtkMathUtilities.h
Generated on Thu May 24 2012 22:22:08 for VTK by
1.8.1