Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
include/CGAL/basic.h
Go to the documentation of this file.
1 /* *******************************************************************
2  * Rocstar Simulation Suite *
3  * Copyright@2015, Illinois Rocstar LLC. All rights reserved. *
4  * *
5  * Illinois Rocstar LLC *
6  * Champaign, IL *
7  * www.illinoisrocstar.com *
8  * sales@illinoisrocstar.com *
9  * *
10  * License: See LICENSE file in top level of distribution package or *
11  * http://opensource.org/licenses/NCSA *
12  *********************************************************************/
13 /* *******************************************************************
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
16  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
17  * NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
19  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
21  * USE OR OTHER DEALINGS WITH THE SOFTWARE. *
22  *********************************************************************/
23 // ======================================================================
24 //
25 // Copyright (c) 1999 The CGAL Consortium
26 
27 // This software and related documentation is part of the Computational
28 // Geometry Algorithms Library (CGAL).
29 // This software and documentation is provided "as-is" and without warranty
30 // of any kind. In no event shall the CGAL Consortium be liable for any
31 // damage of any kind.
32 //
33 // Every use of CGAL requires a license.
34 //
35 // Academic research and teaching license
36 // - For academic research and teaching purposes, permission to use and copy
37 // the software and its documentation is hereby granted free of charge,
38 // provided that it is not a component of a commercial product, and this
39 // notice appears in all copies of the software and related documentation.
40 //
41 // Commercial licenses
42 // - A commercial license is available through Algorithmic Solutions, who also
43 // markets LEDA (http://www.algorithmic-solutions.de).
44 // - Commercial users may apply for an evaluation license by writing to
45 // Algorithmic Solutions (contact@algorithmic-solutions.com).
46 //
47 // The CGAL Consortium consists of Utrecht University (The Netherlands),
48 // ETH Zurich (Switzerland), Free University of Berlin (Germany),
49 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg
50 // (Germany), Max-Planck-Institute Saarbrucken (Germany), RISC Linz (Austria),
51 // and Tel-Aviv University (Israel).
52 //
53 // ----------------------------------------------------------------------
54 //
55 // release : CGAL-2.2
56 // release_date : 2000, September 30
57 //
58 // source : basic.fw
59 // file : include/CGAL/basic.h
60 // package : Kernel_basic (3.14)
61 // revision : 3.14
62 // revision_date : 15 Sep 2000
63 // author(s) : Lutz Kettner
64 // Stefan Schirra
65 //
66 // coordinator : MPI, Saarbruecken (<Stefan.Schirra>)
67 // email : contact@cgal.org
68 // www : http://www.cgal.org
69 //
70 // ======================================================================
71 
72 
73 #ifndef CGAL_BASIC_H
74 #define CGAL_BASIC_H
75 
76 #ifndef CGAL_CONFIG_H
77 # include <CGAL/config.h>
78 #endif // CGAL_CONFIG_H
79 
80 #define CGAL_NTS CGAL::NTS::
81 
82 #if ((__GNUC__ == 2) && (__GNUC_MINOR__ == 95))
83 #include <cmath>
84 #endif // gcc 2.95
85 
86 #include <iostream>
87 #include <cstdlib>
88 
89 
90 // Big endian or little endian machine.
91 // ====================================
92 #ifdef CGAL_CFG_NO_BIG_ENDIAN
93 #define CGAL_LITTLE_ENDIAN 1
94 #else
95 #define CGAL_BIG_ENDIAN 1
96 #endif
97 
98 
99 #ifdef CGAL_USE_LEDA
100 # ifndef CGAL_PROTECT_LEDA_BASIC_H
101 # if ( __LEDA__ < 380 )
102 # define Max leda_Max
103 # define Min leda_Min
104 # endif // __LEDA__ < 380
105 # include <LEDA/basic.h>
106 # if ( __LEDA__ < 380 )
107 # undef Max
108 # undef Min
109 # endif // __LEDA__ < 380
110 # define CGAL_PROTECT_LEDA_BASIC_H
111 # endif // CGAL_PROTECT_LEDA_BASIC_H
112 #endif // CGAL_USE_LEDA
113 
114 // CGAL uses std::min and std::max
115 // (see ISO C++ 25.3.7, page 562),
116 // if feasible
117 #include <algorithm>
118 
119 namespace CGAL {
120 
121 #if !defined(CGAL_CFG_USING_USING_BUG) && !defined(CGAL_CFG_BROKEN_USING)
122 
123  using std::min;
124  using std::max;
125 
126 #else
127 
128  template <class NT>
129  inline
130  NT
131  // const NT&
132  min(const NT& x, const NT& y)
133  { return (y < x) ? y : x; }
134 
135  template <class NT>
136  inline
137  NT
138  // const NT&
139  max(const NT& x, const NT& y)
140  { return (x < y) ? y : x; }
141 
142 #endif // CGAL_CFG_BROKEN_USING
143 } // namespace CGAL
144 
145 
146 #ifndef CGAL_ASSERTIONS_H
147 #include <CGAL/assertions.h>
148 #endif // CGAL_ASSERTIONS_H
149 #ifndef CGAL_KERNEL_ASSERTIONS_H
150 #include <CGAL/kernel_assertions.h>
151 #endif // CGAL_KERNEL_ASSERTIONS_H
152 #ifndef CGAL_HANDLE_H
153 #include <CGAL/Handle.h>
154 #endif // CGAL_HANDLE_H
155 #ifndef CGAL_OBJECT_H
156 #include <CGAL/Object.h>
157 #endif // CGAL_OBJECT_H
158 #ifndef CGAL_ENUM_H
159 #include <CGAL/enum.h>
160 #endif // CGAL_ENUM_H
161 #ifndef CGAL_TAGS_H
162 #include <CGAL/tags.h>
163 #endif // CGAL_TAGS_H
164 #ifndef CGAL_MISC_H
165 #include <CGAL/misc.h>
166 #endif // CGAL_MISC_H
167 #ifndef CGAL_NUMBER_TYPE_BASIC_H
168 #include <CGAL/number_type_basic.h>
169 #endif // CGAL_NUMBER_TYPE_BASIC_H
170 #include <CGAL/number_utils.h>
171 #ifndef CGAL_IO_IO_H
172 #include <CGAL/IO/io.h>
173 #endif // CGAL_IO_IO_H
174 #ifndef CGAL_KERNEL_BASIC_H
175 #include <CGAL/kernel_basic.h>
176 #endif // CGAL_KERNEL_BASIC_H
177 
178 // #ifndef CGAL_KNOWN_BIT_SIZE_INTEGERS_H
179 // #include <CGAL/known_bit_size_integers.h>
180 // #endif // CGAL_KNOWN_BIT_SIZE_INTEGERS_H
181 
183 
184 
185 // Two struct's to denote boolean compile time decisions.
186 // ======================================================
187 struct Tag_true {};
188 struct Tag_false {};
189 
190 inline bool check_tag( Tag_true) {return true;}
191 inline bool check_tag( Tag_false) {return false;}
192 
193 // A function that asserts a specific compile time tag
194 // forcing its two arguments to have equal type.
195 // It is encapsulated with #ifdef since it will be defined also elsewhere.
196 // ======================================================
197 #ifndef CGAL_ASSERT_COMPILE_TIME_TAG
198 #define CGAL_ASSERT_COMPILE_TIME_TAG 1
199 template <class Base>
200 struct Assert_tag_class
201 {
202  void match_compile_time_tag( const Base&) const {}
203 };
204 
205 template <class Tag, class Derived>
206 inline
207 void
208 Assert_compile_time_tag( const Tag&, const Derived& b)
209 {
212 }
213 #endif // CGAL_ASSERT_COMPILE_TIME_TAG
214 
215 template < class T>
216 inline
217 void
218 assert_equal_types( const T&, const T&) {}
219 
220 
221 
222 // Symbolic constants to tailor inlining. Inlining Policy.
223 // =======================================================
224 #ifndef CGAL_MEDIUM_INLINE
225 #define CGAL_MEDIUM_INLINE inline
226 #endif
227 #ifndef CGAL_LARGE_INLINE
228 #define CGAL_LARGE_INLINE
229 #endif
230 #ifndef CGAL_HUGE_INLINE
231 #define CGAL_HUGE_INLINE
232 #endif
233 
235 
236 
237 
238 #endif // CGAL_BASIC_H
239 
240 
241 
242 
243 
244 
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