Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
number_utils_classes.h
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Copyright (c) 1997 The CGAL Consortium
4 
5 // This software and related documentation is part of the Computational
6 // Geometry Algorithms Library (CGAL).
7 // This software and documentation is provided "as-is" and without warranty
8 // of any kind. In no event shall the CGAL Consortium be liable for any
9 // damage of any kind.
10 //
11 // Every use of CGAL requires a license.
12 //
13 // Academic research and teaching license
14 // - For academic research and teaching purposes, permission to use and copy
15 // the software and its documentation is hereby granted free of charge,
16 // provided that it is not a component of a commercial product, and this
17 // notice appears in all copies of the software and related documentation.
18 //
19 // Commercial licenses
20 // - A commercial license is available through Algorithmic Solutions, who also
21 // markets LEDA (http://www.algorithmic-solutions.de).
22 // - Commercial users may apply for an evaluation license by writing to
23 // Algorithmic Solutions (contact@algorithmic-solutions.com).
24 //
25 // The CGAL Consortium consists of Utrecht University (The Netherlands),
26 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
27 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
28 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
29 // and Tel-Aviv University (Israel).
30 //
31 // ----------------------------------------------------------------------
32 //
33 // release : CGAL-2.2
34 // release_date : 2000, September 30
35 //
36 // file : include/CGAL/number_utils_classes.h
37 // package : Number_types (3.4)
38 // source :
39 // revision : 2.0.5
40 // revision_date : 14 Mar 99
41 // author(s) : Michael Hoffmann
42 //
43 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
44 //
45 // slight modification of Michael's 1.1 version
46 // email : contact@cgal.org
47 // www : http://www.cgal.org
48 //
49 // ======================================================================
50 
51 // to be included by number_utils.h
52 
53 #ifndef CGAL_NUMBER_UTILS_CLASSES_H
54 #define CGAL_NUMBER_UTILS_CLASSES_H 1
55 
56 #ifndef CGAL_CONFIG_H
57 #include <CGAL/config.h>
58 #endif // CGAL_CONFIG_H
59 
60 #include <algorithm>
61 #include <functional>
62 
64 
65 template < class NT >
66 struct Is_zero :public CGAL_STD::unary_function< NT, bool > {
67  bool operator()( const NT& x) const
68  { return is_zero( x); }
69 };
70 
71 template < class NT >
72 struct Is_one :public CGAL_STD::unary_function< NT, bool > {
73  bool operator()( const NT& x) const
74  { return is_one( x); }
75 };
76 
77 template < class NT >
78 struct Is_negative :public CGAL_STD::unary_function< NT, bool > {
79  bool operator()( const NT& x) const
80  { return is_negative( x); }
81 };
82 
83 template < class NT >
84 struct Is_positive :public CGAL_STD::unary_function< NT, bool > {
85  bool operator()( const NT& x) const
86  { return is_positive( x); }
87 };
88 
89 // Sign would result in a name clash with enum.h
90 template < class NT >
91 struct Sgn :public CGAL_STD::unary_function< NT, int > {
92  Sign operator()( const NT& x) const
93  { return sign( x); }
94 };
95 
96 template < class NT >
98  :public CGAL_STD::binary_function< NT, NT, int > {
99 
100  Sign operator()( const NT& x, const NT& y) const
101  { return lexicographical_sign( x, y); }
102 };
103 
104 template < class NT >
105 struct Abs :public CGAL_STD::unary_function< NT, NT > {
106  NT operator()( const NT& x) const
107  { return abs( x); }
108 };
109 
110 template < class NT >
111 struct Min :public CGAL_STD::binary_function< NT, NT, NT > {
112  NT operator()( const NT& x, const NT& y) const
113  { return std::min( x, y); }
114 };
115 
116 template < class NT >
117 struct Max :public CGAL_STD::binary_function< NT, NT, NT > {
118  NT operator()( const NT& x, const NT& y) const
119  { return std::max( x, y); }
120 };
121 
122 template < class NT >
123 struct Compare
124  :public CGAL_STD::binary_function< NT, NT, Comparison_result > {
125 
127  operator()( const NT& x, const NT& y) const
128  { return compare( x, y); }
129 };
130 
131 template < class NT >
132 struct Square :public CGAL_STD::unary_function< NT, NT > {
133 
134  NT
135  operator()( const NT& x) const
136  { return square( x ); }
137 };
138 
140 
141 #endif // CGAL_NUMBER_UTILS_CLASSES_H
NT operator()(const NT &x) const
double square(double x)
bool is_one(const NT &x)
Definition: number_utils.h:75
bool operator()(const NT &x) const
static SURF_BEGIN_NAMESPACE double sign(double x)
NT operator()(const NT &x) const
void int int REAL REAL * y
Definition: read.cpp:74
bool is_zero(const NT &x)
Definition: number_utils.h:64
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
Sign operator()(const NT &x, const NT &y) const
bool operator()(const NT &x) const
bool is_negative(const NT &x)
Definition: number_utils.h:86
NT operator()(const NT &x, const NT &y) const
Sign
Definition: enum.h:57
Comparison_result operator()(const NT &x, const NT &y) const
bool operator()(const NT &x) const
void int int REAL * x
Definition: read.cpp:74
bool operator()(const NT &x) const
bool is_positive(const NT &x)
Definition: number_utils.h:97
Sign operator()(const NT &x) const
Comparison_result
Definition: enum.h:94
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
NT abs(const NT &x)
Definition: number_utils.h:130
CGAL_KERNEL_INLINE Sign lexicographical_sign(const NT &x, const NT &y)
Definition: number_utils.h:119
NT operator()(const NT &x, const NT &y) const
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
CGAL_KERNEL_INLINE Comparison_result compare(const NT &n1, const NT &n2)
Definition: number_utils.h:143
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87