00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef PPL_Coefficient_inlines_hh
00025 #define PPL_Coefficient_inlines_hh 1
00026
00027 namespace Parma_Polyhedra_Library {
00028
00029 #ifdef PPL_CHECKED_INTEGERS
00030 inline void
00031 Bounded_Integer_Coefficient_Policy::handle_result(Result r) {
00032
00033 if (result_overflow(r) || result_class(r) == VC_NAN)
00034 throw_result_exception(r);
00035 }
00036 #endif // PPL_CHECKED_INTEGERS
00037
00038
00039 #if defined(PPL_CHECKED_INTEGERS) || defined(PPL_NATIVE_INTEGERS)
00040 inline Coefficient_traits::const_reference
00041 Coefficient_zero() {
00042
00043 static Coefficient zero(0);
00044 return zero;
00045 }
00046
00047 inline Coefficient_traits::const_reference
00048 Coefficient_one() {
00049
00050 static Coefficient one(1);
00051 return one;
00052 }
00053 #endif // defined(PPL_CHECKED_INTEGERS) || defined(PPL_NATIVE_INTEGERS)
00054
00055 #ifdef PPL_GMP_INTEGERS
00056 inline Coefficient_traits::const_reference
00057 Coefficient_zero() {
00058 extern const Coefficient* Coefficient_zero_p;
00059 return *Coefficient_zero_p;
00060 }
00061
00062 inline Coefficient_traits::const_reference
00063 Coefficient_one() {
00064 extern const Coefficient* Coefficient_one_p;
00065 PPL_ASSERT(*Coefficient_one_p != 0);
00066 return *Coefficient_one_p;
00067 }
00068 #endif // PPL_GMP_INTEGERS
00069
00070 }
00071
00072 #endif // !defined(PPL_Coefficient_inlines_hh)