vgl_homg.h
Go to the documentation of this file.
1 // This is core/vgl/vgl_homg.h
2 #ifndef vgl_homg_h_
3 #define vgl_homg_h_
4 //:
5 // \file
6 // \brief General purpose support class for vgl_homg_ classes
7 //
8 // This is the private base class for homogeneous vectors. It provides the
9 // get/set interface, and also a static variable vgl_homg::infinity which is used
10 // throughout when returning infinite nonhomogeneous values.
11 //
12 // \author
13 // Paul Beardsley, 29.03.96
14 // Oxford University, UK
15 //
16 // \verbatim
17 // Modifications
18 // 210297 AWF Switched to fixed-length vectors for speed.
19 // 23 Oct 2001 - Peter Vanroose - made templated and ported to vgl
20 // \endverbatim
21 //
22 //-------------------------------------------------------------------------------
23 
24 #ifdef _MSC_VER
25 # include <vcl_msvc_warnings.h>
26 #endif
27 #include <vgl/vgl_export.h>
28 
29 //: General purpose support class for vgl_homg_ classes
30 template <class T>
31 class vgl_homg
32 {
33  public:
34 
35 //: Standard placeholder for methods that wish to return infinity.
36  static VGL_EXPORT T infinity;
37 
38 //: Standard way to test whether a number is indeed infinite.
39  static bool is_infinity(T v) { return v == infinity; }
40 
41 //: The tolerance used in "near zero" tests in the vgl_homg subclasses.
42  static T infinitesimal_tol;
43 
44 //: Static method to set the default tolerance used for infinitesimal checks.
45 // The default is 1e-12.
46  static void set_infinitesimal_tol(T tol);
47 };
48 
49 #endif // vgl_homg_h_
static void set_infinitesimal_tol(T tol)
Static method to set the default tolerance used for infinitesimal checks.
#define v
Definition: vgl_vector_2d.h:74
static bool is_infinity(T v)
Standard way to test whether a number is indeed infinite.
Definition: vgl_homg.h:38
float infinitesimal_tol
Definition: vgl_homg.cxx:6
General purpose support class for vgl_homg_ classes.
Definition: vgl_fwd.h:6
float infinity
Definition: vgl_homg.cxx:5