BWAPI
|
00001 // Copyright (c) 1997-2001 Utrecht University (The Netherlands), 00002 // ETH Zurich (Switzerland), Freie Universitaet Berlin (Germany), 00003 // INRIA Sophia-Antipolis (France), Martin-Luther-University Halle-Wittenberg 00004 // (Germany), Max-Planck-Institute Saarbruecken (Germany), RISC Linz (Austria), 00005 // and Tel-Aviv University (Israel). All rights reserved. 00006 // 00007 // This file is part of CGAL (www.cgal.org); you can redistribute it and/or 00008 // modify it under the terms of the GNU Lesser General Public License as 00009 // published by the Free Software Foundation; version 2.1 of the License. 00010 // See the file LICENSE.LGPL distributed with CGAL. 00011 // 00012 // Licensees holding a valid commercial license may use this file in 00013 // accordance with the commercial license agreement provided with the software. 00014 // 00015 // This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00016 // WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00017 // 00018 // $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/CGAL-3.5-branch/Optimisation_basic/include/CGAL/Optimisation/assertions.h $ 00019 // $Id: assertions.h 44139 2008-07-14 11:16:41Z spion $ 00020 // 00021 // 00022 // Author(s) : Geert-Jan Giezeman, Sven Schoenherr <sven@inf.ethz.ch> 00023 00024 #ifndef CGAL_OPTIMISATION_ASSERTIONS_H 00025 #define CGAL_OPTIMISATION_ASSERTIONS_H 00026 00027 // macro definitions 00028 // ================= 00029 00030 // assertions 00031 // ---------- 00032 #if ( defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ 00033 || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) 00034 # define CGAL_optimisation_assertion(EX) ((void)0) 00035 # define CGAL_optimisation_assertion_msg(EX,MSG) ((void)0) 00036 # define CGAL_optimisation_assertion_code(CODE) 00037 # undef CGAL_OPTIMISATION_ASSERTION_TAG 00038 #else 00039 # define CGAL_optimisation_assertion(EX) \ 00040 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) 00041 # define CGAL_optimisation_assertion_msg(EX,MSG) \ 00042 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) 00043 # define CGAL_optimisation_assertion_code(CODE) CODE 00044 # define CGAL_OPTIMISATION_ASSERTION_TAG 1 00045 #endif // optimisation assertions 00046 00047 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ 00048 || defined( CGAL_CHECK_EXACTNESS) ) \ 00049 || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ 00050 || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) 00051 # define CGAL_optimisation_exactness_assertion(EX) ((void)0) 00052 # define CGAL_optimisation_exactness_assertion_msg(EX,MSG) ((void)0) 00053 # define CGAL_optimisation_exactness_assertion_code(CODE) 00054 # undef CGAL_OPTIMISATION_EXACTNESS_ASSERTION_TAG 00055 #else 00056 # define CGAL_optimisation_exactness_assertion(EX) \ 00057 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) 00058 # define CGAL_optimisation_exactness_assertion_msg(EX,MSG) \ 00059 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) 00060 # define CGAL_optimisation_exactness_assertion_code(CODE) CODE 00061 # define CGAL_OPTIMISATION_EXACTNESS_ASSERTION_TAG 1 00062 #endif // optimisation exactness assertions 00063 00064 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ 00065 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00066 || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ 00067 || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) 00068 # define CGAL_optimisation_expensive_assertion(EX) ((void)0) 00069 # define CGAL_optimisation_expensive_assertion_msg(EX,MSG) ((void)0) 00070 # define CGAL_optimisation_expensive_assertion_code(CODE) 00071 # undef CGAL_OPTIMISATION_EXPENSIVE_ASSERTION_TAG 00072 #else 00073 # define CGAL_optimisation_expensive_assertion(EX) \ 00074 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) 00075 # define CGAL_optimisation_expensive_assertion_msg(EX,MSG) \ 00076 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) 00077 # define CGAL_optimisation_expensive_assertion_code(CODE) CODE 00078 # define CGAL_OPTIMISATION_EXPENSIVE_ASSERTION_TAG 1 00079 #endif // optimisation expensive assertions 00080 00081 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ 00082 || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ 00083 || defined( CGAL_CHECK_EXACTNESS) \ 00084 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00085 || defined( CGAL_OPTIMISATION_NO_ASSERTIONS) \ 00086 || defined( CGAL_NO_ASSERTIONS) || defined( NDEBUG)) 00087 # define CGAL_optimisation_expensive_exactness_assertion(EX) \ 00088 ((void)0) 00089 # define CGAL_optimisation_expensive_exactness_assertion_msg(EX,MSG) \ 00090 ((void)0) 00091 # define CGAL_optimisation_expensive_exactness_assertion_code(CODE) 00092 # undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_ASSERTION_TAG 00093 #else 00094 # define CGAL_optimisation_expensive_exactness_assertion(EX) \ 00095 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__)) 00096 # define CGAL_optimisation_expensive_exactness_assertion_msg(EX,MSG) \ 00097 (CGAL::possibly(EX)?((void)0): ::CGAL::assertion_fail( # EX ,__FILE__,__LINE__,MSG)) 00098 # define CGAL_optimisation_expensive_exactness_assertion_code(CODE) CODE 00099 # define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_ASSERTION_TAG 1 00100 #endif // optimisation expensive exactness assertions 00101 00102 00103 00104 // preconditions 00105 // ------------- 00106 #if ( defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ 00107 || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) 00108 # define CGAL_optimisation_precondition(EX) ((void)0) 00109 # define CGAL_optimisation_precondition_msg(EX,MSG) ((void)0) 00110 # define CGAL_optimisation_precondition_code(CODE) 00111 # undef CGAL_OPTIMISATION_PRECONDITION_TAG 00112 #else 00113 # define CGAL_optimisation_precondition(EX) \ 00114 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) 00115 # define CGAL_optimisation_precondition_msg(EX,MSG) \ 00116 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00117 # define CGAL_optimisation_precondition_code(CODE) CODE 00118 # define CGAL_OPTIMISATION_PRECONDITION_TAG 1 00119 #endif // optimisation preconditions 00120 00121 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ 00122 || defined( CGAL_CHECK_EXACTNESS) ) \ 00123 || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ 00124 || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) 00125 # define CGAL_optimisation_exactness_precondition(EX) ((void)0) 00126 # define CGAL_optimisation_exactness_precondition_msg(EX,MSG) ((void)0) 00127 # define CGAL_optimisation_exactness_precondition_code(CODE) 00128 # undef CGAL_OPTIMISATION_EXACTNESS_PRECONDITION_TAG 00129 #else 00130 # define CGAL_optimisation_exactness_precondition(EX) \ 00131 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) 00132 # define CGAL_optimisation_exactness_precondition_msg(EX,MSG) \ 00133 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00134 # define CGAL_optimisation_exactness_precondition_code(CODE) CODE 00135 # define CGAL_OPTIMISATION_EXACTNESS_PRECONDITION_TAG 1 00136 #endif // optimisation exactness preconditions 00137 00138 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ 00139 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00140 || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ 00141 || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) 00142 # define CGAL_optimisation_expensive_precondition(EX) ((void)0) 00143 # define CGAL_optimisation_expensive_precondition_msg(EX,MSG) ((void)0) 00144 # define CGAL_optimisation_expensive_precondition_code(CODE) 00145 # undef CGAL_OPTIMISATION_EXPENSIVE_PRECONDITION_TAG 00146 #else 00147 # define CGAL_optimisation_expensive_precondition(EX) \ 00148 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) 00149 # define CGAL_optimisation_expensive_precondition_msg(EX,MSG) \ 00150 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00151 # define CGAL_optimisation_expensive_precondition_code(CODE) CODE 00152 # define CGAL_OPTIMISATION_EXPENSIVE_PRECONDITION_TAG 1 00153 #endif // optimisation expensive preconditions 00154 00155 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ 00156 || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ 00157 || defined( CGAL_CHECK_EXACTNESS) \ 00158 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00159 || defined( CGAL_OPTIMISATION_NO_PRECONDITIONS) \ 00160 || defined( CGAL_NO_PRECONDITIONS) || defined( NDEBUG)) 00161 # define CGAL_optimisation_expensive_exactness_precondition(EX) \ 00162 ((void)0) 00163 # define CGAL_optimisation_expensive_exactness_precondition_msg(EX,MSG) \ 00164 ((void)0) 00165 # define CGAL_optimisation_expensive_exactness_precondition_code(CODE) 00166 # undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_PRECONDITION_TAG 00167 #else 00168 # define CGAL_optimisation_expensive_exactness_precondition(EX) \ 00169 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__)) 00170 # define CGAL_optimisation_expensive_exactness_precondition_msg(EX,MSG) \ 00171 (CGAL::possibly(EX)?((void)0): ::CGAL::precondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00172 # define CGAL_optimisation_expensive_exactness_precondition_code(CODE) CODE 00173 # define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_PRECONDITION_TAG 1 00174 #endif // optimisation expensive exactness preconditions 00175 00176 00177 00178 // postconditions 00179 // -------------- 00180 #if ( defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ 00181 || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) 00182 # define CGAL_optimisation_postcondition(EX) ((void)0) 00183 # define CGAL_optimisation_postcondition_msg(EX,MSG) ((void)0) 00184 # define CGAL_optimisation_postcondition_code(CODE) 00185 # undef CGAL_OPTIMISATION_POSTCONDITION_TAG 00186 #else 00187 # define CGAL_optimisation_postcondition(EX) \ 00188 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) 00189 # define CGAL_optimisation_postcondition_msg(EX,MSG) \ 00190 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00191 # define CGAL_optimisation_postcondition_code(CODE) CODE 00192 # define CGAL_OPTIMISATION_POSTCONDITION_TAG 1 00193 #endif // optimisation postconditions 00194 00195 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ 00196 || defined( CGAL_CHECK_EXACTNESS) ) \ 00197 || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ 00198 || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) 00199 # define CGAL_optimisation_exactness_postcondition(EX) ((void)0) 00200 # define CGAL_optimisation_exactness_postcondition_msg(EX,MSG) ((void)0) 00201 # define CGAL_optimisation_exactness_postcondition_code(CODE) 00202 # undef CGAL_OPTIMISATION_EXACTNESS_POSTCONDITION_TAG 00203 #else 00204 # define CGAL_optimisation_exactness_postcondition(EX) \ 00205 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) 00206 # define CGAL_optimisation_exactness_postcondition_msg(EX,MSG) \ 00207 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00208 # define CGAL_optimisation_exactness_postcondition_code(CODE) CODE 00209 # define CGAL_OPTIMISATION_EXACTNESS_POSTCONDITION_TAG 1 00210 #endif // optimisation exactness postconditions 00211 00212 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ 00213 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00214 || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ 00215 || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) 00216 # define CGAL_optimisation_expensive_postcondition(EX) ((void)0) 00217 # define CGAL_optimisation_expensive_postcondition_msg(EX,MSG) ((void)0) 00218 # define CGAL_optimisation_expensive_postcondition_code(CODE) 00219 # undef CGAL_OPTIMISATION_EXPENSIVE_POSTCONDITION_TAG 00220 #else 00221 # define CGAL_optimisation_expensive_postcondition(EX) \ 00222 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) 00223 # define CGAL_optimisation_expensive_postcondition_msg(EX,MSG) \ 00224 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00225 # define CGAL_optimisation_expensive_postcondition_code(CODE) CODE 00226 # define CGAL_OPTIMISATION_EXPENSIVE_POSTCONDITION_TAG 1 00227 #endif // optimisation expensive postconditions 00228 00229 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ 00230 || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ 00231 || defined( CGAL_CHECK_EXACTNESS) \ 00232 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00233 || defined( CGAL_OPTIMISATION_NO_POSTCONDITIONS) \ 00234 || defined( CGAL_NO_POSTCONDITIONS) || defined( NDEBUG)) 00235 # define CGAL_optimisation_expensive_exactness_postcondition(EX) \ 00236 ((void)0) 00237 # define CGAL_optimisation_expensive_exactness_postcondition_msg(EX,MSG) \ 00238 ((void)0) 00239 # define CGAL_optimisation_expensive_exactness_postcondition_code(CODE) 00240 # undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_POSTCONDITION_TAG 00241 #else 00242 # define CGAL_optimisation_expensive_exactness_postcondition(EX) \ 00243 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__)) 00244 # define CGAL_optimisation_expensive_exactness_postcondition_msg(EX,MSG) \ 00245 (CGAL::possibly(EX)?((void)0): ::CGAL::postcondition_fail( # EX ,__FILE__,__LINE__,MSG)) 00246 # define CGAL_optimisation_expensive_exactness_postcondition_code(CODE) CODE 00247 # define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_POSTCONDITION_TAG 1 00248 #endif // optimisation expensive exactness postconditions 00249 00250 00251 00252 // warnings 00253 // -------- 00254 #if ( defined( CGAL_OPTIMISATION_NO_WARNINGS) \ 00255 || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) 00256 # define CGAL_optimisation_warning(EX) ((void)0) 00257 # define CGAL_optimisation_warning_msg(EX,MSG) ((void)0) 00258 # define CGAL_optimisation_warning_code(CODE) 00259 # undef CGAL_OPTIMISATION_WARNING_TAG 00260 #else 00261 # define CGAL_optimisation_warning(EX) \ 00262 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) 00263 # define CGAL_optimisation_warning_msg(EX,MSG) \ 00264 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) 00265 # define CGAL_optimisation_warning_code(CODE) CODE 00266 # define CGAL_OPTIMISATION_WARNING_TAG 1 00267 #endif // optimisation warnings 00268 00269 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ 00270 || defined( CGAL_CHECK_EXACTNESS) ) \ 00271 || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ 00272 || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) 00273 # define CGAL_optimisation_exactness_warning(EX) ((void)0) 00274 # define CGAL_optimisation_exactness_warning_msg(EX,MSG) ((void)0) 00275 # define CGAL_optimisation_exactness_warning_code(CODE) 00276 # undef CGAL_OPTIMISATION_EXACTNESS_WARNING_TAG 00277 #else 00278 # define CGAL_optimisation_exactness_warning(EX) \ 00279 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) 00280 # define CGAL_optimisation_exactness_warning_msg(EX,MSG) \ 00281 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) 00282 # define CGAL_optimisation_exactness_warning_code(CODE) CODE 00283 # define CGAL_OPTIMISATION_EXACTNESS_WARNING_TAG 1 00284 #endif // optimisation exactness warnings 00285 00286 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ 00287 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00288 || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ 00289 || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) 00290 # define CGAL_optimisation_expensive_warning(EX) ((void)0) 00291 # define CGAL_optimisation_expensive_warning_msg(EX,MSG) ((void)0) 00292 # define CGAL_optimisation_expensive_warning_code(CODE) 00293 # undef CGAL_OPTIMISATION_EXPENSIVE_WARNING_TAG 00294 #else 00295 # define CGAL_optimisation_expensive_warning(EX) \ 00296 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) 00297 # define CGAL_optimisation_expensive_warning_msg(EX,MSG) \ 00298 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) 00299 # define CGAL_optimisation_expensive_warning_code(CODE) CODE 00300 # define CGAL_OPTIMISATION_EXPENSIVE_WARNING_TAG 1 00301 #endif // optimisation expensive warnings 00302 00303 #if ( ! ( defined( CGAL_OPTIMISATION_CHECK_EXACTNESS) \ 00304 || defined( CGAL_OPTIMISATION_CHECK_EXPENSIVE) \ 00305 || defined( CGAL_CHECK_EXACTNESS) \ 00306 || defined( CGAL_CHECK_EXPENSIVE) ) \ 00307 || defined( CGAL_OPTIMISATION_NO_WARNINGS) \ 00308 || defined( CGAL_NO_WARNINGS) || defined( NDEBUG)) 00309 # define CGAL_optimisation_expensive_exactness_warning(EX) \ 00310 ((void)0) 00311 # define CGAL_optimisation_expensive_exactness_warning_msg(EX,MSG) \ 00312 ((void)0) 00313 # define CGAL_optimisation_expensive_exactness_warning_code(CODE) 00314 # undef CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_WARNING_TAG 00315 #else 00316 # define CGAL_optimisation_expensive_exactness_warning(EX) \ 00317 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__)) 00318 # define CGAL_optimisation_expensive_exactness_warning_msg(EX,MSG) \ 00319 (CGAL::possibly(EX)?((void)0): ::CGAL::warning_fail( # EX ,__FILE__,__LINE__,MSG)) 00320 # define CGAL_optimisation_expensive_exactness_warning_code(CODE) CODE 00321 # define CGAL_OPTIMISATION_EXPENSIVE_EXACTNESS_WARNING_TAG 1 00322 #endif // optimisation expensive exactness warnings 00323 00324 00325 00326 #endif // CGAL_OPTIMISATION_ASSERTIONS_H 00327 00328 // ===== EOF ==================================================================