00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PPL_checked_defs_hh
00024 #define PPL_checked_defs_hh 1
00025
00026 #include <iostream>
00027 #include <gmpxx.h>
00028 #include "mp_std_bits.defs.hh"
00029 #include "Temp.defs.hh"
00030 #include "Rounding_Dir.defs.hh"
00031 #include "Numeric_Format.defs.hh"
00032 #include "Float.defs.hh"
00033
00034 namespace Parma_Polyhedra_Library {
00035
00036 namespace Checked {
00037
00038
00039
00040
00041
00042
00043
00044 #define FUNCTION_CLASS(name) name ## _function_struct
00045
00046 #define DECLARE_FUN1_0_0(name, ret_type, qual, type) \
00047 template <typename Policy, typename type> \
00048 struct FUNCTION_CLASS(name); \
00049 template <typename Policy, typename type> \
00050 inline ret_type name(qual type& arg) { \
00051 return FUNCTION_CLASS(name)<Policy, type>::function(arg); \
00052 }
00053
00054 #define DECLARE_FUN1_0_1(name, ret_type, qual, type, after1) \
00055 template <typename Policy, typename type> \
00056 struct FUNCTION_CLASS(name); \
00057 template <typename Policy, typename type> \
00058 inline ret_type name(qual type& arg, after1 a1) { \
00059 return FUNCTION_CLASS(name)<Policy, type>::function(arg, a1); \
00060 }
00061
00062 #define DECLARE_FUN1_0_2(name, ret_type, qual, type, after1, after2) \
00063 template <typename Policy, typename type> \
00064 struct FUNCTION_CLASS(name); \
00065 template <typename Policy, typename type> \
00066 inline ret_type name(qual type& arg, after1 a1, after2 a2) { \
00067 return FUNCTION_CLASS(name)<Policy, type>::function(arg, a1, a2); \
00068 }
00069
00070 #define DECLARE_FUN1_0_3(name, ret_type, qual, type, after1, after2, after3) \
00071 template <typename Policy, typename type> \
00072 struct FUNCTION_CLASS(name); \
00073 template <typename Policy, typename type> \
00074 inline ret_type name(qual type& arg, after1 a1, after2 a2, after3 a3) { \
00075 return FUNCTION_CLASS(name)<Policy, type>::function(arg, a1, a2, a3); \
00076 }
00077
00078 #define DECLARE_FUN1_1_1(name, ret_type, before1, qual, type, after1) \
00079 template <typename Policy, typename type> \
00080 struct FUNCTION_CLASS(name); \
00081 template <typename Policy, typename type> \
00082 inline ret_type name(before1 b1, qual type& arg, after1 a1) { \
00083 return FUNCTION_CLASS(name)<Policy, type>::function(b1, arg, a1); \
00084 }
00085
00086 #define DECLARE_FUN1_1_2(name, ret_type, before1, qual, type, after1, after2) \
00087 template <typename Policy, typename type> \
00088 struct FUNCTION_CLASS(name); \
00089 template <typename Policy, typename type> \
00090 inline ret_type name(before1 b1, qual type& arg, after1 a1, after2 a2) { \
00091 return FUNCTION_CLASS(name)<Policy, type>::function(b1, arg, a1, a2); \
00092 }
00093
00094 #define DECLARE_FUN1_2_2(name, ret_type, before1, before2, qual, type, after1, after2) \
00095 template <typename Policy, typename type> \
00096 struct FUNCTION_CLASS(name); \
00097 template <typename Policy, typename type> \
00098 inline ret_type name(before1 b1, before2 b2, qual type& arg, after1 a1, after2 a2) { \
00099 return FUNCTION_CLASS(name)<Policy, type>::function(b1, b2, arg, a1, a2); \
00100 }
00101
00102 #define DECLARE_FUN2_0_0(name, ret_type, qual1, type1, qual2, type2) \
00103 template <typename Policy1, typename Policy2, typename type1, typename type2> \
00104 struct FUNCTION_CLASS(name); \
00105 template <typename Policy1, typename Policy2, typename type1, typename type2> \
00106 inline ret_type name(qual1 type1& arg1, qual2 type2& arg2) { \
00107 return FUNCTION_CLASS(name)<Policy1, Policy2, type1, type2>::function(arg1, arg2); \
00108 }
00109
00110 #define DECLARE_FUN2_0_1(name, ret_type, qual1, type1, qual2, type2, after1) \
00111 template <typename Policy1, typename Policy2, typename type1, typename type2> \
00112 struct FUNCTION_CLASS(name); \
00113 template <typename Policy1, typename Policy2, typename type1, typename type2> \
00114 inline ret_type name(qual1 type1& arg1, qual2 type2& arg2, after1 a1) { \
00115 return FUNCTION_CLASS(name)<Policy1, Policy2, type1, type2>::function(arg1, arg2, a1); \
00116 }
00117
00118 #define DECLARE_FUN2_0_2(name, ret_type, qual1, type1, qual2, type2, after1, after2) \
00119 template <typename Policy1, typename Policy2, typename type1, typename type2> \
00120 struct FUNCTION_CLASS(name); \
00121 template <typename Policy1, typename Policy2, typename type1, typename type2> \
00122 inline ret_type name(qual1 type1& arg1, qual2 type2& arg2, after1 a1, after2 a2) { \
00123 return FUNCTION_CLASS(name)<Policy1, Policy2, type1, type2>::function(arg1, arg2, a1, a2); \
00124 }
00125
00126 #define DECLARE_FUN3_0_1(name, ret_type, qual1, type1, qual2, type2, qual3, type3, after1) \
00127 template <typename Policy1, typename Policy2, typename Policy3, typename type1, typename type2, typename type3> \
00128 struct FUNCTION_CLASS(name); \
00129 template <typename Policy1, typename Policy2, typename Policy3, typename type1, typename type2, typename type3> \
00130 inline ret_type name(qual1 type1& arg1, qual2 type2& arg2, qual3 type3& arg3, after1 a1) { \
00131 return FUNCTION_CLASS(name)<Policy1, Policy2, Policy3, type1, type2, type3>::function(arg1, arg2, arg3, a1); \
00132 }
00133
00134 #define DECLARE_FUN5_0_1(name, ret_type, \
00135 qual1, type1, qual2, type2, qual3, type3, \
00136 qual4, type4, qual5, type5, \
00137 after1) \
00138 template <typename Policy1, typename Policy2, typename Policy3, \
00139 typename Policy4,typename Policy5, \
00140 typename type1, typename type2, typename type3, \
00141 typename type4, typename type5> \
00142 struct FUNCTION_CLASS(name); \
00143 template <typename Policy1, typename Policy2, typename Policy3, \
00144 typename Policy4,typename Policy5, \
00145 typename type1, typename type2, typename type3, \
00146 typename type4, typename type5> \
00147 inline ret_type name(qual1 type1& arg1, qual2 type2& arg2, \
00148 qual3 type3& arg3, qual4 type4& arg4, \
00149 qual5 type5& arg5, after1 a1) { \
00150 return FUNCTION_CLASS(name)<Policy1, Policy2, Policy3, Policy4, Policy5, type1, type2, type3, type4, type5> \
00151 ::function(arg1, arg2, arg3, arg4, arg5, a1); \
00152 }
00153
00154 #define SPECIALIZE_FUN1_0_0(name, func, ret_type, qual, type) \
00155 template <typename Policy> \
00156 struct FUNCTION_CLASS(name)<Policy, type> { \
00157 static inline ret_type function(qual type& arg) { \
00158 return func<Policy>(arg); \
00159 } \
00160 };
00161
00162 #define SPECIALIZE_FUN1_0_1(name, func, ret_type, qual, type, after1) \
00163 template <typename Policy> \
00164 struct FUNCTION_CLASS(name)<Policy, type> { \
00165 static inline ret_type function(qual type& arg, after1 a1) { \
00166 return func<Policy>(arg, a1); \
00167 } \
00168 };
00169
00170 #define SPECIALIZE_FUN1_0_2(name, func, ret_type, qual, type, after1, after2) \
00171 template <typename Policy> \
00172 struct FUNCTION_CLASS(name)<Policy, type> { \
00173 static inline ret_type function(qual type& arg, after1 a1, after2 a2) { \
00174 return func<Policy>(arg, a1, a2); \
00175 } \
00176 };
00177
00178 #define SPECIALIZE_FUN1_0_3(name, func, ret_type, qual, type, after1, after2, after3) \
00179 template <typename Policy> \
00180 struct FUNCTION_CLASS(name)<Policy, type> { \
00181 static inline ret_type function(qual type& arg, after1 a1, after2 a2, after3 a3) { \
00182 return func<Policy>(arg, a1, a2, a3); \
00183 } \
00184 };
00185
00186 #define SPECIALIZE_FUN1_1_1(name, func, ret_type, before1, qual, type, after1) \
00187 template <typename Policy> \
00188 struct FUNCTION_CLASS(name)<Policy, type> { \
00189 static inline ret_type function(before1 b1, qual type& arg, after1 a1) { \
00190 return func<Policy>(b1, arg, a1); \
00191 } \
00192 };
00193
00194 #define SPECIALIZE_FUN1_1_2(name, func, ret_type, before1, qual, type, after1, after2) \
00195 template <typename Policy> \
00196 struct FUNCTION_CLASS(name)<Policy, type> { \
00197 static inline ret_type function(before1 b1, qual type& arg, after1 a1, after2 a2) { \
00198 return func<Policy>(b1, arg, a1, a2); \
00199 } \
00200 };
00201
00202 #define SPECIALIZE_FUN1_2_2(name, func, ret_type, before1, before2, qual, type, after1, after2) \
00203 template <typename Policy> \
00204 struct FUNCTION_CLASS(name)<Policy, type> { \
00205 static inline ret_type function(before1 b1, before2 b2, qual type& arg, after1 a1, after2 a2) { \
00206 return func<Policy>(b1, b2, arg, a1, a2); \
00207 } \
00208 };
00209
00210 #define SPECIALIZE_FUN2_0_0(name, func, ret_type, qual1, type1, qual2, type2) \
00211 template <typename Policy1, typename Policy2> \
00212 struct FUNCTION_CLASS(name)<Policy1, Policy2, type1, type2> { \
00213 static inline ret_type function(qual1 type1& arg1, qual2 type2 &arg2) { \
00214 return func<Policy1, Policy2>(arg1, arg2); \
00215 } \
00216 };
00217
00218 #define SPECIALIZE_FUN2_0_1(name, func, ret_type, qual1, type1, qual2, type2, after1) \
00219 template <typename Policy1, typename Policy2> \
00220 struct FUNCTION_CLASS(name)<Policy1, Policy2, type1, type2> { \
00221 static inline ret_type function(qual1 type1& arg1, qual2 type2 &arg2, after1 a1) { \
00222 return func<Policy1, Policy2>(arg1, arg2, a1); \
00223 } \
00224 };
00225
00226 #define SPECIALIZE_FUN2_0_2(name, func, ret_type, qual1, type1, qual2, type2, after1, after2) \
00227 template <typename Policy1, typename Policy2> \
00228 struct FUNCTION_CLASS(name)<Policy1, Policy2, type1, type2> { \
00229 static inline ret_type function(qual1 type1& arg1, qual2 type2 &arg2, after1 a1, after2 a2) { \
00230 return func<Policy1, Policy2>(arg1, arg2, a1, a2); \
00231 } \
00232 };
00233
00234 #define SPECIALIZE_FUN3_0_1(name, func, ret_type, qual1, type1, qual2, type2, qual3, type3, after1) \
00235 template <typename Policy1, typename Policy2, typename Policy3> \
00236 struct FUNCTION_CLASS(name) <Policy1, Policy2, Policy3, type1, type2, type3> { \
00237 static inline Result function(qual1 type1& arg1, qual2 type2 &arg2, qual3 type3 &arg3, after1 a1) { \
00238 return func<Policy1, Policy2, Policy3>(arg1, arg2, arg3, a1); \
00239 } \
00240 };
00241
00242 #define SPECIALIZE_FUN5_0_1(name, func, ret_type, \
00243 qual1, type1, qual2, type2, qual3, type3, \
00244 qual4, type4, qual5, type5, after1) \
00245 template <typename Policy1, typename Policy2, typename Policy3, \
00246 typename Policy4, typename Policy5> \
00247 struct FUNCTION_CLASS(name) <Policy1, Policy2, Policy3, Policy4, Policy5, \
00248 type1, type2, type3, type4, type5> { \
00249 static inline Result \
00250 function(qual1 type1& arg1, qual2 type2 &arg2, qual3 type3 &arg3, \
00251 qual4 type4 &arg4, qual5 type5 &arg5, after1 a1) { \
00252 return func<Policy1, Policy2, Policy3, Policy4, Policy5>(arg1, arg2, arg3, arg4, arg5, a1); \
00253 } \
00254 };
00255
00256 #define nonconst
00257
00258 #define SPECIALIZE_COPY(func, Type) \
00259 SPECIALIZE_FUN2_0_0(copy, func, void, nonconst, Type, const, Type)
00260 #define SPECIALIZE_SGN(func, From) \
00261 SPECIALIZE_FUN1_0_0(sgn, func, Result, const, From)
00262 #define SPECIALIZE_CMP(func, Type1, Type2) \
00263 SPECIALIZE_FUN2_0_0(cmp, func, Result, const, Type1, const, Type2)
00264 #define SPECIALIZE_CLASSIFY(func, Type) \
00265 SPECIALIZE_FUN1_0_3(classify, func, Result, const, Type, bool, bool, bool)
00266 #define SPECIALIZE_IS_NAN(func, Type) \
00267 SPECIALIZE_FUN1_0_0(is_nan, func, bool, const, Type)
00268 #define SPECIALIZE_IS_MINF(func, Type) \
00269 SPECIALIZE_FUN1_0_0(is_minf, func, bool, const, Type)
00270 #define SPECIALIZE_IS_PINF(func, Type) \
00271 SPECIALIZE_FUN1_0_0(is_pinf, func, bool, const, Type)
00272 #define SPECIALIZE_IS_INT(func, Type) \
00273 SPECIALIZE_FUN1_0_0(is_int, func, bool, const, Type)
00274 #define SPECIALIZE_ASSIGN_SPECIAL(func, Type) \
00275 SPECIALIZE_FUN1_0_2(assign_special, func, Result, nonconst, Type, Result, Rounding_Dir)
00276 #define SPECIALIZE_CONSTRUCT_SPECIAL(func, Type) \
00277 SPECIALIZE_FUN1_0_2(construct_special, func, Result, nonconst, Type, Result, Rounding_Dir)
00278 #define SPECIALIZE_CONSTRUCT(func, To, From) \
00279 SPECIALIZE_FUN2_0_1(construct, func, Result, nonconst, To, const, From, Rounding_Dir)
00280 #define SPECIALIZE_ASSIGN(func, To, From) \
00281 SPECIALIZE_FUN2_0_1(assign, func, Result, nonconst, To, const, From, Rounding_Dir)
00282 #define SPECIALIZE_FLOOR(func, To, From) \
00283 SPECIALIZE_FUN2_0_1(floor, func, Result, nonconst, To, const, From, Rounding_Dir)
00284 #define SPECIALIZE_CEIL(func, To, From) \
00285 SPECIALIZE_FUN2_0_1(ceil, func, Result, nonconst, To, const, From, Rounding_Dir)
00286 #define SPECIALIZE_TRUNC(func, To, From) \
00287 SPECIALIZE_FUN2_0_1(trunc, func, Result, nonconst, To, const, From, Rounding_Dir)
00288 #define SPECIALIZE_NEG(func, To, From) \
00289 SPECIALIZE_FUN2_0_1(neg, func, Result, nonconst, To, const, From, Rounding_Dir)
00290 #define SPECIALIZE_ABS(func, To, From) \
00291 SPECIALIZE_FUN2_0_1(abs, func, Result, nonconst, To, const, From, Rounding_Dir)
00292 #define SPECIALIZE_SQRT(func, To, From) \
00293 SPECIALIZE_FUN2_0_1(sqrt, func, Result, nonconst, To, const, From, Rounding_Dir)
00294 #define SPECIALIZE_ADD(func, To, From1, From2) \
00295 SPECIALIZE_FUN3_0_1(add, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00296 #define SPECIALIZE_SUB(func, To, From1, From2) \
00297 SPECIALIZE_FUN3_0_1(sub, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00298 #define SPECIALIZE_MUL(func, To, From1, From2) \
00299 SPECIALIZE_FUN3_0_1(mul, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00300 #define SPECIALIZE_DIV(func, To, From1, From2) \
00301 SPECIALIZE_FUN3_0_1(div, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00302 #define SPECIALIZE_REM(func, To, From1, From2) \
00303 SPECIALIZE_FUN3_0_1(rem, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00304 #define SPECIALIZE_IDIV(func, To, From1, From2) \
00305 SPECIALIZE_FUN3_0_1(idiv, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00306 #define SPECIALIZE_MUL2EXP(func, To, From) \
00307 SPECIALIZE_FUN2_0_2(mul2exp, func, Result, nonconst, To, const, From, int, Rounding_Dir)
00308 #define SPECIALIZE_DIV2EXP(func, To, From) \
00309 SPECIALIZE_FUN2_0_2(div2exp, func, Result, nonconst, To, const, From, int, Rounding_Dir)
00310 #define SPECIALIZE_ADD_MUL(func, To, From1, From2) \
00311 SPECIALIZE_FUN3_0_1(add_mul, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00312 #define SPECIALIZE_SUB_MUL(func, To, From1, From2) \
00313 SPECIALIZE_FUN3_0_1(sub_mul, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00314 #define SPECIALIZE_GCD(func, To, From1, From2) \
00315 SPECIALIZE_FUN3_0_1(gcd, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00316 #define SPECIALIZE_GCDEXT(func, To1, From1, From2, To2, To3) \
00317 SPECIALIZE_FUN5_0_1(gcdext, func, Result, nonconst, To1, \
00318 nonconst, To2, nonconst, To3, const, From1, const, From2, Rounding_Dir)
00319 #define SPECIALIZE_LCM(func, To, From1, From2) \
00320 SPECIALIZE_FUN3_0_1(lcm, func, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00321 #define SPECIALIZE_INPUT(func, Type) \
00322 SPECIALIZE_FUN1_0_2(input, func, Result, nonconst, Type, std::istream&, Rounding_Dir)
00323 #define SPECIALIZE_OUTPUT(func, Type) \
00324 SPECIALIZE_FUN1_1_2(output, func, Result, std::ostream&, const, Type, const Numeric_Format&, Rounding_Dir)
00325
00326
00327 DECLARE_FUN2_0_0(copy, void, nonconst, Type1, const, Type2)
00328 DECLARE_FUN1_0_0(sgn, Result, const, From)
00329 DECLARE_FUN2_0_0(cmp, Result, const, Type1, const, Type2)
00330 DECLARE_FUN1_0_3(classify, Result, const, Type, bool, bool, bool)
00331 DECLARE_FUN1_0_0(is_nan, bool, const, Type)
00332 DECLARE_FUN1_0_0(is_minf, bool, const, Type)
00333 DECLARE_FUN1_0_0(is_pinf, bool, const, Type)
00334 DECLARE_FUN1_0_0(is_int, bool, const, Type)
00335 DECLARE_FUN1_0_2(assign_special, Result, nonconst, Type, Result, Rounding_Dir)
00336 DECLARE_FUN1_0_2(construct_special, Result, nonconst, Type, Result, Rounding_Dir)
00337 DECLARE_FUN2_0_1(construct, Result, nonconst, To, const, From, Rounding_Dir)
00338 DECLARE_FUN2_0_1(assign, Result, nonconst, To, const, From, Rounding_Dir)
00339 DECLARE_FUN2_0_1(floor, Result, nonconst, To, const, From, Rounding_Dir)
00340 DECLARE_FUN2_0_1(ceil, Result, nonconst, To, const, From, Rounding_Dir)
00341 DECLARE_FUN2_0_1(trunc, Result, nonconst, To, const, From, Rounding_Dir)
00342 DECLARE_FUN2_0_1(neg, Result, nonconst, To, const, From, Rounding_Dir)
00343 DECLARE_FUN2_0_1(abs, Result, nonconst, To, const, From, Rounding_Dir)
00344 DECLARE_FUN2_0_1(sqrt, Result, nonconst, To, const, From, Rounding_Dir)
00345 DECLARE_FUN3_0_1(add, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00346 DECLARE_FUN3_0_1(sub, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00347 DECLARE_FUN3_0_1(mul, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00348 DECLARE_FUN3_0_1(div, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00349 DECLARE_FUN3_0_1(rem, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00350 DECLARE_FUN3_0_1(idiv, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00351 DECLARE_FUN2_0_2(mul2exp, Result, nonconst, To, const, From, int, Rounding_Dir)
00352 DECLARE_FUN2_0_2(div2exp, Result, nonconst, To, const, From, int, Rounding_Dir)
00353 DECLARE_FUN3_0_1(add_mul, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00354 DECLARE_FUN3_0_1(sub_mul, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00355 DECLARE_FUN3_0_1(gcd, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00356 DECLARE_FUN5_0_1(gcdext, Result, nonconst, To1, nonconst, To2, nonconst, To3, const, From1, const, From2, Rounding_Dir)
00357 DECLARE_FUN3_0_1(lcm, Result, nonconst, To, const, From1, const, From2, Rounding_Dir)
00358 DECLARE_FUN1_0_2(input, Result, nonconst, Type, std::istream&, Rounding_Dir)
00359 DECLARE_FUN1_1_2(output, Result, std::ostream&, const, Type, const Numeric_Format&, Rounding_Dir)
00360
00361 template <typename Policy, typename To>
00362 Result round(To& to, Result r, Rounding_Dir dir);
00363
00364 Result input_mpq(mpq_class& to, std::istream& is);
00365
00366 }
00367
00368 struct Minus_Infinity {
00369 static const Result code = VC_MINUS_INFINITY;
00370 };
00371 struct Plus_Infinity {
00372 static const Result code = VC_PLUS_INFINITY;
00373 };
00374 struct Not_A_Number {
00375 static const Result code = VC_NAN;
00376 };
00377
00378 template <typename T>
00379 struct Is_Special : public False { };
00380
00381 template <>
00382 struct Is_Special<Minus_Infinity> : public True {};
00383
00384 template <>
00385 struct Is_Special<Plus_Infinity> : public True {};
00386
00387 template <>
00388 struct Is_Special<Not_A_Number> : public True {};
00389
00390
00391 #define MINUS_INFINITY Minus_Infinity()
00392 #define PLUS_INFINITY Plus_Infinity()
00393 #define NOT_A_NUMBER Not_A_Number()
00394
00395 #ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS
00396
00397 #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS)
00398 template <typename T>
00399 struct Checked_Number_Transparent_Policy {
00401 const_bool_nodef(check_overflow, false);
00402
00404 const_bool_nodef(check_inf_add_inf, false);
00405
00407 const_bool_nodef(check_inf_sub_inf, false);
00408
00410 const_bool_nodef(check_inf_mul_zero, false);
00411
00413 const_bool_nodef(check_div_zero, false);
00414
00416 const_bool_nodef(check_inf_div_inf, false);
00417
00419 const_bool_nodef(check_inf_mod, false);
00420
00422 const_bool_nodef(check_sqrt_neg, false);
00423
00425 const_bool_nodef(has_nan, std::numeric_limits<T>::has_quiet_NaN);
00426
00428 const_bool_nodef(has_infinity, std::numeric_limits<T>::has_infinity);
00429
00431 const_bool_nodef(convertible, true);
00432
00434 const_bool_nodef(fpu_check_inexact, false);
00435
00437 const_bool_nodef(check_nan_result, false);
00438 static const Rounding_Dir ROUND_DEFAULT_CONSTRUCTOR = ROUND_NATIVE;
00439 static const Rounding_Dir ROUND_DEFAULT_OPERATOR = ROUND_NATIVE;
00440 static const Rounding_Dir ROUND_DEFAULT_FUNCTION = ROUND_NATIVE;
00441 static const Rounding_Dir ROUND_DEFAULT_INPUT = ROUND_NATIVE;
00442 static const Rounding_Dir ROUND_DEFAULT_OUTPUT = ROUND_NATIVE;
00443 static void handle_result(Result r);
00444 };
00445
00446 }
00447
00448 #define CHECK_P(cond, check) ((cond) ? (check) : (assert(!(check)), false))
00449
00450 #include "checked.inlines.hh"
00451 #include "checked_int.inlines.hh"
00452 #include "checked_float.inlines.hh"
00453 #include "checked_mpz.inlines.hh"
00454 #include "checked_mpq.inlines.hh"
00455 #include "checked_ext.inlines.hh"
00456
00457 #endif // !defined(PPL_checked_defs_hh)