Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:23

0001 /*-----------------------------------------------------------------------------+
0002 Copyright (c) 2008-2009: Joachim Faulhaber
0003 +------------------------------------------------------------------------------+
0004    Distributed under the Boost Software License, Version 1.0.
0005       (See accompanying file LICENCE.txt or copy at
0006            http://www.boost.org/LICENSE_1_0.txt)
0007 +-----------------------------------------------------------------------------*/
0008 
0009 /*------------------------------------------------------------------------------
0010 itl_rational provides adapter code for boost::rational.
0011 ------------------------------------------------------------------------------*/
0012 
0013 #ifndef BOOST_ICL_RATIONAL_HPP_JOFA_080913
0014 #define BOOST_ICL_RATIONAL_HPP_JOFA_080913
0015 
0016 #include <boost/config.hpp> // For BOOST_MSVC and more
0017 
0018 #ifdef BOOST_MSVC 
0019 #pragma warning(push)
0020 #pragma warning(disable:4127) // conditional expression is constant
0021 #pragma warning(disable:4512) // 'boost::detail::resetter' : assignment operator could not be generated
0022 #pragma warning(disable:4800) // 'unsigned int' : forcing value to bool 'true' or 'false' (performance warning)
0023 #endif                        
0024 
0025 #include <boost/rational.hpp>
0026 
0027 #ifdef BOOST_MSVC
0028 #pragma warning(pop)
0029 #endif
0030 
0031 #include <boost/icl/type_traits/is_continuous.hpp>
0032 #include <boost/icl/type_traits/has_inverse.hpp>
0033 #include <boost/icl/type_traits/is_numeric.hpp>
0034 
0035 namespace boost{namespace icl
0036 {
0037     template<class Integral> 
0038     struct is_numeric<boost::rational<Integral> >
0039     {
0040         typedef is_numeric type;
0041         BOOST_STATIC_CONSTANT(bool, value = true);
0042     };
0043 
0044     template<class Integral> 
0045     struct is_continuous<boost::rational<Integral> >
0046     {
0047         typedef is_continuous type;
0048         BOOST_STATIC_CONSTANT(bool, value = true);
0049     };
0050 
0051     template<class Integral> 
0052     struct is_discrete<boost::rational<Integral> >
0053     {
0054         typedef is_discrete type;
0055         BOOST_STATIC_CONSTANT(bool, value = false);
0056     };
0057 
0058     template<class Integral> 
0059     struct has_inverse<boost::rational<Integral> >
0060     {
0061         typedef has_inverse type;
0062         BOOST_STATIC_CONSTANT(bool, value = (boost::is_signed<Integral>::value));
0063     };
0064 
0065 }} // namespace icl boost
0066 
0067 
0068 #endif
0069 
0070