Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CGAL/include/CGAL/basic.h
Go to the documentation of this file.
1 // ======================================================================
2 //
3 // Copyright (c) 1999 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 // source : basic.fw
37 // file : include/CGAL/basic.h
38 // package : Kernel_basic (3.14)
39 // revision : 3.14
40 // revision_date : 15 Sep 2000
41 // author(s) : Lutz Kettner
42 // Stefan Schirra
43 //
44 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
45 // email : contact@cgal.org
46 // www : http://www.cgal.org
47 //
48 // ======================================================================
49 
50 
51 #ifndef CGAL_BASIC_H
52 #define CGAL_BASIC_H
53 
54 #ifndef CGAL_CONFIG_H
55 # include <CGAL/config.h>
56 #endif // CGAL_CONFIG_H
57 
58 #define CGAL_NTS CGAL::NTS::
59 
60 #if ((__GNUC__ == 2) && (__GNUC_MINOR__ == 95))
61 #include <cmath>
62 #endif // gcc 2.95
63 
64 #include <iostream>
65 #include <cstdlib>
66 
67 
68 // Big endian or little endian machine.
69 // ====================================
70 #ifdef CGAL_CFG_NO_BIG_ENDIAN
71 #define CGAL_LITTLE_ENDIAN 1
72 #else
73 #define CGAL_BIG_ENDIAN 1
74 #endif
75 
76 
77 #ifdef CGAL_USE_LEDA
78 # ifndef CGAL_PROTECT_LEDA_BASIC_H
79 # if ( __LEDA__ < 380 )
80 # define Max leda_Max
81 # define Min leda_Min
82 # endif // __LEDA__ < 380
83 # include <LEDA/basic.h>
84 # if ( __LEDA__ < 380 )
85 # undef Max
86 # undef Min
87 # endif // __LEDA__ < 380
88 # define CGAL_PROTECT_LEDA_BASIC_H
89 # endif // CGAL_PROTECT_LEDA_BASIC_H
90 #endif // CGAL_USE_LEDA
91 
92 // CGAL uses std::min and std::max
93 // (see ISO C++ 25.3.7, page 562),
94 // if feasible
95 #include <algorithm>
96 
97 namespace CGAL {
98 
99 #if !defined(CGAL_CFG_USING_USING_BUG) && !defined(CGAL_CFG_BROKEN_USING)
100 
101  using std::min;
102  using std::max;
103 
104 #else
105 
106  template <class NT>
107  inline
108  NT
109  // const NT&
110  min(const NT& x, const NT& y)
111  { return (y < x) ? y : x; }
112 
113  template <class NT>
114  inline
115  NT
116  // const NT&
117  max(const NT& x, const NT& y)
118  { return (x < y) ? y : x; }
119 
120 #endif // CGAL_CFG_BROKEN_USING
121 } // namespace CGAL
122 
123 
124 #ifndef CGAL_ASSERTIONS_H
125 #include <CGAL/assertions.h>
126 #endif // CGAL_ASSERTIONS_H
127 #ifndef CGAL_KERNEL_ASSERTIONS_H
128 #include <CGAL/kernel_assertions.h>
129 #endif // CGAL_KERNEL_ASSERTIONS_H
130 #ifndef CGAL_HANDLE_H
131 #include <CGAL/Handle.h>
132 #endif // CGAL_HANDLE_H
133 #ifndef CGAL_OBJECT_H
134 #include <CGAL/Object.h>
135 #endif // CGAL_OBJECT_H
136 #ifndef CGAL_ENUM_H
137 #include <CGAL/enum.h>
138 #endif // CGAL_ENUM_H
139 #ifndef CGAL_TAGS_H
140 #include <CGAL/tags.h>
141 #endif // CGAL_TAGS_H
142 #ifndef CGAL_MISC_H
143 #include <CGAL/misc.h>
144 #endif // CGAL_MISC_H
145 #ifndef CGAL_NUMBER_TYPE_BASIC_H
146 #include <CGAL/number_type_basic.h>
147 #endif // CGAL_NUMBER_TYPE_BASIC_H
148 #ifndef CGAL_IO_IO_H
149 #include <CGAL/IO/io.h>
150 #endif // CGAL_IO_IO_H
151 #ifndef CGAL_KERNEL_BASIC_H
152 #include <CGAL/kernel_basic.h>
153 #endif // CGAL_KERNEL_BASIC_H
154 
155 #ifndef CGAL_KNOWN_BIT_SIZE_INTEGERS_H
157 #endif // CGAL_KNOWN_BIT_SIZE_INTEGERS_H
158 
160 
161 
162 // Two struct's to denote boolean compile time decisions.
163 // ======================================================
164 struct Tag_true {};
165 struct Tag_false {};
166 
167 inline bool check_tag( Tag_true) {return true;}
168 inline bool check_tag( Tag_false) {return false;}
169 
170 // A function that asserts a specific compile time tag
171 // forcing its two arguments to have equal type.
172 // It is encapsulated with #ifdef since it will be defined also elsewhere.
173 // ======================================================
174 #ifndef CGAL_ASSERT_COMPILE_TIME_TAG
175 #define CGAL_ASSERT_COMPILE_TIME_TAG 1
176 template <class Base>
178 {
179  void match_compile_time_tag( const Base&) const {}
180 };
181 
182 template <class Tag, class Derived>
183 inline
184 void
185 Assert_compile_time_tag( const Tag&, const Derived& b)
186 {
189 }
190 #endif // CGAL_ASSERT_COMPILE_TIME_TAG
191 
192 template < class T>
193 inline
194 void
195 assert_equal_types( const T&, const T&) {}
196 
197 
198 
199 // Symbolic constants to tailor inlining. Inlining Policy.
200 // =======================================================
201 #ifndef CGAL_MEDIUM_INLINE
202 #define CGAL_MEDIUM_INLINE inline
203 #endif
204 #ifndef CGAL_LARGE_INLINE
205 #define CGAL_LARGE_INLINE
206 #endif
207 #ifndef CGAL_HUGE_INLINE
208 #define CGAL_HUGE_INLINE
209 #endif
210 
212 
213 
214 
215 #endif // CGAL_BASIC_H
void int int REAL REAL * y
Definition: read.cpp:74
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
void assert_equal_types(const T &, const T &)
void match_compile_time_tag(const Base &) const
bool check_tag(Tag_true)
void int int REAL * x
Definition: read.cpp:74
Vector_n min(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:346
void Assert_compile_time_tag(const Tag &, const Derived &b)
#define CGAL_BEGIN_NAMESPACE
Definition: kdtree_d.h:86
#define CGAL_END_NAMESPACE
Definition: kdtree_d.h:87