[GIT] ppl/ppl(bounded_arithmetic): Coefficient types of weakly-relational domains moved to new source files.
 
            Module: ppl/ppl Branch: bounded_arithmetic Commit: 0edbd37a47bb2bb6fd79f993cb2deb77d0c6892e URL: http://www.cs.unipr.it/git/gitweb.cgi?p=ppl/ppl.git;a=commit;h=0edbd37a47bb2...
Author: Roberto Bagnara bagnara@cs.unipr.it Date: Wed May 13 22:17:32 2009 +0200
Coefficient types of weakly-relational domains moved to new source files.
---
src/BD_Shape.defs.hh | 1 + src/Checked_Number.defs.hh | 29 --------------- src/Checked_Number.inlines.hh | 6 --- src/Makefile.am | 2 + src/Octagonal_Shape.defs.hh | 2 + src/WRD_coefficient_types.defs.hh | 63 ++++++++++++++++++++++++++++++++++ src/WRD_coefficient_types.inlines.hh | 36 +++++++++++++++++++ 7 files changed, 104 insertions(+), 35 deletions(-)
diff --git a/src/BD_Shape.defs.hh b/src/BD_Shape.defs.hh index 4738a92..a15ff6a 100644 --- a/src/BD_Shape.defs.hh +++ b/src/BD_Shape.defs.hh @@ -43,6 +43,7 @@ site: http://www.cs.unipr.it/ppl/ . */ #include "DB_Matrix.defs.hh" #include "DB_Row.defs.hh" #include "Checked_Number.defs.hh" +#include "WRD_coefficient_types.defs.hh" #include "Bit_Matrix.defs.hh" #include <cstddef> #include <iosfwd> diff --git a/src/Checked_Number.defs.hh b/src/Checked_Number.defs.hh index d363c65..da7b2fb 100644 --- a/src/Checked_Number.defs.hh +++ b/src/Checked_Number.defs.hh @@ -61,35 +61,6 @@ struct Extended_Number_Policy { };
#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS -/*! \ingroup PPL_CXX_interface */ -#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) -struct WRD_Extended_Number_Policy { - const_bool_nodef(check_overflow, true); - const_bool_nodef(check_inf_add_inf, false); - const_bool_nodef(check_inf_sub_inf, false); - const_bool_nodef(check_inf_mul_zero, false); - const_bool_nodef(check_div_zero, false); - const_bool_nodef(check_inf_div_inf, false); - const_bool_nodef(check_inf_mod, false); - const_bool_nodef(check_sqrt_neg, false); - const_bool_nodef(has_nan, true); - const_bool_nodef(has_infinity, true); - // Do not uncomment the following. - // The compile time error on conversions is the expected behavior. - // const_bool_nodef(convertible, false); - const_bool_nodef(fpu_check_inexact, true); - const_bool_nodef(fpu_check_nan_result, false); - // Do not uncomment the following. - // The compile time error is the expected behavior. - // static const Rounding_Dir ROUND_DEFAULT_CONSTRUCTOR = ROUND_UP; - // static const Rounding_Dir ROUND_DEFAULT_OPERATOR = ROUND_UP; - // static const Rounding_Dir ROUND_DEFAULT_FUNCTION = ROUND_UP; - // static const Rounding_Dir ROUND_DEFAULT_INPUT = ROUND_UP; - // static const Rounding_Dir ROUND_DEFAULT_OUTPUT = ROUND_UP; - static void handle_result(Result r); -}; - -#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS //! A policy checking for overflows. /*! \ingroup PPL_CXX_interface */ #endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) diff --git a/src/Checked_Number.inlines.hh b/src/Checked_Number.inlines.hh index 1d5aace..f3f77a4 100644 --- a/src/Checked_Number.inlines.hh +++ b/src/Checked_Number.inlines.hh @@ -71,12 +71,6 @@ Extended_Number_Policy::handle_result(Result r) { throw_result_exception(r); }
-inline void -WRD_Extended_Number_Policy::handle_result(Result r) { - if (result_class(r) == VC_NAN) - throw_result_exception(r); -} - template <typename T, typename Policy> inline Checked_Number<T, Policy>::Checked_Number() diff --git a/src/Makefile.am b/src/Makefile.am index 22bad97..5849079 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -193,6 +193,8 @@ checked_ext.inlines.hh \ Checked_Number.defs.hh \ Checked_Number.inlines.hh \ Checked_Number.templates.hh \ +WRD_coefficient_types.defs.hh \ +WRD_coefficient_types.inlines.hh \ checked_numeric_limits.hh \ $(COEFFICIENT_DEFS_INCLUDE_FILES) \ Coefficient.defs.hh \ diff --git a/src/Octagonal_Shape.defs.hh b/src/Octagonal_Shape.defs.hh index e647a99..02bbb32 100644 --- a/src/Octagonal_Shape.defs.hh +++ b/src/Octagonal_Shape.defs.hh @@ -42,6 +42,8 @@ site: http://www.cs.unipr.it/ppl/ . */ #include "Variable.defs.hh" #include "Variables_Set.types.hh" #include "Checked_Number.defs.hh" +#include "WRD_coefficient_types.defs.hh" +#include "Bit_Row.defs.hh" #include <vector> #include <cstddef> #include <climits> diff --git a/src/WRD_coefficient_types.defs.hh b/src/WRD_coefficient_types.defs.hh new file mode 100644 index 0000000..b05b322 --- /dev/null +++ b/src/WRD_coefficient_types.defs.hh @@ -0,0 +1,63 @@ +/* Coefficient types of weakly-relational domains: declarations. + Copyright (C) 2001-2009 Roberto Bagnara bagnara@cs.unipr.it + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://www.cs.unipr.it/ppl/ . */ + +#ifndef PPL_WRD_coefficient_types_defs_hh +#define PPL_WRD_coefficient_types_defs_hh 1 + +#include "meta_programming.hh" + +namespace Parma_Polyhedra_Library { + +#ifdef PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS +/*! \ingroup PPL_CXX_interface */ +#endif // defined(PPL_DOXYGEN_INCLUDE_IMPLEMENTATION_DETAILS) +struct WRD_Extended_Number_Policy { + const_bool_nodef(check_overflow, true); + const_bool_nodef(check_inf_add_inf, false); + const_bool_nodef(check_inf_sub_inf, false); + const_bool_nodef(check_inf_mul_zero, false); + const_bool_nodef(check_div_zero, false); + const_bool_nodef(check_inf_div_inf, false); + const_bool_nodef(check_inf_mod, false); + const_bool_nodef(check_sqrt_neg, false); + const_bool_nodef(has_nan, true); + const_bool_nodef(has_infinity, true); + // Do not uncomment the following. + // The compile time error on conversions is the expected behavior. + // const_bool_nodef(convertible, false); + const_bool_nodef(fpu_check_inexact, true); + const_bool_nodef(fpu_check_nan_result, false); + // Do not uncomment the following. + // The compile time error is the expected behavior. + // static const Rounding_Dir ROUND_DEFAULT_CONSTRUCTOR = ROUND_UP; + // static const Rounding_Dir ROUND_DEFAULT_OPERATOR = ROUND_UP; + // static const Rounding_Dir ROUND_DEFAULT_FUNCTION = ROUND_UP; + // static const Rounding_Dir ROUND_DEFAULT_INPUT = ROUND_UP; + // static const Rounding_Dir ROUND_DEFAULT_OUTPUT = ROUND_UP; + static void handle_result(Result r); +}; + +} // namespace Parma_Polyhedra_Library + +#include "WRD_coefficient_types.inlines.hh" + +#endif // !defined(PPL_WRD_coefficient_types_defs_hh) diff --git a/src/WRD_coefficient_types.inlines.hh b/src/WRD_coefficient_types.inlines.hh new file mode 100644 index 0000000..2f98f58 --- /dev/null +++ b/src/WRD_coefficient_types.inlines.hh @@ -0,0 +1,36 @@ +/* Coefficient types of weakly-relational domains: inline functions. + Copyright (C) 2001-2009 Roberto Bagnara bagnara@cs.unipr.it + +This file is part of the Parma Polyhedra Library (PPL). + +The PPL is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 3 of the License, or (at your +option) any later version. + +The PPL is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software Foundation, +Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1307, USA. + +For the most up-to-date information see the Parma Polyhedra Library +site: http://www.cs.unipr.it/ppl/ . */ + +#ifndef PPL_WRD_coefficient_types_inlines_hh +#define PPL_WRD_coefficient_types_inlines_hh 1 + +namespace Parma_Polyhedra_Library { + +inline void +WRD_Extended_Number_Policy::handle_result(Result r) { + if (result_class(r) == VC_NAN) + throw_result_exception(r); +} + +} // namespace Parma_Polyhedra_Library + +#endif // !defined(PPL_WRD_coefficient_types_inlines_hh)
participants (1)
- 
                 Roberto Bagnara Roberto Bagnara