From: bangerth Date: Thu, 1 Jul 2010 03:33:28 +0000 (+0000) Subject: Upgrade to the current BOOST version 1.43. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6b7084f6e34dca5f74eab891730e27c0c744e602;p=dealii-svn.git Upgrade to the current BOOST version 1.43. git-svn-id: https://svn.dealii.org/trunk@21426 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/contrib/boost/include/boost/archive/basic_archive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_archive.hpp index 668bd679b1..1c906ef94d 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_archive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_archive.hpp @@ -17,22 +17,36 @@ // See http://www.boost.org for updates, documentation, and revision history. #include -#include +#include #include +#include +#include #include #include // must be the last header +#define BOOST_ARCHIVE_STRONG_TYPEDEF(T, D) \ +namespace boost { \ +namespace archive { \ +BOOST_STRONG_TYPEDEF(T, D) \ +} /* archive */ \ +template<> \ +class integer_traits : \ + public integer_traits \ +{}; \ +} /* boost */ \ +/**/ + +BOOST_ARCHIVE_STRONG_TYPEDEF(uint_least16_t, version_type) +BOOST_ARCHIVE_STRONG_TYPEDEF(int_least16_t, class_id_type) +BOOST_ARCHIVE_STRONG_TYPEDEF(int_least16_t, class_id_optional_type) +BOOST_ARCHIVE_STRONG_TYPEDEF(int_least16_t, class_id_reference_type) +BOOST_ARCHIVE_STRONG_TYPEDEF(uint_least32_t, object_id_type) +BOOST_ARCHIVE_STRONG_TYPEDEF(uint_least32_t, object_reference_type) + namespace boost { namespace archive { -BOOST_STRONG_TYPEDEF(unsigned int, version_type) -BOOST_STRONG_TYPEDEF(int, class_id_type) -BOOST_STRONG_TYPEDEF(int, class_id_optional_type) -BOOST_STRONG_TYPEDEF(int, class_id_reference_type) -BOOST_STRONG_TYPEDEF(unsigned int, object_id_type) -BOOST_STRONG_TYPEDEF(unsigned int, object_reference_type) - struct tracking_type { // typedef bool value_type; bool t; @@ -64,7 +78,9 @@ struct tracking_type { } }; -struct class_name_type : private boost::noncopyable { +struct class_name_type : + private boost::noncopyable +{ char *t; operator const char * & () const { return const_cast(t); @@ -95,7 +111,7 @@ enum archive_flags { BOOST_ARCHIVE_DECL(const char *) BOOST_ARCHIVE_SIGNATURE(); -BOOST_ARCHIVE_DECL(unsigned char) +BOOST_ARCHIVE_DECL(version_type) BOOST_ARCHIVE_VERSION(); }// namespace archive diff --git a/deal.II/contrib/boost/include/boost/archive/basic_binary_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_binary_iarchive.hpp index 2448c5fd35..0494c98c9f 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_binary_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_binary_iarchive.hpp @@ -31,6 +31,11 @@ #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + #include // must be the last header namespace boost { @@ -127,6 +132,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_BASIC_BINARY_IARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/basic_binary_iprimitive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_binary_iprimitive.hpp index 11f5b3890a..c374e0b0ce 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_binary_iprimitive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_binary_iprimitive.hpp @@ -46,8 +46,8 @@ namespace std{ #include #include #include -//#include -//#include +#include +#include #include #include @@ -151,7 +151,11 @@ basic_binary_iprimitive::load_binary( std::size_t count ){ // note: an optimizer should eliminate the following for char files - std::streamsize s = count / sizeof(Elem); + assert( + static_cast(count / sizeof(Elem)) + <= boost::integer_traits::const_max + ); + std::streamsize s = static_cast(count / sizeof(Elem)); std::streamsize scount = m_sb.sgetn( static_cast(address), s @@ -161,7 +165,8 @@ basic_binary_iprimitive::load_binary( archive_exception(archive_exception::stream_error) ); // note: an optimizer should eliminate the following for char files - s = count % sizeof(Elem); + assert(count % sizeof(Elem) <= boost::integer_traits::const_max); + s = static_cast(count % sizeof(Elem)); if(0 < s){ // if(is.fail()) // boost::serialization::throw_exception( diff --git a/deal.II/contrib/boost/include/boost/archive/basic_binary_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_binary_oarchive.hpp index d39d187b5e..9198e1acf6 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_binary_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_binary_oarchive.hpp @@ -35,6 +35,13 @@ #include #include +#include // must be the last header + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -73,31 +80,31 @@ public: void save_override(const version_type & t, int){ // upto 255 versions // note:t.t resolves borland ambguity - assert(t.t <= boost::integer_traits::const_max); + assert(t.t < boost::integer_traits::const_max); const unsigned char x = static_cast(t.t); * this->This() << x; } void save_override(const class_id_type & t, int){ // upto 32K classes - assert(t.t <= boost::integer_traits::const_max); + assert(t.t < boost::integer_traits::const_max); const boost::int_least16_t x = static_cast(t.t); * this->This() << x; } void save_override(const class_id_reference_type & t, int){ // upto 32K classes - assert(t.t <= boost::integer_traits::const_max); - const boost::uint_least16_t x = t.t; + assert(t.t < boost::integer_traits::const_max); + const boost::int_least16_t x = t.t; * this->This() << x; } void save_override(const object_id_type & t, int){ // upto 2G objects - assert(t.t <= boost::integer_traits::const_max); + assert(t.t < boost::integer_traits::const_max); const boost::uint_least32_t x = t.t; * this->This() << x; } void save_override(const object_reference_type & t, int){ // upto 2G objects - assert(t.t <= boost::integer_traits::const_max); + assert(t.t < boost::integer_traits::const_max); const boost::uint_least32_t x = t.t; * this->This() << x; } @@ -129,4 +136,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#include // pops abi_suffix.hpp pragmas + #endif // BOOST_ARCHIVE_BASIC_BINARY_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/basic_binary_oprimitive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_binary_oprimitive.hpp index c22c87cfee..934744f6c6 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_binary_oprimitive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_binary_oprimitive.hpp @@ -38,8 +38,8 @@ namespace std{ #endif #include -//#include -//#include +#include +#include #include #include @@ -160,9 +160,10 @@ basic_binary_oprimitive::save_binary( // figure number of elements to output - round up count = ( count + sizeof(Elem) - 1) / sizeof(Elem); + assert(count <= std::size_t(boost::integer_traits::const_max)); std::streamsize scount = m_sb.sputn( static_cast(address), - count + static_cast(count) ); if(count != static_cast(scount)) boost::serialization::throw_exception( diff --git a/deal.II/contrib/boost/include/boost/archive/basic_streambuf_locale_saver.hpp b/deal.II/contrib/boost/include/boost/archive/basic_streambuf_locale_saver.hpp index 3f587de720..ca764e1048 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_streambuf_locale_saver.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_streambuf_locale_saver.hpp @@ -29,11 +29,20 @@ #include // for std::locale #include // for std::basic_streambuf +#include +#include + +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost{ namespace archive{ template < typename Ch, class Tr > -class basic_streambuf_locale_saver +class basic_streambuf_locale_saver : + private boost::noncopyable { public: typedef ::std::basic_streambuf state_type; @@ -56,5 +65,9 @@ private: } // archive } // boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_NO_STD_LOCALE #endif // BOOST_ARCHIVE_BASIC_STREAMBUF_LOCALE_SAVER_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/basic_text_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_text_iarchive.hpp index 8080564666..8d2bc07879 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_text_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_text_iarchive.hpp @@ -33,6 +33,11 @@ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -79,6 +84,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_BASIC_TEXT_IARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/basic_text_iprimitive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_text_iprimitive.hpp index da3234c812..313052a254 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_text_iprimitive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_text_iprimitive.hpp @@ -47,8 +47,10 @@ namespace std{ #include #include +#include #include #include +#include #include // must be the last header namespace boost { @@ -70,8 +72,9 @@ public: #ifndef BOOST_NO_STD_LOCALE boost::scoped_ptr archive_locale; - io::basic_ios_locale_saver< - BOOST_DEDUCED_TYPENAME IStream::char_type, BOOST_DEDUCED_TYPENAME IStream::traits_type + basic_streambuf_locale_saver< + BOOST_DEDUCED_TYPENAME IStream::char_type, + BOOST_DEDUCED_TYPENAME IStream::traits_type > locale_saver; #endif diff --git a/deal.II/contrib/boost/include/boost/archive/basic_text_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_text_oarchive.hpp index 4fd55f0694..47c3c0ecfd 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_text_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_text_oarchive.hpp @@ -34,6 +34,11 @@ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -129,6 +134,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_BASIC_TEXT_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/basic_text_oprimitive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_text_oprimitive.hpp index ba8770959e..3c0c083eeb 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_text_oprimitive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_text_oprimitive.hpp @@ -29,6 +29,7 @@ #include // isnan #include #include // size_t +#include #include #include @@ -49,9 +50,8 @@ namespace std{ #include #include #include - #include - +#include #include // must be the last header namespace boost { @@ -75,8 +75,9 @@ public: #ifndef BOOST_NO_STD_LOCALE boost::scoped_ptr archive_locale; - io::basic_ios_locale_saver< - BOOST_DEDUCED_TYPENAME OStream::char_type, BOOST_DEDUCED_TYPENAME OStream::traits_type + basic_streambuf_locale_saver< + BOOST_DEDUCED_TYPENAME OStream::char_type, + BOOST_DEDUCED_TYPENAME OStream::traits_type > locale_saver; #endif @@ -162,7 +163,7 @@ public: ~basic_text_oprimitive(); public: // unformatted append of one character - void put(int c){ + void put(BOOST_DEDUCED_TYPENAME OStream::char_type c){ if(os.fail()) boost::serialization::throw_exception( archive_exception(archive_exception::stream_error) diff --git a/deal.II/contrib/boost/include/boost/archive/basic_xml_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_xml_iarchive.hpp index fd3ae75589..5351ff353a 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_xml_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_xml_iarchive.hpp @@ -29,6 +29,11 @@ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -113,6 +118,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_BASIC_XML_IARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/basic_xml_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/basic_xml_oarchive.hpp index 0ba2589189..154745a88a 100644 --- a/deal.II/contrib/boost/include/boost/archive/basic_xml_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/basic_xml_oarchive.hpp @@ -28,6 +28,11 @@ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -131,6 +136,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_BASIC_XML_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/binary_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/binary_iarchive.hpp index fdfc355e4a..638d996729 100644 --- a/deal.II/contrib/boost/include/boost/archive/binary_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/binary_iarchive.hpp @@ -20,6 +20,11 @@ #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -91,4 +96,8 @@ public: BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_iarchive) BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_iarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_BINARY_IARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/binary_iarchive_impl.hpp b/deal.II/contrib/boost/include/boost/archive/binary_iarchive_impl.hpp index c1d04d10e1..32c476d645 100644 --- a/deal.II/contrib/boost/include/boost/archive/binary_iarchive_impl.hpp +++ b/deal.II/contrib/boost/include/boost/archive/binary_iarchive_impl.hpp @@ -21,6 +21,11 @@ #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -84,4 +89,8 @@ protected: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_BINARY_IARCHIVE_IMPL_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/binary_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/binary_oarchive.hpp index ee5e7d8cdb..2aac14f908 100644 --- a/deal.II/contrib/boost/include/boost/archive/binary_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/binary_oarchive.hpp @@ -17,9 +17,15 @@ // See http://www.boost.org for updates, documentation, and revision history. #include +#include #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -53,4 +59,8 @@ typedef binary_oarchive naked_binary_oarchive; BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::binary_oarchive) BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::archive::binary_oarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_BINARY_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/binary_oarchive_impl.hpp b/deal.II/contrib/boost/include/boost/archive/binary_oarchive_impl.hpp index 331a8744cd..7ca773b601 100644 --- a/deal.II/contrib/boost/include/boost/archive/binary_oarchive_impl.hpp +++ b/deal.II/contrib/boost/include/boost/archive/binary_oarchive_impl.hpp @@ -17,10 +17,16 @@ // See http://www.boost.org for updates, documentation, and revision history. #include +#include #include #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -84,4 +90,8 @@ protected: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_BINARY_OARCHIVE_IMPL_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/codecvt_null.hpp b/deal.II/contrib/boost/include/boost/archive/codecvt_null.hpp index ba88aea06d..910b26156a 100644 --- a/deal.II/contrib/boost/include/boost/archive/codecvt_null.hpp +++ b/deal.II/contrib/boost/include/boost/archive/codecvt_null.hpp @@ -35,6 +35,11 @@ namespace std { } // namespace #endif +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -87,6 +92,9 @@ class codecvt_null : public std::codecvt } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif #include // pop pragmas #endif //BOOST_ARCHIVE_CODECVT_NULL_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/archive_serializer_map.hpp b/deal.II/contrib/boost/include/boost/archive/detail/archive_serializer_map.hpp index 096a24be34..6d2eec4a85 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/archive_serializer_map.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/archive_serializer_map.hpp @@ -36,8 +36,8 @@ namespace detail { class basic_serializer; template -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) archive_serializer_map -{ +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +archive_serializer_map { public: static bool insert(const basic_serializer * bs); static void erase(const basic_serializer * bs); diff --git a/deal.II/contrib/boost/include/boost/archive/detail/basic_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/detail/basic_iarchive.hpp index 4c9707c26d..c7961775bb 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/basic_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/basic_iarchive.hpp @@ -20,6 +20,8 @@ // #include #include +#include + #include #include #include @@ -39,7 +41,8 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; ////////////////////////////////////////////////////////////////////// // class basic_iarchive - read serialized objects from a input stream -class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive +class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive : + private boost::noncopyable { friend class basic_iarchive_impl; // hide implementation of this class to minimize header conclusion @@ -53,9 +56,6 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iarchive virtual void vload(class_id_optional_type &t) = 0; virtual void vload(class_name_type &t) = 0; virtual void vload(tracking_type &t) = 0; - - virtual const basic_pointer_iserializer * - find(const boost::serialization::extended_type_info & eti) const = 0; protected: basic_iarchive(unsigned int flags); // account for bogus gcc warning @@ -76,11 +76,15 @@ public: const basic_pointer_iserializer * load_pointer( void * & t, - const basic_pointer_iserializer * bpis_ptr + const basic_pointer_iserializer * bpis_ptr, + const basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & eti + ) + ); // real public API starts here void - set_library_version(unsigned int archive_library_version); + set_library_version(version_type archive_library_version); unsigned int get_library_version() const; unsigned int diff --git a/deal.II/contrib/boost/include/boost/archive/detail/basic_iserializer.hpp b/deal.II/contrib/boost/include/boost/archive/detail/basic_iserializer.hpp index de9654f911..2f4f6d811f 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/basic_iserializer.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/basic_iserializer.hpp @@ -19,13 +19,18 @@ #include // NULL #include +#include #include #include #include #include // must be the last header -namespace boost { +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif +namespace boost { namespace serialization { class extended_type_info; } // namespace serialization @@ -71,7 +76,7 @@ public: // returns true if objects should be tracked virtual bool tracking(const unsigned int) const = 0 ; // returns class version - virtual unsigned int version() const = 0 ; + virtual version_type version() const = 0 ; // returns true if this class is polymorphic virtual bool is_polymorphic() const = 0; virtual void destroy(/*const*/ void *address) const = 0 ; @@ -81,6 +86,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_DETAIL_BASIC_ISERIALIZER_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/basic_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/detail/basic_oarchive.hpp index 0a1b4042a2..d418afd648 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/basic_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/basic_oarchive.hpp @@ -16,8 +16,10 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include #include // NULL +#include +#include + #include // can't use this - much as I'd like to as borland doesn't support it @@ -41,7 +43,8 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; ////////////////////////////////////////////////////////////////////// // class basic_oarchive - write serialized objects to an output stream -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive : + private boost::noncopyable { friend class basic_oarchive_impl; // hide implementation of this class to minimize header conclusion diff --git a/deal.II/contrib/boost/include/boost/archive/detail/basic_oserializer.hpp b/deal.II/contrib/boost/include/boost/archive/detail/basic_oserializer.hpp index 69a06cb9fc..74af7e6577 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/basic_oserializer.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/basic_oserializer.hpp @@ -18,14 +18,20 @@ #include // NULL #include +#include +#include #include #include #include // must be the last header -namespace boost { +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif +namespace boost { namespace serialization { class extended_type_info; } // namespace serialization @@ -69,7 +75,7 @@ public: // returns true if objects should be tracked virtual bool tracking(const unsigned int flags) const = 0; // returns class version - virtual unsigned int version() const = 0; + virtual version_type version() const = 0; // returns true if this class is polymorphic virtual bool is_polymorphic() const = 0; }; @@ -78,6 +84,10 @@ public: } // namespace serialization } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_SERIALIZATION_BASIC_OSERIALIZER_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/basic_pointer_iserializer.hpp b/deal.II/contrib/boost/include/boost/archive/detail/basic_pointer_iserializer.hpp index 1a469382c8..d957b83e64 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/basic_pointer_iserializer.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/basic_pointer_iserializer.hpp @@ -17,13 +17,18 @@ // See http://www.boost.org for updates, documentation, and revision history. #include +#include #include #include #include // must be the last header -namespace boost { +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif +namespace boost { namespace serialization { class extended_type_info; } // namespace serialization @@ -59,6 +64,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_BASIC_POINTER_ISERIALIZER_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/basic_pointer_oserializer.hpp b/deal.II/contrib/boost/include/boost/archive/detail/basic_pointer_oserializer.hpp index 9c8d7177d7..b0d3fb9597 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/basic_pointer_oserializer.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/basic_pointer_oserializer.hpp @@ -17,13 +17,18 @@ // See http://www.boost.org for updates, documentation, and revision history. #include +#include #include #include #include // must be the last header -namespace boost { +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif +namespace boost { namespace serialization { class extended_type_info; } // namespace serialization @@ -35,7 +40,8 @@ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oarchive; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer : - public basic_serializer { + public basic_serializer +{ protected: explicit basic_pointer_oserializer( const boost::serialization::extended_type_info & type_ @@ -57,6 +63,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_BASIC_POINTER_OSERIALIZER_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/basic_serializer.hpp b/deal.II/contrib/boost/include/boost/archive/detail/basic_serializer.hpp index b6beeea7da..ab2ffe9d08 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/basic_serializer.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/basic_serializer.hpp @@ -23,6 +23,11 @@ #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { namespace detail { @@ -67,4 +72,8 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_BASIC_SERIALIZER_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/basic_serializer_map.hpp b/deal.II/contrib/boost/include/boost/archive/detail/basic_serializer_map.hpp index d17c5c3c8a..19defcb5be 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/basic_serializer_map.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/basic_serializer_map.hpp @@ -34,7 +34,8 @@ namespace detail { class basic_serializer; -class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_serializer_map : public +class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) +basic_serializer_map : public boost::noncopyable { struct type_info_pointer_compare @@ -43,7 +44,10 @@ class BOOST_ARCHIVE_OR_WARCHIVE_DECL(BOOST_PP_EMPTY()) basic_serializer_map : pu const basic_serializer * lhs, const basic_serializer * rhs ) const ; }; - typedef std::set map_type; + typedef std::set< + const basic_serializer *, + type_info_pointer_compare + > map_type; map_type m_map; public: bool insert(const basic_serializer * bs); diff --git a/deal.II/contrib/boost/include/boost/archive/detail/check.hpp b/deal.II/contrib/boost/include/boost/archive/detail/check.hpp index 5a92e59ce6..737c12c913 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/check.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/check.hpp @@ -48,7 +48,7 @@ namespace detail { // checks for objects template -void inline check_object_level(){ +inline void check_object_level(){ typedef BOOST_DEDUCED_TYPENAME mpl::greater_equal< serialization::implementation_level, @@ -58,10 +58,10 @@ void inline check_object_level(){ // trap attempts to serialize objects marked // not_serializable BOOST_STATIC_ASSERT(typex::value); -}; +} template -void inline check_object_versioning(){ +inline void check_object_versioning(){ typedef BOOST_DEDUCED_TYPENAME mpl::or_< BOOST_DEDUCED_TYPENAME mpl::greater< @@ -76,10 +76,10 @@ void inline check_object_versioning(){ // trap attempts to serialize with objects that don't // save class information in the archive with versioning. BOOST_STATIC_ASSERT(typex::value); -}; +} template -void inline check_object_tracking(){ +inline void check_object_tracking(){ // presume it has already been determined that // T is not a const BOOST_STATIC_ASSERT(! boost::is_const::value); @@ -96,12 +96,12 @@ void inline check_object_tracking(){ // for motivation for this checking. BOOST_STATIC_WARNING(typex::value); -}; +} // checks for pointers template -void inline check_pointer_level(){ +inline void check_pointer_level(){ // we should only invoke this once we KNOW that T // has been used as a pointer!! typedef @@ -146,10 +146,10 @@ void inline check_pointer_tracking(){ // serializing an object of a type marked "track_never" through a pointer // could result in creating more objects than were saved! BOOST_STATIC_WARNING(typex::value); -}; +} template -void inline check_const_loading(){ +inline void check_const_loading(){ typedef BOOST_DEDUCED_TYPENAME mpl::or_< BOOST_DEDUCED_TYPENAME boost::serialization::is_wrapper, @@ -160,7 +160,7 @@ void inline check_const_loading(){ // cannot load data into a "const" object unless it's a // wrapper around some other non-const object. BOOST_STATIC_ASSERT(typex::value); -}; +} } // detail } // archive diff --git a/deal.II/contrib/boost/include/boost/archive/detail/common_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/detail/common_iarchive.hpp index 2713c2f43b..004e131e78 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/common_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/common_iarchive.hpp @@ -16,12 +16,19 @@ // See http://www.boost.org for updates, documentation, and revision history. +#include + #include #include #include #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { namespace detail { @@ -69,18 +76,15 @@ protected: basic_iarchive(flags), interface_iarchive() {} -public: - virtual const basic_pointer_iserializer * - find(const boost::serialization::extended_type_info & eti) const { - return static_cast( - archive_serializer_map::find(eti) - ); - } }; } // namespace detail } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_DETAIL_COMMON_IARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/common_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/detail/common_oarchive.hpp index db072c307d..7962063a58 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/common_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/common_oarchive.hpp @@ -16,9 +16,16 @@ // See http://www.boost.org for updates, documentation, and revision history. +#include + #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { namespace detail { @@ -73,4 +80,8 @@ protected: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_DETAIL_COMMON_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/interface_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/detail/interface_iarchive.hpp index 7fd363d059..06487521fa 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/interface_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/interface_iarchive.hpp @@ -15,7 +15,6 @@ // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. -#include #include // NULL #include #include diff --git a/deal.II/contrib/boost/include/boost/archive/detail/interface_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/detail/interface_oarchive.hpp index 6331e0ea8f..e8db7a2bc8 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/interface_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/interface_oarchive.hpp @@ -15,7 +15,6 @@ // http://www.boost.org/LICENSE_1_0.txt) // See http://www.boost.org for updates, documentation, and revision history. -#include #include // NULL #include #include diff --git a/deal.II/contrib/boost/include/boost/archive/detail/iserializer.hpp b/deal.II/contrib/boost/include/boost/archive/detail/iserializer.hpp index f712e6383a..293155a542 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/iserializer.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/iserializer.hpp @@ -110,6 +110,11 @@ public: namespace detail { +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + template class iserializer : public basic_iserializer { @@ -144,8 +149,8 @@ public: == boost::serialization::track_selectively && serialized_as_pointer()); } - virtual unsigned int version() const { - return ::boost::serialization::version::value; + virtual version_type version() const { + return version_type(::boost::serialization::version::value); } virtual bool is_polymorphic() const { return boost::is_polymorphic::value; @@ -153,6 +158,10 @@ public: virtual ~iserializer(){}; }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + template BOOST_DLLEXPORT void iserializer::load_object_data( basic_iarchive & ar, @@ -160,7 +169,7 @@ BOOST_DLLEXPORT void iserializer::load_object_data( const unsigned int file_version ) const { // trap case where the program cannot handle the current version - if(file_version > version()) + if(file_version > static_cast(version())) boost::serialization::throw_exception( archive::archive_exception( boost::archive::archive_exception::unsupported_class_version, @@ -177,6 +186,11 @@ BOOST_DLLEXPORT void iserializer::load_object_data( ); } +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + template class pointer_iserializer : public basic_pointer_iserializer @@ -198,6 +212,10 @@ protected: ~pointer_iserializer(); }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + // note trick to be sure that operator new is using class specific // version if such exists. Due to Peter Dimov. // note: the following fails if T has no default constructor. @@ -437,7 +455,7 @@ struct load_pointer_type { }; template - static const basic_pointer_iserializer * register_type(Archive &ar, T & /*t*/){ + static const basic_pointer_iserializer * register_type(Archive &ar, const T & /*t*/){ // there should never be any need to load an abstract polymorphic // class pointer. Inhibiting code generation for this // permits abstract base classes to be used - note: exception @@ -454,35 +472,49 @@ struct load_pointer_type { template static T * pointer_tweak( const boost::serialization::extended_type_info & eti, - void * t, - T & + void const * const t, + const T & ) { // tweak the pointer back to the base class return static_cast( - boost::serialization::void_upcast( - eti, - boost::serialization::singleton< - BOOST_DEDUCED_TYPENAME - boost::serialization::type_info_implementation::type - >::get_const_instance(), - t + const_cast( + boost::serialization::void_upcast( + eti, + boost::serialization::singleton< + BOOST_DEDUCED_TYPENAME + boost::serialization::type_info_implementation::type + >::get_const_instance(), + t + ) ) ); } template - static void load(Archive &ar, T & t){ + static void check_load(T & /* t */){ check_pointer_level(); check_pointer_tracking(); } + static const basic_pointer_iserializer * + find(const boost::serialization::extended_type_info & type){ + return static_cast( + archive_serializer_map::find(type) + ); + } + template static void invoke(Archive & ar, Tptr & t){ - load(ar, *t); + check_load(*t); const basic_pointer_iserializer * bpis_ptr = register_type(ar, *t); const basic_pointer_iserializer * newbpis_ptr = ar.load_pointer( - * reinterpret_cast(&t), - bpis_ptr + // note major hack here !!! + // I tried every way to convert Tptr &t (where Tptr might + // include const) to void * &. This is the only way + // I could make it work. RR + (void * & )t, + bpis_ptr, + find ); // if the pointer isn't that of the base class if(newbpis_ptr != bpis_ptr){ diff --git a/deal.II/contrib/boost/include/boost/archive/detail/oserializer.hpp b/deal.II/contrib/boost/include/boost/archive/detail/oserializer.hpp index cc5159e00e..009204a30e 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/oserializer.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/oserializer.hpp @@ -91,6 +91,11 @@ public: namespace detail { +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + template class oserializer : public basic_oserializer { @@ -119,8 +124,8 @@ public: || (boost::serialization::tracking_level::value == boost::serialization::track_selectively && serialized_as_pointer()); } - virtual unsigned int version() const { - return ::boost::serialization::version::value; + virtual version_type version() const { + return version_type(::boost::serialization::version::value); } virtual bool is_polymorphic() const { return boost::is_polymorphic::value; @@ -128,6 +133,10 @@ public: virtual ~oserializer(){} }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + template BOOST_DLLEXPORT void oserializer::save_object_data( basic_oarchive & ar, @@ -143,6 +152,11 @@ BOOST_DLLEXPORT void oserializer::save_object_data( ); } +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + template class pointer_oserializer : public basic_pointer_oserializer @@ -163,6 +177,10 @@ public: ~pointer_oserializer(); }; +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + template BOOST_DLLEXPORT void pointer_oserializer::save_object_ptr( basic_oarchive & ar, @@ -288,13 +306,13 @@ struct save_non_pointer_type { > > >::type typex; check_object_versioning(); typex::invoke(ar, t); - }; + } template static void invoke(Archive & ar, T & t){ check_object_level(); check_object_tracking(); invoke(ar, const_cast(t)); - }; + } }; template @@ -377,7 +395,7 @@ struct save_pointer_type { boost::serialization::throw_exception( archive_exception( archive_exception::unregistered_class, - true_type->get_debug_info() + "derived class not registered or exported" ) ); } @@ -453,7 +471,7 @@ struct save_pointer_type { return; } save(ar, * t); - }; + } }; template diff --git a/deal.II/contrib/boost/include/boost/archive/detail/polymorphic_iarchive_route.hpp b/deal.II/contrib/boost/include/boost/archive/detail/polymorphic_iarchive_route.hpp index e8f624046a..76b005bb0f 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/polymorphic_iarchive_route.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/polymorphic_iarchive_route.hpp @@ -27,8 +27,8 @@ namespace std{ } // namespace std #endif -#include #include +#include #include #include // must be the last header @@ -42,13 +42,17 @@ namespace detail{ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_iserializer; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_iserializer; +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + template class polymorphic_iarchive_route : public polymorphic_iarchive, // note: gcc dynamic cross cast fails if the the derivation below is // not public. I think this is a mistake. - public /*protected*/ ArchiveImplementation, - private boost::noncopyable + public /*protected*/ ArchiveImplementation { private: // these are used by the serialization library. @@ -60,11 +64,14 @@ private: } virtual const basic_pointer_iserializer * load_pointer( void * & t, - const basic_pointer_iserializer * bpis_ptr + const basic_pointer_iserializer * bpis_ptr, + const basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type + ) ){ - return ArchiveImplementation::load_pointer(t, bpis_ptr); + return ArchiveImplementation::load_pointer(t, bpis_ptr, finder); } - virtual void set_library_version(unsigned int archive_library_version){ + virtual void set_library_version(version_type archive_library_version){ ArchiveImplementation::set_library_version(archive_library_version); } virtual unsigned int get_library_version() const{ @@ -123,11 +130,18 @@ private: virtual void load(unsigned long & t){ ArchiveImplementation::load(t); } - #if !defined(BOOST_NO_INTRINSIC_INT64_T) - virtual void load(boost::int64_t & t){ + #if defined(BOOST_HAS_LONG_LONG) + virtual void load(boost::long_long_type & t){ + ArchiveImplementation::load(t); + } + virtual void load(boost::ulong_long_type & t){ ArchiveImplementation::load(t); } - virtual void load(boost::uint64_t & t){ + #elif defined(BOOST_HAS_MS_INT64) + virtual void load(__int64 & t){ + ArchiveImplementation::load(t); + } + virtual void load(unsigned __int64 & t){ ArchiveImplementation::load(t); } #endif @@ -188,6 +202,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_DETAIL_POLYMORPHIC_IARCHIVE_DISPATCH_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/polymorphic_oarchive_route.hpp b/deal.II/contrib/boost/include/boost/archive/detail/polymorphic_oarchive_route.hpp index e043bb59ff..59795096c0 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/polymorphic_oarchive_route.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/polymorphic_oarchive_route.hpp @@ -18,8 +18,6 @@ #include #include -#include -#include #include // size_t #include @@ -29,6 +27,8 @@ namespace std{ } // namespace std #endif +#include +#include #include #include // must be the last header @@ -42,13 +42,17 @@ namespace detail{ class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_oserializer; class BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) basic_pointer_oserializer; +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + template class polymorphic_oarchive_route : public polymorphic_oarchive, // note: gcc dynamic cross cast fails if the the derivation below is // not public. I think this is a mistake. - public /*protected*/ ArchiveImplementation, - private boost::noncopyable + public /*protected*/ ArchiveImplementation { private: // these are used by the serialization library. @@ -105,7 +109,14 @@ private: virtual void save(const unsigned long t){ ArchiveImplementation::save(t); } - #if !defined(BOOST_NO_INTRINSIC_INT64_T) + #if defined(BOOST_HAS_LONG_LONG) + virtual void save(const boost::long_long_type t){ + ArchiveImplementation::save(t); + } + virtual void save(const boost::ulong_long_type t){ + ArchiveImplementation::save(t); + } + #elif defined(BOOST_HAS_MS_INT64) virtual void save(const boost::int64_t t){ ArchiveImplementation::save(t); } @@ -179,6 +190,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_DETAIL_POLYMORPHIC_OARCHIVE_DISPATCH_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/detail/register_archive.hpp b/deal.II/contrib/boost/include/boost/archive/detail/register_archive.hpp index 87fedcbe86..e31ae46c05 100644 --- a/deal.II/contrib/boost/include/boost/archive/detail/register_archive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/detail/register_archive.hpp @@ -54,12 +54,12 @@ void instantiate_ptr_serialization(Serializable*, counter<0>) {} #define BOOST_SERIALIZATION_REGISTER_ARCHIVE(Archive) \ namespace boost { namespace archive { namespace detail { \ - get_counter::next adjust_counter(get_counter::type);\ + get_counter::next adjust_counter(get_counter::type);\ template \ void instantiate_ptr_serialization(Serializable* s, \ - get_counter::type) { \ + get_counter::type) { \ ptr_serialization_support x; \ - instantiate_ptr_serialization(s, get_counter::prior()); \ + instantiate_ptr_serialization(s, get_counter::prior()); \ }\ }}} diff --git a/deal.II/contrib/boost/include/boost/archive/impl/archive_serializer_map.ipp b/deal.II/contrib/boost/include/boost/archive/impl/archive_serializer_map.ipp index ec580b541f..f8e6ab5169 100644 --- a/deal.II/contrib/boost/include/boost/archive/impl/archive_serializer_map.ipp +++ b/deal.II/contrib/boost/include/boost/archive/impl/archive_serializer_map.ipp @@ -21,12 +21,21 @@ namespace boost { namespace archive { namespace detail { +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace { // anon template class map : public basic_serializer_map {}; } +#ifdef BOOST_MSVC +# pragma warning(pop) +#endif + template BOOST_ARCHIVE_OR_WARCHIVE_DECL(bool) archive_serializer_map::insert(const basic_serializer * bs){ diff --git a/deal.II/contrib/boost/include/boost/archive/impl/basic_binary_oprimitive.ipp b/deal.II/contrib/boost/include/boost/archive/impl/basic_binary_oprimitive.ipp index 1b25c227f9..9d398bea63 100644 --- a/deal.II/contrib/boost/include/boost/archive/impl/basic_binary_oprimitive.ipp +++ b/deal.II/contrib/boost/include/boost/archive/impl/basic_binary_oprimitive.ipp @@ -20,7 +20,6 @@ namespace std{ } // namespace std #endif - #ifndef BOOST_NO_CWCHAR #include #ifdef BOOST_NO_STDC_NAMESPACE @@ -30,9 +29,6 @@ namespace std{ using ::wcslen; } #include -#include -#include -#include #include #include diff --git a/deal.II/contrib/boost/include/boost/archive/impl/basic_text_iarchive.ipp b/deal.II/contrib/boost/include/boost/archive/impl/basic_text_iarchive.ipp index 6d9b8c74f5..2ea7257af2 100644 --- a/deal.II/contrib/boost/include/boost/archive/impl/basic_text_iarchive.ipp +++ b/deal.II/contrib/boost/include/boost/archive/impl/basic_text_iarchive.ipp @@ -64,11 +64,11 @@ basic_text_iarchive::init(void){ #if ! BOOST_WORKAROUND(BOOST_MSVC, <= 1200) detail:: #endif - basic_iarchive::set_library_version(input_library_version.t); + basic_iarchive::set_library_version(input_library_version); #endif // extra little .t is to get around borland quirk - if(BOOST_ARCHIVE_VERSION() < input_library_version.t) + if(BOOST_ARCHIVE_VERSION() < input_library_version) boost::serialization::throw_exception( archive_exception(archive_exception::unsupported_version) ); diff --git a/deal.II/contrib/boost/include/boost/archive/impl/basic_text_iprimitive.ipp b/deal.II/contrib/boost/include/boost/archive/impl/basic_text_iprimitive.ipp index c64502dc78..b91432bf99 100644 --- a/deal.II/contrib/boost/include/boost/archive/impl/basic_text_iprimitive.ipp +++ b/deal.II/contrib/boost/include/boost/archive/impl/basic_text_iprimitive.ipp @@ -39,13 +39,13 @@ namespace { template<> bool is_whitespace(char t){ - return std::isspace(t); + return 0 != std::isspace(t); } #ifndef BOOST_NO_CWCHAR template<> bool is_whitespace(wchar_t t){ - return std::iswspace(t); + return 0 != std::iswspace(t); } #endif } @@ -104,11 +104,11 @@ basic_text_iprimitive::load_binary( iterators::istream_iterator i; for(;;){ - CharType c; - c = is.get(); + BOOST_DEDUCED_TYPENAME IStream::int_type r; + r = is.get(); if(is.eof()) break; - if(is_whitespace(c)) + if(is_whitespace(static_cast(r))) break; } } @@ -124,7 +124,7 @@ basic_text_iprimitive::basic_text_iprimitive( flags_saver(is_), precision_saver(is_), archive_locale(NULL), - locale_saver(is_) + locale_saver(* is_.rdbuf()) { if(! no_codecvt){ archive_locale.reset( diff --git a/deal.II/contrib/boost/include/boost/archive/impl/basic_text_oprimitive.ipp b/deal.II/contrib/boost/include/boost/archive/impl/basic_text_oprimitive.ipp index 702663ad81..e27bd37c61 100644 --- a/deal.II/contrib/boost/include/boost/archive/impl/basic_text_oprimitive.ipp +++ b/deal.II/contrib/boost/include/boost/archive/impl/basic_text_oprimitive.ipp @@ -84,7 +84,7 @@ basic_text_oprimitive::basic_text_oprimitive( flags_saver(os_), precision_saver(os_), archive_locale(NULL), - locale_saver(os_) + locale_saver(* os_.rdbuf()) { if(! no_codecvt){ archive_locale.reset( diff --git a/deal.II/contrib/boost/include/boost/archive/impl/xml_iarchive_impl.ipp b/deal.II/contrib/boost/include/boost/archive/impl/xml_iarchive_impl.ipp index 21d006e7f0..daa3e594b3 100644 --- a/deal.II/contrib/boost/include/boost/archive/impl/xml_iarchive_impl.ipp +++ b/deal.II/contrib/boost/include/boost/archive/impl/xml_iarchive_impl.ipp @@ -156,7 +156,9 @@ template BOOST_ARCHIVE_DECL(void) xml_iarchive_impl::init(){ gimpl->init(is); - this->set_library_version(gimpl->rv.version); + this->set_library_version( + version_type(gimpl->rv.version) + ); } template diff --git a/deal.II/contrib/boost/include/boost/archive/impl/xml_wiarchive_impl.ipp b/deal.II/contrib/boost/include/boost/archive/impl/xml_wiarchive_impl.ipp index 3df68d9140..c600eb815c 100644 --- a/deal.II/contrib/boost/include/boost/archive/impl/xml_wiarchive_impl.ipp +++ b/deal.II/contrib/boost/include/boost/archive/impl/xml_wiarchive_impl.ipp @@ -146,7 +146,9 @@ template BOOST_WARCHIVE_DECL(void) xml_wiarchive_impl::init(){ gimpl->init(is); - this->set_library_version(gimpl->rv.version); + this->set_library_version( + version_type(gimpl->rv.version) + ); } template diff --git a/deal.II/contrib/boost/include/boost/archive/iterators/escape.hpp b/deal.II/contrib/boost/include/boost/archive/iterators/escape.hpp index 3fe64fa49f..b11d1a6722 100644 --- a/deal.II/contrib/boost/include/boost/archive/iterators/escape.hpp +++ b/deal.II/contrib/boost/include/boost/archive/iterators/escape.hpp @@ -97,7 +97,7 @@ class escape : const base_value_type *m_bnext; const base_value_type *m_bend; bool m_full; - BOOST_DEDUCED_TYPENAME boost::iterator_value::type m_current_value; + base_value_type m_current_value; public: escape(Base base) : super_t(base), diff --git a/deal.II/contrib/boost/include/boost/archive/iterators/istream_iterator.hpp b/deal.II/contrib/boost/include/boost/archive/iterators/istream_iterator.hpp index ac3568aa87..1df612dc8d 100644 --- a/deal.II/contrib/boost/include/boost/archive/iterators/istream_iterator.hpp +++ b/deal.II/contrib/boost/include/boost/archive/iterators/istream_iterator.hpp @@ -61,7 +61,7 @@ class istream_iterator : void increment(){ if(NULL != m_istream){ - m_current_value = m_istream->get(); + m_current_value = static_cast(m_istream->get()); if(! m_istream->good()){ const_cast(this)->m_istream = NULL; } diff --git a/deal.II/contrib/boost/include/boost/archive/iterators/unescape.hpp b/deal.II/contrib/boost/include/boost/archive/iterators/unescape.hpp index e709138181..f437c388e7 100644 --- a/deal.II/contrib/boost/include/boost/archive/iterators/unescape.hpp +++ b/deal.II/contrib/boost/include/boost/archive/iterators/unescape.hpp @@ -50,13 +50,11 @@ class unescape > super_t; typedef unescape this_t; - typedef BOOST_DEDUCED_TYPENAME super_t::reference reference_type; public: - // gcc 3.4.1 - linux required that this be public - typedef BOOST_DEDUCED_TYPENAME super_t::value_type value_type; + typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type; + typedef BOOST_DEDUCED_TYPENAME this_t::reference reference; private: - - reference_type dereference_impl() { + value_type dereference_impl() { if(! m_full){ m_current_value = static_cast(this)->drain(); m_full = true; @@ -64,11 +62,10 @@ private: return m_current_value; } - reference_type dereference() const { + reference dereference() const { return const_cast(this)->dereference_impl(); } - // value_type is const char - can't be const fix later value_type m_current_value; bool m_full; diff --git a/deal.II/contrib/boost/include/boost/archive/iterators/xml_unescape.hpp b/deal.II/contrib/boost/include/boost/archive/iterators/xml_unescape.hpp index 4272c9786e..25b7edf460 100644 --- a/deal.II/contrib/boost/include/boost/archive/iterators/xml_unescape.hpp +++ b/deal.II/contrib/boost/include/boost/archive/iterators/xml_unescape.hpp @@ -19,6 +19,7 @@ #include #include // for BOOST_DEDUCED_TYPENAME + #include #include @@ -44,8 +45,15 @@ class xml_unescape return unescape, Base>::dereference(); } public: + // workaround msvc 7.1 ICU crash + #if defined(BOOST_MSVC) + typedef int value_type; + #else + typedef BOOST_DEDUCED_TYPENAME this_t::value_type value_type; + #endif + void drain_residue(const char *literal); - int drain(); + value_type drain(); template xml_unescape(BOOST_PFTO_WRAPPER(T) start) : @@ -75,8 +83,10 @@ void xml_unescape::drain_residue(const char * literal){ // iterator refenence which would make subsequent iterator comparisons // incorrect and thereby break the composiblity of iterators. template -int xml_unescape::drain(){ - int retval = * this->base_reference(); +BOOST_DEDUCED_TYPENAME xml_unescape::value_type +//int +xml_unescape::drain(){ + value_type retval = * this->base_reference(); if('&' != retval){ return retval; } diff --git a/deal.II/contrib/boost/include/boost/archive/polymorphic_binary_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/polymorphic_binary_iarchive.hpp index c14ad5afd0..ce7e3b0609 100644 --- a/deal.II/contrib/boost/include/boost/archive/polymorphic_binary_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/polymorphic_binary_iarchive.hpp @@ -20,6 +20,11 @@ #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -36,6 +41,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE( boost::archive::polymorphic_binary_iarchive diff --git a/deal.II/contrib/boost/include/boost/archive/polymorphic_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/polymorphic_iarchive.hpp index 8506062160..a2777509a5 100644 --- a/deal.II/contrib/boost/include/boost/archive/polymorphic_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/polymorphic_iarchive.hpp @@ -38,26 +38,6 @@ namespace std{ #include #include // must be the last header -// determine if its necessary to handle (u)int64_t specifically -// i.e. that its not a synonym for (unsigned) long -// if there is no 64 bit int or if its the same as a long -// we shouldn't define separate functions for int64 data types. -#if defined(BOOST_NO_INT64_T) - #define BOOST_NO_INTRINSIC_INT64_T -#else - #if defined(ULLONG_MAX) - #if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1 - #define BOOST_NO_INTRINSIC_INT64_T - #endif - #elif defined(ULONG_MAX) - #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1 - #define BOOST_NO_INTRINSIC_INT64_T - #endif - #else - #define BOOST_NO_INTRINSIC_INT64_T - #endif -#endif - namespace boost { template class shared_ptr; @@ -99,10 +79,14 @@ public: virtual void load(long & t) = 0; virtual void load(unsigned long & t) = 0; - #if !defined(BOOST_NO_INTRINSIC_INT64_T) - virtual void load(boost::int64_t & t) = 0; - virtual void load(boost::uint64_t & t) = 0; + #if defined(BOOST_HAS_LONG_LONG) + virtual void load(boost::long_long_type & t) = 0; + virtual void load(boost::ulong_long_type & t) = 0; + #elif defined(BOOST_HAS_MS_INT64) + virtual void load(__int64 & t) = 0; + virtual void load(unsigned __int64 & t) = 0; #endif + virtual void load(float & t) = 0; virtual void load(double & t) = 0; @@ -141,7 +125,7 @@ protected: virtual ~polymorphic_iarchive_impl(){}; public: // utility function implemented by all legal archives - virtual void set_library_version(unsigned int archive_library_version) = 0; + virtual void set_library_version(version_type archive_library_version) = 0; virtual unsigned int get_library_version() const = 0; virtual unsigned int get_flags() const = 0; virtual void delete_created_pointers() = 0; @@ -159,7 +143,10 @@ public: ) = 0; virtual const detail::basic_pointer_iserializer * load_pointer( void * & t, - const detail::basic_pointer_iserializer * bpis_ptr + const detail::basic_pointer_iserializer * bpis_ptr, + const detail::basic_pointer_iserializer * (*finder)( + const boost::serialization::extended_type_info & type + ) ) = 0; }; diff --git a/deal.II/contrib/boost/include/boost/archive/polymorphic_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/polymorphic_oarchive.hpp index 19aedf5f44..69f7a95ced 100644 --- a/deal.II/contrib/boost/include/boost/archive/polymorphic_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/polymorphic_oarchive.hpp @@ -37,26 +37,6 @@ namespace std{ #include #include // must be the last header -// determine if its necessary to handle (u)int64_t specifically -// i.e. that its not a synonym for (unsigned) long -// if there is no 64 bit int or if its the same as a long -// we shouldn't define separate functions for int64 data types. -#if defined(BOOST_NO_INT64_T) - #define BOOST_NO_INTRINSIC_INT64_T -#else - #if defined(ULLONG_MAX) - #if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1 - #define BOOST_NO_INTRINSIC_INT64_T - #endif - #elif defined(ULONG_MAX) - #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1 - #define BOOST_NO_INTRINSIC_INT64_T - #endif - #else - #define BOOST_NO_INTRINSIC_INT64_T - #endif -#endif - namespace boost { template class shared_ptr; @@ -97,10 +77,15 @@ public: virtual void save(const unsigned int t) = 0; virtual void save(const long t) = 0; virtual void save(const unsigned long t) = 0; - #if !defined(BOOST_NO_INTRINSIC_INT64_T) - virtual void save(const boost::int64_t t) = 0; - virtual void save(const boost::uint64_t t) = 0; + + #if defined(BOOST_HAS_LONG_LONG) + virtual void save(const boost::long_long_type t) = 0; + virtual void save(const boost::ulong_long_type t) = 0; + #elif defined(BOOST_HAS_MS_INT64) + virtual void save(const __int64 t) = 0; + virtual void save(const unsigned __int64 t) = 0; #endif + virtual void save(const float t) = 0; virtual void save(const double t) = 0; diff --git a/deal.II/contrib/boost/include/boost/archive/polymorphic_text_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/polymorphic_text_iarchive.hpp index 9dbc6c471d..931a9287c7 100644 --- a/deal.II/contrib/boost/include/boost/archive/polymorphic_text_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/polymorphic_text_iarchive.hpp @@ -20,6 +20,11 @@ #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -36,6 +41,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE( boost::archive::polymorphic_text_iarchive diff --git a/deal.II/contrib/boost/include/boost/archive/polymorphic_text_wiarchive.hpp b/deal.II/contrib/boost/include/boost/archive/polymorphic_text_wiarchive.hpp index a04283ac3b..4df3d47351 100644 --- a/deal.II/contrib/boost/include/boost/archive/polymorphic_text_wiarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/polymorphic_text_wiarchive.hpp @@ -24,6 +24,11 @@ #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -40,6 +45,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE( boost::archive::polymorphic_text_wiarchive diff --git a/deal.II/contrib/boost/include/boost/archive/polymorphic_xml_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/polymorphic_xml_iarchive.hpp index bcd7254c72..feb0b99bc2 100644 --- a/deal.II/contrib/boost/include/boost/archive/polymorphic_xml_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/polymorphic_xml_iarchive.hpp @@ -20,6 +20,11 @@ #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -36,6 +41,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE( boost::archive::polymorphic_xml_iarchive diff --git a/deal.II/contrib/boost/include/boost/archive/shared_ptr_helper.hpp b/deal.II/contrib/boost/include/boost/archive/shared_ptr_helper.hpp index b54c654437..a1e252aa2f 100644 --- a/deal.II/contrib/boost/include/boost/archive/shared_ptr_helper.hpp +++ b/deal.II/contrib/boost/include/boost/archive/shared_ptr_helper.hpp @@ -7,7 +7,7 @@ #endif /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// shared_ptr_helper.hpp: serialization for boost shared pointer +// shared_ptr_helper.hpp: serialization for boost shared pointern // (C) Copyright 2004-2009 Robert Ramey, Martin Ecker and Takatoshi Kondo // Use, modification and distribution is subject to the Boost Software @@ -16,7 +16,7 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include +#include #include #include #include // NULL @@ -32,7 +32,7 @@ #include #include -#include // must be the last header +#include // must be the last headern namespace boost_132 { template class shared_ptr; @@ -55,9 +55,17 @@ namespace detail { // a common class for holding various types of shared pointers class shared_ptr_helper { - typedef std::map< - void *, - boost::shared_ptr + struct collection_type_compare { + bool operator()( + const shared_ptr &lhs, + const shared_ptr &rhs + )const{ + return lhs.get() < rhs.get(); + } + }; + typedef std::set< + boost::shared_ptr, + collection_type_compare > collection_type; typedef collection_type::const_iterator iterator_type; // list of shared_pointers create accessable by raw pointer. This @@ -71,6 +79,16 @@ class shared_ptr_helper { void operator()(void const *) const {} }; + struct void_deleter { + const boost::serialization::extended_type_info * m_eti; + void_deleter(const boost::serialization::extended_type_info *eti) : + m_eti(eti) + {} + void operator()(void *vp) const { + m_eti->destroy(vp); + } + }; + #ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS public: #else @@ -91,24 +109,26 @@ public: // new system which is disjoint from this set. This is implemented // by a change in load_construct_data below. It makes this file suitable // only for loading pointers into a 1.33 or later boost system. - std::list > * m_pointers_132; + std::list > * m_pointers_132; // #endif - typedef std::pair result_type; - // returns pointer to object and an indicator whether this is a // new entry (true) or a previous one (false) - BOOST_ARCHIVE_DECL(result_type) get_od( - void * od, - const boost::serialization::extended_type_info * true_type, - const boost::serialization::extended_type_info * this_type + BOOST_ARCHIVE_DECL(shared_ptr) + get_od( + const void * od, + const boost::serialization::extended_type_info * true_type, + const boost::serialization::extended_type_info * this_type ); + BOOST_ARCHIVE_DECL(void) + append(const boost::shared_ptr &); + template struct non_polymorphic { static const boost::serialization::extended_type_info * get_object_identifier(T & t){ - return boost::serialization::singleton< + return & boost::serialization::singleton< BOOST_DEDUCED_TYPENAME boost::serialization::type_info_implementation::type >::get_const_instance(); @@ -136,7 +156,7 @@ public: ::get_const_instance(); // get pointer to the most derived object. This is effectively - // the object identifer + // the object identifern typedef BOOST_DEDUCED_TYPENAME mpl::eval_if< is_polymorphic, mpl::identity >, @@ -146,7 +166,7 @@ public: const boost::serialization::extended_type_info * true_type = type::get_object_identifier(*t); - // note:if this exception is thrown, be sure that derived pointer + // note:if this exception is thrown, be sure that derived pointern // is either registered or exported. if(NULL == true_type) boost::serialization::throw_exception( @@ -155,21 +175,33 @@ public: this_type->get_debug_info() ) ); - result_type r = + shared_ptr r = get_od( - t, + static_cast(t), true_type, this_type ); - s = shared_ptr( - r.first->second, - static_cast(r.second) - ); + if(!r){ + s.reset(t); + const void * od = void_downcast( + *true_type, + *this_type, + static_cast(t) + ); + shared_ptr sp(s, od); + append(sp); + } + else{ + s = shared_ptr( + r, + static_cast(r.get()) + ); + } } // #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP BOOST_ARCHIVE_DECL(void) - append(const boost_132::shared_ptr & t); + append(const boost_132::shared_ptr & t); // #endif public: BOOST_ARCHIVE_DECL(BOOST_PP_EMPTY()) diff --git a/deal.II/contrib/boost/include/boost/archive/text_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/text_iarchive.hpp index 3b1a99d147..1a6b757718 100644 --- a/deal.II/contrib/boost/include/boost/archive/text_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/text_iarchive.hpp @@ -26,6 +26,11 @@ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -94,6 +99,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas // note special treatment of shared_ptr. This type needs a special @@ -102,6 +111,11 @@ public: // special esteem in the boost library - we included it here by default. #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -123,4 +137,8 @@ public: // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_iarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_TEXT_IARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/text_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/text_oarchive.hpp index 5268752ec0..a01f29bbf1 100644 --- a/deal.II/contrib/boost/include/boost/archive/text_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/text_oarchive.hpp @@ -33,6 +33,11 @@ namespace std{ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -82,7 +87,6 @@ class text_oarchive : public text_oarchive_impl { public: - text_oarchive(std::ostream & os_, unsigned int flags = 0) : // note: added _ to suppress useless gcc warning text_oarchive_impl(os_, flags) @@ -98,6 +102,10 @@ typedef text_oarchive naked_text_oarchive; // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_oarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_TEXT_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/text_wiarchive.hpp b/deal.II/contrib/boost/include/boost/archive/text_wiarchive.hpp index 82d9a71a4c..d5d7171471 100644 --- a/deal.II/contrib/boost/include/boost/archive/text_wiarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/text_wiarchive.hpp @@ -30,6 +30,11 @@ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -91,6 +96,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas // note special treatment of shared_ptr. This type needs a special @@ -99,6 +108,11 @@ public: // special esteem in the boost library - we included it here by default. #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -119,5 +133,9 @@ public: // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_wiarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_NO_STD_WSTREAMBUF #endif // BOOST_ARCHIVE_TEXT_WIARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/text_woarchive.hpp b/deal.II/contrib/boost/include/boost/archive/text_woarchive.hpp index 79d374216e..ff9b4c8854 100644 --- a/deal.II/contrib/boost/include/boost/archive/text_woarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/text_woarchive.hpp @@ -38,6 +38,11 @@ namespace std{ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -83,7 +88,7 @@ protected: } public: void save_binary(const void *address, std::size_t count){ - put(L'\n'); + put(static_cast('\n')); this->end_preamble(); #if ! defined(__MWERKS__) this->basic_text_oprimitive::save_binary( @@ -93,7 +98,7 @@ public: address, count ); - put(L'\n'); + put(static_cast('\n')); this->delimiter = this->none; } @@ -123,6 +128,10 @@ typedef text_woarchive naked_text_woarchive; // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::text_woarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_NO_STD_WSTREAMBUF diff --git a/deal.II/contrib/boost/include/boost/archive/xml_iarchive.hpp b/deal.II/contrib/boost/include/boost/archive/xml_iarchive.hpp index a3bc9f5587..c697e849ce 100644 --- a/deal.II/contrib/boost/include/boost/archive/xml_iarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/xml_iarchive.hpp @@ -26,6 +26,11 @@ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -102,6 +107,10 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas // note special treatment of shared_ptr. This type needs a special @@ -110,6 +119,11 @@ public: // special esteem in the boost library - we included it here by default. #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -130,4 +144,8 @@ public: // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_iarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_ARCHIVE_XML_IARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/xml_oarchive.hpp b/deal.II/contrib/boost/include/boost/archive/xml_oarchive.hpp index 790b7398a8..3d9f20db4b 100644 --- a/deal.II/contrib/boost/include/boost/archive/xml_oarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/xml_oarchive.hpp @@ -33,6 +33,11 @@ namespace std{ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -110,6 +115,10 @@ typedef xml_oarchive naked_xml_oarchive; // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_oarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_ARCHIVE_XML_OARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/xml_wiarchive.hpp b/deal.II/contrib/boost/include/boost/archive/xml_wiarchive.hpp index 3675741241..0e2ee29d66 100644 --- a/deal.II/contrib/boost/include/boost/archive/xml_wiarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/xml_wiarchive.hpp @@ -31,6 +31,11 @@ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -106,6 +111,11 @@ public: } // namespace archive } // namespace boost +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + #include // pops abi_suffix.hpp pragmas // note special treatment of shared_ptr. This type needs a special @@ -114,6 +124,11 @@ public: // special esteem in the boost library - we included it here by default. #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -134,5 +149,9 @@ public: // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_wiarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_NO_STD_WSTREAMBUF #endif // BOOST_ARCHIVE_XML_WIARCHIVE_HPP diff --git a/deal.II/contrib/boost/include/boost/archive/xml_woarchive.hpp b/deal.II/contrib/boost/include/boost/archive/xml_woarchive.hpp index e396143c9e..fdcf8c72bb 100644 --- a/deal.II/contrib/boost/include/boost/archive/xml_woarchive.hpp +++ b/deal.II/contrib/boost/include/boost/archive/xml_woarchive.hpp @@ -37,6 +37,11 @@ namespace std{ #include // must be the last header +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace archive { @@ -124,6 +129,10 @@ typedef xml_woarchive naked_xml_woarchive; // required by export BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::archive::xml_woarchive) +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #include // pops abi_suffix.hpp pragmas #endif // BOOST_NO_STD_WSTREAMBUF diff --git a/deal.II/contrib/boost/include/boost/array.hpp b/deal.II/contrib/boost/include/boost/array.hpp index 8ef73c4250..649646991b 100644 --- a/deal.II/contrib/boost/include/boost/array.hpp +++ b/deal.II/contrib/boost/include/boost/array.hpp @@ -13,6 +13,10 @@ * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * + * 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group. + * See or Trac issue #3168 + * Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow) + * 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow) * 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis) * 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries. * 05 Aug 2001 - minor update (Nico Josuttis) @@ -24,6 +28,15 @@ #ifndef BOOST_ARRAY_HPP #define BOOST_ARRAY_HPP +#include + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +# pragma warning(push) +# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe +# pragma warning(disable:4510) // boost::array' : default constructor could not be generated +# pragma warning(disable:4610) // warning C4610: class 'boost::array' can never be instantiated - user defined constructor required +#endif + #include #include #include @@ -71,6 +84,11 @@ namespace boost { reference, iterator, reference> > reverse_iterator; typedef std::reverse_iterator > const_reverse_iterator; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; #else // workaround for broken reverse_iterator implementations typedef std::reverse_iterator reverse_iterator; @@ -151,7 +169,8 @@ namespace boost { } // assign one value to all elements - void assign (const T& value) + void assign (const T& value) { fill ( value ); } // A synonym for fill + void fill (const T& value) { std::fill_n(begin(),size(),value); } @@ -159,7 +178,8 @@ namespace boost { // check range (may be private because it is static) static void rangecheck (size_type i) { if (i >= size()) { - throw std::out_of_range("array<>: index out of range"); + std::out_of_range e("array<>: index out of range"); + boost::throw_exception(e); } } @@ -195,6 +215,11 @@ namespace boost { reference, iterator, reference> > reverse_iterator; typedef std::reverse_iterator > const_reverse_iterator; +#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC) + typedef std::reverse_iterator reverse_iterator; + typedef std::reverse_iterator const_reverse_iterator; #else // workaround for broken reverse_iterator implementations typedef std::reverse_iterator reverse_iterator; @@ -269,12 +294,14 @@ namespace boost { } // assign one value to all elements - void assign (const T& ) { } - + void assign (const T& value) { fill ( value ); } + void fill (const T& ) {} + // check range (may be private because it is static) static reference failed_rangecheck () { std::out_of_range e("attempt to access element of an empty array"); boost::throw_exception(e); +#if defined(BOOST_NO_EXCEPTIONS) || !defined(BOOST_MSVC) // // We need to return something here to keep // some compilers happy: however we will never @@ -282,6 +309,7 @@ namespace boost { // static T placeholder; return placeholder; +#endif } }; #endif @@ -320,4 +348,9 @@ namespace boost { } /* namespace boost */ + +#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) +# pragma warning(pop) +#endif + #endif /*BOOST_ARRAY_HPP*/ diff --git a/deal.II/contrib/boost/include/boost/asio.hpp b/deal.II/contrib/boost/include/boost/asio.hpp index 5d8b43b299..f94e0d657b 100644 --- a/deal.II/contrib/boost/include/boost/asio.hpp +++ b/deal.II/contrib/boost/include/boost/asio.hpp @@ -2,7 +2,7 @@ // asio.hpp // ~~~~~~~~ // -// Copyright (c) 2003-2008 Christopher M. Kohlhoff (chris at kohlhoff dot com) +// Copyright (c) 2003-2010 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) diff --git a/deal.II/contrib/boost/include/boost/bind/bind.hpp b/deal.II/contrib/boost/include/boost/bind/bind.hpp index 1e5c9e0324..a63d2a026b 100644 --- a/deal.II/contrib/boost/include/boost/bind/bind.hpp +++ b/deal.II/contrib/boost/include/boost/bind/bind.hpp @@ -207,6 +207,13 @@ public: } }; +#ifdef BOOST_MSVC +// MSVC is bright enough to realise that the parameter rhs +// in operator==may be unused for some template argument types: +#pragma warning(push) +#pragma warning(disable:4100) +#endif + template< class A1 > class list1: private storage1< A1 > { private: @@ -846,6 +853,10 @@ public: } }; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + // bind_t #ifndef BOOST_NO_VOID_RETURNS @@ -1629,7 +1640,7 @@ template _bi::bind_t< R, _mfi::dm, typename _bi::list_av_1::type > @@ -1654,7 +1665,14 @@ template< class M, class T > struct add_cref< M T::*, 0 > template< class M, class T > struct add_cref< M T::*, 1 > { +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4180) +#endif typedef M const & type; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif }; template< class R, class T > struct add_cref< R (T::*) (), 1 > diff --git a/deal.II/contrib/boost/include/boost/bind/mem_fn_template.hpp b/deal.II/contrib/boost/include/boost/bind/mem_fn_template.hpp index 1db0713b77..b26d585dbc 100644 --- a/deal.II/contrib/boost/include/boost/bind/mem_fn_template.hpp +++ b/deal.II/contrib/boost/include/boost/bind/mem_fn_template.hpp @@ -51,14 +51,16 @@ public: template R operator()(U & u) const { - BOOST_MEM_FN_RETURN call(u, &u); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u) const { - BOOST_MEM_FN_RETURN call(u, &u); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p); } #endif @@ -109,7 +111,8 @@ public: template R operator()(U const & u) const { - BOOST_MEM_FN_RETURN call(u, &u); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p); } R operator()(T const & t) const @@ -164,14 +167,16 @@ public: template R operator()(U & u, A1 a1) const { - BOOST_MEM_FN_RETURN call(u, &u, a1); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u, A1 a1) const { - BOOST_MEM_FN_RETURN call(u, &u, a1); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1); } #endif @@ -223,7 +228,8 @@ public: template R operator()(U const & u, A1 a1) const { - BOOST_MEM_FN_RETURN call(u, &u, a1); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1); } R operator()(T const & t, A1 a1) const @@ -276,14 +282,16 @@ public: template R operator()(U & u, A1 a1, A2 a2) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u, A1 a1, A2 a2) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2); } #endif @@ -333,7 +341,8 @@ public: template R operator()(U const & u, A1 a1, A2 a2) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2); } R operator()(T const & t, A1 a1, A2 a2) const @@ -386,14 +395,16 @@ public: template R operator()(U & u, A1 a1, A2 a2, A3 a3) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u, A1 a1, A2 a2, A3 a3) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); } #endif @@ -443,7 +454,8 @@ public: template R operator()(U const & u, A1 a1, A2 a2, A3 a3) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3); } R operator()(T const & t, A1 a1, A2 a2, A3 a3) const @@ -496,14 +508,16 @@ public: template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); } #endif @@ -553,7 +567,8 @@ public: template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4) const @@ -606,14 +621,16 @@ public: template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); } #endif @@ -663,7 +680,8 @@ public: template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) const @@ -716,14 +734,16 @@ public: template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); } #endif @@ -773,7 +793,8 @@ public: template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) const @@ -826,14 +847,16 @@ public: template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); } #endif @@ -883,7 +906,8 @@ public: template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) const @@ -936,14 +960,16 @@ public: template R operator()(U & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); } #ifdef BOOST_MEM_FN_ENABLE_CONST_OVERLOADS template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); } #endif @@ -998,7 +1024,8 @@ public: template R operator()(U const & u, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const { - BOOST_MEM_FN_RETURN call(u, &u, a1, a2, a3, a4, a5, a6, a7, a8); + U const * p = 0; + BOOST_MEM_FN_RETURN call(u, p, a1, a2, a3, a4, a5, a6, a7, a8); } R operator()(T const & t, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) const diff --git a/deal.II/contrib/boost/include/boost/concept/detail/has_constraints.hpp b/deal.II/contrib/boost/include/boost/concept/detail/has_constraints.hpp index 3112b55514..9191181d9e 100644 --- a/deal.II/contrib/boost/include/boost/concept/detail/has_constraints.hpp +++ b/deal.II/contrib/boost/include/boost/concept/detail/has_constraints.hpp @@ -19,7 +19,7 @@ namespace detail template struct wrap_constraints {}; -#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) +#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) || defined(__CUDACC__) // Work around the following bogus error in Sun Studio 11, by // turning off the has_constraints function entirely: // Error: complex expression not allowed in dependent template diff --git a/deal.II/contrib/boost/include/boost/concept_check.hpp b/deal.II/contrib/boost/include/boost/concept_check.hpp index 12ec2ad775..7ee3036855 100644 --- a/deal.II/contrib/boost/include/boost/concept_check.hpp +++ b/deal.II/contrib/boost/include/boost/concept_check.hpp @@ -330,7 +330,16 @@ namespace boost { f(arg); } - + +#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \ + && BOOST_WORKAROUND(__GNUC__, > 3))) + // Declare a dummy construktor to make gcc happy. + // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type. + // (warning: non-static reference "const double& boost::UnaryFunction::arg" + // in class without a constructor [-Wuninitialized]) + UnaryFunction(); +#endif + Func f; Arg arg; }; diff --git a/deal.II/contrib/boost/include/boost/config/compiler/borland.hpp b/deal.II/contrib/boost/include/boost/config/compiler/borland.hpp index 91f064c68e..6a7b988d16 100644 --- a/deal.II/contrib/boost/include/boost/config/compiler/borland.hpp +++ b/deal.II/contrib/boost/include/boost/config/compiler/borland.hpp @@ -66,7 +66,6 @@ // Borland C++ Builder 6 and below: #if (__BORLANDC__ <= 0x564) -# define BOOST_NO_INTEGRAL_INT64_T # ifdef NDEBUG // fix broken so that Boost.test works: @@ -121,6 +120,7 @@ #endif // Borland C++ Builder 2008 and below: +# define BOOST_NO_INTEGRAL_INT64_T # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS diff --git a/deal.II/contrib/boost/include/boost/config/compiler/codegear.hpp b/deal.II/contrib/boost/include/boost/config/compiler/codegear.hpp index 3915cd54f9..698624ece2 100644 --- a/deal.II/contrib/boost/include/boost/config/compiler/codegear.hpp +++ b/deal.II/contrib/boost/include/boost/config/compiler/codegear.hpp @@ -19,8 +19,8 @@ #endif // // versions check: -// last known and checked version is 0x610 -#if (__CODEGEARC__ > 0x613) +// last known and checked version is 0x620 +#if (__CODEGEARC__ > 0x620) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else @@ -30,20 +30,24 @@ // CodeGear C++ Builder 2009 #if (__CODEGEARC__ <= 0x613) -# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL +# define BOOST_NO_INTEGRAL_INT64_T # define BOOST_NO_DEPENDENT_NESTED_DERIVATIONS -# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_PRIVATE_IN_AGGREGATE -# define BOOST_NO_TWO_PHASE_NAME_LOOKUP # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE -# define BOOST_NO_USING_TEMPLATE // we shouldn't really need this - but too many things choke // without it, this needs more investigation: # define BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS -# define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type -# define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member # define BOOST_SP_NO_SP_CONVERTIBLE +#endif +// CodeGear C++ Builder 2010 +#if (__CODEGEARC__ <= 0x620) +# define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type +# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL +# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS +# define BOOST_NO_NESTED_FRIENDSHIP // TC1 gives nested classes access rights as any other member +# define BOOST_NO_USING_TEMPLATE +# define BOOST_NO_TWO_PHASE_NAME_LOOKUP // Temporary hack, until specific MPL preprocessed headers are generated # define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS @@ -59,7 +63,6 @@ # endif #endif - // // C++0x macros: // diff --git a/deal.II/contrib/boost/include/boost/config/compiler/gcc.hpp b/deal.II/contrib/boost/include/boost/config/compiler/gcc.hpp index 6cae94cae6..fe2c52ea29 100644 --- a/deal.II/contrib/boost/include/boost/config/compiler/gcc.hpp +++ b/deal.II/contrib/boost/include/boost/config/compiler/gcc.hpp @@ -108,11 +108,8 @@ // #define BOOST_NO_CONSTEXPR #define BOOST_NO_EXTERN_TEMPLATE -#define BOOST_NO_LAMBDAS #define BOOST_NO_NULLPTR -#define BOOST_NO_RAW_LITERALS #define BOOST_NO_TEMPLATE_ALIASES -#define BOOST_NO_UNICODE_LITERALS // C++0x features in 4.3.n and later // @@ -168,6 +165,9 @@ // #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__) # define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS +# define BOOST_NO_LAMBDAS +# define BOOST_NO_RAW_LITERALS +# define BOOST_NO_UNICODE_LITERALS #endif // ConceptGCC compiler: diff --git a/deal.II/contrib/boost/include/boost/config/compiler/nvcc.hpp b/deal.II/contrib/boost/include/boost/config/compiler/nvcc.hpp new file mode 100644 index 0000000000..7d831af834 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/config/compiler/nvcc.hpp @@ -0,0 +1,85 @@ +// (C) Copyright Eric Jourdanneau, Joel Falcou 2010 +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for most recent version. + +// NVIDIA CUDA C++ compiler setup + +#ifndef BOOST_COMPILER +# define BOOST_COMPILER "NVIDIA CUDA C++ Compiler" +#endif + +// NVIDIA Specific support +// BOOST_GPU_ENABLED : Flag a function or a method as being enabled on the host and device +#define BOOST_GPU_ENABLED __host__ __device__ + +// Boost support macro for NVCC +// NVCC Basically behaves like some flavor of MSVC6 + some specific quirks +#define BOOST_NO_INCLASS_MEMBER_INITIALIZATION +#define BOOST_MSVC6_MEMBER_TEMPLATES +#define BOOST_HAS_UNISTD_H +#define BOOST_HAS_STDINT_H +#define BOOST_HAS_SIGACTION +#define BOOST_HAS_SCHED_YIELD +#define BOOST_HAS_PTHREADS +#define BOOST_HAS_PTHREAD_YIELD +#define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE +#define BOOST_HAS_PARTIAL_STD_ALLOCATOR +#define BOOST_HAS_NRVO +#define BOOST_HAS_NL_TYPES_H +#define BOOST_HAS_NANOSLEEP +#define BOOST_HAS_LONG_LONG +#define BOOST_HAS_LOG1P +#define BOOST_HAS_GETTIMEOFDAY +#define BOOST_HAS_EXPM1 +#define BOOST_HAS_DIRENT_H +#define BOOST_HAS_CLOCK_GETTIME +#define BOOST_NO_VARIADIC_TEMPLATES +#define BOOST_NO_UNICODE_LITERALS +#define BOOST_NO_TEMPLATE_ALIASES +#define BOOST_NO_STD_UNORDERED +#define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_RVALUE_REFERENCES +#define BOOST_NO_RAW_LITERALS +#define BOOST_NO_NULLPTR +#define BOOST_NO_LAMBDAS +#define BOOST_NO_INITIALIZER_LISTS +#define BOOST_NO_MS_INT64_NUMERIC_LIMITS +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_EXTERN_TEMPLATE +#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS +#define BOOST_NO_DELETED_FUNCTIONS +#define BOOST_NO_DEFAULTED_FUNCTIONS +#define BOOST_NO_DECLTYPE +#define BOOST_NO_CONSTEXPR +#define BOOST_NO_CONCEPTS +#define BOOST_NO_CHAR32_T +#define BOOST_NO_CHAR16_T +#define BOOST_NO_AUTO_MULTIDECLARATIONS +#define BOOST_NO_AUTO_DECLARATIONS +#define BOOST_NO_0X_HDR_UNORDERED_SET +#define BOOST_NO_0X_HDR_UNORDERED_MAP +#define BOOST_NO_0X_HDR_TYPE_TRAITS +#define BOOST_NO_0X_HDR_TUPLE +#define BOOST_NO_0X_HDR_THREAD +#define BOOST_NO_0X_HDR_SYSTEM_ERROR +#define BOOST_NO_0X_HDR_REGEX +#define BOOST_NO_0X_HDR_RATIO +#define BOOST_NO_0X_HDR_RANDOM +#define BOOST_NO_0X_HDR_MUTEX +#define BOOST_NO_0X_HDR_MEMORY_CONCEPTS +#define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS +#define BOOST_NO_0X_HDR_INITIALIZER_LIST +#define BOOST_NO_0X_HDR_FUTURE +#define BOOST_NO_0X_HDR_FORWARD_LIST +#define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS +#define BOOST_NO_0X_HDR_CONDITION_VARIABLE +#define BOOST_NO_0X_HDR_CONCEPTS +#define BOOST_NO_0X_HDR_CODECVT +#define BOOST_NO_0X_HDR_CHRONO +#define BOOST_NO_0X_HDR_ARRAY + diff --git a/deal.II/contrib/boost/include/boost/config/compiler/pgi.hpp b/deal.II/contrib/boost/include/boost/config/compiler/pgi.hpp index e40553efc0..1c7c84b70c 100644 --- a/deal.II/contrib/boost/include/boost/config/compiler/pgi.hpp +++ b/deal.II/contrib/boost/include/boost/config/compiler/pgi.hpp @@ -16,11 +16,28 @@ // if no threading API is detected. // -#if (__PGIC__ >= 7) +// PGI 10.x doesn't seem to define __PGIC__ + +// versions earlier than 10.x do define __PGIC__ +#if __PGIC__ >= 10 + +// options requested by configure --enable-test +#define BOOST_HAS_PTHREADS +#define BOOST_HAS_NRVO +#define BOOST_HAS_LONG_LONG + +// options --enable-test wants undefined +#undef BOOST_NO_STDC_NAMESPACE +#undef BOOST_NO_EXCEPTION_STD_NAMESPACE +#undef BOOST_DEDUCED_TYPENAME + +#elif __PGIC__ >= 7 #define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL #define BOOST_NO_TWO_PHASE_NAME_LOOKUP #define BOOST_NO_SWPRINTF +#define BOOST_NO_AUTO_MULTIDECLARATIONS +#define BOOST_NO_AUTO_DECLARATIONS #else @@ -32,8 +49,6 @@ // // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T #define BOOST_NO_CONCEPTS diff --git a/deal.II/contrib/boost/include/boost/config/compiler/visualc.hpp b/deal.II/contrib/boost/include/boost/config/compiler/visualc.hpp index fd21f26bab..f8cc1096f7 100644 --- a/deal.II/contrib/boost/include/boost/config/compiler/visualc.hpp +++ b/deal.II/contrib/boost/include/boost/config/compiler/visualc.hpp @@ -125,7 +125,7 @@ #if (_MSC_VER >= 1200) # define BOOST_HAS_MS_INT64 #endif -#if (_MSC_VER >= 1310) && defined(_MSC_EXTENSIONS) +#if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400)) # define BOOST_HAS_LONG_LONG #else # define BOOST_NO_LONG_LONG diff --git a/deal.II/contrib/boost/include/boost/config/platform/symbian.hpp b/deal.II/contrib/boost/include/boost/config/platform/symbian.hpp new file mode 100644 index 0000000000..ad37943127 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/config/platform/symbian.hpp @@ -0,0 +1,94 @@ +// (C) Copyright Yuriy Krasnoschek 2009. +// (C) Copyright John Maddock 2001 - 2003. +// (C) Copyright Jens Maurer 2001 - 2003. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for most recent version. + +// symbian specific config options: + + +#define BOOST_PLATFORM "Symbian" +#define BOOST_SYMBIAN 1 + + +#if defined(__S60_3X__) +// Open C / C++ plugin was introdused in this SDK, earlier versions don't have CRT / STL +# define BOOST_S60_3rd_EDITION_FP2_OR_LATER_SDK +// make sure we have __GLIBC_PREREQ if available at all +# include +// boilerplate code: +# define BOOST_HAS_UNISTD_H +# include +// S60 SDK defines _POSIX_VERSION as POSIX.1 +# ifndef BOOST_HAS_STDINT_H +# define BOOST_HAS_STDINT_H +# endif +# ifndef BOOST_HAS_GETTIMEOFDAY +# define BOOST_HAS_GETTIMEOFDAY +# endif +# ifndef BOOST_HAS_DIRENT_H +# define BOOST_HAS_DIRENT_H +# endif +# ifndef BOOST_HAS_SIGACTION +# define BOOST_HAS_SIGACTION +# endif +# ifndef BOOST_HAS_PTHREADS +# define BOOST_HAS_PTHREADS +# endif +# ifndef BOOST_HAS_NANOSLEEP +# define BOOST_HAS_NANOSLEEP +# endif +# ifndef BOOST_HAS_SCHED_YIELD +# define BOOST_HAS_SCHED_YIELD +# endif +# ifndef BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE +# define BOOST_HAS_PTHREAD_MUTEXATTR_SETTYPE +# endif +# ifndef BOOST_HAS_LOG1P +# define BOOST_HAS_LOG1P +# endif +# ifndef BOOST_HAS_EXPM1 +# define BOOST_HAS_EXPM1 +# endif +# ifndef BOOST_POSIX_API +# define BOOST_POSIX_API +# endif +// endianess support +# include +// Symbian SDK provides _BYTE_ORDER instead of __BYTE_ORDER +# ifndef __LITTLE_ENDIAN +# ifdef _LITTLE_ENDIAN +# define __LITTLE_ENDIAN _LITTLE_ENDIAN +# else +# define __LITTLE_ENDIAN 1234 +# endif +# endif +# ifndef __BIG_ENDIAN +# ifdef _BIG_ENDIAN +# define __BIG_ENDIAN _BIG_ENDIAN +# else +# define __BIG_ENDIAN 4321 +# endif +# endif +# ifndef __BYTE_ORDER +# define __BYTE_ORDER __LITTLE_ENDIAN // Symbian is LE +# endif +// Known limitations +# define BOOST_ASIO_DISABLE_SERIAL_PORT +# define BOOST_DATE_TIME_NO_LOCALE +# define BOOST_NO_STD_WSTRING +# define BOOST_EXCEPTION_DISABLE +# define BOOST_NO_EXCEPTIONS + +#else // TODO: More platform support e.g. UIQ +# error "Unsuppoted Symbian SDK" +#endif + +#if defined(__WINSCW__) && !defined(BOOST_DISABLE_WIN32) +# define BOOST_DISABLE_WIN32 // winscw defines WIN32 macro +#endif + + diff --git a/deal.II/contrib/boost/include/boost/config/select_compiler_config.hpp b/deal.II/contrib/boost/include/boost/config/select_compiler_config.hpp index 9141cd6376..792963e2d8 100644 --- a/deal.II/contrib/boost/include/boost/config/select_compiler_config.hpp +++ b/deal.II/contrib/boost/include/boost/config/select_compiler_config.hpp @@ -31,6 +31,7 @@ # define BOOST_CXX_IBMCPP 0 # define BOOST_CXX_MSVC 0 # define BOOST_CXX_PGI 0 +# define BOOST_CXX_NVCC 0 // locate which compiler we are using and define @@ -40,6 +41,10 @@ // GCC-XML emulates other compilers, it has to appear first here! # define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc_xml.hpp" +#elif defined __CUDACC__ +// NVIDIA CUDA C++ compiler for GPU +# define BOOST_COMPILER_CONFIG "boost/config/compiler/nvcc.hpp" + #elif defined __COMO__ // Comeau C++ # define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp" diff --git a/deal.II/contrib/boost/include/boost/config/select_platform_config.hpp b/deal.II/contrib/boost/include/boost/config/select_platform_config.hpp index 615bb064ff..8606e12edf 100644 --- a/deal.II/contrib/boost/include/boost/config/select_platform_config.hpp +++ b/deal.II/contrib/boost/include/boost/config/select_platform_config.hpp @@ -65,6 +65,10 @@ // vxWorks: # define BOOST_PLATFORM_CONFIG "boost/config/platform/vxworks.hpp" +#elif defined(__SYMBIAN32__) +// Symbian: +# define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp" + #else # if defined(unix) \ diff --git a/deal.II/contrib/boost/include/boost/config/suffix.hpp b/deal.II/contrib/boost/include/boost/config/suffix.hpp index fa44986946..9e4d0788c1 100644 --- a/deal.II/contrib/boost/include/boost/config/suffix.hpp +++ b/deal.II/contrib/boost/include/boost/config/suffix.hpp @@ -8,7 +8,7 @@ // Copyright (c) 2002-2003 David Abrahams // Copyright (c) 2003 Gennaro Prota // Copyright (c) 2003 Eric Friedman -// +// Copyright (c) 2010 Eric Jourdanneau, Joel Falcou // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -596,6 +596,11 @@ namespace boost{ # endif # endif +// +// Set some default values GPU support +// +# ifndef BOOST_GPU_ENABLED +# define BOOST_GPU_ENABLED +# endif #endif - diff --git a/deal.II/contrib/boost/include/boost/cstdint.hpp b/deal.II/contrib/boost/include/boost/cstdint.hpp index d55a4840b9..47e6a160c6 100644 --- a/deal.II/contrib/boost/include/boost/cstdint.hpp +++ b/deal.II/contrib/boost/include/boost/cstdint.hpp @@ -23,10 +23,25 @@ #ifndef BOOST_CSTDINT_HPP #define BOOST_CSTDINT_HPP -#include +// +// Since we always define the INT#_C macros as per C++0x, +// define __STDC_CONSTANT_MACROS so that does the right +// thing if possible, and so that the user knows that the macros +// are actually defined as per C99. +// +#ifndef __STDC_CONSTANT_MACROS +# define __STDC_CONSTANT_MACROS +#endif +#include -#ifdef BOOST_HAS_STDINT_H +// +// Note that GLIBC is a bit inconsistent about whether int64_t is defined or not +// depending upon what headers happen to have been included first... +// so we disable use of stdint.h when GLIBC does not define __GLIBC_HAVE_LONG_LONG. +// See https://svn.boost.org/trac/boost/ticket/3548 and http://sources.redhat.com/bugzilla/show_bug.cgi?id=10990 +// +#if defined(BOOST_HAS_STDINT_H) && (!defined(__GLIBC__) || defined(__GLIBC_HAVE_LONG_LONG)) // The following #include is an implementation artifact; not part of interface. # ifdef __hpux @@ -220,6 +235,15 @@ namespace boost typedef unsigned short uint_least16_t; typedef unsigned short uint_fast16_t; # endif +# elif (USHRT_MAX == 0xffffffff) && defined(__MTA__) + // On MTA / XMT short is 32 bits unless the -short16 compiler flag is specified + // MTA / XMT does support the following non-standard integer types + typedef __short16 int16_t; + typedef __short16 int_least16_t; + typedef __short16 int_fast16_t; + typedef unsigned __short16 uint16_t; + typedef unsigned __short16 uint_least16_t; + typedef unsigned __short16 uint_fast16_t; # elif (USHRT_MAX == 0xffffffff) && defined(CRAY) // no 16-bit types on Cray: typedef short int_least16_t; @@ -246,6 +270,14 @@ namespace boost typedef unsigned int uint32_t; typedef unsigned int uint_least32_t; typedef unsigned int uint_fast32_t; +# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) + // Integers are 64 bits on the MTA / XMT + typedef __int32 int32_t; + typedef __int32 int_least32_t; + typedef __int32 int_fast32_t; + typedef unsigned __int32 uint32_t; + typedef unsigned __int32 uint_least32_t; + typedef unsigned __int32 uint_fast32_t; # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif @@ -326,19 +358,16 @@ namespace boost Macro definition section: -Define various INTXX_C macros only if -__STDC_CONSTANT_MACROS is defined. - -Undefine the macros if __STDC_CONSTANT_MACROS is -not defined and the macros are (cf ). - Added 23rd September 2000 (John Maddock). Modified 11th September 2001 to be excluded when BOOST_HAS_STDINT_H is defined (John Maddock). +Modified 11th Dec 2009 to always define the +INT#_C macros if they're not already defined (John Maddock). ******************************************************/ -#if defined(__STDC_CONSTANT_MACROS) && !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(BOOST_HAS_STDINT_H) +#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(INT8_C) +#include # define BOOST__STDC_CONSTANT_MACROS_DEFINED # if defined(BOOST_HAS_MS_INT64) // @@ -390,27 +419,40 @@ BOOST_HAS_STDINT_H is defined (John Maddock). // 64-bit types + intmax_t and uintmax_t ----------------------------------// # if defined(BOOST_HAS_LONG_LONG) && \ - (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX)) + (defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX)) # if defined(__hpux) - // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions -# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615U) || \ - (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615U) || \ - (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615U) - + // HP-UX's value of ULONG_LONG_MAX is unusable in preprocessor expressions +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# elif (defined(ULLONG_MAX) && ULLONG_MAX == 18446744073709551615ULL) || \ + (defined(ULONG_LONG_MAX) && ULONG_LONG_MAX == 18446744073709551615ULL) || \ + (defined(ULONGLONG_MAX) && ULONGLONG_MAX == 18446744073709551615ULL) || \ + (defined(_LLONG_MAX) && _LLONG_MAX == 18446744073709551615ULL) + +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif -# define INT64_C(value) value##LL -# define UINT64_C(value) value##uLL # elif ULONG_MAX != 0xffffffff -# if ULONG_MAX == 18446744073709551615 // 2**64 - 1 +# if ULONG_MAX == 18446744073709551615U // 2**64 - 1 # define INT64_C(value) value##L # define UINT64_C(value) value##uL # else # error defaults not correct; you must hand modify boost/cstdint.hpp # endif +# elif defined(BOOST_HAS_LONG_LONG) + // Usual macros not defined, work things out for ourselves: +# if(~0uLL == 18446744073709551615ULL) +# define INT64_C(value) value##LL +# define UINT64_C(value) value##uLL +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp +# endif +# else +# error defaults not correct; you must hand modify boost/cstdint.hpp # endif # ifdef BOOST_NO_INT64_T @@ -423,23 +465,7 @@ BOOST_HAS_STDINT_H is defined (John Maddock). # endif // Borland/Microsoft specific width suffixes - -#elif defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(__STDC_CONSTANT_MACROS) && !defined(BOOST_HAS_STDINT_H) -// -// undef all the macros: -// -# undef INT8_C -# undef INT16_C -# undef INT32_C -# undef INT64_C -# undef UINT8_C -# undef UINT16_C -# undef UINT32_C -# undef UINT64_C -# undef INTMAX_C -# undef UINTMAX_C - -#endif // __STDC_CONSTANT_MACROS_DEFINED etc. +#endif // INT#_C macros. diff --git a/deal.II/contrib/boost/include/boost/date_time/c_time.hpp b/deal.II/contrib/boost/include/boost/date_time/c_time.hpp index 048a66563c..24ccfe5c37 100644 --- a/deal.II/contrib/boost/include/boost/date_time/c_time.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/c_time.hpp @@ -2,11 +2,11 @@ #define DATE_TIME_C_TIME_HPP___ /* Copyright (c) 2002,2003,2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland, Bart Garst - * $Date: 2009-10-03 06:22:58 -0400 (Sat, 03 Oct 2009) $ + * Author: Jeff Garland, Bart Garst + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ @@ -38,11 +38,11 @@ namespace std { using ::time_t; using ::time; using ::localtime; namespace boost { namespace date_time { //! Provides a uniform interface to some 'ctime' functions - /*! Provides a uniform interface to some ctime functions and - * their '_r' counterparts. The '_r' functions require a pointer to a - * user created std::tm struct whereas the regular functions use a - * staticly created struct and return a pointer to that. These wrapper - * functions require the user to create a std::tm struct and send in a + /*! Provides a uniform interface to some ctime functions and + * their '_r' counterparts. The '_r' functions require a pointer to a + * user created std::tm struct whereas the regular functions use a + * staticly created struct and return a pointer to that. These wrapper + * functions require the user to create a std::tm struct and send in a * pointer to it. This struct may be used to store the resulting time. * The returned pointer may or may not point to this struct, however, * it will point to the result of the corresponding function. @@ -103,5 +103,5 @@ namespace date_time { #endif // BOOST_HAS_THREADS }; }} // namespaces - + #endif // DATE_TIME_C_TIME_HPP___ diff --git a/deal.II/contrib/boost/include/boost/date_time/date.hpp b/deal.II/contrib/boost/include/boost/date_time/date.hpp index 677f6286ad..1056fb6a72 100644 --- a/deal.II/contrib/boost/include/boost/date_time/date.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/date.hpp @@ -2,11 +2,11 @@ #define DATE_TIME_DATE_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -17,28 +17,28 @@ namespace boost { namespace date_time { //!Representation of timepoint at the one day level resolution. - /*! + /*! The date template represents an interface shell for a date class that is based on a year-month-day system such as the gregorian or iso systems. It provides basic operations to enable calculation - and comparisons. + and comparisons. Theory - This date representation fundamentally departs from the C tm struct + This date representation fundamentally departs from the C tm struct approach. The goal for this type is to provide efficient date operations (add, subtract) and storage (minimize space to represent) in a concrete class. Thus, the date uses a count internally to - represent a particular date. The calendar parameter defines + represent a particular date. The calendar parameter defines the policies for converting the the year-month-day and internal counted form here. Applications that need to perform heavy formatting of the same date repeatedly will perform better by using the year-month-day representation. - + Internally the date uses a day number to represent the date. - This is a monotonic time representation. This representation + This is a monotonic time representation. This representation allows for fast comparison as well as simplifying - the creation of writing numeric operations. Essentially, the + the creation of writing numeric operations. Essentially, the internal day number is like adjusted julian day. The adjustment is determined by the Epoch date which is represented as day 1 of the calendar. Day 0 is reserved for negative infinity so that @@ -48,11 +48,11 @@ namespace date_time { day representations. */ - - template - class date : private - boost::less_than_comparable + class date : private + boost::less_than_comparable > { public: @@ -67,26 +67,26 @@ namespace date_time { typedef typename calendar::date_rep_type date_rep_type; typedef typename calendar::date_int_type date_int_type; typedef typename calendar::day_of_week_type day_of_week_type; - date(year_type y, month_type m, day_type d) + date(year_type y, month_type m, day_type d) : days_(calendar::day_number(ymd_type(y, m, d))) {} - date(const ymd_type& ymd) + date(const ymd_type& ymd) : days_(calendar::day_number(ymd)) - {} + {} //let the compiler write copy, assignment, and destructor year_type year() const { - ymd_type ymd = calendar::from_day_number(days_); + ymd_type ymd = calendar::from_day_number(days_); return ymd.year; } month_type month() const { - ymd_type ymd = calendar::from_day_number(days_); + ymd_type ymd = calendar::from_day_number(days_); return ymd.month; } day_type day() const { - ymd_type ymd = calendar::from_day_number(days_); + ymd_type ymd = calendar::from_day_number(days_); return ymd.day; } day_of_week_type day_of_week() const @@ -152,7 +152,7 @@ namespace date_time { return duration_type(val.as_special()); } } - + date_type operator-(const duration_type& dd) const { if(dd.is_special()) @@ -166,7 +166,7 @@ namespace date_time { *this = *this - dd; return date_type(days_); } - date_rep_type day_count() const + date_rep_type day_count() const { return days_; } @@ -181,25 +181,25 @@ namespace date_time { } date_type operator+=(const duration_type& dd) { - *this = *this + dd; + *this = *this + dd; return date_type(days_); } //see reference protected: - /*! This is a private constructor which allows for the creation of new - dates. It is not exposed to users since that would require class + /*! This is a private constructor which allows for the creation of new + dates. It is not exposed to users since that would require class users to understand the inner workings of the date class. */ explicit date(date_int_type days) : days_(days) {}; explicit date(date_rep_type days) : days_(days.as_number()) {}; date_int_type days_; - + }; - + } } // namespace date_time diff --git a/deal.II/contrib/boost/include/boost/date_time/gregorian/conversion.hpp b/deal.II/contrib/boost/include/boost/date_time/gregorian/conversion.hpp index 5b0d0ca533..f35796ee7f 100644 --- a/deal.II/contrib/boost/include/boost/date_time/gregorian/conversion.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/gregorian/conversion.hpp @@ -41,7 +41,7 @@ namespace gregorian { boost::throw_exception(std::out_of_range(s)); } - std::tm datetm = std::tm(); // zero initialization is needed for extension members, like tm_zone + std::tm datetm = {}; // zero initialization is needed for extension members, like tm_zone boost::gregorian::date::ymd_type ymd = d.year_month_day(); datetm.tm_year = ymd.year - 1900; datetm.tm_mon = ymd.month - 1; diff --git a/deal.II/contrib/boost/include/boost/date_time/gregorian/greg_calendar.hpp b/deal.II/contrib/boost/include/boost/date_time/gregorian/greg_calendar.hpp index 48b84604d1..483ead5016 100644 --- a/deal.II/contrib/boost/include/boost/date_time/gregorian/greg_calendar.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/gregorian/greg_calendar.hpp @@ -2,11 +2,11 @@ #define GREGORIAN_GREGORIAN_CALENDAR_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * Author: Jeff Garland + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -18,12 +18,12 @@ namespace boost { namespace gregorian { - + //!An internal date representation that includes infinities, not a date typedef date_time::int_adapter fancy_date_rep; //! Gregorian calendar for this implementation, hard work in the base - class gregorian_calendar : + class gregorian_calendar : public date_time::gregorian_calendar_base { public: //! Type to hold a weekday (eg: Sunday, Monday,...) @@ -35,14 +35,14 @@ namespace gregorian { //! Date rep implements the traits stuff as well typedef fancy_date_rep date_traits_type; - + private: }; } } //namespace gregorian - + #endif - + diff --git a/deal.II/contrib/boost/include/boost/date_time/gregorian/greg_date.hpp b/deal.II/contrib/boost/include/boost/date_time/gregorian/greg_date.hpp index 772c783d9d..ad67c0ce2f 100644 --- a/deal.II/contrib/boost/include/boost/date_time/gregorian/greg_date.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/gregorian/greg_date.hpp @@ -2,11 +2,11 @@ #define GREG_DATE_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * Author: Jeff Garland + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -28,10 +28,10 @@ namespace gregorian { using date_time::min_date_time; //! A date type based on gregorian_calendar - /*! This class is the primary interface for programming with + /*! This class is the primary interface for programming with greogorian dates. The is a lightweight type that can be - freely passed by value. All comparison operators are - supported. + freely passed by value. All comparison operators are + supported. \ingroup date_basics */ class date : public date_time::date @@ -52,7 +52,7 @@ namespace gregorian { {} #endif // DATE_TIME_NO_DEFAULT_CONSTRUCTOR //! Main constructor with year, month, day - date(year_type y, month_type m, day_type d) + date(year_type y, month_type m, day_type d) : date_time::date(y, m, d) { if (gregorian_calendar::end_of_month_day(y, m) < d) { @@ -60,7 +60,7 @@ namespace gregorian { } } //! Constructor from a ymd_type structure - explicit date(const ymd_type& ymd) + explicit date(const ymd_type& ymd) : date_time::date(ymd) {} //! Needed copy constructor @@ -102,13 +102,13 @@ namespace gregorian { date_int_type modjulian_day() const { ymd_type ymd = year_month_day(); - return gregorian_calendar::modjulian_day_number(ymd); + return gregorian_calendar::modjulian_day_number(ymd); } //!Return the iso 8601 week number 1..53 int week_number() const { ymd_type ymd = year_month_day(); - return gregorian_calendar::week_number(ymd); + return gregorian_calendar::week_number(ymd); } //! Return the day number from the calendar date_int_type day_number() const @@ -118,7 +118,7 @@ namespace gregorian { //! Return the last day of the current month date end_of_month() const { - ymd_type ymd = year_month_day(); + ymd_type ymd = year_month_day(); short eom_day = gregorian_calendar::end_of_month_day(ymd.year, ymd.month); return date(ymd.year, ymd.month, eom_day); } @@ -126,7 +126,7 @@ namespace gregorian { private: }; - + } } //namespace gregorian diff --git a/deal.II/contrib/boost/include/boost/date_time/gregorian_calendar.hpp b/deal.II/contrib/boost/include/boost/date_time/gregorian_calendar.hpp index 3df1ed59f9..c27c09e760 100644 --- a/deal.II/contrib/boost/include/boost/date_time/gregorian_calendar.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/gregorian_calendar.hpp @@ -2,11 +2,11 @@ #define DATE_TIME_GREGORIAN_CALENDAR_HPP__ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) - * Author: Jeff Garland - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * Author: Jeff Garland + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ @@ -27,7 +27,7 @@ namespace date_time { template class gregorian_calendar_base { public: - //! define a type a date split into components + //! define a type a date split into components typedef ymd_type_ ymd_type; //! define a type for representing months typedef typename ymd_type::month_type month_type; @@ -58,7 +58,7 @@ namespace date_time { } } //namespace - + #ifndef NO_BOOST_DATE_TIME_INLINE #include "boost/date_time/gregorian_calendar.ipp" #endif @@ -66,5 +66,5 @@ namespace date_time { #endif - + diff --git a/deal.II/contrib/boost/include/boost/date_time/gregorian_calendar.ipp b/deal.II/contrib/boost/include/boost/date_time/gregorian_calendar.ipp index 85a3747d09..a281b45cca 100644 --- a/deal.II/contrib/boost/include/boost/date_time/gregorian_calendar.ipp +++ b/deal.II/contrib/boost/include/boost/date_time/gregorian_calendar.ipp @@ -1,9 +1,9 @@ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #ifndef NO_BOOST_DATE_TIME_INLINE @@ -27,10 +27,10 @@ namespace date_time { //std::cout << year << "-" << month << "-" << day << " is day: " << d << "\n"; return d; } - + //!Return the iso week number for the date /*!Implements the rules associated with the iso 8601 week number. - Basically the rule is that Week 1 of the year is the week that contains + Basically the rule is that Week 1 of the year is the week that contains January 4th or the week that contains the first Thursday in January. Reference for this algorithm is the Calendar FAQ by Claus Tondering, April 2000. */ @@ -42,11 +42,11 @@ namespace date_time { unsigned long juliantoday = julian_day_number(ymd); unsigned long day = (julianbegin + 3) % 7; unsigned long week = (juliantoday + day - julianbegin + 4)/7; - + if ((week >= 1) && (week <= 52)) { return week; } - + if ((week == 53)) { if((day==6) ||(day == 5 && is_leap_year(ymd.year))) { return week; //under these circumstances week == 53. @@ -62,18 +62,18 @@ namespace date_time { week = (juliantoday + day - julianbegin + 4)/7; return week; } - + return week; //not reachable -- well except if day == 5 and is_leap_year != true - + } - + //! Convert a ymd_type into a day number /*! The day number is an absolute number of days since the start of count */ template BOOST_DATE_TIME_INLINE date_int_type_ - gregorian_calendar_base::day_number(const ymd_type& ymd) + gregorian_calendar_base::day_number(const ymd_type& ymd) { unsigned short a = static_cast((14-ymd.month)/12); unsigned short y = static_cast(ymd.year + 4800 - a); @@ -81,14 +81,14 @@ namespace date_time { unsigned long d = ymd.day + ((153*m + 2)/5) + 365*y + (y/4) - (y/100) + (y/400) - 32045; return d; } - + //! Convert a year-month-day into the julian day number /*! Since this implementation uses julian day internally, this is the same as the day_number. */ template BOOST_DATE_TIME_INLINE date_int_type_ - gregorian_calendar_base::julian_day_number(const ymd_type& ymd) + gregorian_calendar_base::julian_day_number(const ymd_type& ymd) { return day_number(ymd); } @@ -100,16 +100,16 @@ namespace date_time { template BOOST_DATE_TIME_INLINE date_int_type_ - gregorian_calendar_base::modjulian_day_number(const ymd_type& ymd) + gregorian_calendar_base::modjulian_day_number(const ymd_type& ymd) { return julian_day_number(ymd)-2400001; //prerounded } - + //! Change a day number into a year-month-day template BOOST_DATE_TIME_INLINE ymd_type_ - gregorian_calendar_base::from_day_number(date_int_type dayNumber) + gregorian_calendar_base::from_day_number(date_int_type dayNumber) { date_int_type a = dayNumber + 32044; date_int_type b = (4*a + 3)/146097; @@ -121,15 +121,15 @@ namespace date_time { unsigned short month = static_cast(m + 3 - 12 * (m/10)); year_type year = static_cast(100*b + d - 4800 + (m/10)); //std::cout << year << "-" << month << "-" << day << "\n"; - + return ymd_type(static_cast(year),month,day); } - + //! Change a day number into a year-month-day template BOOST_DATE_TIME_INLINE ymd_type_ - gregorian_calendar_base::from_julian_day_number(date_int_type dayNumber) + gregorian_calendar_base::from_julian_day_number(date_int_type dayNumber) { date_int_type a = dayNumber + 32044; date_int_type b = (4*a+3)/146097; @@ -141,10 +141,10 @@ namespace date_time { unsigned short month = static_cast(m + 3 - 12 * (m/10)); year_type year = static_cast(100*b + d - 4800 + (m/10)); //std::cout << year << "-" << month << "-" << day << "\n"; - + return ymd_type(year,month,day); } - + //! Change a modified julian day number into a year-month-day template BOOST_DATE_TIME_INLINE @@ -153,7 +153,7 @@ namespace date_time { date_int_type jd = dayNumber + 2400001; //is 2400000.5 prerounded return from_julian_day_number(jd); } - + //! Determine if the provided year is a leap year /*! *@return true if year is a leap year, false otherwise @@ -161,12 +161,12 @@ namespace date_time { template BOOST_DATE_TIME_INLINE bool - gregorian_calendar_base::is_leap_year(year_type year) + gregorian_calendar_base::is_leap_year(year_type year) { //divisible by 4, not if divisible by 100, but true if divisible by 400 return (!(year % 4)) && ((year % 100) || (!(year % 400))); } - + //! Calculate the last day of the month /*! Find the day which is the end of the month given year and month * No error checking is performed. @@ -175,7 +175,7 @@ namespace date_time { BOOST_DATE_TIME_INLINE unsigned short gregorian_calendar_base::end_of_month_day(year_type year, - month_type month) + month_type month) { switch (month) { case 2: @@ -194,12 +194,12 @@ namespace date_time { }; } - + //! Provide the ymd_type specification for the calandar start template BOOST_DATE_TIME_INLINE ymd_type_ - gregorian_calendar_base::epoch() + gregorian_calendar_base::epoch() { return ymd_type(1400,1,1); } @@ -208,7 +208,7 @@ namespace date_time { template BOOST_DATE_TIME_INLINE unsigned short - gregorian_calendar_base::days_in_week() + gregorian_calendar_base::days_in_week() { return 7; } diff --git a/deal.II/contrib/boost/include/boost/date_time/local_time/local_date_time.hpp b/deal.II/contrib/boost/include/boost/date_time/local_time/local_date_time.hpp index 166c4034e1..9c9f62340f 100644 --- a/deal.II/contrib/boost/include/boost/date_time/local_time/local_date_time.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/local_time/local_date_time.hpp @@ -2,10 +2,10 @@ #define LOCAL_TIME_LOCAL_DATE_TIME_HPP__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. - * Subject to the Boost Software License, Version 1.0. + * Subject to the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -42,7 +42,7 @@ namespace local_time { std::logic_error(std::string("is_dst flag does not match resulting dst for time label given: " + msg)) {} }; - //TODO: I think these should be in local_date_time_base and not + //TODO: I think these should be in local_date_time_base and not // necessarily brought into the namespace using date_time::time_is_dst_result; using date_time::is_in_dst; @@ -52,17 +52,17 @@ namespace local_time { //! Representation of "wall-clock" time in a particular time zone /*! Representation of "wall-clock" time in a particular time zone - * Local_date_time_base holds a time value (date and time offset from 00:00) - * along with a time zone. The time value is stored as UTC and conversions - * to wall clock time are made as needed. This approach allows for - * operations between wall-clock times in different time zones, and - * daylight savings time considerations, to be made. Time zones are + * Local_date_time_base holds a time value (date and time offset from 00:00) + * along with a time zone. The time value is stored as UTC and conversions + * to wall clock time are made as needed. This approach allows for + * operations between wall-clock times in different time zones, and + * daylight savings time considerations, to be made. Time zones are * required to be in the form of a boost::shared_ptr. */ - template > - class local_date_time_base : public date_time::base_time { + class local_date_time_base : public date_time::base_time { public: typedef utc_time_ utc_time_type; typedef typename utc_time_type::time_duration_type time_duration_type; @@ -71,41 +71,41 @@ namespace local_time { typedef typename utc_time_type::time_system_type time_system_type; /*! This constructor interprets the passed time as a UTC time. * So, for example, if the passed timezone is UTC-5 then the - * time will be adjusted back 5 hours. The time zone allows for + * time will be adjusted back 5 hours. The time zone allows for * automatic calculation of whether the particular time is adjusted for * daylight savings, etc. * If the time zone shared pointer is null then time stays unadjusted. *@param t A UTC time *@param tz Timezone for to adjust the UTC time to. */ - local_date_time_base(utc_time_type t, - boost::shared_ptr tz) : + local_date_time_base(utc_time_type t, + boost::shared_ptr tz) : date_time::base_time(t), zone_(tz) { // param was already utc so nothing more to do - } + } - /*! This constructs a local time -- the passed time information - * understood to be in the passed tz. The DST flag must be passed - * to indicate whether the time is in daylight savings or not. - * @throws -- time_label_invalid if the time passed does not exist in - * the given locale. The non-existent case occurs typically - * during the shift-back from daylight savings time. When - * the clock is shifted forward a range of times + /*! This constructs a local time -- the passed time information + * understood to be in the passed tz. The DST flag must be passed + * to indicate whether the time is in daylight savings or not. + * @throws -- time_label_invalid if the time passed does not exist in + * the given locale. The non-existent case occurs typically + * during the shift-back from daylight savings time. When + * the clock is shifted forward a range of times * (2 am to 3 am in the US) is skipped and hence is invalid. - * @throws -- dst_not_valid if the DST flag is passed for a period + * @throws -- dst_not_valid if the DST flag is passed for a period * where DST is not active. */ - local_date_time_base(date_type d, + local_date_time_base(date_type d, time_duration_type td, - boost::shared_ptr tz, + boost::shared_ptr tz, bool dst_flag) : //necessary for constr_adj() date_time::base_time(construction_adjustment(utc_time_type(d, td), tz, dst_flag)), zone_(tz) { if(tz != boost::shared_ptr() && tz->has_dst()){ - + // d & td are already local so we use them time_is_dst_result result = check_dst(d, td, tz); bool in_dst = (result == is_in_dst); // less processing than is_dst() @@ -125,23 +125,23 @@ namespace local_time { ss << "flag given: dst=" << dst_flag << ", dst calculated: dst=" << in_dst; boost::throw_exception(dst_not_valid(ss.str())); } - + // everything checks out and conversion to utc already done } - } - + } + //TODO maybe not the right set...Ignore the last 2 for now... - enum DST_CALC_OPTIONS { EXCEPTION_ON_ERROR, NOT_DATE_TIME_ON_ERROR }; + enum DST_CALC_OPTIONS { EXCEPTION_ON_ERROR, NOT_DATE_TIME_ON_ERROR }; //ASSUME_DST_ON_ERROR, ASSUME_NOT_DST_ON_ERROR }; - /*! This constructs a local time -- the passed time information - * understood to be in the passed tz. The DST flag is calculated - * according to the specified rule. + /*! This constructs a local time -- the passed time information + * understood to be in the passed tz. The DST flag is calculated + * according to the specified rule. */ - local_date_time_base(date_type d, + local_date_time_base(date_type d, time_duration_type td, - boost::shared_ptr tz, - DST_CALC_OPTIONS calc_option) : + boost::shared_ptr tz, + DST_CALC_OPTIONS calc_option) : // dummy value - time_ is set in constructor code date_time::base_time(utc_time_type(d,td)), zone_(tz) @@ -168,36 +168,36 @@ namespace local_time { } } else if(result == is_in_dst){ - utc_time_type t = + utc_time_type t = construction_adjustment(utc_time_type(d, td), tz, true); - this->time_ = posix_time::posix_time_system::get_time_rep(t.date(), + this->time_ = posix_time::posix_time_system::get_time_rep(t.date(), t.time_of_day()); } else{ - utc_time_type t = + utc_time_type t = construction_adjustment(utc_time_type(d, td), tz, false); - this->time_ = posix_time::posix_time_system::get_time_rep(t.date(), + this->time_ = posix_time::posix_time_system::get_time_rep(t.date(), t.time_of_day()); } } //! Determines if given time label is in daylight savings for given zone - /*! Determines if given time label is in daylight savings for given zone. - * Takes a date and time_duration representing a local time, along + /*! Determines if given time label is in daylight savings for given zone. + * Takes a date and time_duration representing a local time, along * with time zone, and returns a time_is_dst_result object as result. */ - static time_is_dst_result check_dst(date_type d, + static time_is_dst_result check_dst(date_type d, time_duration_type td, - boost::shared_ptr tz) + boost::shared_ptr tz) { if(tz != boost::shared_ptr() && tz->has_dst()) { typedef typename date_time::dst_calculator dst_calculator; return dst_calculator::local_is_dst( - d, td, - tz->dst_local_start_time(d.year()).date(), - tz->dst_local_start_time(d.year()).time_of_day(), - tz->dst_local_end_time(d.year()).date(), + d, td, + tz->dst_local_start_time(d.year()).date(), + tz->dst_local_start_time(d.year()).time_of_day(), + tz->dst_local_end_time(d.year()).date(), tz->dst_local_end_time(d.year()).time_of_day(), tz->dst_offset() ); @@ -211,7 +211,7 @@ namespace local_time { ~local_date_time_base() {}; //! Copy constructor - local_date_time_base(const local_date_time_base& rhs) : + local_date_time_base(const local_date_time_base& rhs) : date_time::base_time(rhs), zone_(rhs.zone_) {} @@ -224,7 +224,7 @@ namespace local_time { {} //! returns time zone associated with calling instance - boost::shared_ptr zone() const + boost::shared_ptr zone() const { return zone_; } @@ -243,12 +243,12 @@ namespace local_time { return false; case is_in_dst: return true; - case ambiguous: + case ambiguous: if(lt + zone_->dst_offset() < zone_->dst_local_end_time(lt.date().year())) { return true; } break; - case invalid_time_label: + case invalid_time_label: if(lt >= zone_->dst_local_start_time(lt.date().year())) { return true; } @@ -258,12 +258,12 @@ namespace local_time { return false; } //! Returns object's time value as a utc representation - utc_time_type utc_time() const + utc_time_type utc_time() const { return utc_time_type(this->time_); } //! Returns object's time value as a local representation - utc_time_type local_time() const + utc_time_type local_time() const { if(zone_ != boost::shared_ptr()){ utc_time_type lt = this->utc_time() + zone_->base_utc_offset(); @@ -276,7 +276,7 @@ namespace local_time { } //! Returns string in the form "2003-Aug-20 05:00:00 EDT" /*! Returns string in the form "2003-Aug-20 05:00:00 EDT". If - * time_zone is NULL the time zone abbreviation will be "UTC". The time + * time_zone is NULL the time zone abbreviation will be "UTC". The time * zone abbrev will not be included if calling object is a special_value*/ std::string to_string() const { @@ -304,17 +304,17 @@ namespace local_time { } return ss.str(); } - /*! returns a local_date_time_base in the given time zone with the + /*! returns a local_date_time_base in the given time zone with the * optional time_duration added. */ - local_date_time_base local_time_in(boost::shared_ptr new_tz, - time_duration_type td=time_duration_type(0,0,0)) const + local_date_time_base local_time_in(boost::shared_ptr new_tz, + time_duration_type td=time_duration_type(0,0,0)) const { return local_date_time_base(utc_time_type(this->time_) + td, new_tz); } - + //! Returns name of associated time zone or "Coordinated Universal Time". - /*! Optional bool parameter will return time zone as an offset - * (ie "+07:00" extended iso format). Empty string is returned for + /*! Optional bool parameter will return time zone as an offset + * (ie "+07:00" extended iso format). Empty string is returned for * classes that do not use a time_zone */ std::string zone_name(bool as_offset=false) const { @@ -347,8 +347,8 @@ namespace local_time { } } //! Returns abbreviation of associated time zone or "UTC". - /*! Optional bool parameter will return time zone as an offset - * (ie "+0700" iso format). Empty string is returned for classes + /*! Optional bool parameter will return time zone as an offset + * (ie "+0700" iso format). Empty string is returned for classes * that do not use a time_zone */ std::string zone_abbrev(bool as_offset=false) const { @@ -389,7 +389,7 @@ namespace local_time { } return zone_->to_posix_string(); } - + //! Equality comparison operator /*bool operator==(const date_time::base_time& rhs) const { // fails due to rhs.time_ being protected @@ -427,45 +427,45 @@ namespace local_time { return (*this > rhs || *this == rhs); } - //! Local_date_time + date_duration + //! Local_date_time + date_duration local_date_time_base operator+(const date_duration_type& dd) const { return local_date_time_base(time_system_type::add_days(this->time_,dd), zone_); } - //! Local_date_time += date_duration + //! Local_date_time += date_duration local_date_time_base operator+=(const date_duration_type& dd) { this->time_ = time_system_type::add_days(this->time_,dd); return *this; } - //! Local_date_time - date_duration + //! Local_date_time - date_duration local_date_time_base operator-(const date_duration_type& dd) const { return local_date_time_base(time_system_type::subtract_days(this->time_,dd), zone_); } - //! Local_date_time -= date_duration + //! Local_date_time -= date_duration local_date_time_base operator-=(const date_duration_type& dd) { this->time_ = time_system_type::subtract_days(this->time_,dd); return *this; } - //! Local_date_time + time_duration + //! Local_date_time + time_duration local_date_time_base operator+(const time_duration_type& td) const { return local_date_time_base(time_system_type::add_time_duration(this->time_,td), zone_); } - //! Local_date_time += time_duration - local_date_time_base operator+=(const time_duration_type& td) + //! Local_date_time += time_duration + local_date_time_base operator+=(const time_duration_type& td) { this->time_ = time_system_type::add_time_duration(this->time_,td); return *this; } - //! Local_date_time - time_duration + //! Local_date_time - time_duration local_date_time_base operator-(const time_duration_type& td) const { return local_date_time_base(time_system_type::subtract_time_duration(this->time_,td), zone_); } - //! Local_date_time -= time_duration + //! Local_date_time -= time_duration local_date_time_base operator-=(const time_duration_type& td) { this->time_ = time_system_type::subtract_time_duration(this->time_,td); @@ -482,7 +482,7 @@ namespace local_time { /*! Adjust the passed in time to UTC? */ - utc_time_type construction_adjustment(utc_time_type t, + utc_time_type construction_adjustment(utc_time_type t, boost::shared_ptr z, bool dst_flag) { @@ -497,21 +497,21 @@ namespace local_time { /*! Simple formatting code -- todo remove this? */ - std::string zone_as_offset(const time_duration_type& td, + std::string zone_as_offset(const time_duration_type& td, const std::string& separator) const { std::ostringstream ss; if(td.is_negative()) { // a negative duration is represented as "-[h]h:mm" - // we require two digits for the hour. A positive duration + // we require two digits for the hour. A positive duration // with the %H flag will always give two digits ss << "-"; } else { ss << "+"; } - ss << std::setw(2) << std::setfill('0') - << date_time::absolute_value(td.hours()) + ss << std::setw(2) << std::setfill('0') + << date_time::absolute_value(td.hours()) << separator << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.minutes()); diff --git a/deal.II/contrib/boost/include/boost/date_time/local_time/posix_time_zone.hpp b/deal.II/contrib/boost/include/boost/date_time/local_time/posix_time_zone.hpp index 416c95b68b..50483634f2 100644 --- a/deal.II/contrib/boost/include/boost/date_time/local_time/posix_time_zone.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/local_time/posix_time_zone.hpp @@ -1,11 +1,11 @@ #ifndef _DATE_TIME_POSIX_TIME_ZONE__ -#define _DATE_TIME_POSIX_TIME_ZONE__ +#define _DATE_TIME_POSIX_TIME_ZONE__ /* Copyright (c) 2003-2005 CrystalClear Software, Inc. * Subject to the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-10-03 06:04:00 -0400 (Sat, 03 Oct 2009) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -36,13 +36,13 @@ namespace local_time{ bad_adjustment(std::string const& msg = std::string()) : std::out_of_range(std::string("Adjustment out of range: " + msg)) {} }; - + typedef boost::date_time::dst_adjustment_offsets dst_adjustment_offsets; //! A time zone class constructed from a POSIX time zone string /*! A POSIX time zone string takes the form of:
* "std offset dst [offset],start[/time],end[/time]" (w/no spaces) - * 'std' specifies the abbrev of the time zone.
+ * 'std' specifies the abbrev of the time zone.
* 'offset' is the offset from UTC.
* 'dst' specifies the abbrev of the time zone during daylight savings time.
* The second offset is how many hours changed during DST. Default=1
@@ -84,10 +84,10 @@ namespace local_time{ string_type>::iterator tokenizer_iterator_type; //! Construct from a POSIX time zone string - posix_time_zone_base(const string_type& s) : + posix_time_zone_base(const string_type& s) : //zone_names_("std_name","std_abbrev","no-dst","no-dst"), zone_names_(), - has_dst_(false), + has_dst_(false), base_utc_offset_(posix_time::hours(0)), dst_offsets_(posix_time::hours(0),posix_time::hours(0),posix_time::hours(0)), dst_calc_rules_() @@ -107,7 +107,7 @@ namespace local_time{ string_type tmp_str = *it++; calc_rules(tmp_str, *it); } - } + } virtual ~posix_time_zone_base() {}; //!String for the zone when not in daylight savings (eg: EST) virtual string_type std_zone_abbrev()const @@ -121,15 +121,15 @@ namespace local_time{ return zone_names_.dst_zone_abbrev(); } //!String for the zone when not in daylight savings (eg: Eastern Standard Time) - /*! The full STD name is not extracted from the posix time zone string. + /*! The full STD name is not extracted from the posix time zone string. * Therefore, the STD abbreviation is used in it's place */ virtual string_type std_zone_name()const { return zone_names_.std_zone_name(); } //!String for the timezone when in daylight savings (eg: Eastern Daylight Time) - /*! The full DST name is not extracted from the posix time zone string. - * Therefore, the STD abbreviation is used in it's place. For time zones + /*! The full DST name is not extracted from the posix time zone string. + * Therefore, the STD abbreviation is used in it's place. For time zones * that have no DST, an empty string is used */ virtual string_type dst_zone_name()const { @@ -250,7 +250,7 @@ namespace local_time{ while(std::isalpha(*sit)){ ss << *sit++; } - l_std_zone_abbrev = ss.str(); + l_std_zone_abbrev = ss.str(); ss.str(empty_string); // get UTC offset @@ -259,7 +259,7 @@ namespace local_time{ while(sit != obj_end && !std::isalpha(*sit)){ ss << *sit++; } - base_utc_offset_ = date_time::str_from_delimited_time_duration(ss.str()); + base_utc_offset_ = date_time::str_from_delimited_time_duration(ss.str()); ss.str(empty_string); // base offset must be within range of -12 hours to +14 hours @@ -273,12 +273,12 @@ namespace local_time{ // get DST data if given if(sit != obj_end){ has_dst_ = true; - + // get 'dst' name/abbrev while(sit != obj_end && std::isalpha(*sit)){ ss << *sit++; } - l_dst_zone_abbrev = ss.str(); + l_dst_zone_abbrev = ss.str(); ss.str(empty_string); // get DST offset if given @@ -287,7 +287,7 @@ namespace local_time{ while(sit != obj_end && !std::isalpha(*sit)){ ss << *sit++; } - dst_offsets_.dst_adjust_ = date_time::str_from_delimited_time_duration(ss.str()); + dst_offsets_.dst_adjust_ = date_time::str_from_delimited_time_duration(ss.str()); ss.str(empty_string); } else{ // default DST offset @@ -381,12 +381,12 @@ namespace local_time{ #endif char_separator_type sep(sep_chars); tokenizer_type stok(s, sep), etok(e, sep); - + tokenizer_iterator_type it = stok.begin(); sm = lexical_cast(*it++); sw = lexical_cast(*it++); sd = lexical_cast(*it); - + it = etok.begin(); em = lexical_cast(*it++); ew = lexical_cast(*it++); @@ -395,13 +395,13 @@ namespace local_time{ dst_calc_rules_ = shared_ptr( new nth_kday_dst_rule( nth_last_dst_rule::start_rule( - static_cast(sw),sd,sm), + static_cast(sw),sd,sm), nth_last_dst_rule::start_rule( - static_cast(ew),ed,em) + static_cast(ew),ed,em) ) ); } - + //! Julian day. Feb29 is never counted, even in leap years // expects range of 1-365 void julian_no_leap(const string_type& s, const string_type& e){ @@ -423,9 +423,9 @@ namespace local_time{ dst_calc_rules_ = shared_ptr( new partial_date_dst_rule( partial_date_dst_rule::start_rule( - sd, static_cast(sm)), + sd, static_cast(sm)), partial_date_dst_rule::end_rule( - ed, static_cast(em)) + ed, static_cast(em)) ) ); } @@ -460,8 +460,8 @@ namespace local_time{ }; typedef posix_time_zone_base posix_time_zone; - + } } // namespace boost::local_time -#endif // _DATE_TIME_POSIX_TIME_ZONE__ +#endif // _DATE_TIME_POSIX_TIME_ZONE__ diff --git a/deal.II/contrib/boost/include/boost/date_time/posix_time/conversion.hpp b/deal.II/contrib/boost/include/boost/date_time/posix_time/conversion.hpp index 38a3269a93..9cdb864790 100644 --- a/deal.II/contrib/boost/include/boost/date_time/posix_time/conversion.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/posix_time/conversion.hpp @@ -6,7 +6,7 @@ * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -43,7 +43,7 @@ namespace posix_time { //! Convert a time_duration to a tm structure truncating any fractional seconds and zeroing fields for date components inline std::tm to_tm(const boost::posix_time::time_duration& td) { - std::tm timetm = std::tm(); + std::tm timetm = {}; timetm.tm_hour = date_time::absolute_value(td.hours()); timetm.tm_min = date_time::absolute_value(td.minutes()); timetm.tm_sec = date_time::absolute_value(td.seconds()); diff --git a/deal.II/contrib/boost/include/boost/date_time/posix_time/time_formatters.hpp b/deal.II/contrib/boost/include/boost/date_time/posix_time/time_formatters.hpp index 255129276e..466331b0a1 100644 --- a/deal.II/contrib/boost/include/boost/date_time/posix_time/time_formatters.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/posix_time/time_formatters.hpp @@ -2,11 +2,11 @@ #define POSIXTIME_FORMATTERS_HPP___ /* Copyright (c) 2002-2004 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -18,8 +18,8 @@ #include // absolute_value #include -/* NOTE: The "to_*_string" code for older compilers, ones that define - * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in +/* NOTE: The "to_*_string" code for older compilers, ones that define + * BOOST_DATE_TIME_INCLUDE_LIMITED_HEADERS, is located in * formatters_limited.hpp */ @@ -57,27 +57,27 @@ namespace posix_time { if(td.is_negative()) { ss << '-'; } - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.hours()) << ":"; - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.minutes()) << ":"; - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t frac_sec = + boost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] charT buff[32]; _i64toa(frac_sec, buff, 10); #else - time_duration::fractional_seconds_type frac_sec = + time_duration::fractional_seconds_type frac_sec = date_time::absolute_value(td.fractional_seconds()); #endif if (frac_sec != 0) { ss << "." << std::setw(time_duration::num_fractional_digits()) << std::setfill(fill_char) - + // JDG [7/6/02 VC++ compatibility] #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) << buff; @@ -99,7 +99,7 @@ namespace posix_time { // template function called by wrapper functions: // to_*_string(time_duration) & to_*_wstring(time_duration) template - inline std::basic_string to_iso_string_type(time_duration td) + inline std::basic_string to_iso_string_type(time_duration td) { std::basic_ostringstream ss; if(td.is_special()) { @@ -126,27 +126,27 @@ namespace posix_time { if(td.is_negative()) { ss << '-'; } - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.hours()); - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.minutes()); - ss << std::setw(2) << std::setfill(fill_char) + ss << std::setw(2) << std::setfill(fill_char) << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t frac_sec = + boost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] charT buff[32]; _i64toa(frac_sec, buff, 10); #else - time_duration::fractional_seconds_type frac_sec = + time_duration::fractional_seconds_type frac_sec = date_time::absolute_value(td.fractional_seconds()); #endif if (frac_sec != 0) { ss << "." << std::setw(time_duration::num_fractional_digits()) << std::setfill(fill_char) - + // JDG [7/6/02 VC++ compatibility] #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) << buff; @@ -168,7 +168,7 @@ namespace posix_time { /*!\ingroup time_format */ template - inline std::basic_string to_simple_string_type(ptime t) + inline std::basic_string to_simple_string_type(ptime t) { // can't use this w/gcc295, no to_simple_string_type<>(td) available std::basic_string ts = gregorian::to_simple_string_type(t.date());// + " "; @@ -184,10 +184,10 @@ namespace posix_time { return to_simple_string_type(t); } - // function called by wrapper functions to_*_string(time_period) + // function called by wrapper functions to_*_string(time_period) // & to_*_wstring(time_period) template - inline std::basic_string to_simple_string_type(time_period tp) + inline std::basic_string to_simple_string_type(time_period tp) { charT beg = '[', mid = '/', end = ']'; std::basic_string d1(to_simple_string_type(tp.begin())); @@ -201,10 +201,10 @@ namespace posix_time { return to_simple_string_type(tp); } - // function called by wrapper functions to_*_string(time_period) + // function called by wrapper functions to_*_string(time_period) // & to_*_wstring(time_period) template - inline std::basic_string to_iso_string_type(ptime t) + inline std::basic_string to_iso_string_type(ptime t) { std::basic_string ts = gregorian::to_iso_string_type(t.date());// + "T"; if(!t.time_of_day().is_special()) { @@ -223,10 +223,10 @@ namespace posix_time { } - // function called by wrapper functions to_*_string(time_period) + // function called by wrapper functions to_*_string(time_period) // & to_*_wstring(time_period) template - inline std::basic_string to_iso_extended_string_type(ptime t) + inline std::basic_string to_iso_extended_string_type(ptime t) { std::basic_string ts = gregorian::to_iso_extended_string_type(t.date());// + "T"; if(!t.time_of_day().is_special()) { diff --git a/deal.II/contrib/boost/include/boost/date_time/posix_time/time_formatters_limited.hpp b/deal.II/contrib/boost/include/boost/date_time/posix_time/time_formatters_limited.hpp index e4d1a6ef0a..d0e959e915 100644 --- a/deal.II/contrib/boost/include/boost/date_time/posix_time/time_formatters_limited.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/posix_time/time_formatters_limited.hpp @@ -2,11 +2,11 @@ #define POSIXTIME_FORMATTERS_LIMITED_HPP___ /* Copyright (c) 2002,2003 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Jeff Garland, Bart Garst - * $Date: 2009-09-28 14:10:02 -0400 (Mon, 28 Sep 2009) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -16,7 +16,7 @@ #include #include #include // absolute_value - + namespace boost { namespace posix_time { @@ -50,27 +50,27 @@ namespace posix_time { if(td.is_negative()) { ss << '-'; } - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.hours()) << ":"; - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.minutes()) << ":"; - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t frac_sec = + boost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] char buff[32]; _i64toa(frac_sec, buff, 10); #else - time_duration::fractional_seconds_type frac_sec = + time_duration::fractional_seconds_type frac_sec = date_time::absolute_value(td.fractional_seconds()); #endif if (frac_sec != 0) { ss << "." << std::setw(time_duration::num_fractional_digits()) << std::setfill('0') - + // JDG [7/6/02 VC++ compatibility] #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) << buff; @@ -85,9 +85,9 @@ namespace posix_time { //! Time duration in iso format -hhmmss,fffffff Example: 10:09:03,0123456 /*!\ingroup time_format */ - inline - std::string - to_iso_string(time_duration td) + inline + std::string + to_iso_string(time_duration td) { std::ostringstream ss; if(td.is_special()) { @@ -113,27 +113,27 @@ namespace posix_time { if(td.is_negative()) { ss << '-'; } - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.hours()); - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.minutes()); - ss << std::setw(2) << std::setfill('0') + ss << std::setw(2) << std::setfill('0') << date_time::absolute_value(td.seconds()); //TODO the following is totally non-generic, yelling FIXME #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) - boost::int64_t frac_sec = + boost::int64_t frac_sec = date_time::absolute_value(td.fractional_seconds()); // JDG [7/6/02 VC++ compatibility] char buff[32]; _i64toa(frac_sec, buff, 10); #else - time_duration::fractional_seconds_type frac_sec = + time_duration::fractional_seconds_type frac_sec = date_time::absolute_value(td.fractional_seconds()); #endif if (frac_sec != 0) { ss << "." << std::setw(time_duration::num_fractional_digits()) << std::setfill('0') - + // JDG [7/6/02 VC++ compatibility] #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) << buff; @@ -148,9 +148,9 @@ namespace posix_time { //! Time to simple format CCYY-mmm-dd hh:mm:ss.fffffff /*!\ingroup time_format */ - inline - std::string - to_simple_string(ptime t) + inline + std::string + to_simple_string(ptime t) { std::string ts = gregorian::to_simple_string(t.date());// + " "; if(!t.time_of_day().is_special()) { @@ -164,9 +164,9 @@ namespace posix_time { //! Convert to string of form [YYYY-mmm-DD HH:MM::SS.ffffff/YYYY-mmm-DD HH:MM::SS.fffffff] /*!\ingroup time_format */ - inline - std::string - to_simple_string(time_period tp) + inline + std::string + to_simple_string(time_period tp) { std::string d1(to_simple_string(tp.begin())); std::string d2(to_simple_string(tp.last())); @@ -176,8 +176,8 @@ namespace posix_time { //! Convert iso short form YYYYMMDDTHHMMSS where T is the date-time separator /*!\ingroup time_format */ - inline - std::string to_iso_string(ptime t) + inline + std::string to_iso_string(ptime t) { std::string ts = gregorian::to_iso_string(t.date());// + "T"; if(!t.time_of_day().is_special()) { @@ -191,9 +191,9 @@ namespace posix_time { //! Convert to form YYYY-MM-DDTHH:MM:SS where T is the date-time separator /*!\ingroup time_format */ - inline - std::string - to_iso_extended_string(ptime t) + inline + std::string + to_iso_extended_string(ptime t) { std::string ts = gregorian::to_iso_extended_string(t.date());// + "T"; if(!t.time_of_day().is_special()) { diff --git a/deal.II/contrib/boost/include/boost/date_time/time_facet.hpp b/deal.II/contrib/boost/include/boost/date_time/time_facet.hpp index 60398dedb5..3f27f77f4e 100644 --- a/deal.II/contrib/boost/include/boost/date_time/time_facet.hpp +++ b/deal.II/contrib/boost/include/boost/date_time/time_facet.hpp @@ -3,11 +3,11 @@ #define _DATE_TIME_FACET__HPP__ /* Copyright (c) 2004-2005 CrystalClear Software, Inc. - * Use, modification and distribution is subject to the + * Use, modification and distribution is subject to the * Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) * Author: Martin Andrian, Jeff Garland, Bart Garst - * $Date: 2009-10-03 06:04:00 -0400 (Sat, 03 Oct 2009) $ + * $Date: 2010-01-10 14:17:23 -0500 (Sun, 10 Jan 2010) $ */ #include @@ -56,129 +56,129 @@ namespace date_time { static const char_type iso_time_format_specifier[18]; static const char_type iso_time_format_extended_specifier[22]; //default ptime format is YYYY-Mon-DD HH:MM:SS[.fff...][ zzz] - static const char_type default_time_format[23]; + static const char_type default_time_format[23]; // default_time_input_format uses a posix_time_zone_string instead of a time zone abbrev - static const char_type default_time_input_format[24]; + static const char_type default_time_input_format[24]; //default time_duration format is HH:MM:SS[.fff...] static const char_type default_time_duration_format[11]; }; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::fractional_seconds_format[3] = {'%','f'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::fractional_seconds_or_none_format[3] = {'%','F'}; - template - const typename time_formats::char_type - time_formats::seconds_with_fractional_seconds_format[3] = + template + const typename time_formats::char_type + time_formats::seconds_with_fractional_seconds_format[3] = {'%','s'}; template - const typename time_formats::char_type + const typename time_formats::char_type time_formats::seconds_format[3] = {'%','S'}; template - const typename time_formats::char_type + const typename time_formats::char_type time_formats::hours_format[3] = {'%','H'}; template - const typename time_formats::char_type + const typename time_formats::char_type time_formats::unrestricted_hours_format[3] = {'%','O'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type //time_formats::standard_format[5] = {'%','c',' ','%','z'}; time_formats::standard_format[9] = {'%','x',' ','%','X',' ','%','z'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::zone_abbrev_format[3] = {'%','z'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::zone_name_format[3] = {'%','Z'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::zone_iso_format[3] = {'%','q'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::zone_iso_extended_format[3] ={'%','Q'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::posix_zone_string_format[4] ={'%','Z','P'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::duration_seperator[2] = {':'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::negative_sign[2] = {'-'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::positive_sign[2] = {'+'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::duration_sign_negative_only[3] ={'%','-'}; - template - const typename time_formats::char_type + template + const typename time_formats::char_type time_formats::duration_sign_always[3] ={'%','+'}; - template - const typename time_formats::char_type - time_formats::iso_time_format_specifier[18] = - {'%', 'Y', '%', 'm', '%', 'd', 'T', + template + const typename time_formats::char_type + time_formats::iso_time_format_specifier[18] = + {'%', 'Y', '%', 'm', '%', 'd', 'T', '%', 'H', '%', 'M', '%', 'S', '%', 'F', '%','q' }; - template - const typename time_formats::char_type - time_formats::iso_time_format_extended_specifier[22] = - {'%', 'Y', '-', '%', 'm', '-', '%', 'd', ' ', + template + const typename time_formats::char_type + time_formats::iso_time_format_extended_specifier[22] = + {'%', 'Y', '-', '%', 'm', '-', '%', 'd', ' ', '%', 'H', ':', '%', 'M', ':', '%', 'S', '%', 'F','%','Q'}; - template - const typename time_formats::char_type - time_formats::default_time_format[23] = + template + const typename time_formats::char_type + time_formats::default_time_format[23] = {'%','Y','-','%','b','-','%','d',' ', '%','H',':','%','M',':','%','S','%','F',' ','%','z'}; - template - const typename time_formats::char_type - time_formats::default_time_input_format[24] = + template + const typename time_formats::char_type + time_formats::default_time_input_format[24] = {'%','Y','-','%','b','-','%','d',' ', '%','H',':','%','M',':','%','S','%','F',' ','%','Z','P'}; - template - const typename time_formats::char_type - time_formats::default_time_duration_format[11] = + template + const typename time_formats::char_type + time_formats::default_time_duration_format[11] = {'%','O',':','%','M',':','%','S','%','F'}; - /*! Facet used for format-based output of time types + /*! Facet used for format-based output of time types * This class provides for the use of format strings to output times. In addition * to the flags for formatting date elements, the following are the allowed format flags: * - %x %X => default format - enables addition of more flags to default (ie. "%x %X %z") * - %f => fractional seconds ".123456" * - %F => fractional seconds or none: like frac sec but empty if frac sec == 0 - * - %s => seconds w/ fractional sec "02.123" (this is the same as "%S%f) + * - %s => seconds w/ fractional sec "02.123" (this is the same as "%S%f) * - %S => seconds "02" * - %z => abbreviated time zone "EDT" * - %Z => full time zone name "Eastern Daylight Time" */ template > > - class time_facet : + class time_facet : public boost::date_time::date_facet { public: typedef typename time_type::date_type date_type; @@ -211,7 +211,7 @@ namespace date_time { static const char_type* iso_time_format_extended_specifier; //default ptime format is YYYY-Mon-DD HH:MM:SS[.fff...][ zzz] - static const char_type* default_time_format; + static const char_type* default_time_format; //default time_duration format is HH:MM:SS[.fff...] static const char_type* default_time_duration_format; static std::locale::id id; @@ -228,20 +228,20 @@ namespace date_time { //! Construct the facet with an explicitly specified format explicit time_facet(const char_type* a_format, - period_formatter_type period_formatter = period_formatter_type(), - const special_values_formatter_type& special_value_formatter = special_values_formatter_type(), + period_formatter_type period_formatter = period_formatter_type(), + const special_values_formatter_type& special_value_formatter = special_values_formatter_type(), date_gen_formatter_type dg_formatter = date_gen_formatter_type(), - ::size_t a_ref = 0) - : base_type(a_format, + ::size_t a_ref = 0) + : base_type(a_format, period_formatter, - special_value_formatter, - dg_formatter, + special_value_formatter, + dg_formatter, a_ref), m_time_duration_format(string_type(duration_sign_negative_only) + default_time_duration_format) {} //! Changes format for time_duration - void time_duration_format(const char_type* const format) + void time_duration_format(const char_type* const format) { m_time_duration_format = format; } @@ -255,33 +255,33 @@ namespace date_time { this->m_format = iso_time_format_extended_specifier; } - OutItrT put(OutItrT a_next, - std::ios_base& a_ios, - char_type a_fill, - const time_type& a_time) const + OutItrT put(OutItrT a_next, + std::ios_base& a_ios, + char_type a_fill, + const time_type& a_time) const { - if (a_time.is_special()) { - return this->do_put_special(a_next, a_ios, a_fill, + if (a_time.is_special()) { + return this->do_put_special(a_next, a_ios, a_fill, a_time.date().as_special()); } string_type format(this->m_format); string_type frac_str; if (format.find(seconds_with_fractional_seconds_format) != string_type::npos) { - // replace %s with %S.nnn - frac_str = + // replace %s with %S.nnn + frac_str = fractional_seconds_as_string(a_time.time_of_day(), false); char_type sep = std::use_facet >(a_ios.getloc()).decimal_point(); - + string_type replace_string(seconds_format); replace_string += sep; replace_string += frac_str; - boost::algorithm::replace_all(format, - seconds_with_fractional_seconds_format, + boost::algorithm::replace_all(format, + seconds_with_fractional_seconds_format, replace_string); } /* NOTE: replacing posix_zone_string_format must be done BEFORE - * zone_name_format: "%ZP" & "%Z", if Z is checked first it will + * zone_name_format: "%ZP" & "%Z", if Z is checked first it will * incorrectly replace a zone_name where a posix_string should go */ if (format.find(posix_zone_string_format) != string_type::npos) { if(a_time.zone_abbrev().empty()) { @@ -297,8 +297,8 @@ namespace date_time { } if (format.find(zone_name_format) != string_type::npos) { if(a_time.zone_name().empty()) { - /* TODO: this'll probably create problems if a user places - * the zone_*_format flag in the format with a ptime. This + /* TODO: this'll probably create problems if a user places + * the zone_*_format flag in the format with a ptime. This * code removes the flag from the default formats */ // if zone_name() returns an empty string, we want to @@ -315,8 +315,8 @@ namespace date_time { } if (format.find(zone_abbrev_format) != string_type::npos) { if(a_time.zone_abbrev(false).empty()) { - /* TODO: this'll probably create problems if a user places - * the zone_*_format flag in the format with a ptime. This + /* TODO: this'll probably create problems if a user places + * the zone_*_format flag in the format with a ptime. This * code removes the flag from the default formats */ // if zone_abbrev() returns an empty string, we want to @@ -333,8 +333,8 @@ namespace date_time { } if (format.find(zone_iso_extended_format) != string_type::npos) { if(a_time.zone_name(true).empty()) { - /* TODO: this'll probably create problems if a user places - * the zone_*_format flag in the format with a ptime. This + /* TODO: this'll probably create problems if a user places + * the zone_*_format flag in the format with a ptime. This * code removes the flag from the default formats */ // if zone_name() returns an empty string, we want to @@ -350,8 +350,8 @@ namespace date_time { if (format.find(zone_iso_format) != string_type::npos) { if(a_time.zone_abbrev(true).empty()) { - /* TODO: this'll probably create problems if a user places - * the zone_*_format flag in the format with a ptime. This + /* TODO: this'll probably create problems if a user places + * the zone_*_format flag in the format with a ptime. This * code removes the flag from the default formats */ // if zone_abbrev() returns an empty string, we want to @@ -370,13 +370,13 @@ namespace date_time { frac_str = fractional_seconds_as_string(a_time.time_of_day(), false); } boost::algorithm::replace_all(format, - fractional_seconds_format, + fractional_seconds_format, frac_str); } if (format.find(fractional_seconds_or_none_format) != string_type::npos) { // replace %F with nnnnnnn or nothing if fs == 0 - frac_str = + frac_str = fractional_seconds_as_string(a_time.time_of_day(), true); if (frac_str.size()) { char_type sep = std::use_facet >(a_ios.getloc()).decimal_point(); @@ -384,7 +384,7 @@ namespace date_time { replace_string += sep; replace_string += frac_str; boost::algorithm::replace_all(format, - fractional_seconds_or_none_format, + fractional_seconds_or_none_format, replace_string); } else { @@ -393,46 +393,46 @@ namespace date_time { } } - return this->do_put_tm(a_next, a_ios, a_fill, + return this->do_put_tm(a_next, a_ios, a_fill, to_tm(a_time), format); } //! put function for time_duration - OutItrT put(OutItrT a_next, - std::ios_base& a_ios, - char_type a_fill, - const time_duration_type& a_time_dur) const + OutItrT put(OutItrT a_next, + std::ios_base& a_ios, + char_type a_fill, + const time_duration_type& a_time_dur) const { - if (a_time_dur.is_special()) { - return this->do_put_special(a_next, a_ios, a_fill, + if (a_time_dur.is_special()) { + return this->do_put_special(a_next, a_ios, a_fill, a_time_dur.get_rep().as_special()); } string_type format(m_time_duration_format); if (a_time_dur.is_negative()) { // replace %- with minus sign. Should we use the numpunct facet? - boost::algorithm::replace_all(format, - duration_sign_negative_only, + boost::algorithm::replace_all(format, + duration_sign_negative_only, negative_sign); // remove all the %+ in the string with '-' - boost::algorithm::replace_all(format, - duration_sign_always, + boost::algorithm::replace_all(format, + duration_sign_always, negative_sign); } else { //duration is positive // remove all the %- combos from the string boost::algorithm::erase_all(format, duration_sign_negative_only); // remove all the %+ in the string with '+' - boost::algorithm::replace_all(format, - duration_sign_always, + boost::algorithm::replace_all(format, + duration_sign_always, positive_sign); } /* - * It is possible for a time duration to span more then 24 hours. - * Standard time_put::put is obliged to behave the same as strftime - * (See ISO 14882-2003 22.2.5.3.1 par. 1) and strftime's behavior is - * unspecified for the case when tm_hour field is outside 0-23 range + * It is possible for a time duration to span more then 24 hours. + * Standard time_put::put is obliged to behave the same as strftime + * (See ISO 14882-2003 22.2.5.3.1 par. 1) and strftime's behavior is + * unspecified for the case when tm_hour field is outside 0-23 range * (See ISO 9899-1999 7.23.3.5 par. 3). So we must output %H and %O * here ourself. */ @@ -453,16 +453,16 @@ namespace date_time { string_type frac_str; if (format.find(seconds_with_fractional_seconds_format) != string_type::npos) { - // replace %s with %S.nnn - frac_str = + // replace %s with %S.nnn + frac_str = fractional_seconds_as_string(a_time_dur, false); char_type sep = std::use_facet >(a_ios.getloc()).decimal_point(); - + string_type replace_string(seconds_format); replace_string += sep; replace_string += frac_str; - boost::algorithm::replace_all(format, - seconds_with_fractional_seconds_format, + boost::algorithm::replace_all(format, + seconds_with_fractional_seconds_format, replace_string); } if (format.find(fractional_seconds_format) != string_type::npos) { @@ -471,13 +471,13 @@ namespace date_time { frac_str = fractional_seconds_as_string(a_time_dur, false); } boost::algorithm::replace_all(format, - fractional_seconds_format, + fractional_seconds_format, frac_str); } if (format.find(fractional_seconds_or_none_format) != string_type::npos) { // replace %F with nnnnnnn or nothing if fs == 0 - frac_str = + frac_str = fractional_seconds_as_string(a_time_dur, true); if (frac_str.size()) { char_type sep = std::use_facet >(a_ios.getloc()).decimal_point(); @@ -485,7 +485,7 @@ namespace date_time { replace_string += sep; replace_string += frac_str; boost::algorithm::replace_all(format, - fractional_seconds_or_none_format, + fractional_seconds_or_none_format, replace_string); } else { @@ -494,12 +494,12 @@ namespace date_time { } } - return this->do_put_tm(a_next, a_ios, a_fill, + return this->do_put_tm(a_next, a_ios, a_fill, to_tm(a_time_dur), format); } - - OutItrT put(OutItrT next, std::ios_base& a_ios, - char_type fill, const period_type& p) const + + OutItrT put(OutItrT next, std::ios_base& a_ios, + char_type fill, const period_type& p) const { return this->m_period_formatter.put_period(next, a_ios, fill,p,*this); } @@ -507,12 +507,12 @@ namespace date_time { protected: - static - string_type + static + string_type fractional_seconds_as_string(const time_duration_type& a_time, - bool null_when_zero) + bool null_when_zero) { - typename time_duration_type::fractional_seconds_type frac_sec = + typename time_duration_type::fractional_seconds_type frac_sec = a_time.fractional_seconds(); if (null_when_zero && (frac_sec == 0)) { @@ -539,7 +539,7 @@ namespace date_time { { std::basic_ostringstream ss; ss.imbue(std::locale::classic()); // don't want any formatting - ss << std::setw(width) + ss << std::setw(width) << std::setfill(static_cast('0')); #if (defined(BOOST_MSVC) && (_MSC_VER < 1300)) // JDG [7/6/02 VC++ compatibility] @@ -556,105 +556,105 @@ namespace date_time { }; - template + template std::locale::id time_facet::id; - template - const typename time_facet::char_type* + template + const typename time_facet::char_type* time_facet::fractional_seconds_format = time_formats::fractional_seconds_format; - template - const typename time_facet::char_type* + template + const typename time_facet::char_type* time_facet::fractional_seconds_or_none_format = time_formats::fractional_seconds_or_none_format; - template - const typename time_facet::char_type* - time_facet::seconds_with_fractional_seconds_format = + template + const typename time_facet::char_type* + time_facet::seconds_with_fractional_seconds_format = time_formats::seconds_with_fractional_seconds_format; - template + template const typename time_facet::char_type* time_facet::zone_name_format = time_formats::zone_name_format; - template + template const typename time_facet::char_type* time_facet::zone_abbrev_format = time_formats::zone_abbrev_format; - template + template const typename time_facet::char_type* time_facet::zone_iso_extended_format =time_formats::zone_iso_extended_format; - template + template const typename time_facet::char_type* time_facet::posix_zone_string_format =time_formats::posix_zone_string_format; - template + template const typename time_facet::char_type* time_facet::zone_iso_format = time_formats::zone_iso_format; - template + template const typename time_facet::char_type* time_facet::seconds_format = time_formats::seconds_format; - template + template const typename time_facet::char_type* time_facet::hours_format = time_formats::hours_format; - template + template const typename time_facet::char_type* time_facet::unrestricted_hours_format = time_formats::unrestricted_hours_format; - template + template const typename time_facet::char_type* time_facet::standard_format = time_formats::standard_format; - template + template const typename time_facet::char_type* time_facet::duration_seperator = time_formats::duration_seperator; - template + template const typename time_facet::char_type* time_facet::negative_sign = time_formats::negative_sign; - template + template const typename time_facet::char_type* time_facet::positive_sign = time_formats::positive_sign; - template + template const typename time_facet::char_type* time_facet::duration_sign_negative_only = time_formats::duration_sign_negative_only; - template + template const typename time_facet::char_type* time_facet::duration_sign_always = time_formats::duration_sign_always; - template + template const typename time_facet::char_type* time_facet::iso_time_format_specifier = time_formats::iso_time_format_specifier; - template + template const typename time_facet::char_type* time_facet::iso_time_format_extended_specifier = time_formats::iso_time_format_extended_specifier; - template + template const typename time_facet::char_type* - time_facet::default_time_format = + time_facet::default_time_format = time_formats::default_time_format; - template - const typename time_facet::char_type* - time_facet::default_time_duration_format = + template + const typename time_facet::char_type* + time_facet::default_time_duration_format = time_formats::default_time_duration_format; - //! Facet for format-based input. + //! Facet for format-based input. /*! */ template > > - class time_input_facet : + class time_input_facet : public boost::date_time::date_input_facet { public: typedef typename time_type::date_type date_type; @@ -687,13 +687,13 @@ namespace date_time { static const char_type* duration_seperator; static const char_type* iso_time_format_specifier; static const char_type* iso_time_format_extended_specifier; - static const char_type* default_time_input_format; + static const char_type* default_time_input_format; static const char_type* default_time_duration_format; static std::locale::id id; //! Constructor that takes a format string for a ptime - explicit time_input_facet(const string_type& format, ::size_t a_ref = 0) - : base_type(format, a_ref), + explicit time_input_facet(const string_type& format, ::size_t a_ref = 0) + : base_type(format, a_ref), m_time_duration_format(default_time_duration_format) { } @@ -708,16 +708,16 @@ namespace date_time { sv_parser, per_parser, date_gen_parser, - a_ref), + a_ref), m_time_duration_format(default_time_duration_format) {} //! sets default formats for ptime, local_date_time, and time_duration - explicit time_input_facet(::size_t a_ref = 0) - : base_type(default_time_input_format, a_ref), + explicit time_input_facet(::size_t a_ref = 0) + : base_type(default_time_input_format, a_ref), m_time_duration_format(default_time_duration_format) { } - + //! Set the format for time_duration void time_duration_format(const char_type* const format) { m_time_duration_format = format; @@ -730,47 +730,47 @@ namespace date_time { { this->m_format = iso_time_format_extended_specifier; } - + InItrT get(InItrT& sitr, InItrT& stream_end, std::ios_base& a_ios, period_type& p) const { - p = this->m_period_parser.get_period(sitr, - stream_end, - a_ios, - p, - time_duration_type::unit(), + p = this->m_period_parser.get_period(sitr, + stream_end, + a_ios, + p, + time_duration_type::unit(), *this); return sitr; } - + //default ptime format is YYYY-Mon-DD HH:MM:SS[.fff...][ zzz] //default time_duration format is %H:%M:%S%F HH:MM:SS[.fff...] - InItrT get(InItrT& sitr, - InItrT& stream_end, - std::ios_base& a_ios, + InItrT get(InItrT& sitr, + InItrT& stream_end, + std::ios_base& a_ios, time_duration_type& td) const { // skip leading whitespace while((sitr != stream_end) && std::isspace(*sitr)) { ++sitr; } - + bool use_current_char = false; - + // num_get will consume the +/-, we may need a copy if special_value char_type c = '\0'; if((sitr != stream_end) && (*sitr == '-' || *sitr == '+')) { c = *sitr; } - + typedef typename time_duration_type::hour_type hour_type; typedef typename time_duration_type::min_type min_type; typedef typename time_duration_type::sec_type sec_type; - hour_type hour = 0; - min_type min = 0; - sec_type sec = 0; + hour_type hour = 0; + min_type min = 0; + sec_type sec = 0; typename time_duration_type::fractional_seconds_type frac(0); typedef std::num_get num_get; @@ -779,25 +779,25 @@ namespace date_time { std::locale loc = std::locale(a_ios.getloc(), ng); a_ios.imbue(loc); } - + const_itr itr(m_time_duration_format.begin()); while (itr != m_time_duration_format.end() && (sitr != stream_end)) { if (*itr == '%') { ++itr; if (*itr != '%') { switch(*itr) { - case 'O': + case 'O': { // A period may span more than 24 hours. In that case the format // string should be composed with the unrestricted hours specifier. - hour = var_string_to_int(sitr, stream_end, + hour = var_string_to_int(sitr, stream_end, std::numeric_limits::digits10 + 1); if(hour == -1){ return check_special_value(sitr, stream_end, td, c); } break; } - case 'H': + case 'H': { match_results mr; hour = fixed_string_to_int(sitr, stream_end, mr, 2); @@ -806,7 +806,7 @@ namespace date_time { } break; } - case 'M': + case 'M': { match_results mr; min = fixed_string_to_int(sitr, stream_end, mr, 2); @@ -816,7 +816,7 @@ namespace date_time { break; } case 's': - case 'S': + case 'S': { match_results mr; sec = fixed_string_to_int(sitr, stream_end, mr, 2); @@ -833,7 +833,7 @@ namespace date_time { if(*sitr == '.') { ++sitr; parse_frac_type(sitr, stream_end, frac); - // sitr will point to next expected char after this parsing + // sitr will point to next expected char after this parsing // is complete so no need to advance it use_current_char = true; } @@ -842,13 +842,13 @@ namespace date_time { } break; } - case 'F': + case 'F': { // check for decimal, skip if missing if(*sitr == '.') { ++sitr; parse_frac_type(sitr, stream_end, frac); - // sitr will point to next expected char after this parsing + // sitr will point to next expected char after this parsing // is complete so no need to advance it use_current_char = true; } @@ -865,12 +865,12 @@ namespace date_time { else { // itr == '%', second consecutive ++sitr; } - + ++itr; //advance past format specifier } else { //skip past chars in format and in buffer ++itr; - // set use_current_char when sitr is already + // set use_current_char when sitr is already // pointing at the next character to process if (use_current_char) { use_current_char = false; @@ -884,21 +884,21 @@ namespace date_time { td = time_duration_type(hour, min, sec, frac); return sitr; } - + //! Parses a time object from the input stream - InItrT get(InItrT& sitr, - InItrT& stream_end, - std::ios_base& a_ios, + InItrT get(InItrT& sitr, + InItrT& stream_end, + std::ios_base& a_ios, time_type& t) const { string_type tz_str; return get(sitr, stream_end, a_ios, t, tz_str, false); } //! Expects a time_zone in the input stream - InItrT get_local_time(InItrT& sitr, - InItrT& stream_end, - std::ios_base& a_ios, + InItrT get_local_time(InItrT& sitr, + InItrT& stream_end, + std::ios_base& a_ios, time_type& t, string_type& tz_str) const { @@ -907,19 +907,19 @@ namespace date_time { protected: - InItrT get(InItrT& sitr, - InItrT& stream_end, - std::ios_base& a_ios, + InItrT get(InItrT& sitr, + InItrT& stream_end, + std::ios_base& a_ios, time_type& t, string_type& tz_str, bool time_is_local) const { // skip leading whitespace while((sitr != stream_end) && std::isspace(*sitr)) { ++sitr; } - + bool use_current_char = false; bool use_current_format_char = false; // used whith two character flags - + // num_get will consume the +/-, we may need a copy if special_value char_type c = '\0'; if((sitr != stream_end) && (*sitr == '-' || *sitr == '+')) { @@ -931,27 +931,27 @@ namespace date_time { typedef typename time_duration_type::sec_type sec_type; // time elements - hour_type hour = 0; - min_type min = 0; - sec_type sec = 0; + hour_type hour = 0; + min_type min = 0; + sec_type sec = 0; typename time_duration_type::fractional_seconds_type frac(0); // date elements short day_of_year(0); - /* Initialized the following to their minimum values. These intermediate - * objects are used so we get specific exceptions when part of the input - * is unparsable. + /* Initialized the following to their minimum values. These intermediate + * objects are used so we get specific exceptions when part of the input + * is unparsable. * Ex: "205-Jan-15" will throw a bad_year, "2005-Jsn-15"- bad_month, etc.*/ year_type t_year(1400); month_type t_month(1); day_type t_day(1); - + typedef std::num_get num_get; if(!std::has_facet(a_ios.getloc())) { num_get* ng = new num_get(); std::locale loc = std::locale(a_ios.getloc(), ng); a_ios.imbue(loc); } - + const_itr itr(this->m_format.begin()); while (itr != this->m_format.end() && (sitr != stream_end)) { if (*itr == '%') { @@ -1066,7 +1066,7 @@ namespace date_time { break; } // time flags - case 'H': + case 'H': { match_results mr; hour = fixed_string_to_int(sitr, stream_end, mr, 2); @@ -1075,7 +1075,7 @@ namespace date_time { } break; } - case 'M': + case 'M': { match_results mr; min = fixed_string_to_int(sitr, stream_end, mr, 2); @@ -1085,7 +1085,7 @@ namespace date_time { break; } case 's': - case 'S': + case 'S': { match_results mr; sec = fixed_string_to_int(sitr, stream_end, mr, 2); @@ -1102,7 +1102,7 @@ namespace date_time { if(*sitr == '.') { ++sitr; parse_frac_type(sitr, stream_end, frac); - // sitr will point to next expected char after this parsing + // sitr will point to next expected char after this parsing // is complete so no need to advance it use_current_char = true; } @@ -1111,13 +1111,13 @@ namespace date_time { } break; } - case 'F': + case 'F': { // check for decimal, skip if missing if(*sitr == '.') { ++sitr; parse_frac_type(sitr, stream_end, frac); - // sitr will point to next expected char after this parsing + // sitr will point to next expected char after this parsing // is complete so no need to advance it use_current_char = true; } @@ -1147,34 +1147,34 @@ namespace date_time { else { use_current_format_char = true; } - + } else { // nothing was parsed so we don't want to advance sitr use_current_char = true; } - + break; } default: {} // ignore what we don't understand? }// switch - } + } else { // itr == '%', second consecutive ++sitr; } - + if(use_current_format_char) { use_current_format_char = false; } else { ++itr; //advance past format specifier } - + } else { //skip past chars in format and in buffer ++itr; - // set use_current_char when sitr is already + // set use_current_char when sitr is already // pointing at the next character to process if (use_current_char) { use_current_char = false; @@ -1184,7 +1184,7 @@ namespace date_time { } } } - + date_type d(not_a_date_time); if (day_of_year > 0) { d = date_type(static_cast(t_year-1),12,31) + date_duration_type(day_of_year); @@ -1199,8 +1199,8 @@ namespace date_time { } //! Helper function to check for special_value - /*! First character may have been consumed during original parse - * attempt. Parameter 'c' should be a copy of that character. + /*! First character may have been consumed during original parse + * attempt. Parameter 'c' should be a copy of that character. * Throws ios_base::failure if parse fails. */ template inline @@ -1216,13 +1216,13 @@ namespace date_time { boost::throw_exception(std::ios_base::failure("Parse failed. No match found for '" + tmp + "'")); BOOST_DATE_TIME_UNREACHABLE_EXPRESSION(return sitr); // should never reach } - tt = temporal_type(static_cast(mr.current_match)); + tt = temporal_type(static_cast(mr.current_match)); return sitr; } //! Helper function for parsing a fractional second type from the stream - void parse_frac_type(InItrT& sitr, - InItrT& stream_end, + void parse_frac_type(InItrT& sitr, + InItrT& stream_end, fracional_seconds_type& frac) const { string_type cache; @@ -1243,7 +1243,7 @@ namespace date_time { } } } - + private: string_type m_time_duration_format; @@ -1264,60 +1264,60 @@ namespace date_time { template std::locale::id time_input_facet::id; -template - const typename time_input_facet::char_type* +template + const typename time_input_facet::char_type* time_input_facet::fractional_seconds_format = time_formats::fractional_seconds_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::fractional_seconds_or_none_format = time_formats::fractional_seconds_or_none_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::seconds_with_fractional_seconds_format = time_formats::seconds_with_fractional_seconds_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::seconds_format = time_formats::seconds_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::standard_format = time_formats::standard_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::zone_abbrev_format = time_formats::zone_abbrev_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::zone_name_format = time_formats::zone_name_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::zone_iso_format = time_formats::zone_iso_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::zone_iso_extended_format = time_formats::zone_iso_extended_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::duration_seperator = time_formats::duration_seperator; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::iso_time_format_specifier = time_formats::iso_time_format_specifier; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::iso_time_format_extended_specifier = time_formats::iso_time_format_extended_specifier; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::default_time_input_format = time_formats::default_time_input_format; - template - const typename time_input_facet::char_type* + template + const typename time_input_facet::char_type* time_input_facet::default_time_duration_format = time_formats::default_time_duration_format; diff --git a/deal.II/contrib/boost/include/boost/detail/algorithm.hpp b/deal.II/contrib/boost/include/boost/detail/algorithm.hpp index 252e9f461c..3f9297bcab 100644 --- a/deal.II/contrib/boost/include/boost/detail/algorithm.hpp +++ b/deal.II/contrib/boost/include/boost/detail/algorithm.hpp @@ -40,115 +40,30 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace boost { - template - Iter1 begin(const std::pair& p) { return p.first; } - - template - Iter2 end(const std::pair& p) { return p.second; } - - template - typename boost::detail::iterator_traits::difference_type - size(const std::pair& p) { - return std::distance(p.first, p.second); - } - -#if 0 - // These seem to interfere with the std::pair overloads :( - template - typename Container::iterator - begin(Container& c) { return c.begin(); } - - template - typename Container::const_iterator - begin(const Container& c) { return c.begin(); } - - template - typename Container::iterator - end(Container& c) { return c.end(); } - - template - typename Container::const_iterator - end(const Container& c) { return c.end(); } - - template - typename Container::size_type - size(const Container& c) { return c.size(); } -#else - template - typename std::vector::iterator - begin(std::vector& c) { return c.begin(); } - - template - typename std::vector::const_iterator - begin(const std::vector& c) { return c.begin(); } - - template - typename std::vector::iterator - end(std::vector& c) { return c.end(); } - - template - typename std::vector::const_iterator - end(const std::vector& c) { return c.end(); } - - template - typename std::vector::size_type - size(const std::vector& c) { return c.size(); } -#endif - - template - void iota(ForwardIterator first, ForwardIterator last, T value) - { - for (; first != last; ++first, ++value) - *first = value; - } - template - void iota(Container& c, const T& value) - { - iota(begin(c), end(c), value); - } - - // Also do version with 2nd container? - template - OutIter copy(const Container& c, OutIter result) { - return std::copy(begin(c), end(c), result); - } - - template - bool equal(const Container1& c1, const Container2& c2) - { - if (size(c1) != size(c2)) - return false; - return std::equal(begin(c1), end(c1), begin(c2)); - } - - template - void sort(Container& c) { std::sort(begin(c), end(c)); } - - template - void sort(Container& c, const Predicate& p) { - std::sort(begin(c), end(c), p); - } - - template - void stable_sort(Container& c) { std::stable_sort(begin(c), end(c)); } - - template - void stable_sort(Container& c, const Predicate& p) { - std::stable_sort(begin(c), end(c), p); - } - template bool any_if(InputIterator first, InputIterator last, Predicate p) { return std::find_if(first, last, p) != last; } + template bool any_if(const Container& c, Predicate p) { - return any_if(begin(c), end(c), p); + return any_if(boost::begin(c), boost::end(c), p); } template @@ -159,62 +74,7 @@ namespace boost { template bool container_contains(const Container& c, const T& value) { - return container_contains(begin(c), end(c), value); - } - - template - std::size_t count(const Container& c, const T& value) - { - return std::count(begin(c), end(c), value); - } - - template - std::size_t count_if(const Container& c, Predicate p) - { - return std::count_if(begin(c), end(c), p); - } - - template - bool is_sorted(ForwardIterator first, ForwardIterator last) - { - if (first == last) - return true; - - ForwardIterator next = first; - for (++next; next != last; first = next, ++next) { - if (*next < *first) - return false; - } - - return true; - } - - template - bool is_sorted(ForwardIterator first, ForwardIterator last, - StrictWeakOrdering comp) - { - if (first == last) - return true; - - ForwardIterator next = first; - for (++next; next != last; first = next, ++next) { - if (comp(*next, *first)) - return false; - } - - return true; - } - - template - bool is_sorted(const Container& c) - { - return is_sorted(begin(c), end(c)); - } - - template - bool is_sorted(const Container& c, StrictWeakOrdering comp) - { - return is_sorted(begin(c), end(c), comp); + return container_contains(boost::begin(c), boost::end(c), value); } } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/detail/container_fwd.hpp b/deal.II/contrib/boost/include/boost/detail/container_fwd.hpp index bc7f780b06..67c5a21c8a 100644 --- a/deal.II/contrib/boost/include/boost/detail/container_fwd.hpp +++ b/deal.II/contrib/boost/include/boost/detail/container_fwd.hpp @@ -13,7 +13,9 @@ #include #include -#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \ +#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) \ + || ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) \ + && (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL))) \ || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) diff --git a/deal.II/contrib/boost/include/boost/detail/interlocked.hpp b/deal.II/contrib/boost/include/boost/detail/interlocked.hpp index b6c8d75001..fccebc3f70 100644 --- a/deal.II/contrib/boost/include/boost/detail/interlocked.hpp +++ b/deal.II/contrib/boost/include/boost/detail/interlocked.hpp @@ -54,11 +54,23 @@ extern "C" long __cdecl InterlockedExchangeAdd( long*, long ); #elif defined( BOOST_MSVC ) || defined( BOOST_INTEL_WIN ) +#if defined( __CLRCALL_PURE_OR_CDECL ) + +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedIncrement( long volatile * ); +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedDecrement( long volatile * ); +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedCompareExchange( long volatile *, long, long ); +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedExchange( long volatile *, long ); +extern "C" long __CLRCALL_PURE_OR_CDECL _InterlockedExchangeAdd( long volatile *, long ); + +#else + extern "C" long __cdecl _InterlockedIncrement( long volatile * ); extern "C" long __cdecl _InterlockedDecrement( long volatile * ); extern "C" long __cdecl _InterlockedCompareExchange( long volatile *, long, long ); -extern "C" long __cdecl _InterlockedExchange( long volatile *, long); -extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long); +extern "C" long __cdecl _InterlockedExchange( long volatile *, long ); +extern "C" long __cdecl _InterlockedExchangeAdd( long volatile *, long ); + +#endif # pragma intrinsic( _InterlockedIncrement ) # pragma intrinsic( _InterlockedDecrement ) diff --git a/deal.II/contrib/boost/include/boost/detail/lcast_precision.hpp b/deal.II/contrib/boost/include/boost/detail/lcast_precision.hpp index d40ca21eb3..93abce18ce 100644 --- a/deal.II/contrib/boost/include/boost/detail/lcast_precision.hpp +++ b/deal.II/contrib/boost/include/boost/detail/lcast_precision.hpp @@ -173,8 +173,8 @@ inline void lcast_set_precision(std::ios_base& stream, T*) template inline void lcast_set_precision(std::ios_base& stream, Source*, Target*) { - std::streamsize const s = lcast_get_precision((Source*)0); - std::streamsize const t = lcast_get_precision((Target*)0); + std::streamsize const s = lcast_get_precision(static_cast(0)); + std::streamsize const t = lcast_get_precision(static_cast(0)); stream.precision(s > t ? s : t); } diff --git a/deal.II/contrib/boost/include/boost/detail/scoped_enum_emulation.hpp b/deal.II/contrib/boost/include/boost/detail/scoped_enum_emulation.hpp index 644c1386b7..e695a20857 100644 --- a/deal.II/contrib/boost/include/boost/detail/scoped_enum_emulation.hpp +++ b/deal.II/contrib/boost/include/boost/detail/scoped_enum_emulation.hpp @@ -41,9 +41,9 @@ #ifdef BOOST_NO_SCOPED_ENUMS -# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_t +# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type # define BOOST_SCOPED_ENUM_END }; -# define BOOST_SCOPED_ENUM(name) name::enum_t +# define BOOST_SCOPED_ENUM(name) name::enum_type #else diff --git a/deal.II/contrib/boost/include/boost/detail/sp_typeinfo.hpp b/deal.II/contrib/boost/include/boost/detail/sp_typeinfo.hpp index e78c94316a..636fe277bc 100644 --- a/deal.II/contrib/boost/include/boost/detail/sp_typeinfo.hpp +++ b/deal.II/contrib/boost/include/boost/detail/sp_typeinfo.hpp @@ -19,20 +19,66 @@ #if defined( BOOST_NO_TYPEID ) +#include +#include + namespace boost { namespace detail { -typedef void* sp_typeinfo; +class sp_typeinfo +{ +private: + + sp_typeinfo( sp_typeinfo const& ); + sp_typeinfo& operator=( sp_typeinfo const& ); + + char const * name_; + +public: + + explicit sp_typeinfo( char const * name ): name_( name ) + { + } + + bool operator==( sp_typeinfo const& rhs ) const + { + return this == &rhs; + } + + bool operator!=( sp_typeinfo const& rhs ) const + { + return this != &rhs; + } + + bool before( sp_typeinfo const& rhs ) const + { + return std::less< sp_typeinfo const* >()( this, &rhs ); + } + + char const* name() const + { + return name_; + } +}; template struct sp_typeid_ { - static char v_; + static sp_typeinfo ti_; + + static char const * name() + { + return BOOST_CURRENT_FUNCTION; + } }; -template char sp_typeid_< T >::v_; +template sp_typeinfo sp_typeid_< T >::ti_( sp_typeid_< T >::name() ); + +template struct sp_typeid_< T & >: sp_typeid_< T > +{ +}; template struct sp_typeid_< T const >: sp_typeid_< T > { @@ -50,7 +96,7 @@ template struct sp_typeid_< T const volatile >: sp_typeid_< T > } // namespace boost -#define BOOST_SP_TYPEID(T) (&boost::detail::sp_typeid_::v_) +#define BOOST_SP_TYPEID(T) (boost::detail::sp_typeid_::ti_) #else diff --git a/deal.II/contrib/boost/include/boost/dynamic_property_map.hpp b/deal.II/contrib/boost/include/boost/dynamic_property_map.hpp deleted file mode 100644 index 58a4ac90c8..0000000000 --- a/deal.II/contrib/boost/include/boost/dynamic_property_map.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= -Copyright (c) 2009 Trustees of Indiana University - -Distributed under the Boost Software License, Version 1.0. (See accompanying -file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -// Redirect/warning header, adapted from the version in Spirit - -#include - -#if BOOST_VERSION >= 103800 -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__) -# pragma message ("Warning: This header is deprecated. Please use: boost/property_map/dynamic_property_map.hpp") -#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) -# warning "This header is deprecated. Please use: boost/property_map/dynamic_property_map.hpp" -#endif -#endif - -#include diff --git a/deal.II/contrib/boost/include/boost/exception.hpp b/deal.II/contrib/boost/include/boost/exception.hpp index ff315654b0..6424159c6d 100644 --- a/deal.II/contrib/boost/include/boost/exception.hpp +++ b/deal.II/contrib/boost/include/boost/exception.hpp @@ -6,8 +6,6 @@ #ifndef UUID_1D94A7C6054E11DB9804B622A1EF5492 #define UUID_1D94A7C6054E11DB9804B622A1EF5492 -//The header has been deprecated. -//Please #include instead. -#include +#error The header has been deprecated. Please #include instead. #endif diff --git a/deal.II/contrib/boost/include/boost/exception/all.hpp b/deal.II/contrib/boost/include/boost/exception/all.hpp index c47738b2c6..9ffe42a9d0 100644 --- a/deal.II/contrib/boost/include/boost/exception/all.hpp +++ b/deal.II/contrib/boost/include/boost/exception/all.hpp @@ -5,6 +5,12 @@ #ifndef UUID_316FDA946C0D11DEA9CBAE5255D89593 #define UUID_316FDA946C0D11DEA9CBAE5255D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include @@ -24,4 +30,7 @@ #include #endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/current_exception_cast.hpp b/deal.II/contrib/boost/include/boost/exception/current_exception_cast.hpp index 228b6ea10e..af2f153113 100644 --- a/deal.II/contrib/boost/include/boost/exception/current_exception_cast.hpp +++ b/deal.II/contrib/boost/include/boost/exception/current_exception_cast.hpp @@ -5,6 +5,12 @@ #ifndef UUID_7E83C166200811DE885E826156D89593 #define UUID_7E83C166200811DE885E826156D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif namespace boost @@ -31,4 +37,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/detail/attribute_noreturn.hpp b/deal.II/contrib/boost/include/boost/exception/detail/attribute_noreturn.hpp index 1cb0763efd..f6a0b5903e 100644 --- a/deal.II/contrib/boost/include/boost/exception/detail/attribute_noreturn.hpp +++ b/deal.II/contrib/boost/include/boost/exception/detail/attribute_noreturn.hpp @@ -6,9 +6,7 @@ #ifndef UUID_61531AB0680611DEADD5846855D89593 #define UUID_61531AB0680611DEADD5846855D89593 -#include - -#if defined(BOOST_MSVC) +#if defined(_MSC_VER) #define BOOST_ATTRIBUTE_NORETURN __declspec(noreturn) #elif defined(__GNUC__) #define BOOST_ATTRIBUTE_NORETURN __attribute__((noreturn)) diff --git a/deal.II/contrib/boost/include/boost/exception/detail/error_info_impl.hpp b/deal.II/contrib/boost/include/boost/exception/detail/error_info_impl.hpp index a25d066fd1..883d313a98 100644 --- a/deal.II/contrib/boost/include/boost/exception/detail/error_info_impl.hpp +++ b/deal.II/contrib/boost/include/boost/exception/detail/error_info_impl.hpp @@ -1,10 +1,16 @@ -//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc. //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef UUID_CE6983AC753411DDA764247956D89593 #define UUID_CE6983AC753411DDA764247956D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include @@ -19,12 +25,11 @@ boost { public: - virtual char const * tag_typeid_name() const = 0; + virtual std::string tag_typeid_name() const = 0; virtual std::string value_as_string() const = 0; protected: - virtual ~error_info_base() throw() { } @@ -57,11 +62,14 @@ boost private: - char const * tag_typeid_name() const; + std::string tag_typeid_name() const; std::string value_as_string() const; value_type value_; }; } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/detail/exception_ptr.hpp b/deal.II/contrib/boost/include/boost/exception/detail/exception_ptr.hpp new file mode 100644 index 0000000000..59686e95c3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/exception/detail/exception_ptr.hpp @@ -0,0 +1,429 @@ +//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. + +//Distributed under the Boost Software License, Version 1.0. (See accompanying +//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef UUID_618474C2DE1511DEB74A388C56D89593 +#define UUID_618474C2DE1511DEB74A388C56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif + +#include +#ifdef BOOST_NO_EXCEPTIONS +#error This header requires exception handling to be enabled. +#endif +#include +#include +#include +#include +#include +#include +#include +#include + +namespace +boost + { + typedef shared_ptr exception_ptr; + + exception_ptr current_exception(); + + template + inline + exception_ptr + copy_exception( T const & e ) + { + try + { + throw enable_current_exception(e); + } + catch( + ... ) + { + return current_exception(); + } + } + +#ifndef BOOST_NO_RTTI + typedef error_info original_exception_type; + + inline + std::string + to_string( original_exception_type const & x ) + { + return x.value()->name(); + } +#endif + + namespace + exception_detail + { + struct + bad_alloc_: + boost::exception, + std::bad_alloc + { + }; + + template + exception_ptr + get_bad_alloc() + { + static exception_ptr e = boost::copy_exception( + bad_alloc_() << + throw_function("boost::current_exception()") << + throw_file(__FILE__) << + throw_line(__LINE__) ); + return e; + } + + template + struct + exception_ptr_bad_alloc + { + static exception_ptr const e; + }; + + template + exception_ptr const + exception_ptr_bad_alloc:: + e = get_bad_alloc(); + } + + class + unknown_exception: + public boost::exception, + public std::exception + { + public: + + unknown_exception() + { + } + + explicit + unknown_exception( std::exception const & e ) + { + add_original_type(e); + } + + explicit + unknown_exception( boost::exception const & e ): + boost::exception(e) + { + add_original_type(e); + } + + ~unknown_exception() throw() + { + } + + private: + + template + void + add_original_type( E const & e ) + { +#ifndef BOOST_NO_RTTI + (*this) << original_exception_type(&typeid(e)); +#endif + } + }; + + namespace + exception_detail + { + template + class + current_exception_std_exception_wrapper: + public T, + public boost::exception + { + public: + + explicit + current_exception_std_exception_wrapper( T const & e1 ): + T(e1) + { + add_original_type(e1); + } + + current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ): + T(e1), + boost::exception(e2) + { + add_original_type(e1); + } + + ~current_exception_std_exception_wrapper() throw() + { + } + + private: + + template + void + add_original_type( E const & e ) + { +#ifndef BOOST_NO_RTTI + (*this) << original_exception_type(&typeid(e)); +#endif + } + }; + +#ifdef BOOST_NO_RTTI + template + boost::exception const * + get_boost_exception( T const * ) + { + try + { + throw; + } + catch( + boost::exception & x ) + { + return &x; + } + catch(...) + { + return 0; + } + } +#else + template + boost::exception const * + get_boost_exception( T const * x ) + { + return dynamic_cast(x); + } +#endif + + template + inline + exception_ptr + current_exception_std_exception( T const & e1 ) + { + if( boost::exception const * e2 = get_boost_exception(&e1) ) + return boost::copy_exception(current_exception_std_exception_wrapper(e1,*e2)); + else + return boost::copy_exception(current_exception_std_exception_wrapper(e1)); + } + + inline + exception_ptr + current_exception_unknown_exception() + { + return boost::copy_exception(unknown_exception()); + } + + inline + exception_ptr + current_exception_unknown_boost_exception( boost::exception const & e ) + { + return boost::copy_exception(unknown_exception(e)); + } + + inline + exception_ptr + current_exception_unknown_std_exception( std::exception const & e ) + { + if( boost::exception const * be = get_boost_exception(&e) ) + return current_exception_unknown_boost_exception(*be); + else + return boost::copy_exception(unknown_exception(e)); + } + + inline + exception_ptr + current_exception_impl() + { + try + { + throw; + } + catch( + exception_detail::clone_base & e ) + { + return exception_ptr(e.clone()); + } + catch( + std::domain_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::invalid_argument & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::length_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::out_of_range & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::logic_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::range_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::overflow_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::underflow_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::ios_base::failure & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::runtime_error & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::bad_alloc & e ) + { + return exception_detail::current_exception_std_exception(e); + } +#ifndef BOOST_NO_TYPEID + catch( + std::bad_cast & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::bad_typeid & e ) + { + return exception_detail::current_exception_std_exception(e); + } +#endif + catch( + std::bad_exception & e ) + { + return exception_detail::current_exception_std_exception(e); + } + catch( + std::exception & e ) + { + return exception_detail::current_exception_unknown_std_exception(e); + } + catch( + boost::exception & e ) + { + return exception_detail::current_exception_unknown_boost_exception(e); + } + catch( + ... ) + { + return exception_detail::current_exception_unknown_exception(); + } + } + } + + inline + exception_ptr + current_exception() + { + exception_ptr ret; + BOOST_ASSERT(!ret); + try + { + ret=exception_detail::current_exception_impl(); + } + catch( + std::bad_alloc & ) + { + ret=exception_detail::exception_ptr_bad_alloc<42>::e; + } + catch( + ... ) + { + try + { + ret=exception_detail::current_exception_std_exception(std::bad_exception()); + } + catch( + std::bad_alloc & ) + { + ret=exception_detail::exception_ptr_bad_alloc<42>::e; + } + catch( + ... ) + { + BOOST_ASSERT(0); + } + } + BOOST_ASSERT(ret); + return ret; + } + + inline + void + rethrow_exception( exception_ptr const & p ) + { + BOOST_ASSERT(p); + p->rethrow(); + } + + inline + std::string + diagnostic_information( exception_ptr const & p ) + { + if( p ) + try + { + rethrow_exception(p); + } + catch( + ... ) + { + return current_exception_diagnostic_information(); + } + return ""; + } + + inline + std::string + to_string( exception_ptr const & p ) + { + std::string s='\n'+diagnostic_information(p); + std::string padding(" "); + std::string r; + bool f=false; + for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i ) + { + if( f ) + r+=padding; + char c=*i; + r+=c; + f=(c=='\n'); + } + return r; + } + } + +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif +#endif diff --git a/deal.II/contrib/boost/include/boost/exception/detail/is_output_streamable.hpp b/deal.II/contrib/boost/include/boost/exception/detail/is_output_streamable.hpp index af59cb8d2f..743313c1ec 100644 --- a/deal.II/contrib/boost/include/boost/exception/detail/is_output_streamable.hpp +++ b/deal.II/contrib/boost/include/boost/exception/detail/is_output_streamable.hpp @@ -5,6 +5,12 @@ #ifndef UUID_898984B4076411DD973EDFA055D89593 #define UUID_898984B4076411DD973EDFA055D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include @@ -14,8 +20,21 @@ boost namespace to_string_detail { - template - char operator<<( std::basic_ostream &, T const & ); + struct + partial_ordering_helper1 + { + template + partial_ordering_helper1( std::basic_ostream & ); + }; + + struct + partial_ordering_helper2 + { + template + partial_ordering_helper2( T const & ); + }; + + char operator<<( partial_ordering_helper1, partial_ordering_helper2 ); template struct @@ -35,4 +54,7 @@ boost }; } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/detail/object_hex_dump.hpp b/deal.II/contrib/boost/include/boost/exception/detail/object_hex_dump.hpp index f535944ea2..ccf1bac3f7 100644 --- a/deal.II/contrib/boost/include/boost/exception/detail/object_hex_dump.hpp +++ b/deal.II/contrib/boost/include/boost/exception/detail/object_hex_dump.hpp @@ -5,12 +5,19 @@ #ifndef UUID_6F463AC838DF11DDA3E6909F56D89593 #define UUID_6F463AC838DF11DDA3E6909F56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include #include #include #include +#include namespace boost @@ -21,11 +28,11 @@ boost template inline std::string - object_hex_dump( T const & x, size_t max_size=16 ) + object_hex_dump( T const & x, std::size_t max_size=16 ) { std::ostringstream s; s << "type: " << type_name() << ", size: " << sizeof(T) << ", dump: "; - size_t n=sizeof(T)>max_size?max_size:sizeof(T); + std::size_t n=sizeof(T)>max_size?max_size:sizeof(T); s.fill('0'); s.width(2); unsigned char const * b=reinterpret_cast(&x); @@ -37,4 +44,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/detail/type_info.hpp b/deal.II/contrib/boost/include/boost/exception/detail/type_info.hpp index ac0960db68..9ab1c57f53 100644 --- a/deal.II/contrib/boost/include/boost/exception/detail/type_info.hpp +++ b/deal.II/contrib/boost/include/boost/exception/detail/type_info.hpp @@ -1,130 +1,83 @@ -//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc. //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef UUID_C3E1741C754311DDB2834CCA55D89593 #define UUID_C3E1741C754311DDB2834CCA55D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include +#include +#ifndef BOOST_NO_TYPEID +#include +#endif +#include namespace boost { template inline - char const * + std::string tag_type_name() { #ifdef BOOST_NO_TYPEID return BOOST_CURRENT_FUNCTION; #else - return typeid(T*).name(); + return units::detail::demangle(typeid(T*).name()); #endif } template inline - char const * + std::string type_name() { #ifdef BOOST_NO_TYPEID return BOOST_CURRENT_FUNCTION; #else - return typeid(T).name(); + return units::detail::demangle(typeid(T).name()); #endif } namespace exception_detail { -#ifdef BOOST_NO_TYPEID - struct - type_info_ - { - detail::sp_typeinfo type_; - char const * name_; - - explicit - type_info_( detail::sp_typeinfo type, char const * name ): - type_(type), - name_(name) - { - } - - friend - bool - operator==( type_info_ const & a, type_info_ const & b ) - { - return a.type_==b.type_; - } - - friend - bool - operator<( type_info_ const & a, type_info_ const & b ) - { - return a.type_before(*b.type_)); - } - - char const * - name() const - { - return type_->name(); + return 0!=(a.type_.before(b.type_)); } }; -#endif - - inline - bool - operator!=( type_info_ const & a, type_info_ const & b ) - { - return !(a==b); - } } } -#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T),::boost::tag_type_name()) +#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T)) #ifndef BOOST_NO_RTTI #define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x)) #endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/diagnostic_information.hpp b/deal.II/contrib/boost/include/boost/exception/diagnostic_information.hpp index 1ea9dc1bab..1d6bc2cc98 100644 --- a/deal.II/contrib/boost/include/boost/exception/diagnostic_information.hpp +++ b/deal.II/contrib/boost/include/boost/exception/diagnostic_information.hpp @@ -1,46 +1,85 @@ -//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc. //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef UUID_0552D49838DD11DD90146B8956D89593 #define UUID_0552D49838DD11DD90146B8956D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include -#include #include +#ifndef BOOST_NO_RTTI +#include +#endif #include #include #include +#ifndef BOOST_NO_EXCEPTIONS +#include +namespace +boost + { + namespace + exception_detail + { + std::string diagnostic_information_impl( boost::exception const *, std::exception const *, bool ); + } + + inline + std::string + current_exception_diagnostic_information() + { + boost::exception const * be=current_exception_cast(); + std::exception const * se=current_exception_cast(); + if( be || se ) + return exception_detail::diagnostic_information_impl(be,se,true); + else + return "No diagnostic information available."; + } + } +#endif + namespace boost { namespace exception_detail { - template - struct - enable_boost_exception_overload + inline + exception const * + get_boost_exception( exception const * e ) + { + return e; + } + + inline + exception const * + get_boost_exception( ... ) { - struct yes { char q[100]; }; - typedef char no; - static yes check(exception const *); - static no check(...); - enum e { value=sizeof(check((T*)0))==sizeof(yes) }; - }; + return 0; + } - template - struct - enable_std_exception_overload + inline + std::exception const * + get_std_exception( std::exception const * e ) { - struct yes { char q[100]; }; - typedef char no; - static yes check(std::exception const *); - static no check(...); - enum e { value = !enable_boost_exception_overload::value && sizeof(check((T*)0))==sizeof(yes) }; - }; + return e; + } + + inline + std::exception const * + get_std_exception( ... ) + { + return 0; + } inline char const * @@ -65,12 +104,13 @@ boost std::string diagnostic_information_impl( boost::exception const * be, std::exception const * se, bool with_what ) { - BOOST_ASSERT(be||se); + if( !be && !se ) + return "Unknown exception."; #ifndef BOOST_NO_RTTI - if( !se ) - se = dynamic_cast(be); if( !be ) - be = dynamic_cast(se); + be=dynamic_cast(se); + if( !se ) + se=dynamic_cast(be); #endif char const * wh=0; if( with_what && se ) @@ -97,7 +137,7 @@ boost } #ifndef BOOST_NO_RTTI tmp << std::string("Dynamic exception type: ") << - (be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).name() << '\n'; + units::detail::demangle((be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).type_.name()) << '\n'; #endif if( with_what && se ) tmp << "std::exception::what: " << wh << '\n'; @@ -110,19 +150,10 @@ boost } template - inline - typename enable_if,std::string>::type - diagnostic_information( T const & e ) - { - return exception_detail::diagnostic_information_impl(&e,0,true); - } - - template - inline - typename enable_if,std::string>::type + std::string diagnostic_information( T const & e ) { - return exception_detail::diagnostic_information_impl(0,&e,true); + return exception_detail::diagnostic_information_impl(exception_detail::get_boost_exception(&e),exception_detail::get_std_exception(&e),true); } inline @@ -147,40 +178,7 @@ boost } } -#ifndef BOOST_NO_EXCEPTIONS -#include -namespace -boost - { - inline - std::string - current_exception_diagnostic_information() - { - boost::exception const * be=current_exception_cast(); - std::exception const * se=current_exception_cast(); - if( be || se ) - return exception_detail::diagnostic_information_impl(be,se,true); - else - return "No diagnostic information available."; - } - - inline - std::string - diagnostic_information( exception_detail::exception_ptr_base const & p ) - { - if( !p._empty() ) - try - { - p._rethrow(); - } - catch( - ... ) - { - return current_exception_diagnostic_information(); - } - return ""; - } - } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) #endif - #endif diff --git a/deal.II/contrib/boost/include/boost/exception/errinfo_errno.hpp b/deal.II/contrib/boost/include/boost/exception/errinfo_errno.hpp index 310ceb78d0..ea74010c94 100644 --- a/deal.II/contrib/boost/include/boost/exception/errinfo_errno.hpp +++ b/deal.II/contrib/boost/include/boost/exception/errinfo_errno.hpp @@ -5,6 +5,12 @@ #ifndef UUID_F0EE17BE6C1211DE87FF459155D89593 #define UUID_F0EE17BE6C1211DE87FF459155D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include "boost/exception/info.hpp" #include @@ -32,4 +38,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/errinfo_nested_exception.hpp b/deal.II/contrib/boost/include/boost/exception/errinfo_nested_exception.hpp index de055e035f..e4e75d9eef 100644 --- a/deal.II/contrib/boost/include/boost/exception/errinfo_nested_exception.hpp +++ b/deal.II/contrib/boost/include/boost/exception/errinfo_nested_exception.hpp @@ -9,8 +9,10 @@ namespace boost { + namespace exception_detail { class clone_base; }; template class error_info; - class exception_ptr; + template class shared_ptr; + typedef shared_ptr exception_ptr; typedef error_info errinfo_nested_exception; } diff --git a/deal.II/contrib/boost/include/boost/exception/exception.hpp b/deal.II/contrib/boost/include/boost/exception/exception.hpp index e7faf594c4..fd516dd5ea 100644 --- a/deal.II/contrib/boost/include/boost/exception/exception.hpp +++ b/deal.II/contrib/boost/include/boost/exception/exception.hpp @@ -5,6 +5,12 @@ #ifndef UUID_274DA366004E11DCB1DDFE2E56D89593 #define UUID_274DA366004E11DCB1DDFE2E56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif namespace boost @@ -126,9 +132,6 @@ boost } }; - template - E const & operator<<( E const &, error_info const & ); - class exception; template @@ -148,10 +151,10 @@ boost virtual void set( shared_ptr const &, type_info_ const & ) = 0; virtual void add_ref() const = 0; virtual void release() const = 0; + virtual refcount_ptr clone() const = 0; protected: - virtual ~error_info_container() throw() { } @@ -170,6 +173,20 @@ boost struct get_info; char const * get_diagnostic_information( exception const &, char const * ); + + void copy_boost_exception( exception *, exception const * ); + + template + E const & set_info( E const &, error_info const & ); + + template + E const & set_info( E const &, throw_function const & ); + + template + E const & set_info( E const &, throw_file const & ); + + template + E const & set_info( E const &, throw_line const & ); } class @@ -202,46 +219,32 @@ boost #endif ; +#if (defined(__MWERKS__) && __MWERKS__<=0x3207) || (defined(_MSC_VER) && _MSC_VER<=1310) + public: +#else private: template - friend - E const & - operator<<( E const & x, throw_function const & y ) - { - x.throw_function_=y.v_; - return x; - } + friend E const & exception_detail::set_info( E const &, throw_function const & ); template - friend - E const & - operator<<( E const & x, throw_file const & y ) - { - x.throw_file_=y.v_; - return x; - } + friend E const & exception_detail::set_info( E const &, throw_file const & ); template - friend - E const & - operator<<( E const & x, throw_line const & y ) - { - x.throw_line_=y.v_; - return x; - } - - friend char const * exception_detail::get_diagnostic_information( exception const &, char const * ); + friend E const & exception_detail::set_info( E const &, throw_line const & ); template - friend E const & operator<<( E const &, error_info const & ); + friend E const & exception_detail::set_info( E const &, error_info const & ); + + friend char const * exception_detail::get_diagnostic_information( exception const &, char const * ); template friend struct exception_detail::get_info; friend struct exception_detail::get_info; friend struct exception_detail::get_info; friend struct exception_detail::get_info; - + friend void exception_detail::copy_boost_exception( exception *, exception const * ); +#endif mutable exception_detail::refcount_ptr data_; mutable char const * throw_function_; mutable char const * throw_file_; @@ -254,6 +257,34 @@ boost { } + namespace + exception_detail + { + template + E const & + set_info( E const & x, throw_function const & y ) + { + x.throw_function_=y.v_; + return x; + } + + template + E const & + set_info( E const & x, throw_file const & y ) + { + x.throw_file_=y.v_; + return x; + } + + template + E const & + set_info( E const & x, throw_line const & y ) + { + x.throw_line_=y.v_; + return x; + } + } + //////////////////////////////////////////////////////////////////////// namespace @@ -277,10 +308,10 @@ boost }; struct large_size { char c[256]; }; - large_size dispatch( exception * ); + large_size dispatch_boost_exception( exception const * ); struct small_size { }; - small_size dispatch( void * ); + small_size dispatch_boost_exception( void const * ); template struct enable_error_info_helper; @@ -303,7 +334,7 @@ boost struct enable_error_info_return_type { - typedef typename enable_error_info_helper::type type; + typedef typename enable_error_info_helper::type type; }; } @@ -340,7 +371,13 @@ boost void copy_boost_exception( exception * a, exception const * b ) { - *a = *b; + refcount_ptr data; + if( error_info_container * d=b->data_.get() ) + data = d->clone(); + a->throw_file_ = b->throw_file_; + a->throw_line_ = b->throw_line_; + a->throw_function_ = b->throw_function_; + a->data_ = data; } inline @@ -393,4 +430,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/get_error_info.hpp b/deal.II/contrib/boost/include/boost/exception/get_error_info.hpp index 640a612f3d..046f05aeef 100644 --- a/deal.II/contrib/boost/include/boost/exception/get_error_info.hpp +++ b/deal.II/contrib/boost/include/boost/exception/get_error_info.hpp @@ -5,6 +5,12 @@ #ifndef UUID_1A590226753311DD9E4CCF6156D89593 #define UUID_1A590226753311DD9E4CCF6156D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include @@ -118,4 +124,7 @@ boost #endif } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/info.hpp b/deal.II/contrib/boost/include/boost/exception/info.hpp index c1b76c02cf..7aeeee5385 100644 --- a/deal.II/contrib/boost/include/boost/exception/info.hpp +++ b/deal.II/contrib/boost/include/boost/exception/info.hpp @@ -1,15 +1,22 @@ -//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. +//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc. //Distributed under the Boost Software License, Version 1.0. (See accompanying //file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593 #define UUID_8D22C4CA9CC811DCAA9133D256D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include #include #include +#include #include namespace @@ -40,7 +47,7 @@ boost template inline - char const * + std::string error_info:: tag_typeid_name() const { @@ -90,7 +97,7 @@ boost { shared_ptr const & p = i->second; #ifndef BOOST_NO_RTTI - BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p)==ti ); + BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p).type_==ti.type_ ); #endif return p; } @@ -124,6 +131,9 @@ boost mutable std::string diagnostic_info_str_; mutable int count_; + error_info_container_impl( error_info_container_impl const & ); + error_info_container_impl & operator=( error_info_container const & ); + void add_ref() const { @@ -136,22 +146,50 @@ boost if( !--count_ ) delete this; } + + refcount_ptr + clone() const + { + refcount_ptr p; + error_info_container_impl * c=new error_info_container_impl; + p.adopt(c); + c->info_ = info_; + return p; + } + }; + + template + inline + E const & + set_info( E const & x, error_info const & v ) + { + typedef error_info error_info_tag_t; + shared_ptr p( new error_info_tag_t(v) ); + exception_detail::error_info_container * c=x.data_.get(); + if( !c ) + x.data_.adopt(c=new exception_detail::error_info_container_impl); + c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t)); + return x; + } + + template + struct + derives_boost_exception + { + enum e { value = (sizeof(dispatch_boost_exception((T*)0))==sizeof(large_size)) }; }; } template inline - E const & + typename enable_if,E const &>::type operator<<( E const & x, error_info const & v ) { - typedef error_info error_info_tag_t; - shared_ptr p( new error_info_tag_t(v) ); - exception_detail::error_info_container * c; - if( !(c=x.data_.get()) ) - x.data_.adopt(c=new exception_detail::error_info_container_impl); - c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t)); - return x; + return exception_detail::set_info(x,v); } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/info_tuple.hpp b/deal.II/contrib/boost/include/boost/exception/info_tuple.hpp index 38b2512626..34afe421b1 100644 --- a/deal.II/contrib/boost/include/boost/exception/info_tuple.hpp +++ b/deal.II/contrib/boost/include/boost/exception/info_tuple.hpp @@ -5,6 +5,12 @@ #ifndef UUID_63EE924290FB11DC87BB856555D89593 #define UUID_63EE924290FB11DC87BB856555D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include @@ -64,4 +70,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/to_string.hpp b/deal.II/contrib/boost/include/boost/exception/to_string.hpp index 5d88efa467..59bf83d4c0 100644 --- a/deal.II/contrib/boost/include/boost/exception/to_string.hpp +++ b/deal.II/contrib/boost/include/boost/exception/to_string.hpp @@ -5,6 +5,12 @@ #ifndef UUID_7E48761AD92811DC9011477D56D89593 #define UUID_7E48761AD92811DC9011477D56D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include @@ -71,4 +77,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception/to_string_stub.hpp b/deal.II/contrib/boost/include/boost/exception/to_string_stub.hpp index 4b7028144f..e41d369775 100644 --- a/deal.II/contrib/boost/include/boost/exception/to_string_stub.hpp +++ b/deal.II/contrib/boost/include/boost/exception/to_string_stub.hpp @@ -5,6 +5,12 @@ #ifndef UUID_E788439ED9F011DCB181F25B55D89593 #define UUID_E788439ED9F011DCB181F25B55D89593 +#if defined(__GNUC__) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma GCC system_header +#endif +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(push,1) +#endif #include #include @@ -97,4 +103,7 @@ boost } } +#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS) +#pragma warning(pop) +#endif #endif diff --git a/deal.II/contrib/boost/include/boost/exception_ptr.hpp b/deal.II/contrib/boost/include/boost/exception_ptr.hpp index 1bae365ea0..d48cce9dc6 100644 --- a/deal.II/contrib/boost/include/boost/exception_ptr.hpp +++ b/deal.II/contrib/boost/include/boost/exception_ptr.hpp @@ -6,459 +6,6 @@ #ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593 #define UUID_FA5836A2CADA11DC8CD47C8555D89593 -#include -#ifdef BOOST_NO_EXCEPTIONS -#error This header requires exception handling to be enabled. -#endif -#include -#include -#include -#include -#include -#include -#include -#include - -namespace -boost - { -#ifndef BOOST_NO_RTTI - typedef error_info original_exception_type; - - inline - std::string - to_string( original_exception_type const & x ) - { - return x.value()->name(); - } -#endif - - class exception_ptr; - exception_ptr current_exception(); - void rethrow_exception( exception_ptr const & ); - - class - exception_ptr: - public exception_detail::exception_ptr_base - { - typedef bool exception_ptr::*unspecified_bool_type; - friend exception_ptr current_exception(); - friend void rethrow_exception( exception_ptr const & ); - - shared_ptr c_; - bool bad_alloc_; - - struct - bad_alloc_tag - { - }; - - explicit - exception_ptr( bad_alloc_tag ): - bad_alloc_(true) - { - } - - explicit - exception_ptr( shared_ptr const & c ): - c_(c), - bad_alloc_(false) - { - BOOST_ASSERT(c); - } - - void - _rethrow() const - { - BOOST_ASSERT(*this); - if( bad_alloc_ ) - throw enable_current_exception(std::bad_alloc()); - else - c_->rethrow(); - } - - bool - _empty() const - { - return !bad_alloc_ && !c_; - } - - public: - - exception_ptr(): - bad_alloc_(false) - { - } - - virtual ~exception_ptr () throw() - {} - - operator unspecified_bool_type() const - { - return _empty() ? 0 : &exception_ptr::bad_alloc_; - } - - friend - bool - operator==( exception_ptr const & a, exception_ptr const & b ) - { - return a.c_==b.c_ && a.bad_alloc_==b.bad_alloc_; - } - - friend - bool - operator!=( exception_ptr const & a, exception_ptr const & b ) - { - return !(a==b); - } - }; - - class - unknown_exception: - public exception, - public std::exception, - public exception_detail::clone_base - { - public: - - unknown_exception() - { - } - - explicit - unknown_exception( std::exception const & e ) - { - add_original_type(e); - } - - explicit - unknown_exception( boost::exception const & e ): - boost::exception(e) - { - add_original_type(e); - } - - ~unknown_exception() throw() - { - } - - private: - - exception_detail::clone_base const * - clone() const - { - return new unknown_exception(*this); - } - - void - rethrow() const - { - throw*this; - } - - template - void - add_original_type( E const & e ) - { -#ifndef BOOST_NO_RTTI - (*this) << original_exception_type(&typeid(e)); -#endif - } - }; - - namespace - exception_detail - { - template - class - current_exception_std_exception_wrapper: - public T, - public boost::exception, - public clone_base - { - public: - - explicit - current_exception_std_exception_wrapper( T const & e1 ): - T(e1) - { - add_original_type(e1); - } - - current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ): - T(e1), - boost::exception(e2) - { - add_original_type(e1); - } - - ~current_exception_std_exception_wrapper() throw() - { - } - - private: - - clone_base const * - clone() const - { - return new current_exception_std_exception_wrapper(*this); - } - - void - rethrow() const - { - throw *this; - } - - template - void - add_original_type( E const & e ) - { -#ifndef BOOST_NO_RTTI - (*this) << original_exception_type(&typeid(e)); -#endif - } - }; - -#ifdef BOOST_NO_RTTI - template - exception const * - get_boost_exception( T const * ) - { - try - { - throw; - } - catch( - exception & x ) - { - return &x; - } - catch(...) - { - return 0; - } - } -#else - template - exception const * - get_boost_exception( T const * x ) - { - return dynamic_cast(x); - } -#endif - - template - inline - shared_ptr - current_exception_std_exception( T const & e1 ) - { - if( boost::exception const * e2 = get_boost_exception(&e1) ) - return shared_ptr const>(new current_exception_std_exception_wrapper(e1,*e2)); - else - return shared_ptr const>(new current_exception_std_exception_wrapper(e1)); - } - - inline - shared_ptr - current_exception_unknown_exception() - { - return shared_ptr(new unknown_exception()); - } - - inline - shared_ptr - current_exception_unknown_boost_exception( boost::exception const & e ) - { - return shared_ptr(new unknown_exception(e)); - } - - inline - shared_ptr - current_exception_unknown_std_exception( std::exception const & e ) - { - if( boost::exception const * be = get_boost_exception(&e) ) - return current_exception_unknown_boost_exception(*be); - else - return shared_ptr(new unknown_exception(e)); - } - - inline - shared_ptr - current_exception_impl() - { - try - { - throw; - } - catch( - exception_detail::clone_base & e ) - { - return shared_ptr(e.clone()); - } - catch( - std::domain_error & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::invalid_argument & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::length_error & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::out_of_range & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::logic_error & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::range_error & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::overflow_error & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::underflow_error & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::ios_base::failure & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::runtime_error & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::bad_alloc & e ) - { - return exception_detail::current_exception_std_exception(e); - } -#ifndef BOOST_NO_TYPEID - catch( - std::bad_cast & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::bad_typeid & e ) - { - return exception_detail::current_exception_std_exception(e); - } -#endif - catch( - std::bad_exception & e ) - { - return exception_detail::current_exception_std_exception(e); - } - catch( - std::exception & e ) - { - return exception_detail::current_exception_unknown_std_exception(e); - } - catch( - boost::exception & e ) - { - return exception_detail::current_exception_unknown_boost_exception(e); - } - catch( - ... ) - { - return exception_detail::current_exception_unknown_exception(); - } - } - } - - inline - exception_ptr - current_exception() - { - try - { - return exception_ptr(exception_detail::current_exception_impl()); - } - catch( - std::bad_alloc & ) - { - } - catch( - ... ) - { - try - { - return exception_ptr(exception_detail::current_exception_std_exception(std::bad_exception())); - } - catch( - std::bad_alloc & ) - { - } - catch( - ... ) - { - BOOST_ASSERT(0); - } - } - return exception_ptr(exception_ptr::bad_alloc_tag()); - } - - template - inline - exception_ptr - copy_exception( T const & e ) - { - try - { - throw enable_current_exception(e); - } - catch( - ... ) - { - return current_exception(); - } - } - - inline - void - rethrow_exception( exception_ptr const & p ) - { - p._rethrow(); - } - - inline - std::string - to_string( exception_ptr const & p ) - { - std::string s='\n'+diagnostic_information(p); - std::string padding(" "); - std::string r; - bool f=false; - for( std::string::const_iterator i=s.begin(),e=s.end(); i!=e; ++i ) - { - if( f ) - r+=padding; - char c=*i; - r+=c; - f=(c=='\n'); - } - return r; - } - } +#include #endif diff --git a/deal.II/contrib/boost/include/boost/flyweight.hpp b/deal.II/contrib/boost/include/boost/flyweight.hpp new file mode 100644 index 0000000000..6fe3042681 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/flyweight.hpp @@ -0,0 +1,22 @@ +/* Copyright 2006-2008 Joaquin M Lopez Munoz. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * See http://www.boost.org/libs/flyweight for library home page. + */ + +#ifndef BOOST_FLYWEIGHT_HPP +#define BOOST_FLYWEIGHT_HPP + +#if defined(_MSC_VER)&&(_MSC_VER>=1200) +#pragma once +#endif + +#include +#include +#include +#include +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/function/function_base.hpp b/deal.II/contrib/boost/include/boost/function/function_base.hpp index c4663c35a8..eb201a80e9 100644 --- a/deal.II/contrib/boost/include/boost/function/function_base.hpp +++ b/deal.II/contrib/boost/include/boost/function/function_base.hpp @@ -15,8 +15,8 @@ #include #include #include -#include #include +#include #include #include #include @@ -54,7 +54,9 @@ // Borrowed from Boost.Python library: determines the cases where we // need to use std::type_info::name to compare instead of operator==. -# if (defined(__GNUC__) && __GNUC__ >= 3) \ +#if defined( BOOST_NO_TYPEID ) +# define BOOST_FUNCTION_COMPARE_TYPE_ID(X,Y) ((X)==(Y)) +#elif (defined(__GNUC__) && __GNUC__ >= 3) \ || defined(_AIX) \ || ( defined(__sgi) && defined(__host_mips)) # include @@ -103,7 +105,7 @@ namespace boost { // For pointers to std::type_info objects struct type_t { // (get_functor_type_tag, check_functor_type_tag). - const BOOST_FUNCTION_STD_NS::type_info* type; + const detail::sp_typeinfo* type; // Whether the type is const-qualified. bool const_qualified; @@ -215,12 +217,12 @@ namespace boost { case check_functor_type_tag: { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; // Check whether we have the same type. We can add // cv-qualifiers, but we can't take them away. - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(F)) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(F)) && (!in_buffer.obj_ref.is_const_qualified || out_buffer.type.const_qualified) && (!in_buffer.obj_ref.is_volatile_qualified @@ -232,7 +234,7 @@ namespace boost { return; case get_functor_type_tag: - out_buffer.type.type = &typeid(F); + out_buffer.type.type = &BOOST_SP_TYPEID(F); out_buffer.type.const_qualified = in_buffer.obj_ref.is_const_qualified; out_buffer.type.volatile_qualified = in_buffer.obj_ref.is_volatile_qualified; return; @@ -292,14 +294,14 @@ namespace boost { } else if (op == destroy_functor_tag) out_buffer.func_ptr = 0; else if (op == check_functor_type_tag) { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = &in_buffer.func_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &typeid(Functor); + out_buffer.type.type = &BOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -322,14 +324,14 @@ namespace boost { // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type. reinterpret_cast(&out_buffer.data)->~Functor(); } else if (op == check_functor_type_tag) { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = &in_buffer.data; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &typeid(Functor); + out_buffer.type.type = &BOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -381,14 +383,14 @@ namespace boost { delete f; out_buffer.obj_ptr = 0; } else if (op == check_functor_type_tag) { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = in_buffer.obj_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &typeid(Functor); + out_buffer.type.type = &BOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -423,7 +425,7 @@ namespace boost { typedef typename get_function_tag::type tag_type; switch (op) { case get_functor_type_tag: - out_buffer.type.type = &typeid(functor_type); + out_buffer.type.type = &BOOST_SP_TYPEID(functor_type); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; return; @@ -492,14 +494,14 @@ namespace boost { wrapper_allocator.deallocate(victim,1); out_buffer.obj_ptr = 0; } else if (op == check_functor_type_tag) { - const BOOST_FUNCTION_STD_NS::type_info& check_type + const detail::sp_typeinfo& check_type = *out_buffer.type.type; - if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, typeid(Functor))) + if (BOOST_FUNCTION_COMPARE_TYPE_ID(check_type, BOOST_SP_TYPEID(Functor))) out_buffer.obj_ptr = in_buffer.obj_ptr; else out_buffer.obj_ptr = 0; } else /* op == get_functor_type_tag */ { - out_buffer.type.type = &typeid(Functor); + out_buffer.type.type = &BOOST_SP_TYPEID(Functor); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; } @@ -526,7 +528,7 @@ namespace boost { typedef typename get_function_tag::type tag_type; switch (op) { case get_functor_type_tag: - out_buffer.type.type = &typeid(functor_type); + out_buffer.type.type = &BOOST_SP_TYPEID(functor_type); out_buffer.type.const_qualified = false; out_buffer.type.volatile_qualified = false; return; @@ -627,11 +629,11 @@ public: /** Determine if the function is empty (i.e., has no target). */ bool empty() const { return !vtable; } - /** Retrieve the type of the stored function object, or typeid(void) + /** Retrieve the type of the stored function object, or BOOST_SP_TYPEID(void) if this is empty. */ - const BOOST_FUNCTION_STD_NS::type_info& target_type() const + const detail::sp_typeinfo& target_type() const { - if (!vtable) return typeid(void); + if (!vtable) return BOOST_SP_TYPEID(void); detail::function::function_buffer type; get_vtable()->manager(functor, type, detail::function::get_functor_type_tag); @@ -644,7 +646,7 @@ public: if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.type.type = &typeid(Functor); + type_result.type.type = &BOOST_SP_TYPEID(Functor); type_result.type.const_qualified = is_const::value; type_result.type.volatile_qualified = is_volatile::value; get_vtable()->manager(functor, type_result, @@ -662,7 +664,7 @@ public: if (!vtable) return 0; detail::function::function_buffer type_result; - type_result.type.type = &typeid(Functor); + type_result.type.type = &BOOST_SP_TYPEID(Functor); type_result.type.const_qualified = true; type_result.type.volatile_qualified = is_volatile::value; get_vtable()->manager(functor, type_result, diff --git a/deal.II/contrib/boost/include/boost/functional/factory.hpp b/deal.II/contrib/boost/include/boost/functional/factory.hpp new file mode 100644 index 0000000000..4aa4267b6a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/functional/factory.hpp @@ -0,0 +1,163 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#ifndef BOOST_FUNCTIONAL_FACTORY_HPP_INCLUDED +# ifndef BOOST_PP_IS_ITERATING + +# include +# include +# include + +# include +# include +# include +# include +# include +# include + +# ifndef BOOST_FUNCTIONAL_FACTORY_MAX_ARITY +# define BOOST_FUNCTIONAL_FACTORY_MAX_ARITY 10 +# elif BOOST_FUNCTIONAL_FACTORY_MAX_ARITY < 3 +# undef BOOST_FUNCTIONAL_FACTORY_MAX_ARITY +# define BOOST_FUNCTIONAL_FACTORY_MAX_ARITY 3 +# endif + +namespace boost +{ + enum factory_alloc_propagation + { + factory_alloc_for_pointee_and_deleter, + factory_passes_alloc_to_smart_pointer + }; + + template< typename Pointer, class Allocator = boost::none_t, + factory_alloc_propagation AP = factory_alloc_for_pointee_and_deleter > + class factory; + + //----- ---- --- -- - - - - + + template< typename Pointer, factory_alloc_propagation AP > + class factory + { + public: + typedef typename boost::remove_cv::type result_type; + typedef typename boost::pointee::type value_type; + + factory() + { } + +# define BOOST_PP_FILENAME_1 +# define BOOST_PP_ITERATION_LIMITS (0,BOOST_FUNCTIONAL_FACTORY_MAX_ARITY) +# include BOOST_PP_ITERATE() + }; + + template< class Pointer, class Allocator, factory_alloc_propagation AP > + class factory + : private Allocator::template rebind< typename boost::pointee< + typename boost::remove_cv::type >::type >::other + { + public: + typedef typename boost::remove_cv::type result_type; + typedef typename boost::pointee::type value_type; + + typedef typename Allocator::template rebind::other + allocator_type; + + explicit factory(allocator_type const & a = allocator_type()) + : allocator_type(a) + { } + + private: + + struct deleter + : allocator_type + { + inline deleter(allocator_type const& that) + : allocator_type(that) + { } + + allocator_type& get_allocator() const + { + return *const_cast( + static_cast(this)); + } + + void operator()(value_type* ptr) const + { + if (!! ptr) ptr->~value_type(); + const_cast(static_cast( + this))->deallocate(ptr,1); + } + }; + + inline allocator_type& get_allocator() const + { + return *const_cast( + static_cast(this)); + } + + inline result_type make_pointer(value_type* ptr, boost::non_type< + factory_alloc_propagation,factory_passes_alloc_to_smart_pointer>) + const + { + return result_type(ptr,deleter(this->get_allocator())); + } + inline result_type make_pointer(value_type* ptr, boost::non_type< + factory_alloc_propagation,factory_alloc_for_pointee_and_deleter>) + const + { + return result_type(ptr,deleter(this->get_allocator()), + this->get_allocator()); + } + + public: + +# define BOOST_TMP_MACRO +# define BOOST_PP_FILENAME_1 +# define BOOST_PP_ITERATION_LIMITS (0,BOOST_FUNCTIONAL_FACTORY_MAX_ARITY) +# include BOOST_PP_ITERATE() +# undef BOOST_TMP_MACRO + }; + + template< typename Pointer, class Allocator, factory_alloc_propagation AP > + class factory; + // forbidden, would create a dangling reference +} + +# define BOOST_FUNCTIONAL_FACTORY_HPP_INCLUDED +# else // defined(BOOST_PP_IS_ITERATING) +# define N BOOST_PP_ITERATION() +# if !defined(BOOST_TMP_MACRO) +# if N > 0 + template< BOOST_PP_ENUM_PARAMS(N, typename T) > +# endif + inline result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const + { + return result_type( new value_type(BOOST_PP_ENUM_PARAMS(N,a)) ); + } +# else // defined(BOOST_TMP_MACRO) +# if N > 0 + template< BOOST_PP_ENUM_PARAMS(N, typename T) > +# endif + inline result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const + { + value_type* memory = this->get_allocator().allocate(1); + try + { + return make_pointer( + new(memory) value_type(BOOST_PP_ENUM_PARAMS(N,a)), + boost::non_type() ); + } + catch (...) { this->get_allocator().deallocate(memory,1); throw; } + } +# endif +# undef N +# endif // defined(BOOST_PP_IS_ITERATING) + +#endif // include guard + diff --git a/deal.II/contrib/boost/include/boost/functional/forward_adapter.hpp b/deal.II/contrib/boost/include/boost/functional/forward_adapter.hpp new file mode 100644 index 0000000000..c6e61a98df --- /dev/null +++ b/deal.II/contrib/boost/include/boost/functional/forward_adapter.hpp @@ -0,0 +1,472 @@ +/*============================================================================= + Copyright (c) 2007-2008 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#ifndef BOOST_FUNCTIONAL_FORWARD_ADAPTER_HPP_INCLUDED +# ifndef BOOST_PP_IS_ITERATING + +# include +# include + +# include +# include +# include +# include +# include + +# include + +# ifndef BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY +# define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 6 +# elif BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY < 3 +# undef BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY +# define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 3 +# endif + + +namespace boost +{ + template< typename Function, int Arity_Or_MinArity = -1, int MaxArity = -1 > + class forward_adapter; + + //----- ---- --- -- - - - - + + namespace detail + { + template< class MostDerived, typename Function, typename FunctionConst, + int Arity, int MinArity > + struct forward_adapter_impl; + + struct forward_adapter_result + { + template< typename Sig > struct apply; + + // Utility metafunction for qualification adjustment on arguments + template< typename T > struct q { typedef T const t; }; + template< typename T > struct q { typedef T const t; }; + template< typename T > struct q { typedef T t; }; + + // Utility metafunction to choose target function qualification + template< typename T > struct c + { typedef typename T::target_function_t t; }; + template< typename T > struct c + { typedef typename T::target_function_t t; }; + template< typename T > struct c + { typedef typename T::target_function_const_t t; }; + template< typename T > struct c + { typedef typename T::target_function_const_t t; }; + }; + } + +# define BOOST_TMP_MACRO(f,fn,fc) \ + boost::detail::forward_adapter_impl< \ + forward_adapter, fn, fc, \ + (MaxArity!=-1? MaxArity :Arity_Or_MinArity!=-1? Arity_Or_MinArity \ + :BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY), \ + (Arity_Or_MinArity!=-1? Arity_Or_MinArity : 0) > + + template< typename Function, int Arity_Or_MinArity, int MaxArity > + class forward_adapter + : public BOOST_TMP_MACRO(Function,Function,Function const) + , private Function + { + public: + forward_adapter(Function const& f = Function()) + : Function(f) + { } + + typedef Function target_function_t; + typedef Function const target_function_const_t; + + Function & target_function() { return *this; } + Function const & target_function() const { return *this; } + + template< typename Sig > struct result + : detail::forward_adapter_result::template apply + { }; + + using BOOST_TMP_MACRO(Function,Function, Function const)::operator(); + }; + template< typename Function, int Arity_Or_MinArity, int MaxArity > + class forward_adapter< Function const, Arity_Or_MinArity, MaxArity > + : public BOOST_TMP_MACRO(Function const, Function const, Function const) + , private Function + { + public: + forward_adapter(Function const& f = Function()) + : Function(f) + { } + + typedef Function const target_function_t; + typedef Function const target_function_const_t; + + Function const & target_function() const { return *this; } + + template< typename Sig > struct result + : detail::forward_adapter_result::template apply + { }; + + using BOOST_TMP_MACRO(Function const,Function const, Function const) + ::operator(); + }; + template< typename Function, int Arity_Or_MinArity, int MaxArity > + class forward_adapter< Function &, Arity_Or_MinArity, MaxArity > + : public BOOST_TMP_MACRO(Function&, Function, Function) + { + Function& ref_function; + public: + forward_adapter(Function& f) + : ref_function(f) + { } + + typedef Function target_function_t; + typedef Function target_function_const_t; + + Function & target_function() const { return this->ref_function; } + + template< typename Sig > struct result + : detail::forward_adapter_result::template apply + { }; + + using BOOST_TMP_MACRO(Function&, Function, Function)::operator(); + }; + + #undef BOOST_TMP_MACRO + + namespace detail + { + template< class Self > + struct forward_adapter_result::apply< Self() > + : boost::result_of< typename c::t() > + { }; + + template< class MD, class F, class FC > + struct forward_adapter_impl + { + inline typename boost::result_of< FC() >::type + operator()() const + { + return static_cast(this)->target_function()(); + } + + inline typename boost::result_of< F() >::type + operator()() + { + return static_cast(this)->target_function()(); + } + + // closing brace gets generated by preprocessing code, below + +# define BOOST_TMP_MACRO(tpl_params,arg_types,params,args) \ + template< tpl_params > \ + inline typename boost::result_of< FC(arg_types) >::type \ + operator()(params) const \ + { \ + return static_cast(this)->target_function()(args); \ + } \ + template< tpl_params > \ + inline typename boost::result_of< F(arg_types)>::type \ + operator()(params) \ + { \ + return static_cast(this)->target_function()(args); \ + } + +# // This is the total number of iterations we need +# define count ((1 << BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY+1)-2) + +# // Chain file iteration to virtually one loop +# if BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY <= 7 +# define limit1 count +# define limit2 0 +# define limit3 0 +# else +# if BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY <= 15 +# define limit1 (count >> 8) +# define limit2 255 +# define limit3 0 +# else +# define limit1 (count >> 16) +# define limit2 255 +# define limit3 255 +# endif +# endif + +# define N 0 + +# define BOOST_PP_FILENAME_1 +# define BOOST_PP_ITERATION_LIMITS (0,limit1) +# include BOOST_PP_ITERATE() + +# undef N +# undef limit3 +# undef limit2 +# undef limit1 +# undef count +# undef BOOST_TMP_MACRO + + }; + + } // namespace detail + + template + struct result_of const ()> + : boost::detail::forward_adapter_result::template apply< + boost::forward_adapter const () > + { }; + template + struct result_of()> + : boost::detail::forward_adapter_result::template apply< + boost::forward_adapter() > + { }; + template + struct result_of const& ()> + : boost::detail::forward_adapter_result::template apply< + boost::forward_adapter const () > + { }; + template + struct result_of& ()> + : boost::detail::forward_adapter_result::template apply< + boost::forward_adapter() > + { }; +} + +# define BOOST_FUNCTIONAL_FORWARD_ADAPTER_HPP_INCLUDED + +# elif BOOST_PP_ITERATION_DEPTH() == 1 && limit2 +# define BOOST_PP_FILENAME_2 +# define BOOST_PP_ITERATION_LIMITS (0,limit2) +# include BOOST_PP_ITERATE() +# elif BOOST_PP_ITERATION_DEPTH() == 2 && limit3 +# define BOOST_PP_FILENAME_3 +# define BOOST_PP_ITERATION_LIMITS (0,limit3) +# include BOOST_PP_ITERATE() + +# else + +# // I is the loop counter +# if limit2 && limit3 +# define I (BOOST_PP_ITERATION_1 << 16 | BOOST_PP_ITERATION_2 << 8 | \ + BOOST_PP_ITERATION_3) +# elif limit2 +# define I (BOOST_PP_ITERATION_1 << 8 | BOOST_PP_ITERATION_2) +# else +# define I BOOST_PP_ITERATION_1 +# endif + +# if I < count + +# // Done for this arity? Increment N +# if (I+2 >> N+1) +# if N == 0 +# undef N +# define N 1 +# elif N == 1 +# undef N +# define N 2 +# elif N == 2 +# undef N +# define N 3 +# elif N == 3 +# undef N +# define N 4 +# elif N == 4 +# undef N +# define N 5 +# elif N == 5 +# undef N +# define N 6 +# elif N == 6 +# undef N +# define N 7 +# elif N == 7 +# undef N +# define N 8 +# elif N == 8 +# undef N +# define N 9 +# elif N == 9 +# undef N +# define N 10 +# elif N == 10 +# undef N +# define N 11 +# elif N == 11 +# undef N +# define N 12 +# elif N == 12 +# undef N +# define N 13 +# elif N == 13 +# undef N +# define N 14 +# elif N == 14 +# undef N +# define N 15 +# elif N == 15 +# undef N +# define N 16 +# endif + + }; + + template< class Self, BOOST_PP_ENUM_PARAMS(N,typename T) > + struct forward_adapter_result::apply< Self(BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of< + typename c::t(BOOST_PP_ENUM_BINARY_PARAMS(N, + typename q::t& BOOST_PP_INTERCEPT)) > + { }; + + template< class MD, class F, class FC > + struct forward_adapter_impl + { + template< BOOST_PP_ENUM_PARAMS(N,typename T) > + inline typename boost::result_of< F( + BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT)) >::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT)); + }; + + template< class MD, class F, class FC, int MinArity > + struct forward_adapter_impl + : forward_adapter_impl + { + using forward_adapter_impl::operator(); + +# endif + +# // Zero based count for each arity would be I-(1< + inline typename boost::result_of< FC(BOOST_PP_ENUM_PARAMS(N,PT)) + >::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a)) const + { + return static_cast(this) + ->target_function()(BOOST_PP_ENUM_PARAMS(N,a)); + } + template< BOOST_PP_ENUM_PARAMS(N,typename T) > + inline typename boost::result_of< F(BOOST_PP_ENUM_PARAMS(N,PT)) + >::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a)) + { + return static_cast(this) + ->target_function()(BOOST_PP_ENUM_PARAMS(N,a)); + } +# else + BOOST_TMP_MACRO(BOOST_PP_ENUM_PARAMS(N,typename T), + BOOST_PP_ENUM_PARAMS(N,PT), BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a), + BOOST_PP_ENUM_PARAMS(N,a) ) + // ...generates uglier code but is faster - it caches ENUM_* +# endif + +# undef PT0 +# undef PT1 +# undef PT2 +# undef PT3 +# undef PT4 +# undef PT5 +# undef PT6 +# undef PT7 +# undef PT8 +# undef PT9 +# undef PT10 +# undef PT11 +# undef PT12 +# undef PT13 +# undef PT14 +# undef PT15 + +# endif // I < count + +# undef I +# endif // defined(BOOST_PP_IS_ITERATING) + +#endif // include guard + diff --git a/deal.II/contrib/boost/include/boost/functional/hash/detail/float_functions.hpp b/deal.II/contrib/boost/include/boost/functional/hash/detail/float_functions.hpp index 01cac09722..ae03ff091e 100644 --- a/deal.II/contrib/boost/include/boost/functional/hash/detail/float_functions.hpp +++ b/deal.II/contrib/boost/include/boost/functional/hash/detail/float_functions.hpp @@ -84,7 +84,7 @@ namespace boost { // the boost namespace they'll always be preferable to any other function // (since the arguments are built in types, ADL can't be used). -namespace BOOST_HASH_DETECT_FLOAT_FUNCTIONS { +namespace boost_hash_detect_float_functions { template boost::hash_detail::not_found ldexp(Float, int); template boost::hash_detail::not_found frexp(Float, int*); } @@ -103,7 +103,7 @@ namespace BOOST_HASH_DETECT_FLOAT_FUNCTIONS { // happen mainly when there's a template in the same namesapce. #define BOOST_HASH_CALL_FLOAT_FUNC(cpp_func, c99_func, type1, type2) \ -namespace BOOST_HASH_DETECT_FLOAT_FUNCTIONS { \ +namespace boost_hash_detect_float_functions { \ template \ boost::hash_detail::not_found c99_func(Float, type2); \ } \ @@ -112,7 +112,7 @@ namespace boost { \ namespace hash_detail { \ namespace c99_func##_detect { \ using namespace std; \ - using namespace BOOST_HASH_DETECT_FLOAT_FUNCTIONS; \ + using namespace boost_hash_detect_float_functions; \ \ struct check { \ static type1 x; \ diff --git a/deal.II/contrib/boost/include/boost/functional/hash/detail/hash_float_generic.hpp b/deal.II/contrib/boost/include/boost/functional/hash/detail/hash_float_generic.hpp index f9acee9cd1..fdbf53fe57 100644 --- a/deal.II/contrib/boost/include/boost/functional/hash/detail/hash_float_generic.hpp +++ b/deal.II/contrib/boost/include/boost/functional/hash/detail/hash_float_generic.hpp @@ -51,17 +51,15 @@ namespace boost limits::min_exponent; } - // The result of frexp is always between 0.5 and 1, so its - // top bit will always be 1. Subtract by 0.5 to remove that. - v -= T(0.5); - v = ldexp(v, limits::digits + 1); + v = ldexp(v, limits::digits); std::size_t seed = static_cast(v); v -= seed; // ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1; std::size_t const length = (limits::digits * - boost::static_log2::radix>::value - 1) + boost::static_log2::radix>::value + + limits::digits - 1) / limits::digits; for(std::size_t i = 0; i != length; ++i) diff --git a/deal.II/contrib/boost/include/boost/functional/hash/hash.hpp b/deal.II/contrib/boost/include/boost/functional/hash/hash.hpp index 6784f3ef6b..e85ca5ae0b 100644 --- a/deal.II/contrib/boost/include/boost/functional/hash/hash.hpp +++ b/deal.II/contrib/boost/include/boost/functional/hash/hash.hpp @@ -20,7 +20,8 @@ #include #endif -#if BOOST_WORKAROUND(__GNUC__, < 3) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) +#if BOOST_WORKAROUND(__GNUC__, < 3) \ + && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) #define BOOST_HASH_CHAR_TRAITS string_char_traits #else #define BOOST_HASH_CHAR_TRAITS char_traits @@ -43,7 +44,7 @@ namespace boost std::size_t hash_value(wchar_t); #endif -#if defined(BOOST_HAS_LONG_LONG) +#if !defined(BOOST_NO_LONG_LONG) std::size_t hash_value(boost::long_long_type); std::size_t hash_value(boost::ulong_long_type); #endif @@ -67,7 +68,8 @@ namespace boost std::size_t hash_value(long double v); template - std::size_t hash_value(std::basic_string, A> const&); + std::size_t hash_value( + std::basic_string, A> const&); // Implementation @@ -172,7 +174,7 @@ namespace boost } #endif -#if defined(BOOST_HAS_LONG_LONG) +#if !defined(BOOST_NO_LONG_LONG) inline std::size_t hash_value(boost::long_long_type v) { return hash_detail::hash_value_signed(v); @@ -197,6 +199,16 @@ namespace boost return x + (x >> 3); } +#if defined(BOOST_MSVC) +#pragma warning(push) +#if BOOST_MSVC <= 1400 +#pragma warning(disable:4267) // 'argument' : conversion from 'size_t' to + // 'unsigned int', possible loss of data + // A misguided attempt to detect 64-bit + // incompatability. +#endif +#endif + #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) template inline void hash_combine(std::size_t& seed, T& v) @@ -209,6 +221,10 @@ namespace boost seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2); } +#if defined(BOOST_MSVC) +#pragma warning(pop) +#endif + template inline std::size_t hash_range(It first, It last) { @@ -272,7 +288,8 @@ namespace boost #endif template - inline std::size_t hash_value(std::basic_string, A> const& v) + inline std::size_t hash_value( + std::basic_string, A> const& v) { return hash_range(v.begin(), v.end()); } @@ -297,8 +314,8 @@ namespace boost // // Define the specializations required by the standard. The general purpose - // boost::hash is defined later in extensions.hpp if BOOST_HASH_NO_EXTENSIONS - // is not defined. + // boost::hash is defined later in extensions.hpp if + // BOOST_HASH_NO_EXTENSIONS is not defined. // BOOST_HASH_SPECIALIZE - define a specialization for a type which is // passed by copy. @@ -391,7 +408,7 @@ namespace boost BOOST_HASH_SPECIALIZE_REF(std::wstring) #endif -#if defined(BOOST_HAS_LONG_LONG) +#if !defined(BOOST_NO_LONG_LONG) BOOST_HASH_SPECIALIZE(boost::long_long_type) BOOST_HASH_SPECIALIZE(boost::ulong_long_type) #endif diff --git a/deal.II/contrib/boost/include/boost/functional/lightweight_forward_adapter.hpp b/deal.II/contrib/boost/include/boost/functional/lightweight_forward_adapter.hpp new file mode 100644 index 0000000000..d21ac421b7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/functional/lightweight_forward_adapter.hpp @@ -0,0 +1,259 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#ifndef BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_HPP_INCLUDED +# ifndef BOOST_PP_IS_ITERATING + +# include +# include + +# include +# include +# include +# include +# include +# include + +# include +# include + +# ifndef BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY +# define BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY 10 +# elif BOOST_FUNCTIONAL_FORDWARD_ADAPTER_MAX_ARITY < 3 +# undef BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY +# define BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY 3 +# endif + +namespace boost +{ + template< typename Function, int Arity_Or_MinArity = -1, int MaxArity = -1 > + class lightweight_forward_adapter; + + //----- ---- --- -- - - - - + + namespace detail + { + template< class MostDerived, typename Function, typename FunctionConst, + int Arity, int MinArity > + struct lightweight_forward_adapter_impl; + + struct lightweight_forward_adapter_result + { + template< typename Sig > struct apply; + + // Utility metafunction for argument transform + template< typename T > struct x { typedef T const& t; }; + template< typename T > struct x< boost::reference_wrapper > + { typedef T& t; }; + template< typename T > struct x : x { }; + template< typename T > struct x : x { }; + template< typename T > struct x : x { }; + + // Utility metafunction to choose target function qualification + template< typename T > struct c + { typedef typename T::target_function_t t; }; + template< typename T > struct c + { typedef typename T::target_function_t t; }; + template< typename T > struct c + { typedef typename T::target_function_const_t t; }; + template< typename T > struct c + { typedef typename T::target_function_const_t t; }; + }; + } + +# define BOOST_TMP_MACRO(f,fn,fc) \ + boost::detail::lightweight_forward_adapter_impl< \ + lightweight_forward_adapter, fn, fc, \ + (MaxArity!=-1? MaxArity :Arity_Or_MinArity!=-1? Arity_Or_MinArity \ + :BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY), \ + (Arity_Or_MinArity!=-1? Arity_Or_MinArity : 0) > + + template< typename Function, int Arity_Or_MinArity, int MaxArity > + class lightweight_forward_adapter + : public BOOST_TMP_MACRO(Function,Function,Function const) + , private Function + { + public: + lightweight_forward_adapter(Function const& f = Function()) + : Function(f) + { } + + typedef Function target_function_t; + typedef Function const target_function_const_t; + + Function & target_function() { return *this; } + Function const & target_function() const { return *this; } + + template< typename Sig > struct result + : detail::lightweight_forward_adapter_result::template apply + { }; + + using BOOST_TMP_MACRO(Function,Function, Function const)::operator(); + }; + template< typename Function, int Arity_Or_MinArity, int MaxArity > + class lightweight_forward_adapter< Function const, Arity_Or_MinArity, + MaxArity > + : public BOOST_TMP_MACRO(Function const, Function const, Function const) + , private Function + { + public: + lightweight_forward_adapter(Function const& f = Function()) + : Function(f) + { } + + typedef Function const target_function_t; + typedef Function const target_function_const_t; + + Function const & target_function() const { return *this; } + + template< typename Sig > struct result + : detail::lightweight_forward_adapter_result::template apply + { }; + + using BOOST_TMP_MACRO(Function const,Function const, Function const) + ::operator(); + }; + template< typename Function, int Arity_Or_MinArity, int MaxArity > + class lightweight_forward_adapter< Function &, Arity_Or_MinArity, MaxArity > + : public BOOST_TMP_MACRO(Function&, Function, Function) + { + Function& ref_function; + public: + lightweight_forward_adapter(Function& f) + : ref_function(f) + { } + + typedef Function target_function_t; + typedef Function target_function_const_t; + + Function & target_function() const { return this->ref_function; } + + template< typename Sig > struct result + : detail::lightweight_forward_adapter_result::template apply + { }; + + using BOOST_TMP_MACRO(Function&, Function, Function)::operator(); + }; + + #undef BOOST_TMP_MACRO + + namespace detail + { + template< class Self > + struct lightweight_forward_adapter_result::apply< Self() > + : boost::result_of< typename c::t() > + { }; + + template< class MD, class F, class FC > + struct lightweight_forward_adapter_impl + : lightweight_forward_adapter_result + { + inline typename boost::result_of< FC() >::type + operator()() const + { + return static_cast(this)->target_function()(); + } + + inline typename boost::result_of< F() >::type + operator()() + { + return static_cast(this)->target_function()(); + } + }; + +# define BOOST_PP_FILENAME_1 \ + +# define BOOST_PP_ITERATION_LIMITS \ + (1,BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY) +# include BOOST_PP_ITERATE() + + } // namespace detail + + template + struct result_of const ()> + : boost::detail::lightweight_forward_adapter_result::template apply< + boost::lightweight_forward_adapter const () > + { }; + template + struct result_of()> + : boost::detail::lightweight_forward_adapter_result::template apply< + boost::lightweight_forward_adapter() > + { }; + template + struct result_of const& ()> + : boost::detail::lightweight_forward_adapter_result::template apply< + boost::lightweight_forward_adapter const () > + { }; + template + struct result_of& ()> + : boost::detail::lightweight_forward_adapter_result::template apply< + boost::lightweight_forward_adapter() > + { }; +} + +# define BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_HPP_INCLUDED + +# else // defined(BOOST_PP_IS_ITERATING) +# define N BOOST_PP_ITERATION() + + template< class Self, BOOST_PP_ENUM_PARAMS(N,typename T) > + struct lightweight_forward_adapter_result::apply< + Self (BOOST_PP_ENUM_PARAMS(N,T)) > + : boost::result_of< + typename c::t (BOOST_PP_ENUM_BINARY_PARAMS(N, + typename x::t BOOST_PP_INTERCEPT)) > + { }; + + template< class MD, class F, class FC > + struct lightweight_forward_adapter_impl + : lightweight_forward_adapter_result + { + template< BOOST_PP_ENUM_PARAMS(N,typename T) > + inline typename boost::result_of< F(BOOST_PP_ENUM_BINARY_PARAMS(N, + T,const& BOOST_PP_INTERCEPT)) >::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT)); + }; + + template< class MD, class F, class FC, int MinArity > + struct lightweight_forward_adapter_impl + : lightweight_forward_adapter_impl + { + using lightweight_forward_adapter_impl::operator(); + +# define M(z,i,d) \ + static_cast::t>(a##i) + + template< BOOST_PP_ENUM_PARAMS(N,typename T) > + inline typename lightweight_forward_adapter_result::template apply< + MD const (BOOST_PP_ENUM_BINARY_PARAMS(N, + T,const& BOOST_PP_INTERCEPT)) >::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const& a)) const + { + typedef lightweight_forward_adapter_result _; + return static_cast(this)->target_function()( + BOOST_PP_ENUM(N,M,_)); + } + template< BOOST_PP_ENUM_PARAMS(N,typename T) > + inline typename lightweight_forward_adapter_result::template apply< + MD (BOOST_PP_ENUM_BINARY_PARAMS(N, + T,const& BOOST_PP_INTERCEPT)) >::type + operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const& a)) + { + typedef lightweight_forward_adapter_result _; + return static_cast(this)->target_function()( + BOOST_PP_ENUM(N,M,_)); + } +# undef M + }; + +# undef N +# endif // defined(BOOST_PP_IS_ITERATING) + +#endif // include guard + diff --git a/deal.II/contrib/boost/include/boost/functional/value_factory.hpp b/deal.II/contrib/boost/include/boost/functional/value_factory.hpp new file mode 100644 index 0000000000..6047908ac3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/functional/value_factory.hpp @@ -0,0 +1,70 @@ +/*============================================================================= + Copyright (c) 2007 Tobias Schwinger + + Use modification and distribution are subject to the Boost Software + License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at + http://www.boost.org/LICENSE_1_0.txt). +==============================================================================*/ + +#ifndef BOOST_FUNCTIONAL_VALUE_FACTORY_HPP_INCLUDED +# ifndef BOOST_PP_IS_ITERATING + +# include +# include +# include + +# include +# include +# include +# include +# include +# include + +# ifndef BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY +# define BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY 10 +# elif BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY < 3 +# undef BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY +# define BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY 3 +# endif + +namespace boost +{ + template< typename T > + class value_factory; + + //----- ---- --- -- - - - - + + template< typename T > + class value_factory + { + public: + typedef T result_type; + + value_factory() + { } + +# define BOOST_PP_FILENAME_1 +# define BOOST_PP_ITERATION_LIMITS (0,BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY) +# include BOOST_PP_ITERATE() + }; + + template< typename T > class value_factory; + // forbidden, would create a dangling reference +} +# define BOOST_FUNCTIONAL_VALUE_FACTORY_HPP_INCLUDED +# else // defined(BOOST_PP_IS_ITERATING) + +# define N BOOST_PP_ITERATION() +# if N > 0 + template< BOOST_PP_ENUM_PARAMS(N, typename T) > +# endif + inline result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const + { + return result_type(BOOST_PP_ENUM_PARAMS(N,a)); + } +# undef N + +# endif // defined(BOOST_PP_IS_ITERATING) + +#endif // include guard + diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted.hpp index c343405c98..0dd1f0e787 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted.hpp @@ -13,5 +13,6 @@ #include #include #include +#include #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array.hpp index 2be9d4ba49..cb82809037 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/array.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array.hpp @@ -1,6 +1,7 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -8,15 +9,19 @@ #if !defined(BOOST_FUSION_ARRAY_27122005_1035) #define BOOST_FUSION_ARRAY_27122005_1035 -#include +//For backwards compatibility +#include + #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/at_impl.hpp new file mode 100644 index 0000000000..12f0372670 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/at_impl.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_AT_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_AT_IMPL_HPP + +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply + { + typedef typename + add_reference::type>::type + type; + + static type + call(Seq& seq) + { + return seq[N::value]; + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/begin_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/begin_impl.hpp new file mode 100644 index 0000000000..2ee4d707b1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/begin_impl.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_BEGIN_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_BEGIN_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef + basic_iterator< + po_array_iterator_tag + , random_access_traversal_tag + , Seq + , 0 + > + type; + + static type + call(Seq& seq) + { + return type(seq,0); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/category_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/category_of_impl.hpp new file mode 100644 index 0000000000..0a633a455d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/category_of_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_CATEGORY_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_CATEGORY_OF_IMPL_HPP + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + { + typedef random_access_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/deref_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/deref_impl.hpp new file mode 100644 index 0000000000..a58cf99001 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/deref_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_DEREF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_DEREF_IMPL_HPP + +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename + add_reference< + typename remove_extent::type + >::type + type; + + static type + call(It const& it) + { + return (*it.seq)[It::index::value]; + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/end_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/end_impl.hpp new file mode 100644 index 0000000000..5b367f9c00 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/end_impl.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_END_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_END_IMPL_HPP + +#include +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef + basic_iterator< + po_array_iterator_tag + , random_access_traversal_tag + , Seq + , extent::value-1>::value + > + type; + + static type + call(Seq& seq) + { + return type(seq,0); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/is_sequence_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/is_sequence_impl.hpp new file mode 100644 index 0000000000..d6de858561 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/is_sequence_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_IS_SEQUENCE_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_IS_SEQUENCE_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply + : mpl::true_ + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/is_view_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/is_view_impl.hpp new file mode 100644 index 0000000000..238eac0e58 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/is_view_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_IS_VIEW_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_IS_VIEW_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply + : mpl::false_ + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/size_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/size_impl.hpp new file mode 100644 index 0000000000..8be5a29d81 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/size_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_SIZE_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_SIZE_IMPL_HPP + +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct size_impl; + + template<> + struct size_impl + { + template + struct apply + : extent::value-1> + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/tag_of.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/tag_of.hpp index 62f81ea05e..7c732a7021 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/array/tag_of.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/tag_of.hpp @@ -1,39 +1,72 @@ /*============================================================================= - Copyright (c) 2001-2006 Joel de Guzman - Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(FUSION_SEQUENCE_TAG_OF_27122005_1030) -#define FUSION_SEQUENCE_TAG_OF_27122005_1030 -#include +#ifndef BOOST_FUSION_ADAPTED_ARRAY_TAG_OF_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_TAG_OF_HPP +#include #include -namespace boost -{ - template - class array; -} - -namespace boost { namespace fusion +namespace boost { - struct array_tag; - - namespace traits + namespace fusion { - template -#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) - struct tag_of, void > + struct po_array_tag; + struct po_array_iterator_tag; + struct random_access_traversal_tag; + struct fusion_sequence_tag; + + namespace traits + { +#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS + template + struct tag_of + { + typedef po_array_tag type; + }; + + template + struct tag_of + { + typedef po_array_tag type; + }; #else - struct tag_of > + template + struct tag_of + { + typedef po_array_tag type; + }; + + template + struct tag_of + { + typedef po_array_tag type; + }; #endif + } + } + + namespace mpl + { + template + struct sequence_tag; + + template + struct sequence_tag { - typedef array_tag type; + typedef fusion::po_array_tag type; + }; + + template + struct sequence_tag + { + typedef fusion::po_array_tag type; }; } -}} +} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/value_at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/value_at_impl.hpp new file mode 100644 index 0000000000..4e04c37a8f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/value_at_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_VALUE_AT_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_VALUE_AT_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + : remove_extent + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/array/value_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/array/value_of_impl.hpp new file mode 100644 index 0000000000..2bbddf235e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/array/value_of_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_ARRAY_VALUE_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_ARRAY_VALUE_OF_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + : remove_extent + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array.hpp new file mode 100644 index 0000000000..835135b9b2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BOOST_ARRAY_27122005_1035) +#define BOOST_FUSION_BOOST_ARRAY_27122005_1035 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/array_iterator.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/array_iterator.hpp new file mode 100644 index 0000000000..dbad7763b3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/array_iterator.hpp @@ -0,0 +1,107 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_ARRAY_ITERATOR_26122005_2250) +#define BOOST_FUSION_ARRAY_ITERATOR_26122005_2250 + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + struct random_access_traversal_tag; + + template + struct array_iterator + : iterator_facade, random_access_traversal_tag> + { + BOOST_MPL_ASSERT_RELATION(Pos, >=, 0); + BOOST_MPL_ASSERT_RELATION(Pos, <=, Array::static_size); + + typedef mpl::int_ index; + typedef Array array_type; + + array_iterator(Array& a) + : array(a) {} + + Array& array; + + template + struct value_of + { + typedef typename Iterator::array_type array_type; + typedef typename array_type::value_type type; + }; + + template + struct deref + { + typedef typename Iterator::array_type array_type; + typedef typename + mpl::if_< + is_const + , typename array_type::const_reference + , typename array_type::reference + >::type + type; + + static type + call(Iterator const & it) + { + return it.array[Iterator::index::value]; + } + }; + + template + struct advance + { + typedef typename Iterator::index index; + typedef typename Iterator::array_type array_type; + typedef array_iterator type; + + static type + call(Iterator const& i) + { + return type(i.array); + } + }; + + template + struct next : advance > {}; + + template + struct prior : advance > {}; + + template + struct distance : mpl::minus + { + typedef typename + mpl::minus< + typename I2::index, typename I1::index + >::type + type; + + static type + call(I1 const&, I2 const&) + { + return type(); + } + }; + + private: + + array_iterator& operator=(array_iterator const&); + }; +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp new file mode 100644 index 0000000000..16557a114f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/at_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_AT_IMPL_27122005_1241) +#define BOOST_FUSION_AT_IMPL_27122005_1241 + +#include + +#include + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template + struct at_impl; + + template<> + struct at_impl + { + template + struct apply + { + typedef typename mpl::if_< + is_const, + typename Sequence::const_reference, + typename Sequence::reference>::type type; + + static type + call(Sequence& seq) + { + return seq[N::value]; + } + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp new file mode 100644 index 0000000000..0798659ba7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/begin_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_BEGIN_IMPL_27122005_1117) +#define BOOST_FUSION_BEGIN_IMPL_27122005_1117 + +#include + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template + struct begin_impl; + + template <> + struct begin_impl + { + template + struct apply + { + typedef array_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/category_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/category_of_impl.hpp new file mode 100644 index 0000000000..35762a0306 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/category_of_impl.hpp @@ -0,0 +1,35 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_27122005_1044) +#define BOOST_FUSION_CATEGORY_OF_IMPL_27122005_1044 + +#include + +namespace boost { namespace fusion { + + struct boost_array_tag; + struct random_access_traversal_tag; + + namespace extension + { + template + struct category_of_impl; + + template<> + struct category_of_impl + { + template + struct apply + { + typedef random_access_traversal_tag type; + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp new file mode 100644 index 0000000000..35b1fdbc71 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/end_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_END_IMPL_27122005_1120) +#define BOOST_FUSION_END_IMPL_27122005_1120 + +#include + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template + struct end_impl; + + template <> + struct end_impl + { + template + struct apply + { + typedef array_iterator type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/is_sequence_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/is_sequence_impl.hpp new file mode 100644 index 0000000000..9301e81e6c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/is_sequence_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1648) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1648 + +#include + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/is_view_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/is_view_impl.hpp new file mode 100644 index 0000000000..6cb6b36ac7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/is_view_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_VIEW_IMPL_27042006_2221) +#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2221 + +#include + +namespace boost { namespace fusion +{ + struct boost_array_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::false_ + {}; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/size_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/size_impl.hpp new file mode 100644 index 0000000000..87cafdacd1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/size_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SIZE_IMPL_27122005_1251) +#define BOOST_FUSION_SIZE_IMPL_27122005_1251 + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template + struct size_impl; + + template<> + struct size_impl + { + template + struct apply : mpl::int_ {}; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/value_at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/value_at_impl.hpp new file mode 100644 index 0000000000..a35abc687f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/detail/value_at_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_IMPL_27122005_1256) +#define BOOST_FUSION_VALUE_AT_IMPL_27122005_1256 + +namespace boost { namespace fusion { + + struct boost_array_tag; + + namespace extension + { + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + { + typedef typename Sequence::value_type type; + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/tag_of.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/tag_of.hpp new file mode 100644 index 0000000000..d38cc80471 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_array/tag_of.hpp @@ -0,0 +1,58 @@ +/*============================================================================= + Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_SEQUENCE_TAG_OF_27122005_1030) +#define FUSION_SEQUENCE_TAG_OF_27122005_1030 + +#include + +#include + +namespace boost +{ + template + class array; +} + +namespace boost { namespace fusion +{ + struct boost_array_tag; + struct fusion_sequence_tag; + + namespace traits + { + template +#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) + struct tag_of, void > +#else + struct tag_of > +#endif + { + typedef boost_array_tag type; + }; + } +}} + +namespace boost { namespace mpl +{ + template + struct sequence_tag; + + template + struct sequence_tag > + { + typedef fusion::fusion_sequence_tag type; + }; + + template + struct sequence_tag const> + { + typedef fusion::fusion_sequence_tag type; + }; +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_tuple/tag_of.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_tuple/tag_of.hpp index efae06a22a..1183082d44 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/boost_tuple/tag_of.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/boost_tuple/tag_of.hpp @@ -26,6 +26,7 @@ namespace boost { namespace tuples namespace boost { namespace fusion { struct boost_tuple_tag; + struct fusion_sequence_tag; namespace traits { @@ -60,4 +61,54 @@ namespace boost { namespace fusion } }} +namespace boost { namespace mpl +{ + template + struct sequence_tag; + + template < + class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7, class T8, class T9 + > + struct sequence_tag > + { + typedef fusion::fusion_sequence_tag type; + }; + + template < + class T0, class T1, class T2, class T3, class T4, + class T5, class T6, class T7, class T8, class T9 + > + struct sequence_tag< + tuples::tuple const + > + { + typedef fusion::fusion_sequence_tag type; + }; + + template + struct sequence_tag > + { + typedef fusion::fusion_sequence_tag type; + }; + + template + struct sequence_tag const> + { + typedef fusion::fusion_sequence_tag type; + }; + + template <> + struct sequence_tag + { + typedef fusion::fusion_sequence_tag type; + }; + + template <> + struct sequence_tag + { + typedef fusion::fusion_sequence_tag type; + }; +}} + #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class.hpp index be973831ee..75150942c9 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/class.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class.hpp @@ -1,28 +1,18 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_CLASS_OCTOBER_4_2009_839PM) -#define BOOST_FUSION_CLASS_OCTOBER_4_2009_839PM -#include -#include -#include -#include +#ifndef BOOST_FUSION_ADAPTED_CLASS_HPP +#define BOOST_FUSION_ADAPTED_CLASS_HPP -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_assoc_class.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_assoc_class.hpp index 11f40ade5d..26eb3ae66e 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_assoc_class.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_assoc_class.hpp @@ -1,94 +1,76 @@ /*============================================================================= Copyright (c) 2001-2009 Joel de Guzman Copyright (c) 2007 Dan Marsden + Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_ADAPT_ASSOC_CLASS_OCTOBER_4_2009_840PM) -#define BOOST_FUSION_ADAPT_ASSOC_CLASS_OCTOBER_4_2009_840PM -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_HPP +#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_HPP #include -#include -#include +#include #include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace extension { - template - struct class_assoc_member; -}}} - - -#define BOOST_FUSION_ADAPT_ASSOC_CLASS(name, bseq) \ - BOOST_FUSION_ADAPT_ASSOC_CLASS_I( \ - name, BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_X bseq, 0)) \ - /***/ - -#define BOOST_FUSION_ADAPT_ASSOC_CLASS_X(x, y, z) ((x, y, z)) BOOST_FUSION_ADAPT_ASSOC_CLASS_Y -#define BOOST_FUSION_ADAPT_ASSOC_CLASS_Y(x, y, z) ((x, y, z)) BOOST_FUSION_ADAPT_ASSOC_CLASS_X -#define BOOST_FUSION_ADAPT_ASSOC_CLASS_X0 -#define BOOST_FUSION_ADAPT_ASSOC_CLASS_Y0 +#include +#include +#include -// BOOST_FUSION_ADAPT_ASSOC_CLASS_I generates the overarching structure and uses -// SEQ_FOR_EACH_I to generate the "linear" substructures. -// Thanks to Paul Mensonides for the PP macro help +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#define BOOST_FUSION_ADAPT_ASSOC_CLASS_I(name, seq) \ - namespace boost { namespace fusion { namespace traits \ - { \ - template <> \ - struct tag_of \ - { \ - typedef class_tag type; \ - }; \ - }}} \ - namespace boost { namespace fusion { namespace extension \ - { \ - template <> \ - struct class_size : mpl::int_ {}; \ - BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_ASSOC_CLASS_C, name, seq) \ - }}} \ - /***/ +#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0(A, B, C, D, E)\ + ((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1 +#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1(A, B, C, D, E)\ + ((A, B, C, D, E)) BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 +#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0_END +#define BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_1_END -#define BOOST_FUSION_ADAPT_ASSOC_CLASS_C(r, name, i, xy) \ - template <> \ - struct class_member \ - { \ - typedef BOOST_PP_TUPLE_ELEM(3, 0, xy) type; \ - static type& call(name& class_) \ - { \ - return class_.BOOST_PP_TUPLE_ELEM(3, 1, xy); \ - }; \ - }; \ - template<> \ - struct class_assoc_member \ +#define BOOST_FUSION_ADAPT_ASSOC_CLASS_C( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ + \ + BOOST_FUSION_ADAPT_CLASS_C_BASE(TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,5) \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct struct_assoc_key \ { \ - typedef BOOST_PP_TUPLE_ELEM(3, 0, xy) type; \ - static type& call(name& class_) \ - { \ - return class_.BOOST_PP_TUPLE_ELEM(3, 1, xy); \ - }; \ + typedef BOOST_PP_TUPLE_ELEM(5, 4, ATTRIBUTE) type; \ }; - /***/ + +#define BOOST_FUSION_ADAPT_ASSOC_TPL_CLASS( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (1)TEMPLATE_PARAMS_SEQ, \ + (1)NAME_SEQ, \ + assoc_struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_ASSOC_CLASS_C) + +#define BOOST_FUSION_ADAPT_ASSOC_CLASS(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + assoc_struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_CLASS_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_ASSOC_CLASS_C) #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_assoc_class_named.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_assoc_class_named.hpp new file mode 100644 index 0000000000..e73b1fe234 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_assoc_class_named.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_NAMED_HPP +#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_ASSOC_CLASS_NAMED_HPP + +#include +#include + +#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ + \ + BOOST_FUSION_ADAPT_ASSOC_CLASS( \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \ + ATTRIBUTES) + +#define BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_ASSOC_CLASS_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_class.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_class.hpp index c4e5c29fd2..f3ee7e9371 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_class.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_class.hpp @@ -1,104 +1,63 @@ /*============================================================================= Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2009-2010 Hartmut Kaiser + Copyright (c) 2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_ADAPT_CLASS_OCTOBER_4_2009_840PM) -#define BOOST_FUSION_ADAPT_CLASS_OCTOBER_4_2009_840PM -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_HPP +#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_HPP #include -#include -#include -#include -#include -#include -#include -#include -#include - -#define BOOST_FUSION_ADAPT_CLASS(name, bseq) \ - BOOST_FUSION_ADAPT_CLASS_I( \ - name, BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_X bseq, 0)) \ - /***/ - -#define BOOST_FUSION_ADAPT_CLASS_X(w, x, y, z) ((w, x, y, z)) BOOST_FUSION_ADAPT_CLASS_Y -#define BOOST_FUSION_ADAPT_CLASS_Y(w, x, y, z) ((w, x, y, z)) BOOST_FUSION_ADAPT_CLASS_X -#define BOOST_FUSION_ADAPT_CLASS_X0 -#define BOOST_FUSION_ADAPT_CLASS_Y0 - -// BOOST_FUSION_ADAPT_CLASS_I generates the overarching structure and uses -// SEQ_FOR_EACH_I to generate the "linear" substructures. -// Thanks to Paul Mensonides for the PP macro help - -#define BOOST_FUSION_ADAPT_CLASS_I(name, seq) \ - namespace boost { namespace fusion { namespace traits \ - { \ - template <> \ - struct tag_of \ - { \ - typedef class_tag type; \ - }; \ - }}} \ - namespace boost { namespace fusion { namespace extension \ - { \ - template <> \ - struct class_size : mpl::int_ {}; \ - BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_CLASS_C, name, seq) \ - }}} \ - /***/ +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_FUSION_ADAPT_CLASS_FILLER_0(A, B, C, D)\ + ((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_1 +#define BOOST_FUSION_ADAPT_CLASS_FILLER_1(A, B, C, D)\ + ((A, B, C, D)) BOOST_FUSION_ADAPT_CLASS_FILLER_0 +#define BOOST_FUSION_ADAPT_CLASS_FILLER_0_END +#define BOOST_FUSION_ADAPT_CLASS_FILLER_1_END + +#define BOOST_FUSION_ADAPT_CLASS_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ + BOOST_FUSION_ADAPT_CLASS_C_BASE( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE, 4) + +#define BOOST_FUSION_ADAPT_TPL_CLASS(TEMPLATE_PARAMS_SEQ, NAME_SEQ , ATTRIBUTES)\ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (1)TEMPLATE_PARAMS_SEQ, \ + (1)NAME_SEQ, \ + struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_CLASS_C) + +#define BOOST_FUSION_ADAPT_CLASS(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_CLASS_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_CLASS_C) -#define BOOST_FUSION_ADAPT_CLASS_C(r, name, i, xy) \ - template <> \ - struct class_member \ - { \ - typedef BOOST_PP_TUPLE_ELEM(4, 0, xy) type; \ - typedef BOOST_PP_TUPLE_ELEM(4, 1, xy) get_type; \ - struct proxy \ - { \ - typedef BOOST_PP_TUPLE_ELEM(4, 0, xy) type; \ - typedef BOOST_PP_TUPLE_ELEM(4, 1, xy) get_type; \ - typedef \ - add_reference::type>::type \ - cref_type; \ - \ - proxy(name& obj) : obj(obj) {} \ - name& obj; \ - \ - proxy& operator=(cref_type val) \ - { \ - BOOST_PP_TUPLE_ELEM(4, 3, xy); \ - return *this; \ - } \ - \ - operator get_type() \ - { \ - return BOOST_PP_TUPLE_ELEM(4, 2, xy); \ - } \ - }; \ - \ - static get_type call(name const& obj) \ - { \ - return BOOST_PP_TUPLE_ELEM(4, 2, xy); \ - }; \ - \ - static proxy call(name& obj) \ - { \ - return proxy(obj); \ - }; \ - }; \ - /***/ #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_class_named.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_class_named.hpp new file mode 100644 index 0000000000..4dec906420 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/adapt_class_named.hpp @@ -0,0 +1,30 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2009-2010 Hartmut Kaiser + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_NAMED_HPP +#define BOOST_FUSION_ADAPTED_CLASS_ADAPT_CLASS_NAMED_HPP + +#include +#include + +#define BOOST_FUSION_ADAPT_CLASS_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ + \ + BOOST_FUSION_ADAPT_CLASS( \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ)NAME, \ + ATTRIBUTES) + +#define BOOST_FUSION_ADAPT_CLASS_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_CLASS_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/adapt_base.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/adapt_base.hpp new file mode 100644 index 0000000000..54b701f322 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/adapt_base.hpp @@ -0,0 +1,115 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_HPP +#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_ADAPT_BASE_HPP + +#include +#include +#include +#include +#include + +//cschmidt: Spirit relies on Fusion defining class_member_proxy in the +//boost::fusion::extension namespace, with two nested types named lvalue and +//rvalue. + +#define BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL(TEMPLATE_PARAMS_SEQ)\ + typename detail::get_identity< \ + lvalue \ + , BOOST_PP_SEQ_ELEM(1,TEMPLATE_PARAMS_SEQ) \ + >::type + +#define BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL( \ + TEMPLATE_PARAMS_SEQ) \ + \ + lvalue + +#define BOOST_FUSION_ADAPT_CLASS_C_BASE(\ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct class_member_proxy< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + > \ + { \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) rvalue; \ + \ + class_member_proxy(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj)\ + : obj(obj) \ + {} \ + \ + template \ + class_member_proxy& \ + operator=(Arg const& val) \ + { \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 3, ATTRIBUTE); \ + return *this; \ + } \ + \ + operator lvalue() \ + { \ + return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ + } \ + \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj; \ + }; \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct struct_member \ + { \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) lvalue; \ + \ + typedef \ + BOOST_PP_IF( \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ), \ + BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_TEMPLATE_IMPL, \ + BOOST_FUSION_ADAPT_CLASS_GET_IDENTITY_NON_TEMPLATE_IMPL)( \ + TEMPLATE_PARAMS_SEQ) \ + type; \ + \ + template \ + struct apply \ + { \ + typedef \ + class_member_proxy< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + > \ + proxy; \ + \ + typedef typename \ + mpl::if_< \ + is_const \ + , BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \ + , proxy \ + >::type \ + type; \ + \ + static proxy \ + call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ)& obj) \ + { \ + return proxy(obj); \ + } \ + \ + static BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE) \ + call(BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const& obj) \ + { \ + return BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 2, ATTRIBUTE); \ + } \ + }; \ + }; + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/end_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/end_impl.hpp new file mode 100644 index 0000000000..81c02c307b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/end_impl.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_END_IMPL_OCTOBER_4_2009_919PM) +#define BOOST_FUSION_END_IMPL_OCTOBER_4_2009_919PM + +#include + +namespace boost { namespace fusion +{ + struct class_tag; + + namespace extension + { + template + struct end_impl; + + template + struct class_size; + + template <> + struct end_impl + { + template + struct apply + { + typedef + class_iterator< + Sequence + , class_size::value + > + type; + + static type + call(Sequence& v) + { + return type(v); + } + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/extension.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/extension.hpp new file mode 100644 index 0000000000..0ad7c66eb2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/extension.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP +#define BOOST_FUSION_ADAPTED_CLASS_DETAIL_EXTENSION_HPP + +#include +#include + +namespace boost { namespace fusion +{ + namespace detail + { + template + struct get_identity + : remove_const::type> + {}; + } + + namespace extension + { + template + struct class_member_proxy; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/has_key_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/has_key_impl.hpp new file mode 100644 index 0000000000..27f1adcede --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/has_key_impl.hpp @@ -0,0 +1,40 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_HAS_KEY_IMPL_OCTOBER_4_2009_919PM) +#define BOOST_FUSION_HAS_KEY_IMPL_OCTOBER_4_2009_919PM + +#include +#include + +namespace boost { namespace fusion { + + struct class_tag; + + namespace extension + { + struct no_such_member; + + template + struct has_key_impl; + + template + struct class_assoc_member; + + template<> + struct has_key_impl + { + template + struct apply + : mpl::not_::type> > + { + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/is_sequence_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/is_sequence_impl.hpp new file mode 100644 index 0000000000..c1d35de1e5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/is_sequence_impl.hpp @@ -0,0 +1,31 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_OCTOBER_4_2009_919PM) +#define BOOST_FUSION_IS_SEQUENCE_IMPL_OCTOBER_4_2009_919PM + +#include + +namespace boost { namespace fusion +{ + struct class_tag; + + namespace extension + { + template + struct is_sequence_impl; + + template<> + struct is_sequence_impl + { + template + struct apply : mpl::true_ {}; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/is_view_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/is_view_impl.hpp new file mode 100644 index 0000000000..86ce007401 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/is_view_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_IS_VIEW_IMPL_OCTOBER_4_2009_919PM) +#define BOOST_FUSION_IS_VIEW_IMPL_OCTOBER_4_2009_919PM + +#include + +namespace boost { namespace fusion +{ + struct class_tag; + + namespace extension + { + template + struct is_view_impl; + + template<> + struct is_view_impl + { + template + struct apply : mpl::false_ + {}; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/size_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/size_impl.hpp new file mode 100644 index 0000000000..de34a3b176 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/size_impl.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_SIZE_IMPL_OCTOBER_4_2009_919PM) +#define BOOST_FUSION_SIZE_IMPL_OCTOBER_4_2009_919PM + +#include + +namespace boost { namespace fusion +{ + namespace extension + { + template + struct class_size; + } + + struct class_tag; + + namespace extension + { + template + struct size_impl; + + template <> + struct size_impl + { + template + struct apply : extension::class_size {}; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/value_at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/value_at_impl.hpp new file mode 100644 index 0000000000..64d2fc3afe --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/value_at_impl.hpp @@ -0,0 +1,47 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_IMPL_OCTOBER_4_2009_918PM) +#define BOOST_FUSION_VALUE_AT_IMPL_OCTOBER_4_2009_918PM + +#include +#include + +namespace boost { namespace fusion +{ + struct class_tag; + + namespace extension + { + template + struct value_at_impl; + + template + struct class_member; + + template + struct class_size; + + template <> + struct value_at_impl + { + template + struct apply + { + static int const n_value = N::value; + BOOST_MPL_ASSERT_RELATION( + n_value, <=, extension::class_size::value); + + typedef typename + extension::class_member::type + type; + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/value_at_key_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/value_at_key_impl.hpp new file mode 100644 index 0000000000..f9adc10430 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/detail/value_at_key_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2007 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(BOOST_FUSION_VALUE_AT_KEY_IMPL_OCTOBER_4_2009_918PM) +#define BOOST_FUSION_VALUE_AT_KEY_IMPL_OCTOBER_4_2009_918PM + +#include + +namespace boost { namespace fusion +{ + struct class_tag; + + namespace extension + { + template + struct value_at_key_impl; + + template + struct class_assoc_member; + + template <> + struct value_at_key_impl + { + template + struct apply + { + typedef typename + extension::class_assoc_member::type + type; + }; + }; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/class/extension.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/class/extension.hpp new file mode 100644 index 0000000000..28d0a22382 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/class/extension.hpp @@ -0,0 +1,68 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_CLASS_EXTENSION_OCTOBER_4_2009_839PM) +#define FUSION_CLASS_EXTENSION_OCTOBER_4_2009_839PM + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct class_member; + + template + struct class_size; + + template + struct class_member : class_member {}; + //~ { + //~ typedef typename class_member::type type; + //~ typedef typename class_member::get_type get_type; + //~ typedef typename class_member::proxy proxy; + + //~ static get_type& + //~ call(Class const& class_) + //~ { + //~ return class_member::call( + //~ const_cast(class_)); + //~ } + //~ }; + + template + struct class_size + : class_size + {}; + + struct no_such_member; + + template + struct class_assoc_member + { + typedef no_such_member type; + }; + + template + struct class_assoc_member + { + typedef typename + add_const::type>::type + type; + + static type& + call(Class const& class_) + { + return class_assoc_member::call( + const_cast(class_)); + } + }; + +}}} + +#endif + + diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/std_pair.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/std_pair.hpp index ffc343bc86..5792dd4450 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/std_pair.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/std_pair.hpp @@ -1,70 +1,24 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_STD_PAIR_24122005_1744) -#define BOOST_FUSION_STD_PAIR_24122005_1744 -#include -#include -#include -#include +#ifndef BOOST_FUSION_ADAPTED_STD_PAIR_HPP +#define BOOST_FUSION_ADAPTED_STD_PAIR_HPP -namespace boost { namespace fusion -{ - struct struct_tag; - - namespace traits - { - template -#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) - struct tag_of, void > -#else - struct tag_of > -#endif - { - typedef struct_tag type; - }; - } - - namespace extension - { - template - struct struct_member; - - template - struct struct_size; +#include - template - struct struct_member, 0> - { - typedef T1 type; - - static type& call(std::pair& pair) - { - return pair.first; - } - }; - - template - struct struct_member, 1> - { - typedef T2 type; - - static type& call(std::pair& pair) - { - return pair.second; - } - }; +namespace std +{ + template + struct pair; +} - template - struct struct_size > : mpl::int_<2> - { - }; - } -}} +BOOST_FUSION_ADAPT_TPL_STRUCT( + (T1)(T2),(std::pair)(T1)(T2),(T1, first)(T2, second)) #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct.hpp index c3c24e0b95..f184a0d3a1 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct.hpp @@ -1,28 +1,20 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_STRUCT_24122005_1744) -#define BOOST_FUSION_STRUCT_24122005_1744 -#include -#include -#include -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_HPP -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp index e8ee31b961..c6c991d154 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_assoc_struct.hpp @@ -1,94 +1,82 @@ /*============================================================================= Copyright (c) 2001-2007 Joel de Guzman Copyright (c) 2007 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_ADAPT_ASSOC_STRUCT_20070508_2207) -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_20070508_2207 -#include -#include -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include +#include #include +#include #include #include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -namespace boost { namespace fusion { namespace extension { - template - struct struct_assoc_member; -}}} +#include +#include +#include +#include +#include +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0(X, Y, Z)\ + ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1 +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1(X, Y, Z)\ + ((X, Y, Z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_1_END -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(name, bseq) \ - BOOST_FUSION_ADAPT_ASSOC_STRUCT_I( \ - name, BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_X bseq, 0)) \ - /***/ +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE) \ + \ + BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, PREFIX, ATTRIBUTE, 3) \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct struct_assoc_key \ + { \ + typedef BOOST_PP_TUPLE_ELEM(3, 2, ATTRIBUTE) type; \ + }; -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_X(x, y, z) ((x, y, z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y(x, y, z) ((x, y, z)) BOOST_FUSION_ADAPT_ASSOC_STRUCT_X -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_X0 -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_Y0 +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \ + \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE) -// BOOST_FUSION_ADAPT_ASSOC_STRUCT_I generates the overarching structure and uses -// SEQ_FOR_EACH_I to generate the "linear" substructures. -// Thanks to Paul Mensonides for the PP macro help +#define BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (1)TEMPLATE_PARAMS_SEQ, \ + (1)NAME_SEQ, \ + assoc_struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_C) -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_I(name, seq) \ - namespace boost { namespace fusion { namespace traits \ - { \ - template <> \ - struct tag_of \ - { \ - typedef struct_tag type; \ - }; \ - }}} \ - namespace boost { namespace fusion { namespace extension \ - { \ - template <> \ - struct struct_size : mpl::int_ {}; \ - BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_ASSOC_STRUCT_C, name, seq) \ - }}} \ - /***/ - -#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_C(r, name, i, xy) \ - template <> \ - struct struct_member \ - { \ - typedef BOOST_PP_TUPLE_ELEM(3, 0, xy) type; \ - static type& call(name& struct_) \ - { \ - return struct_.BOOST_PP_TUPLE_ELEM(3, 1, xy); \ - }; \ - }; \ - template<> \ - struct struct_assoc_member \ - { \ - typedef BOOST_PP_TUPLE_ELEM(3, 0, xy) type; \ - static type& call(name& struct_) \ - { \ - return struct_.BOOST_PP_TUPLE_ELEM(3, 1, xy); \ - }; \ - }; - /***/ +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + assoc_struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_C) #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp new file mode 100644 index 0000000000..d4c3cdc2f2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_assoc_struct_named.hpp @@ -0,0 +1,38 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_NAMED_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_ASSOC_STRUCT_NAMED_HPP + +#include +#include + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_C( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, ATTRIBUTE) \ + \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, obj., ATTRIBUTE) + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ + \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \ + (0)NAMESPACE_SEQ)NAME), \ + assoc_struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_C) + +#define BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_struct.hpp index 41de5b1edf..0758af53ec 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_struct.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_struct.hpp @@ -1,75 +1,59 @@ /*============================================================================= Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_ADAPT_STRUCT_APRIL_2_2007_1158AM) -#define BOOST_FUSION_ADAPT_STRUCT_APRIL_2_2007_1158AM -#include -#include -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_HPP + +#include +#include +#include +#include +#include +#include + +#include +#include +#include #include #include +#include #include +#include #include #include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define BOOST_FUSION_ADAPT_STRUCT(name, bseq) \ - BOOST_FUSION_ADAPT_STRUCT_I( \ - name, BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_X bseq, 0)) \ - /***/ - -#define BOOST_FUSION_ADAPT_STRUCT_X(x, y) ((x, y)) BOOST_FUSION_ADAPT_STRUCT_Y -#define BOOST_FUSION_ADAPT_STRUCT_Y(x, y) ((x, y)) BOOST_FUSION_ADAPT_STRUCT_X -#define BOOST_FUSION_ADAPT_STRUCT_X0 -#define BOOST_FUSION_ADAPT_STRUCT_Y0 - -// BOOST_FUSION_ADAPT_STRUCT_I generates the overarching structure and uses -// SEQ_FOR_EACH_I to generate the "linear" substructures. -// Thanks to Paul Mensonides for the PP macro help - -#define BOOST_FUSION_ADAPT_STRUCT_I(name, seq) \ - namespace boost { namespace fusion { namespace traits \ - { \ - template <> \ - struct tag_of \ - { \ - typedef struct_tag type; \ - }; \ - }}} \ - namespace boost { namespace fusion { namespace extension \ - { \ - template <> \ - struct struct_size : mpl::int_ {}; \ - BOOST_PP_SEQ_FOR_EACH_I(BOOST_FUSION_ADAPT_STRUCT_C, name, seq) \ - }}} \ - /***/ - -#define BOOST_FUSION_ADAPT_STRUCT_C(r, name, i, xy) \ - template <> \ - struct struct_member \ - { \ - typedef BOOST_PP_TUPLE_ELEM(2, 0, xy) type; \ - static type& call(name& struct_) \ - { \ - return struct_.BOOST_PP_TUPLE_ELEM(2, 1, xy); \ - }; \ - }; \ - /***/ +#include +#include + +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0(X, Y) \ + ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_1 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1(X, Y) \ + ((X, Y)) BOOST_FUSION_ADAPT_STRUCT_FILLER_0 +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_0_END +#define BOOST_FUSION_ADAPT_STRUCT_FILLER_1_END + +#define BOOST_FUSION_ADAPT_STRUCT_C(TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE)\ + BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,BOOST_PP_EMPTY(),ATTRIBUTE,2) + +#define BOOST_FUSION_ADAPT_TPL_STRUCT(TEMPLATE_PARAMS_SEQ,NAME_SEQ, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (1)TEMPLATE_PARAMS_SEQ, \ + (1)NAME_SEQ, \ + struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_STRUCT_C) + +#define BOOST_FUSION_ADAPT_STRUCT(NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(NAME), \ + struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_STRUCT_C) #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_struct_named.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_struct_named.hpp new file mode 100644 index 0000000000..37ea1af14e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/adapt_struct_named.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2009-2010 Hartmut Kaiser + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_NAMED_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_ADAPT_STRUCT_NAMED_HPP + +#include +#include +#include + +#define BOOST_FUSION_ADAPT_STRUCT_NAMED_C( \ + TEMPLATE_PARAMS_SEQ, NAME_SEQ, I, ATTRIBUTE) \ + \ + BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ, I, obj., ATTRIBUTE, 2) + +#define BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,(0)NAMESPACE_SEQ,NAME) \ + \ + BOOST_FUSION_ADAPT_STRUCT_BASE( \ + (0), \ + (0)(BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION( \ + (0)NAMESPACE_SEQ)NAME), \ + struct_tag, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + BOOST_FUSION_ADAPT_STRUCT_NAMED_C) + +#define BOOST_FUSION_ADAPT_STRUCT_NAMED(WRAPPED_TYPE, NAME, ATTRIBUTES) \ + BOOST_FUSION_ADAPT_STRUCT_NAMED_NS( \ + WRAPPED_TYPE,(boost)(fusion)(adapted),NAME,ATTRIBUTES) + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/define_assoc_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/define_assoc_struct.hpp new file mode 100644 index 0000000000..d69ed461ec --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/define_assoc_struct.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DEFINE_ASSOC_STRUCT_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DEFINE_ASSOC_STRUCT_HPP + +#include +#include + +#define BOOST_FUSION_DEFINE_ASSOC_TPL_STRUCT( \ + TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \ + TEMPLATE_PARAMS_SEQ, \ + (0)NAMESPACE_SEQ, \ + NAME, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + 3) \ + \ + BOOST_FUSION_ADAPT_ASSOC_TPL_STRUCT( \ + TEMPLATE_PARAMS_SEQ, \ + (BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME)\ + TEMPLATE_PARAMS_SEQ, \ + ATTRIBUTES) + +#define BOOST_FUSION_DEFINE_ASSOC_STRUCT(NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + BOOST_FUSION_DEFINE_STRUCT_IMPL( \ + (0)NAMESPACE_SEQ, \ + NAME, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_ASSOC_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + 3) \ + \ + BOOST_FUSION_ADAPT_ASSOC_STRUCT( \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME, \ + ATTRIBUTES) + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/define_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/define_struct.hpp new file mode 100644 index 0000000000..11a393b7b7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/define_struct.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DEFINE_STRUCT_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DEFINE_STRUCT_HPP + +#include +#include + +#define BOOST_FUSION_DEFINE_TPL_STRUCT( \ + TEMPLATE_PARAMS_SEQ, NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + \ + BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \ + TEMPLATE_PARAMS_SEQ, \ + (0)NAMESPACE_SEQ, \ + NAME, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + 2) \ + \ + BOOST_FUSION_ADAPT_TPL_STRUCT( \ + TEMPLATE_PARAMS_SEQ, \ + (BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME)\ + TEMPLATE_PARAMS_SEQ, \ + ATTRIBUTES) + +#define BOOST_FUSION_DEFINE_STRUCT(NAMESPACE_SEQ, NAME, ATTRIBUTES) \ + BOOST_FUSION_DEFINE_STRUCT_IMPL( \ + (0)NAMESPACE_SEQ, \ + NAME, \ + BOOST_PP_CAT(BOOST_FUSION_ADAPT_STRUCT_FILLER_0 ATTRIBUTES,_END), \ + 2) \ + \ + BOOST_FUSION_ADAPT_STRUCT( \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION((0)NAMESPACE_SEQ) NAME, \ + ATTRIBUTES) + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/adapt_base.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/adapt_base.hpp new file mode 100644 index 0000000000..c1b1b9230a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/adapt_base.hpp @@ -0,0 +1,203 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_ADAPT_BASE_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS(SEQ) \ + BOOST_PP_SEQ_HEAD(SEQ) \ + BOOST_PP_EMPTY() + +#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(SEQ) \ + BOOST_PP_IF( \ + BOOST_PP_SEQ_HEAD(SEQ), \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME_TEMPLATE_PARAMS, \ + BOOST_PP_SEQ_HEAD)(BOOST_PP_SEQ_TAIL(SEQ)) + +#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL_C(R, _, ELEM) \ + (typename ELEM) +#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL(SEQ) \ + BOOST_PP_SEQ_ENUM( \ + BOOST_PP_SEQ_FOR_EACH( \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL_C, \ + _, \ + BOOST_PP_SEQ_TAIL(SEQ))) +#define BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(SEQ) \ + BOOST_PP_IF( \ + BOOST_PP_SEQ_HEAD(SEQ), \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL, \ + BOOST_PP_TUPLE_EAT(1))(SEQ) + +#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS +# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ + MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct tag_of< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) MODIFIER \ + , void \ + > \ + { \ + typedef TAG type; \ + }; +#else +# define BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ + MODIFIER, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct tag_of \ + { \ + typedef TAG type; \ + }; +#endif + +#define BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL(R,DATA,I,ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(3,0,DATA)( \ + BOOST_PP_TUPLE_ELEM(3,1,DATA), \ + BOOST_PP_TUPLE_ELEM(3,2,DATA), \ + I, \ + ATTRIBUTE) + +#define BOOST_FUSION_ADAPT_STRUCT_C_BASE( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,I,PREFIX,ATTRIBUTE,ATTRIBUTE_TUPEL_SIZE) \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct struct_member \ + { \ + typedef BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 0, ATTRIBUTE) type; \ + \ + template \ + struct apply \ + { \ + typedef typename \ + add_reference< \ + typename mpl::eval_if< \ + is_const \ + , add_const \ + , mpl::identity \ + >::type \ + >::type \ + type; \ + \ + static type \ + call(Seq& seq) \ + { \ + return seq.PREFIX \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE, 1, ATTRIBUTE); \ + } \ + }; \ + }; \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS(TEMPLATE_PARAMS_SEQ) \ + > \ + struct struct_member_name< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) \ + , I \ + > \ + { \ + typedef char const* type; \ + \ + static type \ + call() \ + { \ + return BOOST_PP_STRINGIZE( \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)); \ + } \ + }; + +#define BOOST_FUSION_ADAPT_STRUCT_BASE( \ + TEMPLATE_PARAMS_SEQ,NAME_SEQ,TAG,ATTRIBUTES_SEQ,ATTRIBUTES_CALLBACK) \ + \ +namespace boost \ +{ \ + namespace fusion \ + { \ + namespace traits \ + { \ + BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ + BOOST_PP_EMPTY(), TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ + BOOST_FUSION_ADAPT_STRUCT_TAG_OF_SPECIALIZATION( \ + const, TEMPLATE_PARAMS_SEQ, NAME_SEQ, TAG) \ + } \ + \ + namespace extension \ + { \ + BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_ADAPT_STRUCT_BASE_UNPACK_AND_CALL, \ + (ATTRIBUTES_CALLBACK,TEMPLATE_PARAMS_SEQ,NAME_SEQ), \ + ATTRIBUTES_SEQ) \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \ + TEMPLATE_PARAMS_SEQ) \ + > \ + struct struct_size \ + : mpl::int_ \ + {}; \ + } \ + } \ + \ + namespace mpl \ + { \ + template \ + struct sequence_tag; \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \ + TEMPLATE_PARAMS_SEQ) \ + > \ + struct sequence_tag \ + { \ + typedef fusion::fusion_sequence_tag type; \ + }; \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS( \ + TEMPLATE_PARAMS_SEQ) \ + > \ + struct sequence_tag< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_NAME(NAME_SEQ) const \ + > \ + { \ + typedef fusion::fusion_sequence_tag type; \ + }; \ + } \ +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/at_impl.hpp index 809902ae56..febb63358b 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/at_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/at_impl.hpp @@ -1,63 +1,38 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_AT_IMPL_24122005_1807) -#define BOOST_FUSION_AT_IMPL_24122005_1807 -#include -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_AT_IMPL_HPP + #include -namespace boost { namespace fusion +namespace boost { namespace fusion { namespace extension { - struct struct_tag; + template + struct at_impl; - namespace extension + template <> + struct at_impl { - template - struct at_impl; - - template - struct struct_member; - - template - struct struct_size; - - template <> - struct at_impl - { - template - struct apply - { - static int const n_value = N::value; - BOOST_MPL_ASSERT_RELATION( - n_value, <=, extension::struct_size::value); - - typedef typename - extension::struct_member - element; - - typedef typename - mpl::eval_if< - is_const - , detail::cref_result - , detail::ref_result - >::type - type; - - static type - call(Sequence& seq) - { - return extension:: - struct_member::call(seq); - } - }; - }; - } -}} + template + struct apply + : extension::struct_member< + typename remove_const::type + , N::value + >::template apply + {}; + }; + + template <> + struct at_impl + : at_impl + {}; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/begin_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/begin_impl.hpp index bf5a00bcca..80321ee125 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/begin_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/begin_impl.hpp @@ -1,40 +1,67 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_BEGIN_IMPL_24122005_1752) -#define BOOST_FUSION_BEGIN_IMPL_24122005_1752 -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_BEGIN_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_BEGIN_IMPL_HPP -namespace boost { namespace fusion +#include + +namespace boost { namespace fusion { namespace extension { - struct struct_tag; + template + struct begin_impl; - namespace extension + template <> + struct begin_impl { - template - struct begin_impl; + template + struct apply + { + typedef + basic_iterator< + struct_iterator_tag + , random_access_traversal_tag + , Seq + , 0 + > + type; - template <> - struct begin_impl + static type + call(Seq& seq) + { + return type(seq,0); + } + }; + }; + + template <> + struct begin_impl + { + template + struct apply { - template - struct apply + typedef + basic_iterator< + struct_iterator_tag + , assoc_struct_category + , Seq + , 0 + > + type; + + static type + call(Seq& seq) { - typedef struct_iterator type; - - static type - call(Sequence& v) - { - return type(v); - } - }; + return type(seq,0); + } }; - } -}} + }; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp index c23b97511c..81350e6a8f 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/category_of_impl.hpp @@ -1,34 +1,41 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731) -#define BOOST_FUSION_CATEGORY_OF_IMPL_24122005_1731 -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_CATEGORY_OF_IMPL_HPP namespace boost { namespace fusion { - struct struct_tag; - struct random_access_traversal_tag; - namespace extension { - template + template struct category_of_impl; template<> struct category_of_impl { - template + template struct apply { typedef random_access_traversal_tag type; }; }; + + template<> + struct category_of_impl + { + template + struct apply + { + typedef assoc_struct_category type; + }; + }; } }} diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/define_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/define_struct.hpp new file mode 100644 index 0000000000..42bc6dcd70 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/define_struct.hpp @@ -0,0 +1,308 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEFINE_STRUCT_HPP +#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_DEFINE_STRUCT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I( \ + R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + \ + BOOST_PP_COMMA_IF(I) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \ + other_self.BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)) + +#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I( \ + R, ATTRIBUTE_TUPEL_SIZE, I_, ATTRIBUTE) \ + \ + BOOST_PP_IF( \ + I_, \ + typedef typename \ + boost::fusion::result_of::next< \ + BOOST_PP_CAT(I,BOOST_PP_DEC(I_)) \ + >::type \ + BOOST_PP_CAT(I,I_); \ + BOOST_PP_CAT(I,I_) BOOST_PP_CAT(i,I_)= \ + boost::fusion::next(BOOST_PP_CAT(i,BOOST_PP_DEC(I_)));, \ + BOOST_PP_EMPTY() \ + ) \ + \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)= \ + boost::fusion::deref(BOOST_PP_CAT(i,I_)); + +#define BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP( \ + ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + template \ + self_type& \ + operator=(Seq const& seq) \ + { \ + typedef typename \ + boost::fusion::result_of::begin::type \ + I0; \ + I0 i0=boost::fusion::begin(seq); \ + \ + BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_DEFINE_STRUCT_ASSIGN_FILLER_I, \ + ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTES_SEQ) \ + \ + return *this; \ + } + +#define BOOST_FUSION_DEFINE_STRUCT_ATTR_I(R, ATTRIBUTE_TUPEL_SIZE, ATTRIBUTE) \ + \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE); + +#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I( \ + R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + \ + BOOST_PP_COMMA_IF(I) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)( \ + boost::fusion::deref(boost::fusion::advance_c(boost::fusion::begin( \ + seq)))) + +#define BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER( \ + ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + , typename boost::disable_if< \ + boost::is_convertible< \ + Seq const& \ + , BOOST_PP_TUPLE_ELEM( \ + ATTRIBUTE_TUPEL_SIZE, \ + 0, \ + BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ + > \ + >::type* =0 + +#define BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I( \ + R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + \ + BOOST_PP_COMMA_IF(I) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)() + +#define BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + BOOST_PP_SEQ_FOR_EACH_R( \ + 1, \ + BOOST_FUSION_DEFINE_STRUCT_ATTR_I, \ + ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTES_SEQ) \ + \ + NAME() \ + : BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_DEFINE_STRUCT_SEQ_DEFAULT_CTOR_FILLER_I, \ + ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTES_SEQ) \ + {} \ + \ + NAME(self_type const& other_self) \ + : BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_DEFINE_STRUCT_COPY_CTOR_FILLER_I, \ + ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTES_SEQ) \ + {} \ + \ + template \ + NAME(Seq const& seq \ + BOOST_PP_IF( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ + BOOST_PP_TUPLE_EAT(2), \ + BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_DISABLER)( \ + ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + ) \ + : BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_DEFINE_STRUCT_SEQ_CTOR_FILLER_I, \ + ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTES_SEQ) \ + {} \ + \ + BOOST_FUSION_DEFINE_STRUCT_ASSIGN_OP(ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) + +#define BOOST_FUSION_DEFINE_STRUCT_CTOR_1( \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + explicit \ + NAME(boost::call_traits< \ + BOOST_PP_TUPLE_ELEM( \ + ATTRIBUTE_TUPEL_SIZE,0,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ + >::param_type arg) \ + : BOOST_PP_TUPLE_ELEM( \ + ATTRIBUTE_TUPEL_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \ + {} + +#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1( \ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + explicit \ + NAME(typename boost::call_traits< \ + typename boost::fusion::detail::get_first_arg< \ + BOOST_PP_TUPLE_ELEM( \ + ATTRIBUTE_TUPEL_SIZE, \ + 0, \ + BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ)) \ + , BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \ + >::type \ + >::param_type arg) \ + : BOOST_PP_TUPLE_ELEM( \ + ATTRIBUTE_TUPEL_SIZE,1,BOOST_PP_SEQ_HEAD(ATTRIBUTES_SEQ))(arg) \ + {} + +#define BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I( \ + R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + \ + BOOST_PP_COMMA_IF(I) \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,1,ATTRIBUTE)(BOOST_PP_CAT(_,I)) + +#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I(R, DATA, I, ATTRIBUTE) \ + \ + BOOST_PP_COMMA_IF(I) \ + typename boost::call_traits< \ + typename boost::fusion::detail::get_first_arg< \ + BOOST_PP_TUPLE_ELEM( \ + BOOST_PP_TUPLE_ELEM(3,0,DATA), \ + 0, \ + ATTRIBUTE) \ + , BOOST_PP_TUPLE_ELEM(3,2,DATA) \ + >::type \ + >::param_type BOOST_PP_CAT(_,I) + +#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N( \ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_ARG_I, \ + ( \ + ATTRIBUTE_TUPEL_SIZE, \ + BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ), \ + BOOST_PP_SEQ_HEAD(TEMPLATE_PARAMS_SEQ) \ + ), \ + ATTRIBUTES_SEQ)) \ + : BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \ + ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTES_SEQ) \ + {} + +#define BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I( \ + R, ATTRIBUTE_TUPEL_SIZE, I, ATTRIBUTE) \ + \ + BOOST_PP_COMMA_IF(I) \ + boost::call_traits< \ + BOOST_PP_TUPLE_ELEM(ATTRIBUTE_TUPEL_SIZE,0,ATTRIBUTE) \ + >::param_type BOOST_PP_CAT(_,I) + +#define BOOST_FUSION_DEFINE_STRUCT_CTOR_N( \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + NAME(BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_DEFINE_STRUCT_CTOR_ARG_I, \ + ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTES_SEQ)) \ + : BOOST_PP_SEQ_FOR_EACH_I_R( \ + 1, \ + BOOST_FUSION_DEFINE_STRUCT_CTOR_FILLER_I, \ + ATTRIBUTE_TUPEL_SIZE, \ + ATTRIBUTES_SEQ) \ + {} + +#define BOOST_FUSION_DEFINE_STRUCT_CTOR(ATTRIBUTES_SEQ) \ + BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ + BOOST_FUSION_DEFINE_STRUCT_CTOR_N, \ + BOOST_FUSION_DEFINE_STRUCT_CTOR_1) + +#define BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR(ATTRIBUTES_SEQ) \ + BOOST_PP_IF(BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(ATTRIBUTES_SEQ)), \ + BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_N, \ + BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR_1) + +#define BOOST_FUSION_DEFINE_STRUCT_IMPL( \ + NAMESPACE_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ + \ + struct NAME \ + { \ + typedef NAME self_type; \ + \ + BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + BOOST_FUSION_DEFINE_STRUCT_CTOR(ATTRIBUTES_SEQ)( \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + }; \ + \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) + +#define BOOST_FUSION_DEFINE_TPL_STRUCT_IMPL( \ + TEMPLATE_PARAMS_SEQ, \ + NAMESPACE_SEQ, \ + NAME, \ + ATTRIBUTES_SEQ, \ + ATTRIBUTE_TUPEL_SIZE) \ + \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ + \ + template< \ + BOOST_FUSION_ADAPT_STRUCT_UNPACK_TEMPLATE_PARAMS_IMPL( \ + (0)TEMPLATE_PARAMS_SEQ) \ + > \ + struct NAME \ + { \ + typedef NAME self_type; \ + \ + BOOST_FUSION_DEFINE_STRUCT_IMPL_IMPL( \ + NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + \ + BOOST_FUSION_DEFINE_TPL_STRUCT_CTOR(ATTRIBUTES_SEQ)( \ + TEMPLATE_PARAMS_SEQ, NAME, ATTRIBUTES_SEQ, ATTRIBUTE_TUPEL_SIZE) \ + }; \ + \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) + +namespace boost { namespace fusion { namespace detail +{ + template + struct get_first_arg + { + typedef A1 type; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/deref_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/deref_data_impl.hpp new file mode 100644 index 0000000000..d3b6ced6c6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/deref_data_impl.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2009-2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_DATA_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_DATA_IMPL_HPP + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_data_impl; + + template <> + struct deref_data_impl + : deref_impl + {}; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/deref_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/deref_impl.hpp new file mode 100644 index 0000000000..498617a359 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/deref_impl.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2009-2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_DEREF_IMPL_HPP + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename + extension::struct_member< + typename remove_const::type + , It::index::value + >::template apply + impl; + + typedef typename impl::type type; + + static + type + call(It const& it) + { + return impl::call(*it.seq); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/end_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/end_impl.hpp index 514f7f583d..e4f92056bb 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/end_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/end_impl.hpp @@ -1,48 +1,67 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_END_IMPL_24122005_1755) -#define BOOST_FUSION_END_IMPL_24122005_1755 -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_END_IMPL_HPP -namespace boost { namespace fusion +#include + +namespace boost { namespace fusion { namespace extension { - struct struct_tag; + template + struct end_impl; - namespace extension + template <> + struct end_impl { - template - struct end_impl; + template + struct apply + { + typedef + basic_iterator< + struct_iterator_tag + , random_access_traversal_tag + , Seq + , struct_size::type>::value + > + type; - template - struct struct_size; + static type + call(Seq& seq) + { + return type(seq,0); + } + }; + }; - template <> - struct end_impl + template <> + struct end_impl + { + template + struct apply { - template - struct apply + typedef + basic_iterator< + struct_iterator_tag + , assoc_struct_category + , Seq + , struct_size::type>::value + > + type; + + static type + call(Seq& seq) { - typedef - struct_iterator< - Sequence - , struct_size::value - > - type; - - static type - call(Sequence& v) - { - return type(v); - } - }; + return type(seq,0); + } }; - } -}} + }; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/extension.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/extension.hpp new file mode 100644 index 0000000000..4896859d2b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/extension.hpp @@ -0,0 +1,44 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_EXTENSION_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_EXTENSION_HPP + +#include + +namespace boost { namespace fusion +{ + struct struct_tag; + struct struct_iterator_tag; + struct assoc_struct_tag; + struct fusion_sequence_tag; + + struct assoc_struct_category + : bidirectional_traversal_tag, associative_tag + {}; + + namespace extension + { + struct no_such_member; + + template + struct struct_member; + + template + struct struct_member_name; + + template + struct struct_assoc_key; + + template + struct struct_size; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp index f81e9fb63c..6f8adde5ca 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/is_sequence_impl.hpp @@ -1,31 +1,35 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651) -#define BOOST_FUSION_IS_SEQUENCE_IMPL_27122005_1651 + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_SEQUENCE_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_SEQUENCE_IMPL_HPP #include -namespace boost { namespace fusion +namespace boost { namespace fusion { namespace extension { - struct struct_tag; + template + struct is_sequence_impl; - namespace extension + template<> + struct is_sequence_impl { - template - struct is_sequence_impl; + template + struct apply + : mpl::true_ + {}; + }; - template<> - struct is_sequence_impl - { - template - struct apply : mpl::true_ {}; - }; - } -}} + template <> + struct is_sequence_impl + : is_sequence_impl + {}; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp index da6f380bd6..0580018d1f 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/is_view_impl.hpp @@ -1,32 +1,35 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_IS_VIEW_IMPL_27042006_2219) -#define BOOST_FUSION_IS_VIEW_IMPL_27042006_2219 + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_IS_VIEW_IMPL_HPP #include -namespace boost { namespace fusion +namespace boost { namespace fusion { namespace extension { - struct struct_tag; + template + struct is_view_impl; - namespace extension + template<> + struct is_view_impl { - template - struct is_view_impl; + template + struct apply + : mpl::false_ + {}; + }; - template<> - struct is_view_impl - { - template - struct apply : mpl::false_ - {}; - }; - } -}} + template <> + struct is_view_impl + : is_view_impl + {}; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/key_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/key_of_impl.hpp new file mode 100644 index 0000000000..d24a24b1b3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/key_of_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2009-2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_KEY_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_KEY_OF_IMPL_HPP + +namespace boost { namespace fusion { namespace extension +{ + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + : extension::struct_assoc_key< + typename remove_const::type + , It::index::value + > + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/namespace.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/namespace.hpp new file mode 100644 index 0000000000..0f3ec5e0b1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/namespace.hpp @@ -0,0 +1,51 @@ +/*============================================================================= + Copyright (c) 2009-2010 Hartmut Kaiser + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_NAMESPACE_HPP +#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_NAMESPACE_HPP + +#include +#include +#include +#include +#include +#include +#include + +#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_BEGIN_I(R,DATA,ELEM) \ + namespace ELEM { +#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_END_I(Z,I,DATA) } +#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I(Z,I,ELEM) ELEM:: + +#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ + BOOST_PP_IF( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \ + BOOST_PP_SEQ_FOR_EACH_R, \ + BOOST_PP_TUPLE_EAT(4))( \ + 1, \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_BEGIN_I, \ + _, \ + BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ)) + +#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) \ + BOOST_PP_REPEAT_1( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_END_I, \ + _) + +#define BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION(NAMESPACE_SEQ) \ + BOOST_PP_IF( \ + BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(NAMESPACE_SEQ)), \ + BOOST_PP_SEQ_FOR_EACH_R, \ + BOOST_PP_TUPLE_EAT(4))( \ + 1, \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DECLARATION_I, \ + _, \ + BOOST_PP_SEQ_TAIL(NAMESPACE_SEQ)) + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/proxy_type.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/proxy_type.hpp new file mode 100644 index 0000000000..062f24a158 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/proxy_type.hpp @@ -0,0 +1,36 @@ +/*============================================================================= + Copyright (c) 2009-2010 Hartmut Kaiser + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP +#define BOOST_FUSION_ADAPTED_DETAIL_STRUCT_PROXY_TYPE_HPP + +#include + +#define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE,NAMESPACE_SEQ,NAME) \ + \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_BEGIN(NAMESPACE_SEQ) \ + \ + struct NAME \ + { \ + NAME(WRAPPED_TYPE& obj) \ + : obj(obj) \ + {} \ + \ + WRAPPED_TYPE& obj; \ + }; \ + \ + BOOST_FUSION_ADAPT_STRUCT_NAMESPACE_DEFINITION_END(NAMESPACE_SEQ) + +#define BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE( \ + WRAPPED_TYPE, NAMESPACE_SEQ, NAME) \ + \ + BOOST_FUSION_ADAPT_STRUCT_DEFINE_PROXY_TYPE_IMPL( \ + WRAPPED_TYPE, (0)NAMESPACE_SEQ, NAME) + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/size_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/size_impl.hpp index 12ec14bab4..43a5705744 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/size_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/size_impl.hpp @@ -1,37 +1,33 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_SIZE_IMPL_24122005_1759) -#define BOOST_FUSION_SIZE_IMPL_24122005_1759 -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_SIZE_IMPL_HPP -namespace boost { namespace fusion +namespace boost { namespace fusion { namespace extension { - namespace extension - { - template - struct struct_size; - } - - struct struct_tag; + template + struct size_impl; - namespace extension + template <> + struct size_impl { - template - struct size_impl; + template + struct apply + : struct_size::type> + {}; + }; - template <> - struct size_impl - { - template - struct apply : extension::struct_size {}; - }; - } -}} + template <> + struct size_impl + : size_impl + {}; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp index 8f5d97a0d5..5ecf4ac730 100644 --- a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_at_impl.hpp @@ -1,47 +1,33 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2005-2006 Dan Marsden + Copyright (c) 2009-2010 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(BOOST_FUSION_VALUE_AT_IMPL_24122005_1917) -#define BOOST_FUSION_VALUE_AT_IMPL_24122005_1917 -#include -#include +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_AT_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_AT_IMPL_HPP -namespace boost { namespace fusion +namespace boost { namespace fusion { namespace extension { - struct struct_tag; + template + struct value_at_impl; - namespace extension + template <> + struct value_at_impl { - template - struct value_at_impl; - - template - struct struct_member; - - template - struct struct_size; - - template <> - struct value_at_impl - { - template - struct apply - { - static int const n_value = N::value; - BOOST_MPL_ASSERT_RELATION( - n_value, <=, extension::struct_size::value); - - typedef typename - extension::struct_member::type - type; - }; - }; - } -}} + template + struct apply + : struct_member::type, N::value> + {}; + }; + + template <> + struct value_at_impl + : value_at_impl + {}; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_of_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_of_data_impl.hpp new file mode 100644 index 0000000000..4528b854a4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_of_data_impl.hpp @@ -0,0 +1,22 @@ +/*============================================================================= + Copyright (c) 2009-2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_DATA_IMPL_HPP + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + : value_of_impl + {}; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_of_impl.hpp new file mode 100644 index 0000000000..55d37ed7a7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/adapted/struct/detail/value_of_impl.hpp @@ -0,0 +1,29 @@ +/*============================================================================= + Copyright (c) 2009-2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_IMPL_HPP +#define BOOST_FUSION_ADAPTED_STRUCT_DETAIL_VALUE_OF_IMPL_HPP + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + : extension::struct_member< + typename remove_const::type + , It::index::value + > + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/algorithm/iteration/detail/fold.hpp b/deal.II/contrib/boost/include/boost/fusion/algorithm/iteration/detail/fold.hpp index 390b188cee..62a677dec1 100644 --- a/deal.II/contrib/boost/include/boost/fusion/algorithm/iteration/detail/fold.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/algorithm/iteration/detail/fold.hpp @@ -34,18 +34,18 @@ namespace detail template struct apply_fold_result { - template + template struct apply - : boost::result_of + : boost::result_of {}; }; - template + template struct fold_apply { typedef typename result_of::deref::type dereferenced; typedef typename add_reference::type>::type lvalue_state; - typedef typename boost::result_of::type type; + typedef typename boost::result_of::type type; }; template @@ -56,9 +56,9 @@ namespace detail { typedef typename static_fold< - typename result_of::next::type + typename result_of::next::type , Last - , typename fold_apply::type + , typename fold_apply::type , F >::type type; @@ -78,15 +78,15 @@ namespace detail typedef typename result::type type; }; - template + template struct result_of_unrolled_fold; template struct unrolled_fold { - template - static typename result_of_unrolled_fold::type - call(I0 const& i0, State const& state, F f) + template + static typename result_of_unrolled_fold::type + call(State const& state, I0 const& i0, F f) { typedef typename result_of::next::type I1; I1 i1 = fusion::next(i0); @@ -97,54 +97,54 @@ namespace detail typedef typename result_of::next::type I4; I4 i4 = fusion::next(i3); - return unrolled_fold::call(i4, f(*i3, f(*i2, f(*i1, f(*i0, state)))), f); + return unrolled_fold::call(f(f(f(f(state, *i0), *i1), *i2), *i3), i4, f); } }; template<> struct unrolled_fold<3> { - template - static typename result_of_unrolled_fold::type - call(I0 const& i0, State const& state, F f) + template + static typename result_of_unrolled_fold::type + call(State const& state, I0 const& i0, F f) { typedef typename result_of::next::type I1; I1 i1 = fusion::next(i0); typedef typename result_of::next::type I2; I2 i2 = fusion::next(i1); - return f(*i2, f(*i1, f(*i0, state))); + return f(f(f(state, *i0), *i1), *i2); } }; template<> struct unrolled_fold<2> { - template - static typename result_of_unrolled_fold::type - call(I0 const& i0, State const& state, F f) + template + static typename result_of_unrolled_fold::type + call(State const& state, I0 const& i0, F f) { typedef typename result_of::next::type I1; I1 i1 = fusion::next(i0); - return f(*i1, f(*i0, state)); + return f(f(state, *i0), *i1); } }; template<> struct unrolled_fold<1> { - template - static typename result_of_unrolled_fold::type - call(I0 const& i0, State const& state, F f) + template + static typename result_of_unrolled_fold::type + call(State const& state, I0 const& i0, F f) { - return f(*i0, state); + return f(state, *i0); } }; template<> struct unrolled_fold<0> { - template - static State call(I0 const&, State const& state, F) + template + static State call(State const& state, I0 const&, F) { return state; } @@ -171,53 +171,53 @@ namespace detail return detail::linear_fold( fusion::next(first) , last - , f(*first, state) + , f(state, *first) , f , result_of::equal_to::type, Last>() ); } - template + template struct result_of_unrolled_fold { typedef typename result_of::next::type I1; typedef typename result_of::next::type I2; typedef typename result_of::next::type I3; typedef typename result_of::next::type I4; - typedef typename fold_apply::type Rest1; - typedef typename fold_apply::type Rest2; - typedef typename fold_apply::type Rest3; - typedef typename fold_apply::type Rest4; + typedef typename fold_apply::type Rest1; + typedef typename fold_apply::type Rest2; + typedef typename fold_apply::type Rest3; + typedef typename fold_apply::type Rest4; - typedef typename result_of_unrolled_fold::type type; + typedef typename result_of_unrolled_fold::type type; }; - template - struct result_of_unrolled_fold + template + struct result_of_unrolled_fold { typedef typename result_of::next::type I1; typedef typename result_of::next::type I2; - typedef typename fold_apply::type Rest; - typedef typename fold_apply::type Rest2; - typedef typename fold_apply::type type; + typedef typename fold_apply::type Rest; + typedef typename fold_apply::type Rest2; + typedef typename fold_apply::type type; }; - template - struct result_of_unrolled_fold + template + struct result_of_unrolled_fold { typedef typename result_of::next::type I1; - typedef typename fold_apply::type Rest; - typedef typename fold_apply::type type; + typedef typename fold_apply::type Rest; + typedef typename fold_apply::type type; }; - template - struct result_of_unrolled_fold + template + struct result_of_unrolled_fold { - typedef typename fold_apply::type type; + typedef typename fold_apply::type type; }; - template - struct result_of_unrolled_fold + template + struct result_of_unrolled_fold { typedef State type; }; @@ -231,7 +231,7 @@ namespace detail typedef typename result_of::begin::type begin; typedef typename result_of::end::type end; typedef typename result_of_unrolled_fold< - begin, State, F, result_of::distance::type::value>::type type; + State, begin, F, result_of::distance::type::value>::type type; }; template @@ -269,8 +269,8 @@ namespace detail typedef typename result_of::begin::type begin; typedef typename result_of::end::type end; return unrolled_fold::type::value>::call( - fusion::begin(seq) - , state + state + , fusion::begin(seq) , f); } }}} diff --git a/deal.II/contrib/boost/include/boost/fusion/algorithm/query/detail/find_if.hpp b/deal.II/contrib/boost/include/boost/fusion/algorithm/query/detail/find_if.hpp index cf0cc6b760..5d2a74196f 100644 --- a/deal.II/contrib/boost/include/boost/fusion/algorithm/query/detail/find_if.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/algorithm/query/detail/find_if.hpp @@ -1,6 +1,7 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman Copyright (c) 2007 Dan Marsden + Copyright (c) 2009 Christopher Schmidt Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) @@ -13,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -31,7 +31,7 @@ namespace detail struct apply_filter { typedef typename mpl::apply1< - Pred, typename result_of::value_of::type>::type type; + Pred, Iterator>::type type; BOOST_STATIC_CONSTANT(int, value = type::value); }; @@ -85,7 +85,7 @@ namespace detail typedef typename mpl::apply1< Pred - , typename result_of::value_of::type + , Shifted >::type type; BOOST_STATIC_CONSTANT(int, value = type::value); @@ -227,26 +227,6 @@ namespace detail return choose_call(iter, typename traits::category_of::type()); } }; - - template - struct static_seq_find_if : static_find_if - { - typedef typename static_find_if::type type; - - template - static type - call(Sequence const& seq) - { - return static_find_if::call(fusion::begin(seq)); - } - - template - static type - call(Sequence& seq) - { - return static_find_if::call(fusion::begin(seq)); - } - }; }}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/algorithm/query/find.hpp b/deal.II/contrib/boost/include/boost/fusion/algorithm/query/find.hpp index ece8cdd66a..6beb900587 100644 --- a/deal.II/contrib/boost/include/boost/fusion/algorithm/query/find.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/algorithm/query/find.hpp @@ -8,46 +8,43 @@ #define FUSION_FIND_05052005_1107 #include -#include #include #include +#include +#include #include +#include #include #include #include namespace boost { namespace fusion { - struct associative_sequence_tag; - namespace result_of { template < typename Sequence , typename T - , bool is_associative_sequence = traits::is_associative::value > - struct find; - - template - struct find + > + struct find { typedef - detail::static_seq_find_if< + detail::static_find_if< typename result_of::begin::type , typename result_of::end::type - , is_same + , is_same< + typename mpl::if_< + traits::is_associative + , key_of + , value_of + >::type + , T + > > filter; typedef typename filter::type type; }; - - template - struct find - { - typedef detail::assoc_find filter; - typedef typename filter::type type; - }; } template @@ -59,7 +56,7 @@ namespace boost { namespace fusion find(Sequence& seq) { typedef typename result_of::find::filter filter; - return filter::call(seq); + return filter::call(fusion::begin(seq)); } template @@ -67,7 +64,7 @@ namespace boost { namespace fusion find(Sequence const& seq) { typedef typename result_of::find::filter filter; - return filter::call(seq); + return filter::call(fusion::begin(seq)); } }} diff --git a/deal.II/contrib/boost/include/boost/fusion/algorithm/query/find_if.hpp b/deal.II/contrib/boost/include/boost/fusion/algorithm/query/find_if.hpp index 4340d6883b..3950958c38 100644 --- a/deal.II/contrib/boost/include/boost/fusion/algorithm/query/find_if.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/algorithm/query/find_if.hpp @@ -10,6 +10,10 @@ #include #include #include +#include +#include +#include +#include #include #include @@ -20,13 +24,18 @@ namespace boost { namespace fusion template struct find_if { - typedef typename + typedef detail::static_find_if< typename result_of::begin::type , typename result_of::end::type - , Pred - >::type - type; + , mpl::bind1< + typename mpl::lambda::type + , mpl::bind1,mpl::_1> + > + > + filter; + + typedef typename filter::type type; }; } @@ -38,14 +47,7 @@ namespace boost { namespace fusion >::type find_if(Sequence& seq) { - typedef - detail::static_find_if< - typename result_of::begin::type - , typename result_of::end::type - , Pred - > - filter; - + typedef typename result_of::find_if::filter filter; return filter::call(fusion::begin(seq)); } @@ -53,14 +55,7 @@ namespace boost { namespace fusion inline typename result_of::find_if::type const find_if(Sequence const& seq) { - typedef - detail::static_find_if< - typename result_of::begin::type - , typename result_of::end::type - , Pred - > - filter; - + typedef typename result_of::find_if::filter filter; return filter::call(fusion::begin(seq)); } }} diff --git a/deal.II/contrib/boost/include/boost/fusion/algorithm/transformation/erase_key.hpp b/deal.II/contrib/boost/include/boost/fusion/algorithm/transformation/erase_key.hpp index dcdc6f09ba..03128695ea 100644 --- a/deal.II/contrib/boost/include/boost/fusion/algorithm/transformation/erase_key.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/algorithm/transformation/erase_key.hpp @@ -7,7 +7,7 @@ #if !defined(FUSION_ERASE_KEY_10022005_1851) #define FUSION_ERASE_KEY_10022005_1851 -#include +#include #include #include #include @@ -18,18 +18,15 @@ namespace boost { namespace fusion { template struct erase_key - { - typedef detail::assoc_find filter; - typedef typename erase::type type; - }; + : erase::type> + {}; } template inline typename result_of::erase_key::type erase_key(Sequence const& seq) { - typedef typename result_of::erase_key::filter filter; - return erase(seq, filter::call(seq)); + return erase(seq, find(seq)); } }} diff --git a/deal.II/contrib/boost/include/boost/fusion/container/deque/deque.hpp b/deal.II/contrib/boost/include/boost/fusion/container/deque/deque.hpp index 27d9ce7850..01f017e9b8 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/deque/deque.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/deque/deque.hpp @@ -45,6 +45,7 @@ namespace boost { namespace fusion { sequence_base > { typedef deque_tag fusion_tag; + typedef bidirectional_traversal_tag category; typedef typename detail::deque_keyed_values::type base; typedef typename detail::deque_initial_size::type size; typedef mpl::int_ next_up; diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/begin_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/begin_impl.hpp index 5fe25caf65..063932a80d 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/begin_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/begin_impl.hpp @@ -1,56 +1,43 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2009 Christopher Schmidt - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(FUSION_BEGIN_IMPL_05222005_1108) -#define FUSION_BEGIN_IMPL_05222005_1108 -#include -#include -#include -#include +#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_BEGIN_IMPL_HPP +#define BOOST_FUSION_CONTAINER_MAP_DETAIL_BEGIN_IMPL_HPP -namespace boost { namespace fusion +#include + +namespace boost { namespace fusion { namespace extension { - struct map_tag; + template + struct begin_impl; - namespace extension + template <> + struct begin_impl { - template - struct begin_impl; - - template <> - struct begin_impl + template + struct apply { - template - struct apply + typedef + basic_iterator< + map_iterator_tag + , typename Seq::category + , Seq + , 0 + > + type; + + static type + call(Seq& seq) { - typedef typename - result_of::begin::type - iterator_type; - - typedef typename - result_of::begin::type - const_iterator_type; - - typedef typename - mpl::eval_if< - is_const - , mpl::identity - , mpl::identity - >::type - type; - - static type - call(Sequence& m) - { - return fusion::begin(m.get_data()); - } - }; + return type(seq,0); + } }; - } -}} + }; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/deref_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/deref_data_impl.hpp new file mode 100644 index 0000000000..9943171a54 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/deref_data_impl.hpp @@ -0,0 +1,48 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_DATA_IMPL_HPP +#define BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_DATA_IMPL_HPP + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_data_impl; + + template <> + struct deref_data_impl + { + template + struct apply + { + typedef typename result_of::value_of::type::second_type data; + + typedef typename + mpl::eval_if< + is_const + , detail::cref_result > + , detail::ref_result > + >::type + type; + + static type + call(It const& it) + { + return deref(it).second; + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/deref_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/deref_impl.hpp new file mode 100644 index 0000000000..359a5dc07f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/deref_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_IMPL_HPP +#define BOOST_FUSION_CONTAINER_MAP_DETAIL_DEREF_IMPL_HPP + +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename + result_of::at< + typename mpl::if_< + is_const + , typename It::seq_type::storage_type const + , typename It::seq_type::storage_type + >::type + , typename It::index + >::type + type; + + static type + call(It const& it) + { + return at(it.seq->get_data()); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/end_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/end_impl.hpp index 0cafc92cde..0e30de8c00 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/end_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/end_impl.hpp @@ -1,53 +1,43 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2009 Christopher Schmidt - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(FUSION_END_IMPL_05222005_1108) -#define FUSION_END_IMPL_05222005_1108 -#include +#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_END_IMPL_HPP +#define BOOST_FUSION_CONTAINER_MAP_DETAIL_END_IMPL_HPP -namespace boost { namespace fusion +#include + +namespace boost { namespace fusion { namespace extension { - struct map_tag; + template + struct end_impl; - namespace extension + template <> + struct end_impl { - template - struct end_impl; - - template <> - struct end_impl + template + struct apply { - template - struct apply + typedef + basic_iterator< + map_iterator_tag + , typename Seq::category + , Seq + , Seq::size::value + > + type; + + static type + call(Seq& seq) { - typedef typename - result_of::end::type - iterator_type; - - typedef typename - result_of::end::type - const_iterator_type; - - typedef typename - mpl::eval_if< - is_const - , mpl::identity - , mpl::identity - >::type - type; - - static type - call(Sequence& m) - { - return fusion::end(m.get_data()); - } - }; + return type(seq,0); + } }; - } -}} + }; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/key_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/key_of_impl.hpp new file mode 100644 index 0000000000..5a90c03784 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/key_of_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_KEY_OF_IMPL_HPP +#define BOOST_FUSION_CONTAINER_MAP_DETAIL_KEY_OF_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + { + typedef typename + value_of_impl:: + template apply::type::first_type + type; + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/value_of_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/value_of_data_impl.hpp new file mode 100644 index 0000000000..28d21678f0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/value_of_data_impl.hpp @@ -0,0 +1,32 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define BOOST_FUSION_CONTAINER_MAP_DETAIL_VALUE_OF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + { + template + struct apply + { + typedef typename + value_of_impl:: + template apply::type::second_type + type; + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/detail/value_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/value_of_impl.hpp new file mode 100644 index 0000000000..26b19f20f3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/detail/value_of_impl.hpp @@ -0,0 +1,39 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_MAP_DETAIL_VALUE_OF_IMPL_HPP +#define BOOST_FUSION_CONTAINER_MAP_DETAIL_VALUE_OF_IMPL_HPP + +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename + result_of::value_at< + typename mpl::if_< + is_const + , typename It::seq_type::storage_type const + , typename It::seq_type::storage_type + >::type + , typename It::index + >::type + type; + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/map.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/map.hpp index 5f5fb1cc5f..77fe292018 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/map/map.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/map.hpp @@ -11,11 +11,13 @@ #include #include #include -#include #include #include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -23,13 +25,12 @@ namespace boost { namespace fusion { struct void_; - struct map_tag; struct fusion_sequence_tag; template struct map : sequence_base > { - struct category : forward_traversal_tag, associative_sequence_tag {}; + struct category : forward_traversal_tag, associative_tag {}; typedef map_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL @@ -49,7 +50,6 @@ namespace boost { namespace fusion : data(rhs) {} #include - #include template map& diff --git a/deal.II/contrib/boost/include/boost/fusion/container/map/map_fwd.hpp b/deal.II/contrib/boost/include/boost/fusion/container/map/map_fwd.hpp index 660466bd90..d8a9c1b71f 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/map/map_fwd.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/map/map_fwd.hpp @@ -13,6 +13,8 @@ namespace boost { namespace fusion { struct void_; + struct map_tag; + struct map_iterator_tag; template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/begin_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/begin_impl.hpp index 9b42df72bf..8047743d15 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/begin_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/begin_impl.hpp @@ -1,56 +1,43 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2009 Christopher Schmidt - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(FUSION_BEGIN_IMPL_09162005_1120) -#define FUSION_BEGIN_IMPL_09162005_1120 -#include -#include -#include -#include +#ifndef BOOST_FUSION_CONTAINER_SET_DETAIL_BEGIN_IMPL_HPP +#define BOOST_FUSION_CONTAINER_SET_DETAIL_BEGIN_IMPL_HPP -namespace boost { namespace fusion +#include + +namespace boost { namespace fusion { namespace extension { - struct set_tag; + template + struct begin_impl; - namespace extension + template <> + struct begin_impl { - template - struct begin_impl; - - template <> - struct begin_impl + template + struct apply { - template - struct apply + typedef + basic_iterator< + set_iterator_tag + , typename Seq::category + , Seq + , 0 + > + type; + + static type + call(Seq& seq) { - typedef typename - result_of::begin::type - iterator_type; - - typedef typename - result_of::begin::type - const_iterator_type; - - typedef typename - mpl::eval_if< - is_const - , mpl::identity - , mpl::identity - >::type - type; - - static type - call(Sequence& s) - { - return fusion::begin(s.get_data()); - } - }; + return type(seq,0); + } }; - } -}} + }; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/deref_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/deref_data_impl.hpp new file mode 100644 index 0000000000..7238cc6f11 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/deref_data_impl.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_SET_DETAIL_DEREF_DATA_IMPL_HPP +#define BOOST_FUSION_CONTAINER_SET_DETAIL_DEREF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_data_impl; + + template <> + struct deref_data_impl + : deref_impl + {}; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/deref_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/deref_impl.hpp new file mode 100644 index 0000000000..12824e614c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/deref_impl.hpp @@ -0,0 +1,45 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_SET_DETAIL_DEREF_IMPL_HPP +#define BOOST_FUSION_CONTAINER_SET_DETAIL_DEREF_IMPL_HPP + +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_impl; + + template <> + struct deref_impl + { + template + struct apply + { + typedef typename + result_of::at< + typename mpl::if_< + is_const + , typename It::seq_type::storage_type const + , typename It::seq_type::storage_type + >::type + , typename It::index + >::type + type; + + static type + call(It const& it) + { + return at(it.seq->get_data()); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/end_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/end_impl.hpp index 4df78a3fcc..a981585b42 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/end_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/end_impl.hpp @@ -1,53 +1,43 @@ /*============================================================================= Copyright (c) 2001-2006 Joel de Guzman + Copyright (c) 2009 Christopher Schmidt - Distributed under the Boost Software License, Version 1.0. (See accompanying + Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(FUSION_END_IMPL_09162005_1121) -#define FUSION_END_IMPL_09162005_1121 -#include +#ifndef BOOST_FUSION_CONTAINER_SET_DETAIL_END_IMPL_HPP +#define BOOST_FUSION_CONTAINER_SET_DETAIL_END_IMPL_HPP -namespace boost { namespace fusion +#include + +namespace boost { namespace fusion { namespace extension { - struct set_tag; + template + struct end_impl; - namespace extension + template <> + struct end_impl { - template - struct end_impl; - - template <> - struct end_impl + template + struct apply { - template - struct apply + typedef + basic_iterator< + set_iterator_tag + , typename Seq::category + , Seq + , Seq::size::value + > + type; + + static type + call(Seq& seq) { - typedef typename - result_of::end::type - iterator_type; - - typedef typename - result_of::end::type - const_iterator_type; - - typedef typename - mpl::eval_if< - is_const - , mpl::identity - , mpl::identity - >::type - type; - - static type - call(Sequence& s) - { - return fusion::end(s.get_data()); - } - }; + return type(seq,0); + } }; - } -}} + }; +}}} #endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/key_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/key_of_impl.hpp new file mode 100644 index 0000000000..9c56aaf5da --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/key_of_impl.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_SET_DETAIL_KEY_OF_IMPL_HPP +#define BOOST_FUSION_CONTAINER_SET_DETAIL_KEY_OF_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct key_of_impl; + + template <> + struct key_of_impl + : value_of_impl + {}; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/value_of_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/value_of_data_impl.hpp new file mode 100644 index 0000000000..c98e5b9f77 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/value_of_data_impl.hpp @@ -0,0 +1,24 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_SET_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define BOOST_FUSION_CONTAINER_SET_DETAIL_VALUE_OF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + : value_of_impl + {}; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/detail/value_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/value_of_impl.hpp new file mode 100644 index 0000000000..02218310ae --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/detail/value_of_impl.hpp @@ -0,0 +1,34 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_CONTAINER_SET_DETAIL_VALUE_OF_IMPL_HPP +#define BOOST_FUSION_CONTAINER_SET_DETAIL_VALUE_OF_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_impl; + + template <> + struct value_of_impl + { + template + struct apply + { + typedef typename + result_of::value_at< + typename It::seq_type::storage_type + , typename It::index + >::type + type; + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/set.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/set.hpp index 07580bb6a6..62b9140298 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/set/set.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/set.hpp @@ -11,11 +11,13 @@ #include #include #include -#include #include #include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -23,13 +25,12 @@ namespace boost { namespace fusion { struct void_; - struct set_tag; struct fusion_sequence_tag; template struct set : sequence_base > { - struct category : forward_traversal_tag, associative_sequence_tag {}; + struct category : forward_traversal_tag, associative_tag {}; typedef set_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL @@ -49,7 +50,6 @@ namespace boost { namespace fusion : data(rhs) {} #include - #include template set& diff --git a/deal.II/contrib/boost/include/boost/fusion/container/set/set_fwd.hpp b/deal.II/contrib/boost/include/boost/fusion/container/set/set_fwd.hpp index 7facb5136a..082422f1f6 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/set/set_fwd.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/set/set_fwd.hpp @@ -13,6 +13,8 @@ namespace boost { namespace fusion { struct void_; + struct set_tag; + struct set_iterator_tag; template < BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( diff --git a/deal.II/contrib/boost/include/boost/fusion/container/vector/vector.hpp b/deal.II/contrib/boost/include/boost/fusion/container/vector/vector.hpp index 5b9a560843..e8284ca88e 100644 --- a/deal.II/contrib/boost/include/boost/fusion/container/vector/vector.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/container/vector/vector.hpp @@ -56,7 +56,7 @@ namespace boost { namespace fusion template vector(Sequence const& rhs) -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1500) +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1600) : vec(ctor_helper(rhs, is_base_of())) {} #else : vec(rhs) {} @@ -129,7 +129,7 @@ namespace boost { namespace fusion private: -#if BOOST_WORKAROUND(BOOST_MSVC, <= 1500) +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1600) static vector_n const& ctor_helper(vector const& rhs, mpl::true_) { diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_class.hpp b/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_class.hpp new file mode 100644 index 0000000000..ccbfeb18e6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_class.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_HPP +#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_class_named.hpp b/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_class_named.hpp new file mode 100644 index 0000000000..10782681d5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_class_named.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_NAMED_HPP +#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_CLASS_NAMED_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_struct.hpp new file mode 100644 index 0000000000..681aa2e421 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_struct.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_ADAPT_ASSOC_STRUCT_HPP +#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_STRUCT_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_struct_named.hpp b/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_struct_named.hpp new file mode 100644 index 0000000000..19204f50b5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapt_assoc_struct_named.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_ADAPT_ASSOC_STRUCT_NAMED_HPP +#define BOOST_FUSION_INCLUDE_ADAPT_ASSOC_STRUCT_NAMED_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapt_class.hpp b/deal.II/contrib/boost/include/boost/fusion/include/adapt_class.hpp new file mode 100644 index 0000000000..77f519be7b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapt_class.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2001-2007 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_ADAPT_CLASS_HPP +#define BOOST_FUSION_INCLUDE_ADAPT_CLASS_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapt_class_named.hpp b/deal.II/contrib/boost/include/boost/fusion/include/adapt_class_named.hpp new file mode 100644 index 0000000000..81136a1fd9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapt_class_named.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_ADAPT_CLASS_NAMED_HPP +#define BOOST_FUSION_INCLUDE_ADAPT_CLASS_NAMED_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapt_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/include/adapt_struct.hpp index facc897020..c1271543f8 100644 --- a/deal.II/contrib/boost/include/boost/fusion/include/adapt_struct.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapt_struct.hpp @@ -4,8 +4,9 @@ Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ==============================================================================*/ -#if !defined(FUSION_INCLUDE_ADAPT_STRUCT) -#define FUSION_INCLUDE_ADAPT_STRUCT + +#ifndef BOOST_FUSION_INCLUDE_ADAPT_STRUCT_HPP +#define BOOST_FUSION_INCLUDE_ADAPT_STRUCT_HPP #include diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapt_struct_named.hpp b/deal.II/contrib/boost/include/boost/fusion/include/adapt_struct_named.hpp new file mode 100644 index 0000000000..01cbf3294d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapt_struct_named.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_ADAPT_STRUCT_NAMED_HPP +#define BOOST_FUSION_INCLUDE_ADAPT_STRUCT_NAMED_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/adapted_class_named.cpp b/deal.II/contrib/boost/include/boost/fusion/include/adapted_class_named.cpp new file mode 100644 index 0000000000..0002ad6fc7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/adapted_class_named.cpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2001-2009 Joel de Guzman + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_ADAPT_CLASS_NAMED) +#define FUSION_INCLUDE_ADAPT_CLASS_NAMED + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/boost_array.hpp b/deal.II/contrib/boost/include/boost/fusion/include/boost_array.hpp new file mode 100644 index 0000000000..d2c2bed836 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/boost_array.hpp @@ -0,0 +1,12 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ +#if !defined(FUSION_INCLUDE_BOOST_ARRAY) +#define FUSION_INCLUDE_BOOST_ARRAY + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/define_assoc_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/include/define_assoc_struct.hpp new file mode 100644 index 0000000000..8b8ee261d2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/define_assoc_struct.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_DEFINE_ASSOC_STRUCT_HPP +#define BOOST_FUSION_INCLUDE_DEFINE_ASSOC_STRUCT_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/define_struct.hpp b/deal.II/contrib/boost/include/boost/fusion/include/define_struct.hpp new file mode 100644 index 0000000000..564f1c7834 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/define_struct.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_DEFINE_STRUCT_HPP +#define BOOST_FUSION_INCLUDE_DEFINE_STRUCT_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/deref_data.hpp b/deal.II/contrib/boost/include/boost/fusion/include/deref_data.hpp new file mode 100644 index 0000000000..24d4e7cfd1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/deref_data.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_DEREF_DATA_HPP +#define BOOST_FUSION_INCLUDE_DEREF_DATA_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/key_of.hpp b/deal.II/contrib/boost/include/boost/fusion/include/key_of.hpp new file mode 100644 index 0000000000..cb29f571ad --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/key_of.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_KEY_OF_HPP +#define BOOST_FUSION_INCLUDE_KEY_OF_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/proxy_type.hpp b/deal.II/contrib/boost/include/boost/fusion/include/proxy_type.hpp new file mode 100644 index 0000000000..31e8dce010 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/proxy_type.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2010 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_PROXY_TYPE_HPP +#define BOOST_FUSION_INCLUDE_PROXY_TYPE_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/include/value_of_data.hpp b/deal.II/contrib/boost/include/boost/fusion/include/value_of_data.hpp new file mode 100644 index 0000000000..6884185fd0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/include/value_of_data.hpp @@ -0,0 +1,13 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_INCLUDE_VALUE_OF_DATA_HPP +#define BOOST_FUSION_INCLUDE_VALUE_OF_DATA_HPP + +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/advance.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/advance.hpp index 2cbafedec3..56ed60be7c 100644 --- a/deal.II/contrib/boost/include/boost/fusion/iterator/advance.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/advance.hpp @@ -21,7 +21,7 @@ namespace boost { namespace fusion // Special tags: struct iterator_facade_tag; // iterator facade tag - struct array_iterator_tag; // boost::array iterator tag + struct boost_array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -51,7 +51,7 @@ namespace boost { namespace fusion }; template <> - struct advance_impl; + struct advance_impl; template <> struct advance_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/basic_iterator.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/basic_iterator.hpp new file mode 100644 index 0000000000..33c514f39b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/basic_iterator.hpp @@ -0,0 +1,141 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ITERATOR_BASIC_ITERATOR_HPP +#define BOOST_FUSION_ITERATOR_BASIC_ITERATOR_HPP + +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace fusion +{ + namespace extension + { + template + struct value_of_impl; + + template + struct deref_impl; + + template + struct value_of_data_impl; + + template + struct key_of_impl; + + template + struct deref_data_impl; + } + + template + struct basic_iterator + : iterator_facade, Category> + { + typedef mpl::int_ index; + typedef Seq seq_type; + + template + struct value_of + : extension::value_of_impl::template apply + {}; + + template + struct deref + : extension::deref_impl::template apply + {}; + + template + struct value_of_data + : extension::value_of_data_impl::template apply + {}; + + template + struct key_of + : extension::key_of_impl::template apply + {}; + + template + struct deref_data + : extension::deref_data_impl::template apply + {}; + + template + struct advance + { + typedef + basic_iterator + type; + + static type + call(It const& it) + { + return type(*it.seq,0); + } + }; + + template + struct next + : advance > + {}; + + template + struct prior + : advance > + {}; + + template + struct distance + { + typedef mpl::minus type; + + static + type + call(It1 const&, It2 const&) + { + return type(); + } + }; + + template + struct equal_to + : mpl::and_< + is_same< + typename remove_const::type + , typename remove_const::type + > + , mpl::equal_to + > + {}; + + template + basic_iterator(basic_iterator const& it) + : seq(it.seq) + {} + + basic_iterator(Seq& seq, int) + : seq(&seq) + {} + + template + basic_iterator& + operator=(basic_iterator const& it) + { + seq=it.seq; + return *this; + } + + Seq* seq; + }; +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/deref.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/deref.hpp index 0e6f54d299..2d5f04ee0c 100644 --- a/deal.II/contrib/boost/include/boost/fusion/iterator/deref.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/deref.hpp @@ -14,7 +14,7 @@ namespace boost { namespace fusion { // Special tags: struct iterator_facade_tag; // iterator facade tag - struct array_iterator_tag; // boost::array iterator tag + struct boost_array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -35,7 +35,7 @@ namespace boost { namespace fusion }; template <> - struct deref_impl; + struct deref_impl; template <> struct deref_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/deref_data.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/deref_data.hpp new file mode 100644 index 0000000000..09ba439214 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/deref_data.hpp @@ -0,0 +1,49 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ITERATOR_DEREF_DATA_HPP +#define BOOST_FUSION_ITERATOR_DEREF_DATA_HPP + +#include + +namespace boost { namespace fusion +{ + struct iterator_facade_tag; + + namespace extension + { + template + struct deref_data_impl; + + template <> + struct deref_data_impl + { + template + struct apply + : It::template deref_data + {}; + }; + } + + namespace result_of + { + template + struct deref_data + : extension::deref_data_impl::type>:: + template apply + {}; + } + + template + typename result_of::deref_data::type + deref_data(It const& it) + { + return result_of::deref_data::call(it); + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/distance.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/distance.hpp index 44fc4292b1..0cfa414d20 100644 --- a/deal.II/contrib/boost/include/boost/fusion/iterator/distance.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/distance.hpp @@ -22,7 +22,7 @@ namespace boost { namespace fusion // Special tags: struct iterator_facade_tag; // iterator facade tag - struct array_iterator_tag; // boost::array iterator tag + struct boost_array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -48,7 +48,7 @@ namespace boost { namespace fusion }; template <> - struct distance_impl; + struct distance_impl; template <> struct distance_impl; @@ -61,8 +61,8 @@ namespace boost { namespace fusion { template struct distance - : extension::distance_impl::type>:: - template apply + : extension::distance_impl::type>:: + template apply { typedef typename extension::distance_impl::type>:: template apply::type distance_application; diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/equal_to.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/equal_to.hpp index 2db2767520..a038741732 100644 --- a/deal.II/contrib/boost/include/boost/fusion/iterator/equal_to.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/equal_to.hpp @@ -18,7 +18,7 @@ namespace boost { namespace fusion { // Special tags: struct iterator_facade_tag; // iterator facade tag - struct array_iterator_tag; // boost::array iterator tag + struct boost_array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -42,7 +42,7 @@ namespace boost { namespace fusion }; template <> - struct equal_to_impl; + struct equal_to_impl; template <> struct equal_to_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/iterator_facade.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/iterator_facade.hpp index 3e0a926f2b..fa74f8dca5 100644 --- a/deal.II/contrib/boost/include/boost/fusion/iterator/iterator_facade.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/iterator_facade.hpp @@ -50,8 +50,7 @@ namespace boost { namespace fusion template struct distance : distance_detail::linear_distance - { - }; + {}; }; }} diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/key_of.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/key_of.hpp new file mode 100644 index 0000000000..64c2f86aa7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/key_of.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ITERATOR_KEY_OF_HPP +#define BOOST_FUSION_ITERATOR_KEY_OF_HPP + +#include + +namespace boost { namespace fusion +{ + struct iterator_facade_tag; + + namespace extension + { + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + : It::template key_of + {}; + }; + } + + namespace result_of + { + template + struct key_of + : extension::key_of_impl::type>:: + template apply + {}; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/next.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/next.hpp index 9070a9e2e3..d2cf63ddde 100644 --- a/deal.II/contrib/boost/include/boost/fusion/iterator/next.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/next.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion { // Special tags: struct iterator_facade_tag; // iterator facade tag - struct array_iterator_tag; // boost::array iterator tag + struct boost_array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -34,7 +34,7 @@ namespace boost { namespace fusion }; template <> - struct next_impl; + struct next_impl; template <> struct next_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/prior.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/prior.hpp index 9a26103967..a8b9fd64be 100644 --- a/deal.II/contrib/boost/include/boost/fusion/iterator/prior.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/prior.hpp @@ -13,7 +13,7 @@ namespace boost { namespace fusion { // Special tags: struct iterator_facade_tag; // iterator facade tag - struct array_iterator_tag; // boost::array iterator tag + struct boost_array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -34,7 +34,7 @@ namespace boost { namespace fusion }; template <> - struct prior_impl; + struct prior_impl; template <> struct prior_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/value_of.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/value_of.hpp index 808c659360..478e4d2b2a 100644 --- a/deal.II/contrib/boost/include/boost/fusion/iterator/value_of.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/value_of.hpp @@ -14,7 +14,7 @@ namespace boost { namespace fusion { // Special tags: struct iterator_facade_tag; // iterator facade tag - struct array_iterator_tag; // boost::array iterator tag + struct boost_array_iterator_tag; // boost::array iterator tag struct mpl_iterator_tag; // mpl sequence iterator tag struct std_pair_iterator_tag; // std::pair iterator tag @@ -35,7 +35,7 @@ namespace boost { namespace fusion }; template <> - struct value_of_impl; + struct value_of_impl; template <> struct value_of_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/iterator/value_of_data.hpp b/deal.II/contrib/boost/include/boost/fusion/iterator/value_of_data.hpp new file mode 100644 index 0000000000..4a8316deb7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/iterator/value_of_data.hpp @@ -0,0 +1,42 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_ITERATOR_VALUE_OF_DATA_HPP +#define BOOST_FUSION_ITERATOR_VALUE_OF_DATA_HPP + +#include + +namespace boost { namespace fusion +{ + struct iterator_facade_tag; + + namespace extension + { + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + { + template + struct apply + : It::template value_of_data + {}; + }; + } + + namespace result_of + { + template + struct value_of_data + : extension::value_of_data_impl::type>:: + template apply + {}; + } +}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/comparison/detail/greater.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/comparison/detail/greater.hpp index 6807d36715..e7b6a034c4 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/comparison/detail/greater.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/comparison/detail/greater.hpp @@ -32,9 +32,8 @@ namespace boost { namespace fusion { namespace detail static bool call(I1 const& a, I2 const& b, mpl::false_) { - return *a > *b - || !(*b > *a) - && call(fusion::next(a), fusion::next(b)); + return *a > *b || + (!(*b > *a) && call(fusion::next(a), fusion::next(b))); } template diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/comparison/detail/less.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/comparison/detail/less.hpp index 0c457c4181..a8b0ce841f 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/comparison/detail/less.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/comparison/detail/less.hpp @@ -32,9 +32,8 @@ namespace boost { namespace fusion { namespace detail static bool call(I1 const& a, I2 const& b, mpl::false_) { - return *a < *b - || !(*b < *a) - && call(fusion::next(a), fusion::next(b)); + return *a < *b || + (!(*b < *a) && call(fusion::next(a), fusion::next(b))); } template diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/at.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/at.hpp index bcb67990e9..9ccbfc64a2 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/at.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/at.hpp @@ -17,7 +17,7 @@ namespace boost { namespace fusion // Special tags: struct sequence_facade_tag; struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -41,7 +41,7 @@ namespace boost { namespace fusion struct at_impl; template <> - struct at_impl; + struct at_impl; template <> struct at_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/at_key.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/at_key.hpp index 849ff2940e..30fefe0126 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/at_key.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/at_key.hpp @@ -9,6 +9,8 @@ #define BOOST_FUSION_AT_KEY_20060304_1755 #include +#include +#include #include #include @@ -16,7 +18,7 @@ namespace boost { namespace fusion { // Special tags: struct sequence_facade_tag; - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -25,19 +27,32 @@ namespace boost { namespace fusion template struct at_key_impl { - template - struct apply; + template + struct apply + { + typedef typename + result_of::deref_data< + typename result_of::find::type + >::type + type; + + static type + call(Seq& seq) + { + return fusion::deref_data(fusion::find(seq)); + } + }; }; template <> struct at_key_impl { template - struct apply : Sequence::template at_key {}; + struct apply : Sequence::template at_key_impl {}; }; template <> - struct at_key_impl; + struct at_key_impl; template <> struct at_key_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/begin.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/begin.hpp index 715ef9e1c7..5dbe0c408d 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/begin.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/begin.hpp @@ -14,7 +14,7 @@ namespace boost { namespace fusion // Special tags: struct sequence_facade_tag; // iterator facade tag struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -38,7 +38,7 @@ namespace boost { namespace fusion struct begin_impl; template <> - struct begin_impl; + struct begin_impl; template <> struct begin_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/end.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/end.hpp index 04232f12ae..98a554e307 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/end.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/end.hpp @@ -14,7 +14,7 @@ namespace boost { namespace fusion // Special tags: struct sequence_facade_tag; struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -38,7 +38,7 @@ namespace boost { namespace fusion struct end_impl; template <> - struct end_impl; + struct end_impl; template <> struct end_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp index d3c31cccd2..8b61746af4 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/ext_/size_s.hpp @@ -28,8 +28,8 @@ namespace boost { namespace fusion template struct result; - template - struct result + template + struct result : mpl::plus< segmented_size::type> , typename remove_reference::type diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/has_key.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/has_key.hpp index 4c6a3e079b..f254eb1eeb 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/has_key.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/has_key.hpp @@ -7,9 +7,11 @@ #if !defined(FUSION_HAS_KEY_09232005_1454) #define FUSION_HAS_KEY_09232005_1454 -#include #include -#include +#include +#include +#include +#include namespace boost { namespace fusion { @@ -17,7 +19,7 @@ namespace boost { namespace fusion // Special tags: struct sequence_facade_tag; - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -26,10 +28,14 @@ namespace boost { namespace fusion template struct has_key_impl { - template + template struct apply - : mpl::not_::type, void_> > + : mpl::not_< + typename result_of::equal_to< + typename result_of::find::type + , typename result_of::end::type + >::type + >::type {}; }; @@ -41,7 +47,7 @@ namespace boost { namespace fusion }; template <> - struct has_key_impl; + struct has_key_impl; template <> struct has_key_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/size.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/size.hpp index 74e3f53a61..2a3cb7f823 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/size.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/size.hpp @@ -15,7 +15,7 @@ namespace boost { namespace fusion // Special tags: struct sequence_facade_tag; struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -39,7 +39,7 @@ namespace boost { namespace fusion struct size_impl; template <> - struct size_impl; + struct size_impl; template <> struct size_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/value_at.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/value_at.hpp index d0868155d3..01cdc9d50a 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/value_at.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/value_at.hpp @@ -15,7 +15,7 @@ namespace boost { namespace fusion // Special tags: struct sequence_facade_tag; struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -39,7 +39,7 @@ namespace boost { namespace fusion struct value_at_impl; template <> - struct value_at_impl; + struct value_at_impl; template <> struct value_at_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/value_at_key.hpp b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/value_at_key.hpp index dbef3e89d0..d7f84cd932 100644 --- a/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/value_at_key.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/sequence/intrinsic/value_at_key.hpp @@ -9,13 +9,15 @@ #define FUSION_VALUE_AT_KEY_05052005_0229 #include +#include +#include #include namespace boost { namespace fusion { // Special tags: struct sequence_facade_tag; - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -24,8 +26,12 @@ namespace boost { namespace fusion template struct value_at_key_impl { - template - struct apply; + template + struct apply + : result_of::value_of_data< + typename result_of::find::type + > + {}; }; template <> @@ -36,7 +42,7 @@ namespace boost { namespace fusion }; template <> - struct value_at_key_impl; + struct value_at_key_impl; template <> struct value_at_key_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/support/category_of.hpp b/deal.II/contrib/boost/include/boost/fusion/support/category_of.hpp index 4d38fb6438..73def5b0e0 100644 --- a/deal.II/contrib/boost/include/boost/fusion/support/category_of.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/support/category_of.hpp @@ -15,7 +15,7 @@ namespace boost { namespace fusion { // Special tags: struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -33,7 +33,7 @@ namespace boost { namespace fusion struct random_access_traversal_tag : bidirectional_traversal_tag {}; - struct associative_sequence_tag {}; + struct associative_tag {}; namespace extension { @@ -48,7 +48,7 @@ namespace boost { namespace fusion struct category_of_impl; template <> - struct category_of_impl; + struct category_of_impl; template <> struct category_of_impl; @@ -68,7 +68,7 @@ namespace boost { namespace fusion template struct is_associative : is_base_of< - associative_sequence_tag + associative_tag , typename category_of::type> {}; diff --git a/deal.II/contrib/boost/include/boost/fusion/support/ext_/is_segmented.hpp b/deal.II/contrib/boost/include/boost/fusion/support/ext_/is_segmented.hpp index 38def075c8..63330a4ae8 100644 --- a/deal.II/contrib/boost/include/boost/fusion/support/ext_/is_segmented.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/support/ext_/is_segmented.hpp @@ -14,7 +14,7 @@ namespace boost { namespace fusion // Special tags: struct sequence_facade_tag; struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag struct iterator_range_tag; diff --git a/deal.II/contrib/boost/include/boost/fusion/support/is_sequence.hpp b/deal.II/contrib/boost/include/boost/fusion/support/is_sequence.hpp index 84dc2ec12f..d57cecb410 100644 --- a/deal.II/contrib/boost/include/boost/fusion/support/is_sequence.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/support/is_sequence.hpp @@ -19,7 +19,7 @@ namespace boost { namespace fusion // Special tags: struct non_fusion_tag; struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -43,7 +43,7 @@ namespace boost { namespace fusion struct is_sequence_impl; template <> - struct is_sequence_impl; + struct is_sequence_impl; template <> struct is_sequence_impl; @@ -56,8 +56,9 @@ namespace boost { namespace fusion { template struct is_sequence - : extension::is_sequence_impl::type>:: - template apply + : extension::is_sequence_impl< + typename fusion::detail::tag_of::type + >::template apply {}; } }} diff --git a/deal.II/contrib/boost/include/boost/fusion/support/is_view.hpp b/deal.II/contrib/boost/include/boost/fusion/support/is_view.hpp index a89291d1a7..e2cf6eb4e7 100644 --- a/deal.II/contrib/boost/include/boost/fusion/support/is_view.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/support/is_view.hpp @@ -15,7 +15,7 @@ namespace boost { namespace fusion // Special tags: struct sequence_facade_tag; struct boost_tuple_tag; // boost::tuples::tuple tag - struct array_tag; // boost::array tag + struct boost_array_tag; // boost::array tag struct mpl_sequence_tag; // mpl sequence tag struct std_pair_tag; // std::pair tag @@ -41,7 +41,7 @@ namespace boost { namespace fusion struct is_view_impl; template <> - struct is_view_impl; + struct is_view_impl; template <> struct is_view_impl; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/detail/strictest_traversal.hpp b/deal.II/contrib/boost/include/boost/fusion/view/detail/strictest_traversal.hpp index e74ffbfcfb..0ba5d8a1a7 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/detail/strictest_traversal.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/detail/strictest_traversal.hpp @@ -42,8 +42,8 @@ namespace boost { namespace fusion template struct result; - template - struct result + template + struct result { typedef typename remove_reference::type next_value; typedef typename remove_reference::type strictest_so_far; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/ext_/segmented_iterator.hpp b/deal.II/contrib/boost/include/boost/fusion/view/ext_/segmented_iterator.hpp index b28182a4cf..79bc707e4d 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/ext_/segmented_iterator.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/ext_/segmented_iterator.hpp @@ -9,8 +9,10 @@ #define FUSION_SEGMENTED_ITERATOR_EAN_05032006_1027 #include +#include #include #include +#include #include #include #include @@ -20,6 +22,7 @@ #include #include // for nil #include +#include #include #include #include @@ -59,16 +62,15 @@ namespace boost { namespace fusion struct segmented_range_tag; //////////////////////////////////////////////////////////////////////////// - template + template struct segmented_range - : sequence_base > + : sequence_base > { BOOST_MPL_ASSERT_NOT((is_reference)); typedef mpl::bool_ is_segmented; typedef segmented_range_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL typedef mpl::true_ is_view; - typedef Iterator iterator_type; // If this is a range of segments, skip over the empty ones typedef typename mpl::if_< @@ -83,20 +85,34 @@ namespace boost { namespace fusion , sequence_non_ref_type & >::type sequence_type; + typedef + typename fusion::result_of::advance< + typename fusion::result_of::begin::type + , Index + >::type + iterator_type; + typedef typename traits::category_of::type category; explicit segmented_range(Sequence &sequence_) : sequence(sequence_type(sequence_)) - , where_(fusion::begin(sequence)) {} - segmented_range(sequence_type sequence_, iterator_type const &wh) + segmented_range(sequence_type sequence_, int) : sequence(sequence_) - , where_(wh) {} + iterator_type where_() const + { + return fusion::advance( + fusion::begin(const_cast(this->sequence)) + ); + } + sequence_type sequence; - iterator_type where_; + + private: + segmented_range &operator =(segmented_range const &); }; } @@ -148,7 +164,7 @@ namespace boost { namespace fusion typedef typename Sequence::iterator_type type; static type call(Sequence &seq) { - return seq.where_; + return seq.where_(); } }; }; @@ -176,15 +192,15 @@ namespace boost { namespace fusion template struct range_next; - template - struct range_next > + template + struct range_next > { - typedef typename result_of::next::type iterator_type; - typedef segmented_range type; + typedef typename mpl::next::type index_type; + typedef segmented_range type; - static type call(segmented_range const &rng) + static type call(segmented_range const &rng) { - return type(rng.sequence, fusion::next(rng.where_)); + return type(rng.sequence, 0); } }; @@ -205,8 +221,7 @@ namespace boost { namespace fusion { typedef typename result_of::segments::type segments; typedef typename remove_reference::type sequence; - typedef typename result_of::begin >::type begin; - typedef segmented_range type; + typedef segmented_range, true> type; static type call(Sequence &seq) { @@ -219,8 +234,7 @@ namespace boost { namespace fusion struct as_segmented_range { typedef typename remove_reference::type sequence; - typedef typename result_of::begin::type begin; - typedef segmented_range type; + typedef segmented_range, false> type; static type call(Sequence &seq) { @@ -228,10 +242,10 @@ namespace boost { namespace fusion } }; - template - struct as_segmented_range, IsSegmented> + template + struct as_segmented_range, IsSegmented> { - typedef segmented_range type; + typedef segmented_range type; static type &call(type &seq) { return seq; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/begin_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/begin_impl.hpp index 2ffe7bd0fa..7d94261de1 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/begin_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/begin_impl.hpp @@ -11,7 +11,7 @@ namespace boost { namespace fusion { struct filter_view_tag; - template + template struct filter_iterator; namespace extension @@ -28,7 +28,8 @@ namespace boost { namespace fusion typedef typename Sequence::first_type first_type; typedef typename Sequence::last_type last_type; typedef typename Sequence::pred_type pred_type; - typedef filter_iterator type; + typedef typename Sequence::category category; + typedef filter_iterator type; static type call(Sequence& s) diff --git a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp new file mode 100644 index 0000000000..bf721b5a5a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/deref_data_impl.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP +#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_DEREF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_data_impl; + + template <> + struct deref_data_impl + { + template + struct apply + { + typedef typename + result_of::deref_data::type + type; + + static type + call(It const& it) + { + return fusion::deref_data(it.first); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/end_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/end_impl.hpp index 677004d49e..baabbd451c 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/end_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/end_impl.hpp @@ -11,7 +11,7 @@ namespace boost { namespace fusion { struct filter_view_tag; - template + template struct filter_iterator; namespace extension @@ -27,7 +27,8 @@ namespace boost { namespace fusion { typedef typename Sequence::last_type last_type; typedef typename Sequence::pred_type pred_type; - typedef filter_iterator type; + typedef typename Sequence::category category; + typedef filter_iterator type; static type call(Sequence& s) diff --git a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/key_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/key_of_impl.hpp new file mode 100644 index 0000000000..09d9112b1f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/key_of_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP +#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_KEY_OF_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + : result_of::key_of + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/next_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/next_impl.hpp index 8423dfe1d2..a436bfc260 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/next_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/next_impl.hpp @@ -8,14 +8,19 @@ #define FUSION_NEXT_IMPL_06052005_0900 #include +#include #include #include +#include +#include +#include +#include namespace boost { namespace fusion { struct filter_view_iterator_tag; - template + template struct filter_iterator; namespace extension @@ -32,6 +37,7 @@ namespace boost { namespace fusion typedef typename Iterator::first_type first_type; typedef typename Iterator::last_type last_type; typedef typename Iterator::pred_type pred_type; + typedef typename Iterator::category category; typedef typename mpl::eval_if< @@ -41,12 +47,19 @@ namespace boost { namespace fusion >::type next_type; - typedef typename detail::static_find_if< - next_type, last_type, pred_type> + typedef typename + detail::static_find_if< + next_type + , last_type + , mpl::bind1< + typename mpl::lambda::type + , mpl::bind1,mpl::_1> + > + > filter; typedef filter_iterator< - typename filter::type, last_type, pred_type> + category, typename filter::type, last_type, pred_type> type; static type diff --git a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp new file mode 100644 index 0000000000..38d1bdc063 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/detail/value_of_data_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define BOOST_FUSION_VIEW_FILTER_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + { + template + struct apply + : result_of::value_of_data + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/filter_view.hpp b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/filter_view.hpp index c3e63fdb73..69f173297d 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/filter_view.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/filter_view.hpp @@ -17,6 +17,10 @@ #include #include #include +#include +#include +#include + namespace boost { namespace fusion { @@ -29,7 +33,13 @@ namespace boost { namespace fusion { typedef filter_view_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL - typedef forward_traversal_tag category; + typedef typename + mpl::eval_if< + traits::is_associative + , mpl::inherit2 + , mpl::identity + >::type + category; typedef mpl::true_ is_view; typedef typename result_of::begin::type first_type; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/filter_view_iterator.hpp b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/filter_view_iterator.hpp index be93c6576c..5d1efc875e 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/filter_view/filter_view_iterator.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/filter_view/filter_view_iterator.hpp @@ -9,20 +9,29 @@ #include #include +#include #include +#include +#include +#include +#include +#include + #include #include #include #include -#include +#include +#include +#include namespace boost { namespace fusion { struct filter_view_iterator_tag; struct forward_traversal_tag; - template - struct filter_iterator : iterator_base > + template + struct filter_iterator : iterator_base > { typedef convert_iterator first_converter; typedef typename first_converter::type first_iter; @@ -30,8 +39,17 @@ namespace boost { namespace fusion typedef typename last_converter::type last_iter; typedef filter_view_iterator_tag fusion_tag; - typedef forward_traversal_tag category; - typedef detail::static_find_if filter; + typedef Category category; + typedef + detail::static_find_if< + first_iter + , last_iter + , mpl::bind1< + typename mpl::lambda::type + , mpl::bind1,mpl::_1> + > + > + filter; typedef typename filter::type first_type; typedef last_iter last_type; typedef Pred pred_type; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/iterator_range/iterator_range.hpp b/deal.II/contrib/boost/include/boost/fusion/view/iterator_range/iterator_range.hpp index 0036f0ae36..14bb24574e 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/iterator_range/iterator_range.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/iterator_range/iterator_range.hpp @@ -17,7 +17,6 @@ #include #include #include -#include namespace boost { namespace fusion { diff --git a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/begin_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/begin_impl.hpp index e2b0281ee2..140d3756d1 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/begin_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/begin_impl.hpp @@ -14,7 +14,7 @@ namespace boost { namespace fusion { struct joint_view_tag; - template + template struct joint_view_iterator; namespace extension @@ -31,13 +31,14 @@ namespace boost { namespace fusion typedef typename Sequence::first_type first_type; typedef typename Sequence::last_type last_type; typedef typename Sequence::concat_type concat_type; + typedef typename Sequence::category category; typedef result_of::equal_to equal_to; typedef typename mpl::if_< equal_to , concat_type - , joint_view_iterator + , joint_view_iterator >::type type; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp new file mode 100644 index 0000000000..a60a125fa9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/deref_data_impl.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_DEREF_DATA_IMPL_HPP +#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_DEREF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_data_impl; + + template <> + struct deref_data_impl + { + template + struct apply + { + typedef typename + result_of::deref_data::type + type; + + static type + call(It const& it) + { + return fusion::deref_data(it.first); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/key_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/key_of_impl.hpp new file mode 100644 index 0000000000..e413c3d441 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/key_of_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_KEY_OF_IMPL_HPP +#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_KEY_OF_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + : result_of::key_of + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/next_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/next_impl.hpp index 80d3580d7b..2313faa0d8 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/next_impl.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/next_impl.hpp @@ -15,7 +15,7 @@ namespace boost { namespace fusion { struct joint_view_iterator_tag; - template + template struct joint_view_iterator; namespace extension @@ -32,6 +32,7 @@ namespace boost { namespace fusion typedef typename Iterator::first_type first_type; typedef typename Iterator::last_type last_type; typedef typename Iterator::concat_type concat_type; + typedef typename Iterator::category category; typedef typename result_of::next::type next_type; typedef result_of::equal_to equal_to; @@ -39,7 +40,7 @@ namespace boost { namespace fusion mpl::if_< equal_to , concat_type - , joint_view_iterator + , joint_view_iterator >::type type; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/value_of_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/value_of_data_impl.hpp new file mode 100644 index 0000000000..cc883d7023 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/detail/value_of_data_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define BOOST_FUSION_VIEW_JOINT_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + { + template + struct apply + : result_of::value_of_data + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/joint_view.hpp b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/joint_view.hpp index 9cc798d346..48d912cded 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/joint_view.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/joint_view.hpp @@ -19,6 +19,9 @@ #include #include #include +#include +#include +#include namespace boost { namespace fusion { @@ -31,7 +34,16 @@ namespace boost { namespace fusion { typedef joint_view_tag fusion_tag; typedef fusion_sequence_tag tag; // this gets picked up by MPL - typedef forward_traversal_tag category; + typedef typename + mpl::eval_if< + mpl::and_< + traits::is_associative + , traits::is_associative + > + , mpl::inherit2 + , mpl::identity + >::type + category; typedef mpl::true_ is_view; typedef typename result_of::begin::type first_type; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/joint_view_iterator.hpp b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/joint_view_iterator.hpp index 18696d7e9d..0fd4c63622 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/joint_view/joint_view_iterator.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/joint_view/joint_view_iterator.hpp @@ -14,6 +14,9 @@ #include #include #include +#include +#include +#include #include namespace boost { namespace fusion @@ -21,9 +24,9 @@ namespace boost { namespace fusion struct joint_view_iterator_tag; struct forward_traversal_tag; - template + template struct joint_view_iterator - : iterator_base > + : iterator_base > { typedef convert_iterator first_converter; typedef convert_iterator last_converter; @@ -34,7 +37,7 @@ namespace boost { namespace fusion typedef typename concat_converter::type concat_type; typedef joint_view_iterator_tag fusion_tag; - typedef forward_traversal_tag category; + typedef Category category; BOOST_STATIC_ASSERT((!result_of::equal_to::value)); joint_view_iterator(First const& first, Concat const& concat) diff --git a/deal.II/contrib/boost/include/boost/fusion/view/nview/nview.hpp b/deal.II/contrib/boost/include/boost/fusion/view/nview/nview.hpp index fe8d35cf2b..02422e0b86 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/nview/nview.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/nview/nview.hpp @@ -14,6 +14,8 @@ #include #include +#include +#include #include #include @@ -34,7 +36,7 @@ namespace boost { namespace fusion struct result : add_reference {}; template - typename boost::result_of::type + typename add_reference::type operator()(T& x) const { return x; @@ -52,11 +54,18 @@ namespace boost { namespace fusion {}; template - typename boost::result_of::type + typename add_reference::type>::type operator()(T& x) const { return x; } + + template + typename add_reference::type>::type + operator()(T const& x) const + { + return x; + } }; } diff --git a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/at_impl.hpp new file mode 100644 index 0000000000..2e842596c4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/at_impl.hpp @@ -0,0 +1,41 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_AT_IMPL_HPP +#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_AT_IMPL_HPP + +#include +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct at_impl; + + template <> + struct at_impl + { + template + struct apply + { + typedef mpl::minus, N> real_n; + + typedef typename + result_of::at::type + type; + + static type + call(Seq& seq) + { + return fusion::at(seq.seq); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp new file mode 100644 index 0000000000..2f52bdd898 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/deref_data_impl.hpp @@ -0,0 +1,37 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP +#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_DEREF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct deref_data_impl; + + template <> + struct deref_data_impl + { + template + struct apply + { + typedef typename + result_of::deref_data::type + type; + + static type + call(It const& it) + { + return fusion::deref_data(it.first); + } + }; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp new file mode 100644 index 0000000000..3d760fd272 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/key_of_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_KEY_OF_IMPL_HPP +#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_KEY_OF_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct key_of_impl; + + template <> + struct key_of_impl + { + template + struct apply + : result_of::key_of + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/value_at_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/value_at_impl.hpp new file mode 100644 index 0000000000..90f5129bc9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/value_at_impl.hpp @@ -0,0 +1,33 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_AT_IMPL_HPP +#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_AT_IMPL_HPP + +#include +#include +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_at_impl; + + template <> + struct value_at_impl + { + template + struct apply + : result_of::value_at< + typename Seq::seq_type + , mpl::minus, N> + > + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp new file mode 100644 index 0000000000..69d310ffb1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/detail/value_of_data_impl.hpp @@ -0,0 +1,28 @@ +/*============================================================================= + Copyright (c) 2009 Christopher Schmidt + + Distributed under the Boost Software License, Version 1.0. (See accompanying + file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +==============================================================================*/ + +#ifndef BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP +#define BOOST_FUSION_VIEW_REVERSE_VIEW_DETAIL_VALUE_OF_DATA_IMPL_HPP + +#include + +namespace boost { namespace fusion { namespace extension +{ + template + struct value_of_data_impl; + + template <> + struct value_of_data_impl + { + template + struct apply + : result_of::value_of_data + {}; + }; +}}} + +#endif diff --git a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/reverse_view.hpp b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/reverse_view.hpp index c939f7ce29..19b51d139d 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/reverse_view.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/reverse_view.hpp @@ -13,6 +13,8 @@ #include #include #include +#include +#include #include #include #include @@ -20,6 +22,9 @@ #include #include #include +#include +#include +#include namespace boost { namespace fusion { @@ -33,6 +38,7 @@ namespace boost { namespace fusion typedef fusion_sequence_tag tag; // this gets picked up by MPL typedef mpl::true_ is_view; + typedef Sequence seq_type; typedef typename traits::category_of::type category; typedef typename result_of::begin::type first_type; typedef typename result_of::end::type last_type; diff --git a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp index 0a890437de..af2267e3b1 100644 --- a/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp +++ b/deal.II/contrib/boost/include/boost/fusion/view/reverse_view/reverse_view_iterator.hpp @@ -17,6 +17,9 @@ #include #include #include +#include +#include +#include #include #include diff --git a/deal.II/contrib/boost/include/boost/graph/adjacency_list.hpp b/deal.II/contrib/boost/include/boost/graph/adjacency_list.hpp index 6ba8f435c0..1a24680faa 100644 --- a/deal.II/contrib/boost/include/boost/graph/adjacency_list.hpp +++ b/deal.II/contrib/boost/include/boost/graph/adjacency_list.hpp @@ -1,6 +1,7 @@ //======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. -// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek +// Copyright 2010 Thomas Claveirole +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, Thomas Claveirole // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -17,16 +18,7 @@ #include #include -// TODO: Deprecating this requires some cooperation from Boost.Config. It's not -// a good idea to just refuse the inclusion because it could break otherwise -// functioning code. -#if !defined BOOST_NO_HASH -# ifdef BOOST_HASH_SET_HEADER -# include BOOST_HASH_SET_HEADER -# else -# include -# endif -#endif +#include #if !defined BOOST_NO_SLIST # ifdef BOOST_SLIST_HEADER @@ -73,12 +65,10 @@ namespace boost { struct mapS { }; struct multisetS { }; struct multimapS { }; -#if !defined BOOST_NO_HASH struct hash_setS { }; struct hash_mapS { }; struct hash_multisetS { }; struct hash_multimapS { }; -#endif template struct container_gen { }; @@ -118,27 +108,25 @@ namespace boost { typedef std::multiset type; }; -#if !defined BOOST_NO_HASH template struct container_gen { - typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set type; + typedef boost::unordered_set type; }; template struct container_gen { - typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set type; + typedef boost::unordered_set type; }; template struct container_gen { - typedef BOOST_STD_EXTENSION_NAMESPACE::hash_multiset type; + typedef boost::unordered_multiset type; }; template struct container_gen { - typedef BOOST_STD_EXTENSION_NAMESPACE::hash_multiset type; + typedef boost::unordered_multiset type; }; -#endif #else // !defined BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION @@ -180,27 +168,25 @@ namespace boost { struct bind_ { typedef std::multiset > type; }; }; -#if !defined BOOST_NO_HASH struct hash_setS { template - struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set > type; }; + struct bind_ { typedef boost::unordered_set type; }; }; struct hash_mapS { template - struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_set > type; }; + struct bind_ { typedef boost::unordered_set type; }; }; struct hash_multisetS { template - struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_multiset > type; }; + struct bind_ { typedef boost::unordered_multiset type; }; }; struct hash_multimapS { template - struct bind_ { typedef BOOST_STD_EXTENSION_NAMESPACE::hash_multiset > type; }; + struct bind_ { typedef boost::unordered_multiset type; }; }; -#endif template struct container_selector { typedef vecS type; @@ -216,9 +202,7 @@ namespace boost { BOOST_CONTAINER_SELECTOR(mapS); BOOST_CONTAINER_SELECTOR(setS); BOOST_CONTAINER_SELECTOR(multisetS); -#if !defined BOOST_NO_HASH BOOST_CONTAINER_SELECTOR(hash_mapS); -#endif #if !defined BOOST_NO_SLIST BOOST_CONTAINER_SELECTOR(slistS); #endif @@ -256,24 +240,30 @@ namespace boost { struct parallel_edge_traits { typedef allow_parallel_edge_tag type; }; -#if !defined BOOST_NO_HASH template <> struct parallel_edge_traits { typedef disallow_parallel_edge_tag type; }; -#endif // mapS is obsolete, replaced with setS template <> struct parallel_edge_traits { typedef disallow_parallel_edge_tag type; }; -#if !defined BOOST_NO_HASH template <> struct parallel_edge_traits { typedef disallow_parallel_edge_tag type; }; -#endif + + template <> + struct parallel_edge_traits { + typedef allow_parallel_edge_tag type; + }; + + template <> + struct parallel_edge_traits { + typedef allow_parallel_edge_tag type; + }; namespace detail { template struct is_random_access { diff --git a/deal.II/contrib/boost/include/boost/graph/adjacency_list_io.hpp b/deal.II/contrib/boost/include/boost/graph/adjacency_list_io.hpp index 326d490d04..91b0b465d7 100644 --- a/deal.II/contrib/boost/include/boost/graph/adjacency_list_io.hpp +++ b/deal.II/contrib/boost/include/boost/graph/adjacency_list_io.hpp @@ -94,7 +94,7 @@ void getSubset } inline void getSubset -( no_property& p, const no_property& s ) +( no_property&, const no_property& ) { } diff --git a/deal.II/contrib/boost/include/boost/graph/adjacency_matrix.hpp b/deal.II/contrib/boost/include/boost/graph/adjacency_matrix.hpp index cf02a1d644..a3694dab74 100644 --- a/deal.II/contrib/boost/include/boost/graph/adjacency_matrix.hpp +++ b/deal.II/contrib/boost/include/boost/graph/adjacency_matrix.hpp @@ -925,18 +925,19 @@ namespace boost { // Functions required by the MutableGraph concept // O(1) - template + template std::pair::edge_descriptor, bool> add_edge(typename adjacency_matrix::vertex_descriptor u, typename adjacency_matrix::vertex_descriptor v, - const EP& ep, + const EP2& ep, adjacency_matrix& g) { typedef typename adjacency_matrix::edge_descriptor edge_descriptor; if (detail::get_edge_exists(g.get_edge(u,v), 0) == false) { ++(g.m_num_edges); - detail::set_property(g.get_edge(u,v), ep, 0); + detail::set_property(g.get_edge(u,v), EP(ep), 0); detail::set_edge_exists(g.get_edge(u,v), true, 0); return std::make_pair (edge_descriptor(true, u, v, &detail::get_property(g.get_edge(u,v))), @@ -989,9 +990,10 @@ namespace boost { return *vertices(g).first; } - template + template inline typename adjacency_matrix::vertex_descriptor - add_vertex(const VP& vp, adjacency_matrix& g) { + add_vertex(const VP2& /*vp*/, adjacency_matrix& g) { // UNDER CONSTRUCTION assert(false); return *vertices(g).first; @@ -999,8 +1001,8 @@ namespace boost { template inline void - remove_vertex(typename adjacency_matrix::vertex_descriptor u, - adjacency_matrix& g) + remove_vertex(typename adjacency_matrix::vertex_descriptor /*u*/, + adjacency_matrix& /*g*/) { // UNDER CONSTRUCTION assert(false); @@ -1298,7 +1300,7 @@ namespace boost { template typename adjacency_matrix::vertex_descriptor vertex(typename adjacency_matrix::vertices_size_type n, - const adjacency_matrix& g) + const adjacency_matrix&) { return n; } diff --git a/deal.II/contrib/boost/include/boost/graph/astar_search.hpp b/deal.II/contrib/boost/include/boost/graph/astar_search.hpp index 25342e82e6..4747433793 100644 --- a/deal.II/contrib/boost/include/boost/graph/astar_search.hpp +++ b/deal.II/contrib/boost/include/boost/graph/astar_search.hpp @@ -17,6 +17,7 @@ #include #include #include +#include #include #include #include @@ -147,7 +148,7 @@ namespace boost { template void examine_edge(Edge e, Graph& g) { if (m_compare(get(m_weight, e), m_zero)) - throw negative_edge(); + BOOST_THROW_EXCEPTION(negative_edge()); m_vis.examine_edge(e, g); } template @@ -240,12 +241,12 @@ namespace boost { DistanceMap distance, WeightMap weight, ColorMap color, VertexIndexMap index_map, CompareFunction compare, CombineFunction combine, - CostInf inf, CostZero zero) + CostInf /*inf*/, CostZero zero) { typedef typename graph_traits::vertex_descriptor Vertex; - typedef boost::vector_property_map IndexInHeapMap; - IndexInHeapMap index_in_heap; + typedef boost::vector_property_map IndexInHeapMap; + IndexInHeapMap index_in_heap(index_map); typedef d_ary_heap_indirect MutableQueue; MutableQueue Q(cost, index_in_heap, compare); diff --git a/deal.II/contrib/boost/include/boost/graph/biconnected_components.hpp b/deal.II/contrib/boost/include/boost/graph/biconnected_components.hpp index ac220659d0..0345963642 100644 --- a/deal.II/contrib/boost/include/boost/graph/biconnected_components.hpp +++ b/deal.II/contrib/boost/include/boost/graph/biconnected_components.hpp @@ -83,9 +83,9 @@ namespace boost put(lowpt, source(e, g), min BOOST_PREVENT_MACRO_SUBSTITUTION(get(lowpt, source(e, g)), get(dtm, target(e, g)))); + } vis.back_edge(e, g); } - } template void forward_or_cross_edge(const Edge& e, Graph& g) diff --git a/deal.II/contrib/boost/include/boost/graph/bipartite.hpp b/deal.II/contrib/boost/include/boost/graph/bipartite.hpp new file mode 100644 index 0000000000..90cff6fea4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/graph/bipartite.hpp @@ -0,0 +1,386 @@ +/** + * + * Copyright (c) 2010 Matthias Walter (xammy@xammy.homelinux.net) + * + * Authors: Matthias Walter + * + * Distributed under the Boost Software License, Version 1.0. (See + * accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + */ + +#ifndef BOOST_GRAPH_BIPARTITE_HPP +#define BOOST_GRAPH_BIPARTITE_HPP + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + + namespace detail { + + /** + * The bipartite_visitor_error is thrown if an edge cannot be colored. + * The witnesses are the edges incident vertices. + */ + + template + struct bipartite_visitor_error: std::exception + { + std::pair witnesses; + + bipartite_visitor_error (Vertex a, Vertex b) : + witnesses (a, b) + { + + } + + const char* what () const throw () + { + return "Graph is not bipartite."; + } + }; + + /** + * Functor which colors edges to be non-monochromatic. + */ + + template + struct bipartition_colorize + { + typedef on_tree_edge event_filter; + + bipartition_colorize (PartitionMap partition_map) : + partition_map_ (partition_map) + { + + } + + template + void operator() (Edge e, const Graph& g) + { + typedef typename graph_traits ::vertex_descriptor vertex_descriptor_t; + typedef color_traits ::value_type> color_traits; + + vertex_descriptor_t source_vertex = source (e, g); + vertex_descriptor_t target_vertex = target (e, g); + if (get (partition_map_, source_vertex) == color_traits::white ()) + put (partition_map_, target_vertex, color_traits::black ()); + else + put (partition_map_, target_vertex, color_traits::white ()); + } + + private: + PartitionMap partition_map_; + }; + + /** + * Creates a bipartition_colorize functor which colors edges + * to be non-monochromatic. + * + * @param partition_map Color map for the bipartition + * @return The functor. + */ + + template + inline bipartition_colorize colorize_bipartition (PartitionMap partition_map) + { + return bipartition_colorize (partition_map); + } + + /** + * Functor which tests an edge to be monochromatic. + */ + + template + struct bipartition_check + { + typedef on_back_edge event_filter; + + bipartition_check (PartitionMap partition_map) : + partition_map_ (partition_map) + { + + } + + template + void operator() (Edge e, const Graph& g) + { + typedef typename graph_traits ::vertex_descriptor vertex_descriptor_t; + + vertex_descriptor_t source_vertex = source (e, g); + vertex_descriptor_t target_vertex = target (e, g); + if (get (partition_map_, source_vertex) == get (partition_map_, target_vertex)) + throw bipartite_visitor_error (source_vertex, target_vertex); + } + + private: + PartitionMap partition_map_; + }; + + /** + * Creates a bipartition_check functor which raises an error if a + * monochromatic edge is found. + * + * @param partition_map The map for a bipartition. + * @return The functor. + */ + + template + inline bipartition_check check_bipartition (PartitionMap partition_map) + { + return bipartition_check (partition_map); + } + + /** + * Find the beginning of a common suffix of two sequences + * + * @param sequence1 Pair of bidirectional iterators defining the first sequence. + * @param sequence2 Pair of bidirectional iterators defining the second sequence. + * @return Pair of iterators pointing to the beginning of the common suffix. + */ + + template + inline std::pair reverse_mismatch (std::pair < + BiDirectionalIterator1, BiDirectionalIterator1> sequence1, std::pair sequence2) + { + if (sequence1.first == sequence1.second || sequence2.first == sequence2.second) + return std::make_pair (sequence1.first, sequence2.first); + + BiDirectionalIterator1 iter1 = sequence1.second; + BiDirectionalIterator2 iter2 = sequence2.second; + + while (true) + { + --iter1; + --iter2; + if (*iter1 != *iter2) + { + ++iter1; + ++iter2; + break; + } + if (iter1 == sequence1.first) + break; + if (iter2 == sequence2.first) + break; + } + + return std::make_pair (iter1, iter2); + } + + } + + /** + * Checks a given graph for bipartiteness and fills the given color map with + * white and black according to the bipartition. If the graph is not + * bipartite, the contents of the color map are undefined. Runs in linear + * time in the size of the graph, if access to the property maps is in + * constant time. + * + * @param graph The given graph. + * @param index_map An index map associating vertices with an index. + * @param partition_map A color map to fill with the bipartition. + * @return true if and only if the given graph is bipartite. + */ + + template + bool is_bipartite (const Graph& graph, const IndexMap index_map, PartitionMap partition_map) + { + /// General types and variables + typedef typename property_traits ::value_type partition_color_t; + typedef typename graph_traits ::vertex_descriptor vertex_descriptor_t; + typedef typename graph_traits ::vertex_iterator vertex_iterator_t; + + /// Declare dfs visitor + // detail::empty_recorder recorder; + // typedef detail::bipartite_visitor dfs_visitor_t; + // dfs_visitor_t dfs_visitor (partition_map, recorder); + + + /// Call dfs + try + { + depth_first_search (graph, vertex_index_map (index_map).visitor (make_dfs_visitor (std::make_pair ( + detail::colorize_bipartition (partition_map), std::make_pair (detail::check_bipartition (partition_map), + put_property (partition_map, color_traits ::white (), on_start_vertex ())))))); + + // depth_first_search (graph, vertex_index_map (index_map).visitor (dfs_visitor)); + } + catch (detail::bipartite_visitor_error error) + { + return false; + } + + return true; + } + + /** + * Checks a given graph for bipartiteness. + * + * @param graph The given graph. + * @param index_map An index map associating vertices with an index. + * @return true if and only if the given graph is bipartite. + */ + + template + bool is_bipartite (const Graph& graph, const IndexMap index_map) + { + typedef one_bit_color_map partition_map_t; + partition_map_t partition_map (num_vertices (graph), index_map); + + return is_bipartite (graph, index_map, partition_map); + } + + /** + * Checks a given graph for bipartiteness. The graph must + * have an internal vertex_index property. Runs in linear time in the + * size of the graph, if access to the property maps is in constant time. + * + * @param graph The given graph. + * @return true if and only if the given graph is bipartite. + */ + + template + bool is_bipartite (const Graph& graph) + { + return is_bipartite (graph, get (vertex_index, graph)); + } + + /** + * Checks a given graph for bipartiteness and fills a given color map with + * white and black according to the bipartition. If the graph is not + * bipartite, a sequence of vertices, producing an odd-cycle, is written to + * the output iterator. The final iterator value is returned. Runs in linear + * time in the size of the graph, if access to the property maps is in + * constant time. + * + * @param graph The given graph. + * @param index_map An index map associating vertices with an index. + * @param partition_map A color map to fill with the bipartition. + * @param result An iterator to write the odd-cycle vertices to. + * @return The final iterator value after writing. + */ + + template + OutputIterator find_odd_cycle (const Graph& graph, const IndexMap index_map, PartitionMap partition_map, + OutputIterator result) + { + /// General types and variables + typedef typename property_traits ::value_type partition_color_t; + typedef typename graph_traits ::vertex_descriptor vertex_descriptor_t; + typedef typename graph_traits ::vertex_iterator vertex_iterator_t; + vertex_iterator_t vertex_iter, vertex_end; + + /// Declare predecessor map + typedef std::vector predecessors_t; + typedef iterator_property_map predecessor_map_t; + typedef predecessor_recorder predecessor_recorder_t; + + predecessors_t predecessors (num_vertices (graph), graph_traits ::null_vertex ()); + predecessor_map_t predecessor_map (predecessors.begin (), index_map); + predecessor_recorder_t predecessor_recorder (predecessor_map); + + /// Initialize predecessor map + for (tie (vertex_iter, vertex_end) = vertices (graph); vertex_iter != vertex_end; ++vertex_iter) + { + put (predecessor_map, *vertex_iter, *vertex_iter); + } + + /// Call dfs + try + { + depth_first_search (graph, vertex_index_map (index_map).visitor (make_dfs_visitor (std::make_pair ( + detail::colorize_bipartition (partition_map), std::make_pair (detail::check_bipartition (partition_map), + std::make_pair (put_property (partition_map, color_traits ::white (), + on_start_vertex ()), record_predecessors (predecessor_map, on_tree_edge ()))))))); + } + catch (detail::bipartite_visitor_error error) + { + typedef std::vector path_t; + + path_t path1, path2; + vertex_descriptor_t next, current; + + /// First path + next = error.witnesses.first; + do + { + current = next; + path1.push_back (current); + next = predecessor_map[current]; + } + while (current != next); + + /// Second path + next = error.witnesses.second; + do + { + current = next; + path2.push_back (current); + next = predecessor_map[current]; + } + while (current != next); + + /// Find beginning of common suffix + std::pair mismatch = detail::reverse_mismatch ( + std::make_pair (path1.begin (), path1.end ()), std::make_pair (path2.begin (), path2.end ())); + + /// Copy the odd-length cycle + result = std::copy (path1.begin (), mismatch.first + 1, result); + return std::reverse_copy (path2.begin (), mismatch.second, result); + } + + return result; + } + + /** + * Checks a given graph for bipartiteness. If the graph is not bipartite, a + * sequence of vertices, producing an odd-cycle, is written to the output + * iterator. The final iterator value is returned. Runs in linear time in the + * size of the graph, if access to the property maps is in constant time. + * + * @param graph The given graph. + * @param index_map An index map associating vertices with an index. + * @param result An iterator to write the odd-cycle vertices to. + * @return The final iterator value after writing. + */ + + template + OutputIterator find_odd_cycle (const Graph& graph, const IndexMap index_map, OutputIterator result) + { + typedef one_bit_color_map partition_map_t; + partition_map_t partition_map (num_vertices (graph), index_map); + + return find_odd_cycle (graph, index_map, partition_map, result); + } + + /** + * Checks a given graph for bipartiteness. If the graph is not bipartite, a + * sequence of vertices, producing an odd-cycle, is written to the output + * iterator. The final iterator value is returned. The graph must have an + * internal vertex_index property. Runs in linear time in the size of the + * graph, if access to the property maps is in constant time. + * + * @param graph The given graph. + * @param result An iterator to write the odd-cycle vertices to. + * @return The final iterator value after writing. + */ + + template + OutputIterator find_odd_cycle (const Graph& graph, OutputIterator result) + { + return find_odd_cycle (graph, get (vertex_index, graph), result); + } +} + +#endif /// BOOST_GRAPH_BIPARTITE_HPP diff --git a/deal.II/contrib/boost/include/boost/graph/bron_kerbosch_all_cliques.hpp b/deal.II/contrib/boost/include/boost/graph/bron_kerbosch_all_cliques.hpp index bf7e3ff429..f6d253b1a2 100644 --- a/deal.II/contrib/boost/include/boost/graph/bron_kerbosch_all_cliques.hpp +++ b/deal.II/contrib/boost/include/boost/graph/bron_kerbosch_all_cliques.hpp @@ -12,6 +12,7 @@ #include #include +#include #include namespace boost { @@ -125,9 +126,7 @@ namespace detail typename graph_traits::vertex_descriptor v, typename graph_traits::undirected_category) { - function_requires< AdjacencyMatrixConcept >(); - - return edge(u, v, g).second; + return lookup_edge(u, v, g).second; } template @@ -137,13 +136,12 @@ namespace detail typename graph_traits::vertex_descriptor v, typename graph_traits::directed_category) { - function_requires< AdjacencyMatrixConcept >(); // Note that this could alternate between using an || to determine // full connectivity. I believe that this should produce strongly // connected components. Note that using && instead of || will // change the results to a fully connected subgraph (i.e., symmetric // edges between all vertices s.t., if a->b, then b->a. - return edge(u, v, g).second && edge(v, u, g).second; + return lookup_edge(u, v, g).second && lookup_edge(v, u, g).second; } template @@ -189,7 +187,7 @@ namespace detail for(ni = nots.begin(); ni != nend; ++ni) { for(ci = cands.begin(); ci != cend; ++ci) { // if we don't find an edge, then we're okay. - if(!edge(*ni, *ci, g).second) break; + if(!lookup_edge(*ni, *ci, g).second) break; } // if we iterated all the way to the end, then *ni // is connected to all *ci diff --git a/deal.II/contrib/boost/include/boost/graph/clustering_coefficient.hpp b/deal.II/contrib/boost/include/boost/graph/clustering_coefficient.hpp index c84c48027f..e5f94d9fa0 100644 --- a/deal.II/contrib/boost/include/boost/graph/clustering_coefficient.hpp +++ b/deal.II/contrib/boost/include/boost/graph/clustering_coefficient.hpp @@ -10,6 +10,7 @@ #include #include #include +#include namespace boost { @@ -42,8 +43,8 @@ namespace detail { function_requires< AdjacencyMatrixConcept >(); - return (edge(u, v, g).second ? 1 : 0) + - (edge(v, u, g).second ? 1 : 0); + return (lookup_edge(u, v, g).second ? 1 : 0) + + (lookup_edge(v, u, g).second ? 1 : 0); } // This template matches undirectedS @@ -55,7 +56,7 @@ namespace detail undirected_tag) { function_requires< AdjacencyMatrixConcept >(); - return edge(u, v, g).second ? 1 : 0; + return lookup_edge(u, v, g).second ? 1 : 0; } } diff --git a/deal.II/contrib/boost/include/boost/graph/compressed_sparse_row_graph.hpp b/deal.II/contrib/boost/include/boost/graph/compressed_sparse_row_graph.hpp index b4f013526d..5488f42fa3 100644 --- a/deal.II/contrib/boost/include/boost/graph/compressed_sparse_row_graph.hpp +++ b/deal.II/contrib/boost/include/boost/graph/compressed_sparse_row_graph.hpp @@ -47,17 +47,6 @@ # error You will need a compiler that conforms better to the C++ standard. #endif -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE -#warning "Using deprecated BGL compressed sparse row graph interface --" -#warning "please see the documentation for the new interface and then" -#warning "#define BOOST_GRAPH_USE_NEW_CSR_INTERFACE before including" -#warning "" -#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE - -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE -#define BOOST_GRAPH_USE_OLD_CSR_INTERFACE -#endif - namespace boost { // A tag type indicating that the graph in question is a compressed @@ -69,7 +58,6 @@ struct csr_graph_tag; // vertex. enum edges_are_sorted_t {edges_are_sorted}; -#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE // A type (edges_are_sorted_global_t) and a value (edges_are_sorted_global) // used to indicate that the edge list passed into the CSR graph is already // sorted by source vertex. @@ -122,8 +110,6 @@ enum construct_inplace_from_sources_and_targets_global_t {construct_inplace_from // distributed CSR constructors. enum edges_are_unsorted_global_t {edges_are_unsorted_global}; -#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE - /**************************************************************************** * Local helper macros to reduce typing and clutter later on. * ****************************************************************************/ @@ -146,7 +132,6 @@ enum edges_are_unsorted_global_t {edges_are_unsorted_global}; compressed_sparse_row_graph -#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE namespace detail { template struct default_construct_iterator: public boost::iterator_facade, T, boost::random_access_traversal_tag, const T&> { @@ -179,7 +164,6 @@ namespace detail { } }; } -#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE /** Compressed sparse row graph. * @@ -201,11 +185,11 @@ template class compressed_sparse_row_graph : public detail::indexed_vertex_properties + VertexProperty, Vertex, identity_property_map> { public: typedef detail::indexed_vertex_properties + VertexProperty, Vertex, identity_property_map> inherited_vertex_properties; public: @@ -271,7 +255,6 @@ class compressed_sparse_row_graph compressed_sparse_row_graph(edges_are_unsorted_multi_pass_t, @@ -327,38 +310,6 @@ class compressed_sparse_row_graph - compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, - vertices_size_type numverts, - edges_size_type numedges = 0, - const GraphProperty& prop = GraphProperty()) - : m_property(prop) - { - m_forward.assign_from_sorted_edges(edge_begin, edge_end, identity_property_map(), keep_all(), numverts, numedges); - inherited_vertex_properties::resize(numverts); - } - - // From number of vertices and sorted list of edges (deprecated - // interface) - template - compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, - EdgePropertyIterator ep_iter, - vertices_size_type numverts, - edges_size_type numedges = 0, - const GraphProperty& prop = GraphProperty()) - : m_property(prop) - { - m_forward.assign_from_sorted_edges(edge_begin, edge_end, ep_iter, identity_property_map(), keep_all(), numverts, numedges); - inherited_vertex_properties::resize(numverts); - } - -#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE // From number of vertices and sorted list of edges (new interface) template @@ -387,7 +338,6 @@ class compressed_sparse_row_graph compressed_sparse_row_graph(edges_are_sorted_global_t, @@ -556,8 +506,6 @@ class compressed_sparse_row_graph @@ -635,7 +583,6 @@ class compressed_sparse_row_graphadd_edges_internal(first, last, ep_iter, ep_iter_end, identity_property_map()); } -#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE using inherited_vertex_properties::operator[]; @@ -775,8 +721,6 @@ class compressed_sparse_row_graph class compressed_sparse_row_graph : public detail::indexed_vertex_properties + VertexProperty, Vertex, identity_property_map> { public: typedef detail::indexed_vertex_properties + VertexProperty, Vertex, identity_property_map> inherited_vertex_properties; public: @@ -1144,7 +1088,6 @@ class compressed_sparse_row_graph @@ -1185,44 +1128,6 @@ add_vertices(typename BOOST_DIR_CSR_GRAPH_TYPE::vertices_size_type count, BOOST_ return old_num_verts_plus_one - 1; } -#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE -// This function requires that (src, tgt) be lexicographically at least as -// large as the largest edge in the graph so far -template -inline typename BOOST_DIR_CSR_GRAPH_TYPE::edge_descriptor -add_edge(Vertex src, Vertex tgt, BOOST_DIR_CSR_GRAPH_TYPE& g) { - assert ((g.m_last_source == 0 || src >= g.m_last_source - 1) && - src < num_vertices(g)); - EdgeIndex num_edges_orig = g.m_forward.m_column.size(); - for (; g.m_last_source <= src; ++g.m_last_source) - g.m_forward.m_rowstart[g.m_last_source] = num_edges_orig; - g.m_forward.m_rowstart[src + 1] = num_edges_orig + 1; - g.m_forward.m_column.push_back(tgt); - typedef typename BOOST_DIR_CSR_GRAPH_TYPE::edge_push_back_type push_back_type; - g.edge_properties().push_back(push_back_type()); - return typename BOOST_DIR_CSR_GRAPH_TYPE::edge_descriptor(src, num_edges_orig); -} - -// This function requires that src be at least as large as the largest source -// in the graph so far -template -inline typename BOOST_DIR_CSR_GRAPH_TYPE::edge_descriptor -add_edge(Vertex src, Vertex tgt, - typename BOOST_DIR_CSR_GRAPH_TYPE::edge_bundled const& p, - BOOST_DIR_CSR_GRAPH_TYPE& g) { - assert ((g.m_last_source == 0 || src >= g.m_last_source - 1) && - src < num_vertices(g)); - EdgeIndex num_edges_orig = g.m_forward.m_column.size(); - for (; g.m_last_source <= src; ++g.m_last_source) - g.m_forward.m_rowstart[g.m_last_source] = num_edges_orig; - g.m_forward.m_rowstart[src + 1] = num_edges_orig + 1; - g.m_forward.m_column.push_back(tgt); - g.edge_properties().push_back(p); - return typename BOOST_DIR_CSR_GRAPH_TYPE::edge_descriptor(src, num_edges_orig); -} -#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE - -#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE // Add edges from a sorted (smallest sources first) range of pairs and edge // properties template @@ -1340,21 +1244,6 @@ target(typename BOOST_CSR_GRAPH_TYPE::edge_descriptor e, return g.m_forward.m_column[e.idx]; } -namespace detail { - template - inline EdgeIndex get_actual_row_start - (const BOOST_CSR_GRAPH_TYPE& g, - EdgeIndex rowstart_i_minus_1, EdgeIndex rowstart_i) - { -#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - return rowstart_i; -#else - // Special case to allow incremental construction - return (std::max)(rowstart_i_minus_1, rowstart_i); -#endif - } -} - template inline std::pair @@ -1365,8 +1254,7 @@ out_edges(Vertex v, const BOOST_CSR_GRAPH_TYPE& g) EdgeIndex v_row_start = g.m_forward.m_rowstart[v]; EdgeIndex next_row_start = g.m_forward.m_rowstart[v + 1]; return std::make_pair(it(ed(v, v_row_start)), - it(ed(v, detail::get_actual_row_start - (g, v_row_start, next_row_start)))); + it(ed(v, next_row_start))); } template @@ -1375,11 +1263,9 @@ out_degree(Vertex v, const BOOST_CSR_GRAPH_TYPE& g) { EdgeIndex v_row_start = g.m_forward.m_rowstart[v]; EdgeIndex next_row_start = g.m_forward.m_rowstart[v + 1]; - return detail::get_actual_row_start(g, v_row_start, next_row_start) - v_row_start; + return next_row_start - v_row_start; } -#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - template inline std::pair @@ -1402,8 +1288,6 @@ in_degree(Vertex v, const BOOST_BIDIR_CSR_GRAPH_TYPE& g) return next_row_start - v_row_start; } -#endif // BOOST_GRAPH_USE_NEW_CSR_INTERFACE - // From AdjacencyGraph template inline std::pair::vertex_descriptor i, return i; } -#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE -// These require that the out edges from a vertex are sorted, which is only -// guaranteed by the old interface - -// Unlike for an adjacency_matrix, edge_range and edge take lg(out_degree(i)) -// time -template -inline std::pair -edge_range(Vertex i, Vertex j, const BOOST_CSR_GRAPH_TYPE& g) -{ - typedef typename std::vector::const_iterator adj_iter; - typedef typename BOOST_CSR_GRAPH_TYPE::out_edge_iterator out_edge_iter; - typedef typename BOOST_CSR_GRAPH_TYPE::edge_descriptor edge_desc; - std::pair raw_adjacencies = adjacent_vertices(i, g); - std::pair adjacencies = - std::equal_range(raw_adjacencies.first, raw_adjacencies.second, j); - EdgeIndex idx_begin = adjacencies.first - g.m_forward.m_column.begin(); - EdgeIndex idx_end = adjacencies.second - g.m_forward.m_column.begin(); - return std::make_pair(out_edge_iter(edge_desc(i, idx_begin)), - out_edge_iter(edge_desc(i, idx_end))); -} - -template -inline std::pair -edge(Vertex i, Vertex j, const BOOST_CSR_GRAPH_TYPE& g) -{ - typedef typename BOOST_CSR_GRAPH_TYPE::out_edge_iterator out_edge_iter; - std::pair range = edge_range(i, j, g); - if (range.first == range.second) - return std::make_pair(typename BOOST_CSR_GRAPH_TYPE::edge_descriptor(), - false); - else - return std::make_pair(*range.first, true); -} - -#else // !BOOST_GRAPH_USE_OLD_CSR_INTERFACE // edge() can be provided in linear time for the new interface template @@ -1473,15 +1318,13 @@ edge(Vertex i, Vertex j, const BOOST_CSR_GRAPH_TYPE& g) typedef typename BOOST_CSR_GRAPH_TYPE::out_edge_iterator out_edge_iter; std::pair range = out_edges(i, g); for (; range.first != range.second; ++range.first) { - if (target(*range.first) == j) + if (target(*range.first, g) == j) return std::make_pair(*range.first, true); } return std::make_pair(typename BOOST_CSR_GRAPH_TYPE::edge_descriptor(), false); } -#endif // !BOOST_GRAPH_USE_OLD_CSR_INTERFACE - // Find an edge given its index in the graph template inline typename BOOST_CSR_GRAPH_TYPE::edge_descriptor @@ -1491,14 +1334,7 @@ edge_from_index(EdgeIndex idx, const BOOST_CSR_GRAPH_TYPE& g) assert (idx < num_edges(g)); row_start_iter src_plus_1 = std::upper_bound(g.m_forward.m_rowstart.begin(), -#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE - // This handles the case where there are some vertices - // with rowstart 0 after the last provided vertex; this - // case does not happen with the new interface - g.m_forward.m_rowstart.begin() + g.m_last_source + 1, -#else // !BOOST_GRAPH_USE_OLD_CSR_INTERFACE g.m_forward.m_rowstart.end(), -#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE idx); // Get last source whose rowstart is at most idx // upper_bound returns this position plus 1 @@ -1558,24 +1394,6 @@ get_property(const BOOST_CSR_GRAPH_TYPE& g, Tag) return get_property_value(g.m_property, Tag()); } -// Add edge_index property map -template -struct csr_edge_index_map -{ - typedef Index value_type; - typedef Index reference; - typedef Descriptor key_type; - typedef readable_property_map_tag category; -}; - -template -inline Index -get(const csr_edge_index_map&, - const typename csr_edge_index_map::key_type& key) -{ - return key.idx; -} - template struct property_map { @@ -1586,16 +1404,24 @@ struct property_map template struct property_map { -private: - typedef typename graph_traits::edge_descriptor - edge_descriptor; - typedef csr_edge_index_map edge_index_type; - -public: - typedef edge_index_type type; + typedef detail::csr_edge_index_map type; typedef type const_type; }; +template +struct property_map +{ + typedef typename BOOST_CSR_GRAPH_TYPE::inherited_vertex_properties::vertex_map_type type; + typedef typename BOOST_CSR_GRAPH_TYPE::inherited_vertex_properties::const_vertex_map_type const_type; +}; + +template +struct property_map +{ + typedef typename BOOST_CSR_GRAPH_TYPE::forward_type::inherited_edge_properties::edge_map_type type; + typedef typename BOOST_CSR_GRAPH_TYPE::forward_type::inherited_edge_properties::const_edge_map_type const_type; +}; + template inline identity_property_map get(vertex_index_t, const BOOST_CSR_GRAPH_TYPE&) @@ -1628,6 +1454,88 @@ get(edge_index_t, const BOOST_CSR_GRAPH_TYPE&, return e.idx; } +template +inline typename property_map::type +get(vertex_bundle_t, BOOST_CSR_GRAPH_TYPE& g) +{ + return g.get_vertex_bundle(get(vertex_index, g)); +} + +template +inline typename property_map::const_type +get(vertex_bundle_t, const BOOST_CSR_GRAPH_TYPE& g) +{ + return g.get_vertex_bundle(get(vertex_index, g)); +} + +template +inline VertexProperty& +get(vertex_bundle_t, + BOOST_CSR_GRAPH_TYPE& g, Vertex v) +{ + return get(vertex_bundle, g)[v]; +} + +template +inline const VertexProperty& +get(vertex_bundle_t, + const BOOST_CSR_GRAPH_TYPE& g, Vertex v) +{ + return get(vertex_bundle, g)[v]; +} + +template +inline void +put(vertex_bundle_t, + BOOST_CSR_GRAPH_TYPE& g, + Vertex v, + const VertexProperty& val) +{ + put(get(vertex_bundle, g), v, val); +} + +template +inline typename property_map::type +get(edge_bundle_t, BOOST_CSR_GRAPH_TYPE& g) +{ + return g.m_forward.get_edge_bundle(get(edge_index, g)); +} + +template +inline typename property_map::const_type +get(edge_bundle_t, const BOOST_CSR_GRAPH_TYPE& g) +{ + return g.m_forward.get_edge_bundle(get(edge_index, g)); +} + +template +inline EdgeProperty& +get(edge_bundle_t, + BOOST_CSR_GRAPH_TYPE& g, + const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e) +{ + return get(edge_bundle, g)[e]; +} + +template +inline const EdgeProperty& +get(edge_bundle_t, + const BOOST_CSR_GRAPH_TYPE& g, + const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e) +{ + return get(edge_bundle, g)[e]; +} + +template +inline void +put(edge_bundle_t, + BOOST_CSR_GRAPH_TYPE& g, + const typename BOOST_CSR_GRAPH_TYPE::edge_descriptor& e, + const EdgeProperty& val) +{ + put(get(edge_bundle, g), e, val); +} + template inline typename property_map::type diff --git a/deal.II/contrib/boost/include/boost/graph/core_numbers.hpp b/deal.II/contrib/boost/include/boost/graph/core_numbers.hpp index 743c81f916..da072bf1eb 100644 --- a/deal.II/contrib/boost/include/boost/graph/core_numbers.hpp +++ b/deal.II/contrib/boost/include/boost/graph/core_numbers.hpp @@ -86,7 +86,7 @@ namespace boost { template core_numbers_visitor make_core_numbers_visitor(Visitors vis) - { return core_numbers_visitor(vis); }; + { return core_numbers_visitor(vis); } typedef core_numbers_visitor<> default_core_numbers_visitor; diff --git a/deal.II/contrib/boost/include/boost/graph/dag_shortest_paths.hpp b/deal.II/contrib/boost/include/boost/graph/dag_shortest_paths.hpp index cc071de1f3..d8b47ac62f 100644 --- a/deal.II/contrib/boost/include/boost/graph/dag_shortest_paths.hpp +++ b/deal.II/contrib/boost/include/boost/graph/dag_shortest_paths.hpp @@ -83,7 +83,7 @@ namespace boost { dag_sp_dispatch2 (const VertexListGraph& g, typename graph_traits::vertex_descriptor s, - DistanceMap distance, WeightMap weight, ColorMap color, IndexMap id, + DistanceMap distance, WeightMap weight, ColorMap color, IndexMap /*id*/, DijkstraVisitor vis, const Params& params) { typedef typename property_traits::value_type D; diff --git a/deal.II/contrib/boost/include/boost/graph/depth_first_search.hpp b/deal.II/contrib/boost/include/boost/graph/depth_first_search.hpp index 1bf0667113..fcc6164647 100644 --- a/deal.II/contrib/boost/include/boost/graph/depth_first_search.hpp +++ b/deal.II/contrib/boost/include/boost/graph/depth_first_search.hpp @@ -193,7 +193,8 @@ namespace boost { typename graph_traits::vertex_iterator ui, ui_end; for (tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui) { - put(color, *ui, Color::white()); vis.initialize_vertex(*ui, g); + Vertex u = implicit_cast(*ui); + put(color, u, Color::white()); vis.initialize_vertex(u, g); } if (start_vertex != implicit_cast(*vertices(g).first)){ vis.start_vertex(start_vertex, g); @@ -202,9 +203,10 @@ namespace boost { } for (tie(ui, ui_end) = vertices(g); ui != ui_end; ++ui) { - ColorValue u_color = get(color, *ui); - if (u_color == Color::white()) { vis.start_vertex(*ui, g); - detail::depth_first_visit_impl(g, *ui, vis, color, detail::nontruth2()); + Vertex u = implicit_cast(*ui); + ColorValue u_color = get(color, u); + if (u_color == Color::white()) { vis.start_vertex(u, g); + detail::depth_first_visit_impl(g, u, vis, color, detail::nontruth2()); } } } diff --git a/deal.II/contrib/boost/include/boost/graph/detail/adjacency_list.hpp b/deal.II/contrib/boost/include/boost/graph/detail/adjacency_list.hpp index c02a310b84..d94bc1eba9 100644 --- a/deal.II/contrib/boost/include/boost/graph/detail/adjacency_list.hpp +++ b/deal.II/contrib/boost/include/boost/graph/detail/adjacency_list.hpp @@ -1,7 +1,8 @@ // -*- c++ -*- //======================================================================= // Copyright 1997, 1998, 1999, 2000 University of Notre Dame. -// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek +// Copyright 2010 Thomas Claveirole +// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, Thomas Claveirole // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -1183,13 +1184,11 @@ namespace boost { multisetS*) { return edge_range(source(e, g), target(e, g), g); } -#if !defined BOOST_NO_HASH std::pair get_parallel_edge_sublist(typename Config::edge_descriptor e, const graph_type& g, hash_setS*) { return edge_range(source(e, g), target(e, g), g); } -#endif // Placement of these overloaded remove_edge() functions // inside the class avoids a VC++ bug. @@ -1635,6 +1634,7 @@ namespace boost { const Graph& g = static_cast(g_); return g_.edge_dispatch(g, u, v, Cat()); } + template inline std::pair @@ -1650,10 +1650,9 @@ namespace boost { typename Config::OutEdgeList& el = g.out_edge_list(u); typename Config::OutEdgeList::iterator first, last; typename Config::EdgeContainer fake_edge_container; - tie(first, last) = - std::equal_range(el.begin(), el.end(), - StoredEdge(v, fake_edge_container.end(), - &fake_edge_container)); + tie(first, last) = graph_detail:: + equal_range(el, StoredEdge(v, fake_edge_container.end(), + &fake_edge_container)); return std::make_pair(out_edge_iterator(first, u), out_edge_iterator(last, u)); } @@ -2297,7 +2296,7 @@ namespace boost { // VertexList and vertex_iterator typedef typename container_gen::type SeqVertexList; - typedef boost::integer_range RandVertexList; + typedef boost::integer_range RandVertexList; typedef typename mpl::if_::type VertexList; @@ -2785,8 +2784,8 @@ namespace boost { } // namespace boost -#if !defined(BOOST_NO_HASH) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -namespace BOOST_STD_EXTENSION_NAMESPACE { +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +namespace boost { #if BOOST_WORKAROUND( _STLPORT_VERSION, >= 0x500 ) // STLport 5 already defines a hash specialization. diff --git a/deal.II/contrib/boost/include/boost/graph/detail/array_binary_tree.hpp b/deal.II/contrib/boost/include/boost/graph/detail/array_binary_tree.hpp index 6f337e9121..78755556c8 100644 --- a/deal.II/contrib/boost/include/boost/graph/detail/array_binary_tree.hpp +++ b/deal.II/contrib/boost/include/boost/graph/detail/array_binary_tree.hpp @@ -8,18 +8,18 @@ // http://www.boost.org/LICENSE_1_0.txt) //======================================================================= // -#ifndef ADSTL_ARRAY_BINARY_TREE_HPP -#define ADSTL_ARRAY_BINARY_TREE_HPP +#ifndef BOOST_ARRAY_BINARY_TREE_HPP +#define BOOST_ARRAY_BINARY_TREE_HPP #include #include #include -namespace adstl { - /* - Note: array_binary_tree is a completey balanced binary tree - */ +namespace boost { +/* + * Note: array_binary_tree is a completey balanced binary tree. + */ #if !defined BOOST_NO_STD_ITERATOR_TRAITS template #else @@ -45,18 +45,18 @@ public: : boost::iterator { // replace with iterator_adaptor implementation -JGS - + inline iterator() : i(0), n(0) { } inline iterator(const iterator& x) : r(x.r), i(x.i), n(x.n), id(x.id) { } inline iterator& operator=(const iterator& x) { - r = x.r; i = x.i; n = x.n; + r = x.r; i = x.i; n = x.n; /*egcs generate a warning*/ - id = x.id; + id = x.id; return *this; } - inline iterator(rep_iterator rr, - size_type ii, - size_type nn, + inline iterator(rep_iterator rr, + size_type ii, + size_type nn, const ID& _id) : r(rr), i(ii), n(nn), id(_id) { } inline array_binary_tree_node operator*() { return ArrayBinaryTreeNode(r, i, n, id); } @@ -64,7 +64,7 @@ public: inline iterator operator++(int) { iterator t = *this; ++(*this); return t; } inline bool operator==(const iterator& x) const { return i == x.i; } - inline bool operator!=(const iterator& x) const + inline bool operator!=(const iterator& x) const { return !(*this == x); } rep_iterator r; size_type i; @@ -75,13 +75,13 @@ public: inline children_type(const children_type& x) : r(x.r), i(x.i), n(x.n), id(x.id) { } inline children_type& operator=(const children_type& x) { - r = x.r; i = x.i; n = x.n; + r = x.r; i = x.i; n = x.n; /*egcs generate a warning*/ - id = x.id; + id = x.id; return *this; } inline children_type(rep_iterator rr, - size_type ii, + size_type ii, size_type nn, const ID& _id) : r(rr), i(ii), n(nn), id(_id) { } inline iterator begin() { return iterator(r, 2 * i + 1, n, id); } @@ -100,23 +100,23 @@ public: ID id; }; inline array_binary_tree_node() : i(0), n(0) { } - inline array_binary_tree_node(const array_binary_tree_node& x) + inline array_binary_tree_node(const array_binary_tree_node& x) : r(x.r), i(x.i), n(x.n), id(x.id) { } inline ArrayBinaryTreeNode& operator=(const ArrayBinaryTreeNode& x) { r = x.r; - i = x.i; - n = x.n; + i = x.i; + n = x.n; /*egcs generate a warning*/ - id = x.id; + id = x.id; return *this; } - inline array_binary_tree_node(rep_iterator start, - rep_iterator end, + inline array_binary_tree_node(rep_iterator start, + rep_iterator end, rep_iterator pos, const ID& _id) : r(start), i(pos - start), n(end - start), id(_id) { } - inline array_binary_tree_node(rep_iterator rr, - size_type ii, - size_type nn, const ID& _id) + inline array_binary_tree_node(rep_iterator rr, + size_type ii, + size_type nn, const ID& _id) : r(rr), i(ii), n(nn), id(_id) { } inline value_type& value() { return *(r + i); } inline const value_type& value() const { return *(r + i); } @@ -147,8 +147,8 @@ public: value() = tmp; i = x.i; } - inline const children_type children() const { - return children_type(r, i, n); + inline const children_type children() const { + return children_type(r, i, n); } inline size_type index() const { return i; } rep_iterator r; @@ -157,7 +157,7 @@ public: ID id; }; -template > struct compare_array_node { typedef typename RandomAccessContainer::value_type value_type; @@ -176,7 +176,6 @@ struct compare_array_node { Compare comp; }; +} // namespace boost -} /* namespace adstl */ - -#endif /* ADSTL_ARRAY_BINARY_TREE_H */ +#endif /* BOOST_ARRAY_BINARY_TREE_HPP */ diff --git a/deal.II/contrib/boost/include/boost/graph/detail/compressed_sparse_row_struct.hpp b/deal.II/contrib/boost/include/boost/graph/detail/compressed_sparse_row_struct.hpp index 1146c77d80..541b6dd078 100644 --- a/deal.II/contrib/boost/include/boost/graph/detail/compressed_sparse_row_struct.hpp +++ b/deal.II/contrib/boost/include/boost/graph/detail/compressed_sparse_row_struct.hpp @@ -54,6 +54,24 @@ namespace detail { template class csr_edge_descriptor; + // Add edge_index property map + template + struct csr_edge_index_map + { + typedef EdgeIndex value_type; + typedef EdgeIndex reference; + typedef csr_edge_descriptor key_type; + typedef readable_property_map_tag category; + }; + + template + inline EdgeIndex + get(const csr_edge_index_map&, + const csr_edge_descriptor& key) + { + return key.idx; + } + /** Compressed sparse row graph internal structure. * * Vertex and EdgeIndex should be unsigned integral types and should @@ -65,12 +83,14 @@ namespace detail { public detail::indexed_edge_properties< compressed_sparse_row_structure, EdgeProperty, - csr_edge_descriptor > { + csr_edge_descriptor, + csr_edge_index_map > { public: typedef detail::indexed_edge_properties< compressed_sparse_row_structure, EdgeProperty, - csr_edge_descriptor > + csr_edge_descriptor, + csr_edge_index_map > inherited_edge_properties; typedef Vertex vertices_size_type; @@ -81,17 +101,9 @@ namespace detail { std::vector m_rowstart; std::vector m_column; -#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE - // This member is only needed to support add_edge(), which is not provided by - // the new interface - Vertex m_last_source; // Last source of added edge, plus one -#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE compressed_sparse_row_structure(Vertex numverts = 0) : m_rowstart(numverts + 1, EdgeIndex(0)), m_column() -#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE - , m_last_source(numverts) -#endif {} // Rebuild graph from number of vertices and multi-pass unsorted list of @@ -118,6 +130,7 @@ namespace detail { source_pred, boost::make_property_map_function(global_to_local)); m_column.resize(m_rowstart.back()); + inherited_edge_properties::resize(m_rowstart.back()); boost::graph::detail::histogram_sort (sources_begin, sources_end, m_rowstart.begin(), numlocalverts, @@ -251,11 +264,12 @@ namespace detail { (sources.begin(), sources.end(), m_rowstart.begin(), numverts, keep_all(), boost::make_property_map_function(global_to_local)); boost::graph::detail::histogram_sort_inplace - (sources.begin(), sources.end(), m_rowstart.begin(), numverts, + (sources.begin(), m_rowstart.begin(), numverts, targets.begin(), boost::make_property_map_function(global_to_local)); // Now targets is the correct vector (properly sorted by source) for // m_column m_column.swap(targets); + inherited_edge_properties::resize(m_rowstart.back()); } // Replace graph with sources and targets and edge properties given, sorting @@ -277,7 +291,7 @@ namespace detail { (sources.begin(), sources.end(), m_rowstart.begin(), numverts, keep_all(), boost::make_property_map_function(global_to_local)); boost::graph::detail::histogram_sort_inplace - (sources.begin(), sources.end(), m_rowstart.begin(), numverts, + (sources.begin(), m_rowstart.begin(), numverts, targets.begin(), edge_props.begin(), boost::make_property_map_function(global_to_local)); // Now targets is the correct vector (properly sorted by source) for @@ -297,6 +311,7 @@ namespace detail { { m_rowstart.resize(numverts + 1); m_column.resize(numedges); + inherited_edge_properties::resize(numedges); EdgeIndex current_edge = 0; typedef typename boost::graph_traits::vertex_descriptor g_vertex; typedef typename boost::graph_traits::edge_descriptor g_edge; @@ -310,24 +325,12 @@ namespace detail { for (Vertex i = 0; i != numverts; ++i) { m_rowstart[i] = current_edge; g_vertex v = ordered_verts_of_g[i]; -#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE - // Out edges in a single vertex are only sorted for the old interface - EdgeIndex num_edges_before_this_vertex = current_edge; -#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE g_out_edge_iter ei, ei_end; for (tie(ei, ei_end) = out_edges(v, g); ei != ei_end; ++ei) { m_column[current_edge++] = get(vi, target(*ei, g)); } -#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE - // Out edges in a single vertex are only sorted for the old interface - std::sort(m_column.begin() + num_edges_before_this_vertex, - m_column.begin() + current_edge); -#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE } m_rowstart[numverts] = current_edge; -#ifdef BOOST_GRAPH_USE_OLD_CSR_INTERFACE - m_last_source = numverts; -#endif // BOOST_GRAPH_USE_OLD_CSR_INTERFACE } // Add edges from a sorted (smallest sources first) range of pairs and edge diff --git a/deal.II/contrib/boost/include/boost/graph/detail/histogram_sort.hpp b/deal.II/contrib/boost/include/boost/graph/detail/histogram_sort.hpp index 9706d25494..742c6f9639 100644 --- a/deal.II/contrib/boost/include/boost/graph/detail/histogram_sort.hpp +++ b/deal.II/contrib/boost/include/boost/graph/detail/histogram_sort.hpp @@ -148,7 +148,7 @@ template void -histogram_sort_inplace(KeyIterator key_begin, KeyIterator key_end, +histogram_sort_inplace(KeyIterator key_begin, RowstartIterator rowstart, // Must support numkeys + 1 elements and be precomputed NumKeys numkeys, Value1Iter values1, @@ -181,7 +181,7 @@ template void -histogram_sort_inplace(KeyIterator key_begin, KeyIterator key_end, +histogram_sort_inplace(KeyIterator key_begin, RowstartIterator rowstart, // Must support numkeys + 1 elements and be precomputed NumKeys numkeys, Value1Iter values1, diff --git a/deal.II/contrib/boost/include/boost/graph/detail/indexed_properties.hpp b/deal.II/contrib/boost/include/boost/graph/detail/indexed_properties.hpp index 7fa1548e24..e1f874b2cc 100644 --- a/deal.II/contrib/boost/include/boost/graph/detail/indexed_properties.hpp +++ b/deal.II/contrib/boost/include/boost/graph/detail/indexed_properties.hpp @@ -23,17 +23,24 @@ #include #include #include +#include #include namespace boost { namespace detail { -template +template class indexed_vertex_properties { public: typedef no_property vertex_property_type; typedef Property vertex_bundled; + typedef iterator_property_map< + typename std::vector::iterator, + IndexMap> vertex_map_type; + typedef iterator_property_map< + typename std::vector::const_iterator, + IndexMap> const_vertex_map_type; // Directly access a vertex or edge bundle Property& operator[](Descriptor v) @@ -42,6 +49,14 @@ public: const Property& operator[](Descriptor v) const { return m_vertex_properties[get(vertex_index, derived(), v)]; } + vertex_map_type get_vertex_bundle(const IndexMap& index_map = IndexMap()) { + return vertex_map_type(m_vertex_properties.begin(), index_map); + } + + const_vertex_map_type get_vertex_bundle(const IndexMap& index_map = IndexMap()) const { + return const_vertex_map_type(m_vertex_properties.begin(), index_map); + } + protected: // Default-construct with no property values indexed_vertex_properties() {} @@ -90,17 +105,23 @@ public: // should be private, but friend templates not portable std::vector m_vertex_properties; }; -template -class indexed_vertex_properties +template +class indexed_vertex_properties { struct secret {}; public: typedef no_property vertex_property_type; typedef void vertex_bundled; + typedef secret vertex_map_type; + typedef secret const_vertex_map_type; secret operator[](secret) { return secret(); } + vertex_map_type get_vertex_bundle() const { + return vertex_map_type(); + } + protected: // All operations do nothing. indexed_vertex_properties() { } @@ -112,13 +133,19 @@ public: void reserve(std::size_t) { } }; -template +template class indexed_edge_properties { public: typedef no_property edge_property_type; typedef Property edge_bundled; typedef Property edge_push_back_type; + typedef iterator_property_map< + typename std::vector::iterator, + IndexMap> edge_map_type; + typedef iterator_property_map< + typename std::vector::const_iterator, + IndexMap> const_edge_map_type; // Directly access a edge or edge bundle Property& operator[](Descriptor v) @@ -127,6 +154,14 @@ public: const Property& operator[](Descriptor v) const { return m_edge_properties[get(edge_index, derived(), v)]; } + edge_map_type get_edge_bundle(const IndexMap& index_map = IndexMap()) { + return edge_map_type(m_edge_properties.begin(), index_map); + } + + const_edge_map_type get_edge_bundle(const IndexMap& index_map = IndexMap()) const { + return const_edge_map_type(m_edge_properties.begin(), index_map); + } + protected: // Default-construct with no property values indexed_edge_properties() {} @@ -205,8 +240,8 @@ struct dummy_no_property_iterator std::ptrdiff_t distance_to(const dummy_no_property_iterator) const {return 0;} }; -template -class indexed_edge_properties +template +class indexed_edge_properties { struct secret {}; @@ -214,10 +249,16 @@ class indexed_edge_properties typedef no_property edge_property_type; typedef void edge_bundled; typedef void* edge_push_back_type; + typedef secret edge_map_type; + typedef secret const_edge_map_type; secret operator[](secret) { return secret(); } void write_by_index(std::size_t idx, const no_property& prop) {} + edge_map_type get_edge_bundle(const IndexMap& = IndexMap()) const { + return edge_map_type(); + } + protected: // All operations do nothing. indexed_edge_properties() { } diff --git a/deal.II/contrib/boost/include/boost/graph/detail/labeled_graph_traits.hpp b/deal.II/contrib/boost/include/boost/graph/detail/labeled_graph_traits.hpp index f61c24a408..6eb1060937 100644 --- a/deal.II/contrib/boost/include/boost/graph/detail/labeled_graph_traits.hpp +++ b/deal.II/contrib/boost/include/boost/graph/detail/labeled_graph_traits.hpp @@ -187,7 +187,7 @@ struct is_labeled_graph > { }; -template class graph_mutability_traits; +template struct graph_mutability_traits; namespace graph_detail { // The determine mutability metafunction computes a labeled mutability tag diff --git a/deal.II/contrib/boost/include/boost/graph/detail/read_graphviz_new.hpp b/deal.II/contrib/boost/include/boost/graph/detail/read_graphviz_new.hpp index 215f9ef939..7c7986dcbe 100644 --- a/deal.II/contrib/boost/include/boost/graph/detail/read_graphviz_new.hpp +++ b/deal.II/contrib/boost/include/boost/graph/detail/read_graphviz_new.hpp @@ -89,26 +89,18 @@ namespace read_graphviz_detail { } // namespace read_graphviz_detail -// This is also in boost/graph/graphviz.hpp namespace detail { namespace graph { - BOOST_GRAPH_DECL bool read_graphviz(const std::string& str, boost::detail::graph::mutate_graph* mg); + BOOST_GRAPH_DECL bool read_graphviz_new(const std::string& str, boost::detail::graph::mutate_graph* mg); } // end namespace graph } // end namespace detail template -bool read_graphviz(const std::string& str, - MutableGraph& graph, boost::dynamic_properties& dp, - std::string const& node_id = "node_id") { +bool read_graphviz_new(const std::string& str, + MutableGraph& graph, boost::dynamic_properties& dp, + std::string const& node_id = "node_id") { boost::detail::graph::mutate_graph_impl mg(graph, dp, node_id); - return detail::graph::read_graphviz(str, &mg); -} - -template -bool read_graphviz(InputIter begin, InputIter end, - MutableGraph& graph, boost::dynamic_properties& dp, - std::string const& node_id = "node_id") { - return read_graphviz(std::string(begin, end), graph, dp, node_id); + return detail::graph::read_graphviz_new(str, &mg); } } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/graph/detail/read_graphviz_spirit.hpp b/deal.II/contrib/boost/include/boost/graph/detail/read_graphviz_spirit.hpp index 815befe91f..4e8b22e5eb 100644 --- a/deal.II/contrib/boost/include/boost/graph/detail/read_graphviz_spirit.hpp +++ b/deal.II/contrib/boost/include/boost/graph/detail/read_graphviz_spirit.hpp @@ -581,9 +581,9 @@ struct dot_skipper : public boost::spirit::classic::grammar } // namespace detail template -bool read_graphviz(MultiPassIterator begin, MultiPassIterator end, - MutableGraph& graph, dynamic_properties& dp, - std::string const& node_id = "node_id") { +bool read_graphviz_spirit(MultiPassIterator begin, MultiPassIterator end, + MutableGraph& graph, dynamic_properties& dp, + std::string const& node_id = "node_id") { using namespace boost; using namespace boost::spirit::classic; diff --git a/deal.II/contrib/boost/include/boost/graph/distributed/adjacency_list.hpp b/deal.II/contrib/boost/include/boost/graph/distributed/adjacency_list.hpp index f7dde1c44a..f16b96426d 100644 --- a/deal.II/contrib/boost/include/boost/graph/distributed/adjacency_list.hpp +++ b/deal.II/contrib/boost/include/boost/graph/distributed/adjacency_list.hpp @@ -395,9 +395,9 @@ namespace boost { typedef typename Graph::directed_selector DirectedS; public: - typedef typename ct_if<(is_same::value), - stored_in_edge, - Edge>::type argument_type; + typedef typename boost::mpl::if_, + stored_in_edge, + Edge>::type argument_type; typedef edge_descriptor result_type; in_generator() : g(0) {} @@ -580,10 +580,10 @@ namespace boost { EdgeProperty> edge_property_with_id; /// For undirected graphs, introduce the locally-owned property for edges - typedef typename ct_if<(is_same::value), - property, - edge_property_with_id>::type + typedef typename boost::mpl::if_, + property, + edge_property_with_id>::type base_edge_property_type; /// The edge descriptor type for the local subgraph @@ -602,10 +602,10 @@ namespace boost { // Bidirectional graphs have an extra vertex property to store // the incoming edges. - typedef typename ct_if<(is_same::value), - property, - VertexProperty>::type + typedef typename boost::mpl::if_, + property, + VertexProperty>::type base_vertex_property_type; // The type of the distributed adjacency list @@ -1097,9 +1097,9 @@ namespace boost { typedef typename base_type::vertex_descriptor local_vertex_descriptor; typedef typename base_type::edge_descriptor local_edge_descriptor; - typedef typename boost::ct_if_t::type >::type directed_category; @@ -1355,12 +1355,12 @@ namespace boost { * are restricted; see the distributed adjacency_list * documentation. */ - typedef typename ct_if< - (is_same::value), + typedef typename boost::mpl::if_< + is_same, directed_distributed_adj_list_tag, - typename ct_if<(is_same::value), - bidirectional_distributed_adj_list_tag, - undirected_distributed_adj_list_tag>::type> + typename boost::mpl::if_, + bidirectional_distributed_adj_list_tag, + undirected_distributed_adj_list_tag>::type> ::type traversal_category; typedef typename inherited::degree_size_type degree_size_type; @@ -1376,9 +1376,9 @@ namespace boost { local_edge_list_type; private: - typedef typename ct_if<(is_same::value), - typename in_edge_list_type::const_iterator, - typename inherited::out_edge_iterator>::type + typedef typename boost::mpl::if_, + typename in_edge_list_type::const_iterator, + typename inherited::out_edge_iterator>::type base_in_edge_iterator; typedef typename inherited::out_edge_iterator base_out_edge_iterator; @@ -1424,11 +1424,11 @@ namespace boost { adjacency_iterator; /// Iterator over the (local) edges in a graph - typedef typename ct_if<(is_same::value), - undirected_edge_iterator, - transform_iterator - >::type + typedef typename boost::mpl::if_, + undirected_edge_iterator, + transform_iterator + >::type edge_iterator; public: diff --git a/deal.II/contrib/boost/include/boost/graph/distributed/betweenness_centrality.hpp b/deal.II/contrib/boost/include/boost/graph/distributed/betweenness_centrality.hpp index 134cc02e8e..3f23d7640f 100644 --- a/deal.II/contrib/boost/include/boost/graph/distributed/betweenness_centrality.hpp +++ b/deal.II/contrib/boost/include/boost/graph/distributed/betweenness_centrality.hpp @@ -71,10 +71,10 @@ namespace boost { boost::tuple& t, const unsigned int) { - ar & get<0>(t); - ar & get<1>(t); - ar & get<2>(t); - ar & get<3>(t); + ar & boost::tuples::get<0>(t); + ar & boost::tuples::get<1>(t); + ar & boost::tuples::get<2>(t); + ar & boost::tuples::get<3>(t); } } // serialization @@ -87,7 +87,7 @@ namespace boost { get_owner_of_first_tuple_element(OwnerMap owner) : owner(owner) { } - owner_type get_owner(Tuple t) { return get(owner, get<0>(t)); } + owner_type get_owner(Tuple t) { return get(owner, boost::tuples::get<0>(t)); } private: OwnerMap owner; @@ -911,10 +911,10 @@ namespace boost { while(!Q.empty()) { queue_value_type x = Q.top(); Q.pop(); - vertex_descriptor w = get<0>(x); - vertex_descriptor source = get<1>(x); - dependency_type dep = get<2>(x); - path_count_type pc = get<3>(x); + vertex_descriptor w = boost::tuples::get<0>(x); + vertex_descriptor source = boost::tuples::get<1>(x); + dependency_type dep = boost::tuples::get<2>(x); + path_count_type pc = boost::tuples::get<3>(x); cache(dependency, source, dep); cache(path_count, source, pc); diff --git a/deal.II/contrib/boost/include/boost/graph/distributed/compressed_sparse_row_graph.hpp b/deal.II/contrib/boost/include/boost/graph/distributed/compressed_sparse_row_graph.hpp index edbf16785e..49654d6da5 100644 --- a/deal.II/contrib/boost/include/boost/graph/distributed/compressed_sparse_row_graph.hpp +++ b/deal.II/contrib/boost/include/boost/graph/distributed/compressed_sparse_row_graph.hpp @@ -17,8 +17,6 @@ #error "Parallel BGL files should not be included unless has been included" #endif -#define BOOST_GRAPH_USE_NEW_CSR_INTERFACE - #include #include #include @@ -179,8 +177,6 @@ class compressed_sparse_row_graph< const Distribution& dist) : m_process_group(pg), m_distribution(dist), m_base(numverts) {} -#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - template compressed_sparse_row_graph(edges_are_unsorted_t, InputIterator edge_begin, InputIterator edge_end, @@ -322,8 +318,6 @@ class compressed_sparse_row_graph< const Distribution& dist, const GraphProperty& prop = GraphProperty()); -#endif - template compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, vertices_size_type numverts, @@ -706,7 +700,6 @@ edges(const BOOST_DISTRIB_CSR_GRAPH_TYPE& g) // ----------------------------------------------------------------- // Graph constructors -#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE // Returns true if a vertex belongs to a process according to a distribution template struct local_vertex { @@ -826,13 +819,10 @@ make_index_to_vertex_iterator(IndexIterator it, const Distribution& dist, return boost::make_transform_iterator( it, index_to_vertex_func(dist, g)); } -#endif // Forward declaration of csr_vertex_owner_map template class csr_vertex_owner_map; -#ifdef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - template template BOOST_DISTRIB_CSR_GRAPH_TYPE:: @@ -1215,8 +1205,6 @@ compressed_sparse_row_graph(distributed_construct_inplace_from_sources_and_targe // TODO: set property on m_base? } -#endif - // // Old (untagged) ctors, these default to the unsorted sequential ctors // @@ -1229,9 +1217,6 @@ compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, const GraphProperty& prop) : m_process_group(pg), m_distribution(parallel::block(m_process_group, numverts)), -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - m_base(m_distribution.block_size(process_id(m_process_group), numverts)) -#else m_base(edges_are_unsorted_global, index_to_vertex_iterator(edge_begin, *this), index_to_vertex_iterator(edge_end, *this), @@ -1240,28 +1225,8 @@ compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, local_vertex, process_id_type> (get(vertex_owner, *this), process_id(pg)), prop) -#endif { -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - parallel::block dist(m_process_group, numverts); - - // Allows us to add edges - m_base.m_last_source = 0; - - typename ProcessGroup::process_id_type id = process_id(m_process_group); - - while (edge_begin != edge_end) { - vertex_descriptor src = edge_begin->first; - if (static_cast(dist(src)) == id) { - vertex_descriptor tgt = - make_vertex_descriptor(dist(edge_begin->second), - dist.local(edge_begin->second)); - add_edge(dist.local(src), tgt, m_base); - } - ++edge_begin; - } -#endif } template @@ -1275,9 +1240,6 @@ compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, : m_process_group(pg), m_distribution(parallel::block(m_process_group, numverts)), -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - m_base(m_distribution.block_size(process_id(m_process_group), numverts)) -#else m_base(edges_are_unsorted_global, index_to_vertex_iterator(edge_begin, *this), index_to_vertex_iterator(edge_end, *this), @@ -1287,28 +1249,7 @@ compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, local_vertex, process_id_type> (get(vertex_owner, *this), process_id(pg)), prop) -#endif { -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - parallel::block dist(m_process_group, numverts); - - // Allows us to add edges - m_base.m_last_source = 0; - - typename ProcessGroup::process_id_type id = process_id(m_process_group); - - while (edge_begin != edge_end) { - EdgeIndex src = edge_begin->first; - if (static_cast(dist(src)) == id) { - EdgeIndex tgt = - make_vertex_descriptor(dist(edge_begin->second), - dist.local(edge_begin->second)); - add_edge(dist.local(src), tgt, *ep_iter, m_base); - } - ++edge_begin; - ++ep_iter; - } -#endif } template @@ -1321,9 +1262,6 @@ compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, const GraphProperty& prop) : m_process_group(pg), m_distribution(dist), -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - m_base(dist.block_size(process_id(m_process_group), numverts)) -#else m_base(edges_are_unsorted_global, index_to_vertex_iterator(edge_begin, *this), index_to_vertex_iterator(edge_end, *this), @@ -1332,27 +1270,7 @@ compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, local_vertex, process_id_type> (get(vertex_owner, *this), process_id(pg)), prop) -#endif { -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - // Allows us to add edges - m_base.m_last_source = 0; - - typename ProcessGroup::process_id_type id = process_id(m_process_group); - - while (edge_begin != edge_end) { - vertex_descriptor src = edge_begin->first; - if (static_cast(dist(src)) == id) { - vertex_descriptor tgt = - make_vertex_descriptor(dist(edge_begin->second), - dist.local(edge_begin->second)); - assert(get(vertex_owner, *this, tgt) == dist(edge_begin->second)); - assert(get(vertex_local, *this, tgt) == dist.local(edge_begin->second)); - add_edge(dist.local(src), tgt, m_base); - } - ++edge_begin; - } -#endif } template @@ -1367,9 +1285,6 @@ compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, const GraphProperty& prop) : m_process_group(pg), m_distribution(dist), -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - m_base(dist.block_size(process_id(m_process_group), numverts)) -#else m_base(edges_are_unsorted_global, index_to_vertex_iterator(edge_begin, *this), index_to_vertex_iterator(edge_end, *this), @@ -1378,26 +1293,7 @@ compressed_sparse_row_graph(InputIterator edge_begin, InputIterator edge_end, local_vertex, process_id_type> (get(vertex_owner, *this), process_id(pg)), prop) -#endif { -#ifndef BOOST_GRAPH_USE_NEW_CSR_INTERFACE - // Allows us to add edges - m_base.m_last_source = 0; - - typename ProcessGroup::process_id_type id = process_id(m_process_group); - - while (edge_begin != edge_end) { - EdgeIndex src = edge_begin->first; - if (static_cast(dist(src)) == id) { - EdgeIndex tgt = - make_vertex_descriptor(dist(edge_begin->second), - dist.local(edge_begin->second)); - add_edge(dist.local(src), tgt, *ep_iter, m_base); - } - ++edge_begin; - ++ep_iter; - } -#endif } // ----------------------------------------------------------------- diff --git a/deal.II/contrib/boost/include/boost/graph/distributed/detail/mpi_process_group.ipp b/deal.II/contrib/boost/include/boost/graph/distributed/detail/mpi_process_group.ipp index 95ee21f162..ef49232884 100644 --- a/deal.II/contrib/boost/include/boost/graph/distributed/detail/mpi_process_group.ipp +++ b/deal.II/contrib/boost/include/boost/graph/distributed/detail/mpi_process_group.ipp @@ -28,6 +28,7 @@ #include #include #include +#include // #define PBGL_PROCESS_GROUP_DEBUG diff --git a/deal.II/contrib/boost/include/boost/graph/distributed/one_bit_color_map.hpp b/deal.II/contrib/boost/include/boost/graph/distributed/one_bit_color_map.hpp new file mode 100644 index 0000000000..0a5704a1f6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/graph/distributed/one_bit_color_map.hpp @@ -0,0 +1,116 @@ +// Copyright (C) 2006-2010 The Trustees of Indiana University. + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Authors: Douglas Gregor +// Jeremiah Willcock +// Andrew Lumsdaine + +// Distributed version of the one-bit color map +#ifndef BOOST_DISTRIBUTED_ONE_BIT_COLOR_MAP_HPP +#define BOOST_DISTRIBUTED_ONE_BIT_COLOR_MAP_HPP + +#ifndef BOOST_GRAPH_USE_MPI +#error "Parallel BGL files should not be included unless has been included" +#endif + +#include +#include +#include + +namespace boost { + +template +class one_bit_color_map > + : public parallel::distributed_property_map > +{ + typedef one_bit_color_map local_map; + + typedef parallel::distributed_property_map + inherited; + + typedef local_property_map + index_map_type; + +public: + one_bit_color_map(std::size_t inital_size, + const index_map_type& index = index_map_type()) + : inherited(index.process_group(), index.global(), + local_map(inital_size, index.base())) { } + + inherited& base() { return *this; } + const inherited& base() const { return *this; } +}; + +template +inline one_bit_color_type +get(one_bit_color_map > + const& pm, + typename property_traits::key_type key) +{ + return get(pm.base(), key); +} + +template +inline void +put(one_bit_color_map > + const& pm, + typename property_traits::key_type key, + one_bit_color_type value) +{ + put(pm.base(), key, value); +} + +template +class one_bit_color_map > + : public parallel::distributed_property_map< + ProcessGroup, GlobalMap, one_bit_color_map > +{ + typedef one_bit_color_map local_map; + + typedef parallel::distributed_property_map + inherited; + + typedef parallel::distributed_property_map + index_map_type; + +public: + one_bit_color_map(std::size_t inital_size, + const index_map_type& index = index_map_type()) + : inherited(index.process_group(), index.global(), + local_map(inital_size, index.base())) { } + + inherited& base() { return *this; } + const inherited& base() const { return *this; } +}; + +template +inline one_bit_color_type +get(one_bit_color_map< + parallel::distributed_property_map< + ProcessGroup, GlobalMap, one_bit_color_map > > const& pm, + typename property_traits::key_type key) +{ + return get(pm.base(), key); +} + +template +inline void +put(one_bit_color_map< + parallel::distributed_property_map< + ProcessGroup, GlobalMap, one_bit_color_map > > const& pm, + typename property_traits::key_type key, + one_bit_color_type value) +{ + put(pm.base(), key, value); +} + +} // end namespace boost + +#endif // BOOST_DISTRIBUTED_ONE_BIT_COLOR_MAP_HPP diff --git a/deal.II/contrib/boost/include/boost/graph/distributed/two_bit_color_map.hpp b/deal.II/contrib/boost/include/boost/graph/distributed/two_bit_color_map.hpp index eb8e29e3ea..d7ec6bdfe4 100644 --- a/deal.II/contrib/boost/include/boost/graph/distributed/two_bit_color_map.hpp +++ b/deal.II/contrib/boost/include/boost/graph/distributed/two_bit_color_map.hpp @@ -50,7 +50,7 @@ template inline two_bit_color_type get(two_bit_color_map > const& pm, - typename two_bit_color_map::key_type key) + typename property_traits::key_type key) { return get(pm.base(), key); } @@ -59,7 +59,7 @@ template inline void put(two_bit_color_map > const& pm, - typename two_bit_color_map::key_type key, + typename property_traits::key_type key, two_bit_color_type value) { put(pm.base(), key, value); @@ -95,7 +95,7 @@ inline two_bit_color_type get(two_bit_color_map< parallel::distributed_property_map< ProcessGroup, GlobalMap, two_bit_color_map > > const& pm, - typename two_bit_color_map::key_type key) + typename property_traits::key_type key) { return get(pm.base(), key); } @@ -105,7 +105,7 @@ inline void put(two_bit_color_map< parallel::distributed_property_map< ProcessGroup, GlobalMap, two_bit_color_map > > const& pm, - typename two_bit_color_map::key_type key, + typename property_traits::key_type key, two_bit_color_type value) { put(pm.base(), key, value); diff --git a/deal.II/contrib/boost/include/boost/graph/dll_import_export.hpp b/deal.II/contrib/boost/include/boost/graph/dll_import_export.hpp new file mode 100644 index 0000000000..cc369d1d12 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/graph/dll_import_export.hpp @@ -0,0 +1,30 @@ +//======================================================================= +// Copyright 2001 University of Notre Dame. +// Copyright 2003 Jeremy Siek +// Authors: Lie-Quan Lee, Jeremy Siek, and Douglas Gregor +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +//======================================================================= + +#ifndef BOOST_GRAPH_DLL_IMPORT_EXPORT_HPP +#define BOOST_GRAPH_DLL_IMPORT_EXPORT_HPP + +#include + +#ifdef BOOST_HAS_DECLSPEC +# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_GRAPH_DYN_LINK) +# ifdef BOOST_GRAPH_SOURCE +# define BOOST_GRAPH_DECL __declspec(dllexport) +# else +# define BOOST_GRAPH_DECL __declspec(dllimport) +# endif // BOOST_GRAPH_SOURCE +# endif // DYN_LINK +#endif // BOOST_HAS_DECLSPEC + +#ifndef BOOST_GRAPH_DECL +# define BOOST_GRAPH_DECL +#endif + +#endif // BOOST_GRAPH_DLL_IMPORT_EXPORT_HPP diff --git a/deal.II/contrib/boost/include/boost/graph/dominator_tree.hpp b/deal.II/contrib/boost/include/boost/graph/dominator_tree.hpp index cf0d310ef8..0c19a4076f 100644 --- a/deal.II/contrib/boost/include/boost/graph/dominator_tree.hpp +++ b/deal.II/contrib/boost/include/boost/graph/dominator_tree.hpp @@ -236,7 +236,7 @@ namespace boost { lengauer_tarjan_dominator_tree_without_dfs (const Graph& g, const typename graph_traits::vertex_descriptor& entry, - const IndexMap& indexMap, + const IndexMap& /*indexMap*/, TimeMap dfnumMap, PredMap parentMap, VertexVector& verticesByDFNum, DomTreePredMap domTreePredMap) { diff --git a/deal.II/contrib/boost/include/boost/graph/filtered_graph.hpp b/deal.II/contrib/boost/include/boost/graph/filtered_graph.hpp index 94b634dff2..30b3433594 100644 --- a/deal.II/contrib/boost/include/boost/graph/filtered_graph.hpp +++ b/deal.II/contrib/boost/include/boost/graph/filtered_graph.hpp @@ -13,6 +13,7 @@ #include #include #include +#include #include namespace boost { @@ -192,8 +193,6 @@ namespace boost { > edge_iterator; typedef typename Traits::edges_size_type edges_size_type; - typedef typename ::boost::edge_property_type::type edge_property_type; - typedef typename ::boost::vertex_property_type::type vertex_property_type; typedef filtered_graph_tag graph_tag; #ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES @@ -219,6 +218,22 @@ namespace boost { VertexPredicate m_vertex_pred; }; + // Do not instantiate these unless needed + template + struct vertex_property_type > { + typedef typename vertex_property_type::type type; + }; + + template + struct edge_property_type > { + typedef typename edge_property_type::type type; + }; + + #ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES template struct vertex_bundle_type bool floyd_warshall_init_dispatch(const VertexListGraph& g, - DistanceMatrix& d, WeightMap w, + DistanceMatrix& d, WeightMap /*w*/, const bgl_named_params& params) { typedef typename property_traits::value_type WM; diff --git a/deal.II/contrib/boost/include/boost/graph/geodesic_distance.hpp b/deal.II/contrib/boost/include/boost/graph/geodesic_distance.hpp index 042d39e40f..a4d702749e 100644 --- a/deal.II/contrib/boost/include/boost/graph/geodesic_distance.hpp +++ b/deal.II/contrib/boost/include/boost/graph/geodesic_distance.hpp @@ -83,7 +83,7 @@ struct mean_graph_distance_measure template inline mean_graph_distance_measure::value_type> -measure_graph_mean_geodesic(const Graph& g, DistanceMap dist) +measure_graph_mean_geodesic(const Graph&, DistanceMap) { typedef typename property_traits::value_type T; return mean_graph_distance_measure(); diff --git a/deal.II/contrib/boost/include/boost/graph/graph_test.hpp b/deal.II/contrib/boost/include/boost/graph/graph_test.hpp index 554ddbad46..fc4d9f0f93 100644 --- a/deal.II/contrib/boost/include/boost/graph/graph_test.hpp +++ b/deal.II/contrib/boost/include/boost/graph/graph_test.hpp @@ -17,6 +17,8 @@ #include #include #include // for connects +#include +#include // UNDER CONSTRUCTION @@ -151,7 +153,7 @@ namespace boost { typedef typename graph_traits::vertex_iterator v_iter; std::pair p = vertices(g); BOOST_CHECK(num_vertices(g) == vertex_set.size()); - v_size_t n = std::distance(p.first, p.second); + v_size_t n = (size_t)std::distance(p.first, p.second); BOOST_CHECK(n == num_vertices(g)); for (; p.first != p.second; ++p.first) { vertex_t v = *p.first; @@ -171,7 +173,7 @@ namespace boost { BOOST_CHECK(m == num_edges(g)); for (; p.first != p.second; ++p.first) { edge_t e = *p.first; - BOOST_CHECK(any_if(edge_set, connects(source(e, g), target(e, g), g))); + BOOST_CHECK(find_if(edge_set, connects(source(e, g), target(e, g), g)) != boost::end(edge_set)); BOOST_CHECK(container_contains(vertex_set, source(e, g)) == true); BOOST_CHECK(container_contains(vertex_set, target(e, g)) == true); } @@ -196,8 +198,8 @@ namespace boost { for (k = vertex_set.begin(); k != vertex_set.end(); ++k) { p = edge(*j, *k, g); if (p.second == true) - BOOST_CHECK(any_if(edge_set, - connects(source(p.first, g), target(p.first, g), g)) == true); + BOOST_CHECK(find_if(edge_set, + connects(source(p.first, g), target(p.first, g), g)) != boost::end(edge_set)); } } diff --git a/deal.II/contrib/boost/include/boost/graph/graph_traits.hpp b/deal.II/contrib/boost/include/boost/graph/graph_traits.hpp index b86ef0a8f8..89687b5dd3 100644 --- a/deal.II/contrib/boost/include/boost/graph/graph_traits.hpp +++ b/deal.II/contrib/boost/include/boost/graph/graph_traits.hpp @@ -181,6 +181,16 @@ namespace boost { >::value > { }; + + template + struct is_adjacency_matrix + : mpl::bool_< + is_convertible< + typename graph_traits::traversal_category, + adjacency_matrix_tag + >::value + > + { }; //@} /** @name Directed Graph Traits diff --git a/deal.II/contrib/boost/include/boost/graph/graphml.hpp b/deal.II/contrib/boost/include/boost/graph/graphml.hpp index f6256a0fe2..b4955b8875 100644 --- a/deal.II/contrib/boost/include/boost/graph/graphml.hpp +++ b/deal.II/contrib/boost/include/boost/graph/graphml.hpp @@ -16,70 +16,21 @@ #include #include #include +#include #include // for exceptions #include #include #include #include #include -#if 0 // Change this back later #include -#endif +#include #include #include namespace boost { - // FIXME: Remove this once property_tree is stable - namespace graph_detail_from_property_tree { - -// ---------------------------------------------------------------------------- -// Copyright (C) 2002-2006 Marcin Kalicinski -// -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -// For more information, see www.boost.org -// ---------------------------------------------------------------------------- - - // Naively convert narrow string to another character type - template - std::basic_string widen(const char *text) - { - std::basic_string result; - while (*text) - { - result += Ch(*text); - ++text; - } - return result; - } - - template - std::basic_string encode_char_entities(const std::basic_string &s) - { - typedef typename std::basic_string Str; - Str r; - typename Str::const_iterator end = s.end(); - for (typename Str::const_iterator it = s.begin(); it != end; ++it) - { - switch (*it) - { - case Ch('<'): r += boost::graph_detail_from_property_tree::widen("<"); break; - case Ch('>'): r += boost::graph_detail_from_property_tree::widen(">"); break; - case Ch('&'): r += boost::graph_detail_from_property_tree::widen("&"); break; - case Ch('"'): r += boost::graph_detail_from_property_tree::widen("""); break; - case Ch('\''): r += boost::graph_detail_from_property_tree::widen("'"); break; - default: r += *it; break; - } - } - return r; - } - - } - ///////////////////////////////////////////////////////////////////////////// // Graph reader exceptions ///////////////////////////////////////////////////////////////////////////// @@ -151,12 +102,16 @@ class mutate_graph_impl : public mutate_graph } catch (bad_lexical_cast) { - throw parse_error("invalid value \"" + value + "\" for key " + - name + " of type " + value_type); + BOOST_THROW_EXCEPTION( + parse_error("invalid value \"" + value + "\" for key " + + name + " of type " + value_type)); } if (!type_found) - throw parse_error("unrecognized type \"" + value_type + - "\" for key " + name); + { + BOOST_THROW_EXCEPTION( + parse_error("unrecognized type \"" + value_type + + "\" for key " + name)); + } } @@ -172,12 +127,16 @@ class mutate_graph_impl : public mutate_graph } catch (bad_lexical_cast) { - throw parse_error("invalid value \"" + value + "\" for key " + - name + " of type " + value_type); + BOOST_THROW_EXCEPTION( + parse_error("invalid value \"" + value + "\" for key " + + name + " of type " + value_type)); } if (!type_found) - throw parse_error("unrecognized type \"" + value_type + - "\" for key " + name); + { + BOOST_THROW_EXCEPTION( + parse_error("unrecognized type \"" + value_type + + "\" for key " + name)); + } } @@ -193,12 +152,16 @@ class mutate_graph_impl : public mutate_graph } catch (bad_lexical_cast) { - throw parse_error("invalid value \"" + value + "\" for key " + - name + " of type " + value_type); + BOOST_THROW_EXCEPTION( + parse_error("invalid value \"" + value + "\" for key " + + name + " of type " + value_type)); } if (!type_found) - throw parse_error("unrecognized type \"" + value_type + - "\" for key " + name); + { + BOOST_THROW_EXCEPTION( + parse_error("unrecognized type \"" + value_type + + "\" for key " + name)); + } } template @@ -279,8 +242,7 @@ write_graphml(std::ostream& out, const Graph& g, VertexIndexMap vertex_index, typedef typename graph_traits::edge_descriptor edge_descriptor; typedef typename graph_traits::vertex_descriptor vertex_descriptor; - // using boost::property_tree::xml_parser::encode_char_entities; - using boost::graph_detail_from_property_tree::encode_char_entities; + using boost::property_tree::xml_parser::encode_char_entities; BOOST_STATIC_CONSTANT(bool, graph_is_directed = diff --git a/deal.II/contrib/boost/include/boost/graph/graphviz.hpp b/deal.II/contrib/boost/include/boost/graph/graphviz.hpp index c1f87375be..a41116d00b 100644 --- a/deal.II/contrib/boost/include/boost/graph/graphviz.hpp +++ b/deal.II/contrib/boost/include/boost/graph/graphviz.hpp @@ -24,20 +24,8 @@ #include #include #include - -#ifdef BOOST_HAS_DECLSPEC -# if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_GRAPH_DYN_LINK) -# ifdef BOOST_GRAPH_SOURCE -# define BOOST_GRAPH_DECL __declspec(dllexport) -# else -# define BOOST_GRAPH_DECL __declspec(dllimport) -# endif // BOOST_GRAPH_SOURCE -# endif // DYN_LINK -#endif // BOOST_HAS_DECLSPEC - -#ifndef BOOST_GRAPH_DECL -# define BOOST_GRAPH_DECL -#endif +#include +#include namespace boost { @@ -784,10 +772,51 @@ class mutate_graph_impl : public mutate_graph std::map bgl_edges; }; -BOOST_GRAPH_DECL -bool read_graphviz(std::istream& in, mutate_graph& graph); +} } } // end namespace boost::detail::graph + +#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER +# ifndef BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS +# define BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS +# endif +# include +#else // New default parser +# include +#endif // BOOST_GRAPH_USE_SPIRIT_PARSER + +namespace boost { + +// Parse the passed string as a GraphViz dot file. +template +bool read_graphviz(const std::string& data, + MutableGraph& graph, + dynamic_properties& dp, + std::string const& node_id = "node_id") { +#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER + return read_graphviz_spirit(data.begin(), data.end(), graph, dp, node_id); +#else // Non-Spirit parser + return read_graphviz_new(data,graph,dp,node_id); +#endif +} + +// Parse the passed iterator range as a GraphViz dot file. +template +bool read_graphviz(InputIterator user_first, + InputIterator user_last, + MutableGraph& graph, + dynamic_properties& dp, + std::string const& node_id = "node_id") { +#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER + typedef InputIterator is_t; + typedef boost::spirit::classic::multi_pass iterator_t; -} } // end namespace detail::graph + iterator_t first(boost::spirit::classic::make_multi_pass(user_first)); + iterator_t last(boost::spirit::classic::make_multi_pass(user_last)); + + return read_graphviz_spirit(first, last, graph, dp, node_id); +#else // Non-Spirit parser + return read_graphviz_new(std::string(user_first, user_last), graph, dp, node_id); +#endif +} // Parse the passed stream as a GraphViz dot file. template @@ -795,25 +824,13 @@ bool read_graphviz(std::istream& in, MutableGraph& graph, dynamic_properties& dp, std::string const& node_id = "node_id") { - std::string data; + typedef std::istream_iterator is_t; in >> std::noskipws; - std::copy(std::istream_iterator(in), - std::istream_iterator(), - std::back_inserter(data)); - return read_graphviz(data,graph,dp,node_id); + return read_graphviz(is_t(in), is_t(), graph, dp, node_id); } } // namespace boost -#ifdef BOOST_GRAPH_USE_SPIRIT_PARSER -# ifndef BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS -# define BOOST_GRAPH_READ_GRAPHVIZ_ITERATORS -# endif -# include -#else // New default parser -# include -#endif // BOOST_GRAPH_USE_SPIRIT_PARSER - #ifdef BOOST_GRAPH_USE_MPI # include #endif diff --git a/deal.II/contrib/boost/include/boost/graph/grid_graph.hpp b/deal.II/contrib/boost/include/boost/graph/grid_graph.hpp index 27cc256b25..bda68d5161 100644 --- a/deal.II/contrib/boost/include/boost/graph/grid_graph.hpp +++ b/deal.II/contrib/boost/include/boost/graph/grid_graph.hpp @@ -208,7 +208,7 @@ namespace boost { const Graph* m_graph; }; - }; // namespace detail + } // namespace detail //=========== // Grid Graph diff --git a/deal.II/contrib/boost/include/boost/graph/gursoy_atun_layout.hpp b/deal.II/contrib/boost/include/boost/graph/gursoy_atun_layout.hpp index ed5e0509e3..b16a01f68f 100644 --- a/deal.II/contrib/boost/include/boost/graph/gursoy_atun_layout.hpp +++ b/deal.II/contrib/boost/include/boost/graph/gursoy_atun_layout.hpp @@ -16,6 +16,7 @@ // http://springerlink.metapress.com/link.asp?id=pcu07ew5rhexp9yt #include +#include #include #include #include @@ -72,7 +73,7 @@ struct update_position_visitor { #endif if (get(node_distance, v) > distance_limit) - throw over_distance_limit(); + BOOST_THROW_EXCEPTION(over_distance_limit()); Point old_position = get(position_map, v); double distance = get(node_distance, v); double fraction = diff --git a/deal.II/contrib/boost/include/boost/graph/howard_cycle_ratio.hpp b/deal.II/contrib/boost/include/boost/graph/howard_cycle_ratio.hpp index 709499ff02..119499a384 100644 --- a/deal.II/contrib/boost/include/boost/graph/howard_cycle_ratio.hpp +++ b/deal.II/contrib/boost/include/boost/graph/howard_cycle_ratio.hpp @@ -173,8 +173,8 @@ namespace boost { virtual ~mcr_howard() {} protected: - virtual void store_critical_edge(edge_t ed, critical_cycle_t &cc) {} - virtual void store_critical_cycle(critical_cycle_t &cc) {} + virtual void store_critical_edge(edge_t, critical_cycle_t &) {} + virtual void store_critical_cycle(critical_cycle_t &) {} private: /*! @@ -216,10 +216,10 @@ namespace boost { tie(oei, oeie) = out_edges(*vi, m_g); typename graph_traits::out_edge_iterator mei = std::max_element(oei, oeie, - bind(m_cmp, - bind(&EdgeWeight1::operator[], m_ew1m, _1), - bind(&EdgeWeight1::operator[], m_ew1m, _2) - ) + boost::bind(m_cmp, + boost::bind(&EdgeWeight1::operator[], m_ew1m, _1), + boost::bind(&EdgeWeight1::operator[], m_ew1m, _2) + ) ); if (mei == oeie) { @@ -334,10 +334,10 @@ namespace boost { tie(uv_itr, vie) = vertices(m_g); float_t mcr = m_bound; while ( (uv_itr = std::find_if(uv_itr, vie, - bind(std::equal_to(), - my_white, - bind(&color_map_t::operator[], vcm_, _1) - ) + boost::bind(std::equal_to(), + my_white, + boost::bind(&color_map_t::operator[], vcm_, _1) + ) ) ) != vie ) ///While there are undiscovered vertices diff --git a/deal.II/contrib/boost/include/boost/graph/is_straight_line_drawing.hpp b/deal.II/contrib/boost/include/boost/graph/is_straight_line_drawing.hpp index 1377e3e9e8..6b7c390548 100644 --- a/deal.II/contrib/boost/include/boost/graph/is_straight_line_drawing.hpp +++ b/deal.II/contrib/boost/include/boost/graph/is_straight_line_drawing.hpp @@ -100,7 +100,7 @@ namespace boost > bool is_straight_line_drawing(const Graph& g, GridPositionMap drawing, - VertexIndexMap vm + VertexIndexMap ) { diff --git a/deal.II/contrib/boost/include/boost/graph/isomorphism.hpp b/deal.II/contrib/boost/include/boost/graph/isomorphism.hpp index 29f6ef2c58..9461dc31e5 100644 --- a/deal.II/contrib/boost/include/boost/graph/isomorphism.hpp +++ b/deal.II/contrib/boost/include/boost/graph/isomorphism.hpp @@ -90,7 +90,7 @@ namespace boost { void discover_vertex(vertex1_t v, const Graph1&) const { vertices.push_back(v); } - void examine_edge(edge1_t e, const Graph1& G1) const { + void examine_edge(edge1_t e, const Graph1&) const { edges.push_back(e); } std::vector& vertices; diff --git a/deal.II/contrib/boost/include/boost/graph/kolmogorov_max_flow.hpp b/deal.II/contrib/boost/include/boost/graph/kolmogorov_max_flow.hpp index 328bd30341..f98a5721a2 100644 --- a/deal.II/contrib/boost/include/boost/graph/kolmogorov_max_flow.hpp +++ b/deal.II/contrib/boost/include/boost/graph/kolmogorov_max_flow.hpp @@ -46,6 +46,7 @@ #include #include #include +#include namespace boost { namespace detail { @@ -161,7 +162,7 @@ namespace boost { } edge_descriptor to_sink; bool is_there; - tie(to_sink, is_there) = edge(current_node, m_sink, m_g); + tie(to_sink, is_there) = lookup_edge(current_node, m_sink, m_g); if(is_there){ tEdgeVal cap_from_source = m_res_cap_map[from_source]; tEdgeVal cap_to_sink = m_res_cap_map[to_sink]; diff --git a/deal.II/contrib/boost/include/boost/graph/labeled_graph.hpp b/deal.II/contrib/boost/include/boost/graph/labeled_graph.hpp index c7f40260eb..d91c5983df 100644 --- a/deal.II/contrib/boost/include/boost/graph/labeled_graph.hpp +++ b/deal.II/contrib/boost/include/boost/graph/labeled_graph.hpp @@ -72,7 +72,6 @@ namespace graph_detail { struct generate_label_map { typedef std::multimap type; }; -#if !defined BOOST_NO_HASH template struct generate_label_map { typedef boost::unordered_map type; }; @@ -80,7 +79,7 @@ namespace graph_detail { template struct generate_label_map { typedef boost::unordered_multimap type; }; -#endif + template struct choose_custom_map { typedef typename generate_label_map::type type; @@ -141,7 +140,7 @@ namespace graph_detail { // Tag dispatch on unique associative containers (i.e. maps). template std::pair::vertex_descriptor, bool> - insert_labeled_vertex(Container& c, Graph& g, Label const& l, Prop const& p, + insert_labeled_vertex(Container& c, Graph& g, Label const& l, Prop const&, unique_associative_container_tag) { // Here, we actually have to try the insertion first, and only add diff --git a/deal.II/contrib/boost/include/boost/graph/lookup_edge.hpp b/deal.II/contrib/boost/include/boost/graph/lookup_edge.hpp new file mode 100644 index 0000000000..f8ea89e22a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/graph/lookup_edge.hpp @@ -0,0 +1,50 @@ +//======================================================================= +// Copyright 2009 Trustees of Indiana University +// Author: Jeremiah Willcock +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +//======================================================================= + +#ifndef BOOST_GRAPH_LOOKUP_EDGE_HPP +#define BOOST_GRAPH_LOOKUP_EDGE_HPP + +#include +#include +#include +#include + +// lookup_edge: a function that acts like edge() but falls back to out_edges() +// and a search when edge() is not provided. + +namespace boost { + + template + std::pair::edge_descriptor, bool> + lookup_edge(typename boost::graph_traits::vertex_descriptor src, + typename boost::graph_traits::vertex_descriptor tgt, + const Graph& g, + typename boost::enable_if, int>::type = 0) { + return edge(src, tgt, g); + } + + template + std::pair::edge_descriptor, bool> + lookup_edge(typename boost::graph_traits::vertex_descriptor src, + typename boost::graph_traits::vertex_descriptor tgt, + const Graph& g, + typename boost::disable_if, int>::type = 0) { + typedef typename boost::graph_traits::out_edge_iterator it; + typedef typename boost::graph_traits::edge_descriptor edesc; + std::pair oe = out_edges(src, g); + for (; oe.first != oe.second; ++oe.first) { + edesc e = *oe.first; + if (target(e, g) == tgt) return std::make_pair(e, true); + } + return std::make_pair(edesc(), false); + } + +} + +#endif // BOOST_GRAPH_LOOKUP_EDGE_HPP diff --git a/deal.II/contrib/boost/include/boost/graph/max_cardinality_matching.hpp b/deal.II/contrib/boost/include/boost/graph/max_cardinality_matching.hpp index ef9ed9e4f2..1f0f6de207 100644 --- a/deal.II/contrib/boost/include/boost/graph/max_cardinality_matching.hpp +++ b/deal.II/contrib/boost/include/boost/graph/max_cardinality_matching.hpp @@ -67,7 +67,7 @@ namespace boost template - bool is_a_matching(const Graph& g, MateMap mate, VertexIndexMap vm) + bool is_a_matching(const Graph& g, MateMap mate, VertexIndexMap) { typedef typename graph_traits::vertex_descriptor vertex_descriptor_t; @@ -106,13 +106,13 @@ namespace boost typename VertexIndexMap = dummy_property_map> struct no_augmenting_path_finder { - no_augmenting_path_finder(const Graph& g, MateMap mate, VertexIndexMap vm) + no_augmenting_path_finder(const Graph&, MateMap, VertexIndexMap) { } inline bool augment_matching() { return false; } template - void get_current_matching(PropertyMap p) {} + void get_current_matching(PropertyMap) {} }; @@ -673,13 +673,13 @@ namespace boost } template - void start_vertex(Vertex v, Graph&) + void start_vertex(Vertex, Graph&) { m_parity = false; } template - void discover_vertex(Vertex u, Graph&) + void discover_vertex(Vertex, Graph&) { m_parity = !m_parity; m_parity ? ++m_count : --m_count; @@ -703,7 +703,7 @@ namespace boost struct no_matching_verifier { inline static bool - verify_matching(const Graph& g, MateMap mate, VertexIndexMap vm) + verify_matching(const Graph&, MateMap, VertexIndexMap) { return true;} }; diff --git a/deal.II/contrib/boost/include/boost/graph/mcgregor_common_subgraphs.hpp b/deal.II/contrib/boost/include/boost/graph/mcgregor_common_subgraphs.hpp index 25db09caca..51eea889ba 100644 --- a/deal.II/contrib/boost/include/boost/graph/mcgregor_common_subgraphs.hpp +++ b/deal.II/contrib/boost/include/boost/graph/mcgregor_common_subgraphs.hpp @@ -89,7 +89,7 @@ namespace boost { template - bool operator()(const ItemFirst& item1, const ItemSecond& item2) { + bool operator()(const ItemFirst&, const ItemSecond&) { return (true); } }; @@ -113,7 +113,7 @@ namespace boost { (const GraphFirst& graph1, const GraphSecond& graph2, CorrespondenceMapFirstToSecond correspondence_map_1_to_2, - CorrespondenceMapSecondToFirst correspondence_map_2_to_1, + CorrespondenceMapSecondToFirst /*correspondence_map_2_to_1*/, typename graph_traits::vertices_size_type subgraph_size, typename graph_traits::vertex_descriptor new_vertex1, typename graph_traits::vertex_descriptor new_vertex2, diff --git a/deal.II/contrib/boost/include/boost/graph/metric_tsp_approx.hpp b/deal.II/contrib/boost/include/boost/graph/metric_tsp_approx.hpp index ff257ab7ac..02709539e7 100644 --- a/deal.II/contrib/boost/include/boost/graph/metric_tsp_approx.hpp +++ b/deal.II/contrib/boost/include/boost/graph/metric_tsp_approx.hpp @@ -34,7 +34,8 @@ #include #include #include - +#include +#include namespace boost { @@ -68,11 +69,11 @@ namespace boost PreorderTraverser(std::vector& p) : path_(p) {} - void preorder(Node n, const Tree& t) + void preorder(Node n, const Tree&) { path_.push_back(n); } - void inorder(Node n, const Tree& t) const {} - void postorder(Node, const Tree& t) const {} + void inorder(Node, const Tree&) const {} + void postorder(Node, const Tree&) const {} const_iterator begin() const { return path_.begin(); } const_iterator end() const { return path_.end(); } @@ -241,7 +242,7 @@ namespace boost { } template - void visit_vertex(Vertex v, const Graph& g) + void visit_vertex(Vertex v, const Graph&) { BOOST_CONCEPT_ASSERT((OutputIterator)); *itr_++ = v; @@ -284,9 +285,9 @@ namespace boost // would require revisiting the core algorithm. Edge e; bool found; - tie(e, found) = edge(previous_, v, g); + tie(e, found) = lookup_edge(previous_, v, g); if(!found) { - throw not_complete(); + BOOST_THROW_EXCEPTION(not_complete()); } tourlen_ += wmap_[e]; diff --git a/deal.II/contrib/boost/include/boost/graph/named_function_params.hpp b/deal.II/contrib/boost/include/boost/graph/named_function_params.hpp index 1e2647c6a3..42c5ef87d0 100644 --- a/deal.II/contrib/boost/include/boost/graph/named_function_params.hpp +++ b/deal.II/contrib/boost/include/boost/graph/named_function_params.hpp @@ -383,13 +383,13 @@ BOOST_BGL_DECLARE_NAMED_PARAMS template struct override_const_property_t { typedef ArgType result_type; - result_type operator()(const Graph& g, const typename boost::add_reference::type a) const {return a;} + result_type operator()(const Graph&, const typename boost::add_reference::type a) const {return a;} }; template struct override_const_property_t { typedef typename boost::property_map::const_type result_type; - result_type operator()(const Graph& g, const ArgType& a) const {return get(Prop(), g);} + result_type operator()(const Graph& g, const ArgType&) const {return get(Prop(), g);} }; template @@ -399,7 +399,7 @@ BOOST_BGL_DECLARE_NAMED_PARAMS Graph, boost::detail::parameter_exists::value >::result_type - override_const_property(const ArgPack& ap, const boost::parameter::keyword& t, const Graph& g, Prop prop) { + override_const_property(const ArgPack& ap, const boost::parameter::keyword& t, const Graph& g, Prop) { return override_const_property_t< typename boost::parameter::value_type::type, Prop, diff --git a/deal.II/contrib/boost/include/boost/graph/one_bit_color_map.hpp b/deal.II/contrib/boost/include/boost/graph/one_bit_color_map.hpp new file mode 100644 index 0000000000..95a9604f6b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/graph/one_bit_color_map.hpp @@ -0,0 +1,103 @@ +// Copyright (C) 2005-2010 The Trustees of Indiana University. + +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// Authors: Jeremiah Willcock +// Douglas Gregor +// Andrew Lumsdaine + +// One bit per color property map (gray and black are the same, green is not +// supported) + +#ifndef BOOST_ONE_BIT_COLOR_MAP_HPP +#define BOOST_ONE_BIT_COLOR_MAP_HPP + +#include +#include +#include +#include +#include +#include + +namespace boost { + +enum one_bit_color_type { + one_bit_white = 0, + one_bit_not_white = 1 +}; + +template <> +struct color_traits +{ + static one_bit_color_type white() { return one_bit_white; } + static one_bit_color_type gray() { return one_bit_not_white; } + static one_bit_color_type black() { return one_bit_not_white; } +}; + + +template +struct one_bit_color_map +{ + BOOST_STATIC_CONSTANT(int, bits_per_char = std::numeric_limits::digits); + std::size_t n; + IndexMap index; + shared_array data; + + typedef typename property_traits::key_type key_type; + typedef one_bit_color_type value_type; + typedef void reference; + typedef read_write_property_map_tag category; + + explicit one_bit_color_map(std::size_t n, const IndexMap& index = IndexMap()) + : n(n), index(index), data(new unsigned char[(n + bits_per_char - 1) / bits_per_char]) + { + // Fill to white + std::fill(data.get(), data.get() + (n + bits_per_char - 1) / bits_per_char, 0); + } +}; + +template +inline one_bit_color_type +get(const one_bit_color_map& pm, + typename property_traits::key_type key) +{ + BOOST_STATIC_CONSTANT(int, bits_per_char = one_bit_color_map::bits_per_char); + typename property_traits::value_type i = get(pm.index, key); + assert ((std::size_t)i < pm.n); + return one_bit_color_type((pm.data.get()[i / bits_per_char] >> (i % bits_per_char)) & 1); +} + +template +inline void +put(const one_bit_color_map& pm, + typename property_traits::key_type key, + one_bit_color_type value) +{ + BOOST_STATIC_CONSTANT(int, bits_per_char = one_bit_color_map::bits_per_char); + typename property_traits::value_type i = get(pm.index, key); + assert ((std::size_t)i < pm.n); + assert (value >= 0 && value < 2); + std::size_t byte_num = i / bits_per_char; + std::size_t bit_position = (i % bits_per_char); + pm.data.get()[byte_num] = + (unsigned char) + ((pm.data.get()[byte_num] & ~(1 << bit_position)) + | (value << bit_position)); +} + +template +inline one_bit_color_map +make_one_bit_color_map(std::size_t n, const IndexMap& index_map) +{ + return one_bit_color_map(n, index_map); +} + +} // end namespace boost + +#endif // BOOST_ONE_BIT_COLOR_MAP_HPP + +#ifdef BOOST_GRAPH_USE_MPI +# include +#endif diff --git a/deal.II/contrib/boost/include/boost/graph/planar_detail/boyer_myrvold_impl.hpp b/deal.II/contrib/boost/include/boost/graph/planar_detail/boyer_myrvold_impl.hpp index 041a55003c..ee31c85ec9 100644 --- a/deal.II/contrib/boost/include/boost/graph/planar_detail/boyer_myrvold_impl.hpp +++ b/deal.II/contrib/boost/include/boost/graph/planar_detail/boyer_myrvold_impl.hpp @@ -104,7 +104,7 @@ namespace boost } template - void finish_vertex(const Vertex& u, Graph& g) + void finish_vertex(const Vertex& u, Graph&) { typedef typename graph_traits::vertices_size_type v_size_t; @@ -889,7 +889,7 @@ namespace boost } - void add_to_merge_points(vertex_t v, graph::detail::no_old_handles) {} + void add_to_merge_points(vertex_t, graph::detail::no_old_handles) {} void add_to_merge_points(vertex_t v, graph::detail::store_old_handles) { @@ -897,7 +897,7 @@ namespace boost } - void add_to_embedded_edges(edge_t e, graph::detail::no_old_handles) {} + void add_to_embedded_edges(edge_t, graph::detail::no_old_handles) {} void add_to_embedded_edges(edge_t e, graph::detail::store_old_handles) { diff --git a/deal.II/contrib/boost/include/boost/graph/planar_face_traversal.hpp b/deal.II/contrib/boost/include/boost/graph/planar_face_traversal.hpp index 6f392c49a3..2f8a2ee33a 100644 --- a/deal.II/contrib/boost/include/boost/graph/planar_face_traversal.hpp +++ b/deal.II/contrib/boost/include/boost/graph/planar_face_traversal.hpp @@ -29,11 +29,11 @@ namespace boost {} template - void next_edge(Edge e) + void next_edge(Edge) {} template - void next_vertex(Vertex v) + void next_vertex(Vertex) {} void end_face() diff --git a/deal.II/contrib/boost/include/boost/graph/properties.hpp b/deal.II/contrib/boost/include/boost/graph/properties.hpp index 3a313b17ba..3245962453 100644 --- a/deal.II/contrib/boost/include/boost/graph/properties.hpp +++ b/deal.II/contrib/boost/include/boost/graph/properties.hpp @@ -175,10 +175,22 @@ namespace boost { namespace detail { + template struct return_void {typedef void type;}; + + template + struct graph_tag_or_void { + typedef void type; + }; + + template + struct graph_tag_or_void::type> { + typedef typename Graph::graph_tag type; + }; + template struct edge_property_map { - typedef typename Graph::edge_property_type Property; - typedef typename Graph::graph_tag graph_tag; + typedef typename edge_property_type::type Property; + typedef typename graph_tag_or_void::type graph_tag; typedef typename edge_property_selector::type Selector; typedef typename Selector::template bind_ Bind; @@ -187,8 +199,8 @@ namespace boost { }; template class vertex_property_map { - typedef typename Graph::vertex_property_type Property; - typedef typename Graph::graph_tag graph_tag; + typedef typename vertex_property_type::type Property; + typedef typename graph_tag_or_void::type graph_tag; typedef typename vertex_property_selector::type Selector; typedef typename Selector::template bind_ Bind; diff --git a/deal.II/contrib/boost/include/boost/graph/property_maps/constant_property_map.hpp b/deal.II/contrib/boost/include/boost/graph/property_maps/constant_property_map.hpp index 9f7f0394e7..dd2461e7ed 100644 --- a/deal.II/contrib/boost/include/boost/graph/property_maps/constant_property_map.hpp +++ b/deal.II/contrib/boost/include/boost/graph/property_maps/constant_property_map.hpp @@ -43,7 +43,7 @@ struct constant_property_map : m_value(copy.m_value) { } - inline reference operator [](const key_type& v) const + inline reference operator [](const key_type&) const { return m_value; } value_type m_value; diff --git a/deal.II/contrib/boost/include/boost/graph/r_c_shortest_paths.hpp b/deal.II/contrib/boost/include/boost/graph/r_c_shortest_paths.hpp index 22cdad8500..b1bd75742c 100644 --- a/deal.II/contrib/boost/include/boost/graph/r_c_shortest_paths.hpp +++ b/deal.II/contrib/boost/include/boost/graph/r_c_shortest_paths.hpp @@ -162,7 +162,7 @@ template::vertex_descriptor s, typename graph_traits::vertex_descriptor t, // each inner vector corresponds to a pareto-optimal path @@ -179,7 +179,7 @@ void r_c_shortest_paths_dispatch Resource_Extension_Function& ref, Dominance_Function& dominance, // to specify the memory management strategy for the labels - Label_Allocator la, + Label_Allocator /*la*/, Visitor vis ) { pareto_optimal_resource_containers.clear(); @@ -449,15 +449,15 @@ void r_c_shortest_paths_dispatch struct default_r_c_shortest_paths_visitor { template - void on_label_popped( const Label& l, const Graph& g ) {} + void on_label_popped( const Label&, const Graph& ) {} template - void on_label_feasible( const Label& l, const Graph& g ) {} + void on_label_feasible( const Label&, const Graph& ) {} template - void on_label_not_feasible( const Label& l, const Graph& g ) {} + void on_label_not_feasible( const Label&, const Graph& ) {} template - void on_label_dominated( const Label& l, const Graph& g ) {} + void on_label_dominated( const Label&, const Graph& ) {} template - void on_label_not_dominated( const Label& l, const Graph& g ) {} + void on_label_not_dominated( const Label&, const Graph& ) {} }; // default_r_c_shortest_paths_visitor diff --git a/deal.II/contrib/boost/include/boost/graph/reverse_graph.hpp b/deal.II/contrib/boost/include/boost/graph/reverse_graph.hpp index 8fbd6364b8..3a81c2940e 100644 --- a/deal.II/contrib/boost/include/boost/graph/reverse_graph.hpp +++ b/deal.II/contrib/boost/include/boost/graph/reverse_graph.hpp @@ -9,6 +9,8 @@ #include #include #include +#include +#include #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) // Stay out of the way of the concept checking class @@ -75,11 +77,6 @@ class reverse_graph { typedef typename Traits::vertices_size_type vertices_size_type; typedef typename Traits::edges_size_type edges_size_type; - // More typedefs used by detail::edge_property_map, vertex_property_map - typedef typename boost::edge_property_type::type - edge_property_type; - typedef typename boost::vertex_property_type::type - vertex_property_type; typedef reverse_graph_tag graph_tag; #ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES @@ -105,6 +102,18 @@ class reverse_graph { GraphRef m_g; }; + +// These are separate so they are not instantiated unless used (see bug 1021) +template +struct vertex_property_type > { + typedef typename boost::vertex_property_type::type type; +}; + +template +struct edge_property_type > { + typedef typename boost::edge_property_type::type type; +}; + #ifndef BOOST_GRAPH_NO_BUNDLED_PROPERTIES template struct vertex_bundle_type > @@ -176,6 +185,14 @@ out_degree(const typename graph_traits::vertex_descriptor u, return in_degree(u, g.m_g); } +template +inline typename graph_traits::vertex_descriptor +vertex(const typename graph_traits::vertices_size_type v, + const reverse_graph& g) +{ + return vertex(v, g.m_g); +} + template inline std::pair::edge_descriptor, bool> @@ -267,14 +284,14 @@ struct edge_property_selector { }; template -typename property_map::type +typename property_map, Property>::type get(Property p, reverse_graph& g) { return get(p, g.m_g); } template -typename property_map::const_type +typename property_map, Property>::const_type get(Property p, const reverse_graph& g) { const BidirGraph& gref = g.m_g; // in case GRef is non-const @@ -309,7 +326,10 @@ set_property(const reverse_graph& g, Tag tag, template inline -typename graph_property::type +typename boost::mpl::if_< + boost::is_const::type>, + const typename graph_property::type&, + typename graph_property::type& >::type get_property(const reverse_graph& g, Tag tag) { return get_property(g.m_g, tag); diff --git a/deal.II/contrib/boost/include/boost/graph/subgraph.hpp b/deal.II/contrib/boost/include/boost/graph/subgraph.hpp index ba2405f1fd..15cdace53b 100644 --- a/deal.II/contrib/boost/include/boost/graph/subgraph.hpp +++ b/deal.II/contrib/boost/include/boost/graph/subgraph.hpp @@ -175,25 +175,27 @@ typedef typename Traits::traversal_category traversal_category; // local <-> global descriptor conversion functions vertex_descriptor local_to_global(vertex_descriptor u_local) const - { return m_global_vertex[u_local]; } + { return is_root() ? u_local : m_global_vertex[u_local]; } vertex_descriptor global_to_local(vertex_descriptor u_global) const { vertex_descriptor u_local; bool in_subgraph; + if (is_root()) return u_global; tie(u_local, in_subgraph) = this->find_vertex(u_global); assert(in_subgraph == true); return u_local; } edge_descriptor local_to_global(edge_descriptor e_local) const - { return m_global_edge[get(get(edge_index, m_graph), e_local)]; } + { return is_root() ? e_local : m_global_edge[get(get(edge_index, m_graph), e_local)]; } edge_descriptor global_to_local(edge_descriptor e_global) const - { return (*m_local_edge.find(get(get(edge_index, root().m_graph), e_global))).second; } + { return is_root() ? e_global : (*m_local_edge.find(get(get(edge_index, root().m_graph), e_global))).second; } // Is vertex u (of the root graph) contained in this subgraph? // If so, return the matching local vertex. std::pair find_vertex(vertex_descriptor u_global) const { + if (is_root()) return std::make_pair(u_global, true); typename std::map::const_iterator i = m_local_vertex.find(u_global); bool valid = i != m_local_vertex.end(); diff --git a/deal.II/contrib/boost/include/boost/graph/topological_sort.hpp b/deal.II/contrib/boost/include/boost/graph/topological_sort.hpp index 9a7f6eb889..08baf69b89 100644 --- a/deal.II/contrib/boost/include/boost/graph/topological_sort.hpp +++ b/deal.II/contrib/boost/include/boost/graph/topological_sort.hpp @@ -16,6 +16,7 @@ #include #include #include +#include namespace boost { @@ -37,7 +38,7 @@ namespace boost { : m_iter(_iter) { } template - void back_edge(const Edge&, Graph&) { throw not_a_dag(); } + void back_edge(const Edge&, Graph&) { BOOST_THROW_EXCEPTION(not_a_dag()); } template void finish_vertex(const Vertex& u, Graph&) { *m_iter++ = u; } diff --git a/deal.II/contrib/boost/include/boost/graph/two_bit_color_map.hpp b/deal.II/contrib/boost/include/boost/graph/two_bit_color_map.hpp index 3dbcdcef9c..9a3872fd04 100644 --- a/deal.II/contrib/boost/include/boost/graph/two_bit_color_map.hpp +++ b/deal.II/contrib/boost/include/boost/graph/two_bit_color_map.hpp @@ -14,8 +14,11 @@ #define BOOST_TWO_BIT_COLOR_MAP_HPP #include +#include #include +#include #include +#include namespace boost { @@ -43,42 +46,50 @@ struct two_bit_color_map IndexMap index; shared_array data; + BOOST_STATIC_CONSTANT(int, bits_per_char = std::numeric_limits::digits); + BOOST_STATIC_CONSTANT(int, elements_per_char = bits_per_char / 2); typedef typename property_traits::key_type key_type; typedef two_bit_color_type value_type; typedef void reference; typedef read_write_property_map_tag category; explicit two_bit_color_map(std::size_t n, const IndexMap& index = IndexMap()) - : n(n), index(index), data(new unsigned char[(n + 3) / 4]) + : n(n), index(index), data(new unsigned char[(n + elements_per_char - 1) / elements_per_char]) { // Fill to white - std::fill(data.get(), data.get() + (n + 3) / 4, 0); + std::fill(data.get(), data.get() + (n + elements_per_char - 1) / elements_per_char, 0); } }; template inline two_bit_color_type get(const two_bit_color_map& pm, - typename two_bit_color_map::key_type key) + typename property_traits::key_type key) { + BOOST_STATIC_CONSTANT(int, elements_per_char = two_bit_color_map::elements_per_char); typename property_traits::value_type i = get(pm.index, key); assert ((std::size_t)i < pm.n); - return two_bit_color_type((pm.data.get()[i / 4] >> ((i % 4) * 2)) & 3); + std::size_t byte_num = i / elements_per_char; + std::size_t bit_position = ((i % elements_per_char) * 2); + return two_bit_color_type((pm.data.get()[byte_num] >> bit_position) & 3); } template inline void put(const two_bit_color_map& pm, - typename two_bit_color_map::key_type key, + typename property_traits::key_type key, two_bit_color_type value) { + BOOST_STATIC_CONSTANT(int, elements_per_char = two_bit_color_map::elements_per_char); typename property_traits::value_type i = get(pm.index, key); assert ((std::size_t)i < pm.n); assert (value >= 0 && value < 4); - std::size_t byte_num = i / 4; - std::size_t bit_position = ((i % 4) * 2); - pm.data.get()[byte_num] = (pm.data.get()[byte_num] & ~(3 << bit_position)) - | (value << bit_position); + std::size_t byte_num = i / elements_per_char; + std::size_t bit_position = ((i % elements_per_char) * 2); + pm.data.get()[byte_num] = + (unsigned char) + ((pm.data.get()[byte_num] & ~(3 << bit_position)) + | (value << bit_position)); } template diff --git a/deal.II/contrib/boost/include/boost/graph/visitors.hpp b/deal.II/contrib/boost/include/boost/graph/visitors.hpp index 1091f10157..f986c96ce4 100644 --- a/deal.II/contrib/boost/include/boost/graph/visitors.hpp +++ b/deal.II/contrib/boost/include/boost/graph/visitors.hpp @@ -251,6 +251,52 @@ namespace boost { return property_writer(pa, out); } + //======================================================================== + // property_put + + /** + * Functor which just sets a given value to a vertex or edge in a property map. + */ + + template + struct property_put + { + typedef EventTag event_filter; + + property_put (PropertyMap property_map, + typename property_traits ::value_type value) : + property_map_ (property_map), value_ (value) + {} + + template + void operator() (VertexOrEdge v, const Graph& g) + { + put (property_map_, v, value_); + } + + private: + PropertyMap property_map_; + typename property_traits ::value_type value_; + }; + + /** + * Creates a property_put functor which just sets a given value to a vertex or edge. + * + * @param property_map Given writeable property map + * @param value Fixed value of the map + * @param tag Event Filter + * @return The functor. + */ + + template + inline property_put + put_property (PropertyMap property_map, + typename property_traits ::value_type value, + EventTag tag) + { + return property_put (property_map, value); + } + #define BOOST_GRAPH_EVENT_STUB(Event,Kind) \ typedef ::boost::Event Event##_type; \ template \ diff --git a/deal.II/contrib/boost/include/boost/integer.hpp b/deal.II/contrib/boost/include/boost/integer.hpp index dc57dff778..3393c81ea8 100644 --- a/deal.II/contrib/boost/include/boost/integer.hpp +++ b/deal.II/contrib/boost/include/boost/integer.hpp @@ -17,8 +17,21 @@ #include // self include -#include // for boost::integer_traits -#include // for std::numeric_limits +#include // for boost::::boost::integer_traits +#include // for ::std::numeric_limits +#include // for boost::int64_t and BOOST_NO_INTEGRAL_INT64_T + +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// boost/integer.hpp:77:30: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif namespace boost { @@ -28,7 +41,13 @@ namespace boost // fast integers from least integers // int_fast_t<> works correctly for unsigned too, in spite of the name. template< typename LeastInt > - struct int_fast_t { typedef LeastInt fast; }; // imps may specialize + struct int_fast_t + { + typedef LeastInt fast; + typedef fast type; + }; // imps may specialize + + namespace detail{ // convert category to type template< int Category > struct int_least_helper {}; // default is empty @@ -36,89 +55,196 @@ namespace boost // specializatons: 1=long, 2=int, 3=short, 4=signed char, // 6=unsigned long, 7=unsigned int, 8=unsigned short, 9=unsigned char // no specializations for 0 and 5: requests for a type > long are in error - template<> struct int_least_helper<1> { typedef long least; }; - template<> struct int_least_helper<2> { typedef int least; }; - template<> struct int_least_helper<3> { typedef short least; }; - template<> struct int_least_helper<4> { typedef signed char least; }; - template<> struct int_least_helper<6> { typedef unsigned long least; }; - template<> struct int_least_helper<7> { typedef unsigned int least; }; - template<> struct int_least_helper<8> { typedef unsigned short least; }; - template<> struct int_least_helper<9> { typedef unsigned char least; }; +#ifdef BOOST_HAS_LONG_LONG + template<> struct int_least_helper<1> { typedef boost::long_long_type least; }; +#endif + template<> struct int_least_helper<2> { typedef long least; }; + template<> struct int_least_helper<3> { typedef int least; }; + template<> struct int_least_helper<4> { typedef short least; }; + template<> struct int_least_helper<5> { typedef signed char least; }; +#ifdef BOOST_HAS_LONG_LONG + template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; }; +#endif + template<> struct int_least_helper<7> { typedef unsigned long least; }; + template<> struct int_least_helper<8> { typedef unsigned int least; }; + template<> struct int_least_helper<9> { typedef unsigned short least; }; + template<> struct int_least_helper<10> { typedef unsigned char least; }; + + template + struct exact_signed_base_helper{}; + template + struct exact_unsigned_base_helper{}; + + template <> struct exact_signed_base_helper { typedef signed char exact; }; + template <> struct exact_unsigned_base_helper { typedef unsigned char exact; }; +#if USHRT_MAX != UCHAR_MAX + template <> struct exact_signed_base_helper { typedef short exact; }; + template <> struct exact_unsigned_base_helper { typedef unsigned short exact; }; +#endif +#if UINT_MAX != USHRT_MAX + template <> struct exact_signed_base_helper { typedef int exact; }; + template <> struct exact_unsigned_base_helper { typedef unsigned int exact; }; +#endif +#if ULONG_MAX != UINT_MAX + template <> struct exact_signed_base_helper { typedef long exact; }; + template <> struct exact_unsigned_base_helper { typedef unsigned long exact; }; +#endif +#if defined(BOOST_HAS_LONG_LONG) &&\ + ((defined(ULLONG_MAX) && (ULLONG_MAX != ULONG_MAX)) ||\ + (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX != ULONG_MAX)) ||\ + (defined(ULONGLONG_MAX) && (ULONGLONG_MAX != ULONG_MAX)) ||\ + (defined(_ULLONG_MAX) && (_ULLONG_MAX != ULONG_MAX))) + template <> struct exact_signed_base_helper { typedef boost::long_long_type exact; }; + template <> struct exact_unsigned_base_helper { typedef boost::ulong_long_type exact; }; +#endif + + + } // namespace detail // integer templates specifying number of bits ---------------------------// // signed template< int Bits > // bits (including sign) required - struct int_t + struct int_t : public detail::exact_signed_base_helper { - typedef typename int_least_helper + typedef typename detail::int_least_helper < - (Bits-1 <= std::numeric_limits::digits) + - (Bits-1 <= std::numeric_limits::digits) + - (Bits-1 <= std::numeric_limits::digits) + - (Bits-1 <= std::numeric_limits::digits) +#ifdef BOOST_HAS_LONG_LONG + (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + +#else + 1 + +#endif + (Bits-1 <= ::std::numeric_limits::digits) + + (Bits-1 <= ::std::numeric_limits::digits) + + (Bits-1 <= ::std::numeric_limits::digits) + + (Bits-1 <= ::std::numeric_limits::digits) >::least least; - typedef typename int_fast_t::fast fast; + typedef typename int_fast_t::type fast; }; // unsigned template< int Bits > // bits required - struct uint_t + struct uint_t : public detail::exact_unsigned_base_helper { - typedef typename int_least_helper +#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) && defined(BOOST_NO_INTEGRAL_INT64_T) + // It's really not clear why this workaround should be needed... shrug I guess! JM + BOOST_STATIC_CONSTANT(int, s = + 6 + + (Bits <= ::std::numeric_limits::digits) + + (Bits <= ::std::numeric_limits::digits) + + (Bits <= ::std::numeric_limits::digits) + + (Bits <= ::std::numeric_limits::digits)); + typedef typename detail::int_least_helper< ::boost::uint_t::s>::least least; +#else + typedef typename detail::int_least_helper < 5 + - (Bits <= std::numeric_limits::digits) + - (Bits <= std::numeric_limits::digits) + - (Bits <= std::numeric_limits::digits) + - (Bits <= std::numeric_limits::digits) +#ifdef BOOST_HAS_LONG_LONG + (Bits-1 <= (int)(sizeof(boost::long_long_type) * CHAR_BIT)) + +#else + 1 + +#endif + (Bits <= ::std::numeric_limits::digits) + + (Bits <= ::std::numeric_limits::digits) + + (Bits <= ::std::numeric_limits::digits) + + (Bits <= ::std::numeric_limits::digits) >::least least; - typedef typename int_fast_t::fast fast; +#endif + typedef typename int_fast_t::type fast; // int_fast_t<> works correctly for unsigned too, in spite of the name. }; // integer templates specifying extreme value ----------------------------// // signed +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::long_long_type MaxValue > // maximum value to require support +#else template< long MaxValue > // maximum value to require support +#endif struct int_max_value_t { - typedef typename int_least_helper + typedef typename detail::int_least_helper < - (MaxValue <= integer_traits::const_max) + - (MaxValue <= integer_traits::const_max) + - (MaxValue <= integer_traits::const_max) + - (MaxValue <= integer_traits::const_max) +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + (MaxValue <= ::boost::integer_traits::const_max) + +#else + 1 + +#endif + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) >::least least; - typedef typename int_fast_t::fast fast; + typedef typename int_fast_t::type fast; }; +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::long_long_type MinValue > // minimum value to require support +#else template< long MinValue > // minimum value to require support +#endif struct int_min_value_t { - typedef typename int_least_helper + typedef typename detail::int_least_helper < - (MinValue >= integer_traits::const_min) + - (MinValue >= integer_traits::const_min) + - (MinValue >= integer_traits::const_min) + - (MinValue >= integer_traits::const_min) +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + (MinValue >= ::boost::integer_traits::const_min) + +#else + 1 + +#endif + (MinValue >= ::boost::integer_traits::const_min) + + (MinValue >= ::boost::integer_traits::const_min) + + (MinValue >= ::boost::integer_traits::const_min) + + (MinValue >= ::boost::integer_traits::const_min) >::least least; - typedef typename int_fast_t::fast fast; + typedef typename int_fast_t::type fast; }; // unsigned - template< unsigned long Value > // maximum value to require support +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::ulong_long_type MaxValue > // minimum value to require support +#else + template< unsigned long MaxValue > // minimum value to require support +#endif struct uint_value_t { - typedef typename int_least_helper +#if (defined(__BORLANDC__) || defined(__CODEGEAR__)) + // It's really not clear why this workaround should be needed... shrug I guess! JM +#if defined(BOOST_NO_INTEGRAL_INT64_T) + BOOST_STATIC_CONSTANT(unsigned, which = + 6 + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max)); + typedef typename detail::int_least_helper< ::boost::uint_value_t::which>::least least; +#else // BOOST_NO_INTEGRAL_INT64_T + BOOST_STATIC_CONSTANT(unsigned, which = + 5 + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max)); + typedef typename detail::int_least_helper< ::boost::uint_value_t::which>::least least; +#endif // BOOST_NO_INTEGRAL_INT64_T +#else + typedef typename detail::int_least_helper < 5 + - (Value <= integer_traits::const_max) + - (Value <= integer_traits::const_max) + - (Value <= integer_traits::const_max) + - (Value <= integer_traits::const_max) +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + (MaxValue <= ::boost::integer_traits::const_max) + +#else + 1 + +#endif + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) + + (MaxValue <= ::boost::integer_traits::const_max) >::least least; - typedef typename int_fast_t::fast fast; +#endif + typedef typename int_fast_t::type fast; }; diff --git a/deal.II/contrib/boost/include/boost/integer/integer_mask.hpp b/deal.II/contrib/boost/include/boost/integer/integer_mask.hpp index 0a092d3850..8c4e1bb1c4 100644 --- a/deal.II/contrib/boost/include/boost/integer/integer_mask.hpp +++ b/deal.II/contrib/boost/include/boost/integer/integer_mask.hpp @@ -70,6 +70,11 @@ struct low_bits_mask_t BOOST_STATIC_CONSTANT( std::size_t, bit_count = limits_type::digits ); \ } +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4245) // 'initializing' : conversion from 'int' to 'const boost::low_bits_mask_t<8>::least', signed/unsigned mismatch +#endif + BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned char ); #if USHRT_MAX > UCHAR_MAX @@ -84,6 +89,10 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int ); BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long ); #endif +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #undef BOOST_LOW_BITS_MASK_SPECIALIZE diff --git a/deal.II/contrib/boost/include/boost/integer/static_log2.hpp b/deal.II/contrib/boost/include/boost/integer/static_log2.hpp index 219a48e341..56c7a00125 100644 --- a/deal.II/contrib/boost/include/boost/integer/static_log2.hpp +++ b/deal.II/contrib/boost/include/boost/integer/static_log2.hpp @@ -16,7 +16,7 @@ #ifndef BOOST_INTEGER_STATIC_LOG2_HPP #define BOOST_INTEGER_STATIC_LOG2_HPP -#include "boost/config.hpp" // for BOOST_STATIC_CONSTANT +#include "boost/integer_fwd.hpp" // for boost::intmax_t namespace boost { @@ -41,9 +41,8 @@ namespace boost { // terminates with x = 1 and n = 0 (see the algorithm's // invariant). - typedef unsigned long argument_type; - typedef int result_type; - + typedef boost::static_log2_argument_type argument_type; + typedef boost::static_log2_result_type result_type; template struct choose_initial_n { @@ -107,10 +106,6 @@ namespace boost { // static_log2 // ---------------------------------------- - typedef detail::static_log2_impl::argument_type static_log2_argument_type; - typedef detail::static_log2_impl::result_type static_log2_result_type; - - template struct static_log2 { diff --git a/deal.II/contrib/boost/include/boost/integer/static_min_max.hpp b/deal.II/contrib/boost/include/boost/integer/static_min_max.hpp index 264603727f..ee76fd424a 100644 --- a/deal.II/contrib/boost/include/boost/integer/static_min_max.hpp +++ b/deal.II/contrib/boost/include/boost/integer/static_min_max.hpp @@ -12,39 +12,35 @@ #include // self include -#include // for BOOST_STATIC_CONSTANT - - namespace boost { - // Compile-time extrema class declarations ---------------------------------// // Get the minimum or maximum of two values, signed or unsigned. -template < long Value1, long Value2 > +template struct static_signed_min { - BOOST_STATIC_CONSTANT( long, value = (Value1 > Value2) ? Value2 : Value1 ); + BOOST_STATIC_CONSTANT(static_min_max_signed_type, value = (Value1 > Value2) ? Value2 : Value1 ); }; -template < long Value1, long Value2 > +template struct static_signed_max { - BOOST_STATIC_CONSTANT( long, value = (Value1 < Value2) ? Value2 : Value1 ); + BOOST_STATIC_CONSTANT(static_min_max_signed_type, value = (Value1 < Value2) ? Value2 : Value1 ); }; -template < unsigned long Value1, unsigned long Value2 > +template struct static_unsigned_min { - BOOST_STATIC_CONSTANT( unsigned long, value + BOOST_STATIC_CONSTANT(static_min_max_unsigned_type, value = (Value1 > Value2) ? Value2 : Value1 ); }; -template < unsigned long Value1, unsigned long Value2 > +template struct static_unsigned_max { - BOOST_STATIC_CONSTANT( unsigned long, value + BOOST_STATIC_CONSTANT(static_min_max_unsigned_type, value = (Value1 < Value2) ? Value2 : Value1 ); }; diff --git a/deal.II/contrib/boost/include/boost/integer_fwd.hpp b/deal.II/contrib/boost/include/boost/integer_fwd.hpp index 33cfc9986f..01b0a0844f 100644 --- a/deal.II/contrib/boost/include/boost/integer_fwd.hpp +++ b/deal.II/contrib/boost/include/boost/integer_fwd.hpp @@ -14,11 +14,23 @@ #include // for BOOST_NO_INTRINSIC_WCHAR_T #include // for std::numeric_limits +#include // For intmax_t namespace boost { +#ifdef BOOST_NO_INTEGRAL_INT64_T + typedef unsigned long static_log2_argument_type; + typedef int static_log2_result_type; + typedef long static_min_max_signed_type; + typedef unsigned long static_min_max_unsigned_type; +#else + typedef boost::uintmax_t static_min_max_unsigned_type; + typedef boost::intmax_t static_min_max_signed_type; + typedef boost::uintmax_t static_log2_argument_type; + typedef int static_log2_result_type; +#endif // From ------------------------------------------------// @@ -65,7 +77,7 @@ template < > template < > class integer_traits< unsigned long >; -#ifdef ULLONG_MAX +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && (defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64)) template < > class integer_traits< ::boost::long_long_type>; @@ -85,13 +97,25 @@ template< int Bits > template< int Bits > struct uint_t; -template< long MaxValue > +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::long_long_type MaxValue > // maximum value to require support +#else + template< long MaxValue > // maximum value to require support +#endif struct int_max_value_t; -template< long MinValue > +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::long_long_type MinValue > // minimum value to require support +#else + template< long MinValue > // minimum value to require support +#endif struct int_min_value_t; -template< unsigned long Value > +#if !defined(BOOST_NO_INTEGRAL_INT64_T) && defined(BOOST_HAS_LONG_LONG) + template< boost::ulong_long_type MaxValue > // maximum value to require support +#else + template< unsigned long MaxValue > // maximum value to require support +#endif struct uint_value_t; @@ -124,28 +148,26 @@ template < > // From ------------------------------------// -template < unsigned long Value > +template struct static_log2; -template < > - struct static_log2< 0ul >; +template <> struct static_log2<0u>; // From ---------------------------------// -template < long Value1, long Value2 > +template struct static_signed_min; -template < long Value1, long Value2 > +template struct static_signed_max; -template < unsigned long Value1, unsigned long Value2 > +template struct static_unsigned_min; -template < unsigned long Value1, unsigned long Value2 > +template struct static_unsigned_max; - } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/integer_traits.hpp b/deal.II/contrib/boost/include/boost/integer_traits.hpp index ac4ef32f30..129ce82c65 100644 --- a/deal.II/contrib/boost/include/boost/integer_traits.hpp +++ b/deal.II/contrib/boost/include/boost/integer_traits.hpp @@ -5,7 +5,7 @@ * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * - * $Id: integer_traits.hpp 32576 2006-02-05 10:19:42Z johnmaddock $ + * $Id: integer_traits.hpp 58381 2009-12-14 18:14:48Z johnmaddock $ * * Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers */ @@ -27,6 +27,17 @@ #include #endif +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// ../../../boost/integer_traits.hpp:164:66: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif namespace boost { template @@ -225,6 +236,20 @@ class integer_traits< ::boost::ulong_long_type> public detail::integer_traits_base< ::boost::ulong_long_type, 0, ~0uLL> { }; +#elif defined(BOOST_HAS_MS_INT64) + +template<> +class integer_traits< __int64> + : public std::numeric_limits< __int64>, + public detail::integer_traits_base< __int64, _I64_MIN, _I64_MAX> +{ }; + +template<> +class integer_traits< unsigned __int64> + : public std::numeric_limits< unsigned __int64>, + public detail::integer_traits_base< unsigned __int64, 0, _UI64_MAX> +{ }; + #endif #endif diff --git a/deal.II/contrib/boost/include/boost/io/ios_state.hpp b/deal.II/contrib/boost/include/boost/io/ios_state.hpp index 9c45c0b587..07cfb345ff 100644 --- a/deal.II/contrib/boost/include/boost/io/ios_state.hpp +++ b/deal.II/contrib/boost/include/boost/io/ios_state.hpp @@ -128,6 +128,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_iostate_saver& operator=(const basic_ios_iostate_saver&); }; template < typename Ch, class Tr > @@ -156,6 +157,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_exception_saver& operator=(const basic_ios_exception_saver&); }; template < typename Ch, class Tr > @@ -180,6 +182,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_tie_saver& operator=(const basic_ios_tie_saver&); }; template < typename Ch, class Tr > @@ -204,6 +207,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_rdbuf_saver& operator=(const basic_ios_rdbuf_saver&); }; template < typename Ch, class Tr > @@ -228,6 +232,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_fill_saver& operator=(const basic_ios_fill_saver&); }; #ifndef BOOST_NO_STD_LOCALE @@ -253,6 +258,7 @@ public: private: state_type & s_save_; aspect_type const a_save_; + basic_ios_locale_saver& operator=(const basic_ios_locale_saver&); }; #endif @@ -392,6 +398,8 @@ private: #ifndef BOOST_NO_STD_LOCALE ::std::locale const a9_save_; #endif + + basic_ios_all_saver& operator=(const basic_ios_all_saver&); }; class ios_all_word_saver diff --git a/deal.II/contrib/boost/include/boost/iostreams/chain.hpp b/deal.II/contrib/boost/include/boost/iostreams/chain.hpp index 28718fafe9..90fd18410d 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/chain.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/chain.hpp @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include // VC6.5 requires this @@ -149,17 +150,20 @@ public: // Sets the size of the buffer created for the devices to be added to this // chain. Does not affect the size of the buffer for devices already // added. - void set_device_buffer_size(int n) { pimpl_->device_buffer_size_ = n; } + void set_device_buffer_size(std::streamsize n) + { pimpl_->device_buffer_size_ = n; } // Sets the size of the buffer created for the filters to be added // to this chain. Does not affect the size of the buffer for filters already // added. - void set_filter_buffer_size(int n) { pimpl_->filter_buffer_size_ = n; } + void set_filter_buffer_size(std::streamsize n) + { pimpl_->filter_buffer_size_ = n; } // Sets the size of the putback buffer for filters and devices to be added // to this chain. Does not affect the size of the buffer for filters or // devices already added. - void set_pback_size(int n) { pimpl_->pback_size_ = n; } + void set_pback_size(std::streamsize n) + { pimpl_->pback_size_ = n; } //----------Device interface----------------------------------------------// @@ -172,7 +176,7 @@ public: const std::type_info& component_type(int n) const { if (static_cast(n) >= size()) - throw std::out_of_range("bad chain offset"); + boost::throw_exception(std::out_of_range("bad chain offset")); return (*boost::next(list().begin(), n))->component_type(); } @@ -196,7 +200,7 @@ public: T* component(int n, boost::type) const { if (static_cast(n) >= size()) - throw std::out_of_range("bad chain offset"); + boost::throw_exception(std::out_of_range("bad chain offset")); streambuf_type* link = *boost::next(list().begin(), n); if (BOOST_IOSTREAMS_COMPARE_TYPE_ID(link->component_type(), typeid(T))) return static_cast(link->component_impl()); @@ -226,7 +230,8 @@ public: bool strict_sync(); private: template - void push_impl(const T& t, int buffer_size = -1, int pback_size = -1) + void push_impl(const T& t, std::streamsize buffer_size = -1, + std::streamsize pback_size = -1) { typedef typename iostreams::category_of::type category; typedef typename unwrap_ios::type component_type; @@ -238,7 +243,7 @@ private: typedef typename list_type::iterator iterator; BOOST_STATIC_ASSERT((is_convertible::value)); if (is_complete()) - throw std::logic_error("chain complete"); + boost::throw_exception(std::logic_error("chain complete")); streambuf_type* prev = !empty() ? list().back() : 0; buffer_size = buffer_size != -1 ? @@ -361,12 +366,12 @@ private: flags_ &= ~f_complete; flags_ &= ~f_open; } - list_type links_; - client_type* client_; - int device_buffer_size_, - filter_buffer_size_, - pback_size_; - int flags_; + list_type links_; + client_type* client_; + std::streamsize device_buffer_size_, + filter_buffer_size_, + pback_size_; + int flags_; }; friend struct chain_impl; diff --git a/deal.II/contrib/boost/include/boost/iostreams/checked_operations.hpp b/deal.II/contrib/boost/include/boost/iostreams/checked_operations.hpp index 2c999c370a..667d925443 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/checked_operations.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/checked_operations.hpp @@ -14,12 +14,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include // Must come last. #include // MSVC. @@ -93,24 +95,28 @@ struct read_write_if_impl { template static bool put(T&, typename char_type_of::type) - { throw cant_write(); } + { boost::throw_exception(cant_write()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(false) } template static std::streamsize write(T&, const typename char_type_of::type*, std::streamsize) - { throw cant_write(); } + { boost::throw_exception(cant_write()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } }; template<> struct read_write_if_impl { template static typename int_type_of::type get(T&) - { throw cant_read(); } + { boost::throw_exception(cant_read()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } template static std::streamsize read(T&, typename char_type_of::type*, std::streamsize) - { throw cant_read(); } + { boost::throw_exception(cant_read()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } template static bool put(T& t, typename char_type_of::type c) @@ -139,7 +145,8 @@ struct seek_if_impl { template static std::streampos seek(T&, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode) - { throw cant_seek(); } + { boost::throw_exception(cant_seek()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(std::streampos()) } }; } // End namespace detail. diff --git a/deal.II/contrib/boost/include/boost/iostreams/code_converter.hpp b/deal.II/contrib/boost/include/boost/iostreams/code_converter.hpp index 3952696155..280a5d0974 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/code_converter.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/code_converter.hpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -152,10 +153,11 @@ struct code_converter_impl { } catch (...) { /* */ } } - void open(const Device& dev, int buffer_size) + template + void open(const T& dev, int buffer_size) { if (flags_ & f_open) - throw BOOST_IOSTREAMS_FAILURE("already open"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("already open")); if (buffer_size == -1) buffer_size = default_filter_buffer_size; int max_length = cvt_.get().max_length(); @@ -354,7 +356,7 @@ std::streamsize code_converter::read case std::codecvt_base::error: default: buf.state() = state_type(); - throw code_conversion_error(); + boost::throw_exception(code_conversion_error()); } } while (total < n && status != EOF && status != WOULD_BLOCK); @@ -407,7 +409,7 @@ std::streamsize code_converter::write case std::codecvt_base::error: default: buf.state() = state_type(); - throw code_conversion_error(); + boost::throw_exception(code_conversion_error()); } } return total; diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/concept_adapter.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/concept_adapter.hpp index c2cd2af448..0963d8905b 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/concept_adapter.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/concept_adapter.hpp @@ -17,15 +17,18 @@ #include #include #include // pubsync. +#include #include #include #include #include #include +#include // Must come last. #include // MSVC. + namespace boost { namespace iostreams { namespace detail { template struct device_wrapper_impl; @@ -137,7 +140,8 @@ struct device_wrapper_impl { seek( Device&, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag ) { - throw cant_seek(); + boost::throw_exception(cant_seek()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } template @@ -171,7 +175,8 @@ struct device_wrapper_impl : device_wrapper_impl { static std::streamsize write( Device&, Dummy*, const typename char_type_of::type*, std::streamsize ) - { throw cant_write(); } + { boost::throw_exception(cant_write()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } }; template<> @@ -179,7 +184,8 @@ struct device_wrapper_impl { template static std::streamsize read(Device&, Dummy*, typename char_type_of::type*, std::streamsize) - { throw cant_read(); } + { boost::throw_exception(cant_read()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } template static std::streamsize @@ -205,7 +211,8 @@ struct flt_wrapper_impl { static std::streampos seek( Filter&, Device*, stream_offset, BOOST_IOS::seekdir, BOOST_IOS::openmode, any_tag ) - { throw cant_seek(); } + { boost::throw_exception(cant_seek()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } template static std::streampos @@ -252,7 +259,8 @@ struct flt_wrapper_impl { static std::streamsize write( Filter&, Sink*, const typename char_type_of::type*, std::streamsize ) - { throw cant_write(); } + { boost::throw_exception(cant_write()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } }; template<> @@ -260,7 +268,8 @@ struct flt_wrapper_impl { template static std::streamsize read(Filter&, Source*, typename char_type_of::type*,std::streamsize) - { throw cant_read(); } + { boost::throw_exception(cant_read()); + BOOST_IOSTREAMS_UNREACHABLE_RETURN(0) } template static std::streamsize diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/direct_adapter.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/direct_adapter.hpp index c70bacc1f8..88ab735a17 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/direct_adapter.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/direct_adapter.hpp @@ -30,6 +30,7 @@ #include #include #include +#include #include // Must come last. @@ -209,7 +210,7 @@ inline std::streamsize direct_adapter::write using namespace std; pointers& put = ptrs_.second(); if (n > static_cast(put.end - put.ptr)) - throw write_area_exhausted(); + boost::throw_exception(write_area_exhausted()); std::copy(s, s + n, put.ptr); put.ptr += n; return n; @@ -224,7 +225,7 @@ inline std::streampos direct_adapter::seek pointers& get = ptrs_.first(); pointers& put = ptrs_.second(); if (way == BOOST_IOS::cur && get.ptr != put.ptr) - throw bad_seek(); + boost::throw_exception(bad_seek()); ptrdiff_t next = 0; if ((which & BOOST_IOS::in) || !is_double::value) { if (way == BOOST_IOS::beg) @@ -236,7 +237,7 @@ inline std::streampos direct_adapter::seek if (next >= 0 && next <= get.end - get.beg) get.ptr = get.beg + next; else - throw bad_seek(); + boost::throw_exception(bad_seek()); } if ((which & BOOST_IOS::out) && is_double::value) { if (way == BOOST_IOS::beg) @@ -248,7 +249,7 @@ inline std::streampos direct_adapter::seek if (next >= 0 && next <= put.end - put.beg) put.ptr = put.beg + next; else - throw bad_seek(); + boost::throw_exception(bad_seek()); } return offset_to_position(next); } diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/range_adapter.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/range_adapter.hpp index f11958db9a..d2b9bc55fd 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/range_adapter.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/adapter/range_adapter.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -116,7 +117,7 @@ struct range_adapter_impl { { while (cur != last && n-- > 0) *cur++ = *s++; if (cur == last && n > 0) - throw write_area_exhausted(); + boost::throw_exception(write_area_exhausted()); return n; } }; @@ -144,7 +145,7 @@ struct range_adapter_impl { std::copy(s, s + count, cur); cur += count; if (count < n) - throw write_area_exhausted(); + boost::throw_exception(write_area_exhausted()); return n; } @@ -156,18 +157,21 @@ struct range_adapter_impl { using namespace std; switch (way) { case BOOST_IOS::beg: - if (off > last - first || off < 0) throw bad_seek(); + if (off > last - first || off < 0) + boost::throw_exception(bad_seek()); cur = first + off; break; case BOOST_IOS::cur: { std::ptrdiff_t newoff = cur - first + off; - if (newoff > last - first || newoff < 0) throw bad_seek(); + if (newoff > last - first || newoff < 0) + boost::throw_exception(bad_seek()); cur += off; break; } case BOOST_IOS::end: - if (last - first + off < 0 || off > 0) throw bad_seek(); + if (last - first + off < 0 || off > 0) + boost::throw_exception(bad_seek()); cur = last + off; break; default: diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp index 5f98b2151d..d5c7107087 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/broken_overload_resolution/stream_buffer.hpp @@ -9,6 +9,7 @@ #define BOOST_IOSTREAMS_DETAIL_BROKEN_OVERLOAD_RESOLUTION_STREAM_BUFFER_HPP_INCLUDED #include +#include namespace boost { namespace iostreams { @@ -179,7 +180,7 @@ private: void check_open() { if (this->is_open()) - throw BOOST_IOSTREAMS_FAILURE("already open"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("already open")); } }; diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/buffer.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/buffer.hpp index f6b6f5cf07..c830ae5bf7 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/buffer.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/buffer.hpp @@ -148,7 +148,12 @@ basic_buffer::basic_buffer(int buffer_size) template inline basic_buffer::~basic_buffer() -{ if (buf_) allocator_type().deallocate(buf_, size_); } +{ + if (buf_) { + allocator_type().deallocate(buf_, + static_cast(size_)); + } +} template inline void basic_buffer::resize(int buffer_size) diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/config/unreachable_return.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/config/unreachable_return.hpp new file mode 100644 index 0000000000..9e40033e8d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/config/unreachable_return.hpp @@ -0,0 +1,25 @@ +// (C) Copyright 2010 Daniel James +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) + +// See http://www.boost.org/libs/iostreams for documentation. + +#ifndef BOOST_IOSTREAMS_DETAIL_UNREACHABLE_RETURN_HPP_INCLUDED +#define BOOST_IOSTREAMS_DETAIL_UNREACHABLE_RETURN_HPP_INCLUDED + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + +#include + +// If Boost.Exception has BOOST_ATTRIBUTE_NORETURN +#if defined(_MSC_VER) || defined(__GNUC__) +#define BOOST_IOSTREAMS_UNREACHABLE_RETURN(x) \ + BOOST_UNREACHABLE_RETURN(x) +#else +#define BOOST_IOSTREAMS_UNREACHABLE_RETURN(x) \ + return x; +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/is_dereferenceable.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/is_dereferenceable.hpp index 62cf429f5d..89252a3547 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/is_dereferenceable.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/is_dereferenceable.hpp @@ -49,10 +49,10 @@ namespace is_dereferenceable_ # endif // two check overloads help us identify which operator++ was picked - char (& check(tag) )[2]; + char (& check BOOST_PREVENT_MACRO_SUBSTITUTION(tag) )[2]; template - char check(T const&); + char check BOOST_PREVENT_MACRO_SUBSTITUTION(T const&); template struct impl @@ -61,7 +61,7 @@ namespace is_dereferenceable_ BOOST_STATIC_CONSTANT( bool - , value = sizeof(is_dereferenceable_::check(BOOST_comma(*x,0))) == 1 + , value = sizeof(is_dereferenceable_::check BOOST_PREVENT_MACRO_SUBSTITUTION(BOOST_comma(*x,0))) == 1 ); }; } diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/path.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/path.hpp index af64c3018e..a78e0c6be3 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/path.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/path.hpp @@ -48,7 +48,7 @@ public: // Constructor taking a boost::filesystem::path or boost::filesystem::wpath template - explicit path(const Path& p) + explicit path(const Path& p, typename Path::external_string_type* = 0) { typedef typename Path::external_string_type string_type; init(p, boost::type()); diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/push_params.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/push_params.hpp index 736d5b8360..7e80d09af1 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/push_params.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/push_params.hpp @@ -13,7 +13,7 @@ #endif #define BOOST_IOSTREAMS_PUSH_PARAMS() \ - , int buffer_size = -1 , int pback_size = -1 \ + , std::streamsize buffer_size = -1 , std::streamsize pback_size = -1 \ /**/ #define BOOST_IOSTREAMS_PUSH_ARGS() , buffer_size, pback_size diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/restrict_impl.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/restrict_impl.hpp index 611b50cc0f..3175bf1f2a 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/restrict_impl.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/restrict_impl.hpp @@ -44,6 +44,7 @@ # include // mode_of, is_direct. # include # include +# include # include # include @@ -159,8 +160,12 @@ public: { if (!open_) open(snk, BOOST_IOS::out); - if (end_ != -1 && pos_ + n >= end_) - bad_write(); + if (end_ != -1 && pos_ + n >= end_) { + if(pos_ < end_) + pos_ += iostreams::write(this->component(), + snk, s, end_ - pos_); + boost::throw_exception(bad_write()); + } std::streamsize result = iostreams::write(this->component(), snk, s, n); pos_ += result; @@ -181,11 +186,11 @@ public: // Restriction is half-open; seek relative to the actual end. pos_ = this->component().seek(dev, off, BOOST_IOS::end); if (pos_ < beg_) - bad_seek(); + boost::throw_exception(bad_seek()); return offset_to_position(pos_ - beg_); } if (next < beg_ || (end_ != -1 && next >= end_)) - bad_seek(); + boost::throw_exception(bad_seek()); pos_ = this->component().seek(dev, next, BOOST_IOS::cur); return offset_to_position(pos_ - beg_); } @@ -248,7 +253,7 @@ restricted_indirect_device::restricted_indirect_device end_(len != -1 ? off + len : -1) { if (len < -1 || off < 0) - throw BOOST_IOSTREAMS_FAILURE("bad offset"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad offset")); iostreams::skip(this->component(), off); } @@ -271,8 +276,11 @@ template inline std::streamsize restricted_indirect_device::write (const char_type* s, std::streamsize n) { - if (end_ != -1 && pos_ + n >= end_) - bad_write(); + if (end_ != -1 && pos_ + n >= end_) { + if(pos_ < end_) + pos_ += iostreams::write(this->component(), s, end_ - pos_); + boost::throw_exception(bad_write()); + } std::streamsize result = iostreams::write(this->component(), s, n); pos_ += result; return result; @@ -293,11 +301,11 @@ std::streampos restricted_indirect_device::seek // Restriction is half-open; seek relative to the actual end. pos_ = iostreams::seek(this->component(), off, BOOST_IOS::end); if (pos_ < beg_) - bad_seek(); + boost::throw_exception(bad_seek()); return offset_to_position(pos_ - beg_); } - if (next < beg_ || (end_ != -1 && next >= end_)) - bad_seek(); + if (next < beg_ || (end_ != -1 && next > end_)) + boost::throw_exception(bad_seek()); pos_ = iostreams::seek(this->component(), next - pos_, BOOST_IOS::cur); return offset_to_position(pos_ - beg_); } @@ -314,7 +322,7 @@ restricted_direct_device::restricted_direct_device if ( off < 0 || len < -1 || (len != -1 && off + len > seq.second - seq.first) ) { - throw BOOST_IOSTREAMS_FAILURE("bad offset"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad offset")); } beg_ = seq.first + off; end_ = len != -1 ? @@ -357,7 +365,7 @@ restricted_filter::restricted_filter pos_(off), end_(len != -1 ? off + len : -1), open_(false) { if (len < -1 || off < 0) - throw BOOST_IOSTREAMS_FAILURE("bad offset"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad offset")); } } // End namespace detail. diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp index 8872e0f63c..1dad9af101 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/streambuf/direct_streambuf.hpp @@ -29,6 +29,7 @@ #include #include #include +#include // Must come last. #include // MSVC. @@ -55,7 +56,8 @@ private: char_type, traits_type ) streambuf_type; public: // stream needs access. - void open(const T& t, int buffer_size, int pback_size); + void open(const T& t, std::streamsize buffer_size, + std::streamsize pback_size); bool is_open() const; void close(); bool auto_close() const { return auto_close_; } @@ -111,7 +113,8 @@ direct_streambuf::direct_streambuf() { this->set_true_eof(true); } template -void direct_streambuf::open(const T& t, int, int) +void direct_streambuf::open + (const T& t, std::streamsize, std::streamsize) { storage_.reset(t); init_input(category()); @@ -138,7 +141,7 @@ typename direct_streambuf::int_type direct_streambuf::underflow() { if (!ibeg_) - throw cant_read(); + boost::throw_exception(cant_read()); if (!gptr()) init_get_area(); return gptr() != iend_ ? @@ -152,14 +155,14 @@ direct_streambuf::pbackfail(int_type c) { using namespace std; if (!ibeg_) - throw cant_read(); + boost::throw_exception(cant_read()); if (gptr() != 0 && gptr() != ibeg_) { gbump(-1); if (!traits_type::eq_int_type(c, traits_type::eof())) *gptr() = traits_type::to_char_type(c); return traits_type::not_eof(c); } - throw bad_putback(); + boost::throw_exception(bad_putback()); } template @@ -167,11 +170,14 @@ typename direct_streambuf::int_type direct_streambuf::overflow(int_type c) { using namespace std; - if (!obeg_) throw BOOST_IOSTREAMS_FAILURE("no write access"); + if (!obeg_) + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("no write access")); if (!pptr()) init_put_area(); if (!traits_type::eq_int_type(c, traits_type::eof())) { if (pptr() == oend_) - throw BOOST_IOSTREAMS_FAILURE("write area exhausted"); + boost::throw_exception( + BOOST_IOSTREAMS_FAILURE("write area exhausted") + ); *pptr() = traits_type::to_char_type(c); pbump(1); return c; @@ -215,7 +221,7 @@ typename direct_streambuf::pos_type direct_streambuf::seek_impl using namespace std; BOOST_IOS::openmode both = BOOST_IOS::in | BOOST_IOS::out; if (two_head() && (which & both) == both) - throw bad_seek(); + boost::throw_exception(bad_seek()); stream_offset result = -1; bool one = one_head(); if (one && (pptr() != 0 || gptr()== 0)) @@ -230,7 +236,7 @@ typename direct_streambuf::pos_type direct_streambuf::seek_impl default: assert(0); } if (next < 0 || next > (iend_ - ibeg_)) - throw bad_seek(); + boost::throw_exception(bad_seek()); setg(ibeg_, ibeg_ + next, iend_); result = next; } @@ -244,7 +250,7 @@ typename direct_streambuf::pos_type direct_streambuf::seek_impl default: assert(0); } if (next < 0 || next > (oend_ - obeg_)) - throw bad_seek(); + boost::throw_exception(bad_seek()); pbump(static_cast(next - (pptr() - obeg_))); result = next; } diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp index bb43050b6b..2926f8ab28 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/streambuf/indirect_streambuf.hpp @@ -35,6 +35,7 @@ #include #include #include +#include #include // Must come last. @@ -151,7 +152,7 @@ indirect_streambuf::indirect_streambuf() template void indirect_streambuf::open - (const T& t, int buffer_size, int pback_size) + (const T& t, std::streamsize buffer_size, std::streamsize pback_size) { using namespace std; @@ -167,7 +168,7 @@ void indirect_streambuf::open // Construct input buffer. if (can_read()) { - pback_size_ = (std::max)(2, pback_size); // STLPort needs 2. + pback_size_ = (std::max)(std::streamsize(2), pback_size); // STLPort needs 2. std::streamsize size = pback_size_ + ( buffer_size ? buffer_size: 1 ); @@ -274,7 +275,7 @@ indirect_streambuf::pbackfail(int_type c) *gptr() = traits_type::to_char_type(c); return traits_type::not_eof(c); } else { - throw bad_putback(); + boost::throw_exception(bad_putback()); } } diff --git a/deal.II/contrib/boost/include/boost/iostreams/detail/system_failure.hpp b/deal.II/contrib/boost/include/boost/iostreams/detail/system_failure.hpp index 3d12299f76..7d86eafec4 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/detail/system_failure.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/detail/system_failure.hpp @@ -18,6 +18,7 @@ #include #include #include +#include #include #include // failure. @@ -73,10 +74,10 @@ inline BOOST_IOSTREAMS_FAILURE system_failure(const std::string& msg) { return system_failure(msg.c_str()); } inline void throw_system_failure(const char* msg) -{ throw system_failure(msg); } +{ boost::throw_exception(system_failure(msg)); } inline void throw_system_failure(const std::string& msg) -{ throw system_failure(msg); } +{ boost::throw_exception(system_failure(msg)); } } } } // End namespaces detail, iostreams, boost. diff --git a/deal.II/contrib/boost/include/boost/iostreams/device/mapped_file.hpp b/deal.II/contrib/boost/include/boost/iostreams/device/mapped_file.hpp index 9c13779822..8493b17736 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/device/mapped_file.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/device/mapped_file.hpp @@ -4,6 +4,9 @@ // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt.) +#ifndef BOOST_IOSTREAMS_MAPPED_FILE_HPP_INCLUDED +#define BOOST_IOSTREAMS_MAPPED_FILE_HPP_INCLUDED + #if defined(_MSC_VER) && (_MSC_VER >= 1020) # pragma once #endif @@ -25,6 +28,7 @@ #include #include #include +#include #include // Must come last. @@ -393,10 +397,10 @@ void mapped_file_source::open(const basic_mapped_file_params& p) param_type params(p); if (params.flags) { if (params.flags != mapped_file::readonly) - throw new BOOST_IOSTREAMS_FAILURE("invalid flags"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid flags")); } else { if (params.mode & BOOST_IOS::out) - throw new BOOST_IOSTREAMS_FAILURE("invalid mode"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid mode")); params.mode |= BOOST_IOS::in; } open_impl(params); @@ -479,10 +483,10 @@ void mapped_file_sink::open(const basic_mapped_file_params& p) param_type params(p); if (params.flags) { if (params.flags & mapped_file::readonly) - throw new BOOST_IOSTREAMS_FAILURE("invalid flags"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid flags")); } else { if (params.mode & BOOST_IOS::in) - throw new BOOST_IOSTREAMS_FAILURE("invalid mode"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("invalid mode")); params.mode |= BOOST_IOS::out; } mapped_file::open(params); @@ -591,3 +595,5 @@ operator^=(mapped_file::mapmode& a, mapped_file::mapmode b) } } // End namespaces iostreams, boost. #include // pops abi_suffix.hpp pragmas + +#endif // #ifndef BOOST_IOSTREAMS_MAPPED_FILE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/iostreams/filter/bzip2.hpp b/deal.II/contrib/boost/include/boost/iostreams/filter/bzip2.hpp index 982d432bf3..45fea085a3 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/filter/bzip2.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/filter/bzip2.hpp @@ -113,7 +113,7 @@ class BOOST_IOSTREAMS_DECL bzip2_error : public BOOST_IOSTREAMS_FAILURE { public: explicit bzip2_error(int error); int error() const { return error_; } - static void check(int error); + static void check BOOST_PREVENT_MACRO_SUBSTITUTION(int error); private: int error_; }; @@ -316,7 +316,7 @@ bool bzip2_compressor_impl::filter before(src_begin, src_end, dest_begin, dest_end); int result = compress(flush ? bzip2::finish : bzip2::run); after(src_begin, dest_begin); - bzip2_error::check(result); + bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result); return result != bzip2::stream_end; } @@ -348,7 +348,7 @@ bool bzip2_decompressor_impl::filter before(src_begin, src_end, dest_begin, dest_end); int result = decompress(); after(src_begin, dest_begin); - bzip2_error::check(result); + bzip2_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result); return !(eof_ = result == bzip2::stream_end); } diff --git a/deal.II/contrib/boost/include/boost/iostreams/filter/gzip.hpp b/deal.II/contrib/boost/include/boost/iostreams/filter/gzip.hpp index 4faee788bc..112a296472 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/filter/gzip.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/filter/gzip.hpp @@ -32,11 +32,13 @@ #include #include #include // failure. +#include #include #include #include #include -#include +#include +#include // Must come last. #if defined(BOOST_MSVC) @@ -417,7 +419,7 @@ public: if (state_ == s_header) { int c = boost::iostreams::get(peek); if (traits_type::is_eof(c)) { - throw gzip_error(gzip::bad_header); + boost::throw_exception(gzip_error(gzip::bad_header)); } else if (traits_type::would_block(c)) { break; } @@ -437,19 +439,19 @@ public: state_ = s_footer; } } catch (const zlib_error& e) { - throw gzip_error(e); + boost::throw_exception(gzip_error(e)); } } else { // state_ == s_footer int c = boost::iostreams::get(peek); if (traits_type::is_eof(c)) { - throw gzip_error(gzip::bad_footer); + boost::throw_exception(gzip_error(gzip::bad_footer)); } else if (traits_type::would_block(c)) { break; } footer_.process(c); if (footer_.done()) { if (footer_.crc() != this->crc()) - throw gzip_error(gzip::bad_crc); + boost::throw_exception(gzip_error(gzip::bad_crc)); int c = boost::iostreams::get(peek); if (traits_type::is_eof(c)) { state_ = s_done; @@ -482,7 +484,7 @@ public: state_ = s_start; header_.reset(); footer_.reset(); - throw gzip_error(e); + boost::throw_exception(gzip_error(e)); } state_ = s_start; } @@ -530,10 +532,11 @@ private: { if (offset_) { putback_[--offset_] = c; - return true; } else { - return boost::iostreams::putback(src_, c); + boost::throw_exception( + boost::iostreams::detail::bad_putback()); } + return true; } void putback(const string_type& s) { diff --git a/deal.II/contrib/boost/include/boost/iostreams/filter/newline.hpp b/deal.II/contrib/boost/include/boost/iostreams/filter/newline.hpp index d6c5f1fc64..279fb9a831 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/filter/newline.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/filter/newline.hpp @@ -27,6 +27,7 @@ #include #include #include +#include #include // Must come last. @@ -120,11 +121,11 @@ public: explicit newline_filter(int target) : flags_(target) { - if ( target != newline::posix && - target != newline::dos && - target != newline::mac ) + if ( target != iostreams::newline::posix && + target != iostreams::newline::dos && + target != iostreams::newline::mac ) { - throw std::logic_error("bad flags"); + boost::throw_exception(std::logic_error("bad flags")); } } @@ -226,12 +227,12 @@ private: using iostreams::newline::CR; using iostreams::newline::LF; - switch (flags_ & newline::platform_mask) { - case newline::posix: + switch (flags_ & iostreams::newline::platform_mask) { + case iostreams::newline::posix: return LF; - case newline::mac: + case iostreams::newline::mac: return CR; - case newline::dos: + case iostreams::newline::dos: if (flags_ & f_has_LF) { flags_ &= ~f_has_LF; return LF; @@ -251,14 +252,14 @@ private: using iostreams::newline::LF; bool success = false; - switch (flags_ & newline::platform_mask) { - case newline::posix: + switch (flags_ & iostreams::newline::platform_mask) { + case iostreams::newline::posix: success = boost::iostreams::put(dest, LF); break; - case newline::mac: + case iostreams::newline::mac: success = boost::iostreams::put(dest, CR); break; - case newline::dos: + case iostreams::newline::dos: if ((flags_ & f_has_LF) != 0) { if ((success = boost::iostreams::put(dest, LF))) flags_ &= ~f_has_LF; @@ -420,7 +421,7 @@ public: } } private: - void fail() { throw newline_error(source()); } + void fail() { boost::throw_exception(newline_error(source())); } int& source() { return flags_; } int source() const { return flags_; } diff --git a/deal.II/contrib/boost/include/boost/iostreams/filter/zlib.hpp b/deal.II/contrib/boost/include/boost/iostreams/filter/zlib.hpp index 56f7f71c87..f329356697 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/filter/zlib.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/filter/zlib.hpp @@ -20,6 +20,7 @@ #include // allocator, bad_alloc. #include #include // MSVC, STATIC_CONSTANT, DEDUCED_TYPENAME, DINKUM. +#include // uint*_t #include #include // buffer size. #include @@ -43,9 +44,9 @@ namespace boost { namespace iostreams { namespace zlib { // Typedefs -typedef unsigned int uint; -typedef unsigned char byte; -typedef unsigned long ulong; +typedef uint32_t uint; +typedef uint8_t byte; +typedef uint32_t ulong; // Prefix 'x' prevents symbols from being redefined when Z_PREFIX is defined typedef void* (*xalloc_func)(void*, zlib::uint, zlib::uint); @@ -138,7 +139,7 @@ class BOOST_IOSTREAMS_DECL zlib_error : public BOOST_IOSTREAMS_FAILURE { public: explicit zlib_error(int error); int error() const { return error_; } - static void check(int error); + static void check BOOST_PREVENT_MACRO_SUBSTITUTION(int error); private: int error_; }; @@ -344,7 +345,7 @@ bool zlib_compressor_impl::filter before(src_begin, src_end, dest_begin, dest_end); int result = xdeflate(flush ? zlib::finish : zlib::no_flush); after(src_begin, dest_begin, true); - zlib_error::check(result); + zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result); return result != zlib::stream_end; } @@ -377,7 +378,7 @@ bool zlib_decompressor_impl::filter before(src_begin, src_end, dest_begin, dest_end); int result = xinflate(zlib::sync_flush); after(src_begin, dest_begin, false); - zlib_error::check(result); + zlib_error::check BOOST_PREVENT_MACRO_SUBSTITUTION(result); return result != zlib::stream_end; } diff --git a/deal.II/contrib/boost/include/boost/iostreams/positioning.hpp b/deal.II/contrib/boost/include/boost/iostreams/positioning.hpp index cb174dd45e..12493d9353 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/positioning.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/positioning.hpp @@ -102,8 +102,10 @@ inline std::fpos_t streampos_to_fpos_t(std::streampos pos) inline stream_offset position_to_offset(std::streampos pos) { return fpos_t_to_offset(streampos_to_fpos_t(pos)) + - static_cast(static_cast(pos)) - - static_cast(_FPOSOFF(streampos_to_fpos_t(pos))); + static_cast( + static_cast(pos) - + _FPOSOFF(streampos_to_fpos_t(pos)) + ); } # endif // # ifndef BOOST_IOSTREAMS_HAS_DINKUMWARE_FPOS diff --git a/deal.II/contrib/boost/include/boost/iostreams/skip.hpp b/deal.II/contrib/boost/include/boost/iostreams/skip.hpp index c99d1291b1..4c62d4528b 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/skip.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/skip.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include namespace boost { namespace iostreams { @@ -40,7 +41,7 @@ void skip(Device& dev, stream_offset off, mpl::false_) for (stream_offset z = 0; z < off; ) { typename traits_type::int_type c; if (traits_type::is_eof(c = iostreams::get(dev))) - throw BOOST_IOSTREAMS_FAILURE("bad skip offset"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad skip offset")); if (!traits_type::would_block(c)) ++z; } @@ -60,7 +61,7 @@ void skip( Filter& flt, Device& dev, stream_offset off, for (stream_offset z = 0; z < off; ) { std::streamsize amt; if ((amt = iostreams::read(flt, dev, &c, 1)) == -1) - throw BOOST_IOSTREAMS_FAILURE("bad skip offset"); + boost::throw_exception(BOOST_IOSTREAMS_FAILURE("bad skip offset")); if (amt == 1) ++z; } diff --git a/deal.II/contrib/boost/include/boost/iostreams/stream_buffer.hpp b/deal.II/contrib/boost/include/boost/iostreams/stream_buffer.hpp index 6d7ade3f7b..0f8a64754e 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/stream_buffer.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/stream_buffer.hpp @@ -22,6 +22,7 @@ #include #include #include +#include #include // Must come last. @@ -99,7 +100,9 @@ private: void open_impl(const T& t BOOST_IOSTREAMS_PUSH_PARAMS()) { // Used for forwarding. if (this->is_open()) - BOOST_IOSTREAMS_FAILURE("already open"); + boost::throw_exception( + BOOST_IOSTREAMS_FAILURE("already open") + ); base_type::open(t BOOST_IOSTREAMS_PUSH_ARGS()); } }; diff --git a/deal.II/contrib/boost/include/boost/iostreams/write.hpp b/deal.II/contrib/boost/include/boost/iostreams/write.hpp index 4f3771a94e..91cb9bd550 100644 --- a/deal.II/contrib/boost/include/boost/iostreams/write.hpp +++ b/deal.II/contrib/boost/include/boost/iostreams/write.hpp @@ -83,7 +83,7 @@ struct write_device_impl { { typedef typename char_type_of::type char_type; typedef BOOST_IOSTREAMS_CHAR_TRAITS(char_type) traits_type; - return !traits_type::eq_int_type( t.rdbuf()->s.sputc(), + return !traits_type::eq_int_type( t.rdbuf()->sputc(c), traits_type::eof() ); } diff --git a/deal.II/contrib/boost/include/boost/math/distributions/detail/hypergeometric_pdf.hpp b/deal.II/contrib/boost/include/boost/math/distributions/detail/hypergeometric_pdf.hpp index 2bfa4fb323..384c3de851 100644 --- a/deal.II/contrib/boost/include/boost/math/distributions/detail/hypergeometric_pdf.hpp +++ b/deal.II/contrib/boost/include/boost/math/distributions/detail/hypergeometric_pdf.hpp @@ -327,7 +327,7 @@ T hypergeometric_pdf_prime_loop_imp(hypergeometric_pdf_prime_loop_data& data, hy template inline T hypergeometric_pdf_prime_imp(unsigned x, unsigned r, unsigned n, unsigned N, const Policy&) { - hypergeometric_pdf_prime_loop_result_entry result = { 1 }; + hypergeometric_pdf_prime_loop_result_entry result = { 1, 0 }; hypergeometric_pdf_prime_loop_data data = { x, r, n, N, 0, prime(0) }; return hypergeometric_pdf_prime_loop_imp(data, result); } diff --git a/deal.II/contrib/boost/include/boost/math/distributions/fisher_f.hpp b/deal.II/contrib/boost/include/boost/math/distributions/fisher_f.hpp index 8e020b7d09..066714adb5 100644 --- a/deal.II/contrib/boost/include/boost/math/distributions/fisher_f.hpp +++ b/deal.II/contrib/boost/include/boost/math/distributions/fisher_f.hpp @@ -177,7 +177,9 @@ inline RealType quantile(const fisher_f_distribution& dist, co function, p, &error_result, Policy())) return error_result; - RealType x, y; + // With optimizations turned on, gcc wrongly warns about y being used + // uninitializated unless we initialize it to something: + RealType x, y(0); x = boost::math::ibeta_inv(df1 / 2, df2 / 2, p, &y, Policy()); diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/bessel.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/bessel.hpp index d9310638e5..1cf37de694 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/bessel.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/bessel.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -145,8 +146,13 @@ T cyl_bessel_j_imp(T v, T x, const bessel_no_int_tag& t, const Policy& pol) "Got v = %1%, but require v >= 0 or a negative integer: the result would be complex.", v, pol); - if((v >= 0) && ((x < 1) || (v > x * x / 4))) + if((v >= 0) && ((x < 1) || (v > x * x / 4) || (x < 5))) { + // + // This series will actually converge rapidly for all small + // x - say up to x < 20 - but the first few terms are large + // and divergent which leads to large errors :-( + // return bessel_j_small_z_series(v, x, pol); } @@ -159,13 +165,10 @@ template inline T cyl_bessel_j_imp(T v, T x, const bessel_maybe_int_tag&, const Policy& pol) { BOOST_MATH_STD_USING // ADL of std names. - typedef typename bessel_asymptotic_tag::type tag_type; - if((fabs(v) < 200) && (floor(v) == v)) + int ival = detail::iconv(v, pol); + if((abs(ival) < 200) && (0 == v - ival)) { - if(fabs(x) > asymptotic_bessel_j_limit(v, tag_type())) - return asymptotic_bessel_j_large_x_2(v, x); - else - return bessel_jn(iround(v, pol), x, pol); + return bessel_jn(ival/*iround(v, pol)*/, x, pol); } return cyl_bessel_j_imp(v, x, bessel_no_int_tag(), pol); } @@ -174,16 +177,7 @@ template inline T cyl_bessel_j_imp(int v, T x, const bessel_int_tag&, const Policy& pol) { BOOST_MATH_STD_USING - typedef typename bessel_asymptotic_tag::type tag_type; - if(fabs(x) > asymptotic_bessel_j_limit(abs(v), tag_type())) - { - T r = asymptotic_bessel_j_large_x_2(static_cast(abs(v)), x); - if((v < 0) && (v & 1)) - r = -r; - return r; - } - else - return bessel_jn(v, x, pol); + return bessel_jn(v, x, pol); } template diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/beta.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/beta.hpp index 6e66bcf95c..0e17af2424 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/beta.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/beta.hpp @@ -884,21 +884,36 @@ T ibeta_imp(T a, T b, T x, const Policy& pol, bool inv, bool normalised, T* p_de if(p_derivative) *p_derivative = -1; // value not set. + if((x < 0) || (x > 1)) + policies::raise_domain_error(function, "Parameter x outside the range [0,1] in the incomplete beta function (got x=%1%).", x, pol); + if(normalised) { + if(a < 0) + policies::raise_domain_error(function, "The argument a to the incomplete beta function must be >= zero (got a=%1%).", a, pol); + if(b < 0) + policies::raise_domain_error(function, "The argument b to the incomplete beta function must be >= zero (got b=%1%).", b, pol); // extend to a few very special cases: - if((a == 0) && (b != 0)) - return inv ? 0 : 1; + if(a == 0) + { + if(b == 0) + policies::raise_domain_error(function, "The arguments a and b to the incomplete beta function cannot both be zero, with x=%1%.", x, pol); + if(b > 0) + return inv ? 0 : 1; + } else if(b == 0) - return inv ? 1 : 0; + { + if(a > 0) + return inv ? 1 : 0; + } + } + else + { + if(a <= 0) + policies::raise_domain_error(function, "The argument a to the incomplete beta function must be greater than zero (got a=%1%).", a, pol); + if(b <= 0) + policies::raise_domain_error(function, "The argument b to the incomplete beta function must be greater than zero (got b=%1%).", b, pol); } - - if(a <= 0) - policies::raise_domain_error(function, "The argument a to the incomplete beta function must be greater than zero (got a=%1%).", a, pol); - if(b <= 0) - policies::raise_domain_error(function, "The argument b to the incomplete beta function must be greater than zero (got b=%1%).", b, pol); - if((x < 0) || (x > 1)) - policies::raise_domain_error(function, "Parameter x outside the range [0,1] in the incomplete beta function (got x=%1%).", x, pol); if(x == 0) { diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/cbrt.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/cbrt.hpp index acbc75039c..e6e5a2ad32 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/cbrt.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/cbrt.hpp @@ -10,31 +10,65 @@ #pragma once #endif -#include +#include +#include #include +#include +#include +#include +#include +#include namespace boost{ namespace math{ namespace detail { - template - struct cbrt_functor - { - cbrt_functor(T const& target) : a(target){} - std::tr1::tuple operator()(T const& z) - { - T sqr = z * z; - return std::tr1::make_tuple(sqr * z - a, 3 * sqr, 6 * z); - } - private: - T a; - }; +template +struct largest_cbrt_int_type +{ + typedef typename mpl::if_< + boost::is_convertible, + boost::uintmax_t, + unsigned int + >::type type; +}; template T cbrt_imp(T z, const Policy& pol) { BOOST_MATH_STD_USING + // + // cbrt approximation for z in the range [0.5,1] + // It's hard to say what number of terms gives the optimum + // trade off between precision and performance, this seems + // to be about the best for double precision. + // + // Maximum Deviation Found: 1.231e-006 + // Expected Error Term: -1.231e-006 + // Maximum Relative Change in Control Points: 5.982e-004 + // + static const T P[] = { + static_cast(0.37568269008611818), + static_cast(1.3304968705558024), + static_cast(-1.4897101632445036), + static_cast(1.2875573098219835), + static_cast(-0.6398703759826468), + static_cast(0.13584489959258635), + }; + static const T correction[] = { + static_cast(0.62996052494743658238360530363911), // 2^-2/3 + static_cast(0.79370052598409973737585281963615), // 2^-1/3 + static_cast(1), + static_cast(1.2599210498948731647672106072782), // 2^1/3 + static_cast(1.5874010519681994747517056392723), // 2^2/3 + }; + + if(!boost::math::isfinite(z)) + { + return policies::raise_domain_error("boost::math::cbrt<%1%>(%1%)", "Argument to function must be finite but got %1%.", z, pol); + } + int i_exp, sign(1); if(z < 0) { @@ -44,15 +78,73 @@ T cbrt_imp(T z, const Policy& pol) if(z == 0) return 0; - frexp(z, &i_exp); - T min = static_cast(ldexp(0.5, i_exp/3)); - T max = static_cast(ldexp(2.0, i_exp/3)); - T guess = static_cast(ldexp(1.0, i_exp/3)); - int digits = (policies::digits()) / 2; - boost::uintmax_t max_iter = policies::get_max_root_iterations(); - guess = sign * tools::halley_iterate(detail::cbrt_functor(z), guess, min, max, digits, max_iter); - policies::check_root_iterations("boost::math::cbrt<%1%>", max_iter, pol); - return guess; + T guess = frexp(z, &i_exp); + int original_i_exp = i_exp; // save for later + guess = tools::evaluate_polynomial(P, guess); + int i_exp3 = i_exp / 3; + + typedef typename largest_cbrt_int_type::type shift_type; + + if(abs(i_exp3) < std::numeric_limits::digits) + { + if(i_exp3 > 0) + guess *= shift_type(1u) << i_exp3; + else + guess /= shift_type(1u) << -i_exp3; + } + else + { + guess = ldexp(guess, i_exp3); + } + i_exp %= 3; + guess *= correction[i_exp + 2]; + // + // Now inline Halley iteration. + // We do this here rather than calling tools::halley_iterate since we can + // simplify the expressions algebraically, and don't need most of the error + // checking of the boilerplate version as we know in advance that the function + // is well behaved... + // + typedef typename policies::precision::type prec; + typedef typename mpl::divides >::type prec3; + typedef typename mpl::plus >::type new_prec; + typedef typename policies::normalise >::type new_policy; + // + // Epsilon calculation uses compile time arithmetic when it's available for type T, + // otherwise uses ldexp to calculate at runtime: + // + T eps = (new_prec::value > 3) ? policies::get_epsilon() : ldexp(T(1), -2 - tools::digits() / 3); + T diff; + + if(original_i_exp < std::numeric_limits::max_exponent - 3) + { + // + // Safe from overflow, use the fast method: + // + do + { + T g3 = guess * guess * guess; + diff = (g3 + z + z) / (g3 + g3 + z); + guess *= diff; + } + while(fabs(1 - diff) > eps); + } + else + { + // + // Either we're ready to overflow, or we can't tell because numeric_limits isn't + // available for type T: + // + do + { + T g2 = guess * guess; + diff = (g2 - z / guess) / (2 * guess + z / g2); + guess -= diff; + } + while((guess * eps) < fabs(diff)); + } + + return sign * guess; } } // namespace detail diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/detail/bessel_jn.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/detail/bessel_jn.hpp index d6ba8d81b5..b759f5408f 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/detail/bessel_jn.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/detail/bessel_jn.hpp @@ -13,6 +13,7 @@ #include #include #include +#include // Bessel function of the first kind of integer order // J_n(z) is the minimal solution @@ -57,6 +58,10 @@ T bessel_jn(int n, T x, const Policy& pol) return static_cast(0); } + typedef typename bessel_asymptotic_tag::type tag_type; + if(fabs(x) > asymptotic_bessel_j_limit(n, tag_type())) + return factor * asymptotic_bessel_j_large_x_2(n, x); + BOOST_ASSERT(n > 1); if (n < abs(x)) // forward recurrence { diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/detail/bessel_jy.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/detail/bessel_jy.hpp index a13b99852f..727631691e 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/detail/bessel_jy.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/detail/bessel_jy.hpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -30,6 +29,45 @@ namespace boost { namespace math { namespace detail { +// +// Simultaneous calculation of A&S 9.2.9 and 9.2.10 +// for use in A&S 9.2.5 and 9.2.6. +// This series is quick to evaluate, but divergent unless +// x is very large, in fact it's pretty hard to figure out +// with any degree of precision when this series actually +// *will* converge!! Consequently, we may just have to +// try it and see... +// +template +bool hankel_PQ(T v, T x, T* p, T* q, const Policy& ) +{ + BOOST_MATH_STD_USING + T tolerance = 2 * policies::get_epsilon(); + *p = 1; + *q = 0; + T k = 1; + T z8 = 8 * x; + T sq = 1; + T mu = 4 * v * v; + T term = 1; + bool ok = true; + do + { + term *= (mu - sq * sq) / (k * z8); + *q += term; + k += 1; + sq += 2; + T mult = (sq * sq - mu) / (k * z8); + ok = fabs(mult) < 0.5f; + term *= mult; + *p += term; + k += 1; + sq += 2; + } + while((fabs(term) > tolerance * *p) && ok); + return ok; +} + // Calculate Y(v, x) and Y(v+1, x) by Temme's method, see // Temme, Journal of Computational Physics, vol 21, 343 (1976) template @@ -76,7 +114,7 @@ int temme_jy(T v, T x, T* Y, T* Y1, const Policy& pol) T coef_mult = -x * x / 4; // series summation - tolerance = tools::epsilon(); + tolerance = policies::get_epsilon(); for (k = 1; k < policies::get_max_series_iterations(); k++) { f = (k * f + p + q) / (k*k - v2); @@ -115,7 +153,7 @@ int CF1_jy(T v, T x, T* fv, int* sign, const Policy& pol) // modified Lentz's method, see // Lentz, Applied Optics, vol 15, 668 (1976) - tolerance = 2 * tools::epsilon(); + tolerance = 2 * policies::get_epsilon();; tiny = sqrt(tools::min_value()); C = f = tiny; // b0 = 0, replace with tiny D = 0; @@ -140,59 +178,87 @@ int CF1_jy(T v, T x, T* fv, int* sign, const Policy& pol) return 0; } - -template -struct complex_trait -{ - typedef typename mpl::if_, - std::complex, sc::simple_complex >::type type; -}; - -// Evaluate continued fraction p + iq = (J' + iY') / (J + iY), see -// Press et al, Numerical Recipes in C, 2nd edition, 1992 +// +// This algorithm was originally written by Xiaogang Zhang +// using std::complex to perform the complex arithmetic. +// However, that turns out to 10x or more slower than using +// all real-valued arithmetic, so it's been rewritten using +// real values only. +// template int CF2_jy(T v, T x, T* p, T* q, const Policy& pol) { - BOOST_MATH_STD_USING - - typedef typename complex_trait::type complex_type; - - complex_type C, D, f, a, b, delta, one(1); - T tiny, zero(0); - unsigned long k; - - // |x| >= |v|, CF2_jy converges rapidly - // |x| -> 0, CF2_jy fails to converge - BOOST_ASSERT(fabs(x) > 1); - - // modified Lentz's method, complex numbers involved, see - // Lentz, Applied Optics, vol 15, 668 (1976) - T tolerance = 2 * tools::epsilon(); - tiny = sqrt(tools::min_value()); - C = f = complex_type(-0.5f/x, 1); - D = 0; - for (k = 1; k < policies::get_max_series_iterations(); k++) - { - a = (k - 0.5f)*(k - 0.5f) - v*v; - if (k == 1) - { - a *= complex_type(T(0), 1/x); - } - b = complex_type(2*x, T(2*k)); - C = b + a / C; - D = b + a * D; - if (C == zero) { C = tiny; } - if (D == zero) { D = tiny; } - D = one / D; - delta = C * D; - f *= delta; - if (abs(delta - one) < tolerance) { break; } - } - policies::check_series_iterations("boost::math::bessel_jy<%1%>(%1%,%1%) in CF2_jy", k, pol); - *p = real(f); - *q = imag(f); - - return 0; + BOOST_MATH_STD_USING + + T Cr, Ci, Dr, Di, fr, fi, a, br, bi, delta_r, delta_i, temp; + T tiny; + unsigned long k; + + // |x| >= |v|, CF2_jy converges rapidly + // |x| -> 0, CF2_jy fails to converge + BOOST_ASSERT(fabs(x) > 1); + + // modified Lentz's method, complex numbers involved, see + // Lentz, Applied Optics, vol 15, 668 (1976) + T tolerance = 2 * policies::get_epsilon(); + tiny = sqrt(tools::min_value()); + Cr = fr = -0.5f / x; + Ci = fi = 1; + //Dr = Di = 0; + T v2 = v * v; + a = (0.25f - v2) / x; // Note complex this one time only! + br = 2 * x; + bi = 2; + temp = Cr * Cr + 1; + Ci = bi + a * Cr / temp; + Cr = br + a / temp; + Dr = br; + Di = bi; + //std::cout << "C = " << Cr << " " << Ci << std::endl; + //std::cout << "D = " << Dr << " " << Di << std::endl; + if (fabs(Cr) + fabs(Ci) < tiny) { Cr = tiny; } + if (fabs(Dr) + fabs(Di) < tiny) { Dr = tiny; } + temp = Dr * Dr + Di * Di; + Dr = Dr / temp; + Di = -Di / temp; + delta_r = Cr * Dr - Ci * Di; + delta_i = Ci * Dr + Cr * Di; + temp = fr; + fr = temp * delta_r - fi * delta_i; + fi = temp * delta_i + fi * delta_r; + //std::cout << fr << " " << fi << std::endl; + for (k = 2; k < policies::get_max_series_iterations(); k++) + { + a = k - 0.5f; + a *= a; + a -= v2; + bi += 2; + temp = Cr * Cr + Ci * Ci; + Cr = br + a * Cr / temp; + Ci = bi - a * Ci / temp; + Dr = br + a * Dr; + Di = bi + a * Di; + //std::cout << "C = " << Cr << " " << Ci << std::endl; + //std::cout << "D = " << Dr << " " << Di << std::endl; + if (fabs(Cr) + fabs(Ci) < tiny) { Cr = tiny; } + if (fabs(Dr) + fabs(Di) < tiny) { Dr = tiny; } + temp = Dr * Dr + Di * Di; + Dr = Dr / temp; + Di = -Di / temp; + delta_r = Cr * Dr - Ci * Di; + delta_i = Ci * Dr + Cr * Di; + temp = fr; + fr = temp * delta_r - fi * delta_i; + fi = temp * delta_i + fi * delta_r; + if (fabs(delta_r - 1) + fabs(delta_i) < tolerance) + break; + //std::cout << fr << " " << fi << std::endl; + } + policies::check_series_iterations("boost::math::bessel_jy<%1%>(%1%,%1%) in CF2_jy", k, pol); + *p = fr; + *q = fi; + + return 0; } enum @@ -237,7 +303,22 @@ int bessel_jy(T v, T x, T* J, T* Y, int kind, const Policy& pol) // x is positive until reflection W = T(2) / (x * pi()); // Wronskian - if (x <= 2) // x in (0, 2] + if((x > 8) && (x < 1000) && hankel_PQ(v, x, &p, &q, pol)) + { + // + // Hankel approximation: note that this method works best when x + // is large, but in that case we end up calculating sines and cosines + // of large values, with horrendous resulting accuracy. It is fast though + // when it works.... + // + T chi = x - fmod(T(v / 2 + 0.25f), T(2)) * boost::math::constants::pi(); + T sc = sin(chi); + T cc = cos(chi); + chi = sqrt(2 / (boost::math::constants::pi() * x)); + Yv = chi * (p * sc + q * cc); + Jv = chi * (p * cc - q * sc); + } + else if (x <= 2) // x in (0, 2] { if(temme_jy(u, x, &Yu, &Yu1, pol)) // Temme series { diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/detail/iconv.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/detail/iconv.hpp new file mode 100644 index 0000000000..1d0dc94122 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/math/special_functions/detail/iconv.hpp @@ -0,0 +1,41 @@ +// Copyright (c) 2009 John Maddock +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MATH_ICONV_HPP +#define BOOST_MATH_ICONV_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +#include +#include + +namespace boost { namespace math { namespace detail{ + +template +inline int iconv_imp(T v, Policy const&, mpl::true_ const&) +{ + return static_cast(v); +} + +template +inline int iconv_imp(T v, Policy const& pol, mpl::false_ const&) +{ + return boost::math::iround(v); +} + +template +inline int iconv(T v, Policy const& pol) +{ + typedef typename boost::is_convertible::type tag_type; + return iconv_imp(v, pol, tag_type()); +} + + +}}} // namespaces + +#endif // BOOST_MATH_ICONV_HPP + diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/detail/igamma_inverse.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/detail/igamma_inverse.hpp index a62568647a..a7dce6f99b 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/detail/igamma_inverse.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/detail/igamma_inverse.hpp @@ -277,7 +277,7 @@ T find_inverse_gamma(T a, T p, T q, const Policy& pol, bool* p_has_10_digits) T ap1 = a + 1; if(w < 0.15f * ap1) { - // DiDonato and Morris Eq 35: + // DiDonato and Morris Eq 35: T v = log(p) + boost::math::lgamma(ap1, pol); T s = 1; z = exp((v + w) / a); @@ -286,7 +286,7 @@ T find_inverse_gamma(T a, T p, T q, const Policy& pol, bool* p_has_10_digits) z = exp((v + z - s) / a); s = boost::math::log1p(z / ap1 * (1 + z / (a + 2) * (1 + z / (a + 3)))); z = exp((v + z - s) / a); - BOOST_MATH_INSTRUMENT_VARIABLE(z); + BOOST_MATH_INSTRUMENT_VARIABLE(z); } if((z <= 0.01 * ap1) || (z > 0.7 * ap1)) diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/detail/t_distribution_inv.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/detail/t_distribution_inv.hpp index bd2e91f98e..a58935f4e7 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/detail/t_distribution_inv.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/detail/t_distribution_inv.hpp @@ -430,7 +430,7 @@ inline T fast_students_t_quantile_imp(T df, T p, const Policy& pol, const mpl::f // required precision so not so fast: // T probability = (p > 0.5) ? 1 - p : p; - T t, x, y; + T t, x, y(0); x = ibeta_inv(df / 2, T(0.5), 2 * probability, &y, pol); if(df * y > tools::max_value() * x) t = policies::raise_overflow_error("boost::math::students_t_quantile<%1%>(%1%,%1%)", 0, pol); diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/erf.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/erf.hpp index 23579cee58..5c23f49784 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/erf.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/erf.hpp @@ -199,14 +199,14 @@ T erf_imp(T z, bool invert, const Policy& pol, const mpl::int_<53>& t) // if(z < 1e-10) { - if(z == 0) - { - result = T(0); - } + if(z == 0) + { + result = T(0); + } else - { - result = static_cast(z * 1.125f + z * 0.003379167095512573896158903121545171688L); - } + { + result = static_cast(z * 1.125f + z * 0.003379167095512573896158903121545171688L); + } } else { diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/fpclassify.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/fpclassify.hpp index 0ecc576bfb..d3dc42b0ca 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/fpclassify.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/fpclassify.hpp @@ -106,7 +106,7 @@ inline bool is_nan_helper(T t, const boost::true_type&) } template -inline bool is_nan_helper(T t, const boost::false_type&) +inline bool is_nan_helper(T, const boost::false_type&) { return false; } @@ -390,6 +390,7 @@ namespace detail { template inline bool isinf_impl(T x, generic_tag const&) { + (void)x; // in case the compiler thinks that x is unused because std::numeric_limits::has_infinity is false return std::numeric_limits::has_infinity && ( x == std::numeric_limits::infinity() || x == -std::numeric_limits::infinity()); diff --git a/deal.II/contrib/boost/include/boost/math/special_functions/gamma.hpp b/deal.II/contrib/boost/include/boost/math/special_functions/gamma.hpp index abf8bbc110..f809fa6f40 100644 --- a/deal.II/contrib/boost/include/boost/math/special_functions/gamma.hpp +++ b/deal.II/contrib/boost/include/boost/math/special_functions/gamma.hpp @@ -1048,7 +1048,7 @@ T gamma_incomplete_imp(T a, T x, bool normalised, bool invert, *p_derivative = regularised_gamma_prefix(a, x, pol, lanczos_type()); break; } - } + } if(normalised && (result > 1)) result = 1; diff --git a/deal.II/contrib/boost/include/boost/math/tools/config.hpp b/deal.II/contrib/boost/include/boost/math/tools/config.hpp index daf2460241..e7eb4c23ff 100644 --- a/deal.II/contrib/boost/include/boost/math/tools/config.hpp +++ b/deal.II/contrib/boost/include/boost/math/tools/config.hpp @@ -153,7 +153,7 @@ // Tune performance options for specific compilers: // #ifdef BOOST_MSVC -# define BOOST_MATH_POLY_METHOD 3 +# define BOOST_MATH_POLY_METHOD 2 #elif defined(BOOST_INTEL) # define BOOST_MATH_POLY_METHOD 2 # define BOOST_MATH_RATIONAL_METHOD 2 diff --git a/deal.II/contrib/boost/include/boost/math/tr1.hpp b/deal.II/contrib/boost/include/boost/math/tr1.hpp index e9de6a54f2..0966f8bdfc 100644 --- a/deal.II/contrib/boost/include/boost/math/tr1.hpp +++ b/deal.II/contrib/boost/include/boost/math/tr1.hpp @@ -11,6 +11,8 @@ #pragma once #endif +#include // So we can check which std C lib we're using + #ifdef __cplusplus #include @@ -39,6 +41,15 @@ namespace boost{ namespace math{ namespace tr1{ extern "C"{ #ifndef BOOST_MATH_TR1_DECL #define BOOST_MATH_TR1_DECL #endif +// +// Set any throw specifications on the C99 extern "C" functions - these have to be +// the same as used in the std lib if any. +// +#if defined(__GLIBC__) && defined(__THROW) +# define BOOST_MATH_C99_THROW_SPEC __THROW +#else +# define BOOST_MATH_C99_THROW_SPEC +#endif // // Now set up the libraries to link against: @@ -109,260 +120,260 @@ typedef long double double_t; #endif // C99 Functions: -double BOOST_MATH_TR1_DECL acosh BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL acoshf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL acoshl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL acosh BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL acoshf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL acoshl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -double BOOST_MATH_TR1_DECL asinh BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL asinhf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL asinhl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL asinh BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL asinhf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL asinhl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -double BOOST_MATH_TR1_DECL atanh BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL atanhf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL atanhl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL atanh BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL atanhf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL atanhl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -double BOOST_MATH_TR1_DECL cbrt BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL cbrtf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL cbrtl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL cbrt BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL cbrtf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL cbrtl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -double BOOST_MATH_TR1_DECL copysign BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y); -float BOOST_MATH_TR1_DECL copysignf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y); -long double BOOST_MATH_TR1_DECL copysignl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); +double BOOST_MATH_TR1_DECL copysign BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL copysignf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL copysignl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; -double BOOST_MATH_TR1_DECL erf BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL erff BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL erfl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL erf BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL erff BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL erfl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -double BOOST_MATH_TR1_DECL erfc BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL erfcf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL erfcl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL erfc BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL erfcf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL erfcl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #if 0 -double BOOST_MATH_TR1_DECL exp2 BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL exp2f BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL exp2l BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL exp2 BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL exp2f BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL exp2l BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #endif -double BOOST_MATH_TR1_DECL boost_expm1 BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL boost_expm1f BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL boost_expm1l BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL boost_expm1 BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL boost_expm1f BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL boost_expm1l BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #if 0 -double BOOST_MATH_TR1_DECL fdim BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y); -float BOOST_MATH_TR1_DECL fdimf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y); -long double BOOST_MATH_TR1_DECL fdiml BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); -double BOOST_MATH_TR1_DECL fma BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y, double z); -float BOOST_MATH_TR1_DECL fmaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y, float z); -long double BOOST_MATH_TR1_DECL fmal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y, long double z); -#endif -double BOOST_MATH_TR1_DECL fmax BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y); -float BOOST_MATH_TR1_DECL fmaxf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y); -long double BOOST_MATH_TR1_DECL fmaxl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); - -double BOOST_MATH_TR1_DECL fmin BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y); -float BOOST_MATH_TR1_DECL fminf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y); -long double BOOST_MATH_TR1_DECL fminl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); - -double BOOST_MATH_TR1_DECL hypot BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y); -float BOOST_MATH_TR1_DECL hypotf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y); -long double BOOST_MATH_TR1_DECL hypotl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); +double BOOST_MATH_TR1_DECL fdim BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL fdimf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL fdiml BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; +double BOOST_MATH_TR1_DECL fma BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y, double z) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL fmaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y, float z) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL fmal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y, long double z) BOOST_MATH_C99_THROW_SPEC; +#endif +double BOOST_MATH_TR1_DECL fmax BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL fmaxf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL fmaxl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; + +double BOOST_MATH_TR1_DECL fmin BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL fminf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL fminl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; + +double BOOST_MATH_TR1_DECL hypot BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL hypotf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL hypotl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; #if 0 -int BOOST_MATH_TR1_DECL ilogb BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -int BOOST_MATH_TR1_DECL ilogbf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -int BOOST_MATH_TR1_DECL ilogbl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +int BOOST_MATH_TR1_DECL ilogb BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +int BOOST_MATH_TR1_DECL ilogbf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +int BOOST_MATH_TR1_DECL ilogbl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #endif -double BOOST_MATH_TR1_DECL lgamma BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL lgammaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL lgammal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL lgamma BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL lgammaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL lgammal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #ifdef BOOST_HAS_LONG_LONG #if 0 -::boost::long_long_type BOOST_MATH_TR1_DECL llrint BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -::boost::long_long_type BOOST_MATH_TR1_DECL llrintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -::boost::long_long_type BOOST_MATH_TR1_DECL llrintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +::boost::long_long_type BOOST_MATH_TR1_DECL llrint BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +::boost::long_long_type BOOST_MATH_TR1_DECL llrintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +::boost::long_long_type BOOST_MATH_TR1_DECL llrintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #endif -::boost::long_long_type BOOST_MATH_TR1_DECL llround BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -::boost::long_long_type BOOST_MATH_TR1_DECL llroundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -::boost::long_long_type BOOST_MATH_TR1_DECL llroundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +::boost::long_long_type BOOST_MATH_TR1_DECL llround BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +::boost::long_long_type BOOST_MATH_TR1_DECL llroundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +::boost::long_long_type BOOST_MATH_TR1_DECL llroundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #endif -double BOOST_MATH_TR1_DECL boost_log1p BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL boost_log1pf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL boost_log1pl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL boost_log1p BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL boost_log1pf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL boost_log1pl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #if 0 -double BOOST_MATH_TR1_DECL log2 BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL log2f BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL log2l BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); - -double BOOST_MATH_TR1_DECL logb BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL logbf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL logbl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); -long BOOST_MATH_TR1_DECL lrint BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -long BOOST_MATH_TR1_DECL lrintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long BOOST_MATH_TR1_DECL lrintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); -#endif -long BOOST_MATH_TR1_DECL lround BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -long BOOST_MATH_TR1_DECL lroundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long BOOST_MATH_TR1_DECL lroundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL log2 BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL log2f BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL log2l BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; + +double BOOST_MATH_TR1_DECL logb BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL logbf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL logbl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; +long BOOST_MATH_TR1_DECL lrint BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +long BOOST_MATH_TR1_DECL lrintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long BOOST_MATH_TR1_DECL lrintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; +#endif +long BOOST_MATH_TR1_DECL lround BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +long BOOST_MATH_TR1_DECL lroundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long BOOST_MATH_TR1_DECL lroundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #if 0 -double BOOST_MATH_TR1_DECL nan BOOST_PREVENT_MACRO_SUBSTITUTION(const char *str); -float BOOST_MATH_TR1_DECL nanf BOOST_PREVENT_MACRO_SUBSTITUTION(const char *str); -long double BOOST_MATH_TR1_DECL nanl BOOST_PREVENT_MACRO_SUBSTITUTION(const char *str); -double BOOST_MATH_TR1_DECL nearbyint BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL nearbyintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL nearbyintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); -#endif -double BOOST_MATH_TR1_DECL boost_nextafter BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y); -float BOOST_MATH_TR1_DECL boost_nextafterf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y); -long double BOOST_MATH_TR1_DECL boost_nextafterl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); - -double BOOST_MATH_TR1_DECL nexttoward BOOST_PREVENT_MACRO_SUBSTITUTION(double x, long double y); -float BOOST_MATH_TR1_DECL nexttowardf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, long double y); -long double BOOST_MATH_TR1_DECL nexttowardl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); +double BOOST_MATH_TR1_DECL nan BOOST_PREVENT_MACRO_SUBSTITUTION(const char *str) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL nanf BOOST_PREVENT_MACRO_SUBSTITUTION(const char *str) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL nanl BOOST_PREVENT_MACRO_SUBSTITUTION(const char *str) BOOST_MATH_C99_THROW_SPEC; +double BOOST_MATH_TR1_DECL nearbyint BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL nearbyintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL nearbyintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; +#endif +double BOOST_MATH_TR1_DECL boost_nextafter BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL boost_nextafterf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL boost_nextafterl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; + +double BOOST_MATH_TR1_DECL nexttoward BOOST_PREVENT_MACRO_SUBSTITUTION(double x, long double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL nexttowardf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, long double y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL nexttowardl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; #if 0 -double BOOST_MATH_TR1_DECL remainder BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y); -float BOOST_MATH_TR1_DECL remainderf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y); -long double BOOST_MATH_TR1_DECL remainderl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); -double BOOST_MATH_TR1_DECL remquo BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y, int *pquo); -float BOOST_MATH_TR1_DECL remquof BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y, int *pquo); -long double BOOST_MATH_TR1_DECL remquol BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y, int *pquo); -double BOOST_MATH_TR1_DECL rint BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL rintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL rintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); -#endif -double BOOST_MATH_TR1_DECL round BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL roundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL roundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL remainder BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL remainderf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL remainderl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; +double BOOST_MATH_TR1_DECL remquo BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y, int *pquo) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL remquof BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y, int *pquo) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL remquol BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y, int *pquo) BOOST_MATH_C99_THROW_SPEC; +double BOOST_MATH_TR1_DECL rint BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL rintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL rintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; +#endif +double BOOST_MATH_TR1_DECL round BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL roundf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL roundl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; #if 0 -double BOOST_MATH_TR1_DECL scalbln BOOST_PREVENT_MACRO_SUBSTITUTION(double x, long ex); -float BOOST_MATH_TR1_DECL scalblnf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, long ex); -long double BOOST_MATH_TR1_DECL scalblnl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long ex); -double BOOST_MATH_TR1_DECL scalbn BOOST_PREVENT_MACRO_SUBSTITUTION(double x, int ex); -float BOOST_MATH_TR1_DECL scalbnf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, int ex); -long double BOOST_MATH_TR1_DECL scalbnl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, int ex); +double BOOST_MATH_TR1_DECL scalbln BOOST_PREVENT_MACRO_SUBSTITUTION(double x, long ex) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL scalblnf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, long ex) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL scalblnl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long ex) BOOST_MATH_C99_THROW_SPEC; +double BOOST_MATH_TR1_DECL scalbn BOOST_PREVENT_MACRO_SUBSTITUTION(double x, int ex) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL scalbnf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, int ex) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL scalbnl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, int ex) BOOST_MATH_C99_THROW_SPEC; #endif -double BOOST_MATH_TR1_DECL tgamma BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL tgammaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL tgammal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL tgamma BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL tgammaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL tgammal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; -double BOOST_MATH_TR1_DECL trunc BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL truncf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL truncl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL trunc BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL truncf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL truncl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.1] associated Laguerre polynomials: -double BOOST_MATH_TR1_DECL assoc_laguerre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, unsigned m, double x); -float BOOST_MATH_TR1_DECL assoc_laguerref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, unsigned m, float x); -long double BOOST_MATH_TR1_DECL assoc_laguerrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, unsigned m, long double x); +double BOOST_MATH_TR1_DECL assoc_laguerre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, unsigned m, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL assoc_laguerref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, unsigned m, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL assoc_laguerrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, unsigned m, long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.2] associated Legendre functions: -double BOOST_MATH_TR1_DECL assoc_legendre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, double x); -float BOOST_MATH_TR1_DECL assoc_legendref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, float x); -long double BOOST_MATH_TR1_DECL assoc_legendrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, long double x); +double BOOST_MATH_TR1_DECL assoc_legendre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL assoc_legendref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL assoc_legendrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.3] beta function: -double BOOST_MATH_TR1_DECL beta BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y); -float BOOST_MATH_TR1_DECL betaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y); -long double BOOST_MATH_TR1_DECL betal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y); +double BOOST_MATH_TR1_DECL beta BOOST_PREVENT_MACRO_SUBSTITUTION(double x, double y) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL betaf BOOST_PREVENT_MACRO_SUBSTITUTION(float x, float y) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL betal BOOST_PREVENT_MACRO_SUBSTITUTION(long double x, long double y) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.4] (complete) elliptic integral of the first kind: -double BOOST_MATH_TR1_DECL comp_ellint_1 BOOST_PREVENT_MACRO_SUBSTITUTION(double k); -float BOOST_MATH_TR1_DECL comp_ellint_1f BOOST_PREVENT_MACRO_SUBSTITUTION(float k); -long double BOOST_MATH_TR1_DECL comp_ellint_1l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k); +double BOOST_MATH_TR1_DECL comp_ellint_1 BOOST_PREVENT_MACRO_SUBSTITUTION(double k) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL comp_ellint_1f BOOST_PREVENT_MACRO_SUBSTITUTION(float k) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL comp_ellint_1l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.5] (complete) elliptic integral of the second kind: -double BOOST_MATH_TR1_DECL comp_ellint_2 BOOST_PREVENT_MACRO_SUBSTITUTION(double k); -float BOOST_MATH_TR1_DECL comp_ellint_2f BOOST_PREVENT_MACRO_SUBSTITUTION(float k); -long double BOOST_MATH_TR1_DECL comp_ellint_2l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k); +double BOOST_MATH_TR1_DECL comp_ellint_2 BOOST_PREVENT_MACRO_SUBSTITUTION(double k) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL comp_ellint_2f BOOST_PREVENT_MACRO_SUBSTITUTION(float k) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL comp_ellint_2l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.6] (complete) elliptic integral of the third kind: -double BOOST_MATH_TR1_DECL comp_ellint_3 BOOST_PREVENT_MACRO_SUBSTITUTION(double k, double nu); -float BOOST_MATH_TR1_DECL comp_ellint_3f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float nu); -long double BOOST_MATH_TR1_DECL comp_ellint_3l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k, long double nu); +double BOOST_MATH_TR1_DECL comp_ellint_3 BOOST_PREVENT_MACRO_SUBSTITUTION(double k, double nu) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL comp_ellint_3f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float nu) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL comp_ellint_3l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k, long double nu) BOOST_MATH_C99_THROW_SPEC; #if 0 // [5.2.1.7] confluent hypergeometric functions: -double BOOST_MATH_TR1_DECL conf_hyperg BOOST_PREVENT_MACRO_SUBSTITUTION(double a, double c, double x); -float BOOST_MATH_TR1_DECL conf_hypergf BOOST_PREVENT_MACRO_SUBSTITUTION(float a, float c, float x); -long double BOOST_MATH_TR1_DECL conf_hypergl BOOST_PREVENT_MACRO_SUBSTITUTION(long double a, long double c, long double x); +double BOOST_MATH_TR1_DECL conf_hyperg BOOST_PREVENT_MACRO_SUBSTITUTION(double a, double c, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL conf_hypergf BOOST_PREVENT_MACRO_SUBSTITUTION(float a, float c, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL conf_hypergl BOOST_PREVENT_MACRO_SUBSTITUTION(long double a, long double c, long double x) BOOST_MATH_C99_THROW_SPEC; #endif // [5.2.1.8] regular modified cylindrical Bessel functions: -double BOOST_MATH_TR1_DECL cyl_bessel_i BOOST_PREVENT_MACRO_SUBSTITUTION(double nu, double x); -float BOOST_MATH_TR1_DECL cyl_bessel_if BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x); -long double BOOST_MATH_TR1_DECL cyl_bessel_il BOOST_PREVENT_MACRO_SUBSTITUTION(long double nu, long double x); +double BOOST_MATH_TR1_DECL cyl_bessel_i BOOST_PREVENT_MACRO_SUBSTITUTION(double nu, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL cyl_bessel_if BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL cyl_bessel_il BOOST_PREVENT_MACRO_SUBSTITUTION(long double nu, long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.9] cylindrical Bessel functions (of the first kind): -double BOOST_MATH_TR1_DECL cyl_bessel_j BOOST_PREVENT_MACRO_SUBSTITUTION(double nu, double x); -float BOOST_MATH_TR1_DECL cyl_bessel_jf BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x); -long double BOOST_MATH_TR1_DECL cyl_bessel_jl BOOST_PREVENT_MACRO_SUBSTITUTION(long double nu, long double x); +double BOOST_MATH_TR1_DECL cyl_bessel_j BOOST_PREVENT_MACRO_SUBSTITUTION(double nu, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL cyl_bessel_jf BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL cyl_bessel_jl BOOST_PREVENT_MACRO_SUBSTITUTION(long double nu, long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.10] irregular modified cylindrical Bessel functions: -double BOOST_MATH_TR1_DECL cyl_bessel_k BOOST_PREVENT_MACRO_SUBSTITUTION(double nu, double x); -float BOOST_MATH_TR1_DECL cyl_bessel_kf BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x); -long double BOOST_MATH_TR1_DECL cyl_bessel_kl BOOST_PREVENT_MACRO_SUBSTITUTION(long double nu, long double x); +double BOOST_MATH_TR1_DECL cyl_bessel_k BOOST_PREVENT_MACRO_SUBSTITUTION(double nu, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL cyl_bessel_kf BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL cyl_bessel_kl BOOST_PREVENT_MACRO_SUBSTITUTION(long double nu, long double x) BOOST_MATH_C99_THROW_SPEC; -// [5.2.1.11] cylindrical Neumann functions; +// [5.2.1.11] cylindrical Neumann functions BOOST_MATH_C99_THROW_SPEC; // cylindrical Bessel functions (of the second kind): -double BOOST_MATH_TR1_DECL cyl_neumann BOOST_PREVENT_MACRO_SUBSTITUTION(double nu, double x); -float BOOST_MATH_TR1_DECL cyl_neumannf BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x); -long double BOOST_MATH_TR1_DECL cyl_neumannl BOOST_PREVENT_MACRO_SUBSTITUTION(long double nu, long double x); +double BOOST_MATH_TR1_DECL cyl_neumann BOOST_PREVENT_MACRO_SUBSTITUTION(double nu, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL cyl_neumannf BOOST_PREVENT_MACRO_SUBSTITUTION(float nu, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL cyl_neumannl BOOST_PREVENT_MACRO_SUBSTITUTION(long double nu, long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.12] (incomplete) elliptic integral of the first kind: -double BOOST_MATH_TR1_DECL ellint_1 BOOST_PREVENT_MACRO_SUBSTITUTION(double k, double phi); -float BOOST_MATH_TR1_DECL ellint_1f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float phi); -long double BOOST_MATH_TR1_DECL ellint_1l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k, long double phi); +double BOOST_MATH_TR1_DECL ellint_1 BOOST_PREVENT_MACRO_SUBSTITUTION(double k, double phi) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL ellint_1f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float phi) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL ellint_1l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k, long double phi) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.13] (incomplete) elliptic integral of the second kind: -double BOOST_MATH_TR1_DECL ellint_2 BOOST_PREVENT_MACRO_SUBSTITUTION(double k, double phi); -float BOOST_MATH_TR1_DECL ellint_2f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float phi); -long double BOOST_MATH_TR1_DECL ellint_2l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k, long double phi); +double BOOST_MATH_TR1_DECL ellint_2 BOOST_PREVENT_MACRO_SUBSTITUTION(double k, double phi) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL ellint_2f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float phi) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL ellint_2l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k, long double phi) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.14] (incomplete) elliptic integral of the third kind: -double BOOST_MATH_TR1_DECL ellint_3 BOOST_PREVENT_MACRO_SUBSTITUTION(double k, double nu, double phi); -float BOOST_MATH_TR1_DECL ellint_3f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float nu, float phi); -long double BOOST_MATH_TR1_DECL ellint_3l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k, long double nu, long double phi); +double BOOST_MATH_TR1_DECL ellint_3 BOOST_PREVENT_MACRO_SUBSTITUTION(double k, double nu, double phi) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL ellint_3f BOOST_PREVENT_MACRO_SUBSTITUTION(float k, float nu, float phi) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL ellint_3l BOOST_PREVENT_MACRO_SUBSTITUTION(long double k, long double nu, long double phi) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.15] exponential integral: -double BOOST_MATH_TR1_DECL expint BOOST_PREVENT_MACRO_SUBSTITUTION(double x); -float BOOST_MATH_TR1_DECL expintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x); -long double BOOST_MATH_TR1_DECL expintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x); +double BOOST_MATH_TR1_DECL expint BOOST_PREVENT_MACRO_SUBSTITUTION(double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL expintf BOOST_PREVENT_MACRO_SUBSTITUTION(float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL expintl BOOST_PREVENT_MACRO_SUBSTITUTION(long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.16] Hermite polynomials: -double BOOST_MATH_TR1_DECL hermite BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x); -float BOOST_MATH_TR1_DECL hermitef BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x); -long double BOOST_MATH_TR1_DECL hermitel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, long double x); +double BOOST_MATH_TR1_DECL hermite BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL hermitef BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL hermitel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, long double x) BOOST_MATH_C99_THROW_SPEC; #if 0 // [5.2.1.17] hypergeometric functions: -double BOOST_MATH_TR1_DECL hyperg BOOST_PREVENT_MACRO_SUBSTITUTION(double a, double b, double c, double x); -float BOOST_MATH_TR1_DECL hypergf BOOST_PREVENT_MACRO_SUBSTITUTION(float a, float b, float c, float x); +double BOOST_MATH_TR1_DECL hyperg BOOST_PREVENT_MACRO_SUBSTITUTION(double a, double b, double c, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL hypergf BOOST_PREVENT_MACRO_SUBSTITUTION(float a, float b, float c, float x) BOOST_MATH_C99_THROW_SPEC; long double BOOST_MATH_TR1_DECL hypergl BOOST_PREVENT_MACRO_SUBSTITUTION(long double a, long double b, long double c, -long double x); +long double x) BOOST_MATH_C99_THROW_SPEC; #endif // [5.2.1.18] Laguerre polynomials: -double BOOST_MATH_TR1_DECL laguerre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x); -float BOOST_MATH_TR1_DECL laguerref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x); -long double BOOST_MATH_TR1_DECL laguerrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, long double x); +double BOOST_MATH_TR1_DECL laguerre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL laguerref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL laguerrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.19] Legendre polynomials: -double BOOST_MATH_TR1_DECL legendre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, double x); -float BOOST_MATH_TR1_DECL legendref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, float x); -long double BOOST_MATH_TR1_DECL legendrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, long double x); +double BOOST_MATH_TR1_DECL legendre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL legendref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL legendrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.20] Riemann zeta function: -double BOOST_MATH_TR1_DECL riemann_zeta BOOST_PREVENT_MACRO_SUBSTITUTION(double); -float BOOST_MATH_TR1_DECL riemann_zetaf BOOST_PREVENT_MACRO_SUBSTITUTION(float); -long double BOOST_MATH_TR1_DECL riemann_zetal BOOST_PREVENT_MACRO_SUBSTITUTION(long double); +double BOOST_MATH_TR1_DECL riemann_zeta BOOST_PREVENT_MACRO_SUBSTITUTION(double) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL riemann_zetaf BOOST_PREVENT_MACRO_SUBSTITUTION(float) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL riemann_zetal BOOST_PREVENT_MACRO_SUBSTITUTION(long double) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.21] spherical Bessel functions (of the first kind): -double BOOST_MATH_TR1_DECL sph_bessel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x); -float BOOST_MATH_TR1_DECL sph_besself BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x); -long double BOOST_MATH_TR1_DECL sph_bessell BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, long double x); +double BOOST_MATH_TR1_DECL sph_bessel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL sph_besself BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL sph_bessell BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, long double x) BOOST_MATH_C99_THROW_SPEC; // [5.2.1.22] spherical associated Legendre functions: -double BOOST_MATH_TR1_DECL sph_legendre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, double theta); -float BOOST_MATH_TR1_DECL sph_legendref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, float theta); -long double BOOST_MATH_TR1_DECL sph_legendrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, long double theta); +double BOOST_MATH_TR1_DECL sph_legendre BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, double theta) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL sph_legendref BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, float theta) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL sph_legendrel BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned l, unsigned m, long double theta) BOOST_MATH_C99_THROW_SPEC; -// [5.2.1.23] spherical Neumann functions; +// [5.2.1.23] spherical Neumann functions BOOST_MATH_C99_THROW_SPEC; // spherical Bessel functions (of the second kind): -double BOOST_MATH_TR1_DECL sph_neumann BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x); -float BOOST_MATH_TR1_DECL sph_neumannf BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x); -long double BOOST_MATH_TR1_DECL sph_neumannl BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, long double x); +double BOOST_MATH_TR1_DECL sph_neumann BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, double x) BOOST_MATH_C99_THROW_SPEC; +float BOOST_MATH_TR1_DECL sph_neumannf BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, float x) BOOST_MATH_C99_THROW_SPEC; +long double BOOST_MATH_TR1_DECL sph_neumannl BOOST_PREVENT_MACRO_SUBSTITUTION(unsigned n, long double x) BOOST_MATH_C99_THROW_SPEC; #ifdef __cplusplus diff --git a/deal.II/contrib/boost/include/boost/memory_order.hpp b/deal.II/contrib/boost/include/boost/memory_order.hpp index 2524e8aa43..4945af623b 100644 --- a/deal.II/contrib/boost/include/boost/memory_order.hpp +++ b/deal.II/contrib/boost/include/boost/memory_order.hpp @@ -11,7 +11,7 @@ // // Defines enum boost::memory_order per the C++0x working draft // -// Copyright (c) 2008 Peter Dimov +// Copyright (c) 2008, 2009 Peter Dimov // // Distributed under the Boost Software License, Version 1.0. // See accompanying file LICENSE_1_0.txt or copy at @@ -21,13 +21,31 @@ namespace boost { +// +// Enum values are chosen so that code that needs to insert +// a trailing fence for acquire semantics can use a single +// test such as: +// +// if( mo & memory_order_acquire ) { ...fence... } +// +// For leading fences one can use: +// +// if( mo & memory_order_release ) { ...fence... } +// +// Architectures such as Alpha that need a fence on consume +// can use: +// +// if( mo & ( memory_order_acquire | memory_order_consume ) ) { ...fence... } +// + enum memory_order { memory_order_relaxed = 0, memory_order_acquire = 1, memory_order_release = 2, memory_order_acq_rel = 3, // acquire | release - memory_order_seq_cst = 7 // acq_rel | 4 + memory_order_seq_cst = 7, // acq_rel | 4 + memory_order_consume = 8 }; } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp b/deal.II/contrib/boost/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp index 3e7bfba1ea..daec4b8a8e 100644 --- a/deal.II/contrib/boost/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp +++ b/deal.II/contrib/boost/include/boost/mpl/aux_/preprocessed/gcc/template_arity.hpp @@ -6,11 +6,10 @@ // http://www.boost.org/LICENSE_1_0.txt) // -// Preprocessed version of "boost/mpl/aux_/template_arity.hpp" header +// *Preprocessed* version of the main "template_arity.hpp" header // -- DO NOT modify by hand! namespace boost { namespace mpl { namespace aux { - template< int N > struct arity_tag { typedef char (&type)[N + 1]; @@ -23,7 +22,6 @@ struct max_arity { BOOST_STATIC_CONSTANT(int, value = ( C6 > 0 ? C6 : ( C5 > 0 ? C5 : ( C4 > 0 ? C4 : ( C3 > 0 ? C3 : ( C2 > 0 ? C2 : ( C1 > 0 ? C1 : -1 ) ) ) ) ) ) - ); }; @@ -83,7 +81,7 @@ template< typename F, int N > struct template_arity_impl { BOOST_STATIC_CONSTANT(int, value = - sizeof(arity_helper(type_wrapper(), arity_tag())) - 1 + sizeof(::boost::mpl::aux::arity_helper(type_wrapper(), arity_tag())) - 1 ); }; @@ -92,9 +90,7 @@ struct template_arity { BOOST_STATIC_CONSTANT(int, value = ( max_arity< template_arity_impl< F,1 >::value, template_arity_impl< F,2 >::value, template_arity_impl< F,3 >::value, template_arity_impl< F,4 >::value, template_arity_impl< F,5 >::value, template_arity_impl< F,6 >::value >::value - )); - typedef mpl::int_ type; }; diff --git a/deal.II/contrib/boost/include/boost/mpl/aux_/template_arity.hpp b/deal.II/contrib/boost/include/boost/mpl/aux_/template_arity.hpp index 47e4eeb54f..ed26ea24bb 100644 --- a/deal.II/contrib/boost/include/boost/mpl/aux_/template_arity.hpp +++ b/deal.II/contrib/boost/include/boost/mpl/aux_/template_arity.hpp @@ -14,9 +14,9 @@ // // See http://www.boost.org/libs/mpl for documentation. -// $Id: template_arity.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ -// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ -// $Revision: 49267 $ +// $Id: template_arity.hpp 61584 2010-04-26 18:48:26Z agurtovoy $ +// $Date: 2010-04-26 14:48:26 -0400 (Mon, 26 Apr 2010) $ +// $Revision: 61584 $ #include #include @@ -98,7 +98,7 @@ template< typename F, BOOST_MPL_AUX_NTTP_DECL(int, N) > struct template_arity_impl { BOOST_STATIC_CONSTANT(int, value = - sizeof(arity_helper(type_wrapper(),arity_tag())) - 1 + sizeof(::boost::mpl::aux::arity_helper(type_wrapper(),arity_tag())) - 1 ); }; diff --git a/deal.II/contrib/boost/include/boost/mpl/zip_view.hpp b/deal.II/contrib/boost/include/boost/mpl/zip_view.hpp index 7e8e1ac716..fc5225f5f6 100644 --- a/deal.II/contrib/boost/include/boost/mpl/zip_view.hpp +++ b/deal.II/contrib/boost/include/boost/mpl/zip_view.hpp @@ -2,7 +2,7 @@ #ifndef BOOST_MPL_ZIP_VIEW_HPP_INCLUDED #define BOOST_MPL_ZIP_VIEW_HPP_INCLUDED -// Copyright Aleksey Gurtovoy 2000-2002 +// Copyright Aleksey Gurtovoy 2000-2010 // Copyright David Abrahams 2000-2002 // // Distributed under the Boost Software License, Version 1.0. @@ -11,9 +11,9 @@ // // See http://www.boost.org/libs/mpl for documentation. -// $Id: zip_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ -// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ -// $Revision: 49267 $ +// $Id: zip_view.hpp 61591 2010-04-26 21:31:09Z agurtovoy $ +// $Date: 2010-04-26 17:31:09 -0400 (Mon, 26 Apr 2010) $ +// $Revision: 61591 $ #include #include @@ -53,6 +53,7 @@ struct zip_view public: typedef nested_begin_end_tag tag; + typedef zip_view type; typedef zip_iterator begin; typedef zip_iterator end; }; diff --git a/deal.II/contrib/boost/include/boost/multi_index/detail/serialization_version.hpp b/deal.II/contrib/boost/include/boost/multi_index/detail/serialization_version.hpp new file mode 100644 index 0000000000..03bf24e088 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/multi_index/detail/serialization_version.hpp @@ -0,0 +1,75 @@ +/* Copyright 2003-2010 Joaquin M Lopez Munoz. + * Distributed under the Boost Software License, Version 1.0. + * (See accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * See http://www.boost.org/libs/multi_index for library home page. + */ + +#ifndef BOOST_MULTI_INDEX_DETAIL_SERIALIZATION_VERSION_HPP +#define BOOST_MULTI_INDEX_DETAIL_SERIALIZATION_VERSION_HPP + +#if defined(_MSC_VER)&&(_MSC_VER>=1200) +#pragma once +#endif + +#include /* keep it first to prevent nasty warns in MSVC */ +#include +#include + +namespace boost{ + +namespace multi_index{ + +namespace detail{ + +/* Helper class for storing and retrieving a given type serialization class + * version while avoiding saving the number multiple times in the same + * archive. + * Behavior undefined if template partial specialization is not supported. + */ + +template +struct serialization_version +{ + serialization_version(): + value(boost::serialization::version::value){} + + serialization_version& operator=(unsigned int x){value=x;return *this;}; + + operator unsigned int()const{return value;} + +private: + friend class boost::serialization::access; + + BOOST_SERIALIZATION_SPLIT_MEMBER() + + template + void save(Archive&,const unsigned int)const{} + + template + void load(Archive&,const unsigned int version) + { + this->value=version; + } + + unsigned int value; +}; + +} /* namespace multi_index::detail */ + +} /* namespace multi_index */ + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) +namespace serialization { +template +struct version > +{ + BOOST_STATIC_CONSTANT(unsigned int,value=version::value); +}; +} /* namespace serialization */ +#endif + +} /* namespace boost */ + +#endif diff --git a/deal.II/contrib/boost/include/boost/multi_index_container.hpp b/deal.II/contrib/boost/include/boost/multi_index_container.hpp index 7b4815fbca..2070b15970 100644 --- a/deal.II/contrib/boost/include/boost/multi_index_container.hpp +++ b/deal.II/contrib/boost/include/boost/multi_index_container.hpp @@ -1,6 +1,6 @@ /* Multiply indexed container. * - * Copyright 2003-2009 Joaquin M Lopez Munoz. + * Copyright 2003-2010 Joaquin M Lopez Munoz. * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) @@ -44,6 +44,7 @@ #if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION) #include +#include #include #include #include @@ -634,16 +635,20 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS: { #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) - const serialization::collection_size_type s(size_()); + const serialization::collection_size_type s(size_()); + const detail::serialization_version value_version; ar< value_version; if(version<1){ std::size_t sz; ar>>serialization::make_nvp("count",sz); @@ -669,15 +675,22 @@ BOOST_MULTI_INDEX_PROTECTED_IF_MEMBER_TEMPLATE_FRIENDS: else{ ar>>serialization::make_nvp("count",s); } + if(version<2){ + value_version=0; + } + else{ + ar>>serialization::make_nvp("value_version",value_version); + } #else - std::size_t s; + std::size_t s; + unsigned int value_version=0; ar>>serialization::make_nvp("count",s); #endif index_loader_type lm(bfm_allocator::member,s); for(std::size_t n=0;n value("item",ar,version); + detail::archive_constructed value("item",ar,value_version); std::pair p=insert_( value.get(),super::end().get_node()); if(!p.second)throw_exception( @@ -1100,8 +1113,9 @@ void swap( #if !defined(BOOST_MULTI_INDEX_DISABLE_SERIALIZATION)&&\ !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) -/* Serialization class version bump as we now serialize the size - * through boost::serialization::collection_size_type. +/* class version = 1 : we now serialize the size through + * boost::serialization::collection_size_type. + * class version = 2 : proper use of {save|load}_construct_data. */ namespace serialization { @@ -1110,7 +1124,7 @@ struct version< boost::multi_index_container > { - BOOST_STATIC_CONSTANT(unsigned int,value=1); + BOOST_STATIC_CONSTANT(unsigned int,value=2); }; } /* namespace serialization */ #endif diff --git a/deal.II/contrib/boost/include/boost/nondet_random.hpp b/deal.II/contrib/boost/include/boost/nondet_random.hpp index 913246cd4b..bbe5bce0d0 100644 --- a/deal.II/contrib/boost/include/boost/nondet_random.hpp +++ b/deal.II/contrib/boost/include/boost/nondet_random.hpp @@ -5,7 +5,7 @@ * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * - * $Id: nondet_random.hpp 49314 2008-10-13 09:00:03Z johnmaddock $ + * $Id: nondet_random.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2000-02-18 Portability fixes (thanks to Beman Dawes) @@ -23,10 +23,66 @@ #include #include // noncopyable #include // compile-time integral limits +#include namespace boost { -// use some OS service to generate non-deterministic random numbers +/** + * Class \random_device models a \nondeterministic_random_number_generator. + * It uses one or more implementation-defined stochastic processes to + * generate a sequence of uniformly distributed non-deterministic random + * numbers. For those environments where a non-deterministic random number + * generator is not available, class random_device must not be implemented. See + * + * @blockquote + * "Randomness Recommendations for Security", D. Eastlake, S. Crocker, + * J. Schiller, Network Working Group, RFC 1750, December 1994 + * @endblockquote + * + * for further discussions. + * + * @xmlnote + * Some operating systems abstract the computer hardware enough + * to make it difficult to non-intrusively monitor stochastic processes. + * However, several do provide a special device for exactly this purpose. + * It seems to be impossible to emulate the functionality using Standard + * C++ only, so users should be aware that this class may not be available + * on all platforms. + * @endxmlnote + * + * Implementation Note for Linux + * + * On the Linux operating system, token is interpreted as a filesystem + * path. It is assumed that this path denotes an operating system + * pseudo-device which generates a stream of non-deterministic random + * numbers. The pseudo-device should never signal an error or end-of-file. + * Otherwise, @c std::ios_base::failure is thrown. By default, + * \random_device uses the /dev/urandom pseudo-device to retrieve + * the random numbers. Another option would be to specify the /dev/random + * pseudo-device, which blocks on reads if the entropy pool has no more + * random bits available. + * + * Inplementation Note for Windows + * + * On the Windows operating system, token is interpreted as the name + * of a cryptographic service provider. By default \random_device uses + * MS_DEF_PROV. + * + * Performance + * + * The test program + * nondet_random_speed.cpp measures the execution times of the + * nondet_random.hpp implementation of the above algorithms in a tight + * loop. The performance has been evaluated on a Pentium Pro 200 MHz + * with gcc 2.95.2, Linux 2.2.13, glibc 2.1.2. + * + * + * + * + *
classtime per invocation [usec]
@xmlonly random_device @endxmlonly 92.0
+ * + * The measurement error is estimated at +/- 1 usec. + */ class random_device : private noncopyable { public: @@ -35,15 +91,37 @@ public: BOOST_STATIC_CONSTANT(result_type, min_value = integer_traits::const_min); BOOST_STATIC_CONSTANT(result_type, max_value = integer_traits::const_max); + /** + * Returns: The smallest value that the \random_device can produce. + */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return min_value; } + /** + * Returns: The largest value that the \random_device can produce. + */ result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return max_value; } - explicit random_device(const std::string& token = default_token); - ~random_device(); - double entropy() const; - unsigned int operator()(); + /** + * Constructs a @c random_device, optionally using the given token as an + * access specification (for example, a URL) to some implementation-defined + * service for monitoring a stochastic process. + */ + BOOST_RANDOM_DECL explicit random_device(const std::string& token = default_token); + BOOST_RANDOM_DECL ~random_device(); + /** + * Returns: An entropy estimate for the random numbers returned by + * operator(), in the range min() to log2( max()+1). A deterministic + * random number generator (e.g. a pseudo-random number engine) + * has entropy 0. + * + * Throws: Nothing. + */ + BOOST_RANDOM_DECL double entropy() const; + /** + * Returns: A random value in the range [min, max] + */ + BOOST_RANDOM_DECL unsigned int operator()(); private: - static const char * const default_token; + BOOST_RANDOM_DECL static const char * const default_token; /* * std:5.3.5/5 [expr.delete]: "If the object being deleted has incomplete diff --git a/deal.II/contrib/boost/include/boost/parameter/aux_/arg_list.hpp b/deal.II/contrib/boost/include/boost/parameter/aux_/arg_list.hpp index d70205f0b1..5c0e00bc95 100644 --- a/deal.II/contrib/boost/include/boost/parameter/aux_/arg_list.hpp +++ b/deal.II/contrib/boost/include/boost/parameter/aux_/arg_list.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include namespace boost { namespace parameter { diff --git a/deal.II/contrib/boost/include/boost/pending/container_traits.hpp b/deal.II/contrib/boost/include/boost/pending/container_traits.hpp index 571eedb1c1..72651d5877 100644 --- a/deal.II/contrib/boost/include/boost/pending/container_traits.hpp +++ b/deal.II/contrib/boost/include/boost/pending/container_traits.hpp @@ -1,4 +1,6 @@ // (C) Copyright Jeremy Siek 2004 +// (C) Copyright Thomas Claveirole 2010 +// (C) Copyright Ignacy Gawedzki 2010 // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) @@ -17,19 +19,8 @@ #include #include #include - -#if !defined BOOST_NO_HASH -# ifdef BOOST_HASH_SET_HEADER -# include BOOST_HASH_SET_HEADER -# else -# include -# endif -# ifdef BOOST_HASH_MAP_HEADER -# include BOOST_HASH_MAP_HEADER -# else -# include -# endif -#endif +#include +#include #if !defined BOOST_NO_SLIST # ifdef BOOST_SLIST_HEADER @@ -273,34 +264,87 @@ namespace boost { namespace graph_detail { // hash_set, hash_map + struct unordered_set_tag : + virtual public simple_associative_container_tag, + virtual public unique_associative_container_tag + { }; + + struct unordered_multiset_tag : + virtual public simple_associative_container_tag, + virtual public multiple_associative_container_tag + { }; + + + struct unordered_map_tag : + virtual public pair_associative_container_tag, + virtual public unique_associative_container_tag + { }; + + struct unordered_multimap_tag : + virtual public pair_associative_container_tag, + virtual public multiple_associative_container_tag + { }; + + #ifndef BOOST_NO_HASH #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION template - struct container_traits< BOOST_STD_EXTENSION_NAMESPACE::hash_set > { - typedef set_tag category; - typedef stable_tag iterator_stability; // is this right? + struct container_traits< boost::unordered_set > { + typedef unordered_set_tag category; + typedef unstable_tag iterator_stability; }; template - struct container_traits< BOOST_STD_EXTENSION_NAMESPACE::hash_map > { - typedef map_tag category; - typedef stable_tag iterator_stability; // is this right? + struct container_traits< boost::unordered_map > { + typedef unordered_map_tag category; + typedef unstable_tag iterator_stability; + }; + template + struct container_traits< boost::unordered_multiset > { + typedef unordered_multiset_tag category; + typedef unstable_tag iterator_stability; + }; + template + struct container_traits< boost::unordered_multimap > { + typedef unordered_multimap_tag category; + typedef unstable_tag iterator_stability; }; #endif template - set_tag container_category(const BOOST_STD_EXTENSION_NAMESPACE::hash_set&) - { return set_tag(); } + unordered_set_tag + container_category(const boost::unordered_set&) + { return unordered_set_tag(); } template - map_tag container_category(const BOOST_STD_EXTENSION_NAMESPACE::hash_map&) - { return map_tag(); } + unordered_map_tag + container_category(const boost::unordered_map&) + { return unordered_map_tag(); } template - stable_tag iterator_stability(const BOOST_STD_EXTENSION_NAMESPACE::hash_set&) - { return stable_tag(); } + unstable_tag iterator_stability(const boost::unordered_set&) + { return unstable_tag(); } template - stable_tag iterator_stability(const BOOST_STD_EXTENSION_NAMESPACE::hash_map&) - { return stable_tag(); } + unstable_tag iterator_stability(const boost::unordered_map&) + { return unstable_tag(); } + template + unordered_multiset_tag + container_category(const boost::unordered_multiset&) + { return unordered_multiset_tag(); } + + template + unordered_multimap_tag + container_category(const boost::unordered_multimap&) + { return unordered_multimap_tag(); } + + template + unstable_tag + iterator_stability(const boost::unordered_multiset&) + { return unstable_tag(); } + + template + unstable_tag + iterator_stability(const boost::unordered_multimap&) + { return unstable_tag(); } #endif @@ -414,6 +458,37 @@ namespace boost { namespace graph_detail { return push_dispatch(c, v, container_category(c)); } + // Equal range + template + std::pair + equal_range_dispatch(Container& c, + const LessThanComparable& value, + container_tag) + { + // c must be sorted for std::equal_range to behave properly. + return std::equal_range(c.begin(), c.end(), value); + } + + template + std::pair + equal_range_dispatch(AssociativeContainer& c, + const LessThanComparable& value, + associative_container_tag) + { + return c.equal_range(value); + } + + template + std::pair + equal_range(Container& c, + const LessThanComparable& value) + { + return equal_range_dispatch(c, value, + graph_detail::container_category(c)); + } + }} // namespace boost::graph_detail #if BOOST_WORKAROUND(BOOST_MSVC, < 1300) diff --git a/deal.II/contrib/boost/include/boost/pending/indirect_cmp.hpp b/deal.II/contrib/boost/include/boost/pending/indirect_cmp.hpp index 5e866561b7..638625cecd 100644 --- a/deal.II/contrib/boost/include/boost/pending/indirect_cmp.hpp +++ b/deal.II/contrib/boost/include/boost/pending/indirect_cmp.hpp @@ -65,7 +65,7 @@ namespace boost { inline indirect_pmap(const ReadablePropertyMap& df) : d(df) { } - inline bool operator()(const K& u) const { + inline T operator()(const K& u) const { return get(d, u); } protected: diff --git a/deal.II/contrib/boost/include/boost/pending/mutable_queue.hpp b/deal.II/contrib/boost/include/boost/pending/mutable_queue.hpp index a4e2050d9f..82cfdd8182 100644 --- a/deal.II/contrib/boost/include/boost/pending/mutable_queue.hpp +++ b/deal.II/contrib/boost/include/boost/pending/mutable_queue.hpp @@ -23,20 +23,20 @@ namespace boost { // The mutable queue whose elements are indexed - // + // // This adaptor provides a special kind of priority queue that has // and update operation. This allows the ordering of the items to // change. After the ordering criteria for item x changes, one must // call the Q.update(x) - // + // // In order to efficiently find x in the queue, a functor must be // provided to map value_type to a unique ID, which the // mutable_queue will then use to map to the location of the // item. The ID's generated must be between 0 and N, where N is the // value passed to the constructor of mutable_queue - template , + template , class Comp = std::less, class ID = identity_property_map > class mutable_queue { @@ -46,23 +46,23 @@ namespace boost { protected: typedef typename RandomAccessContainer::iterator iterator; #if !defined BOOST_NO_STD_ITERATOR_TRAITS - typedef adstl::array_binary_tree_node Node; + typedef array_binary_tree_node Node; #else - typedef adstl::array_binary_tree_node Node; + typedef array_binary_tree_node Node; #endif - typedef adstl::compare_array_node Compare; + typedef compare_array_node Compare; typedef std::vector IndexArray; public: typedef Compare value_compare; typedef ID id_generator; - mutable_queue(size_type n, const Comp& x, const ID& _id) + mutable_queue(size_type n, const Comp& x, const ID& _id) : index_array(n), comp(x), id(_id) { - c.reserve(n); + c.reserve(n); } template - mutable_queue(ForwardIterator first, ForwardIterator last, - const Comp& x, const ID& _id) + mutable_queue(ForwardIterator first, ForwardIterator last, + const Comp& x, const ID& _id) : index_array(std::distance(first, last)), comp(x), id(_id) { while( first != last ) { @@ -72,7 +72,7 @@ namespace boost { } bool empty() const { return c.empty(); } - + void pop() { value_type tmp = c.back(); c.back() = c.front(); @@ -86,7 +86,7 @@ namespace boost { c.pop_back(); Node node(c.begin(), c.end(), c.begin(), id); - down_heap(node, comp, index_array); + down_heap(node, comp, index_array); } void push(const IndexedType& x) { c.push_back(x); @@ -120,7 +120,7 @@ namespace boost { bool test() { return std::is_heap(c.begin(), c.end(), Comp()); } -#endif +#endif protected: IndexArray index_array; diff --git a/deal.II/contrib/boost/include/boost/pending/property.hpp b/deal.II/contrib/boost/include/boost/pending/property.hpp index 448a71911d..07cea5f070 100644 --- a/deal.II/contrib/boost/include/boost/pending/property.hpp +++ b/deal.II/contrib/boost/include/boost/pending/property.hpp @@ -6,7 +6,7 @@ #ifndef BOOST_PROPERTY_HPP #define BOOST_PROPERTY_HPP -#include +#include namespace boost { @@ -47,15 +47,9 @@ namespace boost { }; template - struct has_property { - BOOST_STATIC_CONSTANT(bool, value = true); - typedef true_type type; - }; + struct has_property : boost::mpl::true_ {}; template <> - struct has_property { - BOOST_STATIC_CONSTANT(bool, value = false); - typedef false_type type; - }; + struct has_property : boost::mpl::false_ {}; } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/property_map.hpp b/deal.II/contrib/boost/include/boost/property_map.hpp deleted file mode 100644 index 3a64e93b87..0000000000 --- a/deal.II/contrib/boost/include/boost/property_map.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= -Copyright (c) 2009 Trustees of Indiana University - -Distributed under the Boost Software License, Version 1.0. (See accompanying -file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -// Redirect/warning header, adapted from the version in Spirit - -#include - -#if BOOST_VERSION >= 103800 -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__) -# pragma message ("Warning: This header is deprecated. Please use: boost/property_map/property_map.hpp") -#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) -# warning "This header is deprecated. Please use: boost/property_map/property_map.hpp" -#endif -#endif - -#include diff --git a/deal.II/contrib/boost/include/boost/property_map/dynamic_property_map.hpp b/deal.II/contrib/boost/include/boost/property_map/dynamic_property_map.hpp index ea95d54438..f1fde81fb5 100644 --- a/deal.II/contrib/boost/include/boost/property_map/dynamic_property_map.hpp +++ b/deal.II/contrib/boost/include/boost/property_map/dynamic_property_map.hpp @@ -18,6 +18,7 @@ #include +#include #include #include #include @@ -29,6 +30,7 @@ #include #include #include +#include namespace boost { @@ -165,7 +167,7 @@ class dynamic_property_map_adaptor : public dynamic_property_map void do_put(const any&, const any&, mpl::bool_) { - throw dynamic_const_put_error(); + BOOST_THROW_EXCEPTION(dynamic_const_put_error()); } public: @@ -223,9 +225,9 @@ private: // struct dynamic_properties { - typedef std::multimap + typedef std::multimap > property_maps_type; - typedef boost::function3, + typedef boost::function3, const std::string&, const boost::any&, const boost::any&> generate_fn_type; @@ -237,24 +239,16 @@ public: dynamic_properties() : generate_fn() { } dynamic_properties(const generate_fn_type& g) : generate_fn(g) {} - ~dynamic_properties() - { - for (property_maps_type::iterator i = property_maps.begin(); - i != property_maps.end(); ++i) { - delete i->second; - } - } + ~dynamic_properties() {} template dynamic_properties& property(const std::string& name, PropertyMap property_map) { // Tbd: exception safety - std::auto_ptr pm( + boost::shared_ptr pm( new detail::dynamic_property_map_adaptor(property_map)); - property_maps_type::iterator i = - property_maps.insert(property_maps_type::value_type(name, (dynamic_property_map*)0)); - i->second = pm.release(); + property_maps.insert(property_maps_type::value_type(name, pm)); return *this; } @@ -271,17 +265,17 @@ public: { return property_maps.lower_bound(name); } void - insert(const std::string& name, std::auto_ptr pm) + insert(const std::string& name, boost::shared_ptr pm) { - property_maps.insert(property_maps_type::value_type(name, pm.release())); + property_maps.insert(property_maps_type::value_type(name, pm)); } template - std::auto_ptr + boost::shared_ptr generate(const std::string& name, const Key& key, const Value& value) { if(!generate_fn) { - throw property_not_found(name); + BOOST_THROW_EXCEPTION(property_not_found(name)); } else { return generate_fn(name,key,value); } @@ -305,7 +299,7 @@ put(const std::string& name, dynamic_properties& dp, const Key& key, } } - std::auto_ptr new_map = dp.generate(name, key, value); + boost::shared_ptr new_map = dp.generate(name, key, value); if (new_map.get()) { new_map->put(key, value); dp.insert(name, new_map); @@ -326,7 +320,7 @@ get(const std::string& name, const dynamic_properties& dp, const Key& key) return any_cast(i->second->get(key)); } - throw dynamic_get_failure(name); + BOOST_THROW_EXCEPTION(dynamic_get_failure(name)); } #endif @@ -340,7 +334,7 @@ get(const std::string& name, const dynamic_properties& dp, const Key& key, type< return any_cast(i->second->get(key)); } - throw dynamic_get_failure(name); + BOOST_THROW_EXCEPTION(dynamic_get_failure(name)); } template @@ -353,16 +347,16 @@ get(const std::string& name, const dynamic_properties& dp, const Key& key) return i->second->get_string(key); } - throw dynamic_get_failure(name); + BOOST_THROW_EXCEPTION(dynamic_get_failure(name)); } // The easy way to ignore properties. inline -std::auto_ptr +boost::shared_ptr ignore_other_properties(const std::string&, const boost::any&, const boost::any&) { - return std::auto_ptr(0); + return boost::shared_ptr(); } } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/property_map/property_map.hpp b/deal.II/contrib/boost/include/boost/property_map/property_map.hpp index 1f1c51ff66..d64d6e2799 100644 --- a/deal.II/contrib/boost/include/boost/property_map/property_map.hpp +++ b/deal.II/contrib/boost/include/boost/property_map/property_map.hpp @@ -19,6 +19,8 @@ #include #include #include +#include +#include #include namespace boost { @@ -26,6 +28,39 @@ namespace boost { //========================================================================= // property_traits class + BOOST_MPL_HAS_XXX_TRAIT_DEF(key_type) + BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type) + BOOST_MPL_HAS_XXX_TRAIT_DEF(reference) + BOOST_MPL_HAS_XXX_TRAIT_DEF(category) + + template + struct is_property_map : + boost::mpl::and_< + has_key_type, + has_value_type, + has_reference, + has_category + > + {}; + + template + struct default_property_traits { + typedef typename PA::key_type key_type; + typedef typename PA::value_type value_type; + typedef typename PA::reference reference; + typedef typename PA::category category; + }; + + struct null_property_traits {}; + + template + struct property_traits : + boost::mpl::if_, + default_property_traits, + null_property_traits>::type + {}; + +#if 0 template struct property_traits { typedef typename PA::key_type key_type; @@ -33,6 +68,7 @@ namespace boost { typedef typename PA::reference reference; typedef typename PA::category category; }; +#endif //========================================================================= // property_traits category tags @@ -302,7 +338,8 @@ namespace boost { } }; - struct identity_property_map; + template + struct typed_identity_property_map; // A helper class for constructing a property map // from a class that implements operator[] @@ -539,19 +576,23 @@ namespace boost { }; //========================================================================= - // A property map that applies the identity function to integers - struct identity_property_map - : public boost::put_get_helper + // A generalized identity property map + template + struct typed_identity_property_map + : public boost::put_get_helper > { - typedef std::size_t key_type; - typedef std::size_t value_type; - typedef std::size_t reference; + typedef T key_type; + typedef T value_type; + typedef T reference; typedef boost::readable_property_map_tag category; inline value_type operator[](const key_type& v) const { return v; } }; +//========================================================================= + // A property map that applies the identity function to integers + typedef typed_identity_property_map identity_property_map; + //========================================================================= // A property map that does not do anything, for // when you have to supply a property map, but don't need it. diff --git a/deal.II/contrib/boost/include/boost/property_map_iterator.hpp b/deal.II/contrib/boost/include/boost/property_map_iterator.hpp deleted file mode 100644 index 30799712fa..0000000000 --- a/deal.II/contrib/boost/include/boost/property_map_iterator.hpp +++ /dev/null @@ -1,19 +0,0 @@ -/*============================================================================= -Copyright (c) 2009 Trustees of Indiana University - -Distributed under the Boost Software License, Version 1.0. (See accompanying -file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -// Redirect/warning header, adapted from the version in Spirit - -#include - -#if BOOST_VERSION >= 103800 -#if defined(_MSC_VER) || defined(__BORLANDC__) || defined(__DMC__) -# pragma message ("Warning: This header is deprecated. Please use: boost/property_map/property_map_iterator.hpp") -#elif defined(__GNUC__) || defined(__HP_aCC) || defined(__SUNPRO_CC) || defined(__IBMCPP__) -# warning "This header is deprecated. Please use: boost/property_map/property_map_iterator.hpp" -#endif -#endif - -#include diff --git a/deal.II/contrib/boost/include/boost/python/detail/destroy.hpp b/deal.II/contrib/boost/include/boost/python/detail/destroy.hpp index 7df31d4c2a..0172dca28f 100644 --- a/deal.II/contrib/boost/include/boost/python/detail/destroy.hpp +++ b/deal.II/contrib/boost/include/boost/python/detail/destroy.hpp @@ -30,7 +30,7 @@ struct value_destroyer< template static void execute(T const volatile* p) { - p->T::~T(); + p->~T(); } }; diff --git a/deal.II/contrib/boost/include/boost/python/object/make_instance.hpp b/deal.II/contrib/boost/include/boost/python/object/make_instance.hpp index 8f355fe2ed..1ffded1249 100644 --- a/deal.II/contrib/boost/include/boost/python/object/make_instance.hpp +++ b/deal.II/contrib/boost/include/boost/python/object/make_instance.hpp @@ -10,6 +10,7 @@ # include # include # include +# include namespace boost { namespace python { namespace objects { @@ -21,7 +22,7 @@ struct make_instance_impl template static inline PyObject* execute(Arg& x) { - BOOST_STATIC_ASSERT(is_class::value); + BOOST_MPL_ASSERT((mpl::or_, is_union >)); PyTypeObject* type = Derived::get_class_object(x); diff --git a/deal.II/contrib/boost/include/boost/python/object/pointer_holder.hpp b/deal.II/contrib/boost/include/boost/python/object/pointer_holder.hpp index 2dc6dda93d..4627e34ad2 100644 --- a/deal.II/contrib/boost/include/boost/python/object/pointer_holder.hpp +++ b/deal.II/contrib/boost/include/boost/python/object/pointer_holder.hpp @@ -35,6 +35,8 @@ # include +# include + namespace boost { namespace python { template class wrapper; @@ -122,26 +124,29 @@ inline pointer_holder_back_reference::pointer_holder_back_referen template void* pointer_holder::holds(type_info dst_t, bool null_ptr_only) { + typedef typename boost::remove_const< Value >::type non_const_value; + if (dst_t == python::type_id() && !(null_ptr_only && get_pointer(this->m_p)) ) return &this->m_p; - Value* p + Value* p0 # if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x590)) = static_cast( get_pointer(this->m_p) ) # else = get_pointer(this->m_p) # endif ; - + non_const_value* p = const_cast( p0 ); + if (p == 0) return 0; if (void* wrapped = holds_wrapped(dst_t, p, p)) return wrapped; - type_info src_t = python::type_id(); + type_info src_t = python::type_id(); return src_t == dst_t ? p : find_dynamic_type(p, src_t, dst_t); } diff --git a/deal.II/contrib/boost/include/boost/python/object_core.hpp b/deal.II/contrib/boost/include/boost/python/object_core.hpp index 5857422f04..4d81e2eae8 100644 --- a/deal.II/contrib/boost/include/boost/python/object_core.hpp +++ b/deal.II/contrib/boost/include/boost/python/object_core.hpp @@ -5,6 +5,8 @@ #ifndef OBJECT_CORE_DWA2002615_HPP # define OBJECT_CORE_DWA2002615_HPP +# define BOOST_PYTHON_OBJECT_HAS_IS_NONE // added 2010-03-15 by rwgk + # include # include @@ -239,7 +241,9 @@ namespace api // Underlying object access -- returns a borrowed reference inline PyObject* ptr() const; - + + inline bool is_none() const; + private: PyObject* m_ptr; }; @@ -539,6 +543,11 @@ inline PyObject* api::object_base::ptr() const return m_ptr; } +inline bool api::object_base::is_none() const +{ + return (m_ptr == Py_None); +} + // // Converter specialization implementations // diff --git a/deal.II/contrib/boost/include/boost/python/signature.hpp b/deal.II/contrib/boost/include/boost/python/signature.hpp index 1bb2b226f5..f1143e3abe 100644 --- a/deal.II/contrib/boost/include/boost/python/signature.hpp +++ b/deal.II/contrib/boost/include/boost/python/signature.hpp @@ -52,16 +52,23 @@ struct most_derived // // template // inline mpl::vector -// get_signature(RT(*)(T0...TN), void* = 0) +// get_signature(RT(BOOST_PYTHON_FN_CC *)(T0...TN), void* = 0) // { // return mpl::list(); // } // +// where BOOST_PYTHON_FN_CC is a calling convention keyword, can be +// +// empty, for default calling convention +// __cdecl (if BOOST_PYTHON_ENABLE_CDECL is defined) +// __stdcall (if BOOST_PYTHON_ENABLE_STDCALL is defined) +// __fastcall (if BOOST_PYTHON_ENABLE_FASTCALL is defined) +// // And, for an appropriate assortment of cv-qualifications:: // // template // inline mpl::vector -// get_signature(RT(ClassT::*)(T0...TN) cv)) +// get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(T0...TN) cv)) // { // return mpl::list(); // } @@ -72,7 +79,7 @@ struct most_derived // , typename most_derived::type& // , T0...TN // > -// get_signature(RT(ClassT::*)(T0...TN) cv), Target*) +// get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(T0...TN) cv), Target*) // { // return mpl::list(); // } @@ -87,7 +94,8 @@ struct most_derived // // These functions extract the return type, class (for member // functions) and arguments of the input signature and stuff them in -// an mpl type sequence. Note that cv-qualification is dropped from +// an mpl type sequence (the calling convention is dropped). +// Note that cv-qualification is dropped from // the "hidden this" argument of member functions; that is a // necessary sacrifice to ensure that an lvalue from_python converter // is used. A pointer is not used so that None will be rejected for @@ -100,10 +108,64 @@ struct most_derived // // @group { +// 'default' calling convention + +# define BOOST_PYTHON_FN_CC + # define BOOST_PP_ITERATION_PARAMS_1 \ (3, (0, BOOST_PYTHON_MAX_ARITY, )) # include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FN_CC + +// __cdecl calling convention + +# if defined(BOOST_PYTHON_ENABLE_CDECL) + +# define BOOST_PYTHON_FN_CC __cdecl +# define BOOST_PYTHON_FN_CC_IS_CDECL + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) + +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FN_CC +# undef BOOST_PYTHON_FN_CC_IS_CDECL + +# endif // defined(BOOST_PYTHON_ENABLE_CDECL) + +// __stdcall calling convention + +# if defined(BOOST_PYTHON_ENABLE_STDCALL) + +# define BOOST_PYTHON_FN_CC __stdcall + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) + +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FN_CC + +# endif // defined(BOOST_PYTHON_ENABLE_STDCALL) + +// __fastcall calling convention + +# if defined(BOOST_PYTHON_ENABLE_FASTCALL) + +# define BOOST_PYTHON_FN_CC __fastcall + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3, (0, BOOST_PYTHON_MAX_ARITY, )) + +# include BOOST_PP_ITERATE() + +# undef BOOST_PYTHON_FN_CC + +# endif // defined(BOOST_PYTHON_ENABLE_FASTCALL) + # undef BOOST_PYTHON_LIST_INC // } @@ -120,17 +182,24 @@ struct most_derived # define N BOOST_PP_ITERATION() + // as 'get_signature(RT(*)(T0...TN), void* = 0)' is the same + // function as 'get_signature(RT(__cdecl *)(T0...TN), void* = 0)', + // we don't define it twice +# if !defined(BOOST_PYTHON_FN_CC_IS_CDECL) + template < class RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)> inline BOOST_PYTHON_LIST_INC(N)< RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T)> -get_signature(RT(*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)), void* = 0) +get_signature(RT(BOOST_PYTHON_FN_CC *)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)), void* = 0) { return BOOST_PYTHON_LIST_INC(N)< RT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) >(); } +# endif // !defined(BOOST_PYTHON_FN_CC_IS_CDECL) + # undef N # define BOOST_PP_ITERATION_PARAMS_2 \ @@ -146,7 +215,7 @@ template < class RT, class ClassT BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, class T)> inline BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< RT, ClassT& BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T)> -get_signature(RT(ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q) +get_signature(RT(BOOST_PYTHON_FN_CC ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q) { return BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< RT, ClassT& BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) @@ -165,7 +234,7 @@ inline BOOST_PYTHON_LIST_INC(BOOST_PP_INC(N))< BOOST_PP_ENUM_TRAILING_PARAMS_Z(1, N, T) > get_signature( - RT(ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q + RT(BOOST_PYTHON_FN_CC ClassT::*)(BOOST_PP_ENUM_PARAMS_Z(1, N, T)) Q , Target* ) { diff --git a/deal.II/contrib/boost/include/boost/random.hpp b/deal.II/contrib/boost/include/boost/random.hpp index 60a6abfb2b..ad72a21490 100644 --- a/deal.II/contrib/boost/include/boost/random.hpp +++ b/deal.II/contrib/boost/include/boost/random.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org/libs/random for documentation. * - * $Id: random.hpp 24096 2004-07-27 03:43:34Z dgregor $ + * $Id: random.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2000-02-18 portability fixes (thanks to Beman Dawes) @@ -42,8 +42,20 @@ #include #include #include +#include +#include +#include namespace boost { + /** + * The specialization taus88 was suggested in + * + * @blockquote + * "Maximally Equidistributed Combined Tausworthe Generators", + * Pierre L'Ecuyer, Mathematics of Computation, Volume 65, + * Number 213, January 1996, Pages 203-213 + * @endblockquote + */ typedef random::xor_combine, 0, random::linear_feedback_shift, 0, 0>, 0, random::linear_feedback_shift, 0, 0> taus88; diff --git a/deal.II/contrib/boost/include/boost/random/additive_combine.hpp b/deal.II/contrib/boost/include/boost/random/additive_combine.hpp index 2a43239f94..90eff93fe5 100644 --- a/deal.II/contrib/boost/include/boost/random/additive_combine.hpp +++ b/deal.II/contrib/boost/include/boost/random/additive_combine.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: additive_combine.hpp 53871 2009-06-13 17:54:06Z steven_watanabe $ + * $Id: additive_combine.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -26,7 +26,24 @@ namespace boost { namespace random { -// L'Ecuyer 1988 +/** + * An instantiation of class template \additive_combine model a + * \pseudo_random_number_generator. It combines two multiplicative + * \linear_congruential number generators, i.e. those with @c c = 0. + * It is described in + * + * @blockquote + * "Efficient and Portable Combined Random Number Generators", Pierre L'Ecuyer, + * Communications of the ACM, Vol. 31, No. 6, June 1988, pp. 742-749, 774 + * @endblockquote + * + * The template parameters MLCG1 and MLCG2 shall denote two different + * \linear_congruential number generators, each with c = 0. Each invocation + * returns a random number X(n) := (MLCG1(n) - MLCG2(n)) mod (m1 - 1), where + * m1 denotes the modulus of MLCG1. + * + * The template parameter @c val is the validation value checked by validation. + */ template additive_combine(It& first, It last) : _mlcg1(first, last), _mlcg2(first, last) { } + /** + * Seeds an \additive_combine generator using the default + * seeds of the two base generators. + */ void seed() { _mlcg1.seed(); _mlcg2.seed(); } - void seed(result_type seed) + /** + * Seeds an \additive_combine generator, using @c aseed as the + * seed for both base generators. + */ + void seed(result_type aseed) { - _mlcg1.seed(seed); - _mlcg2.seed(seed); + _mlcg1.seed(aseed); + _mlcg2.seed(aseed); } + /** + * Seeds an \additive_combine generator, using @c seed1 and @c seed2 as + * the seeds to the first and second base generators, respectively. + */ void seed(typename MLCG1::result_type seed1, typename MLCG2::result_type seed2) { @@ -78,36 +136,69 @@ public: _mlcg2.seed(seed2); } + /** + * Seeds an \additive_combine generator with + * values from the range defined by the input iterators first + * and last. first will be modified to point to the element + * after the last one used. + * + * Throws: @c std::invalid_argument if the input range is too small. + * + * Exception Safety: Basic + */ template void seed(It& first, It last) { _mlcg1.seed(first, last); _mlcg2.seed(first, last); } + /** + * Returns: the next value of the generator + */ result_type operator()() { result_type z = _mlcg1() - _mlcg2(); if(z < 1) z += MLCG1::modulus-1; return z; } + static bool validation(result_type x) { return val == x; } #ifndef BOOST_NO_OPERATORS_IN_NAMESPACE #ifndef BOOST_RANDOM_NO_STREAM_OPERATORS + /** + * Writes the state of an \additive_combine generator to a @c + * std::ostream. The textual representation of an \additive_combine + * generator is the textual representation of the first base + * generator followed by the textual representation of the + * second base generator. + */ template friend std::basic_ostream& operator<<(std::basic_ostream& os, const additive_combine& r) { os << r._mlcg1 << " " << r._mlcg2; return os; } + /** + * Reads the state of an \additive_combine generator from a + * @c std::istream. + */ template friend std::basic_istream& operator>>(std::basic_istream& is, additive_combine& r) { is >> r._mlcg1 >> std::ws >> r._mlcg2; return is; } #endif + /** + * Returns: true iff the two \additive_combine generators will + * produce the same sequence of values. + */ friend bool operator==(const additive_combine& x, const additive_combine& y) { return x._mlcg1 == y._mlcg1 && x._mlcg2 == y._mlcg2; } + /** + * Returns: true iff the two \additive_combine generators will + * produce different sequences of values. + */ friend bool operator!=(const additive_combine& x, const additive_combine& y) { return !(x == y); } #else @@ -117,6 +208,7 @@ public: bool operator!=(const additive_combine& rhs) const { return !(*this == rhs); } #endif + private: MLCG1 _mlcg1; MLCG2 _mlcg2; @@ -124,6 +216,14 @@ private: } // namespace random +/** + * The specialization \ecuyer1988 was suggested in + * + * @blockquote + * "Efficient and Portable Combined Random Number Generators", Pierre L'Ecuyer, + * Communications of the ACM, Vol. 31, No. 6, June 1988, pp. 742-749, 774 + * @endblockquote + */ typedef random::additive_combine< random::linear_congruential, random::linear_congruential, diff --git a/deal.II/contrib/boost/include/boost/random/bernoulli_distribution.hpp b/deal.II/contrib/boost/include/boost/random/bernoulli_distribution.hpp index a716edf000..78e54a91ed 100644 --- a/deal.II/contrib/boost/include/boost/random/bernoulli_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/bernoulli_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: bernoulli_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: bernoulli_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -22,7 +22,12 @@ namespace boost { -// Bernoulli distribution: p(true) = p, p(false) = 1-p (boolean) +/** + * Instantiations of class template \bernoulli_distribution model a + * \random_distribution. Such a random distribution produces bool values + * distributed with probabilities P(true) = p and P(false) = 1-p. p is + * the parameter of the distribution. + */ template class bernoulli_distribution { @@ -33,6 +38,12 @@ public: typedef int input_type; typedef bool result_type; + /** + * Constructs a \bernoulli_distribution object. + * p is the parameter of the distribution. + * + * Requires: 0 <= p <= 1 + */ explicit bernoulli_distribution(const RealType& p_arg = RealType(0.5)) : _p(p_arg) { @@ -42,9 +53,20 @@ public: // compiler-generated copy ctor and assignment operator are fine + /** + * Returns: The "p" parameter of the distribution. + */ RealType p() const { return _p; } + /** + * Effects: Subsequent uses of the distribution do not depend + * on values produced by any engine prior to invoking reset. + */ void reset() { } + /** + * Returns: a random variate distributed according to the + * \bernoulli_distribution. + */ template result_type operator()(Engine& eng) { @@ -55,6 +77,9 @@ public: } #ifndef BOOST_RANDOM_NO_STREAM_OPERATORS + /** + * Writes the parameters of the distribution to a @c std::ostream. + */ template friend std::basic_ostream& operator<<(std::basic_ostream& os, const bernoulli_distribution& bd) @@ -63,6 +88,9 @@ public: return os; } + /** + * Reads the parameters of the distribution from a @c std::istream. + */ template friend std::basic_istream& operator>>(std::basic_istream& is, bernoulli_distribution& bd) diff --git a/deal.II/contrib/boost/include/boost/random/binomial_distribution.hpp b/deal.II/contrib/boost/include/boost/random/binomial_distribution.hpp index 17c96e1926..f0e46a50ea 100644 --- a/deal.II/contrib/boost/include/boost/random/binomial_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/binomial_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: binomial_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: binomial_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * */ @@ -21,7 +21,14 @@ namespace boost { -// Knuth +/** + * The binomial distribution is an integer valued distribution with + * two parameters, @c t and @c p. The values of the distribution + * are within the range [0,t]. + * + * The probability that the distribution produces a value k is + * \f${t \choose k}p^k(1-p)^{t-k}\f$. + */ template class binomial_distribution { @@ -29,20 +36,36 @@ public: typedef typename bernoulli_distribution::input_type input_type; typedef IntType result_type; - explicit binomial_distribution(IntType t_arg = 1, - const RealType& p_arg = RealType(0.5)) - : _bernoulli(p_arg), _t(t_arg) + /** + * Construct an @c binomial_distribution object. @c t and @c p + * are the parameters of the distribution. + * + * Requires: t >=0 && 0 <= p <= 1 + */ + explicit binomial_distribution(IntType t = 1, + const RealType& p = RealType(0.5)) + : _bernoulli(p), _t(t) { assert(_t >= 0); - assert(RealType(0) <= p_arg && p_arg <= RealType(1)); + assert(RealType(0) <= p && p <= RealType(1)); } // compiler-generated copy ctor and assignment operator are fine + /** Returns: the @c t parameter of the distribution */ IntType t() const { return _t; } + /** Returns: the @c p parameter of the distribution */ RealType p() const { return _bernoulli.p(); } + /** + * Effects: Subsequent uses of the distribution do not depend + * on values produced by any engine prior to invoking reset. + */ void reset() { } + /** + * Returns: a random variate distributed according to the + * binomial distribution. + */ template result_type operator()(Engine& eng) { @@ -55,6 +78,9 @@ public: } #ifndef BOOST_RANDOM_NO_STREAM_OPERATORS + /** + * Writes the parameters of the distribution to a @c std::ostream. + */ template friend std::basic_ostream& operator<<(std::basic_ostream& os, const binomial_distribution& bd) @@ -63,6 +89,9 @@ public: return os; } + /** + * Reads the parameters of the distribution from a @c std::istream. + */ template friend std::basic_istream& operator>>(std::basic_istream& is, binomial_distribution& bd) diff --git a/deal.II/contrib/boost/include/boost/random/cauchy_distribution.hpp b/deal.II/contrib/boost/include/boost/random/cauchy_distribution.hpp index 9723ced2b2..c11ba2bf77 100644 --- a/deal.II/contrib/boost/include/boost/random/cauchy_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/cauchy_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: cauchy_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: cauchy_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -30,7 +30,14 @@ namespace boost { using std::tan; #endif -// Cauchy distribution: p(x) = sigma/(pi*(sigma**2 + (x-median)**2)) +// Cauchy distribution: + +/** + * The cauchy distribution is a continuous distribution with two + * parameters, sigma and median. + * + * It has \f$p(x) = \frac{\sigma}{\pi(\sigma^2 + (x-m)^2)}\f$ + */ template class cauchy_distribution { @@ -42,16 +49,34 @@ public: BOOST_STATIC_ASSERT(!std::numeric_limits::is_integer); #endif + /** + * Constructs a \cauchy_distribution with the paramters @c median + * and @c sigma. + */ explicit cauchy_distribution(result_type median_arg = result_type(0), result_type sigma_arg = result_type(1)) : _median(median_arg), _sigma(sigma_arg) { } // compiler-generated copy ctor and assignment operator are fine + /** + * Returns: the "median" parameter of the distribution + */ result_type median() const { return _median; } + /** + * Returns: the "sigma" parameter of the distribution + */ result_type sigma() const { return _sigma; } + /** + * Effects: Subsequent uses of the distribution do not depend + * on values produced by any engine prior to invoking reset. + */ void reset() { } + /** + * Returns: A random variate distributed according to the + * cauchy distribution. + */ template result_type operator()(Engine& eng) { @@ -64,6 +89,9 @@ public: } #ifndef BOOST_RANDOM_NO_STREAM_OPERATORS + /** + * Writes the parameters of the distribution to a @c std::ostream. + */ template friend std::basic_ostream& operator<<(std::basic_ostream& os, const cauchy_distribution& cd) @@ -72,6 +100,9 @@ public: return os; } + /** + * Reads the parameters of the distribution from a @c std::istream. + */ template friend std::basic_istream& operator>>(std::basic_istream& is, cauchy_distribution& cd) diff --git a/deal.II/contrib/boost/include/boost/random/detail/auto_link.hpp b/deal.II/contrib/boost/include/boost/random/detail/auto_link.hpp new file mode 100644 index 0000000000..1f30fd56d9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/random/detail/auto_link.hpp @@ -0,0 +1,42 @@ +/* boost random auto_link.hpp header file + * + * Copyright Steven Watanabe 2010 + * Distributed under the Boost Software License, Version 1.0. (See + * accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * $Id: auto_link.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ + */ + +#ifndef BOOST_RANDOM_DETAIL_AUTO_LINK_HPP +#define BOOST_RANDOM_DETAIL_AUTO_LINK_HPP + +#include + +#ifdef BOOST_HAS_DECLSPEC + #if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_RANDOM_DYN_LINK) + #if defined(BOOST_RANDOM_SOURCE) + #define BOOST_RANDOM_DECL __declspec(dllexport) + #else + #define BOOST_RANDOM_DECL __declspec(dllimport) + #endif + #endif +#endif + +#ifndef BOOST_RANDOM_DECL + #define BOOST_RANDOM_DECL +#endif + +#if !defined(BOOST_RANDOM_NO_LIB) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_RANDOM_SOURCE) + +#define BOOST_LIB_NAME boost_random + +#if defined(BOOST_RANDOM_DYN_LINK) || defined(BOOST_ALL_DYN_LINK) + #define BOOST_DYN_LINK +#endif + +#include + +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/random/detail/const_mod.hpp b/deal.II/contrib/boost/include/boost/random/detail/const_mod.hpp index a32e2b9065..e0a8839031 100644 --- a/deal.II/contrib/boost/include/boost/random/detail/const_mod.hpp +++ b/deal.II/contrib/boost/include/boost/random/detail/const_mod.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: const_mod.hpp 41369 2007-11-25 18:07:19Z bemandawes $ + * $Id: const_mod.hpp 58649 2010-01-02 21:23:17Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -22,6 +22,8 @@ #include #include +#include + namespace boost { namespace random { @@ -356,4 +358,6 @@ private: } // namespace random } // namespace boost +#include + #endif // BOOST_RANDOM_CONST_MOD_HPP diff --git a/deal.II/contrib/boost/include/boost/random/detail/disable_warnings.hpp b/deal.II/contrib/boost/include/boost/random/detail/disable_warnings.hpp new file mode 100644 index 0000000000..f3ade5ec8d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/random/detail/disable_warnings.hpp @@ -0,0 +1,23 @@ +/* boost random/detail/disable_warnings.hpp header file + * + * Copyright Steven Watanabe 2009 + * Distributed under the Boost Software License, Version 1.0. (See + * accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * See http://www.boost.org for most recent version including documentation. + * + * $Id: disable_warnings.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ + * + */ + +// No #include guard. This header is intended to be included multiple times. + +#include + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4512) +#pragma warning(disable:4127) +#pragma warning(disable:4724) +#endif diff --git a/deal.II/contrib/boost/include/boost/random/detail/enable_warnings.hpp b/deal.II/contrib/boost/include/boost/random/detail/enable_warnings.hpp new file mode 100644 index 0000000000..26184ea55b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/random/detail/enable_warnings.hpp @@ -0,0 +1,18 @@ +/* boost random/detail/enable_warnings.hpp header file + * + * Copyright Steven Watanabe 2009 + * Distributed under the Boost Software License, Version 1.0. (See + * accompanying file LICENSE_1_0.txt or copy at + * http://www.boost.org/LICENSE_1_0.txt) + * + * See http://www.boost.org for most recent version including documentation. + * + * $Id: enable_warnings.hpp 58649 2010-01-02 21:23:17Z steven_watanabe $ + * + */ + +// No #include guard. This header is intended to be included multiple times. + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif diff --git a/deal.II/contrib/boost/include/boost/random/detail/pass_through_engine.hpp b/deal.II/contrib/boost/include/boost/random/detail/pass_through_engine.hpp index 02dd391a32..468427c62a 100644 --- a/deal.II/contrib/boost/include/boost/random/detail/pass_through_engine.hpp +++ b/deal.II/contrib/boost/include/boost/random/detail/pass_through_engine.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: pass_through_engine.hpp 24096 2004-07-27 03:43:34Z dgregor $ + * $Id: pass_through_engine.hpp 58649 2010-01-02 21:23:17Z steven_watanabe $ * */ @@ -16,7 +16,7 @@ #include #include - +#include namespace boost { namespace random { @@ -94,5 +94,7 @@ operator>>(std::istream& is, } // namespace random } // namespace boost +#include + #endif // BOOST_RANDOM_DETAIL_PASS_THROUGH_ENGINE_HPP diff --git a/deal.II/contrib/boost/include/boost/random/detail/seed.hpp b/deal.II/contrib/boost/include/boost/random/detail/seed.hpp index e1df433354..48cc17e332 100644 --- a/deal.II/contrib/boost/include/boost/random/detail/seed.hpp +++ b/deal.II/contrib/boost/include/boost/random/detail/seed.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: seed.hpp 53871 2009-06-13 17:54:06Z steven_watanabe $ + * $Id: seed.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ */ #ifndef BOOST_RANDOM_DETAIL_SEED_HPP @@ -15,7 +15,9 @@ #include -#if !defined(BOOST_NO_SFINAE) +// Sun seems to have trouble with the use of SFINAE for the +// templated constructor. So does Borland. +#if !defined(BOOST_NO_SFINAE) && !defined(__SUNPRO_CC) && !defined(__BORLANDC__) #include #include @@ -31,8 +33,7 @@ template struct disable_constructor : disable_seed {}; template -struct disable_constructor { -}; +struct disable_constructor {}; #define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \ template \ diff --git a/deal.II/contrib/boost/include/boost/random/discard_block.hpp b/deal.II/contrib/boost/include/boost/random/discard_block.hpp index 6b97ab332c..27abd66e71 100644 --- a/deal.II/contrib/boost/include/boost/random/discard_block.hpp +++ b/deal.II/contrib/boost/include/boost/random/discard_block.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: discard_block.hpp 53871 2009-06-13 17:54:06Z steven_watanabe $ + * $Id: discard_block.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-03-02 created @@ -26,6 +26,15 @@ namespace boost { namespace random { +/** + * The class template \discard_block is a model of + * \pseudo_random_number_generator. It modifies + * another generator by discarding parts of its output. + * Out of every block of @c r results, the first @c p + * will be returned and the rest discarded. + * + * Requires: 0 < p <= r + */ template class discard_block { diff --git a/deal.II/contrib/boost/include/boost/random/exponential_distribution.hpp b/deal.II/contrib/boost/include/boost/random/exponential_distribution.hpp index 56ac8a21ca..022faef8f6 100644 --- a/deal.II/contrib/boost/include/boost/random/exponential_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/exponential_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: exponential_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: exponential_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -25,7 +25,11 @@ namespace boost { -// exponential distribution: p(x) = lambda * exp(-lambda * x) +/** + * The exponential distribution has a single parameter lambda. + * + * It has \f$p(x) = \lambda e^{-\lambda x}\f$ + */ template class exponential_distribution { diff --git a/deal.II/contrib/boost/include/boost/random/gamma_distribution.hpp b/deal.II/contrib/boost/include/boost/random/gamma_distribution.hpp index 9e95bb8ef8..384954baca 100644 --- a/deal.II/contrib/boost/include/boost/random/gamma_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/gamma_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: gamma_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: gamma_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * */ @@ -23,7 +23,14 @@ namespace boost { -// Knuth +// The algorithm is taken from Knuth + +/** + * The gamma distribution is a continuous distribution with a single + * parameter alpha. + * + * It has \f$p(x) = x^{\alpha-1}\frac{e^{-x}}{\Gamma(\alpha)}\f$. + */ template class gamma_distribution { @@ -114,6 +121,7 @@ public: #endif private: + /// \cond hide_private_members void init() { #ifndef BOOST_NO_STDC_NAMESPACE @@ -122,6 +130,7 @@ private: #endif _p = exp(result_type(1)) / (_alpha + exp(result_type(1))); } + /// \endcond exponential_distribution _exp; result_type _alpha; diff --git a/deal.II/contrib/boost/include/boost/random/geometric_distribution.hpp b/deal.II/contrib/boost/include/boost/random/geometric_distribution.hpp index b7e98a1d7b..d96fc45e57 100644 --- a/deal.II/contrib/boost/include/boost/random/geometric_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/geometric_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: geometric_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: geometric_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -30,7 +30,14 @@ namespace boost { using std::log; #endif -// geometric distribution: p(i) = (1-p) * pow(p, i-1) (integer) +/** + * An instantiation of the class template @c geometric_distribution models + * a \random_distribution. The distribution produces positive + * integers which are the number of bernoulli trials + * with probability @c p required to get one that fails. + * + * For the geometric distribution, \f$p(i) = (1-p) p^{i-1}\f$. + */ template class geometric_distribution { @@ -38,8 +45,13 @@ public: typedef RealType input_type; typedef IntType result_type; - explicit geometric_distribution(const RealType& p_arg = RealType(0.5)) - : _p(p_arg) + /** + * Contructs a new geometric_distribution with the paramter @c p. + * + * Requires: 0 < p < 1 + */ + explicit geometric_distribution(const RealType& p = RealType(0.5)) + : _p(p) { assert(RealType(0) < _p && _p < RealType(1)); init(); @@ -47,6 +59,9 @@ public: // compiler-generated copy ctor and assignment operator are fine + /** + * Returns: the distribution parameter @c p + */ RealType p() const { return _p; } void reset() { } @@ -80,6 +95,9 @@ public: #endif private: + + /// \cond hide_private_functions + void init() { #ifndef BOOST_NO_STDC_NAMESPACE @@ -88,6 +106,8 @@ private: _log_p = log(_p); } + /// \endcond + RealType _p; RealType _log_p; }; diff --git a/deal.II/contrib/boost/include/boost/random/inversive_congruential.hpp b/deal.II/contrib/boost/include/boost/random/inversive_congruential.hpp index aa001a96f1..93604b324e 100644 --- a/deal.II/contrib/boost/include/boost/random/inversive_congruential.hpp +++ b/deal.II/contrib/boost/include/boost/random/inversive_congruential.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: inversive_congruential.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: inversive_congruential.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -28,6 +28,35 @@ namespace boost { namespace random { // Eichenauer and Lehn 1986 +/** + * Instantiations of class template @c inversive_congruential model a + * \pseudo_random_number_generator. It uses the inversive congruential + * algorithm (ICG) described in + * + * @blockquote + * "Inversive pseudorandom number generators: concepts, results and links", + * Peter Hellekalek, In: "Proceedings of the 1995 Winter Simulation + * Conference", C. Alexopoulos, K. Kang, W.R. Lilegdon, and D. Goldsman + * (editors), 1995, pp. 255-262. ftp://random.mat.sbg.ac.at/pub/data/wsc95.ps + * @endblockquote + * + * The output sequence is defined by x(n+1) = (a*inv(x(n)) - b) (mod p), + * where x(0), a, b, and the prime number p are parameters of the generator. + * The expression inv(k) denotes the multiplicative inverse of k in the + * field of integer numbers modulo p, with inv(0) := 0. + * + * The template parameter IntType shall denote a signed integral type large + * enough to hold p; a, b, and p are the parameters of the generators. The + * template parameter val is the validation value checked by validation. + * + * @xmlnote + * The implementation currently uses the Euclidian Algorithm to compute + * the multiplicative inverse. Therefore, the inversive generators are about + * 10-20 times slower than the others (see section"performance"). However, + * the paper talks of only 3x slowdown, so the Euclidian Algorithm is probably + * not optimal for calculating the multiplicative inverse. + * @endxmlnote + */ template class inversive_congruential { @@ -47,6 +76,10 @@ public: result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return b == 0 ? 1 : 0; } result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return p-1; } + /** + * Constructs an inversive_congruential generator with + * @c y0 as the initial state. + */ explicit inversive_congruential(IntType y0 = 1) : value(y0) { BOOST_STATIC_ASSERT(b >= 0); @@ -58,6 +91,7 @@ public: template inversive_congruential(It& first, It last) { seed(first, last); } + /** Changes the current state to y0. */ void seed(IntType y0 = 1) { value = y0; if(b == 0) assert(y0 > 0); } template void seed(It& first, It last) { @@ -121,6 +155,16 @@ const typename inversive_congruential::result_type invers } // namespace random +/** + * The specialization hellekalek1995 was suggested in + * + * @blockquote + * "Inversive pseudorandom number generators: concepts, results and links", + * Peter Hellekalek, In: "Proceedings of the 1995 Winter Simulation + * Conference", C. Alexopoulos, K. Kang, W.R. Lilegdon, and D. Goldsman + * (editors), 1995, pp. 255-262. ftp://random.mat.sbg.ac.at/pub/data/wsc95.ps + * @endblockquote + */ typedef random::inversive_congruential hellekalek1995; diff --git a/deal.II/contrib/boost/include/boost/random/lagged_fibonacci.hpp b/deal.II/contrib/boost/include/boost/random/lagged_fibonacci.hpp index 5432885d83..20860dae69 100644 --- a/deal.II/contrib/boost/include/boost/random/lagged_fibonacci.hpp +++ b/deal.II/contrib/boost/include/boost/random/lagged_fibonacci.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: lagged_fibonacci.hpp 53871 2009-06-13 17:54:06Z steven_watanabe $ + * $Id: lagged_fibonacci.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -80,6 +80,12 @@ namespace detail } # endif +/** + * Instantiations of class template \lagged_fibonacci model a + * \pseudo_random_number_generator. It uses a lagged Fibonacci + * algorithm with two lags @c p and @c q: + * x(i) = x(i-p) + x(i-q) (mod 2w) with p > q. + */ template class lagged_fibonacci @@ -91,24 +97,45 @@ public: BOOST_STATIC_CONSTANT(unsigned int, long_lag = p); BOOST_STATIC_CONSTANT(unsigned int, short_lag = q); + /** + * Returns: the smallest value that the generator can produce + */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; } + /** + * Returns: the largest value that the generator can produce + */ result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return wordmask; } + /** + * Creates a new @c lagged_fibonacci generator and calls @c seed() + */ lagged_fibonacci() { init_wordmask(); seed(); } + /** + * Creates a new @c lagged_fibonacci generator and calls @c seed(value) + */ explicit lagged_fibonacci(uint32_t value) { init_wordmask(); seed(value); } + /** + * Creates a new @c lagged_fibonacci generator and calls @c seed(first, last) + */ template lagged_fibonacci(It& first, It last) { init_wordmask(); seed(first, last); } // compiler-generated copy ctor and assignment operator are fine private: + /// \cond hide_private_members void init_wordmask() { wordmask = 0; for(int j = 0; j < w; ++j) wordmask |= (1u << j); } + /// \endcond public: + /** + * Sets the state of the generator to values produced by + * a \minstd_rand generator. + */ void seed(uint32_t value = 331u) { minstd_rand0 gen(value); @@ -117,6 +144,11 @@ public: i = long_lag; } + /** + * Sets the state of the generator to values from the iterator + * range [first, last). If there are not enough elements in the + * range [first, last) throws @c std::invalid_argument. + */ template void seed(It& first, It last) { @@ -129,6 +161,9 @@ public: throw std::invalid_argument("lagged_fibonacci::seed"); } + /** + * Returns: the next value of the generator + */ result_type operator()() { if(i >= long_lag) @@ -183,7 +218,10 @@ public: #endif private: + /// \cond hide_private_members void fill(); + /// \endcond + UIntType wordmask; unsigned int i; UIntType x[long_lag]; @@ -199,6 +237,8 @@ template const unsigned int lagged_fibonacci::short_lag; #endif +/// \cond hide_private_members + template void lagged_fibonacci::fill() { @@ -257,6 +297,30 @@ BOOST_RANDOM_FIBONACCI_VAL(double, 44497,21034, 0.254135073399297, 1e-14) #undef BOOST_RANDOM_FIBONACCI_VAL +/// \endcond + +/** + * Instantiations of class template @c lagged_fibonacci_01 model a + * \pseudo_random_number_generator. It uses a lagged Fibonacci + * algorithm with two lags @c p and @c q, evaluated in floating-point + * arithmetic: x(i) = x(i-p) + x(i-q) (mod 1) with p > q. See + * + * @blockquote + * "Uniform random number generators for supercomputers", Richard Brent, + * Proc. of Fifth Australian Supercomputer Conference, Melbourne, + * Dec. 1992, pp. 704-706. + * @endblockquote + * + * @xmlnote + * The quality of the generator crucially depends on the choice + * of the parameters. User code should employ one of the sensibly + * parameterized generators such as \lagged_fibonacci607 instead. + * @endxmlnote + * + * The generator requires considerable amounts of memory for the storage + * of its state array. For example, \lagged_fibonacci607 requires about + * 4856 bytes and \lagged_fibonacci44497 requires about 350 KBytes. + */ template class lagged_fibonacci_01 { @@ -267,9 +331,12 @@ public: BOOST_STATIC_CONSTANT(unsigned int, long_lag = p); BOOST_STATIC_CONSTANT(unsigned int, short_lag = q); + /** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(). */ lagged_fibonacci_01() { init_modulus(); seed(); } + /** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(value). */ BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(lagged_fibonacci_01, uint32_t, value) { init_modulus(); seed(value); } + /** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(gen). */ BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(lagged_fibonacci_01, Generator, gen) { init_modulus(); seed(gen); } template lagged_fibonacci_01(It& first, It last) @@ -277,6 +344,7 @@ public: // compiler-generated copy ctor and assignment operator are fine private: + /// \cond hide_private_members void init_modulus() { #ifndef BOOST_NO_STDC_NAMESPACE @@ -285,18 +353,30 @@ private: #endif _modulus = pow(RealType(2), word_size); } + /// \endcond public: + /** Calls seed(331u). */ void seed() { seed(331u); } + /** + * Constructs a \minstd_rand0 generator with the constructor parameter + * value and calls seed with it. Distinct seeds in the range + * [1, 2147483647) will produce generators with different states. Other + * seeds will be equivalent to some seed within this range. See + * \linear_congruential for details. + */ BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(lagged_fibonacci_01, uint32_t, value) { minstd_rand0 intgen(value); seed(intgen); } - // For GCC, moving this function out-of-line prevents inlining, which may - // reduce overall object code size. However, MSVC does not grok - // out-of-line template member functions. + /** + * Sets the state of this @c lagged_fibonacci_01 to the values returned + * by p invocations of \uniform_01\()(gen). + * + * Complexity: Exactly p invocations of gen. + */ BOOST_RANDOM_DETAIL_GENERATOR_SEED(lagged_fibonacci, Generator, gen) { // use pass-by-reference, but wrap argument in pass_through_engine @@ -407,7 +487,9 @@ public: #endif private: + /// \cond hide_private_members void fill(); + /// \endcond unsigned int i; RealType x[long_lag]; RealType _modulus; @@ -426,6 +508,7 @@ const int lagged_fibonacci_01::word_size; #endif +/// \cond hide_private_members template void lagged_fibonacci_01::fill() { @@ -446,17 +529,70 @@ void lagged_fibonacci_01::fill() } i = 0; } +/// \endcond } // namespace random +#ifdef BOOST_RANDOM_DOXYGEN +namespace detail { +/** + * The specializations lagged_fibonacci607 ... lagged_fibonacci44497 + * use well tested lags. + * + * See + * + * @blockquote + * "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent + * Computer Sciences Laboratory Australian National University, December 1992 + * @endblockquote + * + * The lags used here can be found in + * + * @blockquote + * "Uniform random number generators for supercomputers", Richard Brent, + * Proc. of Fifth Australian Supercomputer Conference, Melbourne, + * Dec. 1992, pp. 704-706. + * @endblockquote + */ +struct lagged_fibonacci_doc {}; +} +#endif + +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci607; +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci1279; +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci2281; +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci3217; +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci4423; +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci9689; +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci19937; +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci23209; +/** + * @copydoc boost::detail::lagged_fibonacci_doc + */ typedef random::lagged_fibonacci_01 lagged_fibonacci44497; diff --git a/deal.II/contrib/boost/include/boost/random/linear_congruential.hpp b/deal.II/contrib/boost/include/boost/random/linear_congruential.hpp index ce971ca29b..351b9c19c8 100644 --- a/deal.II/contrib/boost/include/boost/random/linear_congruential.hpp +++ b/deal.II/contrib/boost/include/boost/random/linear_congruential.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: linear_congruential.hpp 53871 2009-06-13 17:54:06Z steven_watanabe $ + * $Id: linear_congruential.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -26,10 +26,31 @@ #include #include +#include + namespace boost { namespace random { -// compile-time configurable linear congruential generator +/** + * Instantiations of class template linear_congruential model a + * \pseudo_random_number_generator. Linear congruential pseudo-random + * number generators are described in: + * + * "Mathematical methods in large-scale computing units", D. H. Lehmer, + * Proc. 2nd Symposium on Large-Scale Digital Calculating Machines, + * Harvard University Press, 1951, pp. 141-146 + * + * Let x(n) denote the sequence of numbers returned by some pseudo-random + * number generator. Then for the linear congruential generator, + * x(n+1) := (a * x(n) + c) mod m. Parameters for the generator are + * x(0), a, c, m. The template parameter IntType shall denote an integral + * type. It must be large enough to hold values a, c, and m. The template + * parameters a and c must be smaller than m. + * + * Note: The quality of the generator crucially depends on the choice of + * the parameters. User code should use one of the sensibly parameterized + * generators such as minstd_rand instead. + */ template class linear_congruential { @@ -51,13 +72,12 @@ public: // BOOST_STATIC_ASSERT(m == 0 || a < m); // BOOST_STATIC_ASSERT(m == 0 || c < m); + /** + * Constructs a linear_congruential generator, seeding it with @c x0. + */ explicit linear_congruential(IntType x0 = 1) - : _modulus(modulus), _x(_modulus ? (x0 % _modulus) : x0) { - assert(c || x0); /* if c == 0 and x(0) == 0 then x(n) = 0 for all n */ - // overflow check - // disabled because it gives spurious "divide by zero" gcc warnings - // assert(m == 0 || (a*(m-1)+c) % m == (c < a ? c-a+m : c-a)); + seed(x0); // MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS @@ -65,32 +85,76 @@ public: #endif } + /** + * Constructs a @c linear_congruential generator and seeds it + * with values taken from the itrator range [first, last) + * and adjusts first to point to the element after the last one + * used. If there are not enough elements, throws @c std::invalid_argument. + * + * first and last must be input iterators. + */ template linear_congruential(It& first, It last) - : _modulus(modulus) { seed(first, last); } // compiler-generated copy constructor and assignment operator are fine + + /** + * If c mod m is zero and x0 mod m is zero, changes the current value of + * the generator to 1. Otherwise, changes it to x0 mod m. If c is zero, + * distinct seeds in the range [1,m) will leave the generator in distinct + * states. If c is not zero, the range is [0,m). + */ void seed(IntType x0 = 1) { - assert(c || x0); - _x = (_modulus ? (x0 % _modulus) : x0); + // wrap _x if it doesn't fit in the destination + if(modulus == 0) { + _x = x0; + } else { + _x = x0 % modulus; + } + // handle negative seeds + if(_x <= 0 && _x != 0) { + _x += modulus; + } + // adjust to the correct range + if(increment == 0 && _x == 0) { + _x = 1; + } + assert(_x >= (min)()); + assert(_x <= (max)()); } + /** + * seeds a @c linear_congruential generator with values taken + * from the itrator range [first, last) and adjusts @c first to + * point to the element after the last one used. If there are + * not enough elements, throws @c std::invalid_argument. + * + * @c first and @c last must be input iterators. + */ template void seed(It& first, It last) { if(first == last) throw std::invalid_argument("linear_congruential::seed"); - IntType value = *first++; - _x = (_modulus ? (value % _modulus) : value); + seed(*first++); } + /** + * Returns the smallest value that the @c linear_congruential generator + * can produce. + */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return c == 0 ? 1 : 0; } + /** + * Returns the largest value that the @c linear_congruential generator + * can produce. + */ result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return modulus-1; } + /** Returns the next value of the @c linear_congruential generator. */ IntType operator()() { _x = const_mod::mult_add(a, _x, c); @@ -135,8 +199,7 @@ public: private: #endif #endif - - IntType _modulus; // work-around for gcc "divide by zero" warning in ctor + IntType _x; }; @@ -190,14 +253,48 @@ const IntType linear_congruential::modulus; } // namespace random // validation values from the publications +/** + * The specialization \minstd_rand0 was originally suggested in + * + * @blockquote + * A pseudo-random number generator for the System/360, P.A. Lewis, + * A.S. Goodman, J.M. Miller, IBM Systems Journal, Vol. 8, No. 2, + * 1969, pp. 136-146 + * @endblockquote + * + * It is examined more closely together with \minstd_rand in + * + * @blockquote + * "Random Number Generators: Good ones are hard to find", + * Stephen K. Park and Keith W. Miller, Communications of + * the ACM, Vol. 31, No. 10, October 1988, pp. 1192-1201 + * @endblockquote + */ typedef random::linear_congruential minstd_rand0; + +/** The specialization \minstd_rand was suggested in + * + * @blockquote + * "Random Number Generators: Good ones are hard to find", + * Stephen K. Park and Keith W. Miller, Communications of + * the ACM, Vol. 31, No. 10, October 1988, pp. 1192-1201 + * @endblockquote + */ typedef random::linear_congruential minstd_rand; #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T) -// emulate the lrand48() C library function; requires support for uint64_t +/** Class @c rand48 models a \pseudo_random_number_generator. It uses + * the linear congruential algorithm with the parameters a = 0x5DEECE66D, + * c = 0xB, m = 2**48. It delivers identical results to the @c lrand48() + * function available on some systems (assuming lcong48 has not been called). + * + * It is only available on systems where @c uint64_t is provided as an + * integral type, so that for example static in-class constants and/or + * enum definitions with large @c uint64_t numbers work. + */ class rand48 { public: @@ -209,17 +306,46 @@ public: #else enum { has_fixed_range = false }; #endif + /** + * Returns the smallest value that the generator can produce + */ int32_t min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; } + /** + * Returns the largest value that the generator can produce + */ int32_t max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return std::numeric_limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); } +#ifdef BOOST_RANDOM_DOXYGEN + /** + * If T is an integral type smaller than int46_t, constructs + * a \rand48 generator with x(0) := (x0 << 16) | 0x330e. Otherwise + * constructs a \rand48 generator with x(0) = x0. + */ + template explicit rand48(T x0 = 1); +#else rand48() : lcf(cnv(static_cast(1))) {} template explicit rand48(T x0) : lcf(cnv(x0)) { } +#endif template rand48(It& first, It last) : lcf(first, last) { } + // compiler-generated copy ctor and assignment operator are fine + +#ifdef BOOST_RANDOM_DOXYGEN + /** + * If T is an integral type smaller than int46_t, changes + * the current value x(n) of the generator to (x0 << 16) | 0x330e. + * Otherwise changes the current value x(n) to x0. + */ + template void seed(T x0 = 1); +#else void seed() { seed(static_cast(1)); } template void seed(T x0) { lcf.seed(cnv(x0)); } +#endif template void seed(It& first, It last) { lcf.seed(first,last); } + /** + * Returns the next value of the generator. + */ int32_t operator()() { return static_cast(lcf() >> 17); } // by experiment from lrand48() static bool validation(int32_t x) { return x == 1993516219; } @@ -250,6 +376,7 @@ public: { return !(*this == rhs); } #endif private: + /// \cond hide_private_members random::linear_congruential lcf; @@ -259,15 +386,18 @@ private: if(sizeof(T) < sizeof(uint64_t)) { return (static_cast(x) << 16) | 0x330e; } else { - return(static_cast(x)); + return(static_cast(x)); } } static uint64_t cnv(float x) { return(static_cast(x)); } static uint64_t cnv(double x) { return(static_cast(x)); } static uint64_t cnv(long double x) { return(static_cast(x)); } + /// \endcond }; #endif /* !BOOST_NO_INT64_T && !BOOST_NO_INTEGRAL_INT64_T */ } // namespace boost +#include + #endif // BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP diff --git a/deal.II/contrib/boost/include/boost/random/linear_feedback_shift.hpp b/deal.II/contrib/boost/include/boost/random/linear_feedback_shift.hpp index cb01062c62..5e9b016a6b 100644 --- a/deal.II/contrib/boost/include/boost/random/linear_feedback_shift.hpp +++ b/deal.II/contrib/boost/include/boost/random/linear_feedback_shift.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: linear_feedback_shift.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: linear_feedback_shift.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * */ @@ -25,7 +25,16 @@ namespace boost { namespace random { -// Tausworte 1965 +/** + * Instatiation of @c linear_feedback_shift model a + * \pseudo_random_number_generator. It was originally + * proposed in + * + * @blockquote + * "Random numbers generated by linear recurrence modulo two.", + * Tausworthe, R. C.(1965), Mathematics of Computation 19, 201-209. + * @endblockquote + */ template class linear_feedback_shift { @@ -77,7 +86,12 @@ public: seed(first, last); } - void seed(UIntType s0 = 341) { assert(s0 >= (1 << (w-k))); value = s0; } + void seed(UIntType s0 = 341) { + if(s0 < (1 << (w-k))) { + s0 += 1 << (w-k); + } + value = s0; + } template void seed(It& first, It last) { if(first == last) diff --git a/deal.II/contrib/boost/include/boost/random/lognormal_distribution.hpp b/deal.II/contrib/boost/include/boost/random/lognormal_distribution.hpp index 05f6ff6ad6..ed7d900dc0 100644 --- a/deal.II/contrib/boost/include/boost/random/lognormal_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/lognormal_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: lognormal_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: lognormal_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -40,6 +40,13 @@ namespace boost { using std::exp; #endif +/** + * Instantiations of class template lognormal_distribution model a + * \random_distribution. Such a distribution produces random numbers + * with \f$p(x) = \frac{1}{x \sigma_N \sqrt{2\pi}} e^{\frac{-\left(\log(x)-\mu_N\right)^2}{2\sigma_N^2}}\f$ + * for x > 0, where \f$\mu_N = \log\left(\frac{\mu^2}{\sqrt{\sigma^2 + \mu^2}}\right)\f$ and + * \f$\sigma_N = \sqrt{\log\left(1 + \frac{\sigma^2}{\mu^2}\right)}\f$. + */ template class lognormal_distribution { @@ -51,6 +58,10 @@ public: BOOST_STATIC_ASSERT(!std::numeric_limits::is_integer); #endif + /** + * Constructs a lognormal_distribution. @c mean and @c sigma are the + * mean and standard deviation of the lognormal distribution. + */ explicit lognormal_distribution(result_type mean_arg = result_type(1), result_type sigma_arg = result_type(1)) : _mean(mean_arg), _sigma(sigma_arg) @@ -95,6 +106,8 @@ public: #endif private: + + /// \cond hide_private_members void init() { #ifndef BOOST_NO_STDC_NAMESPACE @@ -104,6 +117,7 @@ private: _nmean = log(_mean*_mean/sqrt(_sigma*_sigma + _mean*_mean)); _nsigma = sqrt(log(_sigma*_sigma/_mean/_mean+result_type(1))); } + /// \endcond RealType _mean, _sigma; RealType _nmean, _nsigma; diff --git a/deal.II/contrib/boost/include/boost/random/mersenne_twister.hpp b/deal.II/contrib/boost/include/boost/random/mersenne_twister.hpp index b60aadfab0..fa80aa622f 100644 --- a/deal.II/contrib/boost/include/boost/random/mersenne_twister.hpp +++ b/deal.II/contrib/boost/include/boost/random/mersenne_twister.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: mersenne_twister.hpp 53871 2009-06-13 17:54:06Z steven_watanabe $ + * $Id: mersenne_twister.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -33,7 +33,34 @@ namespace boost { namespace random { -// http://www.math.keio.ac.jp/matumoto/emt.html +/** + * Instantiations of class template mersenne_twister model a + * \pseudo_random_number_generator. It uses the algorithm described in + * + * @blockquote + * "Mersenne Twister: A 623-dimensionally equidistributed uniform + * pseudo-random number generator", Makoto Matsumoto and Takuji Nishimura, + * ACM Transactions on Modeling and Computer Simulation: Special Issue on + * Uniform Random Number Generation, Vol. 8, No. 1, January 1998, pp. 3-30. + * @endblockquote + * + * @xmlnote + * The boost variant has been implemented from scratch and does not + * derive from or use mt19937.c provided on the above WWW site. However, it + * was verified that both produce identical output. + * @endxmlnote + * + * The seeding from an integer was changed in April 2005 to address a + * weakness. + * + * The quality of the generator crucially depends on the choice of the + * parameters. User code should employ one of the sensibly parameterized + * generators such as \mt19937 instead. + * + * The generator requires considerable amounts of memory for the storage of + * its state array. For example, \mt11213b requires about 1408 bytes and + * \mt19937 requires about 2496 bytes. + */ template class mersenne_twister @@ -54,19 +81,39 @@ public: BOOST_STATIC_CONSTANT(bool, has_fixed_range = false); + /** + * Constructs a @c mersenne_twister and calls @c seed(). + */ mersenne_twister() { seed(); } + /** + * Constructs a @c mersenne_twister and calls @c seed(value). + */ BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(mersenne_twister, UIntType, value) { seed(value); } template mersenne_twister(It& first, It last) { seed(first,last); } + /** + * Constructs a mersenne_twister and calls @c seed(gen). + * + * @xmlnote + * The copy constructor will always be preferred over + * the templated constructor. + * @endxmlnote + */ BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(mersenne_twister, Generator, gen) { seed(gen); } // compiler-generated copy ctor and assignment operator are fine + /** Calls @c seed(result_type(5489)). */ void seed() { seed(UIntType(5489)); } + /** + * Sets the state x(0) to v mod 2w. Then, iteratively, + * sets x(i) to (i + 1812433253 * (x(i-1) xor (x(i-1) rshift w-2))) mod 2w + * for i = 1 .. n-1. x(n) is the first value to be returned by operator(). + */ BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(mersenne_twister, UIntType, value) { // New seeding algorithm from @@ -81,9 +128,12 @@ public: } } - // For GCC, moving this function out-of-line prevents inlining, which may - // reduce overall object code size. However, MSVC does not grok - // out-of-line definitions of member function templates. + /** + * Sets the state of this mersenne_twister to the values + * returned by n invocations of gen. + * + * Complexity: Exactly n invocations of gen. + */ BOOST_RANDOM_DETAIL_GENERATOR_SEED(mersenne_twister, Generator, gen) { #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS @@ -170,6 +220,7 @@ public: #endif private: + /// \cond hide_private_members // returns x(i-n+index), where index is in 0..n-1 UIntType compute(unsigned int index) const { @@ -177,6 +228,7 @@ private: return x[ (i + n + index) % (2*n) ]; } void twist(int block); + /// \endcond // state representation: next output is o(x(i)) // x[0] ... x[k] x[k+1] ... x[n-1] x[n] ... x[2*n-1] represents @@ -225,6 +277,7 @@ template::output_l; #endif +/// \cond hide_private_members template void mersenne_twister::twist(int block) @@ -256,6 +309,7 @@ void mersenne_twister::twist(int block) i = 0; } } +/// \endcond template @@ -278,11 +332,31 @@ mersenne_twister::operator()() } // namespace random - +/** + * The specializations \mt11213b and \mt19937 are from + * + * @blockquote + * "Mersenne Twister: A 623-dimensionally equidistributed + * uniform pseudo-random number generator", Makoto Matsumoto + * and Takuji Nishimura, ACM Transactions on Modeling and + * Computer Simulation: Special Issue on Uniform Random Number + * Generation, Vol. 8, No. 1, January 1998, pp. 3-30. + * @endblockquote + */ typedef random::mersenne_twister mt11213b; -// validation by experiment from mt19937.c +/** + * The specializations \mt11213b and \mt19937 are from + * + * @blockquote + * "Mersenne Twister: A 623-dimensionally equidistributed + * uniform pseudo-random number generator", Makoto Matsumoto + * and Takuji Nishimura, ACM Transactions on Modeling and + * Computer Simulation: Special Issue on Uniform Random Number + * Generation, Vol. 8, No. 1, January 1998, pp. 3-30. + * @endblockquote + */ typedef random::mersenne_twister mt19937; diff --git a/deal.II/contrib/boost/include/boost/random/normal_distribution.hpp b/deal.II/contrib/boost/include/boost/random/normal_distribution.hpp index 486411e02a..3375993456 100644 --- a/deal.II/contrib/boost/include/boost/random/normal_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/normal_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: normal_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: normal_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -25,6 +25,13 @@ namespace boost { +/** + * Instantiations of class template normal_distribution model a + * \random_distribution. Such a distribution produces random numbers + * @c x distributed with probability density function + * \f$p(x) = \frac{1}{\sqrt{2\pi\sigma}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}\f$, + * where mean and sigma are the parameters of the distribution. + */ // deterministic Box-Muller method, uses trigonometric functions template class normal_distribution @@ -37,6 +44,12 @@ public: BOOST_STATIC_ASSERT(!std::numeric_limits::is_integer); #endif + /** + * Constructs a normal_distribution object. @c mean and @c sigma are + * the parameters for the distribution. + * + * Requires: sigma > 0 + */ explicit normal_distribution(const result_type& mean_arg = result_type(0), const result_type& sigma_arg = result_type(1)) : _mean(mean_arg), _sigma(sigma_arg), _valid(false) @@ -52,7 +65,13 @@ public: // compiler-generated copy ctor and assignment operator are fine + /** + * Returns: The "mean" parameter of the distribution. + */ RealType mean() const { return _mean; } + /** + * Returns: The "sigma" parameter of the distribution. + */ RealType sigma() const { return _sigma; } void reset() { _valid = false; } diff --git a/deal.II/contrib/boost/include/boost/random/poisson_distribution.hpp b/deal.II/contrib/boost/include/boost/random/poisson_distribution.hpp index 3cc2ba6cbc..9a2e4b9846 100644 --- a/deal.II/contrib/boost/include/boost/random/poisson_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/poisson_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: poisson_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: poisson_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * */ @@ -24,6 +24,12 @@ namespace boost { // Knuth + +/** + * An instantiation of the class template @c poisson_distribution is a + * model of \random_distribution. The poisson distribution has + * \f$p(i) = \frac{e^{-\lambda}\lambda^i}{i!}\f$ + */ template class poisson_distribution { @@ -31,6 +37,11 @@ public: typedef RealType input_type; typedef IntType result_type; + /** + * Constructs a @c poisson_distribution with the parameter @c mean. + * + * Requires: mean > 0 + */ explicit poisson_distribution(const RealType& mean_arg = RealType(1)) : _mean(mean_arg) { @@ -46,6 +57,9 @@ public: // compiler-generated copy ctor and assignment operator are fine + /** + * Returns: the "mean" parameter of the distribution. + */ RealType mean() const { return _mean; } void reset() { } @@ -81,6 +95,7 @@ public: #endif private: + /// \cond hide_private_members void init() { #ifndef BOOST_NO_STDC_NAMESPACE @@ -89,6 +104,7 @@ private: #endif _exp_mean = exp(-_mean); } + /// \endcond RealType _mean; // some precomputed data from the parameters diff --git a/deal.II/contrib/boost/include/boost/random/random_number_generator.hpp b/deal.II/contrib/boost/include/boost/random/random_number_generator.hpp index 3402a4799a..55a945b9e3 100644 --- a/deal.II/contrib/boost/include/boost/random/random_number_generator.hpp +++ b/deal.II/contrib/boost/include/boost/random/random_number_generator.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: random_number_generator.hpp 26164 2004-11-09 21:22:00Z jmaurer $ + * $Id: random_number_generator.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -24,7 +24,14 @@ namespace boost { -// a model for RandomNumberGenerator std:25.2.11 [lib.alg.random.shuffle] +/** + * Instantiations of class template random_number_generator model a + * RandomNumberGenerator (std:25.2.11 [lib.alg.random.shuffle]). On + * each invocation, it returns a uniformly distributed integer in + * the range [0..n). + * + * The template parameter IntType shall denote some integer-like value type. + */ template class random_number_generator { @@ -32,6 +39,11 @@ public: typedef UniformRandomNumberGenerator base_type; typedef IntType argument_type; typedef IntType result_type; + /** + * Constructs a random_number_generator functor with the given + * \uniform_random_number_generator as the underlying source of + * random numbers. + */ random_number_generator(base_type& rng) : _rng(rng) { #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS @@ -41,6 +53,9 @@ public: // compiler-generated copy ctor is fine // assignment is disallowed because there is a reference member + /** + * Returns a value in the range [0, n) + */ result_type operator()(argument_type n) { typedef uniform_int dist_type; diff --git a/deal.II/contrib/boost/include/boost/random/ranlux.hpp b/deal.II/contrib/boost/include/boost/random/ranlux.hpp index 3859843c89..2faa1cc2de 100644 --- a/deal.II/contrib/boost/include/boost/random/ranlux.hpp +++ b/deal.II/contrib/boost/include/boost/random/ranlux.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: ranlux.hpp 24096 2004-07-27 03:43:34Z dgregor $ + * $Id: ranlux.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 created @@ -28,20 +28,51 @@ namespace random { typedef subtract_with_carry_01 ranlux64_base_01; } +namespace random { +namespace detail { +/** + * The ranlux family of generators are described in + * + * @blockquote + * "A portable high-quality random number generator for lattice field theory + * calculations", M. Luescher, Computer Physics Communications, 79 (1994) + * pp 100-110. + * @endblockquote + * + * The levels are given in + * + * @blockquote + * "RANLUX: A Fortran implementation ofthe high-quality + * pseudorandom number generator of Luescher", F. James, + * Computer Physics Communications 79 (1994) 111-114 + * @endblockquote + */ +class ranlux_documentation {}; +} +} + +/** @copydoc boost::random::detail::ranlux_documentation */ typedef random::discard_block ranlux3; +/** @copydoc boost::random::detail::ranlux_documentation */ typedef random::discard_block ranlux4; +/** @copydoc boost::random::detail::ranlux_documentation */ typedef random::discard_block ranlux3_01; +/** @copydoc boost::random::detail::ranlux_documentation */ typedef random::discard_block ranlux4_01; +/** @copydoc boost::random::detail::ranlux_documentation */ typedef random::discard_block ranlux64_3_01; +/** @copydoc boost::random::detail::ranlux_documentation */ typedef random::discard_block ranlux64_4_01; #if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T) namespace random { typedef random::subtract_with_carry ranlux64_base; } +/** @copydoc boost::random::detail::ranlux_documentation */ typedef random::discard_block ranlux64_3; +/** @copydoc boost::random::detail::ranlux_documentation */ typedef random::discard_block ranlux64_4; #endif /* !BOOST_NO_INT64_T && !BOOST_NO_INTEGRAL_INT64_T */ diff --git a/deal.II/contrib/boost/include/boost/random/shuffle_output.hpp b/deal.II/contrib/boost/include/boost/random/shuffle_output.hpp index cacf8c3804..f06f462104 100644 --- a/deal.II/contrib/boost/include/boost/random/shuffle_output.hpp +++ b/deal.II/contrib/boost/include/boost/random/shuffle_output.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: shuffle_output.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: shuffle_output.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -28,7 +28,30 @@ namespace boost { namespace random { -// Carter Bays and S.D. Durham 1979 +/** + * Instatiations of class template shuffle_output model a + * \pseudo_random_number_generator. It mixes the output + * of some (usually \linear_congruential) \uniform_random_number_generator + * to get better statistical properties. + * The algorithm is described in + * + * @blockquote + * "Improving a poor random number generator", Carter Bays + * and S.D. Durham, ACM Transactions on Mathematical Software, + * Vol 2, No. 1, March 1976, pp. 59-64. + * http://doi.acm.org/10.1145/355666.355670 + * @endblockquote + * + * The output of the base generator is buffered in an array of + * length k. Every output X(n) has a second role: It gives an + * index into the array where X(n+1) will be retrieved. Used + * array elements are replaced with fresh output from the base + * generator. + * + * Template parameters are the base generator and the array + * length k, which should be around 100. The template parameter + * val is the validation value checked by validation. + */ template explicit shuffle_output(T s) : _rng(s) { init(); } + /** + * Constructs a shuffle_output generator by using a copy + * of the provided generator. + * + * Precondition: The template argument UniformRandomNumberGenerator + * shall denote a CopyConstructible type. + * + * Complexity: Exactly k+1 invocations of the base generator. + */ explicit shuffle_output(const base_type & rng) : _rng(rng) { init(); } template shuffle_output(It& first, It last) : _rng(first, last) { init(); } void seed() { _rng.seed(); init(); } + /** + * Invokes the one-argument seed method of the base generator + * with the parameter seed and re-initializes the internal buffer array. + * + * Complexity: Exactly k+1 invocations of the base generator. + */ template void seed(T s) { _rng.seed(s); init(); } template void seed(It& first, It last) @@ -165,6 +215,15 @@ const int shuffle_output::buffer_size; } // namespace random // validation by experiment from Harry Erwin's generator.h (private e-mail) +/** + * According to Harry Erwin (private e-mail), the specialization + * @c kreutzer1986 was suggested in: + * + * @blockquote + * "System Simulation: Programming Styles and Languages (International + * Computer Science Series)", Wolfgang Kreutzer, Addison-Wesley, December 1986. + * @endblockquote + */ typedef random::shuffle_output< random::linear_congruential, 97, 139726> kreutzer1986; diff --git a/deal.II/contrib/boost/include/boost/random/subtract_with_carry.hpp b/deal.II/contrib/boost/include/boost/random/subtract_with_carry.hpp index 2c851ff738..ca5c78ba6d 100644 --- a/deal.II/contrib/boost/include/boost/random/subtract_with_carry.hpp +++ b/deal.II/contrib/boost/include/boost/random/subtract_with_carry.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: subtract_with_carry.hpp 53871 2009-06-13 17:54:06Z steven_watanabe $ + * $Id: subtract_with_carry.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2002-03-02 created @@ -62,10 +62,19 @@ namespace detail carry = value / modulus; } } -# endif -// subtract-with-carry generator -// Marsaglia and Zaman +# endif +/** + * Instantiations of @c subtract_with_carry model a + * \pseudo_random_number_generator. The algorithm is + * described in + * + * @blockquote + * "A New Class of Random Number Generators", George + * Marsaglia and Arif Zaman, Annals of Applied Probability, + * Volume 1, Number 3 (1991), 462-480. + * @endblockquote + */ template class subtract_with_carry @@ -205,11 +214,13 @@ public: #endif private: + /// \cond hide_private_members // returns x(i-r+index), where index is in 0..r-1 IntType compute(unsigned int index) const { return x[(k+index) % long_lag]; } + /// \endcond // state representation; next output (state) is x(i) // x[0] ... x[k] x[k+1] ... x[long_lag-1] represents @@ -248,6 +259,7 @@ const unsigned int subtract_with_carry::short_lag; // use a floating-point representation to produce values in [0..1) +/** @copydoc boost::random::subtract_with_carry */ template class subtract_with_carry_01 { @@ -269,6 +281,7 @@ public: { init_modulus(); seed(first,last); } private: + /// \cond hide_private_members void init_modulus() { #ifndef BOOST_NO_STDC_NAMESPACE @@ -277,6 +290,7 @@ private: #endif _modulus = pow(RealType(2), word_size); } + /// \endcond hide_private_members public: // compiler-generated copy ctor and assignment operator are fine @@ -416,7 +430,9 @@ public: #endif private: + /// \cond hide_private_members RealType compute(unsigned int index) const; + /// \endcond unsigned int k; RealType carry; RealType x[long_lag]; @@ -435,12 +451,13 @@ template const unsigned int subtract_with_carry_01::short_lag; #endif +/// \cond hide_private_members template RealType subtract_with_carry_01::compute(unsigned int index) const { return x[(k+index) % long_lag]; } - +/// \endcond } // namespace random } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/random/triangle_distribution.hpp b/deal.II/contrib/boost/include/boost/random/triangle_distribution.hpp index 1659b93346..7112eb9041 100644 --- a/deal.II/contrib/boost/include/boost/random/triangle_distribution.hpp +++ b/deal.II/contrib/boost/include/boost/random/triangle_distribution.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: triangle_distribution.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: triangle_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -23,8 +23,12 @@ namespace boost { -// triangle distribution, with a smallest, b most probable, and c largest -// value. +/** + * Instantiations of @c triangle_distribution model a \random_distribution. + * A @c triangle_distribution has three parameters, @c a, @c b, and @c c, + * which are the smallest, the most probable and the largest values of + * the distribution respectively. + */ template class triangle_distribution { @@ -32,6 +36,12 @@ public: typedef RealType input_type; typedef RealType result_type; + /** + * Constructs a @c triangle_distribution with the parameters + * @c a, @c b, and @c c. + * + * Preconditions: a <= b <= c. + */ explicit triangle_distribution(result_type a_arg = result_type(0), result_type b_arg = result_type(0.5), result_type c_arg = result_type(1)) @@ -42,8 +52,12 @@ public: } // compiler-generated copy ctor and assignment operator are fine + + /** Returns the @c a parameter of the distribution */ result_type a() const { return _a; } + /** Returns the @c b parameter of the distribution */ result_type b() const { return _b; } + /** Returns the @c c parameter of the distribution */ result_type c() const { return _c; } void reset() { } @@ -81,6 +95,7 @@ public: #endif private: + /// \cond hide_private_members void init() { #ifndef BOOST_NO_STDC_NAMESPACE @@ -92,6 +107,7 @@ private: q1 = d1 / d2; p1 = sqrt(d1 * d2); } + /// \endcond result_type _a, _b, _c; result_type d1, d2, d3, q1, p1; diff --git a/deal.II/contrib/boost/include/boost/random/uniform_01.hpp b/deal.II/contrib/boost/include/boost/random/uniform_01.hpp index 459735c4f1..2cdd05f651 100644 --- a/deal.II/contrib/boost/include/boost/random/uniform_01.hpp +++ b/deal.II/contrib/boost/include/boost/random/uniform_01.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: uniform_01.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: uniform_01.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -23,8 +23,57 @@ #include #include +#include + namespace boost { +#ifdef BOOST_RANDOM_DOXYGEN + +/** + * The distribution function uniform_01 models a \random_distribution. + * On each invocation, it returns a random floating-point value + * uniformly distributed in the range [0..1). + * + * The template parameter RealType shall denote a float-like value type + * with support for binary operators +, -, and /. + * + * Note: The current implementation is buggy, because it may not fill + * all of the mantissa with random bits. I'm unsure how to fill a + * (to-be-invented) @c boost::bigfloat class with random bits efficiently. + * It's probably time for a traits class. + */ +template +class uniform_01 +{ +public: + typedef RealType input_type; + typedef RealType result_type; + result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const; + result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const; + void reset(); + + template + result_type operator()(Engine& eng); + +#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS + template + friend std::basic_ostream& + operator<<(std::basic_ostream& os, const new_uniform_01&) + { + return os; + } + + template + friend std::basic_istream& + operator>>(std::basic_istream& is, new_uniform_01&) + { + return is; + } +#endif +}; + +#else + namespace detail { template @@ -215,6 +264,10 @@ public: #endif }; +#endif + } // namespace boost +#include + #endif // BOOST_RANDOM_UNIFORM_01_HPP diff --git a/deal.II/contrib/boost/include/boost/random/uniform_int.hpp b/deal.II/contrib/boost/include/boost/random/uniform_int.hpp index 372a6c7a5c..426a9e1510 100644 --- a/deal.II/contrib/boost/include/boost/random/uniform_int.hpp +++ b/deal.II/contrib/boost/include/boost/random/uniform_int.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: uniform_int.hpp 56814 2009-10-14 04:54:01Z steven_watanabe $ + * $Id: uniform_int.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-04-08 added min class uniform_int { public: typedef IntType input_type; typedef IntType result_type; + + /// \cond hide_private_members typedef typename make_unsigned::type range_type; + /// \endcond + /** + * Constructs a uniform_int object. @c min and @c max are + * the parameters of the distribution. + * + * Requires: min <= max + */ explicit uniform_int(IntType min_arg = 0, IntType max_arg = 9) : _min(min_arg), _max(max_arg) { @@ -49,7 +64,13 @@ public: init(); } + /** + * Returns: The "min" parameter of the distribution + */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; } + /** + * Returns: The "max" parameter of the distribution + */ result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; } void reset() { } @@ -93,8 +114,17 @@ public: #endif private: + +#ifdef BOOST_MSVC +#pragma warning(push) +// disable division by zero warning, since we can't +// actually divide by zero. +#pragma warning(disable:4723) +#endif + + /// \cond hide_private_members template - static result_type generate(Engine& eng, result_type min_value, result_type max_value, range_type range) + static result_type generate(Engine& eng, result_type min_value, result_type /*max_value*/, range_type range) { typedef typename Engine::result_type base_result; // ranges are always unsigned @@ -248,11 +278,17 @@ private: } } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + void init() { _range = random::detail::subtract()(_max, _min); } + /// \endcond + // The result_type may be signed or unsigned, but the _range is always // unsigned. result_type _min, _max; diff --git a/deal.II/contrib/boost/include/boost/random/uniform_on_sphere.hpp b/deal.II/contrib/boost/include/boost/random/uniform_on_sphere.hpp index 650030ee83..c5c7280696 100644 --- a/deal.II/contrib/boost/include/boost/random/uniform_on_sphere.hpp +++ b/deal.II/contrib/boost/include/boost/random/uniform_on_sphere.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: uniform_on_sphere.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: uniform_on_sphere.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-02-18 moved to individual header files @@ -24,6 +24,16 @@ namespace boost { +/** + * Instantiations of class template uniform_on_sphere model a + * \random_distribution. Such a distribution produces random + * numbers uniformly distributed on the unit sphere of arbitrary + * dimension @c dim. The @c Cont template parameter must be a STL-like + * container type with begin and end operations returning non-const + * ForwardIterators of type @c Cont::iterator. Each invocation of the + * @c UniformRandomNumberGenerator shall result in a floating-point + * value in the range [0,1). + */ template > class uniform_on_sphere { @@ -31,6 +41,10 @@ public: typedef RealType input_type; typedef Cont result_type; + /** + * Constructs a @c uniform_on_sphere distribution. + * @c dim is the dimension of the sphere. + */ explicit uniform_on_sphere(int dim = 2) : _container(dim), _dim(dim) { } // compiler-generated copy ctor and assignment operator are fine diff --git a/deal.II/contrib/boost/include/boost/random/uniform_real.hpp b/deal.II/contrib/boost/include/boost/random/uniform_real.hpp index 6a6e90065b..06bfbc39ab 100644 --- a/deal.II/contrib/boost/include/boost/random/uniform_real.hpp +++ b/deal.II/contrib/boost/include/boost/random/uniform_real.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: uniform_real.hpp 56814 2009-10-14 04:54:01Z steven_watanabe $ + * $Id: uniform_real.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-04-08 added min::digits random binary digits, i.e. + * the mantissa of the floating-point value is completely filled with + * random bits. + * + * Note: The current implementation is buggy, because it may not fill + * all of the mantissa with random bits. + */ template class uniform_real { @@ -34,6 +44,12 @@ public: typedef RealType input_type; typedef RealType result_type; + /** + * Constructs a uniform_real object. @c min and @c max are the + * parameters of the distribution. + * + * Requires: min <= max + */ explicit uniform_real(RealType min_arg = RealType(0), RealType max_arg = RealType(1)) : _min(min_arg), _max(max_arg) @@ -46,7 +62,13 @@ public: // compiler-generated copy ctor and assignment operator are fine + /** + * Returns: The "min" parameter of the distribution + */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; } + /** + * Returns: The "max" parameter of the distribution + */ result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; } void reset() { } diff --git a/deal.II/contrib/boost/include/boost/random/uniform_smallint.hpp b/deal.II/contrib/boost/include/boost/random/uniform_smallint.hpp index 60ea38480c..af03b83e0e 100644 --- a/deal.II/contrib/boost/include/boost/random/uniform_smallint.hpp +++ b/deal.II/contrib/boost/include/boost/random/uniform_smallint.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: uniform_smallint.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $ + * $Id: uniform_smallint.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * * Revision history * 2001-04-08 added minout=(max-min+1) the desired range of integer numbers, and + * let rbase be the range of the underlying source of random + * numbers. Then, for the uniform distribution, the theoretical probability + * for any number i in the range rout will be pout(i) = + * 1/rout. Likewise, assume a uniform distribution on rbase for + * the underlying source of random numbers, i.e. pbase(i) = + * 1/rbase. Let pout_s(i) denote the random + * distribution generated by @c uniform_smallint. Then the sum over all + * i in rout of (pout_s(i)/pout(i) - 1)2 + * shall not exceed rout/rbase2 + * (rbase mod rout)(rout - + * rbase mod rout). + * + * The template parameter IntType shall denote an integer-like value type. + * + * Note: The property above is the square sum of the relative differences + * in probabilities between the desired uniform distribution + * pout(i) and the generated distribution pout_s(i). + * The property can be fulfilled with the calculation + * (base_rng mod rout), as follows: Let r = rbase mod + * rout. The base distribution on rbase is folded onto the + * range rout. The numbers i < r have assigned (rbase + * div rout)+1 numbers of the base distribution, the rest has + * only (rbase div rout). Therefore, + * pout_s(i) = ((rbase div rout)+1) / + * rbase for i < r and pout_s(i) = (rbase + * div rout)/rbase otherwise. Substituting this in the + * above sum formula leads to the desired result. + * + * Note: The upper bound for (rbase mod rout) + * (rout - rbase mod rout) is + * rout2/4. Regarding the upper bound for the + * square sum of the relative quantization error of + * rout3/(4*rbase2), it + * seems wise to either choose rbase so that rbase > + * 10*rout2 or ensure that rbase is + * divisible by rout. + */ template class uniform_smallint { @@ -37,6 +83,10 @@ public: typedef IntType input_type; typedef IntType result_type; + /** + * Constructs a @c uniform_smallint. @c min and @c max are the + * lower and upper bounds of the output range, respectively. + */ explicit uniform_smallint(IntType min_arg = 0, IntType max_arg = 9) : _min(min_arg), _max(max_arg) { @@ -76,7 +126,7 @@ public: r_base /= 2; } - return ((eng() - (eng.min)()) / _factor) % _range + _min; + return static_cast(((eng() - (eng.min)()) / _factor) % _range + _min); } #ifndef BOOST_RANDOM_NO_STREAM_OPERATORS diff --git a/deal.II/contrib/boost/include/boost/random/variate_generator.hpp b/deal.II/contrib/boost/include/boost/random/variate_generator.hpp index 0c6cc2032d..930d96187f 100644 --- a/deal.II/contrib/boost/include/boost/random/variate_generator.hpp +++ b/deal.II/contrib/boost/include/boost/random/variate_generator.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: variate_generator.hpp 27375 2005-02-14 11:53:50Z johnmaddock $ + * $Id: variate_generator.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * */ @@ -29,8 +29,12 @@ #include #endif +#include + namespace boost { +/// \cond hide_private_members + namespace random { namespace detail { @@ -81,7 +85,31 @@ struct engine_helper } // namespace detail } // namespace random +///\endcond +/** + * A random variate generator is used to join a random number + * generator together with a random number distribution. + * Boost.Random provides a vast choice of \generators as well + * as \distributions. + * + * Instantations of class template @c variate_generator model + * a \number_generator. + * + * The argument for the template parameter Engine shall be of + * the form U, U&, or U*, where U models a + * \uniform_random_number_generator. Then, the member + * engine_value_type names U (not the pointer or reference to U). + * + * Specializations of @c variate_generator satisfy the + * requirements of CopyConstructible. They also satisfy the + * requirements of Assignable unless the template parameter + * Engine is of the form U&. + * + * The complexity of all functions specified in this section + * is constant. No function described in this section except + * the constructor throws an exception. + */ template class variate_generator { @@ -94,27 +122,84 @@ public: typedef Distribution distribution_type; typedef typename Distribution::result_type result_type; + /** + * Constructs a @c variate_generator object with the associated + * \uniform_random_number_generator eng and the associated + * \random_distribution d. + * + * Throws: If and what the copy constructor of Engine or + * Distribution throws. + */ variate_generator(Engine e, Distribution d) : _eng(decorated_engine(e)), _dist(d) { } + /** + * Returns: distribution()(e) + * + * Notes: The sequence of numbers produced by the + * \uniform_random_number_generator e, se, is + * obtained from the sequence of numbers produced by the + * associated \uniform_random_number_generator eng, seng, + * as follows: Consider the values of @c numeric_limits::is_integer + * for @c T both @c Distribution::input_type and + * @c engine_value_type::result_type. If the values for both types are + * true, then se is identical to seng. Otherwise, if the + * values for both types are false, then the numbers in seng + * are divided by engine().max()-engine().min() to obtain the numbers + * in se. Otherwise, if the value for + * @c engine_value_type::result_type is true and the value for + * @c Distribution::input_type is false, then the numbers in seng + * are divided by engine().max()-engine().min()+1 to obtain the numbers in + * se. Otherwise, the mapping from seng to + * se is implementation-defined. In all cases, an + * implicit conversion from @c engine_value_type::result_type to + * @c Distribution::input_type is performed. If such a conversion does + * not exist, the program is ill-formed. + */ result_type operator()() { return _dist(_eng); } + /** + * Returns: distribution()(e, value). + * For the semantics of e, see the description of operator()(). + */ template result_type operator()(T value) { return _dist(_eng, value); } + /** + * Returns: A reference to the associated uniform random number generator. + */ engine_value_type& engine() { return _eng.base().base(); } + /** + * Returns: A reference to the associated uniform random number generator. + */ const engine_value_type& engine() const { return _eng.base().base(); } + /** + * Returns: A reference to the associated random distribution. + */ distribution_type& distribution() { return _dist; } + /** + * Returns: A reference to the associated random distribution. + */ const distribution_type& distribution() const { return _dist; } + /** + * Precondition: distribution().min() is well-formed + * + * Returns: distribution().min() + */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (distribution().min)(); } + /** + * Precondition: distribution().max() is well-formed + * + * Returns: distribution().max() + */ result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (distribution().max)(); } private: #if BOOST_WORKAROUND(__BORLANDC__, <= 0x564) typedef typename random::detail::engine_helper< - boost::is_integral::value, - boost::is_integral::value + ::boost::is_integral::value, + ::boost::is_integral::value >::BOOST_NESTED_TEMPLATE impl::type internal_engine_type; #else enum { @@ -130,4 +215,6 @@ private: } // namespace boost +#include + #endif // BOOST_RANDOM_RANDOM_GENERATOR_HPP diff --git a/deal.II/contrib/boost/include/boost/random/xor_combine.hpp b/deal.II/contrib/boost/include/boost/random/xor_combine.hpp index 02fbfa6770..fb39490fba 100644 --- a/deal.II/contrib/boost/include/boost/random/xor_combine.hpp +++ b/deal.II/contrib/boost/include/boost/random/xor_combine.hpp @@ -7,7 +7,7 @@ * * See http://www.boost.org for most recent version including documentation. * - * $Id: xor_combine.hpp 53871 2009-06-13 17:54:06Z steven_watanabe $ + * $Id: xor_combine.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $ * */ @@ -27,13 +27,24 @@ namespace boost { namespace random { +/// \cond hide_private_members #ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS #define BOOST_RANDOM_VAL_TYPE typename URNG1::result_type #else #define BOOST_RANDOM_VAL_TYPE uint32_t #endif +/// \endcond -template +/** + * Instantiations of @c xor_combine model a \pseudo_random_number_generator. + * To produce its output it invokes each of the base generators, shifts + * their results and xors them together. + */ +template class xor_combine { public: @@ -45,25 +56,58 @@ public: BOOST_STATIC_CONSTANT(int, shift1 = s1); BOOST_STATIC_CONSTANT(int, shift2 = s2); + /** + * Constructors a @c xor_combine by default constructing + * both base generators. + */ xor_combine() : _rng1(), _rng2() { } + /** + * Constructs a @c xor_combine by copying two base generators. + */ xor_combine(const base1_type & rng1, const base2_type & rng2) : _rng1(rng1), _rng2(rng2) { } + /** + * Constructs a @c xor_combine, seeding both base generators + * with @c v. + */ xor_combine(const result_type & v) : _rng1(v), _rng2(v) { } + /** + * Constructs a @c xor_combine, seeding both base generators + * with values from the iterator range [first, last) and changes + * first to point to the element after the last one used. If there + * are not enough elements in the range to seed both generators, + * throws @c std::invalid_argument. + */ template xor_combine(It& first, It last) : _rng1(first, last), _rng2( /* advanced by other call */ first, last) { } + /** + * Calls @c seed() for both base generators. + */ void seed() { _rng1.seed(); _rng2.seed(); } + /** + * @c seeds both base generators with @c v. + */ void seed(const result_type & v) { _rng1.seed(v); _rng2.seed(v); } + /** + * seeds both base generators with values from the iterator + * range [first, last) and changes first to point to the element + * after the last one used. If there are not enough elements in + * the range to seed both generators, throws @c std::invalid_argument. + */ template void seed(It& first, It last) { _rng1.seed(first, last); _rng2.seed(first, last); } + /** Returns the first base generator. */ const base1_type& base1() { return _rng1; } + /** Returns the second base generator. */ const base2_type& base2() { return _rng2; } + /** Returns the next value of the generator. */ result_type operator()() { // MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope @@ -75,7 +119,13 @@ public: return (_rng1() << s1) ^ (_rng2() << s2); } + /** + * Returns the smallest value that the generator can produce. + */ result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return std::min BOOST_PREVENT_MACRO_SUBSTITUTION((_rng1.min)(), (_rng2.min)()); } + /** + * Returns the largest value that the generator can produce. + */ result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return std::max BOOST_PREVENT_MACRO_SUBSTITUTION((_rng1.min)(), (_rng2.max)()); } static bool validation(result_type x) { return val == x; } diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/adjacent_filtered.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/adjacent_filtered.hpp new file mode 100644 index 0000000000..c01f1c10ac --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/adjacent_filtered.hpp @@ -0,0 +1,239 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_ADJACENT_FILTER_IMPL_HPP +#define BOOST_RANGE_ADAPTOR_ADJACENT_FILTER_IMPL_HPP + +#include +#ifdef BOOST_MSVC +#pragma warning( push ) +#pragma warning( disable : 4355 ) +#endif + +#include +#include +#include +#include +#include +#include + + +namespace boost +{ + + namespace range_detail + { + template< class Iter, class Pred, bool default_pass > + class skip_iterator + : public boost::iterator_adaptor< + skip_iterator, + Iter, + BOOST_DEDUCED_TYPENAME std::iterator_traits::value_type, + boost::forward_traversal_tag, + BOOST_DEDUCED_TYPENAME std::iterator_traits::reference, + BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type + > + , private Pred + { + private: + typedef boost::iterator_adaptor< + skip_iterator, + Iter, + BOOST_DEDUCED_TYPENAME std::iterator_traits::value_type, + boost::forward_traversal_tag, + BOOST_DEDUCED_TYPENAME std::iterator_traits::reference, + BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type + > base_t; + + public: + typedef Pred pred_t; + typedef Iter iter_t; + + skip_iterator() : m_last() {} + + skip_iterator(iter_t it, iter_t last, const Pred& pred) + : base_t(it) + , pred_t(pred) + , m_last(last) + { + move_to_next_valid(); + } + + template + skip_iterator( const skip_iterator& other ) + : base_t(other.base()) + , pred_t(other) + , m_last(other.m_last) {} + + void move_to_next_valid() + { + iter_t& it = this->base_reference(); + pred_t& bi_pred = *this; + if (it != m_last) + { + if (default_pass) + { + iter_t nxt = ::boost::next(it); + while (nxt != m_last && !bi_pred(*it, *nxt)) + { + ++it; + ++nxt; + } + } + else + { + iter_t nxt = ::boost::next(it); + for(; nxt != m_last; ++it, ++nxt) + { + if (bi_pred(*it, *nxt)) + { + break; + } + } + if (nxt == m_last) + { + it = m_last; + } + } + } + } + + void increment() + { + iter_t& it = this->base_reference(); + BOOST_ASSERT( it != m_last ); + ++it; + move_to_next_valid(); + } + + iter_t m_last; + }; + + template< class P, class R, bool default_pass > + struct adjacent_filter_range + : iterator_range< skip_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type, + P, + default_pass + > + > + { + private: + typedef skip_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type, + P, + default_pass + > + skip_iter; + + typedef iterator_range + base_range; + + typedef BOOST_DEDUCED_TYPENAME range_iterator::type raw_iterator; + + public: + adjacent_filter_range( const P& p, R& r ) + : base_range( skip_iter( boost::begin(r), boost::end(r), p), + skip_iter( boost::end(r), boost::end(r), p) ) + { + } + }; + + template< class T > + struct adjacent_holder : holder + { + adjacent_holder( T r ) : holder(r) + { } + }; + + template< class T > + struct adjacent_excl_holder : holder + { + adjacent_excl_holder( T r ) : holder(r) + { } + }; + + template< class ForwardRng, class BinPredicate > + inline adjacent_filter_range + operator|( ForwardRng& r, + const adjacent_holder& f ) + { + return adjacent_filter_range( f.val, r ); + } + + template< class ForwardRng, class BinPredicate > + inline adjacent_filter_range + operator|( const ForwardRng& r, + const adjacent_holder& f ) + { + return adjacent_filter_range( f.val, r ); + } + + template< class ForwardRng, class BinPredicate > + inline adjacent_filter_range + operator|( ForwardRng& r, + const adjacent_excl_holder& f ) + { + return adjacent_filter_range( f.val, r ); + } + + template< class ForwardRng, class BinPredicate > + inline adjacent_filter_range + operator|( const ForwardRng& r, + const adjacent_excl_holder& f ) + { + return adjacent_filter_range( f.val, r ); + } + + } // 'range_detail' + + // Bring adjacent_filter_range into the boost namespace so that users of + // this library may specify the return type of the '|' operator and + // adjacent_filter() + using range_detail::adjacent_filter_range; + + namespace adaptors + { + namespace + { + const range_detail::forwarder + adjacent_filtered = + range_detail::forwarder(); + + const range_detail::forwarder + adjacent_filtered_excl = + range_detail::forwarder(); + } + + template + inline adjacent_filter_range + adjacent_filter(ForwardRng& rng, BinPredicate filter_pred) + { + return adjacent_filter_range(filter_pred, rng); + } + + template + inline adjacent_filter_range + adjacent_filter(const ForwardRng& rng, BinPredicate filter_pred) + { + return adjacent_filter_range(filter_pred, rng); + } + + } // 'adaptors' + +} + +#ifdef BOOST_MSVC +#pragma warning( pop ) +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/argument_fwd.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/argument_fwd.hpp new file mode 100755 index 0000000000..fbfd40c1df --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/argument_fwd.hpp @@ -0,0 +1,80 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_ARGUMENT_FWD_HPP +#define BOOST_RANGE_ADAPTOR_ARGUMENT_FWD_HPP + +#include + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable : 4512) // assignment operator could not be generated +#endif + +namespace boost +{ + namespace range_detail + { + template< class T > + struct holder + { + T val; + holder( T t ) : val(t) + { } + }; + + template< class T > + struct holder2 + { + T val1, val2; + holder2( T t, T u ) : val1(t), val2(u) + { } + }; + + template< template class Holder > + struct forwarder + { + template< class T > + Holder operator()( T t ) const + { + return Holder(t); + } + }; + + template< template class Holder > + struct forwarder2 + { + template< class T > + Holder operator()( T t, T u ) const + { + return Holder(t,u); + } + }; + + template< template class Holder > + struct forwarder2TU + { + template< class T, class U > + Holder operator()( T t, U u ) const + { + return Holder(t, u); + } + }; + + + } + +} + +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/copied.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/copied.hpp new file mode 100755 index 0000000000..f4cf2d13af --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/copied.hpp @@ -0,0 +1,58 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_COPIED_HPP +#define BOOST_RANGE_ADAPTOR_COPIED_HPP + +#include +#include +#include +#include + +namespace boost +{ + namespace adaptors + { + struct copied + { + copied(std::size_t t_, std::size_t u_) + : t(t_), u(u_) {} + + std::size_t t; + std::size_t u; + }; + + template< class CopyableRandomAccessRng > + inline CopyableRandomAccessRng + operator|( const CopyableRandomAccessRng& r, const copied& f ) + { + iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > + temp( adaptors::slice( r, f.t, f.u ) ); + return CopyableRandomAccessRng( temp.begin(), temp.end() ); + } + + template + inline CopyableRandomAccessRange + copy(const CopyableRandomAccessRange& rng, std::size_t t, std::size_t u) + { + iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type> temp( + adaptors::slice(rng, t, u)); + + return CopyableRandomAccessRange( temp.begin(), temp.end() ); + } + } // 'adaptors' + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/define_adaptor.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/define_adaptor.hpp new file mode 100644 index 0000000000..d68c64e175 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/define_adaptor.hpp @@ -0,0 +1,117 @@ +#ifndef BOOST_RANGE_DEFINE_ADAPTOR_HPP_INCLUDED +#define BOOST_RANGE_DEFINE_ADAPTOR_HPP_INCLUDED + +#include + +#define BOOST_DEFINE_RANGE_ADAPTOR( adaptor_name, range_adaptor ) \ + struct adaptor_name##_forwarder {}; \ + \ + template range_adaptor \ + operator|(Range& rng, adaptor_name##_forwarder) \ + { \ + return range_adaptor ( rng ); \ + } \ + \ + template range_adaptor \ + operator|(const Range& rng, adaptor_name##_forwarder) \ + { \ + return range_adaptor ( rng ); \ + } \ + \ + static adaptor_name##_forwarder adaptor_name = adaptor_name##_forwarder(); \ + \ + template \ + range_adaptor \ + make_##adaptor_name(Range& rng) \ + { \ + return range_adaptor (rng); \ + } \ + \ + template \ + range_adaptor \ + make_##adaptor_name(const Range& rng) \ + { \ + return range_adaptor (rng); \ + } + +#define BOOST_DEFINE_RANGE_ADAPTOR_1( adaptor_name, range_adaptor, adaptor_class ) \ + template range_adaptor \ + operator|(Range& rng, const adaptor_name & args) \ + { \ + return range_adaptor (rng, args.arg1); \ + } \ + template range_adaptor \ + operator|(const Range& rng, const adaptor_name & args) \ + { \ + return range_adaptor (rng, args.arg1); \ + } \ + template \ + range_adaptor \ + make_##adaptor_name(Range& rng, Arg1 arg1) \ + { \ + return range_adaptor(rng, arg1); \ + } + +#define BOOST_DEFINE_RANGE_ADAPTOR_1( adaptor_name, range_adaptor, arg1_type ) \ + struct adaptor_name \ + { \ + explicit adaptor_name (arg1_type arg1_) \ + : arg1(arg1_) {} \ + arg1_type arg1; \ + }; \ + \ + template range_adaptor \ + operator|(Range& rng, adaptor_name args) \ + { \ + return range_adaptor (rng, args.arg1); \ + } \ + \ + template range_adaptor \ + operator|(const Range& rng, adaptor_name args) \ + { \ + return range_adaptor (rng, args.arg1); \ + } \ + \ + template \ + range_adaptor \ + make_##adaptor_name(Range& rng, arg1_type arg1) \ + { \ + return range_adaptor (rng, arg1); \ + } \ + \ + template \ + range_adaptor \ + make_##adaptor_name(const Range& rng, arg1_type arg1) \ + { \ + return range_adaptor (rng, arg1); \ + } + +#define BOOST_RANGE_ADAPTOR_2( adaptor_name, range_adaptor, arg1_type, arg2_type ) \ + struct adaptor_name \ + { \ + explicit adaptor_name (arg1_type arg1_, arg2_type arg2_) \ + : arg1(arg1_), arg2(arg2_) {} \ + arg1_type arg1; \ + arg2_type arg2; \ + }; \ + \ + template range_adaptor \ + operator|(Range& rng, adaptor_name args) \ + { \ + return range_adaptor (rng, args.arg1, args.arg2); \ + } \ + template \ + range_adaptor \ + make_##adaptor_name(Range& rng, arg1_type arg1, arg2_type arg2) \ + { \ + return range_adaptor (rng, arg1, arg2); \ + } \ + template \ + range_adaptor \ + make_##adaptor_name(const Range& rng, arg1_type arg1, arg2_type arg2) \ + { \ + return range_adaptor (rng, arg1, arg2); \ + } + + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/filtered.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/filtered.hpp new file mode 100755 index 0000000000..62888e7627 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/filtered.hpp @@ -0,0 +1,101 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_FILTERED_HPP +#define BOOST_RANGE_ADAPTOR_FILTERED_HPP + +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + template< class P, class R > + struct filter_range : + boost::iterator_range< + boost::filter_iterator< P, + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + { + private: + typedef boost::iterator_range< + boost::filter_iterator< P, + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > base; + public: + filter_range( P p, R& r ) + : base( make_filter_iterator( p, boost::begin(r), boost::end(r) ), + make_filter_iterator( p, boost::end(r), boost::end(r) ) ) + { } + }; + + template< class T > + struct filter_holder : holder + { + filter_holder( T r ) : holder(r) + { } + }; + + template< class InputRng, class Predicate > + inline filter_range + operator|( InputRng& r, + const filter_holder& f ) + { + return filter_range( f.val, r ); + } + + template< class InputRng, class Predicate > + inline filter_range + operator|( const InputRng& r, + const filter_holder& f ) + { + return filter_range( f.val, r ); + } + + } // 'range_detail' + + // Unusual use of 'using' is intended to bring filter_range into the boost namespace + // while leaving the mechanics of the '|' operator in range_detail and maintain + // argument dependent lookup. + // filter_range logically needs to be in the boost namespace to allow user of + // the library to define the return type for filter() + using range_detail::filter_range; + + namespace adaptors + { + namespace + { + const range_detail::forwarder + filtered = + range_detail::forwarder(); + } + + template + inline filter_range + filter(InputRange& rng, Predicate filter_pred) + { + return range_detail::filter_range( filter_pred, rng ); + } + + template + inline filter_range + filter(const InputRange& rng, Predicate filter_pred) + { + return range_detail::filter_range( filter_pred, rng ); + } + } // 'adaptors' + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/indexed.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/indexed.hpp new file mode 100755 index 0000000000..5a523cec58 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/indexed.hpp @@ -0,0 +1,156 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_INDEXED_IMPL_HPP +#define BOOST_RANGE_ADAPTOR_INDEXED_IMPL_HPP + +#include +#ifdef BOOST_MSVC +#pragma warning( push ) +#pragma warning( disable : 4355 ) +#endif + +#include +#include +#include +#include +#include + + + +namespace boost +{ + namespace adaptors + { + // This structure exists to carry the parameters from the '|' operator + // to the index adapter. The expression rng | indexed(1) instantiates + // this structure and passes it as the right-hand operand to the + // '|' operator. + struct indexed + { + explicit indexed(std::size_t x) : val(x) {} + std::size_t val; + }; + } + + namespace range_detail + { + template< class Iter > + class indexed_iterator + : public boost::iterator_adaptor< indexed_iterator, Iter > + { + private: + typedef boost::iterator_adaptor< indexed_iterator, Iter > + base; + + typedef BOOST_DEDUCED_TYPENAME base::difference_type index_type; + + index_type m_index; + + public: + explicit indexed_iterator( Iter i, index_type index ) + : base(i), m_index(index) + { + BOOST_ASSERT( m_index >= 0 && "Indexed Iterator out of bounds" ); + } + + index_type index() const + { + return m_index; + } + + private: + friend class boost::iterator_core_access; + + void increment() + { + ++m_index; + ++(this->base_reference()); + } + + + void decrement() + { + BOOST_ASSERT( m_index > 0 && "Indexed Iterator out of bounds" ); + --m_index; + --(this->base_reference()); + } + + void advance( index_type n ) + { + m_index += n; + BOOST_ASSERT( m_index >= 0 && "Indexed Iterator out of bounds" ); + this->base_reference() += n; + } + }; + + template< class Rng > + struct indexed_range : + iterator_range< indexed_iterator::type> > + { + private: + typedef indexed_iterator::type> + iter_type; + typedef iterator_range + base; + public: + template< class Index > + indexed_range( Index i, Rng& r ) + : base( iter_type(boost::begin(r), i), iter_type(boost::end(r),i) ) + { } + }; + + } // 'range_detail' + + // Make this available to users of this library. It will sometimes be + // required since it is the return type of operator '|' and + // index(). + using range_detail::indexed_range; + + namespace adaptors + { + template< class SinglePassRange > + inline indexed_range + operator|( SinglePassRange& r, + const indexed& f ) + { + return indexed_range( f.val, r ); + } + + template< class SinglePassRange > + inline indexed_range + operator|( const SinglePassRange& r, + const indexed& f ) + { + return indexed_range( f.val, r ); + } + + template + inline indexed_range + index(SinglePassRange& rng, Index index_value) + { + return indexed_range(index_value, rng); + } + + template + inline indexed_range + index(const SinglePassRange& rng, Index index_value) + { + return indexed_range(index_value, rng); + } + } // 'adaptors' + +} + +#ifdef BOOST_MSVC +#pragma warning( pop ) +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/indirected.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/indirected.hpp new file mode 100644 index 0000000000..4abb3ec9bf --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/indirected.hpp @@ -0,0 +1,88 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_INDIRECTED_HPP +#define BOOST_RANGE_ADAPTOR_INDIRECTED_HPP + +#include +#include + +namespace boost +{ + namespace range_detail + { + template< class R > + struct indirect_range : + public boost::iterator_range< + boost::indirect_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + { + private: + typedef boost::iterator_range< + boost::indirect_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + base; + + public: + explicit indirect_range( R& r ) + : base( r ) + { } + }; + + struct indirect_forwarder {}; + + template< class InputRng > + inline indirect_range + operator|( InputRng& r, indirect_forwarder ) + { + return indirect_range( r ); + } + + template< class InputRng > + inline indirect_range + operator|( const InputRng& r, indirect_forwarder ) + { + return indirect_range( r ); + } + + } // 'range_detail' + + using range_detail::indirect_range; + + namespace adaptors + { + namespace + { + const range_detail::indirect_forwarder indirected = + range_detail::indirect_forwarder(); + } + + template + inline indirect_range + indirect(InputRange& rng) + { + return indirect_range(rng); + } + + template + inline indirect_range + indirect(const InputRange& rng) + { + return indirect_range(rng); + } + } // 'adaptors' + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/map.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/map.hpp new file mode 100755 index 0000000000..a8a2c2030f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/map.hpp @@ -0,0 +1,188 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_MAP_HPP +#define BOOST_RANGE_ADAPTOR_MAP_HPP + +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + struct map_keys_forwarder {}; + struct map_values_forwarder {}; + + template< class Map > + struct select_first + { + typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; + typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type& + result_type; + + result_type operator()( const pair_t& r ) const + { + return r.first; + } + }; + + template< class Map > + struct select_second_mutable + { + typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; + typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type; + + result_type operator()( pair_t& r ) const + { + return r.second; + } + }; + + template< class Map > + struct select_second_const + { + typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; + typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type& + result_type; + + result_type operator()( const pair_t& r ) const + { + return r.second; + } + }; + + template + class select_first_range + : public transform_range< + select_first, + const StdPairRng> + { + typedef transform_range, const StdPairRng> base; + public: + typedef select_first transform_fn_type; + typedef const StdPairRng source_range_type; + + select_first_range(transform_fn_type fn, source_range_type& rng) + : base(fn, rng) + { + } + + select_first_range(const base& other) : base(other) {} + }; + + template + class select_second_mutable_range + : public transform_range< + select_second_mutable, + StdPairRng> + { + typedef transform_range, StdPairRng> base; + public: + typedef select_second_mutable transform_fn_type; + typedef StdPairRng source_range_type; + + select_second_mutable_range(transform_fn_type fn, source_range_type& rng) + : base(fn, rng) + { + } + + select_second_mutable_range(const base& other) : base(other) {} + }; + + template + class select_second_const_range + : public transform_range< + select_second_const, + const StdPairRng> + { + typedef transform_range, const StdPairRng> base; + public: + typedef select_second_const transform_fn_type; + typedef const StdPairRng source_range_type; + + select_second_const_range(transform_fn_type fn, source_range_type& rng) + : base(fn, rng) + { + } + + select_second_const_range(const base& other) : base(other) {} + }; + + template< class StdPairRng > + inline select_first_range + operator|( const StdPairRng& r, map_keys_forwarder ) + { + return operator|( r, + boost::adaptors::transformed( select_first() ) ); + } + + template< class StdPairRng > + inline select_second_mutable_range + operator|( StdPairRng& r, map_values_forwarder ) + { + return operator|( r, + boost::adaptors::transformed( select_second_mutable() ) ); + } + + template< class StdPairRng > + inline select_second_const_range + operator|( const StdPairRng& r, map_values_forwarder ) + { + return operator|( r, + boost::adaptors::transformed( select_second_const() ) ); + } + + } // 'range_detail' + + using range_detail::select_first_range; + using range_detail::select_second_mutable_range; + using range_detail::select_second_const_range; + + namespace adaptors + { + namespace + { + const range_detail::map_keys_forwarder map_keys = + range_detail::map_keys_forwarder(); + + const range_detail::map_values_forwarder map_values = + range_detail::map_values_forwarder(); + } + + template + inline select_first_range + keys(const StdPairRange& rng) + { + return select_first_range( + range_detail::select_first(), rng ); + } + + template + inline select_second_const_range + values(const StdPairRange& rng) + { + return select_second_const_range( + range_detail::select_second_const(), rng ); + } + + template + inline select_second_mutable_range + values(StdPairRange& rng) + { + return select_second_mutable_range( + range_detail::select_second_mutable(), rng ); + } + } // 'adaptors' + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/replaced.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/replaced.hpp new file mode 100644 index 0000000000..3c40918dae --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/replaced.hpp @@ -0,0 +1,134 @@ +// Boost.Range library +// +// Copyright Neil Groves 2007. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_REPLACED_IMPL_HPP_INCLUDED +#define BOOST_RANGE_ADAPTOR_REPLACED_IMPL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + template< class Value > + class replace_value + { + public: + typedef const Value& result_type; + typedef const Value& first_argument_type; + + replace_value(const Value& from, const Value& to) + : m_from(from), m_to(to) + { + } + + const Value& operator()(const Value& x) const + { + return (x == m_from) ? m_to : x; + } + + private: + Value m_from; + Value m_to; + }; + + template< class R > + class replace_range : + public boost::iterator_range< + boost::transform_iterator< + replace_value< BOOST_DEDUCED_TYPENAME range_value::type >, + BOOST_DEDUCED_TYPENAME range_iterator::type > > + { + private: + typedef replace_value< BOOST_DEDUCED_TYPENAME range_value::type > Fn; + + typedef boost::iterator_range< + boost::transform_iterator< + replace_value< BOOST_DEDUCED_TYPENAME range_value::type >, + BOOST_DEDUCED_TYPENAME range_iterator::type > > base_t; + + public: + typedef BOOST_DEDUCED_TYPENAME range_value::type value_type; + + replace_range( R& r, value_type from, value_type to ) + : base_t( make_transform_iterator( boost::begin(r), Fn(from, to) ), + make_transform_iterator( boost::end(r), Fn(from, to) ) ) + { } + }; + + template< class T > + class replace_holder : public holder2 + { + public: + replace_holder( const T& from, const T& to ) + : holder2(from, to) + { } + private: + // not assignable + void operator=(const replace_holder&); + }; + + template< class InputRng > + inline replace_range + operator|( InputRng& r, + const replace_holder::type>& f ) + { + return replace_range(r, f.val1, f.val2); + } + + template< class InputRng > + inline replace_range + operator|( const InputRng& r, + const replace_holder::type>& f ) + { + return replace_range(r, f.val1, f.val2); + } + } // 'range_detail' + + using range_detail::replace_range; + + namespace adaptors + { + namespace + { + const range_detail::forwarder2 + replaced = + range_detail::forwarder2(); + } + + template + inline replace_range + replace(InputRange& rng, + BOOST_DEDUCED_TYPENAME range_value::type from, + BOOST_DEDUCED_TYPENAME range_value::type to) + { + return replace_range(rng, from, to); + } + + template + inline replace_range + replace(const InputRange& rng, + BOOST_DEDUCED_TYPENAME range_value::type from, + BOOST_DEDUCED_TYPENAME range_value::type to) + { + return replace_range(rng, from ,to); + } + + } // 'adaptors' +} // 'boost' + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/replaced_if.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/replaced_if.hpp new file mode 100644 index 0000000000..9353abddfd --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/replaced_if.hpp @@ -0,0 +1,136 @@ +// Boost.Range library +// +// Copyright Neil Groves 2007. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_REPLACED_IF_IMPL_HPP_INCLUDED +#define BOOST_RANGE_ADAPTOR_REPLACED_IF_IMPL_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + template< class Pred, class Value > + class replace_value_if + { + public: + typedef const Value& result_type; + typedef const Value& first_argument_type; + + replace_value_if(const Pred& pred, const Value& to) + : m_pred(pred), m_to(to) + { + } + + const Value& operator()(const Value& x) const + { + return m_pred(x) ? m_to : x; + } + + private: + Pred m_pred; + Value m_to; + }; + + template< class Pred, class R > + class replace_if_range : + public boost::iterator_range< + boost::transform_iterator< + replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type >, + BOOST_DEDUCED_TYPENAME range_iterator::type > > + { + private: + typedef replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type > Fn; + + typedef boost::iterator_range< + boost::transform_iterator< + replace_value_if< Pred, BOOST_DEDUCED_TYPENAME range_value::type >, + BOOST_DEDUCED_TYPENAME range_iterator::type > > base_t; + + public: + typedef BOOST_DEDUCED_TYPENAME range_value::type value_type; + + replace_if_range( R& r, const Pred& pred, value_type to ) + : base_t( make_transform_iterator( boost::begin(r), Fn(pred, to) ), + make_transform_iterator( boost::end(r), Fn(pred, to) ) ) + { } + }; + + template< class Pred, class T > + class replace_if_holder + { + public: + replace_if_holder( const Pred& pred, const T& to ) + : m_pred(pred), m_to(to) + { } + + const Pred& pred() const { return m_pred; } + const T& to() const { return m_to; } + + private: + Pred m_pred; + T m_to; + }; + + template< class Pred, class InputRng > + inline replace_if_range + operator|( InputRng& r, + const replace_if_holder::type>& f ) + { + return replace_if_range(r, f.pred(), f.to()); + } + + template< class Pred, class InputRng > + inline replace_if_range + operator|( const InputRng& r, + const replace_if_holder::type>& f ) + { + return replace_if_range(r, f.pred(), f.to()); + } + } // 'range_detail' + + using range_detail::replace_if_range; + + namespace adaptors + { + namespace + { + const range_detail::forwarder2TU + replaced_if = + range_detail::forwarder2TU(); + } + + template + inline replace_if_range + replace_if(InputRange& rng, Pred pred, + BOOST_DEDUCED_TYPENAME range_value::type to) + { + return range_detail::replace_if_range(rng, pred, to); + } + + template + inline replace_if_range + replace_if(const InputRange& rng, Pred pred, + BOOST_DEDUCED_TYPENAME range_value::type to) + { + return range_detail::replace_if_range(rng, pred, to); + } + } // 'adaptors' + +} // 'boost' + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/reversed.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/reversed.hpp new file mode 100755 index 0000000000..229702b136 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/reversed.hpp @@ -0,0 +1,90 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_REVERSED_HPP +#define BOOST_RANGE_ADAPTOR_REVERSED_HPP + +#include +#include + +namespace boost +{ + namespace range_detail + { + template< class R > + struct reverse_range : + public boost::iterator_range< + boost::reverse_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + { + private: + typedef boost::iterator_range< + boost::reverse_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + base; + + public: + typedef boost::reverse_iterator::type> iterator; + + reverse_range( R& r ) + : base( iterator(boost::end(r)), iterator(boost::begin(r)) ) + { } + }; + + struct reverse_forwarder {}; + + template< class BidirectionalRng > + inline reverse_range + operator|( BidirectionalRng& r, reverse_forwarder ) + { + return reverse_range( r ); + } + + template< class BidirectionalRng > + inline reverse_range + operator|( const BidirectionalRng& r, reverse_forwarder ) + { + return reverse_range( r ); + } + + } // 'range_detail' + + using range_detail::reverse_range; + + namespace adaptors + { + namespace + { + const range_detail::reverse_forwarder reversed = + range_detail::reverse_forwarder(); + } + + template + inline reverse_range + reverse(BidirectionalRange& rng) + { + return reverse_range(rng); + } + + template + inline reverse_range + reverse(const BidirectionalRange& rng) + { + return reverse_range(rng); + } + } // 'adaptors' + +} // 'boost' + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/sliced.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/sliced.hpp new file mode 100755 index 0000000000..eb506e079f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/sliced.hpp @@ -0,0 +1,71 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_SLICED_HPP +#define BOOST_RANGE_ADAPTOR_SLICED_HPP + +#include +#include +#include + +namespace boost +{ + namespace adaptors + { + struct sliced + { + sliced(std::size_t t_, std::size_t u_) + : t(t_), u(u_) {} + std::size_t t; + std::size_t u; + }; + + template< class RandomAccessRange > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + slice( RandomAccessRange& rng, std::size_t t, std::size_t u ) + { + BOOST_ASSERT( t <= u && "error in slice indices" ); + BOOST_ASSERT( static_cast(boost::size(rng)) >= u && + "second slice index out of bounds" ); + + return boost::make_iterator_range( rng, t, u - boost::size(rng) ); + } + + template< class RandomAccessRange > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + slice( const RandomAccessRange& rng, std::size_t t, std::size_t u ) + { + BOOST_ASSERT( t <= u && "error in slice indices" ); + BOOST_ASSERT( static_cast(boost::size(rng)) >= u && + "second slice index out of bounds" ); + + return boost::make_iterator_range( rng, t, u - boost::size(rng) ); + } + + template< class RandomAccessRange > + inline iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > + operator|( RandomAccessRange& r, const sliced& f ) + { + return adaptors::slice( r, f.t, f.u ); + } + + template< class RandomAccessRange > + inline iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > + operator|( const RandomAccessRange& r, const sliced& f ) + { + return adaptors::slice( r, f.t, f.u ); + } + + } // namespace adaptors +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/strided.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/strided.hpp new file mode 100755 index 0000000000..5f4c4fa19c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/strided.hpp @@ -0,0 +1,149 @@ +// Boost.Range library +// +// Copyright Neil Groves 2007. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ADAPTOR_STRIDED_HPP_INCLUDED +#define BOOST_RANGE_ADAPTOR_STRIDED_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + + template + class strided_iterator + : public iterator_adaptor< + strided_iterator, + BaseIterator> + { + friend class iterator_core_access; + + typedef iterator_adaptor, BaseIterator> super_t; + + public: + typedef BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type difference_type; + + strided_iterator() : m_stride() { } + + strided_iterator(const strided_iterator& other) + : super_t(other), m_stride(other.m_stride) { } + + explicit strided_iterator(BaseIterator base_it, difference_type stride) + : super_t(base_it), m_stride(stride) { } + + strided_iterator& + operator=(const strided_iterator& other) + { + super_t::operator=(other); + + // Is the interoperation of the stride safe? + m_stride = other.m_stride; + return *this; + } + + void increment() { std::advance(this->base_reference(), m_stride); } + + void decrement() { std::advance(this->base_reference(), -m_stride); } + + void advance(difference_type n) { std::advance(this->base_reference(), n * m_stride); } + + difference_type + distance_to(const strided_iterator& other) const + { + return std::distance(this->base_reference(), other.base_reference()) / m_stride; + } + + // Using the compiler generated copy constructor and + // and assignment operator + + private: + difference_type m_stride; + }; + + template inline + strided_iterator + make_strided_iterator( + const BaseIterator& first, + BOOST_DEDUCED_TYPENAME std::iterator_traits::difference_type stride) + { + return strided_iterator(first, stride); + } + + template< class Rng > + class strided_range + : public iterator_range::type> > + { + typedef range_detail::strided_iterator::type> iter_type; + typedef iterator_range super_t; + public: + template< typename Difference > + strided_range(Difference stride, Rng& rng) + : super_t(make_strided_iterator(boost::begin(rng), stride), + make_strided_iterator(boost::end(rng), stride)) + { + } + }; + + template + class strided_holder : public holder + { + public: + strided_holder(Difference value) : holder(value) {} + }; + + template + inline strided_range + operator|(Rng& rng, const strided_holder& stride) + { + return strided_range(stride.val, rng); + } + + template + inline strided_range + operator|(const Rng& rng, const strided_holder& stride) + { + return strided_range(stride.val, rng); + } + + } // namespace range_detail + + using range_detail::strided_range; + + namespace adaptors + { + + namespace + { + const range_detail::forwarder + strided = range_detail::forwarder(); + } + + template + inline strided_range + stride(Range& rng, Difference step) + { + return strided_range(step, rng); + } + + template + inline strided_range + stride(const Range& rng, Difference step) + { + return strided_range(step, rng); + } + + } // namespace 'adaptors' +} // namespace 'boost' + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/tokenized.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/tokenized.hpp new file mode 100755 index 0000000000..6b6a6fa6de --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/tokenized.hpp @@ -0,0 +1,137 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_TOKENIZED_HPP +#define BOOST_RANGE_ADAPTOR_TOKENIZED_HPP + +#include +#include + +namespace boost +{ + namespace range_detail + { + + template< class R > + struct token_range : + public boost::iterator_range< + boost::regex_token_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + { + private: + typedef + boost::regex_token_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type + > + regex_iter; + + typedef BOOST_DEDUCED_TYPENAME regex_iter::regex_type + regex_type; + + typedef boost::iterator_range + base; + + public: + template< class Regex, class Submatch, class Flag > + token_range( R& r, const Regex& re, const Submatch& sub, Flag f ) + : base( regex_iter( boost::begin(r), boost::end(r), + regex_type(re), sub, f ), + regex_iter() ) + { } + }; + + template< class T, class U, class V > + struct regex_holder + { + const T& re; + const U& sub; + V f; + + regex_holder( const T& rex, const U& subm, V flag ) : + re(rex), sub(subm), f(flag) + { } + private: + // Not assignable + void operator=(const regex_holder&); + }; + + struct regex_forwarder + { + template< class Regex > + regex_holder + operator()( const Regex& re, + int submatch = 0, + regex_constants::match_flag_type f = + regex_constants::match_default ) const + { + return regex_holder( re, submatch, f ); + } + + template< class Regex, class Submatch > + regex_holder + operator()( const Regex& re, + const Submatch& sub, + regex_constants::match_flag_type f = + regex_constants::match_default ) const + { + return regex_holder( re, sub, f ); + } + }; + + template< class BidirectionalRng, class R, class S, class F > + inline token_range + operator|( BidirectionalRng& r, + const regex_holder& f ) + { + return token_range( r, f.re, f.sub, f.f ); + } + + template< class BidirectionalRng, class R, class S, class F > + inline token_range + operator|( const BidirectionalRng& r, + const regex_holder& f ) + { + return token_range( r, f.re, f.sub, f.f ); + } + + } // 'range_detail' + + using range_detail::token_range; + + namespace adaptors + { + namespace + { + const range_detail::regex_forwarder tokenized = + range_detail::regex_forwarder(); + } + + template + inline token_range + tokenize(BidirectionalRange& rng, const Regex& reg, const Submatch& sub, Flag f) + { + return token_range(rng, reg, sub, f); + } + + template + inline token_range + tokenize(const BidirectionalRange& rng, const Regex& reg, const Submatch& sub, Flag f) + { + return token_range(rng, reg, sub, f); + } + } // 'adaptors' + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/transformed.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/transformed.hpp new file mode 100755 index 0000000000..00297ca612 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/transformed.hpp @@ -0,0 +1,103 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_TRANSFORMED_HPP +#define BOOST_RANGE_ADAPTOR_TRANSFORMED_HPP + +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + + template< class F, class R > + struct transform_range : + public boost::iterator_range< + boost::transform_iterator< F, + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + { + private: + typedef boost::iterator_range< + boost::transform_iterator< F, + BOOST_DEDUCED_TYPENAME range_iterator::type + > + > + base; + + public: + typedef F transform_fn_type; + typedef R source_range_type; + + transform_range( F f, R& r ) + : base( make_transform_iterator( boost::begin(r), f ), + make_transform_iterator( boost::end(r), f ) ) + + { } + }; + + template< class T > + struct transform_holder : holder + { + transform_holder( T r ) : holder(r) + { } + }; + + template< class InputRng, class UnaryFunction > + inline transform_range + operator|( InputRng& r, + const transform_holder& f ) + { + return transform_range( f.val, r ); + } + + template< class InputRng, class UnaryFunction > + inline transform_range + operator|( const InputRng& r, + const transform_holder& f ) + { + return transform_range( f.val, r ); + } + + } // 'range_detail' + + using range_detail::transform_range; + + namespace adaptors + { + namespace + { + const range_detail::forwarder + transformed = + range_detail::forwarder(); + } + + template + inline transform_range + transform(InputRange& rng, UnaryFunction fn) + { + return transform_range(fn, rng); + } + + template + inline transform_range + transform(const InputRange& rng, UnaryFunction fn) + { + return transform_range(fn, rng); + } + } // 'adaptors' + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptor/uniqued.hpp b/deal.II/contrib/boost/include/boost/range/adaptor/uniqued.hpp new file mode 100755 index 0000000000..ad6f7f4ad4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptor/uniqued.hpp @@ -0,0 +1,90 @@ +// Boost.Range library +// +// Copyright Thorsten Ottosen, Neil Groves 2006 - 2008. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTOR_UNIQUED_IMPL_HPP +#define BOOST_RANGE_ADAPTOR_UNIQUED_IMPL_HPP + +#include + +namespace boost +{ + + namespace range_detail + { + struct unique_forwarder { }; + + struct unique_not_equal_to + { + typedef bool result_type; + + template< class T > + bool operator()( const T& l, const T& r ) const + { + return !(l == r); + } + }; + + template + class unique_range : public adjacent_filter_range + { + typedef adjacent_filter_range base; + public: + explicit unique_range(ForwardRng& rng) + : base(unique_not_equal_to(), rng) + { + } + }; + + template< class ForwardRng > + inline unique_range + operator|( ForwardRng& r, + unique_forwarder ) + { + return unique_range(r); + } + + template< class ForwardRng > + inline unique_range + operator|( const ForwardRng& r, + unique_forwarder ) + { + return unique_range(r); + } + + } // 'range_detail' + + using range_detail::unique_range; + + namespace adaptors + { + namespace + { + const range_detail::unique_forwarder uniqued = + range_detail::unique_forwarder(); + } + + template + inline unique_range + unique(ForwardRange& rng) + { + return unique_range(rng); + } + + template + inline unique_range + unique(const ForwardRange& rng) + { + return unique_range(rng); + } + } // 'adaptors' + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/adaptors.hpp b/deal.II/contrib/boost/include/boost/range/adaptors.hpp new file mode 100755 index 0000000000..92062a995a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/adaptors.hpp @@ -0,0 +1,30 @@ +// Boost.Range library +// +// Copyright Neil Groves 2007. +// Copyright Thorsten Ottosen 2006. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// + +#ifndef BOOST_RANGE_ADAPTORS_HPP +#define BOOST_RANGE_ADAPTORS_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/algorithm.hpp b/deal.II/contrib/boost/include/boost/range/algorithm.hpp new file mode 100755 index 0000000000..b7d8dd74f8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm.hpp @@ -0,0 +1,104 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file algorithm.hpp +/// Includes the range-based versions of the algorithms in the +/// C++ standard header file +// +///////////////////////////////////////////////////////////////////////////// + +// Copyright 2009 Neil Groves. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Acknowledgements: +// This code uses combinations of ideas, techniques and code snippets +// from: Thorsten Ottosen, Eric Niebler, Jeremy Siek, +// and Vladimir Prus' +// +// The original mutating algorithms that served as the first version +// were originally written by Vladimir Prus' +// code from Boost Wiki + +#if defined(_MSC_VER) && _MSC_VER >= 1000 +#pragma once +#endif + +#ifndef BOOST_RANGE_ALGORITHM_HPP_INCLUDED_01012009 +#define BOOST_RANGE_ALGORITHM_HPP_INCLUDED_01012009 + +#include +#include +#include +#include +#include +#include +#include + +// Non-mutating algorithms +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Mutating algorithms +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// Binary search +#include +#include +#include +#include + +// Set operations of sorted ranges +#include + +// Heap operations +#include + +// Minimum and Maximum +#include +#include + +// Permutations +#include + +#endif // include guard + diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/adjacent_find.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/adjacent_find.hpp new file mode 100755 index 0000000000..1b88dae86e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/adjacent_find.hpp @@ -0,0 +1,125 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_ADJACENT_FIND_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_ADJACENT_FIND_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function adjacent_find +/// +/// range-based version of the adjacent_find std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template< typename ForwardRange > +inline typename range_iterator::type +adjacent_find(ForwardRange & rng) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return std::adjacent_find(boost::begin(rng),boost::end(rng)); +} + +/// \overload +template< typename ForwardRange > +inline typename range_iterator::type +adjacent_find(const ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return std::adjacent_find(boost::begin(rng),boost::end(rng)); +} + +/// \overload +template< typename ForwardRange, typename BinaryPredicate > +inline typename range_iterator::type +adjacent_find(ForwardRange & rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, + typename range_value::type>)); + return std::adjacent_find(boost::begin(rng),boost::end(rng),pred); +} + +/// \overload +template< typename ForwardRange, typename BinaryPredicate > +inline typename range_iterator::type +adjacent_find(const ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, + typename range_value::type>)); + return std::adjacent_find(boost::begin(rng),boost::end(rng),pred); +} + +// range_return overloads + +/// \overload +template< range_return_value re, typename ForwardRange > +inline typename range_return::type +adjacent_find(ForwardRange & rng) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return range_return:: + pack(std::adjacent_find(boost::begin(rng),boost::end(rng)), + rng); +} + +/// \overload +template< range_return_value re, typename ForwardRange > +inline typename range_return::type +adjacent_find(const ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return range_return:: + pack(std::adjacent_find(boost::begin(rng),boost::end(rng)), + rng); +} + +/// \overload +template< range_return_value re, typename ForwardRange, typename BinaryPredicate > +inline typename range_return::type +adjacent_find(ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, + typename range_value::type>)); + return range_return:: + pack(std::adjacent_find(boost::begin(rng),boost::end(rng),pred), + rng); +} + +/// \overload +template< range_return_value re, typename ForwardRange, typename BinaryPredicate > +inline typename range_return::type +adjacent_find(const ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return range_return:: + pack(std::adjacent_find(boost::begin(rng),boost::end(rng),pred), + rng); +} + + } // namespace range + using range::adjacent_find; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/binary_search.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/binary_search.hpp new file mode 100755 index 0000000000..bb64ec8f16 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/binary_search.hpp @@ -0,0 +1,49 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_BINARY_SEARCH_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_BINARY_SEARCH_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function binary_search +/// +/// range-based version of the binary_search std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline bool binary_search(const ForwardRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::binary_search(boost::begin(rng), boost::end(rng), val); +} + +/// \overload +template +inline bool binary_search(const ForwardRange& rng, const Value& val, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::binary_search(boost::begin(rng), boost::end(rng), val, pred); +} + + } // namespace range + using range::binary_search; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/copy.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/copy.hpp new file mode 100644 index 0000000000..dc5a0c3842 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/copy.hpp @@ -0,0 +1,41 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_COPY_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_COPY_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function copy +/// +/// range-based version of the copy std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +/// \pre OutputIterator is a model of the OutputIteratorConcept +template< class SinglePassRange, class OutputIterator > +inline OutputIterator copy(const SinglePassRange& rng, OutputIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::copy(boost::begin(rng),boost::end(rng),out); +} + + } // namespace range + using range::copy; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/copy_backward.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/copy_backward.hpp new file mode 100755 index 0000000000..52dc922a27 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/copy_backward.hpp @@ -0,0 +1,43 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_COPY_BACKWARD_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_COPY_BACKWARD_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function copy_backward +/// +/// range-based version of the copy_backwards std algorithm +/// +/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept +/// \pre BidirectionalTraversalWriteableIterator is a model of the BidirectionalIteratorConcept +/// \pre BidirectionalTraversalWriteableIterator is a model of the WriteableIteratorConcept +template< class BidirectionalRange, class BidirectionalTraversalWriteableIterator > +inline BidirectionalTraversalWriteableIterator +copy_backward(const BidirectionalRange& rng, + BidirectionalTraversalWriteableIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::copy_backward(boost::begin(rng), boost::end(rng), out); +} + + } // namespace range + using range::copy_backward; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/count.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/count.hpp new file mode 100755 index 0000000000..8316ce0f11 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/count.hpp @@ -0,0 +1,50 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_COUNT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_COUNT_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function count +/// +/// range-based version of the count std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +template< class SinglePassRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_difference::type +count(SinglePassRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::count(boost::begin(rng), boost::end(rng), val); +} + +/// \overload +template< class SinglePassRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_difference::type +count(const SinglePassRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::count(boost::begin(rng), boost::end(rng), val); +} + + } // namespace range + using range::count; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/count_if.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/count_if.hpp new file mode 100755 index 0000000000..ae17b0e3ae --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/count_if.hpp @@ -0,0 +1,51 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_COUNT_IF_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_COUNT_IF_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function count_if +/// +/// range-based version of the count_if std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +/// \pre UnaryPredicate is a model of the UnaryPredicateConcept +template< class SinglePassRange, class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME boost::range_difference::type +count_if(SinglePassRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::count_if(boost::begin(rng), boost::end(rng), pred); +} + +/// \overload +template< class SinglePassRange, class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME boost::range_difference::type +count_if(const SinglePassRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::count_if(boost::begin(rng), boost::end(rng), pred); +} + + } // namespace range + using range::count_if; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/equal.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/equal.hpp new file mode 100755 index 0000000000..7226440e07 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/equal.hpp @@ -0,0 +1,188 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EQUAL_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EQUAL_HPP_INCLUDED + +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + // An implementation of equality comparison that is optimized for iterator + // traversal categories less than RandomAccessTraversal. + template< class SinglePassTraversalReadableIterator1, + class SinglePassTraversalReadableIterator2, + class IteratorCategoryTag1, + class IteratorCategoryTag2 > + inline bool equal_impl( SinglePassTraversalReadableIterator1 first1, + SinglePassTraversalReadableIterator1 last1, + SinglePassTraversalReadableIterator2 first2, + SinglePassTraversalReadableIterator2 last2, + IteratorCategoryTag1, + IteratorCategoryTag2 ) + { + do + { + // If we have reached the end of the left range then this is + // the end of the loop. They are equal if and only if we have + // simultaneously reached the end of the right range. + if (first1 == last1) + return first2 == last2; + + // If we have reached the end of the right range at this line + // it indicates that the right range is shorter than the left + // and hence the result is false. + if (first2 == last2) + return false; + + // continue looping if and only if the values are equal + } while(*first1++ == *first2++); + + // Reaching this line in the algorithm indicates that a value + // inequality has been detected. + return false; + } + + template< class SinglePassTraversalReadableIterator1, + class SinglePassTraversalReadableIterator2, + class IteratorCategoryTag1, + class IteratorCategoryTag2, + class BinaryPredicate > + inline bool equal_impl( SinglePassTraversalReadableIterator1 first1, + SinglePassTraversalReadableIterator1 last1, + SinglePassTraversalReadableIterator2 first2, + SinglePassTraversalReadableIterator2 last2, + BinaryPredicate pred, + IteratorCategoryTag1, + IteratorCategoryTag2 ) + { + do + { + // If we have reached the end of the left range then this is + // the end of the loop. They are equal if and only if we have + // simultaneously reached the end of the right range. + if (first1 == last1) + return first2 == last2; + + // If we have reached the end of the right range at this line + // it indicates that the right range is shorter than the left + // and hence the result is false. + if (first2 == last2) + return false; + + // continue looping if and only if the values are equal + } while(pred(*first1++, *first2++)); + + // Reaching this line in the algorithm indicates that a value + // inequality has been detected. + return false; + } + + // An implementation of equality comparison that is optimized for + // random access iterators. + template< class RandomAccessTraversalReadableIterator1, + class RandomAccessTraversalReadableIterator2 > + inline bool equal_impl( RandomAccessTraversalReadableIterator1 first1, + RandomAccessTraversalReadableIterator1 last1, + RandomAccessTraversalReadableIterator2 first2, + RandomAccessTraversalReadableIterator2 last2, + std::random_access_iterator_tag, + std::random_access_iterator_tag ) + { + return ((last1 - first1) == (last2 - first2)) + && std::equal(first1, last1, first2); + } + + template< class RandomAccessTraversalReadableIterator1, + class RandomAccessTraversalReadableIterator2, + class BinaryPredicate > + inline bool equal_impl( RandomAccessTraversalReadableIterator1 first1, + RandomAccessTraversalReadableIterator1 last1, + RandomAccessTraversalReadableIterator2 first2, + RandomAccessTraversalReadableIterator2 last2, + BinaryPredicate pred ) + { + return ((last1 - first1) == (last2 - first2)) + && std::equal(first1, last1, first2, pred); + } + + template< class SinglePassTraversalReadableIterator1, + class SinglePassTraversalReadableIterator2 > + inline bool equal( SinglePassTraversalReadableIterator1 first1, + SinglePassTraversalReadableIterator1 last1, + SinglePassTraversalReadableIterator2 first2, + SinglePassTraversalReadableIterator2 last2 ) + { + BOOST_DEDUCED_TYPENAME std::iterator_traits< SinglePassTraversalReadableIterator1 >::iterator_category tag1; + BOOST_DEDUCED_TYPENAME std::iterator_traits< SinglePassTraversalReadableIterator2 >::iterator_category tag2; + + return equal_impl(first1, last1, first2, last2, tag1, tag2); + } + + template< class SinglePassTraversalReadableIterator1, + class SinglePassTraversalReadableIterator2, + class BinaryPredicate > + inline bool equal( SinglePassTraversalReadableIterator1 first1, + SinglePassTraversalReadableIterator1 last1, + SinglePassTraversalReadableIterator2 first2, + SinglePassTraversalReadableIterator2 last2, + BinaryPredicate pred ) + { + BOOST_DEDUCED_TYPENAME std::iterator_traits< SinglePassTraversalReadableIterator1 >::iterator_category tag1; + BOOST_DEDUCED_TYPENAME std::iterator_traits< SinglePassTraversalReadableIterator2 >::iterator_category tag2; + + return equal_impl(first1, last1, first2, last2, pred, tag1, tag2); + } + + } // namespace range_detail + + namespace range + { + + /// \brief template function equal + /// + /// range-based version of the equal std algorithm + /// + /// \pre SinglePassRange1 is a model of the SinglePassRangeConcept + /// \pre SinglePassRange2 is a model of the SinglePassRangeConcept + /// \pre BinaryPredicate is a model of the BinaryPredicateConcept + template< class SinglePassRange1, class SinglePassRange2 > + inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2 ) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::equal( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2) ); + } + + /// \overload + template< class SinglePassRange1, class SinglePassRange2, class BinaryPredicate > + inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2, + BinaryPredicate pred ) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::equal( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), + pred); + } + + } // namespace range + using range::equal; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/equal_range.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/equal_range.hpp new file mode 100755 index 0000000000..4aa4a54dd7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/equal_range.hpp @@ -0,0 +1,80 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EQUAL_RANGE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EQUAL_RANGE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function equal_range +/// +/// range-based version of the equal_range std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre SortPredicate is a model of the BinaryPredicateConcept +template +inline std::pair< + BOOST_DEDUCED_TYPENAME boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME boost::range_iterator::type + > +equal_range(ForwardRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::equal_range(boost::begin(rng), boost::end(rng), val); +} + +/// \overload +template +inline std::pair< + BOOST_DEDUCED_TYPENAME boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME boost::range_iterator::type + > +equal_range(const ForwardRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::equal_range(boost::begin(rng), boost::end(rng), val); +} + +/// \overload +template +inline std::pair< + BOOST_DEDUCED_TYPENAME boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME boost::range_iterator::type + > +equal_range(ForwardRange& rng, const Value& val, SortPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::equal_range(boost::begin(rng), boost::end(rng), val, pred); +} + +/// \overload +template +inline std::pair< + BOOST_DEDUCED_TYPENAME boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME boost::range_iterator::type + > +equal_range(const ForwardRange& rng, const Value& val, SortPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::equal_range(boost::begin(rng), boost::end(rng), val, pred); +} + + } // namespace range + using range::equal_range; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/fill.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/fill.hpp new file mode 100755 index 0000000000..72c5d5810a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/fill.hpp @@ -0,0 +1,40 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_FILL_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_FILL_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function fill +/// +/// range-based version of the fill std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +template< class ForwardRange, class Value > +inline ForwardRange& fill(ForwardRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + std::fill(boost::begin(rng), boost::end(rng), val); + return rng; +} + + } // namespace range + using range::fill; +} + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/fill_n.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/fill_n.hpp new file mode 100755 index 0000000000..29d7d6f487 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/fill_n.hpp @@ -0,0 +1,43 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_FILL_N_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_FILL_N_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function fill_n +/// +/// range-based version of the fill_n std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre n <= std::distance(boost::begin(rng), boost::end(rng)) +template< class ForwardRange, class Size, class Value > +inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_ASSERT( static_cast(std::distance(boost::begin(rng), boost::end(rng))) >= n ); + std::fill_n(boost::begin(rng), n, val); + return rng; +} + + } // namespace range + using range::fill_n; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/find.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/find.hpp new file mode 100755 index 0000000000..b4bf6d92ee --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/find.hpp @@ -0,0 +1,54 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_FIND_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_FIND_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function find +/// +/// range-based version of the find std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +template< class SinglePassRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find( SinglePassRange& rng, const Value& val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::find(boost::begin(rng), boost::end(rng), val); +} + +// range_return overloads + +/// \overload +template< range_return_value re, class SinglePassRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +find( SinglePassRange& rng, const Value& val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return range_return:: + pack(std::find(boost::begin(rng), boost::end(rng), val), + rng); +} + + } // namespace range + using range::find; +} + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/find_end.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/find_end.hpp new file mode 100755 index 0000000000..864d4b07ec --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/find_end.hpp @@ -0,0 +1,87 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_FIND_END_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_FIND_END_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function find_end +/// +/// range-based version of the find_end std algorithm +/// +/// \pre ForwardRange1 is a model of the ForwardRangeConcept +/// \pre ForwardRange2 is a model of the ForwardRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template< class ForwardRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_iterator< ForwardRange1 >::type +find_end(ForwardRange1 & rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return std::find_end(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2)); +} + +/// \overload +template< class ForwardRange1, class ForwardRange2, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find_end(ForwardRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return std::find_end(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2),pred); +} + +/// \overload +template< range_return_value re, class ForwardRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_end(ForwardRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return range_return:: + pack(std::find_end(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)), + rng1); +} + +/// \overload +template< range_return_value re, class ForwardRange1, class ForwardRange2, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_end(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return range_return:: + pack(std::find_end(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred), + rng1); +} + + } // namespace range + using range::find_end; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/find_first_of.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/find_first_of.hpp new file mode 100755 index 0000000000..f7543b7802 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/find_first_of.hpp @@ -0,0 +1,89 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_FIND_FIRST_OF_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_FIND_FIRST_OF_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function find_first_of +/// +/// range-based version of the find_first_of std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre ForwardRange2 is a model of the ForwardRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template< class SinglePassRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return std::find_first_of(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2)); +} + +/// \overload +template< class SinglePassRange1, class ForwardRange2, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return std::find_first_of(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2),pred); +} + +// range return overloads +/// \overload +template< range_return_value re, class SinglePassRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_first_of(SinglePassRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return range_return:: + pack(std::find_first_of(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)), + rng1); +} + +/// \overload +template< range_return_value re, class SinglePassRange1, class ForwardRange2, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_first_of(SinglePassRange1 & rng1, const ForwardRange2& rng2, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + + return range_return:: + pack(std::find_first_of(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred), + rng1); +} + + } // namespace range + using range::find_first_of; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/find_if.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/find_if.hpp new file mode 100755 index 0000000000..3254d8cc63 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/find_if.hpp @@ -0,0 +1,55 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_FIND_IF_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_FIND_IF_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function find_if +/// +/// range-based version of the find_if std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +/// \pre UnaryPredicate is a model of the UnaryPredicateConcept +template< class SinglePassRange, class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +find_if( SinglePassRange& rng, UnaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::find_if(boost::begin(rng), boost::end(rng), pred); +} + +// range_return overloads + +/// \overload +template< range_return_value re, class SinglePassRange, class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +find_if( SinglePassRange& rng, UnaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return range_return:: + pack(std::find_if(boost::begin(rng), boost::end(rng), pred), + rng); +} + + } // namespace range + using range::find_if; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/for_each.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/for_each.hpp new file mode 100755 index 0000000000..714a06f53e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/for_each.hpp @@ -0,0 +1,48 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_FOR_EACH_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_FOR_EACH_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function for_each +/// +/// range-based version of the for_each std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +/// \pre UnaryFunction is a model of the UnaryFunctionConcept +template< class SinglePassRange, class UnaryFunction > +inline UnaryFunction for_each(SinglePassRange & rng, UnaryFunction fun) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::for_each(boost::begin(rng),boost::end(rng),fun); +} + +/// \overload +template< class SinglePassRange, class UnaryFunction > +inline UnaryFunction for_each(const SinglePassRange& rng, UnaryFunction fun) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::for_each(boost::begin(rng), boost::end(rng), fun); +} + + } // namespace range + using range::for_each; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/generate.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/generate.hpp new file mode 100755 index 0000000000..bd63a481cd --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/generate.hpp @@ -0,0 +1,40 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_GENERATE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_GENERATE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { +/// \brief template function generate +/// +/// range-based version of the generate std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre Generator is a model of the UnaryFunctionConcept +template< class ForwardRange, class Generator > +inline ForwardRange& generate( ForwardRange& rng, Generator gen ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + std::generate(boost::begin(rng), boost::end(rng), gen); + return rng; +} + + } // namespace range + using range::generate; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/heap_algorithm.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/heap_algorithm.hpp new file mode 100755 index 0000000000..64df3e9536 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/heap_algorithm.hpp @@ -0,0 +1,122 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_HEAP_ALGORITHM_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_HEAP_ALGORITHM_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function push_heap +/// +/// range-based version of the push_heap std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre Compare is a model of the BinaryPredicateConcept +template +inline RandomAccessRange& push_heap(RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::push_heap(boost::begin(rng), boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::push_heap(boost::begin(rng), boost::end(rng), comp_pred); + return rng; +} + +/// \brief template function pop_heap +/// +/// range-based version of the pop_heap std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre Compare is a model of the BinaryPredicateConcept +template +inline RandomAccessRange& pop_heap(RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::pop_heap(boost::begin(rng), boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred); + return rng; +} + +/// \brief template function make_heap +/// +/// range-based version of the make_heap std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre Compare is a model of the BinaryPredicateConcept +template +inline RandomAccessRange& make_heap(RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::make_heap(boost::begin(rng), boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::make_heap(boost::begin(rng), boost::end(rng), comp_pred); + return rng; +} + +/// \brief template function sort_heap +/// +/// range-based version of the sort_heap std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre Compare is a model of the BinaryPredicateConcept +template +inline RandomAccessRange& sort_heap(RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::sort_heap(boost::begin(rng), boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred); + return rng; +} + + } // namespace range + using range::push_heap; + using range::pop_heap; + using range::make_heap; + using range::sort_heap; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/inplace_merge.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/inplace_merge.hpp new file mode 100755 index 0000000000..dfadbaa6f1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/inplace_merge.hpp @@ -0,0 +1,74 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_INPLACE_MERGE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_INPLACE_MERGE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function inplace_merge +/// +/// range-based version of the inplace_merge std algorithm +/// +/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline BidirectionalRange& inplace_merge(BidirectionalRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type middle) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + std::inplace_merge(boost::begin(rng), middle, boost::end(rng)); + return rng; +} + +/// \overload +template +inline const BidirectionalRange& inplace_merge(const BidirectionalRange& rng, + BOOST_DEDUCED_TYPENAME boost::range_iterator::type middle) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + std::inplace_merge(boost::begin(rng), middle, boost::end(rng)); + return rng; +} + +/// \overload +template +inline BidirectionalRange& inplace_merge(BidirectionalRange& rng, + BOOST_DEDUCED_TYPENAME boost::range_iterator::type middle, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + std::inplace_merge(boost::begin(rng), middle, boost::end(rng), pred); + return rng; +} + +/// \overload +template +inline const BidirectionalRange& inplace_merge(const BidirectionalRange& rng, + BOOST_DEDUCED_TYPENAME boost::range_iterator::type middle, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + std::inplace_merge(boost::begin(rng), middle, boost::end(rng), pred); + return rng; +} + + } // namespace range + using range::inplace_merge; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/lexicographical_compare.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/lexicographical_compare.hpp new file mode 100755 index 0000000000..c6e4bc8ef4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/lexicographical_compare.hpp @@ -0,0 +1,58 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_LEXICOGRAPHICAL_COMPARE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_LEXICOGRAPHICAL_COMPARE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function lexicographic_compare +/// +/// range-based version of the lexicographic_compare std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +template +inline bool lexicographical_compare(const SinglePassRange1& rng1, + const SinglePassRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::lexicographical_compare( + boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)); +} + +/// \overload +template +inline bool lexicographical_compare(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::lexicographical_compare( + boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred); +} + + } // namespace range + using range::lexicographical_compare; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/lower_bound.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/lower_bound.hpp new file mode 100755 index 0000000000..5d3945eca9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/lower_bound.hpp @@ -0,0 +1,69 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_LOWER_BOUND_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_LOWER_BOUND_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function lower_bound +/// +/// range-based version of the lower_bound std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +template< class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +lower_bound( ForwardRange& rng, Value val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::lower_bound(boost::begin(rng), boost::end(rng), val); +} +/// \overload +template< class ForwardRange, class Value, class SortPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +lower_bound( ForwardRange& rng, Value val, SortPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::lower_bound(boost::begin(rng), boost::end(rng), val, pred); +} +/// \overload +template< range_return_value re, class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +lower_bound( ForwardRange& rng, Value val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::lower_bound(boost::begin(rng), boost::end(rng), val), + rng); +} +/// \overload +template< range_return_value re, class ForwardRange, class Value, class SortPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +lower_bound( ForwardRange& rng, Value val, SortPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::lower_bound(boost::begin(rng), boost::end(rng), val, pred), + rng); +} + + } // namespace range + using range::lower_bound; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/max_element.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/max_element.hpp new file mode 100755 index 0000000000..a0c1ffd8a0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/max_element.hpp @@ -0,0 +1,115 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_MAX_ELEMENT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_MAX_ELEMENT_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function max_element +/// +/// range-based version of the max_element std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +max_element(ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::max_element(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +max_element(const ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::max_element(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +max_element(ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::max_element(boost::begin(rng), boost::end(rng), pred); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +max_element(const ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::max_element(boost::begin(rng), boost::end(rng), pred); +} + +// range_return overloads + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +max_element(ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::max_element(boost::begin(rng), boost::end(rng)), + rng); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +max_element(const ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::max_element(boost::begin(rng), boost::end(rng)), + rng); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +max_element(ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::max_element(boost::begin(rng), boost::end(rng), pred), + rng); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +max_element(const ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::max_element(boost::begin(rng), boost::end(rng), pred), + rng); +} + + } // namespace range + using range::max_element; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/merge.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/merge.hpp new file mode 100755 index 0000000000..c81b8c7847 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/merge.hpp @@ -0,0 +1,61 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_MERGE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_MERGE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function merge +/// +/// range-based version of the merge std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +/// +template +inline OutputIterator merge(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::merge(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out); +} + +/// \overload +template +inline OutputIterator merge(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::merge(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out, pred); +} + + } // namespace range + using range::merge; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/min_element.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/min_element.hpp new file mode 100755 index 0000000000..c966b1e522 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/min_element.hpp @@ -0,0 +1,115 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_MIN_ELEMENT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_MIN_ELEMENT_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function min_element +/// +/// range-based version of the min_element std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +min_element(ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::min_element(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +min_element(const ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::min_element(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +min_element(ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::min_element(boost::begin(rng), boost::end(rng), pred); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +min_element(const ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::min_element(boost::begin(rng), boost::end(rng), pred); +} + +// range_return overloads + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +min_element(ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::min_element(boost::begin(rng), boost::end(rng)), + rng); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +min_element(const ForwardRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::min_element(boost::begin(rng), boost::end(rng)), + rng); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +min_element(ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::min_element(boost::begin(rng), boost::end(rng), pred), + rng); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +min_element(const ForwardRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::min_element(boost::begin(rng), boost::end(rng), pred), + rng); +} + + } // namespace range + using range::min_element; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/mismatch.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/mismatch.hpp new file mode 100755 index 0000000000..2819c333fe --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/mismatch.hpp @@ -0,0 +1,195 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_MISMATCH_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_MISMATCH_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + template< class SinglePassTraversalReadableIterator1, + class SinglePassTraversalReadableIterator2 > + inline std::pair + mismatch_impl(SinglePassTraversalReadableIterator1 first1, + SinglePassTraversalReadableIterator1 last1, + SinglePassTraversalReadableIterator2 first2, + SinglePassTraversalReadableIterator2 last2) + { + while (first1 != last1 && first2 != last2 && *first1 == *first2) + { + ++first1; + ++first2; + } + return std::pair(first1, first2); + } + + template< class SinglePassTraversalReadableIterator1, + class SinglePassTraversalReadableIterator2, + class BinaryPredicate > + inline std::pair + mismatch_impl(SinglePassTraversalReadableIterator1 first1, + SinglePassTraversalReadableIterator1 last1, + SinglePassTraversalReadableIterator2 first2, + SinglePassTraversalReadableIterator2 last2, + BinaryPredicate pred) + { + while (first1 != last1 && first2 != last2 && pred(*first1, *first2)) + { + ++first1; + ++first2; + } + return std::pair(first1, first2); + } + } // namespace range_detail + + namespace range + { +/// \brief template function mismatch +/// +/// range-based version of the mismatch std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template< class SinglePassRange1, class SinglePassRange2 > +inline std::pair< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type > +mismatch(SinglePassRange1& rng1, const SinglePassRange2 & rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::mismatch_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2)); +} + +/// \overload +template< class SinglePassRange1, class SinglePassRange2 > +inline std::pair< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type > +mismatch(const SinglePassRange1& rng1, const SinglePassRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::mismatch_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2)); +} + +/// \overload +template< class SinglePassRange1, class SinglePassRange2 > +inline std::pair< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type > +mismatch(SinglePassRange1& rng1, SinglePassRange2 & rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::mismatch_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2)); +} + +/// \overload +template< class SinglePassRange1, class SinglePassRange2 > +inline std::pair< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type > +mismatch(const SinglePassRange1& rng1, SinglePassRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::mismatch_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2)); +} + + +/// \overload +template< class SinglePassRange1, class SinglePassRange2, class BinaryPredicate > +inline std::pair< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type > +mismatch(SinglePassRange1& rng1, const SinglePassRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::mismatch_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), pred); +} + +/// \overload +template< class SinglePassRange1, class SinglePassRange2, class BinaryPredicate > +inline std::pair< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type > +mismatch(const SinglePassRange1& rng1, const SinglePassRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::mismatch_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), pred); +} + +/// \overload +template< class SinglePassRange1, class SinglePassRange2, class BinaryPredicate > +inline std::pair< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type > +mismatch(SinglePassRange1& rng1, SinglePassRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::mismatch_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), pred); +} + +/// \overload +template< class SinglePassRange1, class SinglePassRange2, class BinaryPredicate > +inline std::pair< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type > +mismatch(const SinglePassRange1& rng1, SinglePassRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::mismatch_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), pred); +} + + } // namespace range + using range::mismatch; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/nth_element.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/nth_element.hpp new file mode 100755 index 0000000000..a605595c02 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/nth_element.hpp @@ -0,0 +1,74 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_NTH_ELEMENT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_NTH_ELEMENT_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function nth_element +/// +/// range-based version of the nth_element std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline RandomAccessRange& nth_element(RandomAccessRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type nth) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::nth_element(boost::begin(rng), nth, boost::end(rng)); + return rng; +} + +/// \overload +template +inline const RandomAccessRange& nth_element(const RandomAccessRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type nth) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::nth_element(boost::begin(rng), nth, boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& nth_element(RandomAccessRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type nth, + BinaryPredicate sort_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::nth_element(boost::begin(rng), nth, boost::end(rng), sort_pred); + return rng; +} + +/// \overload +template +inline const RandomAccessRange& nth_element(const RandomAccessRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type nth, + BinaryPredicate sort_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::nth_element(boost::begin(rng), nth, boost::end(rng), sort_pred); + return rng; +} + + } // namespace range + using range::nth_element; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/partial_sort.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/partial_sort.hpp new file mode 100755 index 0000000000..1797c55b72 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/partial_sort.hpp @@ -0,0 +1,54 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_PARTIAL_SORT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_PARTIAL_SORT_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function partial_sort +/// +/// range-based version of the partial_sort std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline RandomAccessRange& partial_sort(RandomAccessRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type middle) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::partial_sort(boost::begin(rng), middle, boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& partial_sort(RandomAccessRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type middle, + BinaryPredicate sort_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::partial_sort(boost::begin(rng), middle, boost::end(rng), + sort_pred); + return rng; +} + + } // namespace range + using range::partial_sort; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/partial_sort_copy.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/partial_sort_copy.hpp new file mode 100755 index 0000000000..a2fe7614ad --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/partial_sort_copy.hpp @@ -0,0 +1,58 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_PARTIAL_SORT_COPY_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_PARTIAL_SORT_COPY_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function partial_sort_copy +/// +/// range-based version of the partial_sort_copy std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +/// \pre RandomAccessRange is a model of the Mutable_RandomAccessRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + + return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + + return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred); +} + + } // namespace range + using range::partial_sort_copy; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/partition.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/partition.hpp new file mode 100755 index 0000000000..640491836f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/partition.hpp @@ -0,0 +1,54 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_PARTITION__HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_PARTITION__HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function partition +/// +/// range-based version of the partition std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +partition(ForwardRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::partition(boost::begin(rng),boost::end(rng),pred); +} + +// range_return overloads + +/// \overload +template< range_return_value re, class ForwardRange, + class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +partition(ForwardRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return boost::range_return:: + pack(std::partition(boost::begin(rng), boost::end(rng), pred), rng); +} + + } // namespace range + using range::partition; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/permutation.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/permutation.hpp new file mode 100755 index 0000000000..75388cc876 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/permutation.hpp @@ -0,0 +1,108 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_PERMUTATION_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_PERMUTATION_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function next_permutation +/// +/// range-based version of the next_permutation std algorithm +/// +/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept +/// \pre Compare is a model of the BinaryPredicateConcept +template +inline bool next_permutation(BidirectionalRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::next_permutation(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline bool next_permutation(const BidirectionalRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::next_permutation(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline bool next_permutation(BidirectionalRange& rng, Compare comp_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::next_permutation(boost::begin(rng), boost::end(rng), + comp_pred); +} + +/// \overload +template +inline bool next_permutation(const BidirectionalRange& rng, + Compare comp_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::next_permutation(boost::begin(rng), boost::end(rng), + comp_pred); +} + +/// \brief template function prev_permutation +/// +/// range-based version of the prev_permutation std algorithm +/// +/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept +/// \pre Compare is a model of the BinaryPredicateConcept +template +inline bool prev_permutation(BidirectionalRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::prev_permutation(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline bool prev_permutation(const BidirectionalRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::prev_permutation(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline bool prev_permutation(BidirectionalRange& rng, Compare comp_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::prev_permutation(boost::begin(rng), boost::end(rng), + comp_pred); +} + +/// \overload +template +inline bool prev_permutation(const BidirectionalRange& rng, + Compare comp_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::prev_permutation(boost::begin(rng), boost::end(rng), + comp_pred); +} + + } // namespace range + using range::next_permutation; + using range::prev_permutation; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/random_shuffle.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/random_shuffle.hpp new file mode 100755 index 0000000000..0b17333916 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/random_shuffle.hpp @@ -0,0 +1,50 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_RANDOM_SHUFFLE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_RANDOM_SHUFFLE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function random_shuffle +/// +/// range-based version of the random_shuffle std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre Generator is a model of the UnaryFunctionConcept +template +inline RandomAccessRange& random_shuffle(RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::random_shuffle(boost::begin(rng), boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::random_shuffle(boost::begin(rng), boost::end(rng), gen); + return rng; +} + + } // namespace range + using range::random_shuffle; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/remove.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/remove.hpp new file mode 100755 index 0000000000..638dff2e12 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/remove.hpp @@ -0,0 +1,54 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REMOVE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REMOVE_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function remove +/// +/// range-based version of the remove std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +template< class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +remove(ForwardRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::remove(boost::begin(rng),boost::end(rng),val); +} + +// range_return overloads + +/// \overload +template< range_return_value re, class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +remove(ForwardRange& rng, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::remove(boost::begin(rng), boost::end(rng), val), + rng); +} + + } // namespace range + using range::remove; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/remove_copy.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/remove_copy.hpp new file mode 100755 index 0000000000..0d3d83d1aa --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/remove_copy.hpp @@ -0,0 +1,44 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REMOVE_COPY_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REMOVE_COPY_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function remove_copy +/// +/// range-based version of the remove_copy std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +/// \pre OutputIterator is a model of the OutputIteratorConcept +/// \pre Value is a model of the EqualityComparableConcept +/// \pre Objects of type Value can be compared for equality with objects of +/// InputIterator's value type. +template< class SinglePassRange, class OutputIterator, class Value > +inline OutputIterator +remove_copy(SinglePassRange& rng, OutputIterator out_it, const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::remove_copy(boost::begin(rng), boost::end(rng), out_it, val); +} + + } // namespace range + using range::remove_copy; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/remove_copy_if.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/remove_copy_if.hpp new file mode 100755 index 0000000000..791a38f360 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/remove_copy_if.hpp @@ -0,0 +1,38 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REMOVE_COPY_IF_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REMOVE_COPY_IF_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + /// \brief template function remove_copy_if + /// + /// range-based version of the remove_copy_if std algorithm + /// + /// \pre SinglePassRange is a model of the SinglePassRangeConcept + /// \pre OutputIterator is a model of the OutputIteratorConcept + /// \pre Predicate is a model of the PredicateConcept + /// \pre InputIterator's value type is convertible to Predicate's argument type + /// \pre out_it is not an iterator in the range rng + template< class SinglePassRange, class OutputIterator, class Predicate > + inline OutputIterator + remove_copy_if(SinglePassRange& rng, OutputIterator out_it, Predicate pred) + { + boost::function_requires< SinglePassRangeConcept >(); + return std::remove_copy_if(boost::begin(rng), boost::end(rng), out_it, pred); + } +} + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/remove_if.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/remove_if.hpp new file mode 100755 index 0000000000..349e7a42c5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/remove_if.hpp @@ -0,0 +1,55 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REMOVE_IF_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REMOVE_IF_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function remove_if +/// +/// range-based version of the remove_if std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre UnaryPredicate is a model of the UnaryPredicateConcept +template< class ForwardRange, class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME boost::range_iterator::type +remove_if(ForwardRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::remove_if(boost::begin(rng), boost::end(rng), pred); +} + +// range_return overloads + +/// \overload +template< range_return_value re, class ForwardRange, class UnaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +remove_if(ForwardRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return::pack( + std::remove_if(boost::begin(rng), boost::end(rng), pred), + rng); +} + + } // namespace range + using range::remove_if; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/replace.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/replace.hpp new file mode 100755 index 0000000000..3f2d72c811 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/replace.hpp @@ -0,0 +1,42 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REPLACE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REPLACE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function replace +/// +/// range-based version of the replace std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +template< class ForwardRange, class Value > +inline ForwardRange& +replace(ForwardRange& rng, const Value& what, + const Value& with_what) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + std::replace(boost::begin(rng), boost::end(rng), what, with_what); + return rng; +} + + } // namespace range + using range::replace; +} // namespace boost; + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/replace_copy.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/replace_copy.hpp new file mode 100755 index 0000000000..36c91ce2da --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/replace_copy.hpp @@ -0,0 +1,42 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REPLACE_COPY_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REPLACE_COPY_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function replace_copy +/// +/// range-based version of the replace_copy std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +template< class ForwardRange, class OutputIterator, class Value > +inline OutputIterator +replace_copy(ForwardRange& rng, OutputIterator out_it, const Value& what, + const Value& with_what) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::replace_copy(boost::begin(rng), boost::end(rng), out_it, + what, with_what); +} + + } // namespace range + using range::replace_copy; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/replace_copy_if.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/replace_copy_if.hpp new file mode 100755 index 0000000000..5d4bfb6923 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/replace_copy_if.hpp @@ -0,0 +1,46 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REPLACE_COPY_IF_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REPLACE_COPY_IF_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function replace_copy_if +/// +/// range-based version of the replace_copy_if std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre Predicate is a model of the PredicateConcept +/// \pre Value is convertible to Predicate's argument type +/// \pre Value is Assignable +/// \pre Value is convertible to a type in OutputIterator's set of value types. +template< class ForwardRange, class OutputIterator, class Predicate, class Value > +inline OutputIterator +replace_copy_if(ForwardRange& rng, OutputIterator out_it, Predicate pred, + const Value& with_what) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::replace_copy_if(boost::begin(rng), boost::end(rng), out_it, + pred, with_what); +} + + } // namespace range + using range::replace_copy_if; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/replace_if.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/replace_if.hpp new file mode 100755 index 0000000000..393a4cab3d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/replace_if.hpp @@ -0,0 +1,43 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REPLACE_IF_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REPLACE_IF_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function replace_if +/// +/// range-based version of the replace_if std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre UnaryPredicate is a model of the UnaryPredicateConcept +template< class ForwardRange, class UnaryPredicate, class Value > +inline ForwardRange& + replace_if(ForwardRange& rng, UnaryPredicate pred, + const Value& val) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + std::replace_if(boost::begin(rng), boost::end(rng), pred, val); + return rng; +} + + } // namespace range + using range::replace_if; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/reverse.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/reverse.hpp new file mode 100755 index 0000000000..8741d664a4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/reverse.hpp @@ -0,0 +1,41 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REVERSE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REVERSE_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function reverse +/// +/// range-based version of the reverse std algorithm +/// +/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept +template +inline BidirectionalRange& reverse(BidirectionalRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + std::reverse(boost::begin(rng), boost::end(rng)); + return rng; +} + + } // namespace range + using range::reverse; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/reverse_copy.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/reverse_copy.hpp new file mode 100755 index 0000000000..d86145dbc7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/reverse_copy.hpp @@ -0,0 +1,40 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_REVERSE_COPY_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_REVERSE_COPY_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function reverse_copy +/// +/// range-based version of the reverse_copy std algorithm +/// +/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept +template +inline OutputIterator reverse_copy(const BidirectionalRange& rng, OutputIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::reverse_copy(boost::begin(rng), boost::end(rng), out); +} + + } // namespace range + using range::reverse_copy; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/rotate.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/rotate.hpp new file mode 100755 index 0000000000..aef6062341 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/rotate.hpp @@ -0,0 +1,41 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_ROTATE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_ROTATE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function rotate +/// +/// range-based version of the rotate std algorithm +/// +/// \pre Rng meets the requirements for a Forward range +template +inline ForwardRange& rotate(ForwardRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type middle) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + std::rotate(boost::begin(rng), middle, boost::end(rng)); + return rng; +} + + } // namespace range + using range::rotate; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/rotate_copy.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/rotate_copy.hpp new file mode 100755 index 0000000000..0409ac5275 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/rotate_copy.hpp @@ -0,0 +1,44 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_ROTATE_COPY_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_ROTATE_COPY_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + + /// \brief template function rotate + /// + /// range-based version of the rotate std algorithm + /// + /// \pre Rng meets the requirements for a Forward range + template + inline OutputIterator rotate_copy( + const ForwardRange& rng, + BOOST_DEDUCED_TYPENAME range_iterator::type middle, + OutputIterator target + ) + { + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::rotate_copy(boost::begin(rng), middle, boost::end(rng), target); + } + + } // namespace range + using range::rotate_copy; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/search.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/search.hpp new file mode 100755 index 0000000000..28cc6e6216 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/search.hpp @@ -0,0 +1,134 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_SEARCH_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_SEARCH_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function search +/// +/// range-based version of the search std algorithm +/// +/// \pre ForwardRange1 is a model of the ForwardRangeConcept +/// \pre ForwardRange2 is a model of the ForwardRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template< class ForwardRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +search(ForwardRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::search(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2)); +} + +/// \overload +template< class ForwardRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +search(const ForwardRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::search(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2)); +} + +/// \overload +template< class ForwardRange1, class ForwardRange2, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +search(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::search(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2),pred); +} + +/// \overload +template< class ForwardRange1, class ForwardRange2, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +search(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::search(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred); +} + +// range_return overloads + +/// \overload +template< range_return_value re, class ForwardRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_return::type +search(ForwardRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::search(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2)), + rng1); +} + +/// \overload +template< range_return_value re, class ForwardRange1, class ForwardRange2 > +inline BOOST_DEDUCED_TYPENAME range_return::type +search(const ForwardRange1& rng1, const ForwardRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::search(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2)), + rng1); +} + +/// \overload +template< range_return_value re, class ForwardRange1, class ForwardRange2, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +search(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::search(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2),pred), + rng1); +} + +/// \overload +template< range_return_value re, class ForwardRange1, class ForwardRange2, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +search(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::search(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2),pred), + rng1); +} + + } // namespace range + using range::search; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/search_n.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/search_n.hpp new file mode 100755 index 0000000000..2ced14064d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/search_n.hpp @@ -0,0 +1,145 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_SEARCH_N_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_SEARCH_N_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function search +/// +/// range-based version of the search std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +/// \pre Integer is an integral type +/// \pre Value is a model of the EqualityComparableConcept +/// \pre ForwardRange's value type is a model of the EqualityComparableConcept +/// \pre Object's of ForwardRange's value type can be compared for equality with Objects of type Value +template< class ForwardRange, class Integer, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +search_n(ForwardRange& rng, Integer count, const Value& value) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return std::search_n(boost::begin(rng),boost::end(rng), count, value); +} + +/// \overload +template< class ForwardRange, class Integer, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +search_n(const ForwardRange& rng, Integer count, const Value& value) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return std::search_n(boost::begin(rng), boost::end(rng), count, value); +} + +/// \overload +template< class ForwardRange, class Integer, class Value, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +search_n(ForwardRange& rng, Integer count, const Value& value, + BinaryPredicate binary_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, const Value&>)); + return std::search_n(boost::begin(rng), boost::end(rng), + count, value, binary_pred); +} + +/// \overload +template< class ForwardRange, class Integer, class Value, + class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +search_n(const ForwardRange& rng, Integer count, const Value& value, + BinaryPredicate binary_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, const Value&>)); + return std::search_n(boost::begin(rng), boost::end(rng), + count, value, binary_pred); +} + +// range_return overloads + +/// \overload +template< range_return_value re, class ForwardRange, class Integer, + class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +search_n(ForwardRange& rng, Integer count, const Value& value) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return range_return:: + pack(std::search_n(boost::begin(rng),boost::end(rng), + count, value), + rng); +} + +/// \overload +template< range_return_value re, class ForwardRange, class Integer, + class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +search_n(const ForwardRange& rng, Integer count, const Value& value) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + return range_return:: + pack(std::search_n(boost::begin(rng), boost::end(rng), + count, value), + rng); +} + +/// \overload +template< range_return_value re, class ForwardRange, class Integer, + class Value, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +search_n(ForwardRange& rng, Integer count, const Value& value, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, + const Value&>)); + return range_return:: + pack(std::search_n(boost::begin(rng), boost::end(rng), + count, value, pred), + rng); +} + +/// \overload +template< range_return_value re, class ForwardRange, class Integer, + class Value, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +search_n(const ForwardRange& rng, Integer count, const Value& value, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, + const Value&>)); + return range_return:: + pack(std::search_n(boost::begin(rng), boost::end(rng), + count, value, pred), + rng); +} + + } // namespace range + using range::search_n; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/set_algorithm.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/set_algorithm.hpp new file mode 100755 index 0000000000..82ef8ecc15 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/set_algorithm.hpp @@ -0,0 +1,198 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_SET_ALGORITHM_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_SET_ALGORITHM_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function includes +/// +/// range-based version of the includes std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline bool includes(const SinglePassRange1& rng1, + const SinglePassRange2& rng2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::includes(boost::begin(rng1),boost::end(rng1), + boost::begin(rng2),boost::end(rng2)); +} + +/// \overload +template +inline bool includes(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::includes(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), pred); +} + +/// \brief template function set_union +/// +/// range-based version of the set_union std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline OutputIterator set_union(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::set_union(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out); +} + +/// \overload +template +inline OutputIterator set_union(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::set_union(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out, pred); +} + +/// \brief template function set_intersection +/// +/// range-based version of the set_intersection std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline OutputIterator set_intersection(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::set_intersection(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out); +} + +/// \overload +template +inline OutputIterator set_intersection(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::set_intersection(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), + out, pred); +} + +/// \brief template function set_difference +/// +/// range-based version of the set_difference std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline OutputIterator set_difference(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::set_difference(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out); +} + +/// \overload +template +inline OutputIterator set_difference(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::set_difference( + boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out, pred); +} + +/// \brief template function set_symmetric_difference +/// +/// range-based version of the set_symmetric_difference std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline OutputIterator +set_symmetric_difference(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::set_symmetric_difference(boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out); +} + +/// \overload +template +inline OutputIterator +set_symmetric_difference(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out, + BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::set_symmetric_difference( + boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), out, pred); +} + + } // namespace range + using range::includes; + using range::set_union; + using range::set_intersection; + using range::set_difference; + using range::set_symmetric_difference; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/sort.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/sort.hpp new file mode 100755 index 0000000000..0c6e3b2d9d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/sort.hpp @@ -0,0 +1,50 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_SORT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_SORT_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function sort +/// +/// range-based version of the sort std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline RandomAccessRange& sort(RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::sort(boost::begin(rng), boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::sort(boost::begin(rng), boost::end(rng), pred); + return rng; +} + + } // namespace range + using range::sort; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/stable_partition.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/stable_partition.hpp new file mode 100755 index 0000000000..24febfc885 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/stable_partition.hpp @@ -0,0 +1,73 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_STABLE_PARTITION_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_STABLE_PARTITION_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function stable_partition +/// +/// range-based version of the stable_partition std algorithm +/// +/// \pre BidirectionalRange is a model of the BidirectionalRangeConcept +/// \pre UnaryPredicate is a model of the UnaryPredicateConcept +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +stable_partition(BidirectionalRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::stable_partition(boost::begin(rng), boost::end(rng), pred); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_iterator::type +stable_partition(const BidirectionalRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return std::stable_partition(boost::begin(rng),boost::end(rng),pred); +} + +// range_return overloads +template +inline BOOST_DEDUCED_TYPENAME range_return::type +stable_partition(BidirectionalRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return range_return::pack( + std::stable_partition(boost::begin(rng), boost::end(rng), pred), + rng); +} + +/// \overload +template +inline BOOST_DEDUCED_TYPENAME range_return::type +stable_partition(const BidirectionalRange& rng, UnaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept )); + return range_return::pack( + std::stable_partition(boost::begin(rng),boost::end(rng),pred), + rng); +} + + } // namespace range + using range::stable_partition; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/stable_sort.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/stable_sort.hpp new file mode 100755 index 0000000000..6a27aa41d2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/stable_sort.hpp @@ -0,0 +1,50 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_STABLE_SORT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_STABLE_SORT_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function stable_sort +/// +/// range-based version of the stable_sort std algorithm +/// +/// \pre RandomAccessRange is a model of the RandomAccessRangeConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template +inline RandomAccessRange& stable_sort(RandomAccessRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::stable_sort(boost::begin(rng), boost::end(rng)); + return rng; +} + +/// \overload +template +inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate sort_pred) +{ + BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept )); + std::stable_sort(boost::begin(rng), boost::end(rng), sort_pred); + return rng; +} + + } // namespace range + using range::stable_sort; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/swap_ranges.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/swap_ranges.hpp new file mode 100755 index 0000000000..5b8967a4aa --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/swap_ranges.hpp @@ -0,0 +1,87 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_SWAP_RANGES_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_SWAP_RANGES_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + template + void swap_ranges_impl(Iterator1 it1, Iterator1 last1, + Iterator2 it2, Iterator2 last2, + single_pass_traversal_tag, + single_pass_traversal_tag) + { + ignore_unused_variable_warning(last2); + for (; it1 != last1; ++it1, ++it2) + { + BOOST_ASSERT( it2 != last2 ); + std::iter_swap(it1, it2); + } + } + + template + void swap_ranges_impl(Iterator1 it1, Iterator1 last1, + Iterator2 it2, Iterator2 last2, + random_access_traversal_tag, + random_access_traversal_tag) + { + ignore_unused_variable_warning(last2); + BOOST_ASSERT( last2 - it2 >= last1 - it1 ); + std::swap_ranges(it1, last1, it2); + } + + template + void swap_ranges_impl(Iterator1 first1, Iterator1 last1, + Iterator2 first2, Iterator2 last2) + { + swap_ranges_impl(first1, last1, first2, last2, + BOOST_DEDUCED_TYPENAME iterator_traversal::type(), + BOOST_DEDUCED_TYPENAME iterator_traversal::type()); + } + } // namespace range_detail + + namespace range + { + +/// \brief template function swap_ranges +/// +/// range-based version of the swap_ranges std algorithm +/// +/// \pre SinglePassRange1 is a model of the SinglePassRangeConcept +/// \pre SinglePassRange2 is a model of the SinglePassRangeConcept +template< class SinglePassRange1, class SinglePassRange2 > +inline SinglePassRange2& +swap_ranges(SinglePassRange1& range1, SinglePassRange2& range2) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + + boost::range_detail::swap_ranges_impl( + boost::begin(range1), boost::end(range1), + boost::begin(range2), boost::end(range2)); + + return range2; +} + + } // namespace range + using range::swap_ranges; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/transform.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/transform.hpp new file mode 100755 index 0000000000..28f423dc5e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/transform.hpp @@ -0,0 +1,97 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_TRANSFORM_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_TRANSFORM_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + + /// \brief template function transform + /// + /// range-based version of the transform std algorithm + /// + /// \pre SinglePassRange1 is a model of the SinglePassRangeConcept + /// \pre SinglePassRange2 is a model of the SinglePassRangeConcept + /// \pre OutputIterator is a model of the OutputIteratorConcept + /// \pre UnaryOperation is a model of the UnaryFunctionConcept + /// \pre BinaryOperation is a model of the BinaryFunctionConcept + template< class SinglePassRange1, + class OutputIterator, + class UnaryOperation > + inline OutputIterator + transform(const SinglePassRange1& rng, + OutputIterator out, + UnaryOperation fun) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::transform(boost::begin(rng),boost::end(rng),out,fun); + } + + } // namespace range + + namespace range_detail + { + template< class SinglePassTraversalReadableIterator1, + class SinglePassTraversalReadableIterator2, + class OutputIterator, + class BinaryFunction > + inline OutputIterator + transform_impl(SinglePassTraversalReadableIterator1 first1, + SinglePassTraversalReadableIterator1 last1, + SinglePassTraversalReadableIterator2 first2, + SinglePassTraversalReadableIterator2 last2, + OutputIterator out, + BinaryFunction fn) + { + for (; first1 != last1; ++first1, ++first2) + { + BOOST_ASSERT( first2 != last2 ); + *out = fn(*first1, *first2); + ++out; + } + return out; + } + } + + namespace range + { + + /// \overload + template< class SinglePassRange1, + class SinglePassRange2, + class OutputIterator, + class BinaryOperation > + inline OutputIterator + transform(const SinglePassRange1& rng1, + const SinglePassRange2& rng2, + OutputIterator out, + BinaryOperation fun) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return range_detail::transform_impl( + boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), boost::end(rng2), + out, fun); + } + + } // namespace range + using range::transform; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/unique.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/unique.hpp new file mode 100755 index 0000000000..be6eaf932e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/unique.hpp @@ -0,0 +1,107 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_UNIQUE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_UNIQUE_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function unique +/// +/// range-based version of the unique std algorithm +/// +/// \pre Rng meets the requirements for a Forward range +template< range_return_value re, class ForwardRange > +inline BOOST_DEDUCED_TYPENAME range_return::type +unique( ForwardRange& rng ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack( std::unique( boost::begin(rng), + boost::end(rng)), rng ); +} + +/// \overload +template< range_return_value re, class ForwardRange > +inline BOOST_DEDUCED_TYPENAME range_return::type +unique( const ForwardRange& rng ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack( std::unique( boost::begin(rng), + boost::end(rng)), rng ); +} +/// \overload +template< range_return_value re, class ForwardRange, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +unique( ForwardRange& rng, BinaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::unique(boost::begin(rng), boost::end(rng), pred), + rng); +} +/// \overload +template< range_return_value re, class ForwardRange, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +unique( const ForwardRange& rng, BinaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::unique(boost::begin(rng), boost::end(rng), pred), + rng); +} + +/// \overload +template< class ForwardRange > +inline BOOST_DEDUCED_TYPENAME range_return::type +unique( ForwardRange& rng ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return ::boost::range::unique(rng); +} +/// \overload +template< class ForwardRange > +inline BOOST_DEDUCED_TYPENAME range_return::type +unique( const ForwardRange& rng ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return ::boost::range::unique(rng); +} +/// \overload +template< class ForwardRange, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +unique( ForwardRange& rng, BinaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return ::boost::range::unique(rng); +} +/// \overload +template< class ForwardRange, class BinaryPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +unique( const ForwardRange& rng, BinaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return ::boost::range::unique(rng, pred); +} + + } // namespace range + using range::unique; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/unique_copy.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/unique_copy.hpp new file mode 100755 index 0000000000..0682d747ea --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/unique_copy.hpp @@ -0,0 +1,51 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_UNIQUE_COPY_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_UNIQUE_COPY_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function unique_copy +/// +/// range-based version of the unique_copy std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +/// \pre OutputIterator is a model of the OutputIteratorConcept +/// \pre BinaryPredicate is a model of the BinaryPredicateConcept +template< class SinglePassRange, class OutputIterator > +inline OutputIterator +unique_copy( const SinglePassRange& rng, OutputIterator out_it ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::unique_copy(boost::begin(rng), boost::end(rng), out_it); +} +/// \overload +template< class SinglePassRange, class OutputIterator, class BinaryPredicate > +inline OutputIterator +unique_copy( const SinglePassRange& rng, OutputIterator out_it, + BinaryPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + return std::unique_copy(boost::begin(rng), boost::end(rng), out_it, pred); +} + + } // namespace range + using range::unique_copy; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm/upper_bound.hpp b/deal.II/contrib/boost/include/boost/range/algorithm/upper_bound.hpp new file mode 100755 index 0000000000..8aa26bd174 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm/upper_bound.hpp @@ -0,0 +1,71 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_UPPER_BOUND_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_UPPER_BOUND_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function upper_bound +/// +/// range-based version of the upper_bound std algorithm +/// +/// \pre ForwardRange is a model of the ForwardRangeConcept +template< class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +upper_bound( ForwardRange& rng, Value val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::upper_bound(boost::begin(rng), boost::end(rng), val); +} +/// \overload +/// \overload +template< class ForwardRange, class Value, class SortPredicate > +inline BOOST_DEDUCED_TYPENAME range_iterator::type +upper_bound( ForwardRange& rng, Value val, SortPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return std::upper_bound(boost::begin(rng), boost::end(rng), val, pred); +} +/// \overload +template< range_return_value re, class ForwardRange, class Value > +inline BOOST_DEDUCED_TYPENAME range_return::type +upper_bound( ForwardRange& rng, Value val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::upper_bound(boost::begin(rng), boost::end(rng), val), + rng); +} +/// \overload +template< range_return_value re, class ForwardRange, class Value, + class SortPredicate > +inline BOOST_DEDUCED_TYPENAME range_return::type +upper_bound( ForwardRange& rng, Value val, SortPredicate pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + return range_return:: + pack(std::upper_bound(boost::begin(rng), boost::end(rng), val, pred), + rng); +} + + } // namespace range + using range::upper_bound; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext.hpp new file mode 100755 index 0000000000..783d38a6f2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext.hpp @@ -0,0 +1,28 @@ +// Boost.Range library +// +// Copyright Neil Groves 2007. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Copyright Thorsten Ottosen 2006. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_HPP +#define BOOST_RANGE_ALGORITHM_EXT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/copy_n.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/copy_n.hpp new file mode 100755 index 0000000000..ba7ad1cfce --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/copy_n.hpp @@ -0,0 +1,53 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_COPY_N_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_COPY_N_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +/// \brief template function copy +/// +/// range-based version of the copy std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +/// \pre OutputIterator is a model of the OutputIteratorConcept +/// \pre 0 <= n < distance(rng) +template< class SinglePassRange, class Size, class OutputIterator > +inline OutputIterator copy_n(const SinglePassRange& rng, Size n, OutputIterator out) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_ASSERT( n < static_cast(boost::distance(rng)) ); + BOOST_ASSERT( n >= static_cast(0) ); + + BOOST_DEDUCED_TYPENAME range_iterator::type source = boost::begin(rng); + + for (Size i = 0; i < n; ++i, ++out, ++source) + *out = *source; + + return out; +} + + } // namespace range + using range::copy_n; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/erase.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/erase.hpp new file mode 100755 index 0000000000..107d32b56b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/erase.hpp @@ -0,0 +1,61 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_ERASE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EXT_ERASE_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +template< class Container > +inline Container& erase( Container& on, + iterator_range to_erase ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + on.erase( boost::begin(to_erase), boost::end(to_erase) ); + return on; +} + +template< class Container, class T > +inline Container& remove_erase( Container& on, const T& val ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + on.erase( + std::remove(boost::begin(on), boost::end(on), val), + boost::end(on)); + return on; +} + +template< class Container, class Pred > +inline Container& remove_erase_if( Container& on, Pred pred ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + on.erase( + std::remove_if(boost::begin(on), boost::end(on), pred), + boost::end(on)); + return on; +} + + } // namespace range + using range::erase; + using range::remove_erase; + using range::remove_erase_if; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/for_each.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/for_each.hpp new file mode 100755 index 0000000000..a470e2b774 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/for_each.hpp @@ -0,0 +1,86 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_FOR_EACH_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EXT_FOR_EACH_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + template + inline Fn2 for_each_impl(InputIterator1 first1, InputIterator1 last1, + InputIterator2 first2, InputIterator2 last2, + Fn2 fn) + { + for (; first1 != last1 && first2 != last2; ++first1, ++first2) + { + fn(*first1, *first2); + } + return fn; + } + } + + namespace range + { + template + inline Fn2 for_each(const SinglePassRange1& rng1, const SinglePassRange2& rng2, Fn2 fn) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::for_each_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), fn); + } + + template + inline Fn2 for_each(const SinglePassRange1& rng1, SinglePassRange2& rng2, Fn2 fn) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::for_each_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), fn); + } + + template + inline Fn2 for_each(SinglePassRange1& rng1, const SinglePassRange2& rng2, Fn2 fn) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::for_each_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), fn); + } + + template + inline Fn2 for_each(SinglePassRange1& rng1, SinglePassRange2& rng2, Fn2 fn) + { + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + return ::boost::range_detail::for_each_impl( + ::boost::begin(rng1), ::boost::end(rng1), + ::boost::begin(rng2), ::boost::end(rng2), fn); + } + } // namespace range + using range::for_each; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/insert.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/insert.hpp new file mode 100755 index 0000000000..b9adfdd3f7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/insert.hpp @@ -0,0 +1,42 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_INSERT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EXT_INSERT_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +template< class Container, class Range > +inline Container& insert( Container& on, + BOOST_DEDUCED_TYPENAME Container::iterator before, + const Range& from ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_ASSERT( (void*)&on != (void*)&from && + "cannot copy from a container to itself" ); + on.insert( before, boost::begin(from), boost::end(from) ); + return on; +} + + } // namespace range + using range::insert; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/iota.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/iota.hpp new file mode 100644 index 0000000000..65cbc89ac6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/iota.hpp @@ -0,0 +1,41 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_IOTA_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EXT_IOTA_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +template< class ForwardRange, class Value > +inline ForwardRange& iota( ForwardRange& rng, Value x ) +{ + BOOST_CONCEPT_ASSERT(( ForwardRangeConcept )); + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iterator_t; + + iterator_t last_target = ::boost::end(rng); + for (iterator_t target = ::boost::begin(rng); target != last_target; ++target, ++x) + *target = x; + + return rng; +} + + } // namespace range + using range::iota; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/is_sorted.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/is_sorted.hpp new file mode 100755 index 0000000000..69ead1081e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/is_sorted.hpp @@ -0,0 +1,71 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_IS_SORTED_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EXT_IS_SORTED_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + template + inline bool is_sorted(ForwardIterator first, ForwardIterator last) + { + for (ForwardIterator next = first; first != last && ++next != last; ++first) + if (*next < *first) + return false; + return true; + } + + template + inline bool is_sorted(ForwardIterator first, ForwardIterator last, BinaryPredicate pred) + { + for (ForwardIterator next = first; first != last && ++next != last; ++first) + if (pred(*next, *first)) + return false; + return true; + } + } + + namespace range + { + +/// \brief template function count +/// +/// range-based version of the count std algorithm +/// +/// \pre SinglePassRange is a model of the SinglePassRangeConcept +template +inline bool is_sorted(const SinglePassRange& rng) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((LessThanComparableConcept::type>)); + return range_detail::is_sorted(boost::begin(rng), boost::end(rng)); +} + +/// \overload +template +inline bool is_sorted(const SinglePassRange& rng, BinaryPredicate pred) +{ + BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept::type, BOOST_DEDUCED_TYPENAME range_value::type>)); + return range_detail::is_sorted(boost::begin(rng), boost::end(rng), pred); +} + + } // namespace range + using range::is_sorted; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/overwrite.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/overwrite.hpp new file mode 100755 index 0000000000..d2cf4edb33 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/overwrite.hpp @@ -0,0 +1,57 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_OVERWRITE_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EXT_OVERWRITE_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +template< class SinglePassRange1, class SinglePassRange2 > +inline void overwrite( const SinglePassRange1& from, SinglePassRange2& to ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + BOOST_DEDUCED_TYPENAME range_iterator::type + i = boost::begin(from), e = boost::end(from); + + BOOST_DEDUCED_TYPENAME range_iterator::type + out = boost::begin(to); + +#ifndef NDEBUG + BOOST_DEDUCED_TYPENAME range_iterator::type + last_out = boost::end(to); +#endif + + for( ; i != e; ++out, ++i ) + { +#ifndef NDEBUG + BOOST_ASSERT( out != last_out + && "out of bounds in boost::overwrite()" ); +#endif + *out = *i; + } +} + + } // namespace range + using range::overwrite; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/push_back.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/push_back.hpp new file mode 100755 index 0000000000..51a7a7b793 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/push_back.hpp @@ -0,0 +1,40 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_PUSH_BACK_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EXT_PUSH_BACK_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +template< class Container, class Range > +inline Container& push_back( Container& on, const Range& from ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_ASSERT( (void*)&on != (void*)&from && + "cannot copy from a container to itself" ); + on.insert( on.end(), boost::begin(from), boost::end(from) ); + return on; +} + + } // namespace range + using range::push_back; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/algorithm_ext/push_front.hpp b/deal.II/contrib/boost/include/boost/range/algorithm_ext/push_front.hpp new file mode 100755 index 0000000000..470d793123 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/algorithm_ext/push_front.hpp @@ -0,0 +1,40 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ALGORITHM_EXT_PUSH_FRONT_HPP_INCLUDED +#define BOOST_RANGE_ALGORITHM_EXT_PUSH_FRONT_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + +template< class Container, class Range > +inline Container& push_front( Container& on, const Range& from ) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_ASSERT( (void*)&on != (void*)&from && + "cannot copy from a container to itself" ); + on.insert( on.begin(), boost::begin(from), boost::end(from) ); + return on; +} + + } // namespace range + using range::push_front; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/as_literal.hpp b/deal.II/contrib/boost/include/boost/range/as_literal.hpp index 2f04ca8f0c..f67ead7d30 100644 --- a/deal.II/contrib/boost/include/boost/range/as_literal.hpp +++ b/deal.II/contrib/boost/include/boost/range/as_literal.hpp @@ -25,7 +25,7 @@ #include #include -#ifndef BOOST_NO_CWCHAR +#ifndef BOOST_NO_CWCHAR #include #endif @@ -38,41 +38,41 @@ namespace boost return strlen( s ); } -#ifndef BOOST_NO_CWCHAR +#ifndef BOOST_NO_CWCHAR inline std::size_t length( const wchar_t* s ) { return wcslen( s ); } -#endif +#endif // // Remark: the compiler cannot choose between T* and T[sz] // overloads, so we must put the T* internal to the // unconstrained version. - // + // inline bool is_char_ptr( char* ) { return true; } - + inline bool is_char_ptr( const char* ) { return true; } -#ifndef BOOST_NO_CWCHAR +#ifndef BOOST_NO_CWCHAR inline bool is_char_ptr( wchar_t* ) { return true; } - + inline bool is_char_ptr( const wchar_t* ) { return true; } #endif - + template< class T > inline long is_char_ptr( T /* r */ ) { @@ -80,30 +80,30 @@ namespace boost } template< class T > - inline iterator_range + inline iterator_range make_range( T* const r, bool ) { return iterator_range( r, r + length(r) ); } template< class T > - inline iterator_range::type> + inline iterator_range::type> make_range( T& r, long ) { return boost::make_iterator_range( r ); } } - + template< class Range > - inline iterator_range::type> + inline iterator_range::type> as_literal( Range& r ) { return range_detail::make_range( r, range_detail::is_char_ptr(r) ); } template< class Range > - inline iterator_range::type> + inline iterator_range::type> as_literal( const Range& r ) { return range_detail::make_range( r, range_detail::is_char_ptr(r) ); @@ -112,9 +112,9 @@ namespace boost template< class Char, std::size_t sz > inline iterator_range as_literal( Char (&arr)[sz] ) { - return range_detail::make_range( arr, range_detail::is_char_ptr(arr) ); + return range_detail::make_range( arr, range_detail::is_char_ptr(arr) ); } - + template< class Char, std::size_t sz > inline iterator_range as_literal( const Char (&arr)[sz] ) { diff --git a/deal.II/contrib/boost/include/boost/range/combine.hpp b/deal.II/contrib/boost/include/boost/range/combine.hpp new file mode 100755 index 0000000000..8b1be0057f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/combine.hpp @@ -0,0 +1,296 @@ +#ifndef BOOST_RANGE_COMBINE_HPP +#define BOOST_RANGE_COMBINE_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + struct void_ { typedef void_ type; }; + } + + template<> struct range_iterator< ::boost::range_detail::void_ > + { + typedef ::boost::tuples::null_type type; + }; + + namespace range_detail + { + inline ::boost::tuples::null_type range_begin( ::boost::range_detail::void_& ) + { return ::boost::tuples::null_type(); } + + inline ::boost::tuples::null_type range_begin( const ::boost::range_detail::void_& ) + { return ::boost::tuples::null_type(); } + + inline ::boost::tuples::null_type range_end( ::boost::range_detail::void_& ) + { return ::boost::tuples::null_type(); } + + inline ::boost::tuples::null_type range_end( const ::boost::range_detail::void_& ) + { return ::boost::tuples::null_type(); } + + template< class T > + struct tuple_iter + { + typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::eval_if_c< + ::boost::is_same::value, + ::boost::mpl::identity< ::boost::tuples::null_type >, + ::boost::range_iterator + >::type type; + }; + + template< class Rng1, class Rng2 > + struct tuple_range + { + typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::eval_if_c< + ::boost::is_same::value, + ::boost::range_detail::void_, + ::boost::mpl::identity + >::type type; + }; + + template + < + class R1, + class R2, + class R3, + class R4, + class R5, + class R6 + > + struct generate_tuple + { + typedef ::boost::tuples::tuple< + BOOST_DEDUCED_TYPENAME tuple_iter::type, + BOOST_DEDUCED_TYPENAME tuple_iter::type, + BOOST_DEDUCED_TYPENAME tuple_iter::type, + BOOST_DEDUCED_TYPENAME tuple_iter::type, + BOOST_DEDUCED_TYPENAME tuple_iter::type, + BOOST_DEDUCED_TYPENAME tuple_iter::type + > type; + + static type begin( R1& r1, R2& r2, R3& r3, R4& r4, R5& r5, R6& r6 ) + { + return ::boost::tuples::make_tuple( ::boost::begin(r1), + ::boost::begin(r2), + ::boost::begin(r3), + ::boost::begin(r4), + ::boost::begin(r5), + ::boost::begin(r6) ); + } + + static type end( R1& r1, R2& r2, R3& r3, R4& r4, R5& r5, R6& r6 ) + { + return ::boost::tuples::make_tuple( ::boost::end(r1), + ::boost::end(r2), + ::boost::end(r3), + ::boost::end(r4), + ::boost::end(r5), + ::boost::end(r6) ); + } + }; + + template + < + class R1, + class R2 = void_, + class R3 = void_, + class R4 = void_, + class R5 = void_, + class R6 = void_ + > + struct zip_rng + : iterator_range< + zip_iterator< + BOOST_DEDUCED_TYPENAME generate_tuple::type + > + > + { + private: + typedef generate_tuple generator_t; + typedef BOOST_DEDUCED_TYPENAME generator_t::type tuple_t; + typedef zip_iterator zip_iter_t; + typedef iterator_range base_t; + + public: + zip_rng( R1& r1, R2& r2, R3& r3, R4& r4, R5& r5, R6& r6 ) + : base_t( zip_iter_t( generator_t::begin(r1,r2,r3,r4,r5,r6) ), + zip_iter_t( generator_t::end(r1,r2,r3,r4,r5,r6) ) ) + { + BOOST_ASSERT(::boost::distance(r1) <= ::boost::distance(r2)); + BOOST_ASSERT(::boost::distance(r1) <= ::boost::distance(r3)); + BOOST_ASSERT(::boost::distance(r1) <= ::boost::distance(r4)); + BOOST_ASSERT(::boost::distance(r1) <= ::boost::distance(r5)); + BOOST_ASSERT(::boost::distance(r1) <= ::boost::distance(r6)); + } + + template< class Zip, class Rng > + zip_rng( Zip& z, Rng& r ) + : base_t( zip_iter_t( generator_t::begin( z, r ) ), + zip_iter_t( generator_t::end( z, r ) ) ) + { + + // @todo: tuple::begin( should be overloaded for this situation + } + + struct tuple_length : ::boost::tuples::length + { }; + + template< unsigned N > + struct get + { + template< class Z, class R > + static BOOST_DEDUCED_TYPENAME ::boost::tuples::element::type begin( Z& z, R& ) + { + return get( z.begin().get_iterator_tuple() ); + } + + template< class Z, class R > + static BOOST_DEDUCED_TYPENAME ::boost::tuples::element::type end( Z& z, R& r ) + { + return get( z.end().get_iterator_tuple() ); + } + }; + + }; + + template< class Rng1, class Rng2 > + struct zip_range + : iterator_range< + zip_iterator< + ::boost::tuples::tuple< + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type + > + > + > + { + private: + typedef zip_iterator< + ::boost::tuples::tuple< + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type + > + > zip_iter_t; + typedef iterator_range base_t; + + public: + zip_range( Rng1& r1, Rng2& r2 ) + : base_t( zip_iter_t( ::boost::tuples::make_tuple(::boost::begin(r1), + ::boost::begin(r2)) ), + zip_iter_t( ::boost::tuples::make_tuple(::boost::end(r1), + ::boost::end(r2)) ) ) + { + BOOST_ASSERT(::boost::distance(r1) <= ::boost::distance(r2)); + } + }; + + template< class Rng1, class Rng2, class Rng3 > + struct zip_range3 + : iterator_range< + zip_iterator< + ::boost::tuples::tuple< + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type + > + > + > + { + private: + typedef zip_iterator< + ::boost::tuples::tuple< + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type, + BOOST_DEDUCED_TYPENAME ::boost::range_iterator::type + > + > zip_iter_t; + typedef iterator_range base_t; + + public: + zip_range3( Rng1& r1, Rng2& r2, Rng3& r3 ) + : base_t( zip_iter_t( ::boost::tuples::make_tuple(::boost::begin(r1), + ::boost::begin(r2), + ::boost::begin(r3)) ), + zip_iter_t( ::boost::tuples::make_tuple(::boost::end(r1), + ::boost::end(r2), + ::boost::end(r3)) ) + ) + { + BOOST_ASSERT(::boost::distance(r1) <= ::boost::distance(r2)); + BOOST_ASSERT(::boost::distance(r1) <= ::boost::distance(r3)); + } + }; + + + struct combine_tag {}; + + template< class Rng > + inline zip_rng + operator&( combine_tag, Rng& r ) + { + return zip_rng(r); + } + + template< class Rng > + inline iterator_range + operator&( combine_tag, const Rng& r ) + { + return iterator_range(r); + } + + template + < + class R1, + class R2, + class R3, + class R4, + class R5, + class Rng + > + inline BOOST_DEDUCED_TYPENAME zip_rng::next + operator&( const zip_rng& zip, + Rng& r ) + { + return zip_rng::next( zip, r ); + } + + } // namespace range_detail + + template< class Rng1, class Rng2 > + inline ::boost::range_detail::zip_range combine( Rng1& r1, Rng2& r2 ) + { + return ::boost::range_detail::zip_range(r1, r2); + } + + template< class Rng1, class Rng2 > + inline ::boost::range_detail::zip_range combine( const Rng1& r1, Rng2& r2 ) + { + return ::boost::range_detail::zip_range(r1, r2); + } + + template< class Rng1, class Rng2 > + inline ::boost::range_detail::zip_range combine( Rng1& r1, const Rng2& r2 ) + { + return ::boost::range_detail::zip_range(r1, r2); + } + + template< class Rng1, class Rng2 > + inline ::boost::range_detail::zip_range combine( const Rng1& r1, const Rng2& r2 ) + { + return ::boost::range_detail::zip_range(r1, r2); + } + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/concepts.hpp b/deal.II/contrib/boost/include/boost/range/concepts.hpp index 53a88dc3d9..8e4d2cfd57 100644 --- a/deal.II/contrib/boost/include/boost/range/concepts.hpp +++ b/deal.II/contrib/boost/include/boost/range/concepts.hpp @@ -1,5 +1,10 @@ // Boost.Range library concept checks // +// Copyright Neil Groves 2009. Use, modification and distribution +// are subject to the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// // Copyright Daniel Walker 2006. Use, modification and distribution // are subject to the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -15,6 +20,9 @@ #include #include #include +#include +#include +#include /*! * \file @@ -29,20 +37,15 @@ * concept. * * \code - * function_requires >(); + * BOOST_CONCEPT_ASSERT((ForwardRangeConcept)); * \endcode * - * An additional concept check is required for the value access - * property of the range. For example to check for a - * ForwardReadableRange, the following code is required. + * A different concept check is required to ensure writeable value + * access. For example to check for a ForwardRange that can be written + * to, the following code is required. * * \code - * function_requires >(); - * function_requires< - * ReadableIteratorConcept< - * typename range_iterator::type - * > - * >(); + * BOOST_CONCEPT_ASSERT((WriteableForwardRangeConcept)); * \endcode * * \see http://www.boost.org/libs/range/doc/range.html for details @@ -55,84 +58,272 @@ namespace boost { + namespace range_detail { + +#ifndef BOOST_RANGE_ENABLE_CONCEPT_ASSERT + +// List broken compiler versions here: + #ifdef __GNUC__ + // GNUC 4.2 has strange issues correctly detecting compliance with the Concepts + // hence the least disruptive approach is to turn-off the concept checking for + // this version of the compiler. + #if __GNUC__ == 4 && __GNUC_MINOR__ == 2 + #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 0 + #endif + #endif + + #ifdef __BORLANDC__ + #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 0 + #endif + + #ifdef __PATHCC__ + #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 0 + #endif + +// Default to using the concept asserts unless we have defined it off +// during the search for black listed compilers. + #ifndef BOOST_RANGE_ENABLE_CONCEPT_ASSERT + #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 1 + #endif + +#endif + +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + #define BOOST_RANGE_CONCEPT_ASSERT( x ) BOOST_CONCEPT_ASSERT( x ) +#else + #define BOOST_RANGE_CONCEPT_ASSERT( x ) +#endif + + // Rationale for the inclusion of redefined iterator concept + // classes: + // + // The Range algorithms often do not require that the iterators are + // Assignable, but the correct standard conformant iterators + // do require the iterators to be a model of the Assignable concept. + // Iterators that contains a functor that is not assignable therefore + // are not correct models of the standard iterator concepts, + // despite being adequate for most algorithms. An example of this + // use case is the combination of the boost::adaptors::filtered + // class with a boost::lambda::bind generated functor. + // Ultimately modeling the range concepts using composition + // with the Boost.Iterator concepts would render the library + // incompatible with many common Boost.Lambda expressions. + template + struct IncrementableIteratorConcept : CopyConstructible + { +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + typedef BOOST_DEDUCED_TYPENAME iterator_traversal::type traversal_category; + + BOOST_RANGE_CONCEPT_ASSERT(( + Convertible< + traversal_category, + incrementable_traversal_tag + >)); + + BOOST_CONCEPT_USAGE(IncrementableIteratorConcept) + { + ++i; + (void)i++; + } + private: + Iterator i; +#endif + }; + + template + struct SinglePassIteratorConcept + : IncrementableIteratorConcept + , EqualityComparable + { +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + BOOST_RANGE_CONCEPT_ASSERT(( + Convertible< + BOOST_DEDUCED_TYPENAME SinglePassIteratorConcept::traversal_category, + single_pass_traversal_tag + >)); +#endif + }; + + template + struct ForwardIteratorConcept + : SinglePassIteratorConcept + , DefaultConstructible + { +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + typedef BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits::difference_type difference_type; + + BOOST_MPL_ASSERT((is_integral)); + BOOST_MPL_ASSERT_RELATION(std::numeric_limits::is_signed, ==, true); + + BOOST_RANGE_CONCEPT_ASSERT(( + Convertible< + BOOST_DEDUCED_TYPENAME ForwardIteratorConcept::traversal_category, + forward_traversal_tag + >)); +#endif + }; + + template + struct BidirectionalIteratorConcept + : ForwardIteratorConcept + { + #if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + BOOST_RANGE_CONCEPT_ASSERT(( + Convertible< + BOOST_DEDUCED_TYPENAME BidirectionalIteratorConcept::traversal_category, + bidirectional_traversal_tag + >)); + + BOOST_CONCEPT_USAGE(BidirectionalIteratorConcept) + { + --i; + (void)i--; + } + private: + Iterator i; + #endif + }; + + template + struct RandomAccessIteratorConcept + : BidirectionalIteratorConcept + { + #if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + BOOST_RANGE_CONCEPT_ASSERT(( + Convertible< + BOOST_DEDUCED_TYPENAME RandomAccessIteratorConcept::traversal_category, + random_access_traversal_tag + >)); + + BOOST_CONCEPT_USAGE(RandomAccessIteratorConcept) + { + i += n; + i = i + n; + i = n + i; + i -= n; + i = i - n; + n = i - j; + } + private: + BOOST_DEDUCED_TYPENAME RandomAccessIteratorConcept::difference_type n; + Iterator i; + Iterator j; + #endif + }; + + } // namespace range_detail + //! Check if a type T models the SinglePassRange range concept. - template - struct SinglePassRangeConcept + template + struct SinglePassRangeConcept { - typedef typename range_iterator::type range_const_iterator; - typedef typename range_iterator::type range_iterator; +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + typedef BOOST_DEDUCED_TYPENAME range_iterator::type const_iterator; + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iterator; - void constraints() - { - function_requires< - boost_concepts::SinglePassIteratorConcept< - range_iterator - > - >(); - i = boost::begin(a); - i = boost::end(a); - const_constraints(a); + BOOST_RANGE_CONCEPT_ASSERT((range_detail::SinglePassIteratorConcept)); + BOOST_RANGE_CONCEPT_ASSERT((range_detail::SinglePassIteratorConcept)); + + BOOST_CONCEPT_USAGE(SinglePassRangeConcept) + { + // This has been modified from assigning to this->i + // (where i was a member variable) to improve + // compatibility with Boost.Lambda + iterator i1 = boost::begin(*m_range); + iterator i2 = boost::end(*m_range); + + ignore_unused_variable_warning(i1); + ignore_unused_variable_warning(i2); + + const_constraints(*m_range); } - - void const_constraints(const T& a) + + private: + void const_constraints(const T& const_range) { - ci = boost::begin(a); - ci = boost::end(a); + const_iterator ci1 = boost::begin(const_range); + const_iterator ci2 = boost::end(const_range); + + ignore_unused_variable_warning(ci1); + ignore_unused_variable_warning(ci2); } - T a; - range_iterator i; - range_const_iterator ci; + + // Rationale: + // The type of m_range is T* rather than T because it allows + // T to be an abstract class. The other obvious alternative of + // T& produces a warning on some compilers. + T* m_range; +#endif }; //! Check if a type T models the ForwardRange range concept. - template - struct ForwardRangeConcept + template + struct ForwardRangeConcept : SinglePassRangeConcept + { +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + BOOST_RANGE_CONCEPT_ASSERT((range_detail::ForwardIteratorConcept)); + BOOST_RANGE_CONCEPT_ASSERT((range_detail::ForwardIteratorConcept)); +#endif + }; + + template + struct WriteableRangeConcept { - void constraints() +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + typedef BOOST_DEDUCED_TYPENAME range_iterator::type iterator; + + BOOST_CONCEPT_USAGE(WriteableRangeConcept) { - function_requires< - SinglePassRangeConcept - >(); - function_requires< - boost_concepts::ForwardTraversalConcept< - typename range_iterator::type - > - >(); + *i = v; } + private: + iterator i; + BOOST_DEDUCED_TYPENAME range_value::type v; +#endif + }; + + //! Check if a type T models the WriteableForwardRange range concept. + template + struct WriteableForwardRangeConcept + : ForwardRangeConcept + , WriteableRangeConcept + { }; //! Check if a type T models the BidirectionalRange range concept. - template - struct BidirectionalRangeConcept + template + struct BidirectionalRangeConcept : ForwardRangeConcept + { +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept)); + BOOST_RANGE_CONCEPT_ASSERT((BidirectionalIteratorConcept)); +#endif + }; + + //! Check if a type T models the WriteableBidirectionalRange range concept. + template + struct WriteableBidirectionalRangeConcept + : BidirectionalRangeConcept + , WriteableRangeConcept { - void constraints() - { - function_requires< - ForwardRangeConcept - >(); - function_requires< - boost_concepts::BidirectionalTraversalConcept< - typename range_iterator::type - > - >(); - } }; //! Check if a type T models the RandomAccessRange range concept. - template - struct RandomAccessRangeConcept + template + struct RandomAccessRangeConcept : BidirectionalRangeConcept + { +#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT + BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept)); + BOOST_RANGE_CONCEPT_ASSERT((RandomAccessIteratorConcept)); +#endif + }; + + //! Check if a type T models the WriteableRandomAccessRange range concept. + template + struct WriteableRandomAccessRangeConcept + : RandomAccessRangeConcept + , WriteableRangeConcept { - void constraints() - { - function_requires< - BidirectionalRangeConcept - >(); - function_requires< - boost_concepts::RandomAccessTraversalConcept< - typename range_iterator::type - > - >(); - } }; } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/range/const_iterator.hpp b/deal.II/contrib/boost/include/boost/range/const_iterator.hpp index 195f9d4e7a..875320fb00 100644 --- a/deal.II/contrib/boost/include/boost/range/const_iterator.hpp +++ b/deal.II/contrib/boost/include/boost/range/const_iterator.hpp @@ -21,6 +21,7 @@ #include #else +#include #include #include #include @@ -31,11 +32,13 @@ namespace boost // default ////////////////////////////////////////////////////////////////////////// + namespace range_detail { + BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator ) + } + template< typename C > - struct range_const_iterator - { - typedef BOOST_DEDUCED_TYPENAME C::const_iterator type; - }; + struct range_const_iterator : range_detail::extract_const_iterator + {}; ////////////////////////////////////////////////////////////////////////// // pair diff --git a/deal.II/contrib/boost/include/boost/range/counting_range.hpp b/deal.II/contrib/boost/include/boost/range/counting_range.hpp new file mode 100755 index 0000000000..bf22f7ca94 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/counting_range.hpp @@ -0,0 +1,69 @@ +// Boost.Range library +// +// Copyright Neil Groves 2008. Use, modification and +// distribution is subject to the Boost Software Licence, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// +// For more information, see http://www.boost.org/libs/range +// + +#ifndef BOOST_RANGE_COUNTING_RANGE_HPP_INCLUDED +#define BOOST_RANGE_COUNTING_RANGE_HPP_INCLUDED + +#include +#if BOOST_MSVC >= 1400 +#pragma warning(push) +#pragma warning(disable : 4244) +#endif + +#include +#include +#include +#include + +namespace boost +{ + + template + inline iterator_range > + counting_range(Value first, Value last) + { + typedef counting_iterator counting_iterator_t; + typedef iterator_range result_t; + return result_t(counting_iterator_t(first), + counting_iterator_t(last)); + } + + template + inline iterator_range::type> > + counting_range(const Range& rng) + { + typedef counting_iterator::type> counting_iterator_t; + typedef iterator_range result_t; + return boost::empty(rng) + ? result_t() + : result_t( + counting_iterator_t(*boost::begin(rng)), + counting_iterator_t(*boost::prior(boost::end(rng)))); + } + + template + inline iterator_range::type> > + counting_range(Range& rng) + { + typedef counting_iterator::type> counting_iterator_t; + typedef iterator_range result_t; + return boost::empty(rng) + ? result_t() + : result_t( + counting_iterator_t(*boost::begin(rng)), + counting_iterator_t(*boost::prior(boost::end(rng)))); + } +} // namespace boost + +#if BOOST_MSVC >= 1400 +#pragma warning(pop) +#endif + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/detail/demote_iterator_traversal_tag.hpp b/deal.II/contrib/boost/include/boost/range/detail/demote_iterator_traversal_tag.hpp new file mode 100755 index 0000000000..5d77678e89 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/detail/demote_iterator_traversal_tag.hpp @@ -0,0 +1,79 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_DETAIL_DEMOTE_ITERATOR_TRAVERSAL_TAG_HPP_INCLUDED +#define BOOST_RANGE_DETAIL_DEMOTE_ITERATOR_TRAVERSAL_TAG_HPP_INCLUDED + +#include + +namespace boost +{ + namespace range_detail + { + +template +struct demote_iterator_traversal_tag +{ +}; + +#define BOOST_DEMOTE_TRAVERSAL_TAG( Tag1, Tag2, ResultTag ) \ +template<> struct demote_iterator_traversal_tag< Tag1 , Tag2 > \ +{ \ + typedef ResultTag type; \ +}; + +BOOST_DEMOTE_TRAVERSAL_TAG( no_traversal_tag, no_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( no_traversal_tag, incrementable_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( no_traversal_tag, single_pass_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( no_traversal_tag, forward_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( no_traversal_tag, bidirectional_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( no_traversal_tag, random_access_traversal_tag, no_traversal_tag ) + +BOOST_DEMOTE_TRAVERSAL_TAG( incrementable_traversal_tag, no_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( incrementable_traversal_tag, incrementable_traversal_tag, incrementable_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( incrementable_traversal_tag, single_pass_traversal_tag, incrementable_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( incrementable_traversal_tag, forward_traversal_tag, incrementable_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( incrementable_traversal_tag, bidirectional_traversal_tag, incrementable_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( incrementable_traversal_tag, random_access_traversal_tag, incrementable_traversal_tag ) + +BOOST_DEMOTE_TRAVERSAL_TAG( single_pass_traversal_tag, no_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( single_pass_traversal_tag, incrementable_traversal_tag, incrementable_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( single_pass_traversal_tag, single_pass_traversal_tag, single_pass_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( single_pass_traversal_tag, forward_traversal_tag, single_pass_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( single_pass_traversal_tag, bidirectional_traversal_tag, single_pass_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( single_pass_traversal_tag, random_access_traversal_tag, single_pass_traversal_tag ) + +BOOST_DEMOTE_TRAVERSAL_TAG( forward_traversal_tag, no_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( forward_traversal_tag, incrementable_traversal_tag, incrementable_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( forward_traversal_tag, single_pass_traversal_tag, single_pass_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( forward_traversal_tag, forward_traversal_tag, forward_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( forward_traversal_tag, bidirectional_traversal_tag, forward_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( forward_traversal_tag, random_access_traversal_tag, forward_traversal_tag ) + +BOOST_DEMOTE_TRAVERSAL_TAG( bidirectional_traversal_tag, no_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( bidirectional_traversal_tag, incrementable_traversal_tag, incrementable_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( bidirectional_traversal_tag, single_pass_traversal_tag, single_pass_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( bidirectional_traversal_tag, forward_traversal_tag, forward_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( bidirectional_traversal_tag, bidirectional_traversal_tag, bidirectional_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( bidirectional_traversal_tag, random_access_traversal_tag, bidirectional_traversal_tag ) + +BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, no_traversal_tag, no_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, incrementable_traversal_tag, incrementable_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, single_pass_traversal_tag, single_pass_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, forward_traversal_tag, forward_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, bidirectional_traversal_tag, bidirectional_traversal_tag ) +BOOST_DEMOTE_TRAVERSAL_TAG( random_access_traversal_tag, random_access_traversal_tag, random_access_traversal_tag ) + +#undef BOOST_DEMOTE_TRAVERSAL_TAG + + } // namespace range_detail +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/detail/extract_optional_type.hpp b/deal.II/contrib/boost/include/boost/range/detail/extract_optional_type.hpp new file mode 100755 index 0000000000..8292e34fa6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/detail/extract_optional_type.hpp @@ -0,0 +1,52 @@ +// Boost.Range library +// +// Copyright Arno Schoedl & Neil Groves 2009. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_DETAIL_EXTRACT_OPTIONAL_TYPE_HPP_INCLUDED +#define BOOST_RANGE_DETAIL_EXTRACT_OPTIONAL_TYPE_HPP_INCLUDED + +#if defined(_MSC_VER) && (_MSC_VER >= 1200) +# pragma once +#endif + +#include + +#ifdef BOOST_NO_PARTIAL_TEMPLATE_SPECIALIZATION + +#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \ + template< typename C > \ + struct extract_ ## a_typedef \ + { \ + typedef BOOST_DEDUCED_TYPENAME C::a_typedef type; \ + }; + +#else + +namespace boost { + namespace range_detail { + template< typename T > struct exists { typedef void type; }; + } +} + +// Defines extract_some_typedef which exposes T::some_typedef as +// extract_some_typedef::type if T::some_typedef exists. Otherwise +// extract_some_typedef is empty. +#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \ + template< typename C, typename Enable=void > \ + struct extract_ ## a_typedef \ + {}; \ + template< typename C > \ + struct extract_ ## a_typedef< C \ + , BOOST_DEDUCED_TYPENAME boost::range_detail::exists< BOOST_DEDUCED_TYPENAME C::a_typedef >::type \ + > { \ + typedef BOOST_DEDUCED_TYPENAME C::a_typedef type; \ + }; + +#endif + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/detail/implementation_help.hpp b/deal.II/contrib/boost/include/boost/range/detail/implementation_help.hpp index ca12fa4d10..1f7d163edc 100644 --- a/deal.II/contrib/boost/include/boost/range/detail/implementation_help.hpp +++ b/deal.II/contrib/boost/include/boost/range/detail/implementation_help.hpp @@ -21,13 +21,13 @@ #include #endif -namespace boost +namespace boost { namespace range_detail { template inline void boost_range_silence_warning( const T& ) { } - + ///////////////////////////////////////////////////////////////////// // end() help ///////////////////////////////////////////////////////////////////// @@ -36,7 +36,7 @@ namespace boost { return s + strlen( s ); } - + #ifndef BOOST_NO_CWCHAR inline const wchar_t* str_end( const wchar_t* s, const wchar_t* ) { @@ -51,7 +51,7 @@ namespace boost ; return s; } -#endif +#endif template< class Char > inline Char* str_end( Char* s ) @@ -64,7 +64,7 @@ namespace boost { return boost_range_array + sz; } - + template< class T, std::size_t sz > inline const T* array_end( const T BOOST_RANGE_ARRAY_REF()[sz] ) { @@ -74,7 +74,7 @@ namespace boost ///////////////////////////////////////////////////////////////////// // size() help ///////////////////////////////////////////////////////////////////// - + template< class Char > inline std::size_t str_size( const Char* const& s ) { @@ -96,7 +96,7 @@ namespace boost } } // namespace 'range_detail' - + } // namespace 'boost' diff --git a/deal.II/contrib/boost/include/boost/range/detail/join_iterator.hpp b/deal.II/contrib/boost/include/boost/range/detail/join_iterator.hpp new file mode 100644 index 0000000000..792f834b6c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/detail/join_iterator.hpp @@ -0,0 +1,357 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_DETAIL_JOIN_ITERATOR_HPP_INCLUDED +#define BOOST_RANGE_DETAIL_JOIN_ITERATOR_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + +template +struct join_iterator_link +{ +private: + class reference_count_t + { + public: + reference_count_t() : m_count(0u) {} + reference_count_t(const reference_count_t&) : m_count(0u) {} + reference_count_t& operator=(const reference_count_t&) { return *this; } + + void increment() { ++m_count; } + bool decrement() { return --m_count ? false : true; } + + private: + unsigned int m_count; + }; + +public: + join_iterator_link(Iterator1 last1, Iterator2 first2) + : last1(last1) + , first2(first2) + { + } + + void add_reference() const + { + count.increment(); + } + + bool release_reference() const + { + return count.decrement(); + } + + Iterator1 last1; + Iterator2 first2; + +private: + join_iterator_link() /* = delete */ ; + + mutable reference_count_t count; +}; + +} // range_detail + +template +inline void intrusive_ptr_add_ref(const range_detail::join_iterator_link* p) +{ + p->add_reference(); +} + +template +inline void intrusive_ptr_release(const range_detail::join_iterator_link* p) +{ + if (p->release_reference()) + delete p; +} + +namespace range_detail +{ + +class join_iterator_begin_tag {}; +class join_iterator_end_tag {}; + +template +class join_iterator_union +{ +public: + typedef Iterator1 iterator1_t; + typedef Iterator2 iterator2_t; + + join_iterator_union() {} + join_iterator_union(unsigned int /*selected*/, const iterator1_t& it1, const iterator2_t& it2) : m_it1(it1), m_it2(it2) {} + + iterator1_t& it1() { return m_it1; } + const iterator1_t& it1() const { return m_it1; } + + iterator2_t& it2() { return m_it2; } + const iterator2_t& it2() const { return m_it2; } + + Reference dereference(unsigned int selected) const + { + return selected ? *m_it2 : *m_it1; + } + + bool equal(const join_iterator_union& other, unsigned int selected) const + { + return selected + ? m_it2 == other.m_it2 + : m_it1 == other.m_it1; + } + +private: + iterator1_t m_it1; + iterator2_t m_it2; +}; + +template +class join_iterator_union +{ +public: + typedef Iterator iterator1_t; + typedef Iterator iterator2_t; + + join_iterator_union() {} + + join_iterator_union(unsigned int selected, const iterator1_t& it1, const iterator2_t& it2) + : m_it(selected ? it2 : it1) + { + } + + iterator1_t& it1() { return m_it; } + const iterator1_t& it1() const { return m_it; } + + iterator2_t& it2() { return m_it; } + const iterator2_t& it2() const { return m_it; } + + Reference dereference(unsigned int) const + { + return *m_it; + } + + bool equal(const join_iterator_union& other, unsigned int selected) const + { + return m_it == other.m_it; + } + +private: + iterator1_t m_it; +}; + +template::type + , typename Reference = typename iterator_reference::type + , typename Traversal = typename demote_iterator_traversal_tag< + typename iterator_traversal::type + , typename iterator_traversal::type>::type +> +class join_iterator + : public iterator_facade, ValueType, Traversal, Reference> +{ + typedef join_iterator_link link_t; + typedef join_iterator_union iterator_union; +public: + typedef Iterator1 iterator1_t; + typedef Iterator2 iterator2_t; + + join_iterator() : m_section(0u) {} + + join_iterator(unsigned int section, Iterator1 current1, Iterator1 last1, Iterator2 first2, Iterator2 current2) + : m_section(section) + , m_it(section, current1, current2) + , m_link(new link_t(last1, first2)) + { + } + + template + join_iterator(Range1& r1, Range2& r2, join_iterator_begin_tag) + : m_section(boost::empty(r1) ? 1u : 0u) + , m_it(boost::empty(r1) ? 1u : 0u, boost::begin(r1), boost::begin(r2)) + , m_link(new link_t(boost::end(r1), boost::begin(r2))) + { + } + + template + join_iterator(const Range1& r1, const Range2& r2, join_iterator_begin_tag) + : m_section(boost::empty(r1) ? 1u : 0u) + , m_it(boost::empty(r1) ? 1u : 0u, boost::const_begin(r1), boost::const_begin(r2)) + , m_link(new link_t(boost::const_end(r1), boost::const_begin(r2))) + { + } + + template + join_iterator(Range1& r1, Range2& r2, join_iterator_end_tag) + : m_section(1u) + , m_it(1u, boost::end(r1), boost::end(r2)) + , m_link(new link_t(boost::end(r1), boost::begin(r2))) + { + } + + template + join_iterator(const Range1& r1, const Range2& r2, join_iterator_end_tag) + : m_section(1u) + , m_it(1u, boost::const_end(r1), boost::const_end(r2)) + , m_link(new link_t(boost::const_end(r1), boost::const_begin(r2))) + { + } + +private: + void increment() + { + if (m_section) + ++m_it.it2(); + else + { + ++m_it.it1(); + if (m_it.it1() == m_link->last1) + { + m_it.it2() = m_link->first2; + m_section = 1u; + } + } + } + + void decrement() + { + if (m_section) + { + if (m_it.it2() == m_link->first2) + { + m_it.it1() = boost::prior(m_link->last1); + m_section = 0u; + } + else + --m_it.it2(); + } + else + --m_it.it1(); + } + + typename join_iterator::reference dereference() const + { + return m_it.dereference(m_section); + } + + bool equal(const join_iterator& other) const + { + return m_section == other.m_section + && m_it.equal(other.m_it, m_section); + } + + void advance(typename join_iterator::difference_type offset) + { + if (m_section) + advance_from_range2(offset); + else + advance_from_range1(offset); + } + + typename join_iterator::difference_type distance_to(const join_iterator& other) const + { + typename join_iterator::difference_type result; + if (m_section) + { + if (other.m_section) + result = other.m_it.it2() - m_it.it2(); + else + { + result = (m_link->first2 - m_it.it2()) + + (other.m_it.it1() - m_link->last1); + + BOOST_ASSERT( result <= 0 ); + } + } + else + { + if (other.m_section) + { + result = (m_link->last1 - m_it.it1()) + + (other.m_it.it2() - m_link->first2); + } + else + result = other.m_it.it1() - m_it.it1(); + } + return result; + } + + void advance_from_range2(typename join_iterator::difference_type offset) + { + typedef typename join_iterator::difference_type difference_t; + BOOST_ASSERT( m_section == 1u ); + if (offset < 0) + { + difference_t r2_dist = m_link->first2 - m_it.it2(); + BOOST_ASSERT( r2_dist <= 0 ); + if (offset >= r2_dist) + std::advance(m_it.it2(), offset); + else + { + difference_t r1_dist = offset - r2_dist; + BOOST_ASSERT( r1_dist <= 0 ); + m_it.it1() = m_link->last1 + r1_dist; + m_section = 0u; + } + } + else + std::advance(m_it.it2(), offset); + } + + void advance_from_range1(typename join_iterator::difference_type offset) + { + typedef typename join_iterator::difference_type difference_t; + BOOST_ASSERT( m_section == 0u ); + if (offset > 0) + { + difference_t r1_dist = m_link->last1 - m_it.it1(); + BOOST_ASSERT( r1_dist >= 0 ); + if (offset < r1_dist) + std::advance(m_it.it1(), offset); + else + { + difference_t r2_dist = offset - r1_dist; + BOOST_ASSERT( r2_dist >= 0 ); + m_it.it2() = m_link->first2 + r2_dist; + m_section = 1u; + } + } + else + std::advance(m_it.it1(), offset); + } + + unsigned int m_section; + iterator_union m_it; + intrusive_ptr m_link; + + friend class ::boost::iterator_core_access; +}; + + } // namespace range_detail + +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/detail/misc_concept.hpp b/deal.II/contrib/boost/include/boost/range/detail/misc_concept.hpp new file mode 100755 index 0000000000..74cb919f27 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/detail/misc_concept.hpp @@ -0,0 +1,33 @@ +// Boost.Range library concept checks +// +// Copyright Neil Groves 2009. Use, modification and distribution +// are subject to the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +#ifndef BOOST_RANGE_DETAIL_MISC_CONCEPT_HPP_INCLUDED +#define BOOST_RANGE_DETAIL_MISC_CONCEPT_HPP_INCLUDED + +#include + +namespace boost +{ + namespace range_detail + { + template + class SameTypeConcept + { + public: + BOOST_CONCEPT_USAGE(SameTypeConcept) + { + same_type(a,b); + } + private: + template void same_type(T,T) {} + T1 a; + T2 b; + }; + } +} + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/detail/range_return.hpp b/deal.II/contrib/boost/include/boost/range/detail/range_return.hpp new file mode 100755 index 0000000000..52a6073c2f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/detail/range_return.hpp @@ -0,0 +1,180 @@ +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_DETAIL_RANGE_RETURN_HPP_INCLUDED +#define BOOST_RANGE_DETAIL_RANGE_RETURN_HPP_INCLUDED + +#include +#include +#include + +namespace boost +{ + enum range_return_value + { + // (*) indicates the most common values + return_found, // only the found resulting iterator (*) + return_next, // next(found) iterator + return_prior, // prior(found) iterator + return_begin_found, // [begin, found) range (*) + return_begin_next, // [begin, next(found)) range + return_begin_prior, // [begin, prior(found)) range + return_found_end, // [found, end) range (*) + return_next_end, // [next(found), end) range + return_prior_end, // [prior(found), end) range + return_begin_end // [begin, end) range + }; + + template< class SinglePassRange, range_return_value > + struct range_return + { + typedef boost::iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > type; + + static type pack(BOOST_DEDUCED_TYPENAME range_iterator::type found, + SinglePassRange& rng) + { + return type(found, boost::end(rng)); + } + }; + + template< class SinglePassRange > + struct range_return< SinglePassRange, return_found > + { + typedef BOOST_DEDUCED_TYPENAME range_iterator::type type; + + static type pack(type found, SinglePassRange&) + { + return found; + } + }; + + template< class SinglePassRange > + struct range_return< SinglePassRange, return_next > + { + typedef BOOST_DEDUCED_TYPENAME range_iterator::type type; + + static type pack(type found, SinglePassRange& rng) + { + return found == boost::end(rng) + ? found + : boost::next(found); + } + }; + + template< class BidirectionalRange > + struct range_return< BidirectionalRange, return_prior > + { + typedef BOOST_DEDUCED_TYPENAME range_iterator::type type; + + static type pack(type found, BidirectionalRange& rng) + { + return found == boost::begin(rng) + ? found + : boost::prior(found); + } + }; + + template< class SinglePassRange > + struct range_return< SinglePassRange, return_begin_found > + { + typedef boost::iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > type; + + static type pack(BOOST_DEDUCED_TYPENAME range_iterator::type found, + SinglePassRange& rng) + { + return type(boost::begin(rng), found); + } + }; + + template< class SinglePassRange > + struct range_return< SinglePassRange, return_begin_next > + { + typedef boost::iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > type; + + static type pack(BOOST_DEDUCED_TYPENAME range_iterator::type found, + SinglePassRange& rng) + { + return type( boost::begin(rng), + found == boost::end(rng) ? found : boost::next(found) ); + } + }; + + template< class BidirectionalRange > + struct range_return< BidirectionalRange, return_begin_prior > + { + typedef boost::iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > type; + + static type pack(BOOST_DEDUCED_TYPENAME range_iterator::type found, + BidirectionalRange& rng) + { + return type( boost::begin(rng), + found == boost::begin(rng) ? found : boost::prior(found) ); + } + }; + + template< class SinglePassRange > + struct range_return< SinglePassRange, return_found_end > + { + typedef boost::iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > type; + + static type pack(BOOST_DEDUCED_TYPENAME range_iterator::type found, + SinglePassRange& rng) + { + return type(found, boost::end(rng)); + } + }; + + template< class SinglePassRange > + struct range_return< SinglePassRange, return_next_end > + { + typedef boost::iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > type; + + static type pack(BOOST_DEDUCED_TYPENAME range_iterator::type found, + SinglePassRange& rng) + { + return type( found == boost::end(rng) ? found : boost::next(found), + boost::end(rng) ); + } + }; + + template< class BidirectionalRange > + struct range_return< BidirectionalRange, return_prior_end > + { + typedef boost::iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > type; + + static type pack(BOOST_DEDUCED_TYPENAME range_iterator::type found, + BidirectionalRange& rng) + { + return type( found == boost::begin(rng) ? found : boost::prior(found), + boost::end(rng) ); + } + }; + + template< class SinglePassRange > + struct range_return< SinglePassRange, return_begin_end > + { + typedef boost::iterator_range< + BOOST_DEDUCED_TYPENAME range_iterator::type > type; + + static type pack(BOOST_DEDUCED_TYPENAME range_iterator::type found, + SinglePassRange& rng) + { + return type(boost::begin(rng), boost::end(rng)); + } + }; + +} + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/irange.hpp b/deal.II/contrib/boost/include/boost/range/irange.hpp new file mode 100644 index 0000000000..ee25d452e2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/irange.hpp @@ -0,0 +1,204 @@ +// Boost.Range library +// +// Copyright Neil Groves 2010. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_IRANGE_HPP_INCLUDED +#define BOOST_RANGE_IRANGE_HPP_INCLUDED + +#include +#include +#include + +namespace boost +{ + namespace range_detail + { + // integer_iterator is an iterator over an integer sequence that + // is bounded only by the limits of the underlying integer + // representation. + // + // This is useful for implementing the irange(first, last) + // function. + // + // Note: + // This use of this iterator and irange is appreciably less + // performant than the corresponding hand-written integer + // loop on many compilers. + template + class integer_iterator + : public boost::iterator_facade< + integer_iterator, + Integer, + boost::random_access_traversal_tag, + Integer, + std::ptrdiff_t + > + { + typedef boost::iterator_facade< + integer_iterator, + Integer, + boost::random_access_traversal_tag, + Integer, + std::ptrdiff_t + > base_t; + public: + typedef typename base_t::value_type value_type; + typedef typename base_t::difference_type difference_type; + typedef typename base_t::reference reference; + + integer_iterator() : m_value() {} + explicit integer_iterator(value_type x) : m_value(x) {} + + private: + void increment() + { + ++m_value; + } + + void decrement() + { + --m_value; + } + + void advance(difference_type offset) + { + m_value += offset; + } + + difference_type distance_to(const integer_iterator& other) const + { + return other.m_value - m_value; + } + + bool equal(const integer_iterator& other) const + { + return m_value == other.m_value; + } + + reference dereference() const + { + return m_value; + } + + friend class ::boost::iterator_core_access; + value_type m_value; + }; + + // integer_iterator_with_step is similar in nature to the + // integer_iterator but provides the ability to 'move' in + // a number of steps specified at construction time. + // + // The three variable implementation provides the best guarantees + // of loop termination upon various combinations of input. + // + // While this design is less performant than some less + // safe alternatives, the use of ranges and iterators to + // perform counting will never be optimal anyhow, hence + // if optimal performance is desired a handcoded loop + // is the solution. + template + class integer_iterator_with_step + : public boost::iterator_facade< + integer_iterator_with_step, + Integer, + boost::random_access_traversal_tag, + Integer, + std::ptrdiff_t + > + { + typedef boost::iterator_facade< + integer_iterator_with_step, + Integer, + boost::random_access_traversal_tag, + Integer, + std::ptrdiff_t + > base_t; + public: + typedef typename base_t::value_type value_type; + typedef typename base_t::difference_type difference_type; + typedef typename base_t::reference reference; + + integer_iterator_with_step(value_type first, value_type step, difference_type step_size) + : m_first(first) + , m_step(step) + , m_step_size(step_size) + { + BOOST_ASSERT( step >= 0 ); + BOOST_ASSERT( step_size != 0 ); + } + + private: + void increment() + { + ++m_step; + } + + void decrement() + { + --m_step; + } + + void advance(difference_type offset) + { + m_step += offset; + } + + difference_type distance_to(const integer_iterator_with_step& other) const + { + return other.m_step - m_step; + } + + bool equal(const integer_iterator_with_step& other) const + { + return m_step == other.m_step; + } + + reference dereference() const + { + return m_first + (m_step * m_step_size); + } + + friend class ::boost::iterator_core_access; + value_type m_first; + value_type m_step; + difference_type m_step_size; + }; + + } // namespace range_detail + + template + iterator_range< range_detail::integer_iterator > + irange(Integer first, Integer last) + { + BOOST_ASSERT( first <= last ); + return boost::iterator_range< range_detail::integer_iterator >( + range_detail::integer_iterator(first), + range_detail::integer_iterator(last)); + } + + template + iterator_range< range_detail::integer_iterator_with_step > + irange(Integer first, Integer last, StepSize step_size) + { + BOOST_ASSERT( step_size != 0 ); + BOOST_ASSERT( (step_size > 0) ? (last >= first) : (last <= first) ); + typedef typename range_detail::integer_iterator_with_step iterator_t; + + const std::ptrdiff_t last_step + = (static_cast(last) - static_cast(first)) + / (static_cast(step_size)); + + return boost::iterator_range< iterator_t >( + iterator_t(first, 0, step_size), + iterator_t(first, last_step, step_size)); + } + +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/istream_range.hpp b/deal.II/contrib/boost/include/boost/range/istream_range.hpp new file mode 100755 index 0000000000..f0e9ef40a8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/istream_range.hpp @@ -0,0 +1,39 @@ +// Boost.Range library +// +// Copyright Neil Groves 2008. Use, modification and +// distribution is subject to the Boost Software Licence, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt +// +// For more information, see http://www.boost.org/libs/range +// + +#ifndef BOOST_RANGE_ISTREAM_RANGE_HPP_INCLUDED +#define BOOST_RANGE_ISTREAM_RANGE_HPP_INCLUDED + +/*! + * \file istream_range.hpp + */ + +#include +#include +#include +#include + +namespace boost +{ + namespace range + { + template inline + iterator_range > + istream_range(std::basic_istream& in) + { + return iterator_range >( + std::istream_iterator(in), + std::istream_iterator()); + } + } // namespace range + using range::istream_range; +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/iterator.hpp b/deal.II/contrib/boost/include/boost/range/iterator.hpp index 21798c54de..ec73ddc233 100644 --- a/deal.II/contrib/boost/include/boost/range/iterator.hpp +++ b/deal.II/contrib/boost/include/boost/range/iterator.hpp @@ -25,46 +25,46 @@ namespace boost { -#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) - - namespace range_detail_vc7_1 - { - template< typename C, typename Sig = void(C) > - struct range_iterator - { - typedef BOOST_RANGE_DEDUCED_TYPENAME - mpl::eval_if_c< is_const::value, - range_const_iterator< typename remove_const::type >, - range_mutable_iterator >::type type; - }; - - template< typename C, typename T > - struct range_iterator< C, void(T[]) > - { - typedef T* type; - }; - } - -#endif +#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) + + namespace range_detail_vc7_1 + { + template< typename C, typename Sig = void(C) > + struct range_iterator + { + typedef BOOST_RANGE_DEDUCED_TYPENAME + mpl::eval_if_c< is_const::value, + range_const_iterator< typename remove_const::type >, + range_mutable_iterator >::type type; + }; + + template< typename C, typename T > + struct range_iterator< C, void(T[]) > + { + typedef T* type; + }; + } + +#endif template< typename C > struct range_iterator { #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) - - typedef BOOST_RANGE_DEDUCED_TYPENAME - range_detail_vc7_1::range_iterator::type type; - -#else - - typedef BOOST_RANGE_DEDUCED_TYPENAME - mpl::eval_if_c< is_const::value, + + typedef BOOST_RANGE_DEDUCED_TYPENAME + range_detail_vc7_1::range_iterator::type type; + +#else + + typedef BOOST_RANGE_DEDUCED_TYPENAME + mpl::eval_if_c< is_const::value, range_const_iterator< typename remove_const::type >, range_mutable_iterator >::type type; - -#endif + +#endif }; - + } // namespace boost //#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION diff --git a/deal.II/contrib/boost/include/boost/range/iterator_range.hpp b/deal.II/contrib/boost/include/boost/range/iterator_range.hpp index d118224628..dfcd4d2f86 100644 --- a/deal.II/contrib/boost/include/boost/range/iterator_range.hpp +++ b/deal.II/contrib/boost/include/boost/range/iterator_range.hpp @@ -1,659 +1,16 @@ // Boost.Range library // -// Copyright Thorsten Ottosen & Pavol Droba 2003-2004. Use, modification and -// distribution is subject to the Boost Software License, Version -// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// Copyright Neil Groves 2009. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // // For more information, see http://www.boost.org/libs/range/ // +#ifndef BOOST_RANGE_ITERATOR_RANGE_HPP_INCLUDED +#define BOOST_RANGE_ITERATOR_RANGE_HPP_INCLUDED -#ifndef BOOST_RANGE_ITERATOR_RANGE_HPP -#define BOOST_RANGE_ITERATOR_RANGE_HPP - -#include // Define __STL_CONFIG_H, if appropriate. -#include - -#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) - #pragma warning( push ) - #pragma warning( disable : 4996 ) -#endif - -// From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch. -#ifndef BOOST_OLD_IOSTREAMS -# if defined(__STL_CONFIG_H) && \ - !defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \ - /**/ -# define BOOST_OLD_IOSTREAMS -# endif -#endif // #ifndef BOOST_OLD_IOSTREAMS - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#ifndef _STLP_NO_IOSTREAMS -# ifndef BOOST_OLD_IOSTREAMS -# include -# else -# include -# endif -#endif // _STLP_NO_IOSTREAMS -#include - -/*! \file - Defines the \c iterator_class and related functions. - \c iterator_range is a simple wrapper of iterator pair idiom. It provides - a rich subset of Container interface. -*/ - - -namespace boost -{ - namespace iterator_range_detail - { - // - // The functions adl_begin and adl_end are implemented in a separate - // class for gcc-2.9x - // - template - struct iterator_range_impl { - template< class ForwardRange > - static IteratorT adl_begin( ForwardRange& r ) - { - return IteratorT( boost::begin( r ) ); - } - - template< class ForwardRange > - static IteratorT adl_end( ForwardRange& r ) - { - return IteratorT( boost::end( r ) ); - } - }; - - template< class Left, class Right > - inline bool equal( const Left& l, const Right& r ) - { - typedef BOOST_DEDUCED_TYPENAME boost::range_difference::type sz_type; - - sz_type l_size = boost::distance( l ), - r_size = boost::distance( r ); - - if( l_size != r_size ) - return false; - - return std::equal( boost::begin(l), boost::end(l), - boost::begin(r) ); - } - - template< class Left, class Right > - inline bool less_than( const Left& l, const Right& r ) - { - return std::lexicographical_compare( boost::begin(l), - boost::end(l), - boost::begin(r), - boost::end(r) ); - } - - struct range_tag { }; - struct const_range_tag { }; - - } - -// iterator range template class -----------------------------------------// - - //! iterator_range class - /*! - An \c iterator_range delimits a range in a sequence by beginning and ending iterators. - An iterator_range can be passed to an algorithm which requires a sequence as an input. - For example, the \c toupper() function may be used most frequently on strings, - but can also be used on iterator_ranges: - - \code - boost::tolower( find( s, "UPPERCASE STRING" ) ); - \endcode - - Many algorithms working with sequences take a pair of iterators, - delimiting a working range, as an arguments. The \c iterator_range class is an - encapsulation of a range identified by a pair of iterators. - It provides a collection interface, - so it is possible to pass an instance to an algorithm requiring a collection as an input. - */ - template - class iterator_range - { - protected: // Used by sub_range - //! implementation class - typedef iterator_range_detail::iterator_range_impl impl; - public: - - //! this type - typedef iterator_range type; - //BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(value_type); - - //! Encapsulated value type - typedef BOOST_DEDUCED_TYPENAME - iterator_value::type value_type; - - //! Difference type - typedef BOOST_DEDUCED_TYPENAME - iterator_difference::type difference_type; - - //! Size type - typedef std::size_t size_type; // note: must be unsigned - - //! This type - typedef iterator_range this_type; - - //! Refence type - // - // Needed because value-type is the same for - // const and non-const iterators - // - typedef BOOST_DEDUCED_TYPENAME - iterator_reference::type reference; - - //! const_iterator type - /*! - There is no distinction between const_iterator and iterator. - These typedefs are provides to fulfill container interface - */ - typedef IteratorT const_iterator; - //! iterator type - typedef IteratorT iterator; - - private: // for return value of operator()() - typedef BOOST_DEDUCED_TYPENAME - boost::mpl::if_< boost::is_abstract, - reference, value_type >::type abstract_value_type; - - public: - iterator_range() : m_Begin( iterator() ), m_End( iterator() ) - #ifndef NDEBUG - , singular( true ) - #endif - { } - - //! Constructor from a pair of iterators - template< class Iterator > - iterator_range( Iterator Begin, Iterator End ) : - m_Begin(Begin), m_End(End) - #ifndef NDEBUG - , singular(false) - #endif - {} - - //! Constructor from a Range - template< class Range > - iterator_range( const Range& r ) : - m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ) - #ifndef NDEBUG - , singular(false) - #endif - {} - - //! Constructor from a Range - template< class Range > - iterator_range( Range& r ) : - m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ) - #ifndef NDEBUG - , singular(false) - #endif - {} - - //! Constructor from a Range - template< class Range > - iterator_range( const Range& r, iterator_range_detail::const_range_tag ) : - m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ) - #ifndef NDEBUG - , singular(false) - #endif - {} - - //! Constructor from a Range - template< class Range > - iterator_range( Range& r, iterator_range_detail::range_tag ) : - m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ) - #ifndef NDEBUG - , singular(false) - #endif - {} - - #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) - this_type& operator=( const this_type& r ) - { - m_Begin = r.begin(); - m_End = r.end(); - - #ifndef NDEBUG - singular = r.singular; - #endif - return *this; - } - #endif - - template< class Iterator > - iterator_range& operator=( const iterator_range& r ) - { - m_Begin = r.begin(); - m_End = r.end(); - #ifndef NDEBUG - singular = r.is_singular(); - #endif - return *this; - } - - template< class ForwardRange > - iterator_range& operator=( ForwardRange& r ) - { - m_Begin = impl::adl_begin( r ); - m_End = impl::adl_end( r ); - #ifndef NDEBUG - singular = false; - #endif - return *this; - } - - template< class ForwardRange > - iterator_range& operator=( const ForwardRange& r ) - { - m_Begin = impl::adl_begin( r ); - m_End = impl::adl_end( r ); - #ifndef NDEBUG - singular = false; - #endif - return *this; - } - - IteratorT begin() const - { - BOOST_ASSERT( !is_singular() ); - return m_Begin; - } - - IteratorT end() const - { - BOOST_ASSERT( !is_singular() ); - return m_End; - } - - difference_type size() const - { - BOOST_ASSERT( !is_singular() ); - return m_End - m_Begin; - } - - bool empty() const - { - BOOST_ASSERT( !is_singular() ); - return m_Begin == m_End; - } - -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) - operator bool() const - { - return !empty(); - } -#else - typedef iterator (iterator_range::*unspecified_bool_type) () const; - operator unspecified_bool_type() const - { - return empty() ? 0: &iterator_range::end; - } -#endif - - bool equal( const iterator_range& r ) const - { - BOOST_ASSERT( !is_singular() ); - return m_Begin == r.m_Begin && m_End == r.m_End; - } - - -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - - bool operator==( const iterator_range& r ) const - { - BOOST_ASSERT( !is_singular() ); - return iterator_range_detail::equal( *this, r ); - } - - bool operator!=( const iterator_range& r ) const - { - BOOST_ASSERT( !is_singular() ); - return !operator==(r); - } - - bool operator<( const iterator_range& r ) const - { - BOOST_ASSERT( !is_singular() ); - return iterator_range_detail::less_than( *this, r ); - } - -#endif - - public: // convenience - reference front() const - { - BOOST_ASSERT( !empty() ); - return *m_Begin; - } - - reference back() const - { - BOOST_ASSERT( !empty() ); - IteratorT last( m_End ); - return *--last; - } - - reference operator[]( difference_type at ) const - { - BOOST_ASSERT( at >= 0 && at < size() ); - return m_Begin[at]; - } - - // - // When storing transform iterators, operator[]() - // fails because it returns by reference. Therefore - // operator()() is provided for these cases. - // - abstract_value_type operator()( difference_type at ) const - { - BOOST_ASSERT( at >= 0 && at < size() ); - return m_Begin[at]; - } - - iterator_range& advance_begin( difference_type n ) - { - BOOST_ASSERT( !is_singular() ); - std::advance( m_Begin, n ); - return *this; - } - - iterator_range& advance_end( difference_type n ) - { - BOOST_ASSERT( !is_singular() ); - std::advance( m_End, n ); - return *this; - } - - private: - // begin and end iterators - IteratorT m_Begin; - IteratorT m_End; - - #ifndef NDEBUG - bool singular; - #endif - - public: - bool is_singular() const - { - #ifndef NDEBUG - return singular; - #else - return false; - #endif - } - - protected: - // - // Allow subclasses an easy way to access the - // base type - // - typedef iterator_range iterator_range_; - }; - -// iterator range free-standing operators ---------------------------// - -#ifndef _STLP_NO_IOSTREAMS -# ifndef BOOST_OLD_IOSTREAMS - - //! iterator_range output operator - /*! - Output the range to an ostream. Elements are outputed - in a sequence without separators. - */ - template< typename IteratorT, typename Elem, typename Traits > - inline std::basic_ostream& operator<<( - std::basic_ostream& Os, - const iterator_range& r ) - { - std::copy( r.begin(), r.end(), - std::ostream_iterator< BOOST_DEDUCED_TYPENAME - iterator_value::type, - Elem, Traits>(Os) ); - return Os; - } - -# else - - //! iterator_range output operator - /*! - Output the range to an ostream. Elements are outputed - in a sequence without separators. - */ - template< typename IteratorT > - inline std::ostream& operator<<( - std::ostream& Os, - const iterator_range& r ) - { - std::copy( r.begin(), r.end(), std::ostream_iterator(Os)); - return Os; - } - -# endif -#endif // _STLP_NO_IOSTREAMS - - ///////////////////////////////////////////////////////////////////// - // comparison operators - ///////////////////////////////////////////////////////////////////// - - template< class IteratorT, class ForwardRange > - inline bool operator==( const ForwardRange& l, - const iterator_range& r ) - { - return iterator_range_detail::equal( l, r ); - } - - template< class IteratorT, class ForwardRange > - inline bool operator!=( const ForwardRange& l, - const iterator_range& r ) - { - return !iterator_range_detail::equal( l, r ); - } - - template< class IteratorT, class ForwardRange > - inline bool operator<( const ForwardRange& l, - const iterator_range& r ) - { - return iterator_range_detail::less_than( l, r ); - } - -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -#else - template< class Iterator1T, class Iterator2T > - inline bool operator==( const iterator_range& l, - const iterator_range& r ) - { - return iterator_range_detail::equal( l, r ); - } - - template< class IteratorT, class ForwardRange > - inline bool operator==( const iterator_range& l, - const ForwardRange& r ) - { - return iterator_range_detail::equal( l, r ); - } - - - template< class Iterator1T, class Iterator2T > - inline bool operator!=( const iterator_range& l, - const iterator_range& r ) - { - return !iterator_range_detail::equal( l, r ); - } - - template< class IteratorT, class ForwardRange > - inline bool operator!=( const iterator_range& l, - const ForwardRange& r ) - { - return !iterator_range_detail::equal( l, r ); - } - - - template< class Iterator1T, class Iterator2T > - inline bool operator<( const iterator_range& l, - const iterator_range& r ) - { - return iterator_range_detail::less_than( l, r ); - } - - template< class IteratorT, class ForwardRange > - inline bool operator<( const iterator_range& l, - const ForwardRange& r ) - { - return iterator_range_detail::less_than( l, r ); - } - -#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING - -// iterator range utilities -----------------------------------------// - - //! iterator_range construct helper - /*! - Construct an \c iterator_range from a pair of iterators - - \param Begin A begin iterator - \param End An end iterator - \return iterator_range object - */ - template< typename IteratorT > - inline iterator_range< IteratorT > - make_iterator_range( IteratorT Begin, IteratorT End ) - { - return iterator_range( Begin, End ); - } - -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - - template< typename Range > - inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - make_iterator_range( Range& r ) - { - return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - ( boost::begin( r ), boost::end( r ) ); - } - -#else - //! iterator_range construct helper - /*! - Construct an \c iterator_range from a \c Range containing the begin - and end iterators. - */ - template< class ForwardRange > - inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - make_iterator_range( ForwardRange& r ) - { - return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - ( r, iterator_range_detail::range_tag() ); - } - - template< class ForwardRange > - inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - make_iterator_range( const ForwardRange& r ) - { - return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - ( r, iterator_range_detail::const_range_tag() ); - } - -#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING - - namespace iterator_range_detail - { - template< class Range > - inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - make_range_impl( Range& r, - BOOST_DEDUCED_TYPENAME range_difference::type advance_begin, - BOOST_DEDUCED_TYPENAME range_difference::type advance_end ) - { - // - // Not worth the effort - // - //if( advance_begin == 0 && advance_end == 0 ) - // return make_iterator_range( r ); - // - - BOOST_DEDUCED_TYPENAME range_iterator::type - new_begin = boost::begin( r ), - new_end = boost::end( r ); - std::advance( new_begin, advance_begin ); - std::advance( new_end, advance_end ); - return make_iterator_range( new_begin, new_end ); - } - } - -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING - - template< class Range > - inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - make_iterator_range( Range& r, - BOOST_DEDUCED_TYPENAME range_difference::type advance_begin, - BOOST_DEDUCED_TYPENAME range_difference::type advance_end ) - { - //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" ); - return iterator_range_detail::make_range_impl( r, advance_begin, advance_end ); - } - -#else - - template< class Range > - inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - make_iterator_range( Range& r, - BOOST_DEDUCED_TYPENAME range_difference::type advance_begin, - BOOST_DEDUCED_TYPENAME range_difference::type advance_end ) - { - //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" ); - return iterator_range_detail::make_range_impl( r, advance_begin, advance_end ); - } - - template< class Range > - inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > - make_iterator_range( const Range& r, - BOOST_DEDUCED_TYPENAME range_difference::type advance_begin, - BOOST_DEDUCED_TYPENAME range_difference::type advance_end ) - { - //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" ); - return iterator_range_detail::make_range_impl( r, advance_begin, advance_end ); - } - -#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING - - //! copy a range into a sequence - /*! - Construct a new sequence of the specified type from the elements - in the given range - - \param Range An input range - \return New sequence - */ - template< typename SeqT, typename Range > - inline SeqT copy_range( const Range& r ) - { - return SeqT( boost::begin( r ), boost::end( r ) ); - } - -} // namespace 'boost' - -#undef BOOST_OLD_IOSTREAMS - -#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) - #pragma warning( pop ) -#endif - -#endif +#include "boost/range/iterator_range_core.hpp" +#include "boost/range/iterator_range_io.hpp" +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/iterator_range_core.hpp b/deal.II/contrib/boost/include/boost/range/iterator_range_core.hpp new file mode 100755 index 0000000000..497b1e3860 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/iterator_range_core.hpp @@ -0,0 +1,542 @@ +// Boost.Range library +// +// Copyright Neil Groves & Thorsten Ottosen & Pavol Droba 2003-2004. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ITERATOR_RANGE_CORE_HPP_INCLUDED +#define BOOST_RANGE_ITERATOR_RANGE_CORE_HPP_INCLUDED + +#include // Define __STL_CONFIG_H, if appropriate. +#include + +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) + #pragma warning( push ) + #pragma warning( disable : 4996 ) +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/*! \file + Defines the \c iterator_class and related functions. + \c iterator_range is a simple wrapper of iterator pair idiom. It provides + a rich subset of Container interface. +*/ + + +namespace boost +{ + namespace iterator_range_detail + { + // + // The functions adl_begin and adl_end are implemented in a separate + // class for gcc-2.9x + // + template + struct iterator_range_impl { + template< class ForwardRange > + static IteratorT adl_begin( ForwardRange& r ) + { + return IteratorT( boost::begin( r ) ); + } + + template< class ForwardRange > + static IteratorT adl_end( ForwardRange& r ) + { + return IteratorT( boost::end( r ) ); + } + }; + + template< class Left, class Right > + inline bool less_than( const Left& l, const Right& r ) + { + return std::lexicographical_compare( boost::begin(l), + boost::end(l), + boost::begin(r), + boost::end(r) ); + } + + // This version is maintained since it is used in other boost libraries + // such as Boost.Assign + template< class Left, class Right > + inline bool equal(const Left& l, const Right& r) + { + return boost::equal(l, r); + } + + struct range_tag { }; + struct const_range_tag { }; + + } + +// iterator range template class -----------------------------------------// + + //! iterator_range class + /*! + An \c iterator_range delimits a range in a sequence by beginning and ending iterators. + An iterator_range can be passed to an algorithm which requires a sequence as an input. + For example, the \c toupper() function may be used most frequently on strings, + but can also be used on iterator_ranges: + + \code + boost::tolower( find( s, "UPPERCASE STRING" ) ); + \endcode + + Many algorithms working with sequences take a pair of iterators, + delimiting a working range, as an arguments. The \c iterator_range class is an + encapsulation of a range identified by a pair of iterators. + It provides a collection interface, + so it is possible to pass an instance to an algorithm requiring a collection as an input. + */ + template + class iterator_range + { + protected: // Used by sub_range + //! implementation class + typedef iterator_range_detail::iterator_range_impl impl; + public: + + //! this type + typedef iterator_range type; + //BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(value_type); + + //! Encapsulated value type + typedef BOOST_DEDUCED_TYPENAME + iterator_value::type value_type; + + //! Difference type + typedef BOOST_DEDUCED_TYPENAME + iterator_difference::type difference_type; + + //! Size type + typedef std::size_t size_type; // note: must be unsigned + + //! This type + typedef iterator_range this_type; + + //! Reference type + // + // Needed because value-type is the same for + // const and non-const iterators + // + typedef BOOST_DEDUCED_TYPENAME + iterator_reference::type reference; + + //! const_iterator type + /*! + There is no distinction between const_iterator and iterator. + These typedefs are provides to fulfill container interface + */ + typedef IteratorT const_iterator; + //! iterator type + typedef IteratorT iterator; + + private: // for return value of operator()() + typedef BOOST_DEDUCED_TYPENAME + boost::mpl::if_< boost::is_abstract, + reference, value_type >::type abstract_value_type; + + public: + iterator_range() : m_Begin( iterator() ), m_End( iterator() ) + { } + + //! Constructor from a pair of iterators + template< class Iterator > + iterator_range( Iterator Begin, Iterator End ) : + m_Begin(Begin), m_End(End) + {} + + //! Constructor from a Range + template< class Range > + iterator_range( const Range& r ) : + m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ) + {} + + //! Constructor from a Range + template< class Range > + iterator_range( Range& r ) : + m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ) + {} + + //! Constructor from a Range + template< class Range > + iterator_range( const Range& r, iterator_range_detail::const_range_tag ) : + m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ) + {} + + //! Constructor from a Range + template< class Range > + iterator_range( Range& r, iterator_range_detail::range_tag ) : + m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) ) + {} + + #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300) + this_type& operator=( const this_type& r ) + { + m_Begin = r.begin(); + m_End = r.end(); + return *this; + } + #endif + + template< class Iterator > + iterator_range& operator=( const iterator_range& r ) + { + m_Begin = r.begin(); + m_End = r.end(); + return *this; + } + + template< class ForwardRange > + iterator_range& operator=( ForwardRange& r ) + { + m_Begin = impl::adl_begin( r ); + m_End = impl::adl_end( r ); + return *this; + } + + template< class ForwardRange > + iterator_range& operator=( const ForwardRange& r ) + { + m_Begin = impl::adl_begin( r ); + m_End = impl::adl_end( r ); + return *this; + } + + IteratorT begin() const + { + return m_Begin; + } + + IteratorT end() const + { + return m_End; + } + + difference_type size() const + { + return m_End - m_Begin; + } + + bool empty() const + { + return m_Begin == m_End; + } + +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) + operator bool() const + { + return !empty(); + } +#else + typedef iterator (iterator_range::*unspecified_bool_type) () const; + operator unspecified_bool_type() const + { + return empty() ? 0: &iterator_range::end; + } +#endif + + bool equal( const iterator_range& r ) const + { + return m_Begin == r.m_Begin && m_End == r.m_End; + } + + +#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + + bool operator==( const iterator_range& r ) const + { + return boost::equal( *this, r ); + } + + bool operator!=( const iterator_range& r ) const + { + return !operator==(r); + } + + bool operator<( const iterator_range& r ) const + { + return iterator_range_detail::less_than( *this, r ); + } + +#endif + + public: // convenience + reference front() const + { + BOOST_ASSERT( !empty() ); + return *m_Begin; + } + + reference back() const + { + BOOST_ASSERT( !empty() ); + IteratorT last( m_End ); + return *--last; + } + + reference operator[]( difference_type at ) const + { + BOOST_ASSERT( at >= 0 && at < size() ); + return m_Begin[at]; + } + + // + // When storing transform iterators, operator[]() + // fails because it returns by reference. Therefore + // operator()() is provided for these cases. + // + abstract_value_type operator()( difference_type at ) const + { + BOOST_ASSERT( at >= 0 && at < size() ); + return m_Begin[at]; + } + + iterator_range& advance_begin( difference_type n ) + { + std::advance( m_Begin, n ); + return *this; + } + + iterator_range& advance_end( difference_type n ) + { + std::advance( m_End, n ); + return *this; + } + + private: + // begin and end iterators + IteratorT m_Begin; + IteratorT m_End; + + protected: + // + // Allow subclasses an easy way to access the + // base type + // + typedef iterator_range iterator_range_; + }; + +// iterator range free-standing operators ---------------------------// + + ///////////////////////////////////////////////////////////////////// + // comparison operators + ///////////////////////////////////////////////////////////////////// + + template< class IteratorT, class ForwardRange > + inline bool operator==( const ForwardRange& l, + const iterator_range& r ) + { + return boost::equal( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator!=( const ForwardRange& l, + const iterator_range& r ) + { + return !boost::equal( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator<( const ForwardRange& l, + const iterator_range& r ) + { + return iterator_range_detail::less_than( l, r ); + } + +#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING +#else + template< class Iterator1T, class Iterator2T > + inline bool operator==( const iterator_range& l, + const iterator_range& r ) + { + return boost::equal( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator==( const iterator_range& l, + const ForwardRange& r ) + { + return boost::equal( l, r ); + } + + + template< class Iterator1T, class Iterator2T > + inline bool operator!=( const iterator_range& l, + const iterator_range& r ) + { + return !boost::equal( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator!=( const iterator_range& l, + const ForwardRange& r ) + { + return !boost::equal( l, r ); + } + + + template< class Iterator1T, class Iterator2T > + inline bool operator<( const iterator_range& l, + const iterator_range& r ) + { + return iterator_range_detail::less_than( l, r ); + } + + template< class IteratorT, class ForwardRange > + inline bool operator<( const iterator_range& l, + const ForwardRange& r ) + { + return iterator_range_detail::less_than( l, r ); + } + +#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING + +// iterator range utilities -----------------------------------------// + + //! iterator_range construct helper + /*! + Construct an \c iterator_range from a pair of iterators + + \param Begin A begin iterator + \param End An end iterator + \return iterator_range object + */ + template< typename IteratorT > + inline iterator_range< IteratorT > + make_iterator_range( IteratorT Begin, IteratorT End ) + { + return iterator_range( Begin, End ); + } + +#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + + template< typename Range > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + make_iterator_range( Range& r ) + { + return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + ( boost::begin( r ), boost::end( r ) ); + } + +#else + //! iterator_range construct helper + /*! + Construct an \c iterator_range from a \c Range containing the begin + and end iterators. + */ + template< class ForwardRange > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + make_iterator_range( ForwardRange& r ) + { + return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + ( r, iterator_range_detail::range_tag() ); + } + + template< class ForwardRange > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + make_iterator_range( const ForwardRange& r ) + { + return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + ( r, iterator_range_detail::const_range_tag() ); + } + +#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING + + namespace iterator_range_detail + { + template< class Range > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + make_range_impl( Range& r, + BOOST_DEDUCED_TYPENAME range_difference::type advance_begin, + BOOST_DEDUCED_TYPENAME range_difference::type advance_end ) + { + // + // Not worth the effort + // + //if( advance_begin == 0 && advance_end == 0 ) + // return make_iterator_range( r ); + // + + BOOST_DEDUCED_TYPENAME range_iterator::type + new_begin = boost::begin( r ), + new_end = boost::end( r ); + std::advance( new_begin, advance_begin ); + std::advance( new_end, advance_end ); + return make_iterator_range( new_begin, new_end ); + } + } + +#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + + template< class Range > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + make_iterator_range( Range& r, + BOOST_DEDUCED_TYPENAME range_difference::type advance_begin, + BOOST_DEDUCED_TYPENAME range_difference::type advance_end ) + { + //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" ); + return iterator_range_detail::make_range_impl( r, advance_begin, advance_end ); + } + +#else + + template< class Range > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + make_iterator_range( Range& r, + BOOST_DEDUCED_TYPENAME range_difference::type advance_begin, + BOOST_DEDUCED_TYPENAME range_difference::type advance_end ) + { + //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" ); + return iterator_range_detail::make_range_impl( r, advance_begin, advance_end ); + } + + template< class Range > + inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + make_iterator_range( const Range& r, + BOOST_DEDUCED_TYPENAME range_difference::type advance_begin, + BOOST_DEDUCED_TYPENAME range_difference::type advance_end ) + { + //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" ); + return iterator_range_detail::make_range_impl( r, advance_begin, advance_end ); + } + +#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING + + //! copy a range into a sequence + /*! + Construct a new sequence of the specified type from the elements + in the given range + + \param Range An input range + \return New sequence + */ + template< typename SeqT, typename Range > + inline SeqT copy_range( const Range& r ) + { + return SeqT( boost::begin( r ), boost::end( r ) ); + } + +} // namespace 'boost' + +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) + #pragma warning( pop ) +#endif + +#endif + diff --git a/deal.II/contrib/boost/include/boost/range/iterator_range_io.hpp b/deal.II/contrib/boost/include/boost/range/iterator_range_io.hpp new file mode 100755 index 0000000000..51e3a4f3ff --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/iterator_range_io.hpp @@ -0,0 +1,93 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED +#define BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED + +#include +#include + +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) + #pragma warning( push ) + #pragma warning( disable : 4996 ) +#endif + +// From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch. +#ifndef BOOST_OLD_IOSTREAMS +# if defined(__STL_CONFIG_H) && \ + !defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \ + /**/ +# define BOOST_OLD_IOSTREAMS +# endif +#endif // #ifndef BOOST_OLD_IOSTREAMS + +#ifndef _STLP_NO_IOSTREAMS +# ifndef BOOST_OLD_IOSTREAMS +# include +# else +# include +# endif +#endif // _STLP_NO_IOSTREAMS + +#include +#include +#include +#include + +namespace boost +{ + +#ifndef _STLP_NO_IOSTREAMS +# ifndef BOOST_OLD_IOSTREAMS + + //! iterator_range output operator + /*! + Output the range to an ostream. Elements are outputed + in a sequence without separators. + */ + template< typename IteratorT, typename Elem, typename Traits > + inline std::basic_ostream& operator<<( + std::basic_ostream& Os, + const iterator_range& r ) + { + std::copy( r.begin(), r.end(), + std::ostream_iterator< BOOST_DEDUCED_TYPENAME + iterator_value::type, + Elem, Traits>(Os) ); + return Os; + } + +# else + + //! iterator_range output operator + /*! + Output the range to an ostream. Elements are outputed + in a sequence without separators. + */ + template< typename IteratorT > + inline std::ostream& operator<<( + std::ostream& Os, + const iterator_range& r ) + { + std::copy( r.begin(), r.end(), std::ostream_iterator(Os)); + return Os; + } + +# endif +#endif // _STLP_NO_IOSTREAMS + +} // namespace boost + +#undef BOOST_OLD_IOSTREAMS + +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) + #pragma warning(pop) +#endif + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/join.hpp b/deal.II/contrib/boost/include/boost/range/join.hpp new file mode 100644 index 0000000000..518026cd34 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/join.hpp @@ -0,0 +1,68 @@ +// Boost.Range library +// +// Copyright Neil Groves 2009. Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// +// For more information, see http://www.boost.org/libs/range/ +// +#ifndef BOOST_RANGE_JOIN_HPP_INCLUDED +#define BOOST_RANGE_JOIN_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost +{ + +template +iterator_range::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME add_const< + BOOST_DEDUCED_TYPENAME range_value::type>::type> +> +join(const SinglePassRange1& r1, const SinglePassRange2& r2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + typedef range_detail::join_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME add_const< + BOOST_DEDUCED_TYPENAME range_value::type>::type> iterator_t; + + return iterator_range( + iterator_t(r1, r2, range_detail::join_iterator_begin_tag()), + iterator_t(r1, r2, range_detail::join_iterator_end_tag())); +} + +template +iterator_range::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_value::type> +> +join(SinglePassRange1& r1, SinglePassRange2& r2) +{ + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept )); + + typedef range_detail::join_iterator< + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_iterator::type, + BOOST_DEDUCED_TYPENAME range_value::type> iterator_t; + + return iterator_range( + iterator_t(r1, r2, range_detail::join_iterator_begin_tag()), + iterator_t(r1, r2, range_detail::join_iterator_end_tag())); +} + +} // namespace boost + +#endif // include guard diff --git a/deal.II/contrib/boost/include/boost/range/mutable_iterator.hpp b/deal.II/contrib/boost/include/boost/range/mutable_iterator.hpp index 2f45c1627e..7beca66a29 100644 --- a/deal.II/contrib/boost/include/boost/range/mutable_iterator.hpp +++ b/deal.II/contrib/boost/include/boost/range/mutable_iterator.hpp @@ -21,6 +21,7 @@ #include #else +#include #include #include #include @@ -31,11 +32,13 @@ namespace boost // default ////////////////////////////////////////////////////////////////////////// + namespace range_detail { + BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( iterator ) + } + template< typename C > - struct range_mutable_iterator - { - typedef BOOST_DEDUCED_TYPENAME C::iterator type; - }; + struct range_mutable_iterator : range_detail::extract_iterator + {}; ////////////////////////////////////////////////////////////////////////// // pair diff --git a/deal.II/contrib/boost/include/boost/range/numeric.hpp b/deal.II/contrib/boost/include/boost/range/numeric.hpp new file mode 100755 index 0000000000..0a761514bb --- /dev/null +++ b/deal.II/contrib/boost/include/boost/range/numeric.hpp @@ -0,0 +1,117 @@ +/////////////////////////////////////////////////////////////////////////////// +/// \file algorithm.hpp +/// Contains range-based versions of the std algorithms +// +///////////////////////////////////////////////////////////////////////////// +// Copyright 2009 Neil Groves. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +// Copyright 2006 Thorsten Ottosen. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +// Copyright 2004 Eric Niebler. +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#if defined(_MSC_VER) && _MSC_VER >= 1000 + #pragma once +#endif + +#ifndef BOOST_RANGE_NUMERIC_HPP +#define BOOST_RANGE_NUMERIC_HPP + +#include +#include +#include +#include +#include +#include + + +namespace boost +{ + template< class SinglePassRange, class Value > + inline Value accumulate( const SinglePassRange& rng, Value init ) + { + boost::function_requires< SinglePassRangeConcept >(); + return std::accumulate( boost::begin(rng), boost::end(rng), init ); + } + + template< class SinglePassRange, class Value, class BinaryOperation > + inline Value accumulate( const SinglePassRange& rng, Value init, BinaryOperation op ) + { + boost::function_requires< SinglePassRangeConcept >(); + return std::accumulate( boost::begin(rng), boost::end(rng), init, op ); + } + + + template< class SinglePassRange1, class SinglePassRange2, class Value > + inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, Value init ) + { + boost::function_requires< SinglePassRangeConcept >(); + boost::function_requires< SinglePassRangeConcept >(); + BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) ); + return std::inner_product( boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), init ); + } + + template< class SinglePassRange1, + class SinglePassRange2, + class Value, + class BinaryOperation1, class BinaryOperation2 > + inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, + Value init, + BinaryOperation1 op1, BinaryOperation2 op2 ) + { + boost::function_requires< SinglePassRangeConcept >(); + boost::function_requires< SinglePassRangeConcept >(); + BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) ); + + return std::inner_product( boost::begin(rng1), boost::end(rng1), + boost::begin(rng2), init, op1, op2 ); + } + + template< class SinglePassRange, class OutputIterator > + inline OutputIterator partial_sum ( const SinglePassRange& rng, + OutputIterator result ) + { + boost::function_requires< SinglePassRangeConcept >(); + return std::partial_sum( boost::begin(rng), boost::end(rng), result ); + } + + template< class SinglePassRange, class OutputIterator, class BinaryOperation > + inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result, + BinaryOperation op ) + { + boost::function_requires< SinglePassRangeConcept >(); + return std::partial_sum( boost::begin(rng), boost::end(rng), result, op ); + } + + template< class SinglePassRange, class OutputIterator > + inline OutputIterator adjacent_difference ( const SinglePassRange& rng, + OutputIterator result ) + { + boost::function_requires< SinglePassRangeConcept >(); + return std::adjacent_difference( boost::begin(rng), boost::end(rng), + result ); + } + + template< class SinglePassRange, class OutputIterator, class BinaryOperation > + inline OutputIterator adjacent_difference ( const SinglePassRange& rng, + OutputIterator result, + BinaryOperation op ) + { + boost::function_requires< SinglePassRangeConcept >(); + return std::adjacent_difference( boost::begin(rng), boost::end(rng), + result, op ); + } + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/range/size.hpp b/deal.II/contrib/boost/include/boost/range/size.hpp index 311a69210b..2b572d41e7 100644 --- a/deal.II/contrib/boost/include/boost/range/size.hpp +++ b/deal.II/contrib/boost/include/boost/range/size.hpp @@ -20,7 +20,7 @@ #include #include -namespace boost +namespace boost { template< class T > diff --git a/deal.II/contrib/boost/include/boost/range/size_type.hpp b/deal.II/contrib/boost/include/boost/range/size_type.hpp index 7ed8dfa870..8c184f87d2 100644 --- a/deal.II/contrib/boost/include/boost/range/size_type.hpp +++ b/deal.II/contrib/boost/include/boost/range/size_type.hpp @@ -67,7 +67,8 @@ namespace boost { }; template< class T > - struct range_size : range_size + struct range_size + : detail::range_size { }; } // namespace boost diff --git a/deal.II/contrib/boost/include/boost/range/sub_range.hpp b/deal.II/contrib/boost/include/boost/range/sub_range.hpp index dc66692a93..d5544b91f1 100644 --- a/deal.II/contrib/boost/include/boost/range/sub_range.hpp +++ b/deal.II/contrib/boost/include/boost/range/sub_range.hpp @@ -1,5 +1,6 @@ // Boost.Range library // +// Copyright Neil Groves 2009. // Copyright Thorsten Ottosen 2003-2004. Use, modification and // distribution is subject to the Boost Software License, Version // 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -11,7 +12,7 @@ #ifndef BOOST_RANGE_SUB_RANGE_HPP #define BOOST_RANGE_SUB_RANGE_HPP -#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) #pragma warning( push ) #pragma warning( disable : 4996 ) #endif @@ -22,15 +23,16 @@ #include #include #include +#include #include #include #include namespace boost { - - template< class ForwardRange > - class sub_range : public iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > + + template< class ForwardRange > + class sub_range : public iterator_range< BOOST_DEDUCED_TYPENAME range_iterator::type > { typedef BOOST_DEDUCED_TYPENAME range_iterator::type iterator_t; typedef iterator_range< iterator_t > base; @@ -51,40 +53,40 @@ namespace boost reference >::type const_reference; public: - sub_range() : base() + sub_range() : base() + { } + +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500) ) + sub_range( const sub_range& r ) + : base( static_cast( r ) ) { } - -#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500) ) - sub_range( const sub_range& r ) - : base( static_cast( r ) ) - { } #endif template< class ForwardRange2 > - sub_range( ForwardRange2& r ) : - + sub_range( ForwardRange2& r ) : + #if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 800 ) base( impl::adl_begin( r ), impl::adl_end( r ) ) #else base( r ) -#endif +#endif { } - + template< class ForwardRange2 > - sub_range( const ForwardRange2& r ) : + sub_range( const ForwardRange2& r ) : #if BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 800 ) base( impl::adl_begin( r ), impl::adl_end( r ) ) #else base( r ) -#endif +#endif { } template< class Iter > sub_range( Iter first, Iter last ) : base( first, last ) { } - + template< class ForwardRange2 > sub_range& operator=( ForwardRange2& r ) { @@ -97,23 +99,23 @@ namespace boost { base::operator=( r ); return *this; - } + } sub_range& operator=( const sub_range& r ) { base::operator=( static_cast(r) ); - return *this; + return *this; } - + public: - + iterator begin() { return base::begin(); } const_iterator begin() const { return base::begin(); } iterator end() { return base::end(); } const_iterator end() const { return base::end(); } - difference_type size() const { return base::size(); } + difference_type size() const { return base::size(); } + - public: // convenience reference front() { @@ -151,14 +153,14 @@ namespace boost inline bool operator==( const sub_range& l, const sub_range& r ) { - return iterator_range_detail::equal( l, r ); + return boost::equal( l, r ); } template< class ForwardRange, class ForwardRange2 > inline bool operator!=( const sub_range& l, const sub_range& r ) { - return !iterator_range_detail::equal( l, r ); + return !boost::equal( l, r ); } template< class ForwardRange, class ForwardRange2 > @@ -171,7 +173,7 @@ namespace boost } // namespace 'boost' -#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) +#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) #pragma warning( pop ) #endif diff --git a/deal.II/contrib/boost/include/boost/scope_exit.hpp b/deal.II/contrib/boost/include/boost/scope_exit.hpp new file mode 100644 index 0000000000..17f8003a86 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/scope_exit.hpp @@ -0,0 +1,267 @@ +// Copyright Alexander Nasonov 2006-2009 +// +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef FILE_boost_scope_exit_hpp_INCLUDED +#define FILE_boost_scope_exit_hpp_INCLUDED + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#if defined(__GNUC__) && !defined(BOOST_INTEL) +# define BOOST_SCOPE_EXIT_AUX_GCC (__GNUC__ * 100 + __GNUC_MINOR__) +#else +# define BOOST_SCOPE_EXIT_AUX_GCC 0 +#endif + +#if BOOST_WORKAROUND(BOOST_SCOPE_EXIT_AUX_GCC, BOOST_TESTED_AT(413)) +#define BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND +#endif + +// Steven Watanabe's trick with a modification suggested by Kim Barrett +namespace boost { namespace scope_exit { namespace aux { + + // Type of a local boost_scope_exit_args variable. + // First use in a local scope will declare the boost_scope_exit_args + // variable, subsequent uses will be resolved as two comparisons + // (cmp1 with 0 and cmp2 with boost_scope_exit_args). + template + struct declared + { + void* value; + static int const cmp2 = 0; + friend void operator>(int, declared const&) {} + }; + + struct undeclared { declared<> dummy[2]; }; + + template struct resolve; + + template<> + struct resolve)> + { + static const int cmp1 = 0; + }; + + template<> + struct resolve + { + template + struct cmp1 + { + static int const cmp2 = 0; + }; + }; +} } } + +extern boost::scope_exit::aux::undeclared boost_scope_exit_args; // undefined + + +namespace boost { namespace scope_exit { namespace aux { + +typedef void (*ref_tag)(int&); +typedef void (*val_tag)(int ); + +template struct member; + +template +struct member +{ + T& value; +#ifndef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND + member(T& ref) : value(ref) {} +#endif +}; + +template +struct member +{ + T value; +#ifndef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND + member(T& val) : value(val) {} +#endif +}; + +template inline T& deref(T* p, ref_tag) { return *p; } +template inline T& deref(T& r, val_tag) { return r; } + +template +struct wrapper +{ + typedef T type; +}; + +template wrapper wrap(T&); + +} } } + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::scope_exit::aux::wrapper, 1) + +#define BOOST_SCOPE_EXIT_AUX_GUARD(id) BOOST_PP_CAT(boost_se_guard_, id) +#define BOOST_SCOPE_EXIT_AUX_GUARD_T(id) BOOST_PP_CAT(boost_se_guard_t_, id) +#define BOOST_SCOPE_EXIT_AUX_PARAMS(id) BOOST_PP_CAT(boost_se_params_, id) +#define BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) BOOST_PP_CAT(boost_se_params_t_, id) + +#define BOOST_SCOPE_EXIT_AUX_TAG(id, i) \ + BOOST_PP_SEQ_CAT( (boost_se_tag_)(i)(_)(id) ) + +#define BOOST_SCOPE_EXIT_AUX_PARAM(id, i, var) \ + BOOST_PP_SEQ_CAT( (boost_se_param_)(i)(_)(id) ) + +#define BOOST_SCOPE_EXIT_AUX_PARAM_T(id, i, var) \ + BOOST_PP_SEQ_CAT( (boost_se_param_t_)(i)(_)(id) ) + +#define BOOST_SCOPE_EXIT_AUX_CAPTURE_T(id, i, var) \ + BOOST_PP_SEQ_CAT( (boost_se_capture_t_)(i)(_)(id) ) + +#define BOOST_SCOPE_EXIT_AUX_WRAPPED(id, i) \ + BOOST_PP_SEQ_CAT( (boost_se_wrapped_t_)(i)(_)(id) ) + +#define BOOST_SCOPE_EXIT_AUX_DEREF(id, i, var) \ + boost::scope_exit::aux::deref(var, (BOOST_SCOPE_EXIT_AUX_TAG(id,i))0) + +#define BOOST_SCOPE_EXIT_AUX_MEMBER(r, id, i, var) \ + boost::scope_exit::aux::member< \ + BOOST_SCOPE_EXIT_AUX_PARAM_T(id,i,var), \ + BOOST_SCOPE_EXIT_AUX_TAG(id,i) \ + > BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var); + +// idty is (id,typename) or (id,BOOST_PP_EMPTY()) +#define BOOST_SCOPE_EXIT_AUX_ARG_DECL(r, idty, i, var) \ + BOOST_PP_COMMA_IF(i) BOOST_PP_TUPLE_ELEM(2,1,idty) \ + BOOST_SCOPE_EXIT_AUX_PARAMS_T(BOOST_PP_TUPLE_ELEM(2,0,idty)):: \ + BOOST_SCOPE_EXIT_AUX_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) var + +#define BOOST_SCOPE_EXIT_AUX_ARG(r, id, i, var) BOOST_PP_COMMA_IF(i) \ + boost_se_params_->BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var).value + +#define BOOST_SCOPE_EXIT_AUX_TAG_DECL(r, id, i, var) \ + typedef void (*BOOST_SCOPE_EXIT_AUX_TAG(id,i))(int var); + + +#ifdef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND + +#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) + +#define BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, var) \ + BOOST_PP_COMMA_IF(i) { BOOST_SCOPE_EXIT_AUX_DEREF(id,i,var) } + +#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, seq) \ + = { BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_INIT, id, seq) }; + +#else + +#define BOOST_SCOPE_EXIT_AUX_CTOR_ARG(r, id, i, var) BOOST_PP_COMMA_IF(i) \ + BOOST_SCOPE_EXIT_AUX_PARAM_T(id,i,var) & BOOST_PP_CAT(a,i) + +#define BOOST_SCOPE_EXIT_AUX_MEMBER_INIT(r, id, i, var) BOOST_PP_COMMA_IF(i) \ + BOOST_SCOPE_EXIT_AUX_PARAM(id,i,var) ( BOOST_PP_CAT(a,i) ) + +#define BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) \ + BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)( \ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CTOR_ARG, id, seq ) ) \ + : BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER_INIT, id, seq) {} + +#define BOOST_SCOPE_EXIT_AUX_PARAM_INIT(r, id, i, var) \ + BOOST_PP_COMMA_IF(i) BOOST_SCOPE_EXIT_AUX_DEREF(id,i,var) + +#define BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id, seq) \ + ( BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_INIT, id, seq) ); + +#endif + +#if defined(BOOST_TYPEOF_EMULATION) + +#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \ + struct BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i) \ + : BOOST_TYPEOF(boost::scope_exit::aux::wrap( \ + BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var))) \ + {}; typedef BOOST_PP_TUPLE_ELEM(2,1,idty) \ + BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i)::type \ + BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var); + +#elif defined(BOOST_INTEL) + +#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \ + typedef BOOST_TYPEOF_KEYWORD( \ + BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var)) \ + BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var); + +#else + +#define BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL(r, idty, i, var) \ + typedef BOOST_TYPEOF(boost::scope_exit::aux::wrap( \ + BOOST_SCOPE_EXIT_AUX_DEREF(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var))) \ + BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i); \ + typedef BOOST_PP_TUPLE_ELEM(2,1,idty) \ + BOOST_SCOPE_EXIT_AUX_WRAPPED(BOOST_PP_TUPLE_ELEM(2,0,idty), i)::type \ + BOOST_SCOPE_EXIT_AUX_CAPTURE_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var); + +#endif + +#define BOOST_SCOPE_EXIT_AUX_PARAM_DECL(r, idty, i, var) \ + typedef BOOST_SCOPE_EXIT_AUX_CAPTURE_T( \ + BOOST_PP_TUPLE_ELEM(2,0,idty), i, var) \ + BOOST_SCOPE_EXIT_AUX_PARAM_T(BOOST_PP_TUPLE_ELEM(2,0,idty), i, var); + + +#define BOOST_SCOPE_EXIT_AUX_IMPL(id, seq, ty) \ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_TAG_DECL, id, seq) \ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_CAPTURE_DECL, (id,ty), seq) \ + struct BOOST_SCOPE_EXIT_AUX_PARAMS_T(id) { \ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_PARAM_DECL, (id,ty), seq) \ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_MEMBER, id, seq) \ + BOOST_SCOPE_EXIT_AUX_PARAMS_T_CTOR(id, seq) \ + } BOOST_SCOPE_EXIT_AUX_PARAMS(id) BOOST_SCOPE_EXIT_AUX_PARAMS_INIT(id,seq) \ + boost::scope_exit::aux::declared< boost::scope_exit::aux::resolve< \ + sizeof(boost_scope_exit_args)>::cmp1<0>::cmp2 > boost_scope_exit_args; \ + boost_scope_exit_args.value = &BOOST_SCOPE_EXIT_AUX_PARAMS(id); \ + struct BOOST_SCOPE_EXIT_AUX_GUARD_T(id) { \ + BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)* boost_se_params_; \ + BOOST_SCOPE_EXIT_AUX_GUARD_T(id) (void* boost_se_params) \ + : boost_se_params_( \ + (BOOST_SCOPE_EXIT_AUX_PARAMS_T(id)*)boost_se_params) \ + {} \ + ~BOOST_SCOPE_EXIT_AUX_GUARD_T(id)() { boost_se_body( \ + BOOST_PP_SEQ_FOR_EACH_I(BOOST_SCOPE_EXIT_AUX_ARG, id, seq) ); } \ + static void boost_se_body(BOOST_PP_SEQ_FOR_EACH_I( \ + BOOST_SCOPE_EXIT_AUX_ARG_DECL, (id,ty), seq) ) + +#if defined(BOOST_MSVC) + +#define BOOST_SCOPE_EXIT_END } BOOST_SCOPE_EXIT_AUX_GUARD(__COUNTER__) ( \ + boost_scope_exit_args.value); + +#define BOOST_SCOPE_EXIT(seq) \ + BOOST_SCOPE_EXIT_AUX_IMPL(__COUNTER__, seq, BOOST_PP_EMPTY()) + +#else + +#define BOOST_SCOPE_EXIT_END } BOOST_SCOPE_EXIT_AUX_GUARD(__LINE__) ( \ + boost_scope_exit_args.value); + +#define BOOST_SCOPE_EXIT(seq) \ + BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq, BOOST_PP_EMPTY()) + +#endif + +#ifdef BOOST_SCOPE_EXIT_AUX_TPL_WORKAROUND +#define BOOST_SCOPE_EXIT_TPL(seq) \ + BOOST_SCOPE_EXIT_AUX_IMPL(__LINE__, seq, typename) +#else +#define BOOST_SCOPE_EXIT_TPL(seq) BOOST_SCOPE_EXIT(seq) +#endif + +#endif // #ifndef FILE_boost_scope_exit_hpp_INCLUDED + diff --git a/deal.II/contrib/boost/include/boost/serialization/access.hpp b/deal.II/contrib/boost/include/boost/serialization/access.hpp index 990f034e75..40256d6cd3 100644 --- a/deal.II/contrib/boost/include/boost/serialization/access.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/access.hpp @@ -106,6 +106,15 @@ public: T & t, const unsigned int file_version ){ + // note: if you get a compile time error here with a + // message something like: + // cannot convert parameter 1 from to + // a likely possible cause is that the class T contains a + // serialize function - but that serialize function isn't + // a template and corresponds to a file type different than + // the class Archive. To resolve this, don't include an + // archive type other than that for which the serialization + // function is defined!!! t.serialize(ar, file_version); } template diff --git a/deal.II/contrib/boost/include/boost/serialization/array.hpp b/deal.II/contrib/boost/include/boost/serialization/array.hpp index cdc9b59d38..3640c5d8c1 100644 --- a/deal.II/contrib/boost/include/boost/serialization/array.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/array.hpp @@ -6,16 +6,7 @@ // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include -#include -#include -#include -#include -#include #include - #include // std::size_t #include #include // msvc 6.0 needs this for warning suppression @@ -25,6 +16,15 @@ namespace std{ } // namespace std #endif +#include +#include +#include +#include +#include +#include +#include +#include + namespace boost { namespace serialization { // traits to specify whether to use an optimized array serialization @@ -42,8 +42,8 @@ struct use_array_optimization : boost::mpl::always {}; #endif template -class array - : public wrapper_traits > +class array : + public wrapper_traits > { public: typedef T value_type; @@ -52,7 +52,15 @@ public: m_t(t), m_element_count(s) {} - + array(const array & rhs) : + m_t(rhs.m_t), + m_element_count(rhs.m_element_count) + {} + array & operator=(const array & rhs){ + m_t = rhs.m_t; + m_element_count = rhs.m_element_count; + } + // default implementation template void serialize_optimized(Archive &ar, const unsigned int, mpl::false_ ) const @@ -108,7 +116,7 @@ public: private: value_type* m_t; - std::size_t const m_element_count; + std::size_t m_element_count; }; template @@ -126,8 +134,6 @@ void serialize(Archive& ar, boost::array& a, const unsigned int /* version ar & boost::serialization::make_nvp("elems",a.elems); } - - } } // end namespace boost::serialization #ifdef __BORLANDC__ diff --git a/deal.II/contrib/boost/include/boost/serialization/binary_object.hpp b/deal.II/contrib/boost/include/boost/serialization/binary_object.hpp index 2a2d2af878..0d8d027cd0 100644 --- a/deal.II/contrib/boost/include/boost/serialization/binary_object.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/binary_object.hpp @@ -39,8 +39,8 @@ namespace serialization { struct binary_object : public wrapper_traits > { - /* const */ void * const m_t; - const std::size_t m_size; + void const * m_t; + std::size_t m_size; template void save(Archive & ar, const unsigned int /* file_version */) const { ar.save_binary(m_t, m_size); @@ -50,6 +50,11 @@ struct binary_object : ar.load_binary(const_cast(m_t), m_size); } BOOST_SERIALIZATION_SPLIT_MEMBER() + binary_object & operator=(const binary_object & rhs) { + m_t = rhs.m_t; + m_size = rhs.m_size; + return *this; + } binary_object(/* const */ void * const t, std::size_t size) : m_t(t), m_size(size) diff --git a/deal.II/contrib/boost/include/boost/serialization/collection_traits.hpp b/deal.II/contrib/boost/include/boost/serialization/collection_traits.hpp index 568b807402..60453c7939 100644 --- a/deal.II/contrib/boost/include/boost/serialization/collection_traits.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/collection_traits.hpp @@ -27,6 +27,7 @@ #include #include +#include #include // ULONG_MAX #include @@ -47,30 +48,10 @@ struct implementation_level< C < T > > { \ /**/ #endif -// determine if its necessary to handle (u)int64_t specifically -// i.e. that its not a synonym for (unsigned) long -// if there is no 64 bit int or if its the same as a long -// we shouldn't define separate functions for int64 data types. -#if defined(BOOST_NO_INT64_T) - #define BOOST_NO_INTRINSIC_INT64_T -#else - #if defined(ULLONG_MAX) - #if(ULONG_MAX == 18446744073709551615ul) // 2**64 - 1 - #define BOOST_NO_INTRINSIC_INT64_T - #endif - #elif defined(ULONG_MAX) - #if(ULONG_MAX != 0xffffffff && ULONG_MAX == 18446744073709551615ul) // 2**64 - 1 - #define BOOST_NO_INTRINSIC_INT64_T - #endif - #else - #define BOOST_NO_INTRINSIC_INT64_T - #endif -#endif - -#if !defined(BOOST_NO_INTRINSIC_INT64_T) +#if defined(BOOST_HAS_LONG_LONG) #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \ - BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::int64_t, C) \ - BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::uint64_t, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::long_long_type, C) \ + BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::ulong_long_type, C) \ /**/ #else #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) diff --git a/deal.II/contrib/boost/include/boost/serialization/collections_load_imp.hpp b/deal.II/contrib/boost/include/boost/serialization/collections_load_imp.hpp index 04e5051993..4013778c65 100644 --- a/deal.II/contrib/boost/include/boost/serialization/collections_load_imp.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/collections_load_imp.hpp @@ -50,10 +50,12 @@ namespace stl { template struct archive_input_seq { - inline void operator()( + inline BOOST_DEDUCED_TYPENAME Container::iterator + operator()( Archive &ar, Container &s, - const unsigned int v + const unsigned int v, + BOOST_DEDUCED_TYPENAME Container::iterator hint ){ typedef BOOST_DEDUCED_TYPENAME Container::value_type type; detail::stack_construct t(ar, v); @@ -61,6 +63,7 @@ struct archive_input_seq ar >> boost::serialization::make_nvp("item", t.reference()); s.push_back(t.reference()); ar.reset_object_address(& s.back() , & t.reference()); + return hint; } }; @@ -68,51 +71,27 @@ struct archive_input_seq template struct archive_input_map { - inline void operator()( + inline BOOST_DEDUCED_TYPENAME Container::iterator + operator()( Archive &ar, Container &s, - const unsigned int v + const unsigned int v, + BOOST_DEDUCED_TYPENAME Container::iterator hint ){ typedef BOOST_DEDUCED_TYPENAME Container::value_type type; detail::stack_construct t(ar, v); // borland fails silently w/o full namespace ar >> boost::serialization::make_nvp("item", t.reference()); - std::pair result = - s.insert(t.reference()); - // note: the following presumes that the map::value_type was NOT tracked - // in the archive. This is the usual case, but here there is no way - // to determine that. - if(result.second){ - ar.reset_object_address( - & (result.first->second), - & t.reference().second - ); - } - } -}; - -// multimap input -template -struct archive_input_multimap -{ - inline void operator()( - Archive &ar, - Container &s, - const unsigned int v - ){ - typedef BOOST_DEDUCED_TYPENAME Container::value_type type; - detail::stack_construct t(ar, v); - // borland fails silently w/o full namespace - ar >> boost::serialization::make_nvp("item", t.reference()); - BOOST_DEDUCED_TYPENAME Container::const_iterator result - = s.insert(t.reference()); + BOOST_DEDUCED_TYPENAME Container::iterator result = + s.insert(hint, t.reference()); // note: the following presumes that the map::value_type was NOT tracked // in the archive. This is the usual case, but here there is no way // to determine that. ar.reset_object_address( - & result->second, - & t.reference() + & (result->second), + & t.reference().second ); + return result; } }; @@ -120,38 +99,21 @@ struct archive_input_multimap template struct archive_input_set { - inline void operator()( - Archive &ar, - Container &s, - const unsigned int v - ){ - typedef BOOST_DEDUCED_TYPENAME Container::value_type type; - detail::stack_construct t(ar, v); - // borland fails silently w/o full namespace - ar >> boost::serialization::make_nvp("item", t.reference()); - std::pair result = - s.insert(t.reference()); - if(result.second) - ar.reset_object_address(& (* result.first), & t.reference()); - } -}; - -// multiset input -template -struct archive_input_multiset -{ - inline void operator()( + inline BOOST_DEDUCED_TYPENAME Container::iterator + operator()( Archive &ar, Container &s, - const unsigned int v + const unsigned int v, + BOOST_DEDUCED_TYPENAME Container::iterator hint ){ typedef BOOST_DEDUCED_TYPENAME Container::value_type type; detail::stack_construct t(ar, v); // borland fails silently w/o full namespace ar >> boost::serialization::make_nvp("item", t.reference()); - BOOST_DEDUCED_TYPENAME Container::const_iterator result - = s.insert(t.reference()); + BOOST_DEDUCED_TYPENAME Container::iterator result = + s.insert(hint, t.reference()); ar.reset_object_address(& (* result), & t.reference()); + return result; } }; @@ -187,8 +149,10 @@ inline void load_collection(Archive & ar, Container &s) rx(s, count); std::size_t c = count; InputFunction ifunc; + BOOST_DEDUCED_TYPENAME Container::iterator hint; + hint = s.begin(); while(c-- > 0){ - ifunc(ar, s, item_version); + hint = ifunc(ar, s, item_version, hint); } } diff --git a/deal.II/contrib/boost/include/boost/serialization/collections_save_imp.hpp b/deal.II/contrib/boost/include/boost/serialization/collections_save_imp.hpp index 60580f65f1..02f8944c82 100644 --- a/deal.II/contrib/boost/include/boost/serialization/collections_save_imp.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/collections_save_imp.hpp @@ -47,7 +47,7 @@ inline void save_collection(Archive & ar, const Container &s) ar << BOOST_SERIALIZATION_NVP(item_version); } BOOST_DEDUCED_TYPENAME Container::const_iterator it = s.begin(); - std::size_t c=count; + collection_size_type c=count; while(c-- > 0){ // note borland emits a no-op without the explicit namespace boost::serialization::save_construct_data_adl( diff --git a/deal.II/contrib/boost/include/boost/serialization/export.hpp b/deal.II/contrib/boost/include/boost/serialization/export.hpp index d1637007eb..da397feb3b 100644 --- a/deal.II/contrib/boost/include/boost/serialization/export.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/export.hpp @@ -34,6 +34,7 @@ #include #include +#include // for guid_defined only #include #include #include @@ -115,6 +116,10 @@ ptr_serialization_support::instantiate() ); } +// Note INTENTIONAL usage of anonymous namespace in header. +// This was made this way so that export.hpp could be included +// in other headers. This is still under study. + namespace { template diff --git a/deal.II/contrib/boost/include/boost/serialization/extended_type_info.hpp b/deal.II/contrib/boost/include/boost/serialization/extended_type_info.hpp index ef8f8bcfae..4799432885 100644 --- a/deal.II/contrib/boost/include/boost/serialization/extended_type_info.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/extended_type_info.hpp @@ -82,13 +82,8 @@ public: } static const extended_type_info * find(const char *key); // for plugins - virtual void * construct(unsigned int /*count*/ = 0, ...) const { - assert(false); // must be implemented if used - return NULL; - }; - virtual void destroy(void const * const /*p*/) const { - assert(false); // must be implemented if used - } + virtual void * construct(unsigned int /*count*/ = 0, ...) const = 0; + virtual void destroy(void const * const /*p*/) const = 0; }; template diff --git a/deal.II/contrib/boost/include/boost/serialization/extended_type_info_no_rtti.hpp b/deal.II/contrib/boost/include/boost/serialization/extended_type_info_no_rtti.hpp index 15254fba37..5ba09b2e18 100644 --- a/deal.II/contrib/boost/include/boost/serialization/extended_type_info_no_rtti.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/extended_type_info_no_rtti.hpp @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -31,10 +32,13 @@ #include #include +// hijack serialization access +#include + #include // must be the last header #ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable : 4251 4231 4660 4275) +# pragma warning(disable : 4251 4231 4660 4275 4511 4512) #endif namespace boost { @@ -125,15 +129,15 @@ public: va_start(ap, count); switch(count){ case 0: - return factory(ap); + return factory::type, 0>(ap); case 1: - return factory(ap); + return factory::type, 1>(ap); case 2: - return factory(ap); + return factory::type, 2>(ap); case 3: - return factory(ap); + return factory::type, 3>(ap); case 4: - return factory(ap); + return factory::type, 4>(ap); default: assert(false); // too many arguments // throw exception here? @@ -141,7 +145,10 @@ public: } } virtual void destroy(void const * const p) const{ - delete static_cast(p) ; + boost::serialization::access::destroy( + static_cast(p) + ); + //delete static_cast(p) ; } }; diff --git a/deal.II/contrib/boost/include/boost/serialization/extended_type_info_typeid.hpp b/deal.II/contrib/boost/include/boost/serialization/extended_type_info_typeid.hpp index eb0175333e..701cd5aecc 100644 --- a/deal.II/contrib/boost/include/boost/serialization/extended_type_info_typeid.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/extended_type_info_typeid.hpp @@ -32,12 +32,16 @@ #include #include +// hijack serialization access +#include + #include #include // must be the last header + #ifdef BOOST_MSVC # pragma warning(push) -# pragma warning(disable : 4251 4231 4660 4275) +# pragma warning(disable : 4251 4231 4660 4275 4511 4512) #endif namespace boost { @@ -109,30 +113,26 @@ public: va_start(ap, count); switch(count){ case 0: - return factory, 0>(ap); + return factory::type, 0>(ap); case 1: - return factory, 1>(ap); + return factory::type, 1>(ap); case 2: - return factory, 2>(ap); + return factory::type, 2>(ap); case 3: - return factory, 3>(ap); + return factory::type, 3>(ap); case 4: - return factory, 4>(ap); + return factory::type, 4>(ap); default: assert(false); // too many arguments // throw exception here? return NULL; } } - virtual void destroy(void const * const /* p */) const { - // the only current usage of extended type info is in the - // serialization library. The statement below requires - // that destructor of type T be public and this creates - // a problem for some users. So, for now, comment this - // out - //delete static_cast(p); - // and trap any attempt to invoke this function - assert(false); + virtual void destroy(void const * const p) const { + boost::serialization::access::destroy( + static_cast(p) + ); + //delete static_cast(p); } }; diff --git a/deal.II/contrib/boost/include/boost/serialization/factory.hpp b/deal.II/contrib/boost/include/boost/serialization/factory.hpp index c7730cb8c4..9039a32c7a 100644 --- a/deal.II/contrib/boost/include/boost/serialization/factory.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/factory.hpp @@ -24,7 +24,7 @@ #include namespace std{ - #if defined(__LIBCOMO__) + #if defined(__LIBCOMO__) || defined(__QNXNTO__) using ::va_list; #endif } // namespace std @@ -88,6 +88,14 @@ namespace serialization { \ BOOST_SERIALIZATION_FACTORY(1, T, A0, 0, 0, 0) #define BOOST_SERIALIZATION_FACTORY_0(T) \ - BOOST_SERIALIZATION_FACTORY(0, T, 0, 0, 0, 0) +namespace boost { \ +namespace serialization { \ + template<> \ + T * factory(std::va_list){ \ + return new T(); \ + } \ +} \ +} \ +/**/ #endif // BOOST_SERIALIZATION_FACTORY_HPP diff --git a/deal.II/contrib/boost/include/boost/serialization/hash_collections_load_imp.hpp b/deal.II/contrib/boost/include/boost/serialization/hash_collections_load_imp.hpp index cd5bea8d18..45319153d6 100644 --- a/deal.II/contrib/boost/include/boost/serialization/hash_collections_load_imp.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/hash_collections_load_imp.hpp @@ -20,7 +20,7 @@ // helper function templates for serialization of hashed collections #include #include -#include +//#include namespace boost{ namespace serialization { diff --git a/deal.II/contrib/boost/include/boost/serialization/hash_map.hpp b/deal.II/contrib/boost/include/boost/serialization/hash_map.hpp index 06d4c306dc..f5327388aa 100644 --- a/deal.II/contrib/boost/include/boost/serialization/hash_map.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/hash_map.hpp @@ -29,6 +29,62 @@ namespace boost { namespace serialization { +namespace stl { + +// map input +template +struct archive_input_hash_map +{ + inline void operator()( + Archive &ar, + Container &s, + const unsigned int v + ){ + typedef BOOST_DEDUCED_TYPENAME Container::value_type type; + detail::stack_construct t(ar, v); + // borland fails silently w/o full namespace + ar >> boost::serialization::make_nvp("item", t.reference()); + std::pair result = + s.insert(t.reference()); + // note: the following presumes that the map::value_type was NOT tracked + // in the archive. This is the usual case, but here there is no way + // to determine that. + if(result.second){ + ar.reset_object_address( + & (result.first->second), + & t.reference().second + ); + } + } +}; + +// multimap input +template +struct archive_input_hash_multimap +{ + inline void operator()( + Archive &ar, + Container &s, + const unsigned int v + ){ + typedef BOOST_DEDUCED_TYPENAME Container::value_type type; + detail::stack_construct t(ar, v); + // borland fails silently w/o full namespace + ar >> boost::serialization::make_nvp("item", t.reference()); + BOOST_DEDUCED_TYPENAME Container::const_iterator result + = s.insert(t.reference()); + // note: the following presumes that the map::value_type was NOT tracked + // in the archive. This is the usual case, but here there is no way + // to determine that. + ar.reset_object_address( + & result->second, + & t.reference() + ); + } +}; + +} // stl + template< class Archive, class Key, @@ -70,7 +126,7 @@ inline void load( BOOST_STD_EXTENSION_NAMESPACE::hash_map< Key, HashFcn, EqualKey, Allocator >, - boost::serialization::stl::archive_input_map< + boost::serialization::stl::archive_input_hash_map< Archive, BOOST_STD_EXTENSION_NAMESPACE::hash_map< Key, HashFcn, EqualKey, Allocator @@ -140,7 +196,7 @@ inline void load( BOOST_STD_EXTENSION_NAMESPACE::hash_multimap< Key, HashFcn, EqualKey, Allocator >, - boost::serialization::stl::archive_input_multimap< + boost::serialization::stl::archive_input_hash_multimap< Archive, BOOST_STD_EXTENSION_NAMESPACE::hash_multimap< Key, HashFcn, EqualKey, Allocator diff --git a/deal.II/contrib/boost/include/boost/serialization/hash_set.hpp b/deal.II/contrib/boost/include/boost/serialization/hash_set.hpp index 62aeea4601..916c2dd146 100644 --- a/deal.II/contrib/boost/include/boost/serialization/hash_set.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/hash_set.hpp @@ -27,6 +27,49 @@ namespace boost { namespace serialization { +namespace stl { + +// hash_set input +template +struct archive_input_hash_set +{ + inline void operator()( + Archive &ar, + Container &s, + const unsigned int v + ){ + typedef BOOST_DEDUCED_TYPENAME Container::value_type type; + detail::stack_construct t(ar, v); + // borland fails silently w/o full namespace + ar >> boost::serialization::make_nvp("item", t.reference()); + std::pair result = + s.insert(t.reference()); + if(result.second) + ar.reset_object_address(& (* result.first), & t.reference()); + } +}; + +// hash_multiset input +template +struct archive_input_hash_multiset +{ + inline void operator()( + Archive &ar, + Container &s, + const unsigned int v + ){ + typedef BOOST_DEDUCED_TYPENAME Container::value_type type; + detail::stack_construct t(ar, v); + // borland fails silently w/o full namespace + ar >> boost::serialization::make_nvp("item", t.reference()); + BOOST_DEDUCED_TYPENAME Container::const_iterator result + = s.insert(t.reference()); + ar.reset_object_address(& (* result), & t.reference()); + } +}; + +} // stl + template< class Archive, class Key, @@ -68,7 +111,7 @@ inline void load( BOOST_STD_EXTENSION_NAMESPACE::hash_set< Key, HashFcn, EqualKey, Allocator >, - boost::serialization::stl::archive_input_set< + boost::serialization::stl::archive_input_hash_set< Archive, BOOST_STD_EXTENSION_NAMESPACE::hash_set< Key, HashFcn, EqualKey, Allocator @@ -138,7 +181,7 @@ inline void load( BOOST_STD_EXTENSION_NAMESPACE::hash_multiset< Key, HashFcn, EqualKey, Allocator >, - boost::serialization::stl::archive_input_multiset< + boost::serialization::stl::archive_input_hash_multiset< Archive, BOOST_STD_EXTENSION_NAMESPACE::hash_multiset< Key, HashFcn, EqualKey, Allocator diff --git a/deal.II/contrib/boost/include/boost/serialization/map.hpp b/deal.II/contrib/boost/include/boost/serialization/map.hpp index 6cf965ff8b..624290df1a 100644 --- a/deal.II/contrib/boost/include/boost/serialization/map.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/map.hpp @@ -92,7 +92,7 @@ inline void load( boost::serialization::stl::load_collection< Archive, std::multimap, - boost::serialization::stl::archive_input_multimap< + boost::serialization::stl::archive_input_map< Archive, std::multimap >, boost::serialization::stl::no_reserve_imp< diff --git a/deal.II/contrib/boost/include/boost/serialization/set.hpp b/deal.II/contrib/boost/include/boost/serialization/set.hpp index c67c27ed4d..4bb69abb93 100644 --- a/deal.II/contrib/boost/include/boost/serialization/set.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/set.hpp @@ -89,7 +89,7 @@ inline void load( boost::serialization::stl::load_collection< Archive, std::multiset, - boost::serialization::stl::archive_input_multiset< + boost::serialization::stl::archive_input_set< Archive, std::multiset >, boost::serialization::stl::no_reserve_imp< diff --git a/deal.II/contrib/boost/include/boost/serialization/shared_ptr.hpp b/deal.II/contrib/boost/include/boost/serialization/shared_ptr.hpp index 53c0384604..ff2f718fe2 100644 --- a/deal.II/contrib/boost/include/boost/serialization/shared_ptr.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/shared_ptr.hpp @@ -16,7 +16,6 @@ // See http://www.boost.org for updates, documentation, and revision history. -#include #include // NULL #include @@ -108,6 +107,7 @@ inline void save( ar << boost::serialization::make_nvp("px", t_ptr); } +#ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP template inline void load( Archive & ar, @@ -119,7 +119,6 @@ inline void load( // is never tracked by default. Wrap int in a trackable type BOOST_STATIC_ASSERT((tracking_level::value != track_never)); T* r; - #ifdef BOOST_SERIALIZATION_SHARED_PTR_132_HPP if(file_version < 1){ //ar.register_type(static_cast< // boost_132::detail::sp_counted_base_impl > * @@ -134,14 +133,29 @@ inline void load( ar.append(sp); r = sp.get(); } - else - #endif - { + else{ ar >> boost::serialization::make_nvp("px", r); } ar.reset(t,r); } +#else +template +inline void load( + Archive & ar, + boost::shared_ptr &t, + const unsigned int /*file_version*/ +){ + // The most common cause of trapping here would be serializing + // something like shared_ptr. This occurs because int + // is never tracked by default. Wrap int in a trackable type + BOOST_STATIC_ASSERT((tracking_level::value != track_never)); + T* r; + ar >> boost::serialization::make_nvp("px", r); + ar.reset(t,r); +} +#endif + template inline void serialize( Archive & ar, diff --git a/deal.II/contrib/boost/include/boost/serialization/singleton.hpp b/deal.II/contrib/boost/include/boost/serialization/singleton.hpp index cca3b3eb00..b22e517c3b 100644 --- a/deal.II/contrib/boost/include/boost/serialization/singleton.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/singleton.hpp @@ -35,9 +35,15 @@ #endif #include +#include #include #include +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4511 4512) +#endif + namespace boost { namespace serialization { @@ -71,7 +77,8 @@ namespace serialization { // attempt to retieve a mutable instances while locked will // generate a assertion if compiled for debug. -class singleton_module : public boost::noncopyable +class singleton_module : + public boost::noncopyable { private: static bool & get_lock(){ @@ -144,4 +151,8 @@ BOOST_DLLEXPORT T & singleton::instance = singleton::get_instance(); } // namespace serialization } // namespace boost +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + #endif // BOOST_SERIALIZATION_SINGLETON_HPP diff --git a/deal.II/contrib/boost/include/boost/serialization/slist.hpp b/deal.II/contrib/boost/include/boost/serialization/slist.hpp index 0a03acf92b..9e741cc369 100644 --- a/deal.II/contrib/boost/include/boost/serialization/slist.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/slist.hpp @@ -69,7 +69,7 @@ inline void load( t.push_front(u.reference()); BOOST_DEDUCED_TYPENAME BOOST_STD_EXTENSION_NAMESPACE::slist::iterator last; last = t.begin(); - std::size_t c = count; + collection_size_type c = count; while(--c > 0){ boost::serialization::detail::stack_construct u(ar, file_version); diff --git a/deal.II/contrib/boost/include/boost/serialization/static_warning.hpp b/deal.II/contrib/boost/include/boost/serialization/static_warning.hpp index 280598e3d1..b41791ad86 100644 --- a/deal.II/contrib/boost/include/boost/serialization/static_warning.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/static_warning.hpp @@ -77,7 +77,7 @@ namespace boost { namespace serialization { template -struct STATIC_WARNING_LINE{}; +struct BOOST_SERIALIZATION_STATIC_WARNING_LINE{}; template struct static_warning_test{ @@ -86,23 +86,23 @@ struct static_warning_test{ boost::mpl::true_, typename boost::mpl::identity< boost::mpl::print< - STATIC_WARNING_LINE + BOOST_SERIALIZATION_STATIC_WARNING_LINE > > >::type type; }; template -struct SS {}; +struct BOOST_SERIALIZATION_SS {}; } // serialization } // boost -#define BSW(B, L) \ - typedef boost::serialization::SS< \ +#define BOOST_SERIALIZATION_BSW(B, L) \ + typedef boost::serialization::BOOST_SERIALIZATION_SS< \ sizeof( boost::serialization::static_warning_test< B, L > ) \ > BOOST_JOIN(STATIC_WARNING_LINE, L); -#define BOOST_STATIC_WARNING(B) BSW(B, __LINE__) +#define BOOST_STATIC_WARNING(B) BOOST_SERIALIZATION_BSW(B, __LINE__) #endif // BOOST_SERIALIZATION_STATIC_WARNING_HPP diff --git a/deal.II/contrib/boost/include/boost/serialization/throw_exception.hpp b/deal.II/contrib/boost/include/boost/serialization/throw_exception.hpp index dad0efe579..ed7d8109f2 100644 --- a/deal.II/contrib/boost/include/boost/serialization/throw_exception.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/throw_exception.hpp @@ -26,7 +26,7 @@ namespace serialization { #ifdef BOOST_NO_EXCEPTIONS -void inline throw_exception(std::exception const & e) { +inline void throw_exception(std::exception const & e) { ::boost::throw_exception(e); } diff --git a/deal.II/contrib/boost/include/boost/serialization/variant.hpp b/deal.II/contrib/boost/include/boost/serialization/variant.hpp index fef50956d8..5ab822d543 100644 --- a/deal.II/contrib/boost/include/boost/serialization/variant.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/variant.hpp @@ -46,7 +46,9 @@ namespace boost { namespace serialization { template -struct variant_save_visitor : boost::static_visitor<> { +struct variant_save_visitor : + boost::static_visitor<> +{ variant_save_visitor(Archive& ar) : m_ar(ar) {} diff --git a/deal.II/contrib/boost/include/boost/serialization/version.hpp b/deal.II/contrib/boost/include/boost/serialization/version.hpp index 54c72fc26e..e1a2fad333 100644 --- a/deal.II/contrib/boost/include/boost/serialization/version.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/version.hpp @@ -23,7 +23,6 @@ #include #include -//#include namespace boost { namespace serialization { @@ -67,8 +66,19 @@ struct version //#include //#include +#include +#include +#include + // specify the current version number for the class +// version numbers limited to 8 bits !!! #define BOOST_CLASS_VERSION(T, N) \ +BOOST_MPL_ASSERT(( \ + boost::mpl::less< \ + boost::mpl::int_, \ + boost::mpl::int_<256> \ + > \ +)); \ namespace boost { \ namespace serialization { \ template<> \ diff --git a/deal.II/contrib/boost/include/boost/serialization/void_cast.hpp b/deal.II/contrib/boost/include/boost/serialization/void_cast.hpp index 183a4710d6..6190849da2 100644 --- a/deal.II/contrib/boost/include/boost/serialization/void_cast.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/void_cast.hpp @@ -143,6 +143,11 @@ public: virtual ~void_caster(){} }; +#ifdef BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4251 4231 4660 4275 4511 4512) +#endif + template class void_caster_primitive : public void_caster @@ -163,7 +168,7 @@ class void_caster_primitive : } public: void_caster_primitive(); - ~void_caster_primitive(); + virtual ~void_caster_primitive(); }; template @@ -208,9 +213,13 @@ public: return b; } void_caster_virtual_base(); - ~void_caster_virtual_base(); + virtual ~void_caster_virtual_base(); }; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + template void_caster_virtual_base::void_caster_virtual_base() : void_caster( diff --git a/deal.II/contrib/boost/include/boost/serialization/weak_ptr.hpp b/deal.II/contrib/boost/include/boost/serialization/weak_ptr.hpp index a0db064c4a..403c18ab55 100644 --- a/deal.II/contrib/boost/include/boost/serialization/weak_ptr.hpp +++ b/deal.II/contrib/boost/include/boost/serialization/weak_ptr.hpp @@ -29,7 +29,7 @@ inline void save( const unsigned int /* file_version */ ){ const boost::shared_ptr sp = t.lock(); - ar << boost::serialization::make_nvp("shared_ptr", sp); + ar << boost::serialization::make_nvp("weak_ptr", sp); } template @@ -39,7 +39,7 @@ inline void load( const unsigned int /* file_version */ ){ boost::shared_ptr sp; - ar >> boost::serialization::make_nvp("shared_ptr", sp); + ar >> boost::serialization::make_nvp("weak_ptr", sp); t = sp; } diff --git a/deal.II/contrib/boost/include/boost/signals2.hpp b/deal.II/contrib/boost/include/boost/signals2.hpp new file mode 100644 index 0000000000..09fe6409d0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/signals2.hpp @@ -0,0 +1,18 @@ +// A convenience header for Boost.Signals2, should pull in everying in the library. + +// Copyright (c) 2008-2009 Frank Mori Hess + +// Use, modification and +// distribution is subject to the Boost Software License, Version +// 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// For documentation, see http://www.boost.org/libs/signals2/ + +#include +#include +#include +#include +#include +#include +#include diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/detail/lwm_pthreads.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/detail/lwm_pthreads.hpp index fc20dbb145..8eda518233 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/detail/lwm_pthreads.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/detail/lwm_pthreads.hpp @@ -17,6 +17,7 @@ // http://www.boost.org/LICENSE_1_0.txt) // +#include #include namespace boost @@ -42,15 +43,15 @@ public: // HPUX 10.20 / DCE has a nonstandard pthread_mutex_init #if defined(__hpux) && defined(_DECTHREADS_) - pthread_mutex_init(&m_, pthread_mutexattr_default); + BOOST_VERIFY( pthread_mutex_init( &m_, pthread_mutexattr_default ) == 0 ); #else - pthread_mutex_init(&m_, 0); + BOOST_VERIFY( pthread_mutex_init( &m_, 0 ) == 0 ); #endif } ~lightweight_mutex() { - pthread_mutex_destroy(&m_); + BOOST_VERIFY( pthread_mutex_destroy( &m_ ) == 0 ); } class scoped_lock; @@ -69,12 +70,12 @@ public: scoped_lock(lightweight_mutex & m): m_(m.m_) { - pthread_mutex_lock(&m_); + BOOST_VERIFY( pthread_mutex_lock( &m_ ) == 0 ); } ~scoped_lock() { - pthread_mutex_unlock(&m_); + BOOST_VERIFY( pthread_mutex_unlock( &m_ ) == 0 ); } }; }; diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/detail/quick_allocator.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/detail/quick_allocator.hpp index 6d136f82d7..159bd5e7aa 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/detail/quick_allocator.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/detail/quick_allocator.hpp @@ -74,8 +74,9 @@ template struct allocator_impl static lightweight_mutex & mutex() { - static lightweight_mutex m; - return m; + static freeblock< sizeof( lightweight_mutex ), boost::alignment_of< lightweight_mutex >::value > fbm; + static lightweight_mutex * pm = new( &fbm ) lightweight_mutex; + return *pm; } static lightweight_mutex * mutex_init; diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_convertible.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_convertible.hpp index 66e5ec7338..fe440690ac 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_convertible.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_convertible.hpp @@ -25,7 +25,7 @@ # define BOOST_SP_NO_SP_CONVERTIBLE #endif -#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x610 ) +#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x630 ) # define BOOST_SP_NO_SP_CONVERTIBLE #endif diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp index 8af6f0a972..21fa59dcc4 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_counted_base_gcc_sparc.hpp @@ -30,9 +30,9 @@ namespace detail inline int32_t compare_and_swap( int32_t * dest_, int32_t compare_, int32_t swap_ ) { - __asm__ __volatile__( "cas %0, %2, %1" - : "+m" (*dest_), "+r" (swap_) - : "r" (compare_) + __asm__ __volatile__( "cas [%1], %2, %0" + : "+r" (swap_) + : "r" (dest_), "r" (compare_) : "memory" ); return swap_; diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_has_sync.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_has_sync.hpp index cb0282dbad..7fcd09ef08 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_has_sync.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/detail/sp_has_sync.hpp @@ -40,7 +40,7 @@ #undef BOOST_SP_HAS_SYNC #endif -#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) +#if defined( __INTEL_COMPILER ) && !defined( __ia64__ ) && ( __INTEL_COMPILER < 1100 ) #undef BOOST_SP_HAS_SYNC #endif diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/intrusive_ptr.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/intrusive_ptr.hpp index 6927a59185..e72eb21869 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/intrusive_ptr.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/intrusive_ptr.hpp @@ -77,7 +77,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - intrusive_ptr( intrusive_ptr const & rhs, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + intrusive_ptr( intrusive_ptr const & rhs, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -122,7 +122,7 @@ public: intrusive_ptr & operator=(intrusive_ptr && rhs) { - this_type(std::move(rhs)).swap(*this); + this_type( static_cast< intrusive_ptr && >( rhs ) ).swap(*this); return *this; } diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/make_shared.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/make_shared.hpp index 7e1e793e19..d47718808c 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/make_shared.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/make_shared.hpp @@ -86,10 +86,12 @@ public: } }; -template< class T > T forward( T t ) +#if defined( BOOST_HAS_RVALUE_REFS ) +template< class T > T&& forward( T &&t ) { return t; } +#endif } // namespace detail diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/shared_ptr.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/shared_ptr.hpp index 1b367f0f4d..609cce9032 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/shared_ptr.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/shared_ptr.hpp @@ -228,7 +228,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr const & r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + shared_ptr( shared_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -353,7 +353,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - shared_ptr( shared_ptr && r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + shared_ptr( shared_ptr && r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -368,14 +368,14 @@ public: shared_ptr & operator=( shared_ptr && r ) // never throws { - this_type( std::move( r ) ).swap( *this ); + this_type( static_cast< shared_ptr && >( r ) ).swap( *this ); return *this; } template shared_ptr & operator=( shared_ptr && r ) // never throws { - this_type( std::move( r ) ).swap( *this ); + this_type( static_cast< shared_ptr && >( r ) ).swap( *this ); return *this; } @@ -448,7 +448,7 @@ public: return pn < rhs.pn; } - void * _internal_get_deleter( detail::sp_typeinfo const & ti ) const + void * _internal_get_deleter( boost::detail::sp_typeinfo const & ti ) const { return pn.get_deleter( ti ); } diff --git a/deal.II/contrib/boost/include/boost/smart_ptr/weak_ptr.hpp b/deal.II/contrib/boost/include/boost/smart_ptr/weak_ptr.hpp index 621c433a03..d314b0df3e 100644 --- a/deal.II/contrib/boost/include/boost/smart_ptr/weak_ptr.hpp +++ b/deal.II/contrib/boost/include/boost/smart_ptr/weak_ptr.hpp @@ -63,7 +63,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( weak_ptr const & r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + weak_ptr( weak_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -79,20 +79,20 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( weak_ptr && r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + weak_ptr( weak_ptr && r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else weak_ptr( weak_ptr && r ) #endif - : px(r.lock().get()), pn(std::move(r.pn)) // never throws + : px( r.lock().get() ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) // never throws { r.px = 0; } // for better efficiency in the T == Y case - weak_ptr( weak_ptr && r ): px( r.px ), pn(std::move(r.pn)) // never throws + weak_ptr( weak_ptr && r ): px( r.px ), pn( static_cast< boost::detail::weak_count && >( r.pn ) ) // never throws { r.px = 0; } @@ -100,7 +100,7 @@ public: // for better efficiency in the T == Y case weak_ptr & operator=( weak_ptr && r ) // never throws { - this_type( std::move( r ) ).swap( *this ); + this_type( static_cast< weak_ptr && >( r ) ).swap( *this ); return *this; } @@ -110,7 +110,7 @@ public: template #if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) - weak_ptr( shared_ptr const & r, typename detail::sp_enable_if_convertible::type = detail::sp_empty() ) + weak_ptr( shared_ptr const & r, typename boost::detail::sp_enable_if_convertible::type = boost::detail::sp_empty() ) #else @@ -134,9 +134,9 @@ public: #if defined( BOOST_HAS_RVALUE_REFS ) template - weak_ptr & operator=(weak_ptr && r) + weak_ptr & operator=( weak_ptr && r ) { - this_type( std::move( r ) ).swap( *this ); + this_type( static_cast< weak_ptr && >( r ) ).swap( *this ); return *this; } diff --git a/deal.II/contrib/boost/include/boost/thread/barrier.hpp b/deal.II/contrib/boost/include/boost/thread/barrier.hpp index 546f5e9779..4ca30cb4df 100644 --- a/deal.II/contrib/boost/include/boost/thread/barrier.hpp +++ b/deal.II/contrib/boost/include/boost/thread/barrier.hpp @@ -9,6 +9,7 @@ #define BOOST_BARRIER_JDM030602_HPP #include +#include #include #include @@ -27,7 +28,7 @@ namespace boost : m_threshold(count), m_count(count), m_generation(0) { if (count == 0) - throw std::invalid_argument("count cannot be zero."); + boost::throw_exception(std::invalid_argument("count cannot be zero.")); } bool wait() diff --git a/deal.II/contrib/boost/include/boost/thread/detail/thread.hpp b/deal.II/contrib/boost/include/boost/thread/detail/thread.hpp index 170801b61d..9615a39e49 100644 --- a/deal.II/contrib/boost/include/boost/thread/detail/thread.hpp +++ b/deal.II/contrib/boost/include/boost/thread/detail/thread.hpp @@ -39,10 +39,13 @@ namespace boost public detail::thread_data_base { public: -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES thread_data(F&& f_): f(static_cast(f_)) {} + thread_data(F& f_): + f(f_) + {} #else thread_data(F f_): f(f_) @@ -119,7 +122,7 @@ namespace boost detail::thread_data_ptr get_thread_info() const; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template static inline detail::thread_data_ptr make_thread_info(F&& f) { @@ -127,7 +130,7 @@ namespace boost } static inline detail::thread_data_ptr make_thread_info(void (*f)()) { - return detail::thread_data_ptr(detail::heap_new >(f)); + return detail::thread_data_ptr(detail::heap_new >(static_cast(f))); } #else template @@ -141,8 +144,8 @@ namespace boost return detail::thread_data_ptr(detail::heap_new >(f)); } - struct dummy; #endif + struct dummy; public: #ifdef __SUNPRO_CC thread(const volatile thread&); @@ -150,13 +153,22 @@ namespace boost thread(); ~thread(); -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES +#ifdef BOOST_MSVC + template + explicit thread(F f,typename disable_if >, dummy* >::type=0): + thread_info(make_thread_info(f)) + { + start_thread(); + } +#else template thread(F&& f): thread_info(make_thread_info(static_cast(f))) { start_thread(); } +#endif thread(thread&& other) { @@ -343,10 +355,14 @@ namespace boost return lhs.swap(rhs); } -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES + inline thread&& move(thread& t) + { + return static_cast(t); + } inline thread&& move(thread&& t) { - return t; + return static_cast(t); } #else inline detail::thread_move_t move(detail::thread_move_t t) @@ -445,7 +461,7 @@ namespace boost { virtual ~thread_exit_function_base() {} - virtual void operator()() const=0; + virtual void operator()()=0; }; template @@ -458,13 +474,13 @@ namespace boost f(f_) {} - void operator()() const + void operator()() { f(); } }; - void add_thread_exit_function(thread_exit_function_base*); + void BOOST_THREAD_DECL add_thread_exit_function(thread_exit_function_base*); } namespace this_thread diff --git a/deal.II/contrib/boost/include/boost/thread/future.hpp b/deal.II/contrib/boost/include/boost/thread/future.hpp index 3d694ebcb1..8111d9edc6 100644 --- a/deal.II/contrib/boost/include/boost/thread/future.hpp +++ b/deal.II/contrib/boost/include/boost/thread/future.hpp @@ -1,4 +1,4 @@ -// (C) Copyright 2008-9 Anthony Williams +// (C) Copyright 2008-10 Anthony Williams // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -218,7 +219,7 @@ namespace boost struct future_traits { typedef boost::scoped_ptr storage_type; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES typedef T const& source_reference_type; struct dummy; typedef typename boost::mpl::if_,dummy&,T&&>::type rvalue_source_type; @@ -323,7 +324,7 @@ namespace boost move_dest_type get() { wait(); - return *result; + return static_cast(*result); } future_state::state get_state() @@ -403,13 +404,14 @@ namespace boost struct all_futures_lock { - unsigned count; + typedef std::vector::size_type count_type; + count_type count; boost::scoped_array > locks; all_futures_lock(std::vector& futures): count(futures.size()),locks(new boost::unique_lock[count]) { - for(unsigned i=0;i(futures[i].future->mutex); } @@ -632,7 +634,7 @@ namespace boost ~unique_future() {} -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES unique_future(unique_future && other) { future.swap(other.future); @@ -673,7 +675,7 @@ namespace boost { if(!future) { - throw future_uninitialized(); + boost::throw_exception(future_uninitialized()); } return future->get(); @@ -709,7 +711,7 @@ namespace boost { if(!future) { - throw future_uninitialized(); + boost::throw_exception(future_uninitialized()); } future->wait(false); } @@ -724,7 +726,7 @@ namespace boost { if(!future) { - throw future_uninitialized(); + boost::throw_exception(future_uninitialized()); } return future->timed_wait_until(abs_time); } @@ -767,7 +769,7 @@ namespace boost future=other.future; return *this; } -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES shared_future(shared_future && other) { future.swap(other.future); @@ -830,7 +832,7 @@ namespace boost { if(!future) { - throw future_uninitialized(); + boost::throw_exception(future_uninitialized()); } return future->get(); @@ -866,7 +868,7 @@ namespace boost { if(!future) { - throw future_uninitialized(); + boost::throw_exception(future_uninitialized()); } future->wait(false); } @@ -881,7 +883,7 @@ namespace boost { if(!future) { - throw future_uninitialized(); + boost::throw_exception(future_uninitialized()); } return future->timed_wait_until(abs_time); } @@ -929,7 +931,7 @@ namespace boost } // Assignment -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES promise(promise && rhs): future_obtained(rhs.future_obtained) { @@ -974,7 +976,7 @@ namespace boost lazy_init(); if(future_obtained) { - throw future_already_retrieved(); + boost::throw_exception(future_already_retrieved()); } future_obtained=true; return unique_future(future); @@ -986,7 +988,7 @@ namespace boost boost::lock_guard lock(future->mutex); if(future->done) { - throw promise_already_satisfied(); + boost::throw_exception(promise_already_satisfied()); } future->mark_finished_with_result_internal(r); } @@ -998,7 +1000,7 @@ namespace boost boost::lock_guard lock(future->mutex); if(future->done) { - throw promise_already_satisfied(); + boost::throw_exception(promise_already_satisfied()); } future->mark_finished_with_result_internal(static_cast::rvalue_source_type>(r)); } @@ -1009,7 +1011,7 @@ namespace boost boost::lock_guard lock(future->mutex); if(future->done) { - throw promise_already_satisfied(); + boost::throw_exception(promise_already_satisfied()); } future->mark_exceptional_finish_internal(p); } @@ -1063,7 +1065,7 @@ namespace boost } // Assignment -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES promise(promise && rhs): future_obtained(rhs.future_obtained) { @@ -1109,7 +1111,7 @@ namespace boost if(future_obtained) { - throw future_already_retrieved(); + boost::throw_exception(future_already_retrieved()); } future_obtained=true; return unique_future(future); @@ -1121,7 +1123,7 @@ namespace boost boost::lock_guard lock(future->mutex); if(future->done) { - throw promise_already_satisfied(); + boost::throw_exception(promise_already_satisfied()); } future->mark_finished_with_result_internal(); } @@ -1132,7 +1134,7 @@ namespace boost boost::lock_guard lock(future->mutex); if(future->done) { - throw promise_already_satisfied(); + boost::throw_exception(promise_already_satisfied()); } future->mark_exceptional_finish_internal(p); } @@ -1164,7 +1166,7 @@ namespace boost boost::lock_guard lk(this->mutex); if(started) { - throw task_already_started(); + boost::throw_exception(task_already_started()); } started=true; } @@ -1283,7 +1285,7 @@ namespace boost } // assignment -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES packaged_task(packaged_task&& other): future_obtained(other.future_obtained) { @@ -1326,7 +1328,7 @@ namespace boost { if(!task) { - throw task_moved(); + boost::throw_exception(task_moved()); } else if(!future_obtained) { @@ -1335,7 +1337,7 @@ namespace boost } else { - throw future_already_retrieved(); + boost::throw_exception(future_already_retrieved()); } } @@ -1345,7 +1347,7 @@ namespace boost { if(!task) { - throw task_moved(); + boost::throw_exception(task_moved()); } task->run(); } diff --git a/deal.II/contrib/boost/include/boost/thread/locks.hpp b/deal.II/contrib/boost/include/boost/thread/locks.hpp index 82394a595c..3cd6f28216 100644 --- a/deal.II/contrib/boost/include/boost/thread/locks.hpp +++ b/deal.II/contrib/boost/include/boost/thread/locks.hpp @@ -248,7 +248,7 @@ namespace boost { timed_lock(target_time); } -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES unique_lock(unique_lock&& other): m(other.m),is_locked(other.is_locked) { @@ -321,17 +321,17 @@ namespace boost swap(temp); return *this; } - void swap(unique_lock& other) - { - std::swap(m,other.m); - std::swap(is_locked,other.is_locked); - } void swap(detail::thread_move_t > other) { std::swap(m,other->m); std::swap(is_locked,other->is_locked); } #endif + void swap(unique_lock& other) + { + std::swap(m,other.m); + std::swap(is_locked,other.is_locked); + } ~unique_lock() { @@ -344,7 +344,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->lock(); is_locked=true; @@ -353,7 +353,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->try_lock(); return is_locked; @@ -379,7 +379,7 @@ namespace boost { if(!owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->unlock(); is_locked=false; @@ -416,25 +416,30 @@ namespace boost friend class upgrade_lock; }; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template void swap(unique_lock&& lhs,unique_lock&& rhs) { lhs.swap(rhs); } -#else +#endif template void swap(unique_lock& lhs,unique_lock& rhs) { lhs.swap(rhs); } -#endif -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template inline unique_lock&& move(unique_lock&& ul) { - return ul; + return static_cast&&>(ul); + } + + template + inline unique_lock&& move(unique_lock& ul) + { + return static_cast&&>(ul); } #endif @@ -535,24 +540,24 @@ namespace boost return *this; } -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES void swap(shared_lock&& other) { std::swap(m,other.m); std::swap(is_locked,other.is_locked); } #else - void swap(shared_lock& other) - { - std::swap(m,other.m); - std::swap(is_locked,other.is_locked); - } void swap(boost::detail::thread_move_t > other) { std::swap(m,other->m); std::swap(is_locked,other->is_locked); } #endif + void swap(shared_lock& other) + { + std::swap(m,other.m); + std::swap(is_locked,other.is_locked); + } Mutex* mutex() const { @@ -570,7 +575,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->lock_shared(); is_locked=true; @@ -579,7 +584,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->try_lock_shared(); return is_locked; @@ -588,7 +593,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->timed_lock_shared(target_time); return is_locked; @@ -598,7 +603,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->timed_lock_shared(target_time); return is_locked; @@ -607,7 +612,7 @@ namespace boost { if(!owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->unlock_shared(); is_locked=false; @@ -629,7 +634,7 @@ namespace boost }; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template void swap(shared_lock&& lhs,shared_lock&& rhs) { @@ -733,7 +738,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->lock_upgrade(); is_locked=true; @@ -742,7 +747,7 @@ namespace boost { if(owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } is_locked=m->try_lock_upgrade(); return is_locked; @@ -751,7 +756,7 @@ namespace boost { if(!owns_lock()) { - throw boost::lock_error(); + boost::throw_exception(boost::lock_error()); } m->unlock_upgrade(); is_locked=false; @@ -775,7 +780,7 @@ namespace boost }; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template unique_lock::unique_lock(upgrade_lock&& other): m(other.m),is_locked(other.is_locked) @@ -875,7 +880,7 @@ namespace boost try_lock_wrapper(Mutex& m_,try_to_lock_t): base(m_,try_to_lock) {} -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES try_lock_wrapper(try_lock_wrapper&& other): base(other.move()) {} @@ -963,7 +968,7 @@ namespace boost } }; -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template void swap(try_lock_wrapper&& lhs,try_lock_wrapper&& rhs) { diff --git a/deal.II/contrib/boost/include/boost/thread/pthread/condition_variable.hpp b/deal.II/contrib/boost/include/boost/thread/pthread/condition_variable.hpp index 8ec6ae7fcf..8e8f5b5a27 100644 --- a/deal.II/contrib/boost/include/boost/thread/pthread/condition_variable.hpp +++ b/deal.II/contrib/boost/include/boost/thread/pthread/condition_variable.hpp @@ -57,13 +57,13 @@ namespace boost int const res=pthread_mutex_init(&internal_mutex,NULL); if(res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } int const res2=pthread_cond_init(&cond,NULL); if(res2) { BOOST_VERIFY(!pthread_mutex_destroy(&internal_mutex)); - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } } ~condition_variable_any() @@ -87,7 +87,7 @@ namespace boost } if(res) { - throw condition_error(); + boost::throw_exception(condition_error()); } } @@ -117,7 +117,7 @@ namespace boost } if(res) { - throw condition_error(); + boost::throw_exception(condition_error()); } return true; } diff --git a/deal.II/contrib/boost/include/boost/thread/pthread/condition_variable_fwd.hpp b/deal.II/contrib/boost/include/boost/thread/pthread/condition_variable_fwd.hpp index 4048cdfb2d..59908f42ff 100644 --- a/deal.II/contrib/boost/include/boost/thread/pthread/condition_variable_fwd.hpp +++ b/deal.II/contrib/boost/include/boost/thread/pthread/condition_variable_fwd.hpp @@ -6,6 +6,7 @@ // (C) Copyright 2007-8 Anthony Williams #include +#include #include #include #include @@ -30,7 +31,7 @@ namespace boost int const res=pthread_cond_init(&cond,NULL); if(res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } } ~condition_variable() diff --git a/deal.II/contrib/boost/include/boost/thread/pthread/mutex.hpp b/deal.II/contrib/boost/include/boost/thread/pthread/mutex.hpp index 51d62ae546..1f7f790da8 100644 --- a/deal.II/contrib/boost/include/boost/thread/pthread/mutex.hpp +++ b/deal.II/contrib/boost/include/boost/thread/pthread/mutex.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -37,7 +38,7 @@ namespace boost int const res=pthread_mutex_init(&m,NULL); if(res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } } ~mutex() @@ -89,14 +90,14 @@ namespace boost int const res=pthread_mutex_init(&m,NULL); if(res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } #ifndef BOOST_PTHREAD_HAS_TIMEDLOCK int const res2=pthread_cond_init(&cond,NULL); if(res2) { BOOST_VERIFY(!pthread_mutex_destroy(&m)); - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } is_locked=false; #endif diff --git a/deal.II/contrib/boost/include/boost/thread/pthread/once.hpp b/deal.II/contrib/boost/include/boost/thread/pthread/once.hpp index f278a578f4..6321aa2f02 100644 --- a/deal.II/contrib/boost/include/boost/thread/pthread/once.hpp +++ b/deal.II/contrib/boost/include/boost/thread/pthread/once.hpp @@ -10,6 +10,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include @@ -58,10 +59,13 @@ namespace boost if(flag.epoch==uninitialized_flag) { flag.epoch=being_initialized; +#ifndef BOOST_NO_EXCEPTIONS try { +#endif pthread::pthread_mutex_scoped_unlock relocker(&detail::once_epoch_mutex); f(); +#ifndef BOOST_NO_EXCEPTIONS } catch(...) { @@ -69,6 +73,7 @@ namespace boost BOOST_VERIFY(!pthread_cond_broadcast(&detail::once_epoch_cv)); throw; } +#endif flag.epoch=--detail::once_global_epoch; BOOST_VERIFY(!pthread_cond_broadcast(&detail::once_epoch_cv)); } diff --git a/deal.II/contrib/boost/include/boost/thread/pthread/recursive_mutex.hpp b/deal.II/contrib/boost/include/boost/thread/pthread/recursive_mutex.hpp index f3f7bf1dda..ad3b7e1530 100644 --- a/deal.II/contrib/boost/include/boost/thread/pthread/recursive_mutex.hpp +++ b/deal.II/contrib/boost/include/boost/thread/pthread/recursive_mutex.hpp @@ -7,6 +7,7 @@ #include #include +#include #include #include #include @@ -42,18 +43,18 @@ namespace boost int const init_attr_res=pthread_mutexattr_init(&attr); if(init_attr_res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } int const set_attr_res=pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); if(set_attr_res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } int const res=pthread_mutex_init(&m,&attr); if(res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } BOOST_VERIFY(!pthread_mutexattr_destroy(&attr)); } @@ -111,32 +112,32 @@ namespace boost int const init_attr_res=pthread_mutexattr_init(&attr); if(init_attr_res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } int const set_attr_res=pthread_mutexattr_settype(&attr,PTHREAD_MUTEX_RECURSIVE); if(set_attr_res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } int const res=pthread_mutex_init(&m,&attr); if(res) { BOOST_VERIFY(!pthread_mutexattr_destroy(&attr)); - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } BOOST_VERIFY(!pthread_mutexattr_destroy(&attr)); #else int const res=pthread_mutex_init(&m,NULL); if(res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } int const res2=pthread_cond_init(&cond,NULL); if(res2) { BOOST_VERIFY(!pthread_mutex_destroy(&m)); - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } is_locked=false; count=0; diff --git a/deal.II/contrib/boost/include/boost/thread/pthread/thread_heap_alloc.hpp b/deal.II/contrib/boost/include/boost/thread/pthread/thread_heap_alloc.hpp index 7cc0aa0476..737c29858b 100644 --- a/deal.II/contrib/boost/include/boost/thread/pthread/thread_heap_alloc.hpp +++ b/deal.II/contrib/boost/include/boost/thread/pthread/thread_heap_alloc.hpp @@ -17,7 +17,7 @@ namespace boost return new T(); } -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template inline T* heap_new(A1&& a1) { diff --git a/deal.II/contrib/boost/include/boost/thread/win32/basic_timed_mutex.hpp b/deal.II/contrib/boost/include/boost/thread/win32/basic_timed_mutex.hpp index 751bdbdacc..7c6797d14f 100644 --- a/deal.II/contrib/boost/include/boost/thread/win32/basic_timed_mutex.hpp +++ b/deal.II/contrib/boost/include/boost/thread/win32/basic_timed_mutex.hpp @@ -61,15 +61,30 @@ namespace boost void lock() { - BOOST_VERIFY(timed_lock(::boost::detail::get_system_time_sentinel())); - } - bool timed_lock(::boost::system_time const& wait_until) - { - if(!win32::interlocked_bit_test_and_set(&active_count,lock_flag_bit)) + if(try_lock()) { - return true; + return; } long old_count=active_count; + mark_waiting_and_try_lock(old_count); + + if(old_count&lock_flag_value) + { + bool lock_acquired=false; + void* const sem=get_event(); + + do + { + BOOST_VERIFY(win32::WaitForSingleObject( + sem,::boost::detail::win32::infinite)==0); + clear_waiting_and_try_lock(old_count); + lock_acquired=!(old_count&lock_flag_value); + } + while(!lock_acquired); + } + } + void mark_waiting_and_try_lock(long& old_count) + { for(;;) { long const new_count=(old_count&lock_flag_value)?(old_count+1):(old_count|lock_flag_value); @@ -80,6 +95,33 @@ namespace boost } old_count=current; } + } + + void clear_waiting_and_try_lock(long& old_count) + { + old_count&=~lock_flag_value; + old_count|=event_set_flag_value; + for(;;) + { + long const new_count=((old_count&lock_flag_value)?old_count:((old_count-1)|lock_flag_value))&~event_set_flag_value; + long const current=BOOST_INTERLOCKED_COMPARE_EXCHANGE(&active_count,new_count,old_count); + if(current==old_count) + { + break; + } + old_count=current; + } + } + + + bool timed_lock(::boost::system_time const& wait_until) + { + if(try_lock()) + { + return true; + } + long old_count=active_count; + mark_waiting_and_try_lock(old_count); if(old_count&lock_flag_value) { @@ -93,18 +135,7 @@ namespace boost BOOST_INTERLOCKED_DECREMENT(&active_count); return false; } - old_count&=~lock_flag_value; - old_count|=event_set_flag_value; - for(;;) - { - long const new_count=((old_count&lock_flag_value)?old_count:((old_count-1)|lock_flag_value))&~event_set_flag_value; - long const current=BOOST_INTERLOCKED_COMPARE_EXCHANGE(&active_count,new_count,old_count); - if(current==old_count) - { - break; - } - old_count=current; - } + clear_waiting_and_try_lock(old_count); lock_acquired=!(old_count&lock_flag_value); } while(!lock_acquired); diff --git a/deal.II/contrib/boost/include/boost/thread/win32/once.hpp b/deal.II/contrib/boost/include/boost/thread/win32/once.hpp index a6fcc94dc8..c25f9ab386 100644 --- a/deal.II/contrib/boost/include/boost/thread/win32/once.hpp +++ b/deal.II/contrib/boost/include/boost/thread/win32/once.hpp @@ -30,81 +30,47 @@ namespace std namespace boost { - typedef long once_flag; - -#define BOOST_ONCE_INIT 0 - - namespace detail + struct once_flag { - struct win32_mutex_scoped_lock - { - void* const mutex_handle; - explicit win32_mutex_scoped_lock(void* mutex_handle_): - mutex_handle(mutex_handle_) - { - BOOST_VERIFY(!win32::WaitForSingleObject(mutex_handle,win32::infinite)); - } - ~win32_mutex_scoped_lock() - { - BOOST_VERIFY(win32::ReleaseMutex(mutex_handle)!=0); - } - private: - void operator=(win32_mutex_scoped_lock&); - }; + long status; + long count; + long throw_count; + void* event_handle; -#ifdef BOOST_NO_ANSI_APIS - template - void int_to_string(I p, wchar_t* buf) + ~once_flag() { - for(unsigned i=0; i < sizeof(I)*2; ++i,++buf) + if(count) { - *buf = L'A' + static_cast((p >> (i*4)) & 0x0f); + BOOST_ASSERT(count==throw_count); } - *buf = 0; - } -#else - template - void int_to_string(I p, char* buf) - { - for(unsigned i=0; i < sizeof(I)*2; ++i,++buf) + + void* const old_event=BOOST_INTERLOCKED_EXCHANGE_POINTER(&event_handle,0); + if(old_event) { - *buf = 'A' + static_cast((p >> (i*4)) & 0x0f); + ::boost::detail::win32::CloseHandle(old_event); } - *buf = 0; } -#endif + }; + +#define BOOST_ONCE_INIT {0,0,0,0} - // create a named mutex. It doesn't really matter what this name is - // as long as it is unique both to this process, and to the address of "flag": - inline void* create_once_mutex(void* flag_address) + namespace detail + { + inline void* allocate_event_handle(void*& handle) { - -#ifdef BOOST_NO_ANSI_APIS - typedef wchar_t char_type; - static const char_type fixed_mutex_name[]=L"{C15730E2-145C-4c5e-B005-3BC753F42475}-once-flag"; -#else - typedef char char_type; - static const char_type fixed_mutex_name[]="{C15730E2-145C-4c5e-B005-3BC753F42475}-once-flag"; -#endif - unsigned const once_mutex_name_fixed_buffer_size=sizeof(fixed_mutex_name)/sizeof(char_type); - unsigned const once_mutex_name_fixed_length=once_mutex_name_fixed_buffer_size-1; - unsigned const once_mutex_name_length=once_mutex_name_fixed_buffer_size+sizeof(void*)*2+sizeof(unsigned long)*2; - char_type mutex_name[once_mutex_name_length]; + void* const new_handle=::boost::detail::win32::create_anonymous_event( + ::boost::detail::win32::manual_reset_event, + ::boost::detail::win32::event_initially_reset); - std::memcpy(mutex_name,fixed_mutex_name,sizeof(fixed_mutex_name)); - - BOOST_STATIC_ASSERT(sizeof(void*) == sizeof(std::ptrdiff_t)); - detail::int_to_string(reinterpret_cast(flag_address), mutex_name + once_mutex_name_fixed_length); - detail::int_to_string(win32::GetCurrentProcessId(), mutex_name + once_mutex_name_fixed_length + sizeof(void*)*2); - -#ifdef BOOST_NO_ANSI_APIS - return win32::CreateMutexW(0, 0, mutex_name); -#else - return win32::CreateMutexA(0, 0, mutex_name); -#endif + void* event_handle=BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(&handle, + new_handle,0); + if(event_handle) + { + ::boost::detail::win32::CloseHandle(new_handle); + return event_handle; + } + return new_handle; } - - } @@ -114,18 +80,98 @@ namespace boost // Try for a quick win: if the procedure has already been called // just skip through: long const function_complete_flag_value=0xc15730e2; + long const running_value=0x7f0725e3; + long status; + bool counted=false; + void* event_handle=0; + long throw_count=0; + + while((status=::boost::detail::interlocked_read_acquire(&flag.status)) + !=function_complete_flag_value) + { + status=BOOST_INTERLOCKED_COMPARE_EXCHANGE(&flag.status,running_value,0); + if(!status) + { + try + { + if(!event_handle) + { + event_handle=::boost::detail::interlocked_read_acquire(&flag.event_handle); + } + if(event_handle) + { + ::boost::detail::win32::ResetEvent(event_handle); + } + f(); + if(!counted) + { + BOOST_INTERLOCKED_INCREMENT(&flag.count); + counted=true; + } + BOOST_INTERLOCKED_EXCHANGE(&flag.status,function_complete_flag_value); + if(!event_handle && + (::boost::detail::interlocked_read_acquire(&flag.count)>1)) + { + event_handle=::boost::detail::allocate_event_handle(flag.event_handle); + } + if(event_handle) + { + ::boost::detail::win32::SetEvent(event_handle); + } + throw_count=::boost::detail::interlocked_read_acquire(&flag.throw_count); + break; + } + catch(...) + { + if(counted) + { + BOOST_INTERLOCKED_INCREMENT(&flag.throw_count); + } + BOOST_INTERLOCKED_EXCHANGE(&flag.status,0); + if(!event_handle) + { + event_handle=::boost::detail::interlocked_read_acquire(&flag.event_handle); + } + if(event_handle) + { + ::boost::detail::win32::SetEvent(event_handle); + } + throw; + } + } - if(::boost::detail::interlocked_read_acquire(&flag)!=function_complete_flag_value) + if(!counted) + { + BOOST_INTERLOCKED_INCREMENT(&flag.count); + counted=true; + status=::boost::detail::interlocked_read_acquire(&flag.status); + if(status==function_complete_flag_value) + { + break; + } + event_handle=::boost::detail::interlocked_read_acquire(&flag.event_handle); + if(!event_handle) + { + event_handle=::boost::detail::allocate_event_handle(flag.event_handle); + continue; + } + } + BOOST_VERIFY(!::boost::detail::win32::WaitForSingleObject( + event_handle,::boost::detail::win32::infinite)); + } + if(counted || throw_count) { - void* const mutex_handle(::boost::detail::create_once_mutex(&flag)); - BOOST_ASSERT(mutex_handle); - detail::win32::handle_manager const closer(mutex_handle); - detail::win32_mutex_scoped_lock const lock(mutex_handle); - - if(flag!=function_complete_flag_value) + if(!BOOST_INTERLOCKED_EXCHANGE_ADD(&flag.count,(counted?-1:0)-throw_count)) { - f(); - BOOST_INTERLOCKED_EXCHANGE(&flag,function_complete_flag_value); + if(!event_handle) + { + event_handle=::boost::detail::interlocked_read_acquire(&flag.event_handle); + } + if(event_handle) + { + BOOST_INTERLOCKED_EXCHANGE_POINTER(&flag.event_handle,0); + ::boost::detail::win32::CloseHandle(event_handle); + } } } } diff --git a/deal.II/contrib/boost/include/boost/thread/win32/thread_heap_alloc.hpp b/deal.II/contrib/boost/include/boost/thread/win32/thread_heap_alloc.hpp index 9f8186f55c..b70623aaa9 100644 --- a/deal.II/contrib/boost/include/boost/thread/win32/thread_heap_alloc.hpp +++ b/deal.II/contrib/boost/include/boost/thread/win32/thread_heap_alloc.hpp @@ -8,6 +8,7 @@ #include "thread_primitives.hpp" #include #include +#include #if defined( BOOST_USE_WINDOWS_H ) # include @@ -60,7 +61,7 @@ namespace boost void* const heap_memory=detail::win32::HeapAlloc(detail::win32::GetProcessHeap(),0,size); if(!heap_memory) { - throw std::bad_alloc(); + boost::throw_exception(std::bad_alloc()); } return heap_memory; } @@ -86,7 +87,7 @@ namespace boost } } -#ifdef BOOST_HAS_RVALUE_REFS +#ifndef BOOST_NO_RVALUE_REFERENCES template inline T* heap_new(A1&& a1) { diff --git a/deal.II/contrib/boost/include/boost/thread/win32/thread_primitives.hpp b/deal.II/contrib/boost/include/boost/thread/win32/thread_primitives.hpp index 67a1bc3cb2..2359c38e1a 100644 --- a/deal.II/contrib/boost/include/boost/thread/win32/thread_primitives.hpp +++ b/deal.II/contrib/boost/include/boost/thread/win32/thread_primitives.hpp @@ -11,6 +11,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include +#include #include #include #include @@ -177,7 +178,7 @@ namespace boost #endif if(!res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } return res; } @@ -191,7 +192,7 @@ namespace boost #endif if(!res) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } return res; } @@ -204,7 +205,7 @@ namespace boost bool const success=DuplicateHandle(current_process,source,current_process,&new_handle,0,false,same_access_flag)!=0; if(!success) { - throw thread_resource_error(); + boost::throw_exception(thread_resource_error()); } return new_handle; } diff --git a/deal.II/contrib/boost/include/boost/throw_exception.hpp b/deal.II/contrib/boost/include/boost/throw_exception.hpp index a5a5f9ea0b..1d018c531b 100644 --- a/deal.II/contrib/boost/include/boost/throw_exception.hpp +++ b/deal.II/contrib/boost/include/boost/throw_exception.hpp @@ -22,6 +22,7 @@ #include #include +#include #include #if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) ) @@ -35,16 +36,32 @@ #if !defined( BOOST_EXCEPTION_DISABLE ) # include # include -# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\ - ::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\ - ::boost::throw_file(__FILE__) <<\ - ::boost::throw_line((int)__LINE__)) +# define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_CURRENT_FUNCTION,__FILE__,__LINE__) #else # define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x) #endif namespace boost { +#if !defined( BOOST_EXCEPTION_DISABLE ) + namespace + exception_detail + { + template + void + throw_exception_( E const & x, char const * current_function, char const * file, int line ) + { + throw_exception( + set_info( + set_info( + set_info( + enable_error_info(x), + throw_function(current_function)), + throw_file(file)), + throw_line(line))); + } + } +#endif #ifdef BOOST_NO_EXCEPTIONS diff --git a/deal.II/contrib/boost/include/boost/type_traits/has_new_operator.hpp b/deal.II/contrib/boost/include/boost/type_traits/has_new_operator.hpp index 6d5351e080..2c2c32228f 100644 --- a/deal.II/contrib/boost/include/boost/type_traits/has_new_operator.hpp +++ b/deal.II/contrib/boost/include/boost/type_traits/has_new_operator.hpp @@ -26,7 +26,7 @@ namespace detail { template struct has_new_operator_impl { template - static type_traits::yes_type check_sig( + static type_traits::yes_type check_sig1( U*, test< void *(*)(std::size_t), @@ -34,7 +34,10 @@ namespace detail { >* = NULL ); template - static type_traits::yes_type check_sig( + static type_traits::no_type check_sig1(...); + + template + static type_traits::yes_type check_sig2( U*, test< void *(*)(std::size_t, const std::nothrow_t&), @@ -42,7 +45,10 @@ namespace detail { >* = NULL ); template - static type_traits::yes_type check_sig( + static type_traits::no_type check_sig2(...); + + template + static type_traits::yes_type check_sig3( U*, test< void *(*)(std::size_t, void*), @@ -50,10 +56,11 @@ namespace detail { >* = NULL ); template - static type_traits::no_type check_sig(...); + static type_traits::no_type check_sig3(...); + template - static type_traits::yes_type check_sig2( + static type_traits::yes_type check_sig4( U*, test< void *(*)(std::size_t), @@ -61,7 +68,10 @@ namespace detail { >* = NULL ); template - static type_traits::yes_type check_sig2( + static type_traits::no_type check_sig4(...); + + template + static type_traits::yes_type check_sig5( U*, test< void *(*)(std::size_t, const std::nothrow_t&), @@ -69,7 +79,10 @@ namespace detail { >* = NULL ); template - static type_traits::yes_type check_sig2( + static type_traits::no_type check_sig5(...); + + template + static type_traits::yes_type check_sig6( U*, test< void *(*)(std::size_t, void*), @@ -77,21 +90,29 @@ namespace detail { >* = NULL ); template - static type_traits::no_type check_sig2(...); + static type_traits::no_type check_sig6(...); // GCC2 won't even parse this template if we embed the computation // of s1 in the computation of value. #ifdef __GNUC__ - BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(has_new_operator_impl::template check_sig(0))); + BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(has_new_operator_impl::template check_sig1(0))); BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(has_new_operator_impl::template check_sig2(0))); + BOOST_STATIC_CONSTANT(unsigned, s3 = sizeof(has_new_operator_impl::template check_sig3(0))); + BOOST_STATIC_CONSTANT(unsigned, s4 = sizeof(has_new_operator_impl::template check_sig4(0))); + BOOST_STATIC_CONSTANT(unsigned, s5 = sizeof(has_new_operator_impl::template check_sig5(0))); + BOOST_STATIC_CONSTANT(unsigned, s6 = sizeof(has_new_operator_impl::template check_sig6(0))); #else #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(push) #pragma warning(disable:6334) #endif - BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig(0))); + BOOST_STATIC_CONSTANT(unsigned, s1 = sizeof(check_sig1(0))); BOOST_STATIC_CONSTANT(unsigned, s2 = sizeof(check_sig2(0))); + BOOST_STATIC_CONSTANT(unsigned, s3 = sizeof(check_sig3(0))); + BOOST_STATIC_CONSTANT(unsigned, s4 = sizeof(check_sig4(0))); + BOOST_STATIC_CONSTANT(unsigned, s5 = sizeof(check_sig5(0))); + BOOST_STATIC_CONSTANT(unsigned, s6 = sizeof(check_sig6(0))); #if BOOST_WORKAROUND(BOOST_MSVC_FULL_VER, >= 140050000) #pragma warning(pop) @@ -100,7 +121,11 @@ namespace detail { BOOST_STATIC_CONSTANT(bool, value = (::boost::type_traits::ice_or< (s1 == sizeof(type_traits::yes_type)), - (s2 == sizeof(type_traits::yes_type)) + (s2 == sizeof(type_traits::yes_type)), + (s3 == sizeof(type_traits::yes_type)), + (s4 == sizeof(type_traits::yes_type)), + (s5 == sizeof(type_traits::yes_type)), + (s6 == sizeof(type_traits::yes_type)) >::value) ); }; diff --git a/deal.II/contrib/boost/include/boost/type_traits/intrinsics.hpp b/deal.II/contrib/boost/include/boost/type_traits/intrinsics.hpp index 74b64a7d43..8f88036e20 100644 --- a/deal.II/contrib/boost/include/boost/type_traits/intrinsics.hpp +++ b/deal.II/contrib/boost/include/boost/type_traits/intrinsics.hpp @@ -149,7 +149,7 @@ # define BOOST_IS_CLASS(T) __is_class(T) # define BOOST_IS_ENUM(T) __is_enum(T) # define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) -# if !defined(unix) || defined(__LP64__) +# if (!defined(unix) && !defined(__unix__)) || defined(__LP64__) // GCC sometimes lies about alignment requirements // of type double on 32-bit unix platforms, use the // old implementation instead in that case: diff --git a/deal.II/contrib/boost/include/boost/type_traits/is_empty.hpp b/deal.II/contrib/boost/include/boost/type_traits/is_empty.hpp index c8eb7912da..45c4e9e1ee 100644 --- a/deal.II/contrib/boost/include/boost/type_traits/is_empty.hpp +++ b/deal.II/contrib/boost/include/boost/type_traits/is_empty.hpp @@ -36,6 +36,12 @@ namespace boost { namespace detail { #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +#ifdef BOOST_MSVC +#pragma warning(push) +#pragma warning(disable:4624) // destructor could not be generated +#endif + template struct empty_helper_t1 : public T { @@ -47,6 +53,10 @@ private: empty_helper_t1& operator=(const empty_helper_t1&); }; +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif + struct empty_helper_t2 { int i[256]; }; #if !BOOST_WORKAROUND(__BORLANDC__, < 0x600) diff --git a/deal.II/contrib/boost/include/boost/type_traits/is_signed.hpp b/deal.II/contrib/boost/include/boost/type_traits/is_signed.hpp index e06b47cc85..bf7bbfdb76 100644 --- a/deal.II/contrib/boost/include/boost/type_traits/is_signed.hpp +++ b/deal.II/contrib/boost/include/boost/type_traits/is_signed.hpp @@ -26,11 +26,19 @@ namespace detail{ #if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) +template +struct is_signed_values +{ + typedef typename remove_cv::type no_cv_t; + BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast(-1))); + BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast(0))); +}; + template struct is_signed_helper { typedef typename remove_cv::type no_cv_t; - BOOST_STATIC_CONSTANT(bool, value = (!(static_cast(-1) > 0))); + BOOST_STATIC_CONSTANT(bool, value = (!(::boost::detail::is_signed_values::minus_one > boost::detail::is_signed_values::zero))); }; template diff --git a/deal.II/contrib/boost/include/boost/type_traits/is_unsigned.hpp b/deal.II/contrib/boost/include/boost/type_traits/is_unsigned.hpp index 486648692f..98baf4e94e 100644 --- a/deal.II/contrib/boost/include/boost/type_traits/is_unsigned.hpp +++ b/deal.II/contrib/boost/include/boost/type_traits/is_unsigned.hpp @@ -27,10 +27,17 @@ namespace detail{ #if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) template -struct is_ununsigned_helper +struct is_unsigned_values { typedef typename remove_cv::type no_cv_t; - BOOST_STATIC_CONSTANT(bool, value = (static_cast(-1) > 0)); + BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast(-1))); + BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast(0))); +}; + +template +struct is_ununsigned_helper +{ + BOOST_STATIC_CONSTANT(bool, value = (::boost::detail::is_unsigned_values::minus_one > ::boost::detail::is_unsigned_values::zero)); }; template diff --git a/deal.II/contrib/boost/include/boost/units/absolute.hpp b/deal.II/contrib/boost/include/boost/units/absolute.hpp new file mode 100644 index 0000000000..9f360196c5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/absolute.hpp @@ -0,0 +1,147 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ABSOLUTE_HPP +#define BOOST_UNITS_ABSOLUTE_HPP + +#include + +#include + +namespace boost { + +namespace units { + +/// A wrapper to represent absolute units (points rather than vectors). Intended +/// originally for temperatures, this class implements operators for absolute units +/// so that addition of a relative unit to an absolute unit results in another +/// absolute unit : absolute +/- T -> absolute and subtraction of one absolute +/// unit from another results in a relative unit : absolute - absolute -> T +template +class absolute +{ + public: + typedef absolute this_type; + typedef Y value_type; + + absolute() : val_() { } + absolute(const value_type& val) : val_(val) { } + absolute(const this_type& source) : val_(source.val_) { } + + this_type& operator=(const this_type& source) { val_ = source.val_; return *this; } + + const value_type& value() const { return val_; } + + const this_type& operator+=(const value_type& val) { val_ += val; return *this; } + const this_type& operator-=(const value_type& val) { val_ -= val; return *this; } + + private: + value_type val_; +}; + +/// add a relative value to an absolute one +template +absolute operator+(const absolute& aval,const Y& rval) +{ + return absolute(aval.value()+rval); +} + +/// add a relative value to an absolute one +template +absolute operator+(const Y& rval,const absolute& aval) +{ + return absolute(aval.value()+rval); +} + +/// subtract a relative value from an absolute one +template +absolute operator-(const absolute& aval,const Y& rval) +{ + return absolute(aval.value()-rval); +} + +/// subtracting two absolutes gives a difference +template +Y operator-(const absolute& aval1,const absolute& aval2) +{ + return Y(aval1.value()-aval2.value()); +} + +/// creates a quantity from an absolute unit and a raw value +template +quantity >, T> operator*(const T& t, const absolute >&) +{ + return(quantity >, T>::from_value(t)); +} + +/// creates a quantity from an absolute unit and a raw value +template +quantity >, T> operator*(const absolute >&, const T& t) +{ + return(quantity >, T>::from_value(t)); +} + +/// Print an absolute unit +template +std::basic_ostream& operator<<(std::basic_ostream& os,const absolute& aval) +{ + + os << "absolute " << aval.value(); + + return os; +} + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::absolute, (class)) + +#endif + +namespace boost { + +namespace units { + +/// Macro to define the offset between two absolute units. +/// Requires the value to be in the destination units e.g +/// @code +/// BOOST_UNITS_DEFINE_CONVERSION_OFFSET(celsius_base_unit, fahrenheit_base_unit, double, 32.0); +/// @endcode +/// @c BOOST_UNITS_DEFINE_CONVERSION_FACTOR is also necessary to +/// specify the conversion factor. Like @c BOOST_UNITS_DEFINE_CONVERSION_FACTOR +/// this macro defines both forward and reverse conversions so +/// defining, e.g., the conversion from celsius to fahrenheit as above will also +/// define the inverse conversion from fahrenheit to celsius. +#define BOOST_UNITS_DEFINE_CONVERSION_OFFSET(From, To, type_, value_) \ + namespace boost { \ + namespace units { \ + template<> \ + struct affine_conversion_helper< \ + reduce_unit::type, \ + reduce_unit::type> \ + { \ + static const bool is_defined = true; \ + typedef type_ type; \ + static type value() { return(value_); } \ + }; \ + } \ + } \ + void boost_units_require_semicolon() + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ABSOLUTE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_dimension.hpp b/deal.II/contrib/boost/include/boost/units/base_dimension.hpp new file mode 100644 index 0000000000..57b4d27153 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_dimension.hpp @@ -0,0 +1,93 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_DIMENSION_HPP +#define BOOST_UNITS_BASE_DIMENSION_HPP + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// This must be in namespace boost::units so that ADL +/// will work with friend functions defined inline. +/// INTERNAL ONLY +template struct base_dimension_ordinal { }; + +/// INTERNAL ONLY +template struct base_dimension_pair { }; + +/// INTERNAL ONLY +template +struct check_base_dimension { + enum { + value = + sizeof(boost_units_is_registered(units::base_dimension_ordinal())) == sizeof(detail::yes) && + sizeof(boost_units_is_registered(units::base_dimension_pair())) != sizeof(detail::yes) + }; +}; + +/// Defines a base dimension. To define a dimension you need to provide +/// the derived class (CRTP) and a unique integer. +/// @code +/// struct my_dimension : boost::units::base_dimension {}; +/// @endcode +/// It is designed so that you will get an error message if you try +/// to use the same value in multiple definitions. +template::value + >::type +#endif +> +class base_dimension : + public ordinal +{ + public: + /// INTERNAL ONLY + typedef base_dimension this_type; + /// A convenience typedef. Equivalent to boost::units::derived_dimension::type. +#ifndef BOOST_UNITS_DOXYGEN + typedef list >, dimensionless_type> dimension_type; +#else + typedef detail::unspecified dimension_type; +#endif + /// Provided for mpl compatability. + typedef Derived type; + + private: + /// Register this ordinal + /// INTERNAL ONLY + friend detail::yes + boost_units_is_registered(const units::base_dimension_ordinal&) + { detail::yes result; return(result); } + + /// But make sure we can identify the current instantiation! + /// INTERNAL ONLY + friend detail::yes + boost_units_is_registered(const units::base_dimension_pair&) + { detail::yes result; return(result); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_unit.hpp b/deal.II/contrib/boost/include/boost/units/base_unit.hpp new file mode 100644 index 0000000000..975da57618 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_unit.hpp @@ -0,0 +1,114 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNIT_HPP +#define BOOST_UNITS_BASE_UNIT_HPP + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// This must be in namespace boost::units so that ADL +/// will work with friend functions defined inline. +/// Base dimensions and base units are independent. +/// INTERNAL ONLY +template struct base_unit_ordinal { }; + +/// INTERNAL ONLY +template struct base_unit_pair { }; + +/// INTERNAL ONLY +template +struct check_base_unit { + enum { + value = + sizeof(boost_units_unit_is_registered(units::base_unit_ordinal())) == sizeof(detail::yes) && + sizeof(boost_units_unit_is_registered(units::base_unit_pair())) != sizeof(detail::yes) + }; +}; + +/// Defines a base unit. To define a unit you need to provide +/// the derived class (CRTP), a dimension list and a unique integer. +/// @code +/// struct my_unit : boost::units::base_unit {}; +/// @endcode +/// It is designed so that you will get an error message if you try +/// to use the same value in multiple definitions. +template::value + >::type +#endif +> +class base_unit : + public ordinal +{ + public: + /// INTERNAL ONLY + typedef void boost_units_is_base_unit_type; + /// INTERNAL ONLY + typedef base_unit this_type; + /// The dimensions of this base unit. + typedef Dim dimension_type; + + /// Provided for mpl compatability. + typedef Derived type; + + /// The unit corresponding to this base unit. +#ifndef BOOST_UNITS_DOXYGEN + typedef unit< + Dim, + heterogeneous_system< + heterogeneous_system_impl< + list< + heterogeneous_system_dim >, + dimensionless_type + >, + Dim, + no_scale + > + > + > unit_type; +#else + typedef detail::unspecified unit_type; +#endif + + private: + /// Register this ordinal + /// INTERNAL ONLY + friend detail::yes + boost_units_unit_is_registered(const units::base_unit_ordinal&) + { detail::yes result; return(result); } + + /// But make sure we can identify the current instantiation! + /// INTERNAL ONLY + friend detail::yes + boost_units_unit_is_registered(const units::base_unit_pair&) + { detail::yes result; return(result); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/angle/arcminute.hpp b/deal.II/contrib/boost/include/boost/units/base_units/angle/arcminute.hpp new file mode 100644 index 0000000000..86bf5e0fa3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/angle/arcminute.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED +#define BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace angle { + +typedef scaled_base_unit > > arcminute_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("arcminute"); } + static const char* symbol() { return("'"); } +}; + +} +} + +#endif // BOOST_UNIT_BASE_UNITS_ANGLE_ARCMINUTE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/angle/arcsecond.hpp b/deal.II/contrib/boost/include/boost/units/base_units/angle/arcsecond.hpp new file mode 100644 index 0000000000..8baabfa6ec --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/angle/arcsecond.hpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace angle { + +//typedef scaled_base_unit > > arcsecond_base_unit; +typedef scaled_base_unit > > arcsecond_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("arcsecond"); } + static const char* symbol() { return("\""); } +}; + +} +} + +#endif // BOOST_UNIT_SYSTEMS_ANGLE_ARCSECOND_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/angle/degree.hpp b/deal.II/contrib/boost/include/boost/units/base_units/angle/degree.hpp new file mode 100644 index 0000000000..63edb70eef --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/angle/degree.hpp @@ -0,0 +1,27 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP +#define BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(angle,degree,"degree","deg",6.28318530718/360.,boost::units::angle::radian_base_unit,-101); + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::degree_base_unit) + +#endif + +#endif // BOOST_UNITS_ANGLE_DEGREE_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/angle/gradian.hpp b/deal.II/contrib/boost/include/boost/units/base_units/angle/gradian.hpp new file mode 100644 index 0000000000..7b291b4697 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/angle/gradian.hpp @@ -0,0 +1,27 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP +#define BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(angle,gradian,"gradian","grad",6.28318530718/400.,boost::units::angle::radian_base_unit,-102); + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::gradian_base_unit) + +#endif + +#endif // BOOST_UNITS_ANGLE_GRADIAN_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/angle/radian.hpp b/deal.II/contrib/boost/include/boost/units/base_units/angle/radian.hpp new file mode 100644 index 0000000000..f2b56673f4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/angle/radian.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP +#define BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace angle { + +struct radian_base_unit : public base_unit +{ + static std::string name() { return("radian"); } + static std::string symbol() { return("rad"); } +}; + +} // namespace angle + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::radian_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_ANGLE_RADIAN_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/angle/revolution.hpp b/deal.II/contrib/boost/include/boost/units/base_units/angle/revolution.hpp new file mode 100644 index 0000000000..2dd0d5b9bf --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/angle/revolution.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP +#define BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP + +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace angle { + +typedef scaled_base_unit > > revolution_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("revolution"); } + static const char* symbol() { return("rev"); } +}; + +} +} + +#endif // BOOST_UNITS_BASE_UNITS_REVOLUTION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/angle/steradian.hpp b/deal.II/contrib/boost/include/boost/units/base_units/angle/steradian.hpp new file mode 100644 index 0000000000..5e8c5bda00 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/angle/steradian.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP +#define BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace angle { + +struct steradian_base_unit : public base_unit +{ + static std::string name() { return("steradian"); } + static std::string symbol() { return("sr"); } +}; + +} // namespace angle + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::angle::steradian_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_ANGLE_STERADIAN_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/astronomical/astronomical_unit.hpp b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/astronomical_unit.hpp new file mode 100644 index 0000000000..4b1640d95f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/astronomical_unit.hpp @@ -0,0 +1,27 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, astronomical_unit, "astronomical unit", "a.u.", 149597870691.0, boost::units::si::meter_base_unit, -207); + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::astronomical_unit_base_unit) + +#endif + +#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_ASTRONOMICAL_UNIT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_day.hpp b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_day.hpp new file mode 100644 index 0000000000..2d045ff2e1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_day.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace astronomical { + +typedef scaled_base_unit > > light_day_base_unit; + +} // namespace astronomical + +template<> +struct base_unit_info { + static const char* name() { return("light day"); } + static const char* symbol() { return("ldy"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_DAY_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_hour.hpp b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_hour.hpp new file mode 100644 index 0000000000..207d951a46 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_hour.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace astronomical { + +typedef scaled_base_unit > > light_hour_base_unit; + +} // namespace astronomical + +template<> +struct base_unit_info { + static const char* name() { return("light hour"); } + static const char* symbol() { return("lhr"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_HOUR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_minute.hpp b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_minute.hpp new file mode 100644 index 0000000000..f0bd095636 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_minute.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace astronomical { + +typedef scaled_base_unit > > light_minute_base_unit; + +} // namespace astronomical + +template<> +struct base_unit_info { + static const char* name() { return("light minute"); } + static const char* symbol() { return("lmn"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_MINUTE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_second.hpp b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_second.hpp new file mode 100644 index 0000000000..555a315fb4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_second.hpp @@ -0,0 +1,27 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, light_second, "light second", "lsc", 2.99792458e8, boost::units::si::meter_base_unit, -201); + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::light_second_base_unit) + +#endif + +#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_SECOND_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_year.hpp b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_year.hpp new file mode 100644 index 0000000000..e9e83a3acb --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/light_year.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace astronomical { + +typedef scaled_base_unit > > light_year_base_unit; + +} // namespace astronomical + +template<> +struct base_unit_info { + static const char* name() { return("light year"); } + static const char* symbol() { return("ly"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_LIGHT_YEAR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/astronomical/parsec.hpp b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/parsec.hpp new file mode 100644 index 0000000000..dd116e555c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/astronomical/parsec.hpp @@ -0,0 +1,27 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(astronomical, parsec, "parsec", "psc", 3.0856775813e16, boost::units::si::meter_base_unit, -206); + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::astronomical::parsec_base_unit) + +#endif + +#endif // BOOST_UNIT_SYSTEMS_ASTRONOMICAL_PARSEC_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/cgs/biot.hpp b/deal.II/contrib/boost/include/boost/units/base_units/cgs/biot.hpp new file mode 100644 index 0000000000..51eb5fc7bf --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/cgs/biot.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP +#define BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef scaled_base_unit > > biot_base_unit; + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_BIOT_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/cgs/centimeter.hpp b/deal.II/contrib/boost/include/boost/units/base_units/cgs/centimeter.hpp new file mode 100644 index 0000000000..1ff712ed25 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/cgs/centimeter.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP +#define BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef scaled_base_unit > > centimeter_base_unit; + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CENTIMETER_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/cgs/gram.hpp b/deal.II/contrib/boost/include/boost/units/base_units/cgs/gram.hpp new file mode 100644 index 0000000000..1c2cc18b97 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/cgs/gram.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP +#define BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP + +#include + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +struct gram_base_unit : public base_unit +{ + static std::string name() { return("gram"); } + static std::string symbol() { return("g"); } +}; + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::cgs::gram_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_CGS_GRAM_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/conversions.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/conversions.hpp new file mode 100644 index 0000000000..54cf6385ea --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/conversions.hpp @@ -0,0 +1,46 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// No include guards. This header is intended to be included +// multiple times. + +// imperial units + +#if 0 + +#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED) &&\ + !defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GALLON_CONVERSION_DEFINED) + #define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GALLON_CONVERSION_DEFINED + #include + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::gallon_base_unit, double, 1./8.); +#endif + +#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED) &&\ + !defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_QUART_CONVERSION_DEFINED) + #define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_QUART_CONVERSION_DEFINED + #include + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::quart_base_unit, double, 1./2.); +#endif + +#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED) &&\ + !defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GILL_CONVERSION_DEFINED) + #define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_GILL_CONVERSION_DEFINED + #include + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::gill_base_unit, double, 4.); +#endif + +#if defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED) && defined(BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED) &&\ + !defined(BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_FLUID_OUNCE_CONVERSION_DEFINED) + #define BOOST_BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_TO_FLUID_OUNCE_CONVERSION_DEFINED + #include + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::imperial::pint_base_unit,boost::units::imperial::fluid_ounce_base_unit, double, 20.); +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/drachm.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/drachm.hpp new file mode 100644 index 0000000000..3dcc024074 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/drachm.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > drachm_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("drachm"); } + static const char* symbol() { return("drachm"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_DRACHM_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/fluid_ounce.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/fluid_ounce.hpp new file mode 100644 index 0000000000..8bab33eb2d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/fluid_ounce.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > fluid_ounce_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("fluid ounce (imp.)"); } + static const char* symbol() { return("fl oz"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_FLUID_OUNCE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/foot.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/foot.hpp new file mode 100644 index 0000000000..149985e867 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/foot.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP +#define BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > foot_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("foot"); } + static const char* symbol() { return("ft"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IMPERIAL_FOOT_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/furlong.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/furlong.hpp new file mode 100644 index 0000000000..1d988214ae --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/furlong.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP +#define BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > furlong_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("furlong"); } + static const char* symbol() { return("furlong"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IMPERIAL_FURLONG_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/gallon.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/gallon.hpp new file mode 100644 index 0000000000..6fd46538ff --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/gallon.hpp @@ -0,0 +1,40 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +//typedef scaled_base_unit > > gallon_base_unit; +typedef scaled_base_unit > > gallon_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("gallon (imp.)"); } + static const char* symbol() { return("gal"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_GALLON_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/gill.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/gill.hpp new file mode 100644 index 0000000000..3e5b83af3e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/gill.hpp @@ -0,0 +1,40 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +//typedef scaled_base_unit > > gill_base_unit; +typedef scaled_base_unit > > gill_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("gill (imp.)"); } + static const char* symbol() { return("gill"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_GILL_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/grain.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/grain.hpp new file mode 100644 index 0000000000..a36b4a4d2e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/grain.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > grain_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("grain"); } + static const char* symbol() { return("grain"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_GRAIN_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/hundredweight.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/hundredweight.hpp new file mode 100644 index 0000000000..6709a788e0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/hundredweight.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > hundredweight_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("hundredweight"); } + static const char* symbol() { return("cwt"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_HUNDREDWEIGHT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/inch.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/inch.hpp new file mode 100644 index 0000000000..048d8c6710 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/inch.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP +#define BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > inch_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("inch"); } + static const char* symbol() { return("in"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IMPERIAL_INCH_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/league.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/league.hpp new file mode 100644 index 0000000000..991e4b6025 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/league.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP +#define BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > league_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("league"); } + static const char* symbol() { return("league"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IMPERIAL_LEAGUE_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/mile.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/mile.hpp new file mode 100644 index 0000000000..d0d0fb5a15 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/mile.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP +#define BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > mile_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("mile"); } + static const char* symbol() { return("mi"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IMPERIAL_MILE_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/ounce.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/ounce.hpp new file mode 100644 index 0000000000..8b9e33afc9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/ounce.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > ounce_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("ounce"); } + static const char* symbol() { return("oz"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_OUNCE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/pint.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/pint.hpp new file mode 100644 index 0000000000..1a1440f9cc --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/pint.hpp @@ -0,0 +1,29 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED + +#include + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pint, "pint (imp.)", "pt", 4.54609e-3/8., si::volume, -303); // exact conversion + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::pint_base_unit) + +#endif + +#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_PINT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/pound.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/pound.hpp new file mode 100644 index 0000000000..c586e6d0d0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/pound.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED + +#include + +#include +#include +#include +#include +#include + +// can't define in terms of kilogram because it is a scaled_base_unit +//BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pound, "pound", "lb", 0.45359237, si::kilogram_base_unit, -302); // exact conversion +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, pound, "pound", "lb", 453.59237, cgs::gram_base_unit, -302); // exact conversion + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::pound_base_unit) + +#endif + +#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_POUND_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/quart.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/quart.hpp new file mode 100644 index 0000000000..723ce0b4a2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/quart.hpp @@ -0,0 +1,40 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +//typedef scaled_base_unit > > quart_base_unit; +typedef scaled_base_unit > > quart_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("quart (imp.)"); } + static const char* symbol() { return("qt"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_IMPERIAL_QUART_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/quarter.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/quarter.hpp new file mode 100644 index 0000000000..30f0594fad --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/quarter.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > quarter_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("quarter"); } + static const char* symbol() { return("quarter"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_QUARTER_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/stone.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/stone.hpp new file mode 100644 index 0000000000..b4ce433838 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/stone.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > stone_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("stone"); } + static const char* symbol() { return("st"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_STONE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/thou.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/thou.hpp new file mode 100644 index 0000000000..eab2ac9e4e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/thou.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP +#define BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > thou_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("thou"); } + static const char* symbol() { return("thou"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IMPERIAL_THOU_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/ton.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/ton.hpp new file mode 100644 index 0000000000..867f14738c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/ton.hpp @@ -0,0 +1,40 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace imperial { + +typedef scaled_base_unit > > ton_base_unit; + +} // namespace imperial + +template<> +struct base_unit_info { + static const char* name() { return("long ton"); } + static const char* symbol() { return("t"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_IMPERIAL_TON_HPP_INCLUDED + diff --git a/deal.II/contrib/boost/include/boost/units/base_units/imperial/yard.hpp b/deal.II/contrib/boost/include/boost/units/base_units/imperial/yard.hpp new file mode 100644 index 0000000000..d15b99d0cf --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/imperial/yard.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP +#define BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP + +#include + +#include +#include +#include +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(imperial, yard, "yard", "yd", 0.9144, si::meter_base_unit, -301); // exact conversion + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::imperial::yard_base_unit) + +#endif + +#endif // BOOST_UNITS_SYSTEMS_IMPERIAL_YARD_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/angstrom.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/angstrom.hpp new file mode 100644 index 0000000000..d2954e3114 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/angstrom.hpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace metric { + +typedef scaled_base_unit > > angstrom_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("angstrom"); } + static const char* symbol() { return("A"); } +}; + +} +} + +#endif // BOOST_UNIT_SYSTEMS_METRIC_ANGSTROM_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/are.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/are.hpp new file mode 100644 index 0000000000..bd697f43ed --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/are.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, are, "are", "a", 1.0e2, si::area, 10); + +#endif // BOOST_UNIT_SYSTEMS_METRIC_ARE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/atmosphere.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/atmosphere.hpp new file mode 100644 index 0000000000..b714e90d9d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/atmosphere.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, atmosphere, "atmosphere", "atm", 1.01325e5, si::pressure, 33); + +#endif // BOOST_UNIT_SYSTEMS_METRIC_ATMOSPHERE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/bar.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/bar.hpp new file mode 100644 index 0000000000..682d54ffec --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/bar.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, bar, "bar", "bar", 1.0e5, si::pressure, 14); + +#endif // BOOST_UNIT_SYSTEMS_METRIC_BAR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/barn.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/barn.hpp new file mode 100644 index 0000000000..ae2b28cab4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/barn.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, barn, "barn", "b", 1.0e-28, si::area, 11); + +#endif // BOOST_UNIT_SYSTEMS_METRIC_BARN_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/day.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/day.hpp new file mode 100644 index 0000000000..f8d83c8af8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/day.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_OTHER_DAY_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_OTHER_DAY_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace metric { + +typedef scaled_base_unit > > day_base_unit; + +} // namespace metric + +template<> +struct base_unit_info { + static const char* name() { return("day"); } + static const char* symbol() { return("d"); } +}; + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/fermi.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/fermi.hpp new file mode 100644 index 0000000000..8732c4ef01 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/fermi.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace metric { + +typedef scaled_base_unit > > fermi_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("fermi"); } + static const char* symbol() { return("fm"); } +}; + +} +} + +#endif // BOOST_UNIT_SYSTEMS_METRIC_FERMI_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/hectare.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/hectare.hpp new file mode 100644 index 0000000000..476b0fc790 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/hectare.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, hectare, "hectare", "ha", 1.0e4, si::area, 12); + +#endif // BOOST_UNIT_SYSTEMS_METRIC_HECTARE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/hour.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/hour.hpp new file mode 100644 index 0000000000..443e250378 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/hour.hpp @@ -0,0 +1,37 @@ + // Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace metric { + +typedef scaled_base_unit > > hour_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("hour"); } + static const char* symbol() { return("h"); } +}; + +} +} + +#endif // BOOST_UNIT_SYSTEMS_METRIC_HOUR_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/knot.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/knot.hpp new file mode 100644 index 0000000000..6b85e6e806 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/knot.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, knot, "knot", "kt", 1852./3600., boost::units::si::velocity, -403); + +#endif // BOOST_UNIT_SYSTEMS_METRIC_KNOT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/liter.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/liter.hpp new file mode 100644 index 0000000000..da901759b7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/liter.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, liter, "liter", "L", 1.0e-3, si::volume, 13); + +#endif // BOOST_UNIT_SYSTEMS_METRIC_LITER_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/micron.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/micron.hpp new file mode 100644 index 0000000000..0965836079 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/micron.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace metric { + +typedef scaled_base_unit > > micron_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("micron"); } + static const char* symbol() { return("u"); } +}; + +} +} + +#endif // BOOST_UNIT_SYSTEMS_METRIC_MICRON_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/minute.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/minute.hpp new file mode 100644 index 0000000000..c2f9e6b397 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/minute.hpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED + +#include +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace metric { + +typedef scaled_base_unit > > minute_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("minute"); } + static const char* symbol() { return("min"); } +}; + +} +} + +#endif // BOOST_UNIT_SYSTEMS_METRIC_MINUTE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/mmHg.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/mmHg.hpp new file mode 100644 index 0000000000..93e3869589 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/mmHg.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, mmHg, "millimeters mercury", "mmHg", 133.322, si::pressure, -404); + +#endif // BOOST_UNIT_SYSTEMS_METRIC_MMHG_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/nautical_mile.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/nautical_mile.hpp new file mode 100644 index 0000000000..d42dd77e4b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/nautical_mile.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { +namespace units { +namespace metric { + +typedef scaled_base_unit > > nautical_mile_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("nautical mile"); } + static const char* symbol() { return("nmi"); } +}; + +} +} + +#endif // BOOST_UNIT_SYSTEMS_METRIC_NAUTICAL_MILE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/ton.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/ton.hpp new file mode 100644 index 0000000000..a842aaab00 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/ton.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED + +#include +#include +#include +#include +#include +//#include + +namespace boost { +namespace units { +namespace metric { + +//typedef scaled_base_unit > > ton_base_unit; +typedef scaled_base_unit > > ton_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("metric ton"); } + static const char* symbol() { return("t"); } +}; + +} +} + +#endif // BOOST_UNIT_SYSTEMS_METRIC_TON_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/torr.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/torr.hpp new file mode 100644 index 0000000000..08fd29a52c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/torr.hpp @@ -0,0 +1,19 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_METRIC_TORR_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_METRIC_TORR_HPP_INCLUDED + +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(metric, torr, "torr", "Torr", 1.01325e5/760.0, si::pressure, -401); + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/base_units/metric/year.hpp b/deal.II/contrib/boost/include/boost/units/base_units/metric/year.hpp new file mode 100644 index 0000000000..e43acd6dd6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/metric/year.hpp @@ -0,0 +1,38 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_OTHER_YEAR_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_OTHER_YEAR_HPP_INCLUDED + +#include +#include +#include +#include + +// Julian year = 365.25 days exactly = 8766 hours exactly + +namespace boost { +namespace units { +namespace metric { + +typedef scaled_base_unit > > year_base_unit; + +} + +template<> +struct base_unit_info { + static const char* name() { return("Julian year"); } + static const char* symbol() { return("yr"); } +}; + +} +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/base_units/si/ampere.hpp b/deal.II/contrib/boost/include/boost/units/base_units/si/ampere.hpp new file mode 100644 index 0000000000..0c21d67d16 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/si/ampere.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP +#define BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +struct ampere_base_unit : public base_unit +{ + static std::string name() { return("ampere"); } + static std::string symbol() { return("A"); } +}; + +} // namespace si + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::ampere_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_SI_AMPERE_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/si/candela.hpp b/deal.II/contrib/boost/include/boost/units/base_units/si/candela.hpp new file mode 100644 index 0000000000..ab7a795e2a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/si/candela.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP +#define BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +struct candela_base_unit : public base_unit +{ + static std::string name() { return("candela"); } + static std::string symbol() { return("cd"); } +}; + +} // namespace si + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::candela_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_SI_CANDELA_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/si/kelvin.hpp b/deal.II/contrib/boost/include/boost/units/base_units/si/kelvin.hpp new file mode 100644 index 0000000000..78fe1dd3cd --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/si/kelvin.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP +#define BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +struct kelvin_base_unit : public base_unit +{ + static std::string name() { return("kelvin"); } + static std::string symbol() { return("K"); } +}; + +} // namespace si + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::kelvin_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/si/kilogram.hpp b/deal.II/contrib/boost/include/boost/units/base_units/si/kilogram.hpp new file mode 100644 index 0000000000..0f8b0a6c71 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/si/kilogram.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP +#define BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef scaled_base_unit > > kilogram_base_unit; + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_KILOGRAM_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/si/meter.hpp b/deal.II/contrib/boost/include/boost/units/base_units/si/meter.hpp new file mode 100644 index 0000000000..3a5fed237d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/si/meter.hpp @@ -0,0 +1,50 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_METER_BASE_UNIT_HPP +#define BOOST_UNITS_SI_METER_BASE_UNIT_HPP + +#include + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +struct meter_base_unit : public base_unit +{ + static std::string name() { return("meter"); } + static std::string symbol() { return("m"); } +}; + +} // namespace si + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::meter_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_SI_METER_BASE_UNIT_HPP + diff --git a/deal.II/contrib/boost/include/boost/units/base_units/si/mole.hpp b/deal.II/contrib/boost/include/boost/units/base_units/si/mole.hpp new file mode 100644 index 0000000000..5b73313e1a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/si/mole.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP +#define BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +struct mole_base_unit : public base_unit +{ + static std::string name() { return("mole"); } + static std::string symbol() { return("mol"); } +}; + +} // namespace si + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::mole_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_SI_MOLE_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/si/second.hpp b/deal.II/contrib/boost/include/boost/units/base_units/si/second.hpp new file mode 100644 index 0000000000..946c671973 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/si/second.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP +#define BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +struct second_base_unit : public base_unit +{ + static std::string name() { return("second"); } + static std::string symbol() { return("s"); } +}; + +} // namespace si + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::si::second_base_unit) + +#endif + +//#include + +#endif // BOOST_UNITS_SI_SECOND_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/temperature/celsius.hpp b/deal.II/contrib/boost/include/boost/units/base_units/temperature/celsius.hpp new file mode 100644 index 0000000000..dff70a1cd1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/temperature/celsius.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP +#define BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace temperature { + +struct celsius_base_unit : public base_unit +{ + static std::string name() { return("celsius"); } + static std::string symbol() { return("C"); } +}; + +} // namespace temperature + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature::celsius_base_unit) + +#endif + +#include + +#endif // BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/temperature/conversions.hpp b/deal.II/contrib/boost/include/boost/units/base_units/temperature/conversions.hpp new file mode 100644 index 0000000000..e4e45de99f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/temperature/conversions.hpp @@ -0,0 +1,42 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// No include guards. This header is intended to be included +// multiple times. + +// units of temperature + +#if defined(BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP) &&\ + !defined(BOOST_UNITS_SYSTEMS_KELVIN_TO_CELSIUS_CONVERSION_DEFINED) + #define BOOST_UNITS_SYSTEMS_KELVIN_TO_CELSIUS_CONVERSION_DEFINED + #include + #include + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::si::kelvin_base_unit, boost::units::temperature::celsius_base_unit, one, make_one()); + BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::si::kelvin_base_unit, boost::units::temperature::celsius_base_unit, double, -273.15); +#endif + +#if defined(BOOST_UNITS_SI_KELVIN_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP) &&\ + !defined(BOOST_UNITS_SYSTEMS_KELVIN_TO_FAHRENHEIT_CONVERSION_DEFINED) + #define BOOST_UNITS_SYSTEMS_KELVIN_TO_FAHRENHEIT_CONVERSION_DEFINED + #include + #include + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::si::kelvin_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 9.0/5.0); + BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::si::kelvin_base_unit, boost::units::temperature::fahrenheit_base_unit, double, -273.15 * 9.0 / 5.0 + 32.0); +#endif + +#if defined(BOOST_UNITS_TEMPERATURE_CELSIUS_BASE_UNIT_HPP) && defined(BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP) &&\ + !defined(BOOST_UNITS_SYSTEMS_CELSUIS_TO_FAHRENHEIT_CONVERSION_DEFINED) + #define BOOST_UNITS_SYSTEMS_CELSUIS_TO_FAHRENHEIT_CONVERSION_DEFINED + #include + #include + BOOST_UNITS_DEFINE_CONVERSION_FACTOR(boost::units::temperature::celsius_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 9.0/5.0); + BOOST_UNITS_DEFINE_CONVERSION_OFFSET(boost::units::temperature::celsius_base_unit, boost::units::temperature::fahrenheit_base_unit, double, 32.0); +#endif + diff --git a/deal.II/contrib/boost/include/boost/units/base_units/temperature/fahrenheit.hpp b/deal.II/contrib/boost/include/boost/units/base_units/temperature/fahrenheit.hpp new file mode 100644 index 0000000000..ff0149f856 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/temperature/fahrenheit.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP +#define BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace temperature { + +struct fahrenheit_base_unit : public base_unit +{ + static std::string name() { return("fahrenheit"); } + static std::string symbol() { return("F"); } +}; + +} // namespace temperature + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature::fahrenheit_base_unit) + +#endif + +#include + +#endif // BOOST_UNITS_TEMPERATURE_FAHRENHEIT_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/cup.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/cup.hpp new file mode 100644 index 0000000000..f811373304 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/cup.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > cup_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("cup"); } + static const char* symbol() { return("c"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_CUP_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/dram.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/dram.hpp new file mode 100644 index 0000000000..73fc44ff31 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/dram.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED +#define BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > dram_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("dram (U.S.)"); } + static const char* symbol() { return("dr"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_BASE_UNITS_US_DRAM_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/fluid_dram.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/fluid_dram.hpp new file mode 100644 index 0000000000..cf0c85d3c7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/fluid_dram.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > fluid_dram_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("fluid dram (U.S.)"); } + static const char* symbol() { return("fl dr"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_FLUID_DRAM_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/fluid_ounce.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/fluid_ounce.hpp new file mode 100644 index 0000000000..0c9d7e9943 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/fluid_ounce.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > fluid_ounce_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("fluid ounce (U.S.)"); } + static const char* symbol() { return("fl oz"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_FLUID_OUNCE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/foot.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/foot.hpp new file mode 100644 index 0000000000..4b529bb6a4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/foot.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_US_FOOT_BASE_UNIT_HPP +#define BOOST_UNITS_US_FOOT_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > foot_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("foot"); } + static const char* symbol() { return("ft"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_US_FOOT_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/gallon.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/gallon.hpp new file mode 100644 index 0000000000..a7314c58e4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/gallon.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > gallon_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("gallon (U.S.)"); } + static const char* symbol() { return("gal"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_GALLON_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/gill.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/gill.hpp new file mode 100644 index 0000000000..e9373439b6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/gill.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > gill_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("gill (U.S.)"); } + static const char* symbol() { return("gi"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_GILL_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/grain.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/grain.hpp new file mode 100644 index 0000000000..e21baf6916 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/grain.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED +#define BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > grain_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("grain"); } + static const char* symbol() { return("gr"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_BASE_UNITS_US_GRAIN_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/hundredweight.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/hundredweight.hpp new file mode 100644 index 0000000000..0bccd4922e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/hundredweight.hpp @@ -0,0 +1,40 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED +#define BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +//typedef scaled_base_unit > > hundredweight_base_unit; +typedef scaled_base_unit > > hundredweight_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("hundredweight (U.S.)"); } + static const char* symbol() { return("cwt"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_BASE_UNITS_US_HUNDREDWEIGHT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/inch.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/inch.hpp new file mode 100644 index 0000000000..05bd59a248 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/inch.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_US_INCH_BASE_UNIT_HPP +#define BOOST_UNITS_US_INCH_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > inch_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("inch"); } + static const char* symbol() { return("in"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_US_INCH_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/mil.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/mil.hpp new file mode 100644 index 0000000000..ee75b79ab8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/mil.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_US_MIL_BASE_UNIT_HPP +#define BOOST_UNITS_US_MIL_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > mil_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("mil"); } + static const char* symbol() { return("mil"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_US_MIL_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/mile.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/mile.hpp new file mode 100644 index 0000000000..d3513f13d0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/mile.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_US_MILE_BASE_UNIT_HPP +#define BOOST_UNITS_US_MILE_BASE_UNIT_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > mile_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("mile"); } + static const char* symbol() { return("mi"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_US_MILE_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/minim.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/minim.hpp new file mode 100644 index 0000000000..bf266cdba4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/minim.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > minim_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("minim (U.S.)"); } + static const char* symbol() { return("minim"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_MINIM_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/ounce.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/ounce.hpp new file mode 100644 index 0000000000..5f88f8386f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/ounce.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > ounce_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("ounce"); } + static const char* symbol() { return("oz"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_SYSTEMS_US_OUNCE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/pint.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/pint.hpp new file mode 100644 index 0000000000..3a923b883e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/pint.hpp @@ -0,0 +1,28 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED + +#include +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pint, "pint (U.S.)", "pt", 0.4731765e-3, si::volume, -503); + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pint_base_unit) + +#endif + +#endif // BOOST_UNITS_BASE_UNITS_US_PINT_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/pound.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/pound.hpp new file mode 100644 index 0000000000..bef6cde3b9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/pound.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED + +#include + +#include +#include +#include +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound, "pound", "lb", 453.59237, cgs::gram_base_unit, -502); // exact conversion + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pound_base_unit) + +#endif + +#endif // BOOST_UNIT_SYSTEMS_US_POUND_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/pound_force.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/pound_force.hpp new file mode 100644 index 0000000000..9749d5eb0e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/pound_force.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2009 Matthias Christian Schabel +// Copyright (C) 2007-2009 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED +#define BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED + +#include + +#include +#include +//#include +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, pound_force, "pound-force", "lbf", 4.4482216152605, si::force, -600); // exact conversion + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::pound_force_base_unit) + +#endif + +#endif // BOOST_UNIT_SYSTEMS_US_POUND_FORCE_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/quart.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/quart.hpp new file mode 100644 index 0000000000..45cf6a961a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/quart.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > quart_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("quart (U.S.)"); } + static const char* symbol() { return("qt"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_QUART_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/tablespoon.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/tablespoon.hpp new file mode 100644 index 0000000000..f95f0a2b9a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/tablespoon.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > tablespoon_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("tablespoon"); } + static const char* symbol() { return("tbsp"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_TABLESPOON_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/teaspoon.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/teaspoon.hpp new file mode 100644 index 0000000000..8f8dd73d1c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/teaspoon.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED +#define BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > teaspoon_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("teaspoon"); } + static const char* symbol() { return("tsp"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_BASE_UNITS_US_TEASPOON_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/ton.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/ton.hpp new file mode 100644 index 0000000000..84daa85a73 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/ton.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED +#define BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace us { + +typedef scaled_base_unit > > ton_base_unit; + +} // namespace us + +template<> +struct base_unit_info { + static const char* name() { return("short ton"); } + static const char* symbol() { return("t"); } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNIT_BASE_UNITS_US_TON_HPP_INCLUDED diff --git a/deal.II/contrib/boost/include/boost/units/base_units/us/yard.hpp b/deal.II/contrib/boost/include/boost/units/base_units/us/yard.hpp new file mode 100644 index 0000000000..b609eaefa6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/base_units/us/yard.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP +#define BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP + +#include + +#include +#include +#include +#include +#include + +BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(us, yard, "yard", "yd", 0.9144, si::meter_base_unit, -501); // exact conversion + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::us::yard_base_unit) + +#endif + +#endif // BOOST_UNITS_SYSTEMS_US_YARD_BASE_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/cmath.hpp b/deal.II/contrib/boost/include/boost/units/cmath.hpp new file mode 100644 index 0000000000..393aa5dfae --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/cmath.hpp @@ -0,0 +1,639 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CMATH_HPP +#define BOOST_UNITS_CMATH_HPP + +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +/// \file +/// \brief Overloads of functions in \ for quantities +/// +/// \detailed Only functions for which a dimensionally-correct result type +/// can be determined are overloaded. All functions work with dimensionless +/// quantities. + +// BOOST_PREVENT_MACRO_SUBSTITUTION is needed on certain compilers that define +// some functions as macros; it is used for all functions even though it +// isn't necessary -- I didn't want to think :) +// +// the form using namespace detail; return(f(x)); is used +// to enable ADL for UDTs + +namespace boost { + +namespace units { + +template +inline +bool +isfinite BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using boost::math::isfinite; + return isfinite BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()); +} + +template +inline +bool +isinf BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using boost::math::isinf; + return isinf BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()); +} + +template +inline +bool +isnan BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using boost::math::isnan; + return isnan BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()); +} + +template +inline +bool +isnormal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using boost::math::isnormal; + return isnormal BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()); +} + +template +inline +bool +isgreater BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + return isgreater BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()); +} + +template +inline +bool +isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + return isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()); +} + +template +inline +bool +isless BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + return isless BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()); +} + +template +inline +bool +islessequal BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + return islessequal BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()); +} + +template +inline +bool +islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + return islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()); +} + +template +inline +bool +isunordered BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + return isunordered BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value()); +} + +template +inline +quantity +abs BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using std::abs; + + typedef quantity quantity_type; + + return quantity_type::from_value(abs BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +} + +template +inline +quantity +ceil BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using std::ceil; + + typedef quantity quantity_type; + + return quantity_type::from_value(ceil BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +} + +template +inline +quantity +copysign BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using boost::math::copysign; + + typedef quantity quantity_type; + + return quantity_type::from_value(copysign BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value())); +} + +template +inline +quantity +fabs BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using std::fabs; + + typedef quantity quantity_type; + + return quantity_type::from_value(fabs BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +} + +template +inline +quantity +floor BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using std::floor; + + typedef quantity quantity_type; + + return quantity_type::from_value(floor BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +} + +template +inline +quantity +fdim BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + + typedef quantity quantity_type; + + return quantity_type::from_value(fdim BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value())); +} + +#if 0 + +template +inline +typename add_typeof_helper< + typename multiply_typeof_helper, + quantity >::type, + quantity >::type +fma BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2, + const quantity& q3) +{ + using namespace detail; + + typedef quantity type1; + typedef quantity type2; + typedef quantity type3; + + typedef typename multiply_typeof_helper::type prod_type; + typedef typename add_typeof_helper::type quantity_type; + + return quantity_type::from_value(fma BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value(),q3.value())); +} + +#endif + +template +inline +quantity +fmax BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + + typedef quantity quantity_type; + + return quantity_type::from_value(fmax BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value())); +} + +template +inline +quantity +fmin BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using namespace detail; + + typedef quantity quantity_type; + + return quantity_type::from_value(fmin BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value())); +} + +template +inline +int +fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using boost::math::fpclassify; + + return fpclassify BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()); +} + +template +inline +typename root_typeof_helper< + typename add_typeof_helper< + typename power_typeof_helper, + static_rational<2> >::type, + typename power_typeof_helper, + static_rational<2> >::type>::type, + static_rational<2> >::type +hypot BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1,const quantity& q2) +{ + using boost::math::hypot; + + typedef quantity type1; + + typedef typename power_typeof_helper >::type pow_type; + typedef typename add_typeof_helper::type add_type; + typedef typename root_typeof_helper >::type quantity_type; + + return quantity_type::from_value(hypot BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value())); +} + +// does ISO C++ support long long? g++ claims not +//template +//inline +//quantity +//llrint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +//{ +// using namespace detail; +// +// typedef quantity quantity_type; +// +// return quantity_type::from_value(llrint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +//} + +// does ISO C++ support long long? g++ claims not +//template +//inline +//quantity +//llround BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +//{ +// using namespace detail; +// +// typedef quantity quantity_type; +// +// return quantity_type::from_value(llround BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +//} + +#if 0 + +template +inline +quantity +nearbyint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using namespace detail; + + typedef quantity quantity_type; + + return quantity_type::from_value(nearbyint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +} + +#endif + +template +inline +quantity nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + using boost::math::nextafter; + + typedef quantity quantity_type; + + return quantity_type::from_value(nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value())); +} +template +inline +quantity nexttoward BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q1, + const quantity& q2) +{ + // the only difference between nextafter and nexttowards is + // in the argument types. Since we are requiring identical + // argument types, there is no difference. + using boost::math::nextafter; + + typedef quantity quantity_type; + + return quantity_type::from_value(nextafter BOOST_PREVENT_MACRO_SUBSTITUTION (q1.value(),q2.value())); +} + +#if 0 + +template +inline +quantity +rint BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using namespace detail; + + typedef quantity quantity_type; + + return quantity_type::from_value(rint BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +} + +#endif + +template +inline +quantity +round BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using boost::math::round; + + typedef quantity quantity_type; + + return quantity_type::from_value(round BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +} + +template +inline +int +signbit BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using boost::math::signbit; + + return signbit BOOST_PREVENT_MACRO_SUBSTITUTION (q.value()); +} + +template +inline +quantity +trunc BOOST_PREVENT_MACRO_SUBSTITUTION (const quantity& q) +{ + using namespace detail; + + typedef quantity quantity_type; + + return quantity_type::from_value(trunc BOOST_PREVENT_MACRO_SUBSTITUTION (q.value())); +} + +template +inline +quantity +fmod(const quantity& q1, const quantity& q2) +{ + using std::fmod; + + typedef quantity quantity_type; + + return quantity_type::from_value(fmod(q1.value(), q2.value())); +} + +template +inline +quantity +modf(const quantity& q1, quantity* q2) +{ + using std::modf; + + typedef quantity quantity_type; + + return quantity_type::from_value(modf(q1.value(), &quantity_cast(*q2))); +} + +template +inline +quantity +frexp(const quantity& q,Int* ex) +{ + using std::frexp; + + typedef quantity quantity_type; + + return quantity_type::from_value(frexp(q.value(),ex)); +} + +/// For non-dimensionless quantities, integral and rational powers +/// and roots can be computed by @c pow and @c root respectively. +template +inline +quantity +pow(const quantity& q1, + const quantity& q2) +{ + using std::pow; + + typedef quantity quantity_type; + + return quantity_type::from_value(pow(q1.value(), q2.value())); +} + +template +inline +quantity +exp(const quantity& q) +{ + using std::exp; + + typedef quantity quantity_type; + + return quantity_type::from_value(exp(q.value())); +} + +template +inline +quantity +ldexp(const quantity& q,const Int& ex) +{ + using std::ldexp; + + typedef quantity quantity_type; + + return quantity_type::from_value(ldexp(q.value(), ex)); +} + +template +inline +quantity +log(const quantity& q) +{ + using std::log; + + typedef quantity quantity_type; + + return quantity_type::from_value(log(q.value())); +} + +template +inline +quantity +log10(const quantity& q) +{ + using std::log10; + + typedef quantity quantity_type; + + return quantity_type::from_value(log10(q.value())); +} + +template +inline +typename root_typeof_helper< + quantity, + static_rational<2> + >::type +sqrt(const quantity& q) +{ + using std::sqrt; + + typedef typename root_typeof_helper< + quantity, + static_rational<2> + >::type quantity_type; + + return quantity_type::from_value(sqrt(q.value())); +} + +} // namespace units + +} // namespace boost + +namespace boost { + +namespace units { + +// trig functions with si argument/return types + +/// cos of theta in radians +template +typename dimensionless_quantity::type +cos(const quantity& theta) +{ + using std::cos; + return cos(theta.value()); +} + +/// sin of theta in radians +template +typename dimensionless_quantity::type +sin(const quantity& theta) +{ + using std::sin; + return sin(theta.value()); +} + +/// tan of theta in radians +template +typename dimensionless_quantity::type +tan(const quantity& theta) +{ + using std::tan; + return tan(theta.value()); +} + +/// cos of theta in other angular units +template +typename dimensionless_quantity::type +cos(const quantity,Y>& theta) +{ + return cos(quantity(theta)); +} + +/// sin of theta in other angular units +template +typename dimensionless_quantity::type +sin(const quantity,Y>& theta) +{ + return sin(quantity(theta)); +} + +/// tan of theta in other angular units +template +typename dimensionless_quantity::type +tan(const quantity,Y>& theta) +{ + return tan(quantity(theta)); +} + +/// acos of dimensionless quantity returning angle in same system +template +quantity >,Y> +acos(const quantity >,Y>& val) +{ + using std::acos; + return quantity >,Y>(acos(val.value())*si::radians); +} + +/// asin of dimensionless quantity returning angle in same system +template +quantity >,Y> +asin(const quantity >,Y>& val) +{ + using std::asin; + return quantity >,Y>(asin(val.value())*si::radians); +} + +/// atan of dimensionless quantity returning angle in same system +template +quantity >,Y> +atan(const quantity >, Y>& val) +{ + using std::atan; + return quantity >,Y>(atan(val.value())*si::radians); +} + +/// atan2 of @c value_type returning angle in radians +template +quantity >, Y> +atan2(const quantity >, Y>& y, + const quantity >, Y>& x) +{ + using std::atan2; + return quantity >, Y>(atan2(y.value(),x.value())*si::radians); +} + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CMATH_HPP diff --git a/deal.II/contrib/boost/include/boost/units/config.hpp b/deal.II/contrib/boost/include/boost/units/config.hpp new file mode 100644 index 0000000000..e3812138f0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/config.hpp @@ -0,0 +1,105 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CONFIG_HPP +#define BOOST_UNITS_CONFIG_HPP + +#include +#include + +#ifndef BOOST_UNITS_HAS_BOOST_TYPEOF + #if (BOOST_VERSION >= 103400) + ///INTERNAL ONLY + #define BOOST_UNITS_HAS_BOOST_TYPEOF 1 + #else + ///INTERNAL ONLY + #define BOOST_UNITS_HAS_BOOST_TYPEOF 0 + #endif +#endif + +#if (BOOST_UNITS_HAS_BOOST_TYPEOF) + #include + ///INTERNAL ONLY + #define BOOST_UNITS_HAS_TYPEOF 1 +#else + #if (__GNUC__ && __cplusplus && __GNUC__ >= 3) + ///INTERNAL ONLY + #define BOOST_UNITS_HAS_TYPEOF 1 + ///INTERNAL ONLY + #define BOOST_UNITS_HAS_GNU_TYPEOF 1 + #elif defined(__MWERKS__) + ///INTERNAL ONLY + #define BOOST_UNITS_HAS_TYPEOF 1 + ///INTERNAL ONLY + #define BOOST_UNITS_HAS_MWERKS_TYPEOF 1 + #else + ///INTERNAL ONLY + #define BOOST_UNITS_HAS_TYPEOF 0 + #endif +#endif + +// uncomment this to test without typeof support at all +//#undef BOOST_UNITS_HAS_TYPEOF +//#define BOOST_UNITS_HAS_TYPEOF 0 + +#ifndef BOOST_UNITS_NO_COMPILER_CHECK + + #ifdef BOOST_NO_MEMBER_TEMPLATES + #error Boost.Units requires member template + #endif + + #ifdef BOOST_NO_MEMBER_TEMPLATE_KEYWORD + #error Boost.Units requires member template keyword + #endif + + #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION + #error Boost.Units requires in class member initialization + #endif + + #ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING + #error Boost.Units requires function template partial ordering + #endif + + #ifdef BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS + #error Boost.Units requires explicit function template arguments + #endif + + #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + #error Boost.Units requires partial specialization + #endif + +#endif + +#ifdef BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY + ///INTERNAL ONLY + #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) BOOST_STATIC_ASSERT((sizeof(a) == sizeof(b))) +#else + ///INTERNAL ONLY + #define BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(a, b) ((void)0) +#endif + +#ifdef BOOST_UNITS_DOXYGEN + +/// If defined will trigger a static assertion if quantity +/// is not layout compatible with T +#define BOOST_UNITS_REQUIRE_LAYOUT_COMPATIBILITY + +/// If defined will diasable a preprocessor check that the +/// compiler is able to handle the library. +#define BOOST_UNITS_NO_COMPILER_CHECK + +/// Enable checking to verify that a homogeneous system +/// is actually capable of representing all the dimensions +/// that it is used with. Off by default. +#define BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS + +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/conversion.hpp b/deal.II/contrib/boost/include/boost/units/conversion.hpp new file mode 100644 index 0000000000..a486895cef --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/conversion.hpp @@ -0,0 +1,180 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CONVERSION_HPP +#define BOOST_UNITS_CONVERSION_HPP + +#include + +namespace boost { + +namespace units { + +template +struct conversion_helper; + +#ifdef BOOST_UNITS_DOXYGEN + +/// Template for defining conversions between +/// quantities. This template should be specialized +/// for every quantity that allows conversions. +/// For example, if you have a two units +/// called pair and dozen you would write +/// @code +/// namespace boost { +/// namespace units { +/// template +/// struct conversion_helper, quantity > +/// { +/// static quantity convert(const quantity& source) +/// { +/// return(quantity::from_value(6 * source.value())); +/// } +/// }; +/// } +/// } +/// @endcode +/// +/// In most cases, the predefined specializations for @c unit +/// and @c absolute should be sufficient, so users should rarely +/// need to use this. +template +struct conversion_helper +{ + static To convert(const From&); +}; + +#endif + +/// Defines the conversion factor from a base unit to any unit +/// or to another base unit with the correct dimensions. Uses +/// of this macro must appear at global scope. +/// If the destination unit is a base unit or a unit that contains +/// only one base unit which is raised to the first power (e.g. feet->meters) +/// the reverse (meters->feet in this example) need not be defined explicitly. +#define BOOST_UNITS_DEFINE_CONVERSION_FACTOR(Source, Destination, type_, value_) \ + namespace boost { \ + namespace units { \ + template<> \ + struct select_base_unit_converter< \ + unscale::type, \ + unscale::type>::type \ + > \ + { \ + typedef Source source_type; \ + typedef reduce_unit::type destination_type; \ + }; \ + template<> \ + struct base_unit_converter::type> \ + { \ + static const bool is_defined = true; \ + typedef type_ type; \ + static type value() { return(value_); } \ + }; \ + } \ + } \ + void boost_units_require_semicolon() + +/// Defines the conversion factor from a base unit to any other base +/// unit with the same dimensions. Params should be a Boost.Preprocessor +/// Seq of template parameters, such as (class T1)(class T2) +/// All uses of must appear at global scope. The reverse conversion will +/// be defined automatically. This macro is a little dangerous, because, +/// unlike the non-template form, it will silently fail if either base +/// unit is scaled. This is probably not an issue if both the source +/// and destination types depend on the template parameters, but be aware +/// that a generic conversion to kilograms is not going to work. +#define BOOST_UNITS_DEFINE_CONVERSION_FACTOR_TEMPLATE(Params, Source, Destination, type_, value_) \ + namespace boost { \ + namespace units { \ + template \ + struct base_unit_converter< \ + Source, \ + BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(Destination, typename Source::dimension_type)\ + > \ + { \ + static const bool is_defined = true; \ + typedef type_ type; \ + static type value() { return(value_); } \ + }; \ + } \ + } \ + void boost_units_require_semicolon() + +/// Specifies the default conversion to be applied when +/// no direct conversion is available. +/// Source is a base unit. Dest is any unit with the +/// same dimensions. +#define BOOST_UNITS_DEFAULT_CONVERSION(Source, Dest) \ + namespace boost { \ + namespace units { \ + template<> \ + struct unscaled_get_default_conversion::type> \ + { \ + static const bool is_defined = true; \ + typedef Dest::unit_type type; \ + }; \ + } \ + } \ + void boost_units_require_semicolon() + +/// Specifies the default conversion to be applied when +/// no direct conversion is available. +/// Params is a PP Sequence of template arguments. +/// Source is a base unit. Dest is any unit with the +/// same dimensions. The source must not be a scaled +/// base unit. +#define BOOST_UNITS_DEFAULT_CONVERSION_TEMPLATE(Params, Source, Dest) \ + namespace boost { \ + namespace units { \ + template \ + struct unscaled_get_default_conversion \ + { \ + static const bool is_defined = true; \ + typedef typename Dest::unit_type type; \ + }; \ + } \ + } \ + void boost_units_require_semicolon() + +/// INTERNAL ONLY +/// Users should not create their units in namespace boost::units. +/// If we want to make this public it needs to allow better control over +/// the namespaces. --SJW. +/// template that defines a base_unit and conversion to another dimensionally-consistent unit +#define BOOST_UNITS_DEFINE_BASE_UNIT_WITH_CONVERSIONS(namespace_, name_, name_string_, symbol_string_, factor, unit, id)\ +namespace boost { \ +namespace units { \ +namespace namespace_ { \ +struct name_ ## _base_unit \ + : base_unit { \ + static const char* name() { return(name_string_); } \ + static const char* symbol() { return(symbol_string_); }; \ +}; \ +} \ +} \ +} \ +BOOST_UNITS_DEFINE_CONVERSION_FACTOR(namespace_::name_ ## _base_unit, unit, double, factor); \ +BOOST_UNITS_DEFAULT_CONVERSION(namespace_::name_ ## _base_unit, unit) + +/// Find the conversion factor between two units. +template +inline +typename detail::conversion_factor_helper::type +conversion_factor(const FromUnit&,const ToUnit&) +{ + return(detail::conversion_factor_helper::value()); +} + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CONVERSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/derived_dimension.hpp b/deal.II/contrib/boost/include/boost/units/derived_dimension.hpp new file mode 100644 index 0000000000..54cc46a3b1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/derived_dimension.hpp @@ -0,0 +1,208 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// A utility class for defining composite dimensions with integer powers. +template +struct derived_dimension +{ +#ifdef BOOST_UNITS_DOXYGEN + typedef detail::unspecified type; +#else + typedef typename + make_dimension_list< list< dim< DT1,static_rational >, + list< dim< DT2,static_rational >, + list< dim< DT3,static_rational >, + list< dim< DT4,static_rational >, + list< dim< DT5,static_rational >, + list< dim< DT6,static_rational >, + list< dim< DT7,static_rational >, + list< dim< DT8,static_rational >, dimensionless_type > > > > > > > > >::type type; +#endif +}; + +/// INTERNAL ONLY +template +struct derived_dimension< + DT1, E1, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0> +{ + typedef typename + make_dimension_list< list< dim< DT1,static_rational >, dimensionless_type > >::type type; +}; + +/// INTERNAL ONLY +template +struct derived_dimension< + DT1, E1, + DT2, E2, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0> +{ + typedef typename + make_dimension_list< list< dim< DT1,static_rational >, + list< dim< DT2,static_rational >, dimensionless_type > > >::type type; +}; + +/// INTERNAL ONLY +template +struct derived_dimension< + DT1, E1, + DT2, E2, + DT3, E3, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0> +{ + typedef typename + make_dimension_list< list< dim< DT1,static_rational >, + list< dim< DT2,static_rational >, + list< dim< DT3,static_rational >, dimensionless_type > > > >::type type; +}; + +/// INTERNAL ONLY +template +struct derived_dimension< + DT1, E1, + DT2, E2, + DT3, E3, + DT4, E4, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0> +{ + typedef typename + make_dimension_list< list< dim< DT1,static_rational >, + list< dim< DT2,static_rational >, + list< dim< DT3,static_rational >, + list< dim< DT4,static_rational >, dimensionless_type > > > > >::type type; +}; + +/// INTERNAL ONLY +template +struct derived_dimension< + DT1, E1, + DT2, E2, + DT3, E3, + DT4, E4, + DT5, E5, + dimensionless_type,0, + dimensionless_type,0, + dimensionless_type,0> +{ + typedef typename + make_dimension_list< list< dim< DT1,static_rational >, + list< dim< DT2,static_rational >, + list< dim< DT3,static_rational >, + list< dim< DT4,static_rational >, + list< dim< DT5,static_rational >, dimensionless_type > > > > > >::type type; +}; + +/// INTERNAL ONLY +template +struct derived_dimension< + DT1, E1, + DT2, E2, + DT3, E3, + DT4, E4, + DT5, E5, + DT6, E6, + dimensionless_type,0, + dimensionless_type,0> +{ + typedef typename + make_dimension_list< list< dim< DT1,static_rational >, + list< dim< DT2,static_rational >, + list< dim< DT3,static_rational >, + list< dim< DT4,static_rational >, + list< dim< DT5,static_rational >, + list< dim< DT6,static_rational >, dimensionless_type > > > > > > >::type type; +}; + +/// INTERNAL ONLY +template +struct derived_dimension< + DT1, E1, + DT2, E2, + DT3, E3, + DT4, E4, + DT5, E5, + DT6, E6, + DT7, E7, + dimensionless_type,0> +{ + typedef typename + make_dimension_list< list< dim< DT1,static_rational >, + list< dim< DT2,static_rational >, + list< dim< DT3,static_rational >, + list< dim< DT4,static_rational >, + list< dim< DT5,static_rational >, + list< dim< DT6,static_rational >, + list< dim< DT7,static_rational >, dimensionless_type > > > > > > > >::type type; +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/detail/absolute_impl.hpp b/deal.II/contrib/boost/include/boost/units/detail/absolute_impl.hpp new file mode 100644 index 0000000000..127b33a78b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/absolute_impl.hpp @@ -0,0 +1,104 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ABSOLUTE_IMPL_HPP +#define BOOST_UNITS_ABSOLUTE_IMPL_HPP + +#include + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// INTERNAL ONLY +template +struct reduce_unit > > +{ + typedef absolute >::type> type; +}; + +namespace detail { + +struct undefined_affine_conversion_base { + static const bool is_defined = false; +}; + +} // namespace detail + +/// INTERNAL ONLY +template +struct affine_conversion_helper : detail::undefined_affine_conversion_base { }; + +namespace detail { + +template +struct affine_conversion_impl; + +template +struct affine_conversion_impl +{ + template + struct apply { + static T1 value(const T0& t0) + { + return( + t0 * + conversion_factor(Unit1(), Unit2()) + + affine_conversion_helper::type, typename reduce_unit::type>::value()); + } + }; +}; + +template<> +struct affine_conversion_impl +{ + template + struct apply + { + static T1 value(const T0& t0) + { + return( + (t0 - affine_conversion_helper::type, typename reduce_unit::type>::value()) * + conversion_factor(Unit1(), Unit2())); + } + }; +}; + +} // namespace detail + +/// INTERNAL ONLY +template +struct conversion_helper, T1>, quantity, T2> > +{ + typedef quantity, T1> from_quantity_type; + typedef quantity, T2> to_quantity_type; + static to_quantity_type convert(const from_quantity_type& source) + { + return( + to_quantity_type::from_value( + detail::affine_conversion_impl< + affine_conversion_helper::type, typename reduce_unit::type>::is_defined, + affine_conversion_helper::type, typename reduce_unit::type>::is_defined + >::template apply::value(source.value()) + ) + ); + } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ABSOLUTE_IMPL_HPP diff --git a/deal.II/contrib/boost/include/boost/units/detail/cmath_impl.hpp b/deal.II/contrib/boost/include/boost/units/detail/cmath_impl.hpp new file mode 100644 index 0000000000..d5bec14f43 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/cmath_impl.hpp @@ -0,0 +1,154 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CMATH_IMPL_HPP +#define BOOST_UNITS_CMATH_IMPL_HPP + +#include +#include + +namespace boost { +namespace units { +namespace detail { + +template +inline bool isgreater BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false; + else return v1 > v2; +} + +template +inline bool isgreaterequal BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false; + else return v1 >= v2; +} + +template +inline bool isless BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false; + else return v1 < v2; +} + +template +inline bool islessequal BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false; + else return v1 <= v2; +} + +template +inline bool islessgreater BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + if((boost::math::isnan)(v1) || (boost::math::isnan)(v2)) return false; + else return v1 < v2 || v1 > v2; +} + +template +inline bool isunordered BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + return (boost::math::isnan)(v1) || (boost::math::isnan)(v2); +} + +template +inline Y fdim BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + if((boost::math::isnan)(v1)) return v1; + else if((boost::math::isnan)(v2)) return v2; + else if(v1 > v2) return(v1 - v2); + else return(Y(0)); +} + +#if 0 + +template +struct fma_issue_warning { + enum { value = false }; +}; + +template +inline Y fma(const Y& v1,const Y& v2,const Y& v3) +{ + //this implementation does *not* meet the + //requirement of infinite intermediate precision + BOOST_STATIC_WARNING((fma_issue_warning::value)); + + return v1 * v2 + v3; +} + +#endif + +template +inline Y fmax BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + if((boost::math::isnan)(v1)) return(v2); + else if((boost::math::isnan)(v2)) return(v1); + else if(v1 > v2) return(v1); + else return(v2); +} + +template +inline Y fmin BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& v1,const Y& v2) +{ + if((boost::math::isnan)(v1)) return(v2); + else if((boost::math::isnan)(v2)) return(v1); + else if(v1 < v2) return(v1); + else return(v2); +} + +//template +//inline long long llrint(const Y& val) +//{ +// return static_cast(rint(val)); +//} +// +//template +//inline long long llround(const Y& val) +//{ +// return static_cast(round(val)); +//} + +#if 0 + +template +inline Y nearbyint(const Y& val) +{ + //this is not really correct. + //the result should be according to the + //current rounding mode. + using boost::math::round; + return round(val); +} + +template +inline Y rint(const Y& val) +{ + //I don't feel like trying to figure out + //how to raise a floating pointer exception + return nearbyint(val); +} + +#endif + +template +inline Y trunc BOOST_PREVENT_MACRO_SUBSTITUTION(const Y& val) +{ + if(val > 0) return std::floor(val); + else if(val < 0) return std::ceil(val); + else return val; +} + +} +} +} + +#endif // BOOST_UNITS_CMATH_IMPL_HPP diff --git a/deal.II/contrib/boost/include/boost/units/detail/conversion_impl.hpp b/deal.II/contrib/boost/include/boost/units/detail/conversion_impl.hpp new file mode 100644 index 0000000000..8946faf5a6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/conversion_impl.hpp @@ -0,0 +1,458 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_CONVERSION_IMPL_HPP +#define BOOST_UNITS_DETAIL_CONVERSION_IMPL_HPP + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace boost { + +namespace units { + +namespace detail { + +template +struct conversion_factor_helper; + +template +struct call_base_unit_converter; + +} + +/// INTERNAL ONLY +struct undefined_base_unit_converter_base { + static const bool is_defined = false; +}; + +/// INTERNAL ONLY +struct no_default_conversion { + static const bool is_defined = false; +}; + +/// INTERNAL ONLY +template +struct unscaled_get_default_conversion : no_default_conversion { }; + +/// INTERNAL ONLY +template +struct unscaled_get_default_conversion_impl; + +/// INTERNAL ONLY +template<> +struct unscaled_get_default_conversion_impl +{ + template + struct apply + { + typedef typename unscaled_get_default_conversion::type>::type type; + }; +}; + +/// INTERNAL ONLY +template<> +struct unscaled_get_default_conversion_impl +{ + template + struct apply + { + typedef typename T::unit_type type; + }; +}; + +/// INTERNAL ONLY +template +struct get_default_conversion +{ + typedef typename unscaled_get_default_conversion_impl< + unscaled_get_default_conversion::type>::is_defined + >::template apply::type type; +}; + +/// INTERNAL ONLY +template +struct select_base_unit_converter +{ + typedef Source source_type; + typedef Destination destination_type; +}; + +/// INTERNAL ONLY +template +struct base_unit_converter_base : undefined_base_unit_converter_base { +}; + +/// INTERNAL ONLY +template +struct base_unit_converter_base +{ + static const bool is_defined = true; + typedef one type; + static type value() { + one result; + return(result); + } +}; + +/// INTERNAL ONLY +template +struct base_unit_converter : base_unit_converter_base { }; + +namespace detail { + +template +struct do_call_base_unit_converter { + typedef select_base_unit_converter::type, typename unscale::type> selector; + typedef typename selector::source_type source_type; + typedef typename selector::destination_type destination_type; + typedef base_unit_converter converter; + typedef typename mpl::divides::type, typename get_scale_list::type>::type source_factor; + typedef typename mpl::divides::type, typename get_scale_list::type>::type destination_factor; + typedef typename mpl::divides::type factor; + typedef eval_scale_list eval_factor; + typedef typename multiply_typeof_helper::type type; + static type value() + { + return(converter::value() * eval_factor::value()); + } +}; + +template +struct call_base_unit_converter_base_unit_impl; + +template<> +struct call_base_unit_converter_base_unit_impl +{ + template + struct apply + : do_call_base_unit_converter + { + }; +}; + +template<> +struct call_base_unit_converter_base_unit_impl +{ + template + struct apply + : do_call_base_unit_converter + { + }; +}; + +template<> +struct call_base_unit_converter_base_unit_impl +{ + template + struct apply + { + typedef do_call_base_unit_converter converter; + typedef typename divide_typeof_helper::type type; + static type value() { + one numerator; + return(numerator / converter::value()); + } + }; +}; + +template<> +struct call_base_unit_converter_base_unit_impl +{ + template + struct apply + { + typedef typename reduce_unit::type>::type new_source; + typedef typename reduce_unit::type>::type new_dest; + typedef call_base_unit_converter start; + typedef detail::conversion_factor_helper< + new_source, + new_dest + > conversion; + typedef call_base_unit_converter end; + typedef typename divide_typeof_helper< + typename multiply_typeof_helper< + typename start::type, + typename conversion::type + >::type, + typename end::type + >::type type; + static type value() { + return(start::value() * conversion::value() / end::value()); + } + }; +}; + +template +struct get_default_conversion_impl +{ + template + struct apply + { + typedef typename Begin::item source_pair; + typedef typename source_pair::value_type exponent; + typedef typename source_pair::tag_type source; + typedef typename reduce_unit::type>::type new_source; + typedef typename get_default_conversion_impl::template apply next_iteration; + typedef typename multiply_typeof_helper::type, typename next_iteration::unit_type>::type unit_type; + typedef call_base_unit_converter conversion; + typedef typename multiply_typeof_helper::type type; + static type value() { + return(static_rational_power(conversion::value()) * next_iteration::value()); + } + }; +}; + +template<> +struct get_default_conversion_impl<0> +{ + template + struct apply + { + typedef unit > > unit_type; + typedef one type; + static one value() { + one result; + return(result); + } + }; +}; + +template +struct call_base_unit_converter_impl; + +template<> +struct call_base_unit_converter_impl +{ + template + struct apply + : do_call_base_unit_converter + { + }; +}; + +template<> +struct call_base_unit_converter_impl +{ + template + struct apply { + typedef typename reduce_unit::type>::type new_source; + typedef typename Dest::system_type::type system_list; + typedef typename get_default_conversion_impl::template apply impl; + typedef typename impl::unit_type new_dest; + typedef call_base_unit_converter start; + typedef conversion_factor_helper conversion; + typedef typename divide_typeof_helper< + typename multiply_typeof_helper< + typename start::type, + typename conversion::type + >::type, + typename impl::type + >::type type; + static type value() { + return(start::value() * conversion::value() / impl::value()); + } + }; +}; + +#define BOOST_UNITS_DETAIL_BASE_UNIT_CONVERTER_IS_DEFINED(Source, Dest)\ + base_unit_converter<\ + typename select_base_unit_converter::type, typename unscale::type>::source_type,\ + typename select_base_unit_converter::type, typename unscale::type>::destination_type\ + >::is_defined + +template +struct call_base_unit_converter : call_base_unit_converter_impl::template apply +{ +}; + +template +struct call_base_unit_converter : + call_base_unit_converter_base_unit_impl< + BOOST_UNITS_DETAIL_BASE_UNIT_CONVERTER_IS_DEFINED(Source, typename Dest::unit_type), + BOOST_UNITS_DETAIL_BASE_UNIT_CONVERTER_IS_DEFINED(Dest, typename Source::unit_type) + >::template apply +{ +}; + +template +struct conversion_impl +{ + template + struct apply + { + typedef typename conversion_impl::template apply< + typename Begin::next, + DestinationSystem + > next_iteration; + typedef typename Begin::item unit_pair; + typedef typename unit_pair::tag_type unit; + typedef typename unit::dimension_type dimensions; + typedef typename reduce_unit >::type reduced_unit; + typedef detail::call_base_unit_converter converter; + typedef typename multiply_typeof_helper::type type; + static type value() { return(static_rational_power(converter::value()) * next_iteration::value()); } + }; +}; + +template<> +struct conversion_impl<0> +{ + template + struct apply + { + typedef one type; + static type value() { one result; return(result); } + }; +}; + +} // namespace detail + +/// forward to conversion_factor (intentionally allowing ADL) +/// INTERNAL ONLY +template +struct conversion_helper, quantity > +{ + /// INTERNAL ONLY + typedef quantity destination_type; + static destination_type convert(const quantity& source) + { + Unit1 u1; + Unit2 u2; + return(destination_type::from_value(static_cast(source.value() * conversion_factor(u1, u2)))); + } +}; + +namespace detail { + +template +struct conversion_factor_helper; + +template +struct conversion_factor_helper >, unit > > + : conversion_factor_helper< + typename reduce_unit > >::type, + typename reduce_unit > >::type + > +{ + //typedef typename reduce_unit > >::type source_unit; + //typedef typename source_unit::system_type::type unit_list; + //typedef typename detail::conversion_impl::template apply< + // unit_list, + // homogeneous_system + //> impl; + //typedef typename impl::type type; + //static type value() + //{ + // return(impl::value()); + //} +}; + +template +struct conversion_factor_helper >, unit > > + : conversion_factor_helper< + typename reduce_unit > >::type, + typename reduce_unit > >::type + > +{ + //typedef typename detail::conversion_impl::template apply< + // typename L1::type, + // homogeneous_system + //> impl; + //typedef eval_scale_list scale; + //typedef typename multiply_typeof_helper::type type; + //static type value() + //{ + // return(impl::value() * scale::value()); + //} +}; + +// There is no simple algorithm for doing this conversion +// other than just defining it as the reverse of the +// heterogeneous->homogeneous case +template +struct conversion_factor_helper >, unit > > + : conversion_factor_helper< + typename reduce_unit > >::type, + typename reduce_unit > >::type + > +{ + //typedef typename detail::conversion_impl::template apply< + // typename L2::type, + // homogeneous_system + //> impl; + //typedef eval_scale_list scale; + //typedef typename multiply_typeof_helper::type type; + //static type value() + //{ + // one numerator; + // return(numerator / (impl::value() * scale::value())); + //} +}; + +/// Requires that all possible conversions +/// between base units are defined. +template +struct conversion_factor_helper >, unit > > +{ + /// INTERNAL ONLY + typedef typename detail::extract_base_units::template apply< + typename S1::type, + dimensionless_type + >::type from_base_units; + /// INTERNAL ONLY + typedef typename detail::extract_base_units::template apply< + typename S2::type, + from_base_units + >::type all_base_units; + /// INTERNAL ONLY + typedef typename detail::make_homogeneous_system::type system; + typedef typename detail::conversion_impl::template apply< + typename S1::type, + system + > conversion1; + typedef typename detail::conversion_impl::template apply< + typename S2::type, + system + > conversion2; + typedef eval_scale_list::type> scale; + typedef typename multiply_typeof_helper< + typename conversion1::type, + typename divide_typeof_helper::type + >::type type; + static type value() + { + return(conversion1::value() * (scale::value() / conversion2::value())); + } +}; + +} // namespace detail + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CONVERSION_IMPL_HPP diff --git a/deal.II/contrib/boost/include/boost/units/detail/dim_impl.hpp b/deal.II/contrib/boost/include/boost/units/detail/dim_impl.hpp new file mode 100644 index 0000000000..85792b8acb --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/dim_impl.hpp @@ -0,0 +1,90 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DIM_IMPL_HPP +#define BOOST_UNITS_DIM_IMPL_HPP + +#include +#include + +#include + +/// \file +/// \brief Class encapsulating a dimension tag/value pair + +namespace boost { + +namespace units { + +namespace detail { + +struct dim_tag; + +} + +} + +namespace mpl { + +/// Less than comparison for sorting @c dim. +template<> +struct less_impl +{ + template + struct apply : mpl::less {}; +}; + +} + +namespace units { + +template +struct dim; + +template +class static_rational; + +namespace detail { + +/// Extract @c tag_type from a @c dim. +template +struct get_tag +{ + typedef typename T::tag_type type; +}; + +/// Extract @c value_type from a @c dim. +template +struct get_value +{ + typedef typename T::value_type type; +}; + +/// Determine if a @c dim is empty (has a zero exponent). +template +struct is_empty_dim; + +template +struct is_empty_dim< dim > > : + mpl::true_ +{ }; + +template +struct is_empty_dim< dim > : + mpl::false_ +{ }; + +} // namespace detail + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_DIM_IMPL_HPP diff --git a/deal.II/contrib/boost/include/boost/units/detail/dimension_impl.hpp b/deal.II/contrib/boost/include/boost/units/detail/dimension_impl.hpp new file mode 100644 index 0000000000..dbe77afef7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/dimension_impl.hpp @@ -0,0 +1,347 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DIMENSION_IMPL_HPP +#define BOOST_UNITS_DIMENSION_IMPL_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +/// \file +/// \brief Core class and metaprogramming utilities for compile-time dimensional analysis. + +namespace boost { + +namespace units { + +namespace detail { + +template +struct insertion_sort_dims_insert; + +template +struct insertion_sort_dims_comparison_impl; + +// have to recursively add the element to the next sequence. +template<> +struct insertion_sort_dims_comparison_impl { + template + struct apply { + typedef list< + typename Begin::item, + typename insertion_sort_dims_insert::template apply< + typename Begin::next, + T + >::type + > type; + }; +}; + +// either prepend the current element or join it to +// the first remaining element of the sequence. +template<> +struct insertion_sort_dims_comparison_impl { + template + struct apply { + typedef typename push_front_or_add::type type; + }; +}; + +template +struct insertion_sort_dims_insert { + template + struct apply { + typedef typename insertion_sort_dims_comparison_impl::value>::template apply< + Begin, + N, + T + >::type type; + }; +}; + +template<> +struct insertion_sort_dims_insert<0> { + template + struct apply { + typedef list type; + }; +}; + +template +struct insertion_sort_dims_mpl_sequence { + template + struct apply { + typedef typename insertion_sort_dims_mpl_sequence::template apply::type>::type next; + typedef typename insertion_sort_dims_insert<(next::size::value)>::template apply::type>::type type; + }; +}; + +template<> +struct insertion_sort_dims_mpl_sequence<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct insertion_sort_dims_impl { + template + struct apply { + typedef typename insertion_sort_dims_impl::template apply::type next; + typedef typename insertion_sort_dims_insert<(next::size::value)>::template apply::type type; + }; +}; + +template<> +struct insertion_sort_dims_impl<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct sort_dims +{ + typedef typename insertion_sort_dims_mpl_sequence::value>::template apply::type>::type type; +}; + + +template +struct sort_dims > +{ + typedef typename insertion_sort_dims_impl::size::value>::template apply >::type type; +}; + +/// sorted sequences can be merged in linear time +template +struct merge_dimensions_func; + +template +struct merge_dimensions_impl; + +template<> +struct merge_dimensions_func +{ + template + struct apply + { + typedef list< + typename Begin1::item, + typename merge_dimensions_impl::template apply< + typename Begin1::next, + Begin2 + >::type + > type; + }; +}; + +template<> +struct merge_dimensions_func { + template + struct apply + { + typedef list< + typename Begin2::item, + typename merge_dimensions_impl::template apply< + typename Begin2::next, + Begin1 + >::type + > type; + }; +}; + +template<> +struct merge_dimensions_func { + template + struct apply + { + typedef typename mpl::plus::type combined; + typedef typename push_front_if::value>::template apply< + typename merge_dimensions_impl::template apply< + typename Begin1::next, + typename Begin2::next + >::type, + combined + >::type type; + }; +}; + +template +struct merge_dimensions_impl { + template + struct apply + { + typedef typename Begin1::item dim1; + typedef typename Begin2::item dim2; + + typedef typename merge_dimensions_func<(mpl::less::value == true), + (mpl::less::value == true)>::template apply< + Begin1, + Begin2, + N1, + N2 + >::type type; + }; +}; + +template +struct merge_dimensions +{ + typedef typename detail::merge_dimensions_impl::template + apply< + Sequence1, + Sequence2 + >::type type; +}; + +template +struct iterator_to_list +{ + template + struct apply + { + typedef list< + typename Begin::item, + typename iterator_to_list::template apply< + typename Begin::next + >::type + > type; + }; +}; + +template<> +struct iterator_to_list<0> +{ + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct merge_dimensions_impl +{ + template + struct apply + { + typedef typename iterator_to_list::template apply::type type; + }; +}; + +template +struct merge_dimensions_impl<0, N> +{ + template + struct apply + { + typedef typename iterator_to_list::template apply::type type; + }; +}; + +template<> +struct merge_dimensions_impl<0, 0> +{ + template + struct apply + { + typedef dimensionless_type type; + }; +}; + +template +struct static_inverse_impl +{ + template + struct apply { + typedef list< + typename mpl::negate::type, + typename static_inverse_impl::template apply< + typename Begin::next + >::type + > type; + }; +}; + +template<> +struct static_inverse_impl<0> +{ + template + struct apply + { + typedef dimensionless_type type; + }; +}; + +template +struct static_power_impl +{ + template + struct apply + { + typedef list< + typename mpl::times::type, + typename detail::static_power_impl::template apply::type + > type; + }; +}; + +template<> +struct static_power_impl<0> +{ + template + struct apply + { + typedef dimensionless_type type; + }; +}; + +template +struct static_root_impl { + template + struct apply { + typedef list< + typename mpl::divides::type, + typename detail::static_root_impl::template apply::type + > type; + }; +}; + +template<> +struct static_root_impl<0> { + template + struct apply + { + typedef dimensionless_type type; + }; +}; + +} // namespace detail + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_DIMENSION_IMPL_HPP diff --git a/deal.II/contrib/boost/include/boost/units/detail/dimension_list.hpp b/deal.II/contrib/boost/include/boost/units/detail/dimension_list.hpp new file mode 100644 index 0000000000..fc05547765 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/dimension_list.hpp @@ -0,0 +1,133 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DIMENSION_LIST_HPP +#define BOOST_UNITS_DIMENSION_LIST_HPP + +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace boost { + +namespace units { + +struct dimensionless_type; + +namespace detail { + +struct dimension_list_tag { }; + +} // namespace detail + +template +struct list +{ + typedef detail::dimension_list_tag tag; + typedef list type; + typedef Item item; + typedef Next next; + typedef typename mpl::next::type size; +}; + +} // namespace units + +namespace mpl { + +// INTERNAL ONLY +template<> +struct size_impl +{ + template struct apply : public L::size { }; +}; + +// INTERNAL ONLY +template<> +struct begin_impl +{ + template + struct apply + { + typedef L type; + }; +}; + +// INTERNAL ONLY +template<> +struct end_impl +{ + template + struct apply + { + typedef units::dimensionless_type type; + }; +}; + +// INTERNAL ONLY +template<> +struct push_front_impl +{ + template + struct apply + { + typedef units::list type; + }; +}; + +// INTERNAL ONLY +template<> +struct pop_front_impl +{ + template + struct apply + { + typedef typename L::next type; + }; +}; + +// INTERNAL ONLY +template<> +struct front_impl +{ + template + struct apply + { + typedef typename L::item type; + }; +}; + +// INTERNAL ONLY +template +struct deref > +{ + typedef Item type; +}; + +} // namespace mpl + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::list, 2) + +#endif + +#include + +#endif // BOOST_UNITS_DIMENSION_LIST_HPP diff --git a/deal.II/contrib/boost/include/boost/units/detail/dimensionless_unit.hpp b/deal.II/contrib/boost/include/boost/units/detail/dimensionless_unit.hpp new file mode 100644 index 0000000000..bc3223b06a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/dimensionless_unit.hpp @@ -0,0 +1,88 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_DIMENSIONLESS_UNIT_HPP +#define BOOST_UNITS_DETAIL_DIMENSIONLESS_UNIT_HPP + +#include +#include + +namespace boost { +namespace units { + +template +struct heterogeneous_system; + +template +struct homogeneous_system; + +template +struct heterogeneous_system_impl; + +namespace detail { + +template +struct void_if_dimensionless { + typedef int type; +}; + +template +struct void_if_dimensionless > { + typedef void type; +}; + +template<> +struct void_if_dimensionless< + boost::units::heterogeneous_system< + boost::units::heterogeneous_system_impl< + boost::units::dimensionless_type, + boost::units::dimensionless_type, + boost::units::dimensionless_type + > + > +> { + typedef void type; +}; + +template +struct void_if_heterogeneous { + typedef void type; +}; + +template +struct void_if_heterogeneous::type> { + typedef int type; +}; + +template +struct is_dimensionless_system : mpl::false_ {}; + +template +struct is_dimensionless_system::type> : mpl::true_ {}; + +#define BOOST_UNITS_DIMENSIONLESS_UNIT(T)\ + boost::units::unit<\ + boost::units::dimensionless_type,\ + T,\ + typename ::boost::units::detail::void_if_dimensionless::type\ + > + +#define BOOST_UNITS_HETEROGENEOUS_DIMENSIONLESS_UNIT(T)\ + boost::units::unit<\ + boost::units::dimensionless_type,\ + T,\ + typename ::boost::units::detail::void_if_heterogeneous::type\ + > + +} +} +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/heterogeneous_conversion.hpp b/deal.II/contrib/boost/include/boost/units/detail/heterogeneous_conversion.hpp new file mode 100644 index 0000000000..bfdf9876d4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/heterogeneous_conversion.hpp @@ -0,0 +1,309 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_HETEROGENEOUS_CONVERSION_HPP +#define BOOST_UNITS_DETAIL_HETEROGENEOUS_CONVERSION_HPP + +#include +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +namespace detail { + +struct solve_end { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +struct no_solution {}; + +template +struct solve_normal { + template + struct apply { + typedef typename Begin::next next; + typedef list< + typename mpl::minus< + typename mpl::times::type, + typename mpl::times::type + >::type, + typename Next::template apply::type + > type; + }; +}; + +template +struct solve_leading_zeroes { + template + struct apply { + typedef list< + typename Begin::item, + typename Next::template apply::type + > type; + }; + typedef solve_leading_zeroes type; +}; + +template<> +struct solve_leading_zeroes { + typedef no_solution type; +}; + +template +struct solve_first_non_zero { + template + struct apply { + typedef typename Next::template apply< + typename Begin::next, + typename Begin::item + >::type type; + }; +}; + +template +struct solve_internal_zero { + template + struct apply { + typedef list< + typename Begin::item, + typename Next::template apply::type + > type; + }; +}; + +template +struct make_solve_list_internal_zero { + template + struct apply { + typedef solve_normal type; + }; +}; + +template<> +struct make_solve_list_internal_zero > { + template + struct apply { + typedef solve_internal_zero type; + }; +}; + +template +struct make_solve_list_normal { + template + struct apply { + typedef typename make_solve_list_internal_zero< + typename Begin::item + >::template apply< + typename make_solve_list_normal::template apply::type, + X + >::type type; + }; +}; + +template<> +struct make_solve_list_normal<0> { + template + struct apply { + typedef solve_end type; + }; +}; + +template +struct make_solve_list_leading_zeroes; + +template +struct make_solve_list_first_non_zero { + template + struct apply { + typedef solve_first_non_zero< + typename make_solve_list_normal::template apply< + typename Begin::next, + typename Begin::item + >::type + > type; + }; +}; + +template<> +struct make_solve_list_first_non_zero > { + template + struct apply { + typedef typename solve_leading_zeroes< + typename make_solve_list_leading_zeroes::template apply< + typename Begin::next + >::type + >::type type; + }; +}; + +template +struct make_solve_list_leading_zeroes { + template + struct apply { + typedef typename make_solve_list_first_non_zero::template apply::type type; + }; +}; + +template<> +struct make_solve_list_leading_zeroes<0> { + template + struct apply { + typedef no_solution type; + }; +}; + +template +struct try_add_unit_impl { + template + struct apply { + typedef typename try_add_unit_impl::template apply::type next; + typedef typename Begin::item::template apply::type type; + BOOST_STATIC_ASSERT((next::size::value - 1 == type::size::value)); + }; +}; + +template<> +struct try_add_unit_impl<0> { + template + struct apply { + typedef L type; + }; +}; + +template +struct make_homogeneous_system_impl; + +template +struct make_homogeneous_system_func; + +template +struct make_homogeneous_system_func { + template + struct apply { + typedef typename make_homogeneous_system_impl::template apply< + typename Begin::next, + list, + list, + Dimensions + >::type type; + }; +}; + +template +struct make_homogeneous_system_func { + template + struct apply { + typedef list type; + }; +}; + +template<> +struct make_homogeneous_system_func { + template + struct apply { + typedef typename make_homogeneous_system_impl::template apply< + typename Begin::next, + Current, + Units, + Dimensions + >::type type; + }; +}; + +template<> +struct make_homogeneous_system_func { + template + struct apply { + typedef typename make_homogeneous_system_impl::template apply< + typename Begin::next, + Current, + Units, + Dimensions + >::type type; + }; +}; + +template +struct make_homogeneous_system_impl { + template + struct apply { + typedef typename expand_dimensions::template apply< + Dimensions, + typename Begin::item::dimension_type + >::type dimensions; + typedef typename try_add_unit_impl::template apply::type new_element; + typedef typename make_solve_list_leading_zeroes::template apply::type new_func; + typedef typename make_homogeneous_system_func< + new_func, + ((Current::size::value)+1) == (Dimensions::size::value) + >::template apply::type type; + }; +}; + +template<> +struct make_homogeneous_system_impl<0> { + template + struct apply { + typedef Units type; + }; +}; + +template +struct make_homogeneous_system { + typedef typename find_base_dimensions::type base_dimensions; + typedef homogeneous_system< + typename insertion_sort< + typename make_homogeneous_system_impl< + Units::size::value + >::template apply< + Units, + dimensionless_type, + dimensionless_type, + base_dimensions + >::type + >::type + > type; +}; + +template +struct extract_base_units { + template + struct apply { + typedef list< + typename Begin::item::tag_type, + typename extract_base_units::template apply::type + > type; + }; +}; + +template<> +struct extract_base_units<0> { + template + struct apply { + typedef T type; + }; +}; + +} + +} + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/linear_algebra.hpp b/deal.II/contrib/boost/include/boost/units/detail/linear_algebra.hpp new file mode 100644 index 0000000000..20964a9edd --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/linear_algebra.hpp @@ -0,0 +1,1060 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_LINEAR_ALGEBRA_HPP +#define BOOST_UNITS_DETAIL_LINEAR_ALGEBRA_HPP + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace detail { + +// typedef list equation; + +template +struct eliminate_from_pair_of_equations_impl; + +template +struct eliminate_from_pair_of_equations; + +template +struct elimination_impl; + +template +struct elimination_skip_leading_zeros_impl; + +template +struct substitute; + +template +struct substitute_impl; + +template +struct solve_impl; + +template +struct solve; + +template +struct check_extra_equations_impl; + +template +struct normalize_units_impl; + +struct inconsistent {}; + +// generally useful utilies. + +template +struct divide_equation { + template + struct apply { + typedef list::type, typename divide_equation::template apply::type> type; + }; +}; + +template<> +struct divide_equation<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +// eliminate_from_pair_of_equations takes a pair of +// equations and eliminates the first variable. +// +// equation eliminate_from_pair_of_equations(equation l1, equation l2) { +// rational x1 = l1.front(); +// rational x2 = l2.front(); +// return(transform(pop_front(l1), pop_front(l2), _1 * x2 - _2 * x1)); +// } + +template +struct eliminate_from_pair_of_equations_impl { + template + struct apply { + typedef list< + typename mpl::minus< + typename mpl::times::type, + typename mpl::times::type + >::type, + typename eliminate_from_pair_of_equations_impl::template apply< + typename Begin1::next, + typename Begin2::next, + X1, + X2 + >::type + > type; + }; +}; + +template<> +struct eliminate_from_pair_of_equations_impl<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct eliminate_from_pair_of_equations { + typedef E1 begin1; + typedef E2 begin2; + typedef typename eliminate_from_pair_of_equations_impl<(E1::size::value - 1)>::template apply< + typename begin1::next, + typename begin2::next, + typename begin1::item, + typename begin2::item + >::type type; +}; + + + +// Stage 1. Determine which dimensions should +// have dummy base units. For this purpose +// row reduce the matrix. + +template +struct make_zero_vector { + typedef list, typename make_zero_vector::type> type; +}; +template<> +struct make_zero_vector<0> { + typedef dimensionless_type type; +}; + +template +struct create_row_of_identity { + typedef list, typename create_row_of_identity::type> type; +}; +template +struct create_row_of_identity<0, TotalColumns> { + typedef list, typename make_zero_vector::type> type; +}; +template +struct create_row_of_identity { + // error +}; + +template +struct determine_extra_equations_impl; + +template +struct determine_extra_equations_skip_zeros_impl; + +// not the last row and not zero. +template<> +struct determine_extra_equations_skip_zeros_impl { + template + struct apply { + // remove the equation being eliminated against from the set of equations. + typedef typename determine_extra_equations_impl::template apply::type next_equations; + // since this column was present, strip it out. + typedef Result type; + }; +}; + +// the last row but not zero. +template<> +struct determine_extra_equations_skip_zeros_impl { + template + struct apply { + // remove this equation. + typedef dimensionless_type next_equations; + // since this column was present, strip it out. + typedef Result type; + }; +}; + + +// the first columns is zero but it is not the last column. +// continue with the same loop. +template<> +struct determine_extra_equations_skip_zeros_impl { + template + struct apply { + typedef typename RowsBegin::next::item next_row; + typedef typename determine_extra_equations_skip_zeros_impl< + next_row::item::Numerator == 0, + RemainingRows == 2 // the next one will be the last. + >::template apply< + typename RowsBegin::next, + RemainingRows - 1, + CurrentColumn, + TotalColumns, + Result + > next; + typedef list next_equations; + typedef typename next::type type; + }; +}; + +// all the elements in this column are zero. +template<> +struct determine_extra_equations_skip_zeros_impl { + template + struct apply { + typedef list next_equations; + typedef list::type, Result> type; + }; +}; + +template +struct determine_extra_equations_impl { + template + struct apply { + typedef list< + typename eliminate_from_pair_of_equations::type, + typename determine_extra_equations_impl::template apply::type + > type; + }; +}; + +template<> +struct determine_extra_equations_impl<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct determine_extra_equations { + template + struct apply { + typedef typename RowsBegin::item top_row; + typedef typename determine_extra_equations_skip_zeros_impl< + top_row::item::Numerator == 0, + RowsBegin::item::size::value == 1 + >::template apply< + RowsBegin, + RowsBegin::size::value, + TotalColumns - RemainingColumns, + TotalColumns, + Result + > column_info; + typedef typename determine_extra_equations< + RemainingColumns - 1, + column_info::next_equations::size::value == 0 + >::template apply< + typename column_info::next_equations, + TotalColumns, + typename column_info::type + >::type type; + }; +}; + +template +struct determine_extra_equations { + template + struct apply { + typedef typename determine_extra_equations::template apply< + RowsBegin, + TotalColumns, + list::type, Result> + >::type type; + }; +}; + +template<> +struct determine_extra_equations<0, true> { + template + struct apply { + typedef Result type; + }; +}; + +// Stage 2 +// invert the matrix using Gauss-Jordan elimination + + +template +struct invert_strip_leading_zeroes; + +template +struct invert_handle_after_pivot_row; + +// When processing column N, none of the first N rows +// can be the pivot column. +template +struct invert_handle_inital_rows { + template + struct apply { + typedef typename invert_handle_inital_rows::template apply< + typename RowsBegin::next, + typename IdentityBegin::next + > next; + typedef typename RowsBegin::item current_row; + typedef typename IdentityBegin::item current_identity_row; + typedef typename next::pivot_row pivot_row; + typedef typename next::identity_pivot_row identity_pivot_row; + typedef list< + typename eliminate_from_pair_of_equations_impl<(current_row::size::value) - 1>::template apply< + typename current_row::next, + pivot_row, + typename current_row::item, + static_rational<1> + >::type, + typename next::new_matrix + > new_matrix; + typedef list< + typename eliminate_from_pair_of_equations_impl<(current_identity_row::size::value)>::template apply< + current_identity_row, + identity_pivot_row, + typename current_row::item, + static_rational<1> + >::type, + typename next::identity_result + > identity_result; + }; +}; + +// This handles the switch to searching for a pivot column. +// The pivot row will be propagated up in the typedefs +// pivot_row and identity_pivot_row. It is inserted here. +template<> +struct invert_handle_inital_rows<0> { + template + struct apply { + typedef typename RowsBegin::item current_row; + typedef typename invert_strip_leading_zeroes< + (current_row::item::Numerator == 0), + (RowsBegin::size::value == 1) + >::template apply< + RowsBegin, + IdentityBegin + > next; + // results + typedef list new_matrix; + typedef list identity_result; + typedef typename next::pivot_row pivot_row; + typedef typename next::identity_pivot_row identity_pivot_row; + }; +}; + +// The first internal element which is not zero. +template<> +struct invert_strip_leading_zeroes { + template + struct apply { + typedef typename RowsBegin::item current_row; + typedef typename current_row::item current_value; + typedef typename divide_equation<(current_row::size::value - 1)>::template apply::type new_equation; + typedef typename divide_equation<(IdentityBegin::item::size::value)>::template apply::type transformed_identity_equation; + typedef typename invert_handle_after_pivot_row<(RowsBegin::size::value - 1)>::template apply< + typename RowsBegin::next, + typename IdentityBegin::next, + new_equation, + transformed_identity_equation + > next; + + // results + // Note that we don't add the pivot row to the + // results here, because it needs to propagated up + // to the diagonal. + typedef typename next::new_matrix new_matrix; + typedef typename next::identity_result identity_result; + typedef new_equation pivot_row; + typedef transformed_identity_equation identity_pivot_row; + }; +}; + +// The one and only non-zero element--at the end +template<> +struct invert_strip_leading_zeroes { + template + struct apply { + typedef typename RowsBegin::item current_row; + typedef typename current_row::item current_value; + typedef typename divide_equation<(current_row::size::value - 1)>::template apply::type new_equation; + typedef typename divide_equation<(IdentityBegin::item::size::value)>::template apply::type transformed_identity_equation; + + // results + // Note that we don't add the pivot row to the + // results here, because it needs to propagated up + // to the diagonal. + typedef dimensionless_type identity_result; + typedef dimensionless_type new_matrix; + typedef new_equation pivot_row; + typedef transformed_identity_equation identity_pivot_row; + }; +}; + +// One of the initial zeroes +template<> +struct invert_strip_leading_zeroes { + template + struct apply { + typedef typename RowsBegin::item current_row; + typedef typename RowsBegin::next::item next_row; + typedef typename invert_strip_leading_zeroes< + next_row::item::Numerator == 0, + RowsBegin::size::value == 2 + >::template apply< + typename RowsBegin::next, + typename IdentityBegin::next + > next; + typedef typename IdentityBegin::item current_identity_row; + // these are propagated up. + typedef typename next::pivot_row pivot_row; + typedef typename next::identity_pivot_row identity_pivot_row; + typedef list< + typename eliminate_from_pair_of_equations_impl<(current_row::size::value - 1)>::template apply< + typename current_row::next, + pivot_row, + typename current_row::item, + static_rational<1> + >::type, + typename next::new_matrix + > new_matrix; + typedef list< + typename eliminate_from_pair_of_equations_impl<(current_identity_row::size::value)>::template apply< + current_identity_row, + identity_pivot_row, + typename current_row::item, + static_rational<1> + >::type, + typename next::identity_result + > identity_result; + }; +}; + +// the last element, and is zero. +// Should never happen. +template<> +struct invert_strip_leading_zeroes { +}; + +template +struct invert_handle_after_pivot_row { + template + struct apply { + typedef typename invert_handle_after_pivot_row::template apply< + typename RowsBegin::next, + typename IdentityBegin::next, + MatrixPivot, + IdentityPivot + > next; + typedef typename RowsBegin::item current_row; + typedef typename IdentityBegin::item current_identity_row; + typedef MatrixPivot pivot_row; + typedef IdentityPivot identity_pivot_row; + + // results + typedef list< + typename eliminate_from_pair_of_equations_impl<(current_row::size::value - 1)>::template apply< + typename current_row::next, + pivot_row, + typename current_row::item, + static_rational<1> + >::type, + typename next::new_matrix + > new_matrix; + typedef list< + typename eliminate_from_pair_of_equations_impl<(current_identity_row::size::value)>::template apply< + current_identity_row, + identity_pivot_row, + typename current_row::item, + static_rational<1> + >::type, + typename next::identity_result + > identity_result; + }; +}; + +template<> +struct invert_handle_after_pivot_row<0> { + template + struct apply { + typedef dimensionless_type new_matrix; + typedef dimensionless_type identity_result; + }; +}; + +template +struct invert_impl { + template + struct apply { + typedef typename invert_handle_inital_rows::template apply process_column; + typedef typename invert_impl::template apply< + typename process_column::new_matrix, + typename process_column::identity_result + >::type type; + }; +}; + +template<> +struct invert_impl<0> { + template + struct apply { + typedef IdentityBegin type; + }; +}; + +template +struct make_identity { + template + struct apply { + typedef list::type, typename make_identity::template apply::type> type; + }; +}; + +template<> +struct make_identity<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct make_square_and_invert { + typedef typename Matrix::item top_row; + typedef typename determine_extra_equations<(top_row::size::value), false>::template apply< + Matrix, // RowsBegin + top_row::size::value, // TotalColumns + Matrix // Result + >::type invertible; + typedef typename invert_impl::template apply< + invertible, + typename make_identity::template apply::type + >::type type; +}; + + +// find_base_dimensions takes a list of +// base_units and returns a sorted list +// of all the base_dimensions they use. +// +// list find_base_dimensions(list l) { +// set dimensions; +// for_each(base_unit unit : l) { +// for_each(dim d : unit.dimension_type) { +// dimensions = insert(dimensions, d.tag_type); +// } +// } +// return(sort(dimensions, _1 > _2, front_inserter(list()))); +// } + +typedef char set_no; +struct set_yes { set_no dummy[2]; }; + +template +struct wrap {}; + +struct set_end { + static set_no lookup(...); + typedef mpl::long_<0> size; +}; + +template +struct set : Next { + using Next::lookup; + static set_yes lookup(wrap*); + typedef T item; + typedef Next next; + typedef typename mpl::next::type size; +}; + +template +struct set_insert; + +template<> +struct set_insert { + template + struct apply { + typedef Set type; + }; +}; + +template<> +struct set_insert { + template + struct apply { + typedef set type; + }; +}; + +template +struct has_key { + static const long size = sizeof(Set::lookup((wrap*)0)); + static const bool value = (size == sizeof(set_yes)); +}; + +template +struct find_base_dimensions_impl_impl { + template + struct apply { + typedef typename find_base_dimensions_impl_impl::template apply< + typename Begin::next, + S + >::type next; + + typedef typename set_insert< + (has_key::value) + >::template apply< + next, + typename Begin::item::tag_type + >::type type; + }; +}; + +template<> +struct find_base_dimensions_impl_impl<0> { + template + struct apply { + typedef S type; + }; +}; + +template +struct find_base_dimensions_impl { + template + struct apply { + typedef typename find_base_dimensions_impl_impl<(Begin::item::dimension_type::size::value)>::template apply< + typename Begin::item::dimension_type, + typename find_base_dimensions_impl::template apply::type + >::type type; + }; +}; + +template<> +struct find_base_dimensions_impl<0> { + template + struct apply { + typedef set_end type; + }; +}; + +template +struct find_base_dimensions { + typedef typename insertion_sort< + typename find_base_dimensions_impl< + (T::size::value) + >::template apply::type + >::type type; +}; + +// calculate_base_dimension_coefficients finds +// the coefficients corresponding to the first +// base_dimension in each of the dimension_lists. +// It returns two values. The first result +// is a list of the coefficients. The second +// is a list with all the incremented iterators. +// When we encounter a base_dimension that is +// missing from a dimension_list, we do not +// increment the iterator and we set the +// coefficient to zero. + +template +struct calculate_base_dimension_coefficients_func; + +template<> +struct calculate_base_dimension_coefficients_func { + template + struct apply { + typedef typename T::item::value_type type; + typedef typename T::next next; + }; +}; + +template<> +struct calculate_base_dimension_coefficients_func { + template + struct apply { + typedef static_rational<0> type; + typedef T next; + }; +}; + +// begins_with_dimension returns true iff its first +// parameter is a valid iterator which yields its +// second parameter when dereferenced. + +template +struct begins_with_dimension { + template + struct apply : + boost::is_same< + Dim, + typename Iterator::item::tag_type + > {}; +}; + +template<> +struct begins_with_dimension { + template + struct apply : mpl::false_ {}; +}; + +template +struct calculate_base_dimension_coefficients_impl { + template + struct apply { + typedef typename calculate_base_dimension_coefficients_func< + begins_with_dimension::template apply< + Dim + >::value + >::template apply< + typename BaseUnitDimensions::item + > result; + typedef typename calculate_base_dimension_coefficients_impl::template apply< + typename BaseUnitDimensions::next, + Dim, + list + > next_; + typedef typename next_::type type; + typedef list next; + }; +}; + +template<> +struct calculate_base_dimension_coefficients_impl<0> { + template + struct apply { + typedef T type; + typedef dimensionless_type next; + }; +}; + +// add_zeroes pushs N zeroes onto the +// front of a list. +// +// list add_zeroes(list l, int N) { +// if(N == 0) { +// return(l); +// } else { +// return(push_front(add_zeroes(l, N-1), 0)); +// } +// } + +template +struct add_zeroes_impl { + // If you get an error here and your base units are + // in fact linearly independent, please report it. + BOOST_MPL_ASSERT_MSG((N > 0), base_units_are_probably_not_linearly_independent, (void)); + template + struct apply { + typedef list< + static_rational<0>, + typename add_zeroes_impl::template apply::type + > type; + }; +}; + +template<> +struct add_zeroes_impl<0> { + template + struct apply { + typedef T type; + }; +}; + +// expand_dimensions finds the exponents of +// a set of dimensions in a dimension_list. +// the second parameter is assumed to be +// a superset of the base_dimensions of +// the first parameter. +// +// list expand_dimensions(dimension_list, list); + +template +struct expand_dimensions { + template + struct apply { + typedef typename calculate_base_dimension_coefficients_func< + begins_with_dimension::template apply::value + >::template apply result; + typedef list< + typename result::type, + typename expand_dimensions::template apply::type + > type; + }; +}; + +template<> +struct expand_dimensions<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct create_unit_matrix { + template + struct apply { + typedef typename create_unit_matrix::template apply::type next; + typedef list::template apply::type, next> type; + }; +}; + +template<> +struct create_unit_matrix<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct normalize_units { + typedef typename find_base_dimensions::type dimensions; + typedef typename create_unit_matrix<(T::size::value)>::template apply< + T, + dimensions + >::type matrix; + typedef typename make_square_and_invert::type type; + static const long extra = (type::size::value) - (T::size::value); +}; + +// multiply_add_units computes M x V +// where M is a matrix and V is a horizontal +// vector +// +// list multiply_add_units(list >, list); + +template +struct multiply_add_units_impl { + template + struct apply { + typedef list< + typename mpl::plus< + typename mpl::times< + typename Begin2::item, + X + >::type, + typename Begin1::item + >::type, + typename multiply_add_units_impl::template apply< + typename Begin1::next, + typename Begin2::next, + X + >::type + > type; + }; +}; + +template<> +struct multiply_add_units_impl<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct multiply_add_units { + template + struct apply { + typedef typename multiply_add_units_impl< + (Begin2::item::size::value) + >::template apply< + typename multiply_add_units::template apply< + typename Begin1::next, + typename Begin2::next + >::type, + typename Begin2::item, + typename Begin1::item + >::type type; + }; +}; + +template<> +struct multiply_add_units<1> { + template + struct apply { + typedef typename add_zeroes_impl< + (Begin2::item::size::value) + >::template apply::type type1; + typedef typename multiply_add_units_impl< + (Begin2::item::size::value) + >::template apply< + type1, + typename Begin2::item, + typename Begin1::item + >::type type; + }; +}; + + +// strip_zeroes erases the first N elements of a list if +// they are all zero, otherwise returns inconsistent +// +// list strip_zeroes(list l, int N) { +// if(N == 0) { +// return(l); +// } else if(l.front == 0) { +// return(strip_zeroes(pop_front(l), N-1)); +// } else { +// return(inconsistent); +// } +// } + +template +struct strip_zeroes_impl; + +template +struct strip_zeroes_func { + template + struct apply { + typedef inconsistent type; + }; +}; + +template<> +struct strip_zeroes_func > { + template + struct apply { + typedef typename strip_zeroes_impl::template apply::type type; + }; +}; + +template +struct strip_zeroes_impl { + template + struct apply { + typedef typename strip_zeroes_func::template apply::type type; + }; +}; + +template<> +struct strip_zeroes_impl<0> { + template + struct apply { + typedef T type; + }; +}; + +// Given a list of base_units, computes the +// exponents of each base unit for a given +// dimension. +// +// list calculate_base_unit_exponents(list units, dimension_list dimensions); + +template +struct is_base_dimension_unit { + typedef mpl::false_ type; + typedef void base_dimension_type; +}; +template +struct is_base_dimension_unit >, dimensionless_type> > { + typedef mpl::true_ type; + typedef T base_dimension_type; +}; + +template +struct is_simple_system_impl { + template + struct apply { + typedef is_base_dimension_unit test; + typedef mpl::and_< + typename test::type, + mpl::less, + typename is_simple_system_impl::template apply< + typename Begin::next, + typename test::base_dimension_type + > + > type; + static const bool value = (type::value); + }; +}; + +template<> +struct is_simple_system_impl<0> { + template + struct apply : mpl::true_ { + }; +}; + +template +struct is_simple_system { + typedef T Begin; + typedef is_base_dimension_unit test; + typedef typename mpl::and_< + typename test::type, + typename is_simple_system_impl< + T::size::value - 1 + >::template apply< + typename Begin::next::type, + typename test::base_dimension_type + > + >::type type; + static const bool value = type::value; +}; + +template +struct calculate_base_unit_exponents_impl; + +template<> +struct calculate_base_unit_exponents_impl { + template + struct apply { + typedef typename expand_dimensions<(T::size::value)>::template apply< + typename find_base_dimensions::type, + Dimensions + >::type type; + }; +}; + +template<> +struct calculate_base_unit_exponents_impl { + template + struct apply { + // find the units that correspond to each base dimension + typedef normalize_units base_solutions; + // pad the dimension with zeroes so it can just be a + // list of numbers, making the multiplication easy + // e.g. if the arguments are list and + // list then this step will + // yield list<0,1,-2> + typedef typename expand_dimensions<(base_solutions::dimensions::size::value)>::template apply< + typename base_solutions::dimensions, + Dimensions + >::type dimensions; + // take the unit corresponding to each base unit + // multiply each of its exponents by the exponent + // of the base_dimension in the result and sum. + typedef typename multiply_add_units::template apply< + dimensions, + typename base_solutions::type + >::type units; + // Now, verify that the dummy units really + // cancel out and remove them. + typedef typename strip_zeroes_impl::template apply::type type; + }; +}; + +template +struct calculate_base_unit_exponents { + typedef typename calculate_base_unit_exponents_impl::value>::template apply::type type; +}; + +} // namespace detail + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/one.hpp b/deal.II/contrib/boost/include/boost/units/detail/one.hpp new file mode 100644 index 0000000000..15bc7a40b7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/one.hpp @@ -0,0 +1,104 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_ONE_HPP +#define BOOST_UNITS_DETAIL_ONE_HPP + +#include + +namespace boost { + +namespace units { + +struct one { one() {} }; + +// workaround for pathscale. +inline one make_one() { + one result; + return(result); +} + +template +struct multiply_typeof_helper +{ + typedef T type; +}; + +template +struct multiply_typeof_helper +{ + typedef T type; +}; + +template<> +struct multiply_typeof_helper +{ + typedef one type; +}; + +template +inline T operator*(const one&, const T& t) +{ + return(t); +} + +template +inline T operator*(const T& t, const one&) +{ + return(t); +} + +inline one operator*(const one&, const one&) +{ + one result; + return(result); +} + +template +struct divide_typeof_helper +{ + typedef T type; +}; + +template +struct divide_typeof_helper +{ + typedef T type; +}; + +template<> +struct divide_typeof_helper +{ + typedef one type; +}; + +template +inline T operator/(const T& t, const one&) +{ + return(t); +} + +template +inline T operator/(const one&, const T& t) +{ + return(1/t); +} + +inline one operator/(const one&, const one&) +{ + one result; + return(result); +} + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/ordinal.hpp b/deal.II/contrib/boost/include/boost/units/detail/ordinal.hpp new file mode 100644 index 0000000000..b47ef67424 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/ordinal.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_ORDINAL_HPP_INCLUDED +#define BOOST_UNITS_DETAIL_ORDINAL_HPP_INCLUDED + +#include +#include + +namespace boost { +namespace units { + +namespace detail { + +struct ordinal_tag {}; + +} + +template +struct ordinal { + typedef detail::ordinal_tag tag; + static const long value = N; +}; + +template +const long ordinal::value; + +} + +namespace mpl { + +template<> +struct less_impl { + template + struct apply : bool_<(T1::value) < (T2::value)> {}; +}; + +} + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/prevent_redefinition.hpp b/deal.II/contrib/boost/include/boost/units/detail/prevent_redefinition.hpp new file mode 100644 index 0000000000..fba969ae38 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/prevent_redefinition.hpp @@ -0,0 +1,54 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_PREVENT_REDEFINITION_HPP +#define BOOST_UNITS_DETAIL_PREVENT_REDEFINITION_HPP + +#include + +namespace boost { + +namespace units { + +namespace detail { + +struct no { no() {} char dummy; }; +struct yes { no dummy[2]; }; + +template struct ordinal_has_already_been_defined; + +template<> +struct ordinal_has_already_been_defined { }; + +template<> +struct ordinal_has_already_been_defined { typedef void type; }; + +} + +/// This must be in namespace boost::units so that ADL +/// will work. we need a mangled name because it must +/// be found by ADL +/// INTERNAL ONLY +template +detail::no +boost_units_is_registered(const T&) +{ detail::no result; return(result); } + +/// INTERNAL ONLY +template +detail::no +boost_units_unit_is_registered(const T&) +{ detail::no result; return(result); } + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_PREVENT_ORDINAL_REDEFINITION_IMPL_HPP diff --git a/deal.II/contrib/boost/include/boost/units/detail/push_front_if.hpp b/deal.II/contrib/boost/include/boost/units/detail/push_front_if.hpp new file mode 100644 index 0000000000..b924a24c6b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/push_front_if.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_PUSH_FRONT_IF_HPP +#define BOOST_UNITS_DETAIL_PUSH_FRONT_IF_HPP + +namespace boost { + +namespace units { + +template +struct list; + +namespace detail { + +template +struct push_front_if; + +template<> +struct push_front_if { + template + struct apply { + typedef list type; + }; +}; + +template<> +struct push_front_if { + template + struct apply { + typedef L type; + }; +}; + +} + +} + +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/push_front_or_add.hpp b/deal.II/contrib/boost/include/boost/units/detail/push_front_or_add.hpp new file mode 100644 index 0000000000..a3092da766 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/push_front_or_add.hpp @@ -0,0 +1,84 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_PUSH_FRONT_OR_ADD_HPP +#define BOOST_UNITS_DETAIL_PUSH_FRONT_OR_ADD_HPP + +#include +#include +#include +#include +#include + +#include +#include + +namespace boost { + +namespace units { + +template +struct list; + +namespace detail { + +template +struct is_empty_dim; + +/// add an instantiation of dim to Sequence. +template +struct push_front_or_add_impl; + +template<> +struct push_front_or_add_impl +{ + template + struct apply + { + typedef typename mpl::plus::type item; + typedef typename push_front_if::value>::template apply< + typename Sequence::next, + item + > type; + }; +}; + +template<> +struct push_front_or_add_impl +{ + template + struct apply + { + typedef list type; + }; +}; + +template +struct push_front_or_add +{ + typedef typename push_front_or_add_impl::value>::template apply< + Sequence, + T + >::type type; +}; + +template +struct push_front_or_add +{ + typedef list type; +}; + +} // namespace detail + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/sort.hpp b/deal.II/contrib/boost/include/boost/units/detail/sort.hpp new file mode 100644 index 0000000000..389adfe6ec --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/sort.hpp @@ -0,0 +1,109 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_SORT_HPP +#define BOOST_UNITS_DETAIL_SORT_HPP + +#include +#include +#include +#include +#include +#include + +#include +#include + +namespace boost { + +namespace units { + +namespace detail { + +template +struct insertion_sort_insert; + +template +struct insertion_sort_comparison_impl; + +// have to recursively add the element to the next sequence. +template<> +struct insertion_sort_comparison_impl { + template + struct apply { + typedef list< + typename Begin::item, + typename insertion_sort_insert::template apply< + typename Begin::next, + T + >::type + > type; + }; +}; + +// prepend the current element +template<> +struct insertion_sort_comparison_impl { + template + struct apply { + typedef list type; + }; +}; + +template +struct insertion_sort_insert { + template + struct apply { + typedef typename insertion_sort_comparison_impl::value>::template apply< + Begin, + N, + T + >::type type; + }; +}; + +template<> +struct insertion_sort_insert<0> { + template + struct apply { + typedef list type; + }; +}; + +template +struct insertion_sort_impl { + template + struct apply { + typedef typename insertion_sort_impl::template apply::type next; + typedef typename insertion_sort_insert<(next::size::value)>::template apply::type type; + }; +}; + +template<> +struct insertion_sort_impl<0> { + template + struct apply { + typedef dimensionless_type type; + }; +}; + +template +struct insertion_sort +{ + typedef typename insertion_sort_impl::template apply::type type; +}; + +} // namespace detail + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/static_rational_power.hpp b/deal.II/contrib/boost/include/boost/units/detail/static_rational_power.hpp new file mode 100644 index 0000000000..9c71f55ab7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/static_rational_power.hpp @@ -0,0 +1,206 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_STATIC_RATIONAL_POWER_HPP +#define BOOST_UNITS_DETAIL_STATIC_RATIONAL_POWER_HPP + +#include + +#include +#include + +namespace boost { + +namespace units { + +template +class static_rational; + +namespace detail { + +namespace typeof_pow_adl_barrier { + +using std::pow; + +template +struct typeof_pow +{ +#if defined(BOOST_UNITS_HAS_BOOST_TYPEOF) + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, pow(typeof_::make(), 0.0)) + typedef typename nested::type type; +#elif defined(BOOST_UNITS_HAS_MWERKS_TYPEOF) + typedef __typeof__(pow(typeof_::make(), 0.0)) type; +#elif defined(BOOST_UNITS_HAS_GNU_TYPEOF) + typedef typeof(pow(typeof_::make(), 0.0)) type; +#else + typedef Y type; +#endif +}; + +} + +template +struct static_rational_power_impl +{ + typedef typename typeof_pow_adl_barrier::typeof_pow::type type; + static type call(const Y& y) + { + using std::pow; + return(pow(y, static_cast(R::Numerator) / static_cast(R::Denominator))); + } +}; + +template +struct static_rational_power_impl +{ + typedef one type; + static one call(const one&) + { + one result; + return(result); + } +}; + +template +struct static_rational_power_impl, one> +{ + typedef one type; + static one call(const one&) + { + one result; + return(result); + } +}; + +template +struct static_int_power_impl; + +template +struct static_int_power_impl +{ + template + struct apply + { + typedef typename multiply_typeof_helper::type square_type; + typedef typename static_int_power_impl<(N >> 1)>::template apply next; + typedef typename next::type type; + static type call(const Y& y, const R& r) + { + const Y square = y * y; + return(next::call(square, r)); + } + }; +}; + +template +struct static_int_power_impl +{ + template + struct apply + { + typedef typename multiply_typeof_helper::type square_type; + typedef typename multiply_typeof_helper::type new_r; + typedef typename static_int_power_impl<(N >> 1)>::template apply next; + typedef typename next::type type; + static type call(const Y& y, const R& r) + { + const Y square = y * y; + return(next::call(square, y * r)); + } + }; +}; + +template<> +struct static_int_power_impl<1, false> +{ + template + struct apply + { + typedef typename multiply_typeof_helper::type type; + static type call(const Y& y, const R& r) + { + return(y * r); + } + }; +}; + +template<> +struct static_int_power_impl<0, true> +{ + template + struct apply + { + typedef R type; + static R call(const Y&, const R& r) + { + return(r); + } + }; +}; + +template +struct static_int_power_sign_impl; + +template +struct static_int_power_sign_impl +{ + template + struct apply + { + typedef typename static_int_power_impl::template apply impl; + typedef typename impl::type type; + static type call(const Y& y) + { + one result; + return(impl::call(y, result)); + } + }; +}; + +template +struct static_int_power_sign_impl +{ + template + struct apply + { + typedef typename static_int_power_impl<-N>::template apply impl; + typedef typename divide_typeof_helper::type type; + static type call(const Y& y) + { + one result; + return(result/impl::call(y, result)); + } + }; +}; + +template +struct static_rational_power_impl, Y> +{ + typedef typename static_int_power_sign_impl::template apply impl; + typedef typename impl::type type; + static Y call(const Y& y) + { + return(impl::call(y)); + } +}; + +template +typename detail::static_rational_power_impl::type static_rational_power(const Y& y) +{ + return(detail::static_rational_power_impl::call(y)); +} + +} // namespace detail + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/unscale.hpp b/deal.II/contrib/boost/include/boost/units/detail/unscale.hpp new file mode 100644 index 0000000000..08e51e96d5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/unscale.hpp @@ -0,0 +1,234 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DETAIL_UNSCALE_HPP_INCLUDED +#define BOOST_UNITS_DETAIL_UNSCALE_HPP_INCLUDED + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +template +struct heterogeneous_system; + +template +struct heterogeneous_system_impl; + +template +struct heterogeneous_system_dim; + +template +struct scaled_base_unit; + +/// removes all scaling from a unit or a base unit. +template +struct unscale +{ +#ifndef BOOST_UNITS_DOXYGEN + typedef T type; +#else + typedef detail::unspecified type; +#endif +}; + +/// INTERNAL ONLY +template +struct unscale > +{ + typedef typename unscale::type type; +}; + +/// INTERNAL ONLY +template +struct unscale > +{ + typedef unit::type> type; +}; + +/// INTERNAL ONLY +template +struct scale_list_dim; + +/// INTERNAL ONLY +template +struct get_scale_list +{ + typedef dimensionless_type type; +}; + +/// INTERNAL ONLY +template +struct get_scale_list > +{ + typedef typename mpl::times, dimensionless_type>, typename get_scale_list::type>::type type; +}; + +/// INTERNAL ONLY +template +struct get_scale_list > +{ + typedef typename get_scale_list::type type; +}; + +/// INTERNAL ONLY +struct scale_dim_tag {}; + +/// INTERNAL ONLY +template +struct scale_list_dim : Scale +{ + typedef scale_dim_tag tag; + typedef scale_list_dim type; +}; + +} // namespace units + +#ifndef BOOST_UNITS_DOXYGEN + +namespace mpl { + +/// INTERNAL ONLY +template<> +struct less_impl +{ + template + struct apply : mpl::bool_<((T0::base) < (T1::base))> {}; +}; + +} + +#endif + +namespace units { + +namespace detail { + +template +struct is_empty_dim > : mpl::false_ {}; + +template +struct is_empty_dim > > > : mpl::true_ {}; + +template +struct eval_scale_list_impl +{ + template + struct apply + { + typedef typename eval_scale_list_impl::template apply next_iteration; + typedef typename multiply_typeof_helper::type type; + static type value() + { + return(next_iteration::value() * Begin::item::value()); + } + }; +}; + +template<> +struct eval_scale_list_impl<0> +{ + template + struct apply + { + typedef one type; + static one value() + { + one result; + return(result); + } + }; +}; + +} + +/// INTERNAL ONLY +template +struct eval_scale_list : detail::eval_scale_list_impl::template apply {}; + +} // namespace units + +#ifndef BOOST_UNITS_DOXYGEN + +namespace mpl { + +/// INTERNAL ONLY +template<> +struct plus_impl +{ + template + struct apply + { + typedef boost::units::scale_list_dim< + boost::units::scale< + (T0::base), + typename mpl::plus::type + > + > type; + }; +}; + +/// INTERNAL ONLY +template<> +struct negate_impl +{ + template + struct apply + { + typedef boost::units::scale_list_dim< + boost::units::scale< + (T0::base), + typename mpl::negate::type + > + > type; + }; +}; + +/// INTERNAL ONLY +template<> +struct times_impl +{ + template + struct apply + { + typedef boost::units::scale_list_dim< + boost::units::scale< + (T0::base), + typename mpl::times::type + > + > type; + }; +}; + +} // namespace mpl + +#endif + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/detail/utility.hpp b/deal.II/contrib/boost/include/boost/units/detail/utility.hpp new file mode 100644 index 0000000000..da46b456eb --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/detail/utility.hpp @@ -0,0 +1,104 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_UTILITY_HPP +#define BOOST_UNITS_UTILITY_HPP + +#include +#include +#include + +#if defined(__GLIBCXX__) || defined(__GLIBCPP__) +#define BOOST_UNITS_USE_DEMANGLING +#include +#endif // __GNUC__ + +#ifdef BOOST_UNITS_USE_DEMANGLING + +#include + +namespace boost { + +namespace units { + +namespace detail { + +inline +std::string +demangle(const char* name) +{ + // need to demangle C++ symbols + char* realname; + std::size_t len; + int stat; + + realname = abi::__cxa_demangle(name,NULL,&len,&stat); + + if (realname != NULL) + { + std::string out(realname); + + std::free(realname); + + boost::replace_all(out,"boost::units::",""); + + return out; + } + + return std::string("demangle :: error - unable to demangle specified symbol"); +} + +} // namespace detail + +template +std::string simplify_typename(const L& /*source*/) +{ + const std::string demangled = detail::demangle(typeid(L).name()); + + return demangled; +} + +} // namespace units + +} // namespace boost + +#else // BOOST_UNITS_USE_DEMANGLING + +namespace boost { + +namespace units { + +namespace detail { + +inline +std::string +demangle(const char* name) +{ + return name; +} + +} // namespace detail + +template +std::string simplify_typename(const L& /*source*/) +{ + return std::string(typeid(L).name()); +} + +} // namespace units + +} // namespace boost + +// To get system-specific predefined macros: +// gcc -arch ppc -dM -E - < /dev/null | sort + +#endif // BOOST_UNITS_USE_DEMANGLING + +#endif // BOOST_UNITS_UTILITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/dim.hpp b/deal.II/contrib/boost/include/boost/units/dim.hpp new file mode 100644 index 0000000000..53372cfda6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/dim.hpp @@ -0,0 +1,167 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DIM_HPP +#define BOOST_UNITS_DIM_HPP + +#include + +#include + +#include + +#include +#include +#include + +/// \file +/// \brief Handling of fundamental dimension/exponent pairs. + +namespace boost { + +namespace units { + +namespace detail { + +struct dim_tag { }; + +} + +/// \brief Dimension tag/exponent pair for a single fundamental dimension. +/// +/// \detailed +/// The dim class represents a single dimension tag/dimension exponent pair. +/// That is, @c dim is a pair where @c tag_type represents the +/// fundamental dimension being represented and @c value_type represents the +/// exponent of that fundamental dimension as a @c static_rational. @c tag_type must +/// be a derived from a specialization of @c base_dimension. +/// Specialization of the following Boost.MPL metafunctions are provided +/// +/// - @c mpl::plus for two @c dims +/// - @c mpl::minus for two @c dims +/// - @c mpl::negate for a @c dim +/// +/// These metafunctions all operate on the exponent, and require +/// that the @c dim operands have the same base dimension tag. +/// In addition, multiplication and division by @c static_rational +/// is supported. +/// +/// - @c mpl::times for a @c static_rational and a @c dim in either order +/// - @c mpl::divides for a @c static_rational and a @c dim in either order +/// +/// These metafunctions likewise operate on the exponent only. +template +struct dim +{ + typedef dim type; + typedef detail::dim_tag tag; + typedef T tag_type; + typedef V value_type; +}; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::dim, 2) + +#endif + +#ifndef BOOST_UNITS_DOXYGEN + +namespace boost { + +namespace mpl { + +// define MPL operators acting on dim + +template<> +struct plus_impl +{ + template + struct apply + { + BOOST_STATIC_ASSERT((boost::is_same::value == true)); + typedef boost::units::dim::type> type; + }; +}; + +template<> +struct minus_impl +{ + template + struct apply + { + BOOST_STATIC_ASSERT((boost::is_same::value == true)); + typedef boost::units::dim::type> type; + }; +}; + +template<> +struct times_impl +{ + template + struct apply + { + typedef boost::units::dim::type> type; + }; +}; + +template<> +struct times_impl +{ + template + struct apply + { + typedef boost::units::dim::type> type; + }; +}; + +template<> +struct divides_impl +{ + template + struct apply + { + typedef boost::units::dim::type> type; + }; +}; + +template<> +struct divides_impl +{ + template + struct apply + { + typedef boost::units::dim::type> type; + }; +}; + +template<> +struct negate_impl +{ + template + struct apply + { + typedef boost::units::dim::type> type; + }; +}; + +} // namespace mpl + +} // namespace boost + +#endif + +#endif // BOOST_UNITS_DIM_HPP diff --git a/deal.II/contrib/boost/include/boost/units/dimension.hpp b/deal.II/contrib/boost/include/boost/units/dimension.hpp new file mode 100644 index 0000000000..90334a17df --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/dimension.hpp @@ -0,0 +1,150 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DIMENSION_HPP +#define BOOST_UNITS_DIMENSION_HPP + +#include + +#include + +#include + +#include +#include +#include + +/// \file +/// \brief Core metaprogramming utilities for compile-time dimensional analysis. + +namespace boost { + +namespace units { + +/// Reduce dimension list to cardinal form. This algorithm collapses duplicate +/// base dimension tags and sorts the resulting list by the tag ordinal value. +/// Dimension lists that resolve to the same dimension are guaranteed to be +/// represented by an identical type. +/// +/// The argument should be an MPL forward sequence containing instances +/// of the @c dim template. +/// +/// The result is also an MPL forward sequence. It also supports the +/// following metafunctions to allow use as a dimension. +/// +/// - @c mpl::plus is defined only on two equal dimensions and returns the argument unchanged. +/// - @c mpl::minus is defined only for two equal dimensions and returns the argument unchanged. +/// - @c mpl::negate will return its argument unchanged. +/// - @c mpl::times is defined for any dimensions and adds corresponding exponents. +/// - @c mpl::divides is defined for any dimensions and subtracts the exponents of the +/// right had argument from the corresponding exponents of the left had argument. +/// Missing base dimension tags are assumed to have an exponent of zero. +/// - @c static_power takes a dimension and a static_rational and multiplies all +/// the exponents of the dimension by the static_rational. +/// - @c static_root takes a dimension and a static_rational and divides all +/// the exponents of the dimension by the static_rational. +template +struct make_dimension_list +{ + typedef typename detail::sort_dims::type type; +}; + +/// Raise a dimension list to a scalar power. +template +struct static_power +{ + typedef typename detail::static_power_impl::template apply< + DL, + Ex + >::type type; +}; + +/// Take a scalar root of a dimension list. +template +struct static_root +{ + typedef typename detail::static_root_impl::template apply< + DL, + Rt + >::type type; +}; + +} // namespace units + +#ifndef BOOST_UNITS_DOXYGEN + +namespace mpl { + +template<> +struct plus_impl +{ + template + struct apply + { + BOOST_STATIC_ASSERT((boost::is_same::value == true)); + typedef T0 type; + }; +}; + +template<> +struct minus_impl +{ + template + struct apply + { + BOOST_STATIC_ASSERT((boost::is_same::value == true)); + typedef T0 type; + }; +}; + +template<> +struct times_impl +{ + template + struct apply + { + typedef typename boost::units::detail::merge_dimensions::type type; + }; +}; + +template<> +struct divides_impl +{ + template + struct apply + { + typedef typename boost::units::detail::merge_dimensions< + T0, + typename boost::units::detail::static_inverse_impl< + T1::size::value + >::template apply< + T1 + >::type + >::type type; + }; +}; + +template<> +struct negate_impl +{ + template + struct apply + { + typedef T0 type; + }; +}; + +} // namespace mpl + +#endif + +} // namespace boost + +#endif // BOOST_UNITS_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/dimensionless_quantity.hpp b/deal.II/contrib/boost/include/boost/units/dimensionless_quantity.hpp new file mode 100644 index 0000000000..1d39296c7b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/dimensionless_quantity.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DIMENSIONLESS_QUANTITY_HPP +#define BOOST_UNITS_DIMENSIONLESS_QUANTITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// utility class to simplify construction of dimensionless quantities +template +struct dimensionless_quantity +{ + typedef quantity::type,Y> type; +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_DIMENSIONLESS_QUANTITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/dimensionless_type.hpp b/deal.II/contrib/boost/include/boost/units/dimensionless_type.hpp new file mode 100644 index 0000000000..ba8230a8c1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/dimensionless_type.hpp @@ -0,0 +1,50 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DIMENSIONLESS_TYPE_HPP +#define BOOST_UNITS_DIMENSIONLESS_TYPE_HPP + +#include +#include +#include + +#include + +namespace boost { + +namespace units { + +namespace detail { + +struct dimension_list_tag; + +} + +/// Dimension lists in which all exponents resolve to zero reduce to @c dimensionless_type. +struct dimensionless_type +{ + typedef dimensionless_type type; + typedef detail::dimension_list_tag tag; + typedef mpl::long_<0> size; +}; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::dimensionless_type) + +#endif + +#endif // BOOST_UNITS_DIMENSIONLESS_TYPE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/dimensionless_unit.hpp b/deal.II/contrib/boost/include/boost/units/dimensionless_unit.hpp new file mode 100644 index 0000000000..448e9d3138 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/dimensionless_unit.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DIMENSIONLESS_UNIT_HPP +#define BOOST_UNITS_DIMENSIONLESS_UNIT_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// utility class to simplify construction of dimensionless units in a system +template +struct dimensionless_unit +{ + typedef unit type; +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_DIMENSIONLESS_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/get_dimension.hpp b/deal.II/contrib/boost/include/boost/units/get_dimension.hpp new file mode 100644 index 0000000000..e057f794c3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/get_dimension.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_GET_DIMENSION_HPP +#define BOOST_UNITS_GET_DIMENSION_HPP + +#include + +namespace boost { + +namespace units { + +template +struct get_dimension {}; + +/// get the dimension of a unit +template +struct get_dimension< unit > +{ + typedef Dim type; +}; + +/// get the dimension of an absolute unit +template +struct get_dimension< absolute > +{ + typedef typename get_dimension::type type; +}; + +/// get the dimension of a quantity +template +struct get_dimension< quantity > +{ + typedef typename get_dimension::type type; +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_GET_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/get_system.hpp b/deal.II/contrib/boost/include/boost/units/get_system.hpp new file mode 100644 index 0000000000..9e5bd5e9eb --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/get_system.hpp @@ -0,0 +1,48 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_GET_SYSTEM_HPP +#define BOOST_UNITS_GET_SYSTEM_HPP + +#include + +namespace boost { + +namespace units { + +template +struct get_system {}; + +/// get the system of a unit +template +struct get_system< unit > +{ + typedef System type; +}; + +/// get the system of an absolute unit +template +struct get_system< absolute > +{ + typedef typename get_system::type type; +}; + +/// get the system of a quantity +template +struct get_system< quantity > +{ + typedef typename get_system::type type; +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_GET_SYSTEM_HPP diff --git a/deal.II/contrib/boost/include/boost/units/heterogeneous_system.hpp b/deal.II/contrib/boost/include/boost/units/heterogeneous_system.hpp new file mode 100644 index 0000000000..57ed8209a9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/heterogeneous_system.hpp @@ -0,0 +1,425 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_HETEROGENEOUS_SYSTEM_HPP +#define BOOST_UNITS_HETEROGENEOUS_SYSTEM_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace detail { + +// A normal system is a sorted list of base units. +// A heterogeneous system is a sorted list of base unit/exponent pairs. +// As long as we don't need to convert heterogeneous systems +// directly everything is cool + +template +struct is_zero : mpl::false_ {}; + +template<> +struct is_zero > : mpl::true_ {}; + +} // namespace detail + +/// INTERNAL ONLY +template +struct heterogeneous_system_impl +{ + typedef L type; + typedef Dimensions dimensions; + typedef Scale scale; +}; + +/// INTERNAL ONLY +typedef dimensionless_type no_scale; + +/// A system that can represent any possible combination +/// of units at the expense of not preserving information +/// about how it was created. Do not create specializations +/// of this template directly. Instead use @c reduce_unit and +/// @c base_unit<...>::unit_type. +template +struct heterogeneous_system : T {}; + +/// INTERNAL ONLY +struct heterogeneous_system_dim_tag {}; + +/// INTERNAL ONLY +template +struct heterogeneous_system_dim +{ + typedef heterogeneous_system_dim_tag tag; + typedef heterogeneous_system_dim type; + typedef Unit tag_type; + typedef Exponent value_type; +}; + +/// INTERNAL ONLY +#define BOOST_UNITS_MAKE_HETEROGENEOUS_UNIT(BaseUnit, Dimensions) \ + boost::units::unit< \ + Dimensions, \ + boost::units::heterogeneous_system< \ + boost::units::heterogeneous_system_impl< \ + boost::units::list< \ + boost::units::heterogeneous_system_dim< \ + BaseUnit, \ + boost::units::static_rational<1> \ + >, \ + boost::units::dimensionless_type \ + >, \ + Dimensions, \ + boost::units::no_scale \ + > \ + > \ + > + +} // namespace units + +} // namespace boost + + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::heterogeneous_system_impl, (class)(class)(class)) +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::heterogeneous_system, (class)) +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::heterogeneous_system_dim, (class)(class)) + +#endif + +namespace boost { + +namespace mpl { + +/// INTERNAL ONLY +template<> +struct less_impl +{ + template + struct apply : mpl::less {}; +}; + +} + +namespace units { + +namespace detail { + +template +struct is_empty_dim > : detail::is_zero {}; + +} // namespace detail + +} // namespace units + +namespace mpl { + +/// INTERNAL ONLY +template<> +struct plus_impl +{ + template + struct apply + { + typedef boost::units::heterogeneous_system_dim< + typename T0::tag_type, + typename mpl::plus::type + > type; + }; +}; + +/// INTERNAL ONLY +template<> +struct times_impl +{ + template + struct apply + { + typedef boost::units::heterogeneous_system_dim< + typename T0::tag_type, + typename mpl::times::type + > type; + }; +}; + +/// INTERNAL ONLY +template<> +struct divides_impl +{ + template + struct apply + { + typedef boost::units::heterogeneous_system_dim< + typename T0::tag_type, + typename mpl::divides::type + > type; + }; +}; + +/// INTERNAL ONLY +template<> +struct negate_impl +{ + template + struct apply + { + typedef boost::units::heterogeneous_system_dim::type> type; + }; +}; + +} // namespace mpl + +namespace units { + +namespace detail { + +template +struct make_heterogeneous_system_impl +{ + template + struct apply + { + typedef typename push_front_if::value)>::template apply< + typename make_heterogeneous_system_impl::template apply< + typename UnitsBegin::next, + typename ExponentsBegin::next + >::type, + heterogeneous_system_dim + >::type type; + }; +}; + +template<> +struct make_heterogeneous_system_impl<0> +{ + template + struct apply + { + typedef dimensionless_type type; + }; +}; + +template +struct make_heterogeneous_system +{ + typedef typename calculate_base_unit_exponents::type exponents; + BOOST_MPL_ASSERT_MSG((!boost::is_same::value), the_specified_dimension_is_not_representible_in_the_given_system, (types)); + typedef typename make_heterogeneous_system_impl::template apply< + typename System::type, + exponents + >::type unit_list; + typedef heterogeneous_system > type; +}; + +template +struct make_heterogeneous_system > +{ + typedef heterogeneous_system type; +}; + +template +struct multiply_systems +{ + typedef heterogeneous_system< + heterogeneous_system_impl< + typename mpl::times::type, + typename mpl::times::type, + typename mpl::times::type + > + > type; +}; + +template +struct divide_systems +{ + typedef heterogeneous_system< + heterogeneous_system_impl< + typename mpl::divides::type, + typename mpl::divides::type, + typename mpl::divides::type + > + > type; +}; + +} // namespace detail + +/// INTERNAL ONLY +template +struct static_power, static_rational > +{ + typedef heterogeneous_system< + heterogeneous_system_impl< + typename static_power >::type, + typename static_power >::type, + typename static_power >::type + > + > type; +}; + +/// INTERNAL ONLY +template +struct static_root, static_rational > +{ + typedef heterogeneous_system< + heterogeneous_system_impl< + typename static_root >::type, + typename static_root >::type, + typename static_root >::type + > + > type; +}; + +namespace detail { + +template +struct unscale_heterogeneous_system_impl +{ + template + struct apply + { + typedef typename push_front_or_add< + typename unscale_heterogeneous_system_impl::template apply< + typename Begin::next + >::type, + typename unscale::type + >::type type; + }; +}; + +template<> +struct unscale_heterogeneous_system_impl<0> +{ + template + struct apply + { + typedef dimensionless_type type; + }; +}; + +} // namespace detail + +/// Unscale all the base units. e.g +/// km s -> m s +/// cm km -> m^2 +/// INTERNAL ONLY +template +struct unscale > +{ + typedef heterogeneous_system< + heterogeneous_system_impl< + typename detail::unscale_heterogeneous_system_impl< + T::type::size::value + >::template apply< + typename T::type + >::type, + typename T::dimensions, + no_scale + > + > type; +}; + +/// INTERNAL ONLY +template +struct unscale > +{ + typedef heterogeneous_system_dim::type, Exponent> type; +}; + +namespace detail { + +template +struct get_scale_list_of_heterogeneous_system_impl +{ + template + struct apply + { + typedef typename mpl::times< + typename get_scale_list_of_heterogeneous_system_impl::template apply< + typename Begin::next + >::type, + typename get_scale_list::type + >::type type; + }; +}; + +template<> +struct get_scale_list_of_heterogeneous_system_impl<0> +{ + template + struct apply + { + typedef dimensionless_type type; + }; +}; + +} // namespace detail + +/// INTERNAL ONLY +template +struct get_scale_list > +{ + typedef typename mpl::times< + typename detail::get_scale_list_of_heterogeneous_system_impl< + T::type::size::value + >::template apply::type, + typename T::scale + >::type type; +}; + +/// INTERNAL ONLY +template +struct get_scale_list > +{ + typedef typename static_power::type, Exponent>::type type; +}; + +namespace detail { + +template +struct check_system : mpl::false_ {}; + +template +struct check_system >, Dimension> : mpl::true_ {}; + +} // namespace detail + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/homogeneous_system.hpp b/deal.II/contrib/boost/include/boost/units/homogeneous_system.hpp new file mode 100644 index 0000000000..aa3b056891 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/homogeneous_system.hpp @@ -0,0 +1,105 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED +#define BOOST_UNITS_HOMOGENEOUS_SYSTEM_HPP_INCLUDED + +#include + +#include +#include + +#ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS + +#include +#include + +#include + +#endif + +namespace boost { + +namespace units { + +/// A system that can uniquely represent any unit +/// which can be composed from a linearly independent set +/// of base units. It is safe to rebind a unit with +/// such a system to different dimensions. +/// +/// Do not construct this template directly. Use +/// make_system instead. +template +struct homogeneous_system { + /// INTERNAL ONLY + typedef L type; +}; + +template +struct static_power; + +template +struct static_root; + +/// INTERNAL ONLY +template +struct static_power, static_rational > +{ + typedef homogeneous_system type; +}; + +/// INTERNAL ONLY +template +struct static_root, static_rational > +{ + typedef homogeneous_system type; +}; + +namespace detail { + +template +struct check_system; + +#ifdef BOOST_UNITS_CHECK_HOMOGENEOUS_UNITS + +template +struct check_system, Dimensions> : + boost::mpl::not_< + boost::is_same< + typename calculate_base_unit_exponents< + L, + Dimensions + >::type, + inconsistent + > + > {}; + +#else + +template +struct check_system, Dimensions> : mpl::true_ {}; + +#endif + +} // namespace detail + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::homogeneous_system, (class)) + +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/io.hpp b/deal.II/contrib/boost/include/boost/units/io.hpp new file mode 100644 index 0000000000..8ce1212732 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/io.hpp @@ -0,0 +1,619 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IO_HPP +#define BOOST_UNITS_IO_HPP + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace serialization { + +/// Boost Serialization library support for units. +template +inline void serialize(Archive& ar,boost::units::unit&,const unsigned int /*version*/) +{ } + +/// Boost Serialization library support for quantities. +template +inline void serialize(Archive& ar,boost::units::quantity& q,const unsigned int /*version*/) +{ + ar & boost::serialization::make_nvp("value", units::quantity_cast(q)); +} + +} // namespace serialization + +namespace units { + +// get string representation of arbitrary type +template std::string to_string(const T& t) +{ + std::stringstream sstr; + + sstr << t; + + return sstr.str(); +} + +// get string representation of integral-valued @c static_rational +template std::string to_string(const static_rational&) +{ + return to_string(N); +} + +// get string representation of @c static_rational +template std::string to_string(const static_rational&) +{ + return '(' + to_string(N) + '/' + to_string(D) + ')'; +} + +/// Write @c static_rational to @c std::basic_ostream. +template +inline std::basic_ostream& operator<<(std::basic_ostream& os,const static_rational& r) +{ + os << to_string(r); + return os; +} + +/// traits template for unit names +template +struct base_unit_info +{ + /// The full name of the unit (returns BaseUnit::name() by default) + static std::string name() + { + return(BaseUnit::name()); + } + + /// The symbol for the base unit (Returns BaseUnit::symbol() by default) + static std::string symbol() + { + return(BaseUnit::symbol()); + } +}; + +enum format_mode +{ + symbol_fmt = 0, // default - reduces unit names to known symbols for both base and derived units + name_fmt, // output full unit names for base and derived units + raw_fmt, // output only symbols for base units + typename_fmt // output demangled typenames +}; + +namespace detail { + +template +struct xalloc_key_holder +{ + static int value; + static bool initialized; +}; + +template +int xalloc_key_holder::value = 0; + +template +bool xalloc_key_holder::initialized = 0; + +struct xalloc_key_initializer_t +{ + xalloc_key_initializer_t() + { + if (!xalloc_key_holder::initialized) + { + xalloc_key_holder::value = std::ios_base::xalloc(); + xalloc_key_holder::initialized = true; + } + } +}; + +namespace /**/ { + +xalloc_key_initializer_t xalloc_key_initializer; + +} // namespace + +} // namespace detail + +inline format_mode get_format(std::ios_base& ios) +{ + return(static_cast(ios.iword(detail::xalloc_key_holder::value))); +} + +inline void set_format(std::ios_base& ios, format_mode new_mode) +{ + ios.iword(detail::xalloc_key_holder::value) = static_cast(new_mode); +} + +inline std::ios_base& typename_format(std::ios_base& ios) +{ + (set_format)(ios, typename_fmt); + return(ios); +} + +inline std::ios_base& raw_format(std::ios_base& ios) +{ + (set_format)(ios, raw_fmt); + return(ios); +} + +inline std::ios_base& symbol_format(std::ios_base& ios) +{ + (set_format)(ios, symbol_fmt); + return(ios); +} + +inline std::ios_base& name_format(std::ios_base& ios) +{ + (set_format)(ios, name_fmt); + return(ios); +} + +namespace detail { + +template +inline std::string exponent_string(const static_rational& r) +{ + return '^' + to_string(r); +} + +template<> +inline std::string exponent_string(const static_rational<1>&) +{ + return ""; +} + +template +inline std::string base_unit_symbol_string(const T&) +{ + return base_unit_info::symbol() + exponent_string(typename T::value_type()); +} + +template +inline std::string base_unit_name_string(const T&) +{ + return base_unit_info::name() + exponent_string(typename T::value_type()); +} + +// stringify with symbols +template +struct symbol_string_impl +{ + template + struct apply + { + typedef typename symbol_string_impl::template apply next; + static void value(std::string& str) + { + str += base_unit_symbol_string(typename Begin::item()) + ' '; + next::value(str); + } + }; +}; + +template<> +struct symbol_string_impl<1> +{ + template + struct apply + { + static void value(std::string& str) + { + str += base_unit_symbol_string(typename Begin::item()); + }; + }; +}; + +template<> +struct symbol_string_impl<0> +{ + template + struct apply + { + static void value(std::string& str) + { + // better shorthand for dimensionless? + str += "dimensionless"; + } + }; +}; + +template +struct scale_symbol_string_impl +{ + template + struct apply + { + static void value(std::string& str) + { + str += Begin::item::symbol(); + scale_symbol_string_impl::template apply::value(str); + } + }; +}; + +template<> +struct scale_symbol_string_impl<0> +{ + template + struct apply + { + static void value(std::string&) { } + }; +}; + +// stringify with names +template +struct name_string_impl +{ + template + struct apply + { + typedef typename name_string_impl::template apply next; + static void value(std::string& str) + { + str += base_unit_name_string(typename Begin::item()) + ' '; + next::value(str); + } + }; +}; + +template<> +struct name_string_impl<1> +{ + template + struct apply + { + static void value(std::string& str) + { + str += base_unit_name_string(typename Begin::item()); + }; + }; +}; + +template<> +struct name_string_impl<0> +{ + template + struct apply + { + static void value(std::string& str) + { + str += "dimensionless"; + } + }; +}; + +template +struct scale_name_string_impl +{ + template + struct apply + { + static void value(std::string& str) + { + str += Begin::item::name(); + scale_name_string_impl::template apply::value(str); + } + }; +}; + +template<> +struct scale_name_string_impl<0> +{ + template + struct apply + { + static void value(std::string&) { } + }; +}; + +} // namespace detail + +namespace detail { + +// These two overloads of symbol_string and name_string will +// will pick up homogeneous_systems. They simply call the +// appropriate function with a heterogeneous_system. +template +inline std::string +to_string_impl(const unit&, SubFormatter f) +{ + return f(typename reduce_unit >::type()); +} + +/// INTERNAL ONLY +// this overload picks up heterogeneous units that are not scaled. +template +inline std::string +to_string_impl(const unit > >&, Subformatter f) +{ + std::string str; + f.template append_units_to(str); + return(str); +} + +// This overload is a special case for heterogeneous_system which +// is really unitless +/// INTERNAL ONLY +template +inline std::string +to_string_impl(const unit > >&, Subformatter) +{ + return("dimensionless"); +} + +// this overload deals with heterogeneous_systems which are unitless +// but scaled. +/// INTERNAL ONLY +template +inline std::string +to_string_impl(const unit > >&, Subformatter f) +{ + std::string str; + f.template append_scale_to(str); + return(str); +} + +// this overload deals with scaled units. +/// INTERNAL ONLY +template +inline std::string +to_string_impl(const unit > >&, Subformatter f) +{ + std::string str; + + f.template append_scale_to(str); + + std::string without_scale = f(unit > >()); + + if (f.is_default_string(without_scale, unit > >())) + { + str += "("; + str += without_scale; + str += ")"; + } + else + { + str += without_scale; + } + + return(str); +} + +// this overload catches scaled units that have a single base unit +// raised to the first power. It causes si::nano * si::meters to not +// put parentheses around the meters. i.e. nm rather than n(m) +/// INTERNAL ONLY +template +inline std::string +to_string_impl(const unit >,dimensionless_type>, Dimension, Scale> > >&, Subformatter f) +{ + std::string str; + + f.template append_scale_to(str); + str += f(unit >, dimensionless_type>, Dimension, dimensionless_type> > >()); + + return(str); +} + +// this overload is necessary to disambiguate. +// it catches units that are unscaled and have a single +// base unit raised to the first power. It is treated the +// same as any other unscaled unit. +/// INTERNAL ONLY +template +inline std::string +to_string_impl(const unit >,dimensionless_type>, Dimension, dimensionless_type> > >&, Subformatter f) +{ + std::string str; + f.template append_units_to >,dimensionless_type> >(str); + return(str); +} + + +// this overload catches scaled units that have a single scaled base unit +// raised to the first power. It moves that scaling on the base unit +// to the unit level scaling and recurses. By doing this we make sure that +// si::milli * si::kilograms will print g rather than mkg +// +/// INTERNAL ONLY +template +inline std::string +to_string_impl(const unit, static_rational<1> >, dimensionless_type>, Dimension, Scale> > >&, Subformatter f) +{ + return(f( + unit< + Dimension, + heterogeneous_system< + heterogeneous_system_impl< + list >, dimensionless_type>, + Dimension, + typename mpl::times >::type + > + > + >())); +} + +// this overload disambuguates between the overload for an unscaled unit +// and the overload for a scaled base unit raised to the first power. +/// INTERNAL ONLY +template +inline std::string +to_string_impl(const unit, static_rational<1> >, dimensionless_type>, Dimension, dimensionless_type> > >&, Subformatter f) +{ + std::string str; + f.template append_units_to, static_rational<1> >, dimensionless_type> >(str); + return(str); +} + +struct format_raw_symbol_impl { + template + void append_units_to(std::string& str) { + detail::symbol_string_impl::template apply::value(str); + } + template + void append_scale_to(std::string& str) { + detail::scale_symbol_string_impl::template apply::value(str); + } + template + std::string operator()(const Unit& unit) { + return(to_string_impl(unit, *this)); + } + template + bool is_default_string(const std::string&, const Unit&) { + return(true); + } +}; + +struct format_symbol_impl : format_raw_symbol_impl { + template + std::string operator()(const Unit& unit) { + return(symbol_string(unit)); + } + template + bool is_default_string(const std::string& str, const Unit& unit) { + return(str == to_string_impl(unit, format_raw_symbol_impl())); + } +}; + +struct format_raw_name_impl { + template + void append_units_to(std::string& str) { + detail::name_string_impl<(Units::size::value)>::template apply::value(str); + } + template + void append_scale_to(std::string& str) { + detail::scale_name_string_impl::template apply::value(str); + } + template + std::string operator()(const Unit& unit) { + return(to_string_impl(unit, *this)); + } + template + bool is_default_string(const std::string&, const Unit&) { + return(true); + } +}; + +struct format_name_impl : format_raw_name_impl { + template + std::string operator()(const Unit& unit) { + return(name_string(unit)); + } + template + bool is_default_string(const std::string& str, const Unit& unit) { + return(str == to_string_impl(unit, format_raw_name_impl())); + } +}; + +template +inline void do_print(std::basic_ostream& os, const std::string& s) { + os << s.c_str(); +} + +inline void do_print(std::ostream& os, const std::string& s) { + os << s; +} + +template +inline void do_print(std::basic_ostream& os, const char* s) { + os << s; +} + +} // namespace detail + +template +inline std::string +typename_string(const unit&) +{ + return simplify_typename(typename reduce_unit< unit >::type()); +} + +template +inline std::string +symbol_string(const unit&) +{ + return detail::to_string_impl(unit(), detail::format_symbol_impl()); +} + +template +inline std::string +name_string(const unit&) +{ + return detail::to_string_impl(unit(), detail::format_name_impl()); +} + +/// Print an @c unit as a list of base units and exponents +/// +/// for @c symbol_format this gives e.g. "m s^-1" or "J" +/// for @c name_format this gives e.g. "meter second^-1" or "joule" +/// for @c raw_format this gives e.g. "m s^-1" or "meter kilogram^2 second^-2" +/// for @c typename_format this gives the typename itself (currently demangled only on GCC) +template +inline std::basic_ostream& operator<<(std::basic_ostream& os, const unit& u) +{ + if (units::get_format(os) == typename_fmt) + { + detail::do_print(os , typename_string(u)); + } + else if (units::get_format(os) == raw_fmt) + { + detail::do_print(os, detail::to_string_impl(u, detail::format_raw_symbol_impl())); + } + else if (units::get_format(os) == symbol_fmt) + { + detail::do_print(os, symbol_string(u)); + } + else if (units::get_format(os) == name_fmt) + { + detail::do_print(os, name_string(u)); + } + else + { + assert(!"The format mode must be one of: typename_format, raw_format, name_format, symbol_format"); + } + + return(os); +} + +/// INTERNAL ONLY +/// Print a @c quantity. Prints the value followed by the unit +template +inline std::basic_ostream& operator<<(std::basic_ostream& os, const quantity& q) +{ + os << q.value() << ' ' << Unit(); + return(os); +} + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/is_dim.hpp b/deal.II/contrib/boost/include/boost/units/is_dim.hpp new file mode 100644 index 0000000000..42297c5017 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_dim.hpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_DIM_HPP +#define BOOST_UNITS_IS_DIM_HPP + +#include + +#include + +namespace boost { + +namespace units { + +/// Check that a type is a valid @c dim. +template +struct is_dim : + public mpl::false_ +{ }; + +template +struct is_dim< dim > : + public mpl::true_ +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_DIM_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_dimension_list.hpp b/deal.II/contrib/boost/include/boost/units/is_dimension_list.hpp new file mode 100644 index 0000000000..47caaa03d1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_dimension_list.hpp @@ -0,0 +1,42 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_DIMENSION_LIST_HPP +#define BOOST_UNITS_IS_DIMENSION_LIST_HPP + +#include + +#include + +namespace boost { + +namespace units { + +/// Check that a type is a valid dimension list. +template +struct is_dimension_list : + public mpl::false_ +{ }; + +template +struct is_dimension_list > : + public mpl::true_ +{ }; + +template<> +struct is_dimension_list : + public mpl::true_ +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_DIMENSION_LIST_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_dimensionless.hpp b/deal.II/contrib/boost/include/boost/units/is_dimensionless.hpp new file mode 100644 index 0000000000..60d12924c5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_dimensionless.hpp @@ -0,0 +1,42 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_DIMENSIONLESS_HPP +#define BOOST_UNITS_IS_DIMENSIONLESS_HPP + +#include +#include + +namespace boost { + +namespace units { + +template +struct is_dimensionless : + public mpl::false_ +{ }; + +/// check if a unit is dimensionless +template +struct is_dimensionless< unit > : + public mpl::true_ +{ }; + +/// check if a quantity is dimensionless +template +struct is_dimensionless< quantity > : + public is_dimensionless +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_DIMENSIONLESS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_dimensionless_quantity.hpp b/deal.II/contrib/boost/include/boost/units/is_dimensionless_quantity.hpp new file mode 100644 index 0000000000..c946b0a7c6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_dimensionless_quantity.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_DIMENSIONLESS_QUANTITY_HPP +#define BOOST_UNITS_IS_DIMENSIONLESS_QUANTITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// check that a type is a dimensionless quantity +template +struct is_dimensionless_quantity : + public is_quantity_of_dimension +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_DIMENSIONLESS_QUANTITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_dimensionless_unit.hpp b/deal.II/contrib/boost/include/boost/units/is_dimensionless_unit.hpp new file mode 100644 index 0000000000..ce69a037a4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_dimensionless_unit.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_DIMENSIONLESS_UNIT_HPP +#define BOOST_UNITS_IS_DIMENSIONLESS_UNIT_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// check that a type is a dimensionless unit +template +struct is_dimensionless_unit : + public is_unit_of_dimension +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_DIMENSIONLESS_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_quantity.hpp b/deal.II/contrib/boost/include/boost/units/is_quantity.hpp new file mode 100644 index 0000000000..6e09080bed --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_quantity.hpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_QUANTITY_HPP +#define BOOST_UNITS_IS_QUANTITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// check that a type is a quantity +template +struct is_quantity : + public mpl::false_ +{ }; + +template +struct is_quantity< quantity > : + public mpl::true_ +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_QUANTITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_quantity_of_dimension.hpp b/deal.II/contrib/boost/include/boost/units/is_quantity_of_dimension.hpp new file mode 100644 index 0000000000..3c8c002851 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_quantity_of_dimension.hpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_QUANTITY_OF_DIMENSION_HPP +#define BOOST_UNITS_IS_QUANTITY_OF_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// check that a type is a quantity of the specified dimension +template +struct is_quantity_of_dimension : + public mpl::false_ +{ }; + +template +struct is_quantity_of_dimension< quantity< Unit,Y>,Dim > : + public is_unit_of_dimension +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_QUANTITY_OF_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_quantity_of_system.hpp b/deal.II/contrib/boost/include/boost/units/is_quantity_of_system.hpp new file mode 100644 index 0000000000..3f10255a3b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_quantity_of_system.hpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_QUANTITY_OF_SYSTEM_HPP +#define BOOST_UNITS_IS_QUANTITY_OF_SYSTEM_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// check that a type is a quantity in a specified system +template +struct is_quantity_of_system : + public mpl::false_ +{ }; + +template +struct is_quantity_of_system< quantity< Unit,Y>,System > : + public is_unit_of_system +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_QUANTITY_OF_SYSTEM_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_unit.hpp b/deal.II/contrib/boost/include/boost/units/is_unit.hpp new file mode 100644 index 0000000000..59fb99ec27 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_unit.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_UNIT_HPP +#define BOOST_UNITS_IS_UNIT_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// check that a type is a unit +template +struct is_unit : + public mpl::false_ +{ }; + +template +struct is_unit< unit > : + public mpl::true_ +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_UNIT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_unit_of_dimension.hpp b/deal.II/contrib/boost/include/boost/units/is_unit_of_dimension.hpp new file mode 100644 index 0000000000..0bc2147e31 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_unit_of_dimension.hpp @@ -0,0 +1,41 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_UNIT_OF_DIMENSION_HPP +#define BOOST_UNITS_IS_UNIT_OF_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// check that a type is a unit of the specified dimension +template +struct is_unit_of_dimension : + public mpl::false_ +{ }; + +template +struct is_unit_of_dimension< unit,Dim > : + public mpl::true_ +{ }; + +template +struct is_unit_of_dimension< absolute >,Dim > : + public mpl::true_ +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_UNIT_OF_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/is_unit_of_system.hpp b/deal.II/contrib/boost/include/boost/units/is_unit_of_system.hpp new file mode 100644 index 0000000000..8bd7d6477a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/is_unit_of_system.hpp @@ -0,0 +1,41 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IS_UNIT_OF_SYSTEM_HPP +#define BOOST_UNITS_IS_UNIT_OF_SYSTEM_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// check that a type is a unit in a specified system +template +struct is_unit_of_system : + public mpl::false_ +{ }; + +template +struct is_unit_of_system< unit,System > : + public mpl::true_ +{ }; + +template +struct is_unit_of_system< absolute >,System > : + public mpl::true_ +{ }; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IS_UNIT_OF_SYSTEM_HPP diff --git a/deal.II/contrib/boost/include/boost/units/lambda.hpp b/deal.II/contrib/boost/include/boost/units/lambda.hpp new file mode 100644 index 0000000000..9014ccaabf --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/lambda.hpp @@ -0,0 +1,593 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// $Id: lambda.hpp 27 2008-06-16 14:50:58Z maehne $ + +#ifndef BOOST_UNITS_LAMBDA_HPP +#define BOOST_UNITS_LAMBDA_HPP + + +//////////////////////////////////////////////////////////////////////// +/// +/// \file lambda.hpp +/// +/// \brief Definitions to ease the usage of Boost.Units' quantity, +/// unit, and absolute types in functors created with the +/// Boost.Lambda library. +/// +/// \author Torsten Maehne +/// \date 2008-06-16 +/// +/// Boost.Lambda's return type deduction system is extented to make +/// use of Boost.Units' typeof_helper trait classes for Boost.Units' +/// quantity, absolute, and unit template classes. +/// +//////////////////////////////////////////////////////////////////////// + + +#include +#include +#include +#include + +namespace boost { + +namespace lambda { + + /// Partial specialization of return type trait for action + /// unit * Y. + template + struct plain_return_type_2, + boost::units::unit, + Y > { + typedef typename boost::units::multiply_typeof_helper< + boost::units::unit, Y >::type type; + }; + +} // namespace lambda + +namespace units { + + template + struct multiply_typeof_helper, boost::lambda::lambda_functor > { + typedef boost::lambda::lambda_functor< + boost::lambda::lambda_functor_base< + boost::lambda::arithmetic_action, + tuple >::type, boost::lambda::lambda_functor > + > + > type; + }; + + /// Disambiguating overload for action + /// unit * lambda_functor + /// based on \. + template + inline const typename multiply_typeof_helper, boost::lambda::lambda_functor >::type + operator*(const boost::units::unit& a, + const boost::lambda::lambda_functor& b) { + return typename multiply_typeof_helper, boost::lambda::lambda_functor >::type::inherited + (tuple >::type, + boost::lambda::lambda_functor > + (a, b)); + } + +} // namespace units + +namespace lambda { + + /// Partial specialization of return type trait for action + /// unit / Y. + template + struct plain_return_type_2, + boost::units::unit, + Y > { + typedef typename boost::units::divide_typeof_helper< + boost::units::unit, Y >::type type; + }; + +} // namespace lambda + +namespace units { + + template + struct divide_typeof_helper, boost::lambda::lambda_functor > { + typedef boost::lambda::lambda_functor< + boost::lambda::lambda_functor_base< + boost::lambda::arithmetic_action, + tuple >::type, boost::lambda::lambda_functor > + > + > type; + }; + + /// Disambiguating overload for action + /// unit / lambda_functor + /// based on \. + template + inline const typename divide_typeof_helper, boost::lambda::lambda_functor >::type + operator/(const boost::units::unit& a, + const boost::lambda::lambda_functor& b) { + return typename divide_typeof_helper, boost::lambda::lambda_functor >::type::inherited + (tuple >::type, + boost::lambda::lambda_functor > + (a, b)); + } + +} // namespace units + +namespace lambda { + + /// Partial specialization of return type trait for action + /// Y * unit. + template + struct plain_return_type_2, + Y, + boost::units::unit > { + typedef typename boost::units::multiply_typeof_helper< + Y, boost::units::unit >::type type; + }; + +} // namespace lambda + +namespace units { + + template + struct multiply_typeof_helper, boost::units::unit > { + typedef boost::lambda::lambda_functor< + boost::lambda::lambda_functor_base< + boost::lambda::arithmetic_action, + tuple, typename boost::lambda::const_copy_argument >::type> + > + > type; + }; + + /// Disambiguating overload for action + /// lambda_functor * unit + /// based on \. + template + inline const typename multiply_typeof_helper, boost::units::unit >::type + operator*(const boost::lambda::lambda_functor& a, + const boost::units::unit& b) { + return typename multiply_typeof_helper, boost::units::unit >::type::inherited + (tuple, + typename boost::lambda::const_copy_argument >::type> + (a, b)); + } + +} // namespace units + +namespace lambda { + + /// Partial specialization of return type trait for action + /// Y / unit. + template + struct plain_return_type_2, + Y, + boost::units::unit > { + typedef typename boost::units::divide_typeof_helper< + Y, boost::units::unit >::type type; + }; + +} // namespace lambda + +namespace units { + + template + struct divide_typeof_helper, boost::units::unit > { + typedef boost::lambda::lambda_functor< + boost::lambda::lambda_functor_base< + boost::lambda::arithmetic_action, + tuple, typename boost::lambda::const_copy_argument >::type> + > + > type; + }; + + /// Disambiguating overload for action + /// lambda_functor / unit + /// based on \. + template + inline const typename divide_typeof_helper, boost::units::unit >::type + operator/(const boost::lambda::lambda_functor& a, + const boost::units::unit& b) { + return typename divide_typeof_helper, boost::units::unit >::type::inherited + (tuple, + typename boost::lambda::const_copy_argument >::type> + (a, b)); + } + +} // namespace units + +namespace lambda { + + /// Partial specialization of return type trait for action + /// quantity * X. + template + struct plain_return_type_2, + boost::units::quantity, + X> { + typedef typename boost::units::multiply_typeof_helper< + boost::units::quantity, X>::type type; + }; + + /// Partial specialization of return type trait for action + /// X * quantity. + template + struct plain_return_type_2, + X, + boost::units::quantity > { + typedef typename boost::units::multiply_typeof_helper< + X, boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity / X. + template + struct plain_return_type_2, + boost::units::quantity, + X> { + typedef typename boost::units::divide_typeof_helper< + boost::units::quantity, X>::type type; + }; + + /// Partial specialization of return type trait for action + /// X / quantity. + template + struct plain_return_type_2, + X, + boost::units::quantity > { + typedef typename boost::units::divide_typeof_helper< + X, boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// unit * quantity. + template + struct plain_return_type_2, + boost::units::unit, + boost::units::quantity > { + typedef typename boost::units::multiply_typeof_helper< + boost::units::unit, + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// unit / quantity. + template + struct plain_return_type_2, + boost::units::unit, + boost::units::quantity > { + typedef typename boost::units::divide_typeof_helper< + boost::units::unit, + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity * unit. + template + struct plain_return_type_2, + boost::units::quantity, + boost::units::unit > { + typedef typename boost::units::multiply_typeof_helper< + boost::units::quantity, + boost::units::unit >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity / unit. + template + struct plain_return_type_2, + boost::units::quantity, + boost::units::unit > { + typedef typename boost::units::divide_typeof_helper< + boost::units::quantity, + boost::units::unit >::type type; + }; + + /// Partial specialization of return type trait for action + /// +quantity. + template + struct plain_return_type_1, + boost::units::quantity > { + typedef typename boost::units::unary_plus_typeof_helper< + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// -quantity. + template + struct plain_return_type_1, + boost::units::quantity > { + typedef typename boost::units::unary_minus_typeof_helper< + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity + quantity. + template + struct plain_return_type_2, + boost::units::quantity, + boost::units::quantity > { + typedef typename boost::units::add_typeof_helper< + boost::units::quantity, + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity + Y. + template + struct plain_return_type_2, + boost::units::quantity, + Y> { + typedef typename boost::units::add_typeof_helper< + boost::units::quantity, + Y>::type type; + }; + + /// Partial specialization of return type trait for action + /// X + quantity. + template + struct plain_return_type_2, + X, + boost::units::quantity > { + typedef typename boost::units::add_typeof_helper< + X, + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity - quantity. + template + struct plain_return_type_2, + boost::units::quantity, + boost::units::quantity > { + typedef typename boost::units::subtract_typeof_helper< + boost::units::quantity, + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity - Y. + template + struct plain_return_type_2, + boost::units::quantity, + Y> { + typedef typename boost::units::subtract_typeof_helper< + boost::units::quantity, + Y>::type type; + }; + + /// Partial specialization of return type trait for action + /// X - quantity. + template + struct plain_return_type_2, + X, + boost::units::quantity > { + typedef typename boost::units::subtract_typeof_helper< + X, + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity * quantity. + template + struct plain_return_type_2, + boost::units::quantity, + boost::units::quantity > { + typedef typename boost::units::multiply_typeof_helper< + boost::units::quantity, + boost::units::quantity >::type type; + }; + + /// Partial specialization of return type trait for action + /// quantity / quantity. + template + struct plain_return_type_2, + boost::units::quantity, + boost::units::quantity > { + typedef typename boost::units::divide_typeof_helper< + boost::units::quantity, + boost::units::quantity >::type type; + }; + + + //////////////////////////////////////////////////////////////////////// + // Partial specialization of Boost.Lambda's trait classes for all + // operators overloaded in + //////////////////////////////////////////////////////////////////////// + + /// Partial specialization of return type trait for action + /// +unit. + template + struct plain_return_type_1, + boost::units::unit > { + typedef typename boost::units::unary_plus_typeof_helper< + boost::units::unit >::type type; + }; + + /// Partial specialization of return type trait for action + /// -unit. + template + struct plain_return_type_1, + boost::units::unit > { + typedef typename boost::units::unary_minus_typeof_helper< + boost::units::unit >::type type; + }; + + /// Partial specialization of return type trait for action + /// unit + unit. + template + struct plain_return_type_2, + boost::units::unit, + boost::units::unit > { + typedef typename boost::units::add_typeof_helper< + boost::units::unit, + boost::units::unit >::type type; + }; + + /// Partial specialization of return type trait for action + /// unit - unit. + template + struct plain_return_type_2, + boost::units::unit, + boost::units::unit > { + typedef typename boost::units::subtract_typeof_helper< + boost::units::unit, + boost::units::unit >::type type; + }; + + /// Partial specialization of return type trait for action + /// unit * unit. + template + struct plain_return_type_2, + boost::units::unit, + boost::units::unit > { + typedef typename boost::units::multiply_typeof_helper< + boost::units::unit, + boost::units::unit >::type type; + }; + + /// Partial specialization of return type trait for action + /// unit / unit. + template + struct plain_return_type_2, + boost::units::unit, + boost::units::unit > { + typedef typename boost::units::divide_typeof_helper< + boost::units::unit, + boost::units::unit >::type type; + }; + + + //////////////////////////////////////////////////////////////////////// + // Partial specialization of Boost.Lambda's trait classes for all + // operators overloaded in + //////////////////////////////////////////////////////////////////////// + + + /// Partial specialization of return type trait for action + /// absolute + Y. + template + struct plain_return_type_2, + boost::units::absolute, + Y> { + typedef typename boost::units::absolute type; + }; + + /// Partial specialization of return type trait for action + /// Y + absolute. + template + struct plain_return_type_2, + Y, + boost::units::absolute > { + typedef typename boost::units::absolute type; + }; + + /// Partial specialization of return type trait for action + /// absolute - Y. + template + struct plain_return_type_2, + boost::units::absolute, + Y> { + typedef typename boost::units::absolute type; + }; + + /// Partial specialization of return type trait for action + /// absolute - absolute. + template + struct plain_return_type_2, + boost::units::absolute, + boost::units::absolute > { + typedef Y type; + }; + + /// Partial specialization of return type trait for action + /// T * absolute >. + template + struct plain_return_type_2, + T, + boost::units::absolute > > { + typedef typename boost::units::quantity< + boost::units::absolute >, T> type; + }; + +} // namespace lambda + +namespace units { + + template + struct multiply_typeof_helper, boost::units::absolute > > { + typedef boost::lambda::lambda_functor< + boost::lambda::lambda_functor_base< + boost::lambda::arithmetic_action, + tuple, + typename boost::lambda::const_copy_argument > >::type> + > + > type; + }; + + /// Disambiguating overload for action + /// lambda_functor * absolute > + /// based on \. + template + inline const typename multiply_typeof_helper, boost::units::absolute > >::type + operator*(const boost::lambda::lambda_functor& a, + const boost::units::absolute >& b) { + return typename multiply_typeof_helper, boost::units::absolute > >::type::inherited + (tuple, + typename boost::lambda::const_copy_argument > >::type> + (a, b)); + } + +} // namespace units + +namespace lambda { + + /// Partial specialization of return type trait for action + /// absolute > * T. + template + struct plain_return_type_2, + boost::units::absolute >, + T> { + typedef typename boost::units::quantity< + boost::units::absolute >, T> type; + }; + +} // namespace lambda + +namespace units { + + template + struct multiply_typeof_helper >, boost::lambda::lambda_functor > { + typedef boost::lambda::lambda_functor< + boost::lambda::lambda_functor_base< + boost::lambda::arithmetic_action, + tuple > >::type, + boost::lambda::lambda_functor > + > + > type; + }; + + /// Disambiguating overload for action + /// absolute > * lambda_functor + /// based on \. + template + inline const typename multiply_typeof_helper >, boost::lambda::lambda_functor >::type + operator*(const boost::units::absolute >& a, + const boost::lambda::lambda_functor& b) { + return typename multiply_typeof_helper >, boost::lambda::lambda_functor >::type::inherited + (tuple > >::type, + boost::lambda::lambda_functor > + (a, b)); + } + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_LAMBDA_HPP diff --git a/deal.II/contrib/boost/include/boost/units/limits.hpp b/deal.II/contrib/boost/include/boost/units/limits.hpp new file mode 100644 index 0000000000..d248774e38 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/limits.hpp @@ -0,0 +1,63 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +#ifndef BOOST_UNITS_LIMITS_HPP +#define BOOST_UNITS_LIMITS_HPP + +#include + +#include + +namespace std { + +template +class numeric_limits< ::boost::units::quantity > +{ + public: + typedef ::boost::units::quantity quantity_type; + static const bool is_specialized = std::numeric_limits::is_specialized; + static quantity_type (min)() { return(quantity_type::from_value((std::numeric_limits::min)())); } + static quantity_type (max)() { return(quantity_type::from_value((std::numeric_limits::max)())); } + static const int digits = std::numeric_limits::digits; + static const int digits10 = std::numeric_limits::digits10; + static const bool is_signed = std::numeric_limits::is_signed; + static const bool is_integer = std::numeric_limits::is_integer; + static const bool is_exact = std::numeric_limits::is_exact; + static const int radix = std::numeric_limits::radix; + static quantity_type epsilon() { return(quantity_type::from_value(std::numeric_limits::epsilon())); } + static quantity_type round_error() { return(quantity_type::from_value(std::numeric_limits::round_error())); } + static const int min_exponent = std::numeric_limits::min_exponent; + static const int min_exponent10 = std::numeric_limits::min_exponent10; + static const int max_exponent = std::numeric_limits::max_exponent; + static const int max_exponent10 = std::numeric_limits::max_exponent10; + static const bool has_infinity = std::numeric_limits::has_infinity; + static const bool has_quiet_NaN = std::numeric_limits::has_quiet_NaN; + static const bool has_signaling_NaN = std::numeric_limits::has_signaling_NaN; + static const bool has_denorm_loss = std::numeric_limits::has_denorm_loss; + static quantity_type infinity() { return(quantity_type::from_value(std::numeric_limits::infinity())); } + static quantity_type quiet_NaN() { return(quantity_type::from_value(std::numeric_limits::quiet_NaN())); } + static quantity_type signaling_NaN() { return(quantity_type::from_value(std::numeric_limits::signaling_NaN())); } + static quantity_type denorm_min() { return(quantity_type::from_value(std::numeric_limits::denorm_min())); } + static const bool is_iec559 = std::numeric_limits::is_iec559; + static const bool is_bounded = std::numeric_limits::is_bounded; + static const bool is_modulo = std::numeric_limits::is_modulo; + static const bool traps = std::numeric_limits::traps; + static const bool tinyness_before = std::numeric_limits::tinyness_before; +#if defined(_STLP_STATIC_CONST_INIT_BUG) + static const int has_denorm = std::numeric_limits::has_denorm; + static const int round_style = std::numeric_limits::round_style; +#else + static const float_denorm_style has_denorm = std::numeric_limits::has_denorm; + static const float_round_style round_style = std::numeric_limits::round_style; +#endif +}; + +} + +#endif // BOOST_UNITS_LIMITS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/make_scaled_unit.hpp b/deal.II/contrib/boost/include/boost/units/make_scaled_unit.hpp new file mode 100644 index 0000000000..084b362f57 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/make_scaled_unit.hpp @@ -0,0 +1,45 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MAKE_SCALED_UNIT_HPP_INCLUDED +#define BOOST_UNITS_MAKE_SCALED_UNIT_HPP_INCLUDED + +#include +#include + +namespace boost { +namespace units { + +template +struct make_scaled_unit { + typedef typename make_scaled_unit::type, Scale>::type type; +}; + +template +struct make_scaled_unit > >, Scale> { + typedef unit< + Dimension, + heterogeneous_system< + heterogeneous_system_impl< + UnitList, + Dimension, + typename mpl::times< + OldScale, + list, dimensionless_type> + >::type + > + > + > type; +}; + +} +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/make_system.hpp b/deal.II/contrib/boost/include/boost/units/make_system.hpp new file mode 100644 index 0000000000..444ae22a86 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/make_system.hpp @@ -0,0 +1,135 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MAKE_SYSTEM_HPP +#define BOOST_UNITS_MAKE_SYSTEM_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +#ifdef BOOST_UNITS_DOXYGEN + +namespace detail { + +struct unspecified {}; + +} + +/// Metafunction returning a homogeneous system that can +/// represent any combination of the base units. There must +/// be no way to represent any of the base units in terms +/// of the others. make_system::type +/// is not allowed, for example. +template +struct make_system +{ + typedef homogeneous_system type; +}; + +#else + +struct na {}; + +template< + class U0 = na, + class U1 = na, + class U2 = na, + class U3 = na, + class U4 = na, + class U5 = na, + class U6 = na, + class U7 = na, + class U8 = na, + class U9 = na +> +struct make_system; + +template<> +struct make_system<> +{ + typedef homogeneous_system type; +}; + +// Codewarrior 9.2 doesn't like using the defaults. Need +// to specify na explicitly. +template +struct make_system +{ + typedef homogeneous_system > type; +}; + +template +struct make_system +{ + typedef homogeneous_system > >::type> type; +}; + +template +struct make_system +{ + typedef homogeneous_system > > >::type> type; +}; + +template +struct make_system +{ + typedef homogeneous_system > > > >::type> type; +}; + +template +struct make_system +{ + typedef homogeneous_system > > > > >::type> type; +}; + +template +struct make_system +{ + typedef homogeneous_system > > > > > >::type> type; +}; + +template +struct make_system +{ + typedef homogeneous_system > > > > > > >::type> type; +}; + +template +struct make_system +{ + typedef homogeneous_system > > > > > > > >::type> type; +}; + +template +struct make_system +{ + typedef homogeneous_system > > > > > > > > >::type> type; +}; + +template +struct make_system +{ + typedef homogeneous_system > > > > > > > > > >::type> type; +}; + +#endif + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/operators.hpp b/deal.II/contrib/boost/include/boost/units/operators.hpp new file mode 100644 index 0000000000..c162610344 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/operators.hpp @@ -0,0 +1,163 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_OPERATORS_HPP +#define BOOST_UNITS_OPERATORS_HPP + +#include +#include + +#include + +/// \file +/// \brief Compile time operators and typeof helper classes. +/// +/// \detailed +/// These operators declare the compile-time operators needed to support dimensional +/// analysis algebra. They require the use of Boost.Typeof. +/// Typeof helper classes define result type for heterogeneous operators on value types. +/// These must be defined through specialization for powers and roots. + +namespace boost { + +namespace units { + +#if BOOST_UNITS_HAS_TYPEOF + +#ifndef BOOST_UNITS_DOXYGEN + +// to avoid need for default constructor and eliminate divide by zero errors +namespace typeof_ { + +/// INTERNAL ONLY +template T make(); + +} // namespace typeof_ + +#endif + +#if (BOOST_UNITS_HAS_BOOST_TYPEOF) + +template struct unary_plus_typeof_helper +{ + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (+typeof_::make())) + typedef typename nested::type type; +}; + +template struct unary_minus_typeof_helper +{ + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (-typeof_::make())) + typedef typename nested::type type; +}; + +template struct add_typeof_helper +{ + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make()+typeof_::make())) + typedef typename nested::type type; +}; + +template struct subtract_typeof_helper +{ + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make()-typeof_::make())) + typedef typename nested::type type; +}; + +template struct multiply_typeof_helper +{ + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make()*typeof_::make())) + typedef typename nested::type type; +}; + +template struct divide_typeof_helper +{ + BOOST_TYPEOF_NESTED_TYPEDEF_TPL(nested, (typeof_::make()/typeof_::make())) + typedef typename nested::type type; +}; + +#elif (BOOST_UNITS_HAS_MWERKS_TYPEOF) + +template struct unary_plus_typeof_helper { typedef __typeof__((+typeof_::make())) type; }; +template struct unary_minus_typeof_helper { typedef __typeof__((-typeof_::make())) type; }; + +template struct add_typeof_helper { typedef __typeof__((typeof_::make()+typeof_::make())) type; }; +template struct subtract_typeof_helper { typedef __typeof__((typeof_::make()-typeof_::make())) type; }; +template struct multiply_typeof_helper { typedef __typeof__((typeof_::make()*typeof_::make())) type; }; +template struct divide_typeof_helper { typedef __typeof__((typeof_::make()/typeof_::make())) type; }; + +#elif (BOOST_UNITS_HAS_GNU_TYPEOF) || defined(BOOST_UNITS_DOXYGEN) + +template struct unary_plus_typeof_helper { typedef typeof((+typeof_::make())) type; }; +template struct unary_minus_typeof_helper { typedef typeof((-typeof_::make())) type; }; + +template struct add_typeof_helper { typedef typeof((typeof_::make()+typeof_::make())) type; }; +template struct subtract_typeof_helper { typedef typeof((typeof_::make()-typeof_::make())) type; }; +template struct multiply_typeof_helper { typedef typeof((typeof_::make()*typeof_::make())) type; }; +template struct divide_typeof_helper { typedef typeof((typeof_::make()/typeof_::make())) type; }; + +#endif + +#else // BOOST_UNITS_HAS_TYPEOF + +template struct unary_plus_typeof_helper { typedef X type; }; +template struct unary_minus_typeof_helper { typedef X type; }; + +template struct add_typeof_helper { BOOST_STATIC_ASSERT((is_same::value == true)); typedef X type; }; +template struct subtract_typeof_helper { BOOST_STATIC_ASSERT((is_same::value == true)); typedef X type; }; +template struct multiply_typeof_helper { BOOST_STATIC_ASSERT((is_same::value == true)); typedef X type; }; +template struct divide_typeof_helper { BOOST_STATIC_ASSERT((is_same::value == true)); typedef X type; }; + +#endif // BOOST_UNITS_HAS_TYPEOF + +template struct power_typeof_helper; +template struct root_typeof_helper; + +#ifdef BOOST_UNITS_DOXYGEN + +/// A helper used by @c pow to raise +/// a runtime object to a compile time +/// known exponent. This template is intended to +/// be specialized. All specializations must +/// conform to the interface shown here. +/// @c Exponent will be either the exponent +/// passed to @c pow or @c static_rational +/// for and integer argument, N. +template +struct power_typeof_helper +{ + /// specifies the result type + typedef detail::unspecified type; + /// Carries out the runtime calculation. + static type value(const BaseType& base); +}; + +/// A helper used by @c root to take a root +/// of a runtime object using a compile time +/// known index. This template is intended to +/// be specialized. All specializations must +/// conform to the interface shown here. +/// @c Index will be either the type +/// passed to @c pow or @c static_rational +/// for and integer argument, N. +template +struct root_typeof_helper +{ + /// specifies the result type + typedef detail::unspecified type; + /// Carries out the runtime calculation. + static type value(const Radicand& base); +}; + +#endif + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_OPERATORS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions.hpp new file mode 100644 index 0000000000..e115898634 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions.hpp @@ -0,0 +1,86 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_PHYSICAL_UNITS_HPP +#define BOOST_UNITS_PHYSICAL_UNITS_HPP + +/// \file Includes all of the physical_dimension headers. +/// +/// \brief Physical dimensions according to the SI system +/// +/// \detail This header includes all physical dimension headers for both base +/// derived dimensions. Base dimensions are extended to include plane and +/// solid angle for convenience. +/// + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // BOOST_UNITS_PHYSICAL_UNITS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/absorbed_dose.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/absorbed_dose.hpp new file mode 100644 index 0000000000..c62ed09b6d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/absorbed_dose.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ABSORBED_DOSE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ABSORBED_DOSE_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for absorbed dose : L^2 T^-2 +typedef derived_dimension::type absorbed_dose_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ABSORBED_DOSE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/acceleration.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/acceleration.hpp new file mode 100644 index 0000000000..8f25c86364 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/acceleration.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ACCELERATION_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ACCELERATION_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for acceleration : L T^-2 +typedef derived_dimension::type acceleration_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ACCELERATION_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/action.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/action.hpp new file mode 100644 index 0000000000..cf38d324bd --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/action.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ACTION_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ACTION_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for action : L^2 M T^-1 +typedef derived_dimension::type action_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ACTION_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/activity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/activity.hpp new file mode 100644 index 0000000000..035cd44433 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/activity.hpp @@ -0,0 +1,28 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ACTIVITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ACTIVITY_DERIVED_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for activity : T^-1 +typedef derived_dimension::type activity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ACTIVITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/amount.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/amount.hpp new file mode 100644 index 0000000000..6d9d4b3a48 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/amount.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_AMOUNT_BASE_DIMENSION_HPP +#define BOOST_UNITS_AMOUNT_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of amount +struct amount_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::amount_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// dimension of amount of substance (N) +typedef amount_base_dimension::dimension_type amount_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_AMOUNT_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_acceleration.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_acceleration.hpp new file mode 100644 index 0000000000..79a3a14beb --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_acceleration.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGULAR_ACCELERATION_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ANGULAR_ACCELERATION_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for angular acceleration : T^-2 QP +typedef derived_dimension::type angular_acceleration_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ANGULAR_ACCELERATION_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_momentum.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_momentum.hpp new file mode 100644 index 0000000000..0a86f88bc6 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_momentum.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGULAR_MOMENTUM_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ANGULAR_MOMENTUM_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for angular momentum : L^2 M T^-1 QP^-1 +typedef derived_dimension::type angular_momentum_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ANGULAR_MOMENTUM_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_velocity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_velocity.hpp new file mode 100644 index 0000000000..5d7ea879b7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/angular_velocity.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGULAR_VELOCITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ANGULAR_VELOCITY_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for angular velocity : T^-1 QP +typedef derived_dimension::type angular_velocity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ANGULAR_VELOCITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/area.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/area.hpp new file mode 100644 index 0000000000..0d8cb0991e --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/area.hpp @@ -0,0 +1,28 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_AREA_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_AREA_DERIVED_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for area : L^2 +typedef derived_dimension::type area_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_AREA_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/capacitance.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/capacitance.hpp new file mode 100644 index 0000000000..e7019a7c5b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/capacitance.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for capacitance : L^-2 M^-1 T^4 I^2 +typedef derived_dimension::type capacitance_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CAPACITANCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/conductance.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/conductance.hpp new file mode 100644 index 0000000000..8405f92d39 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/conductance.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CONDUCTANCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_CONDUCTANCE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for conductance : L^-2 M^-1 T^3 I^2 +typedef derived_dimension::type conductance_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CONDUCTANCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/conductivity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/conductivity.hpp new file mode 100644 index 0000000000..d255915a5c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/conductivity.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for conductivity : L^-3 M^-1 T^3 I^2 +typedef derived_dimension::type conductivity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CONDUCTIVITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/current.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/current.hpp new file mode 100644 index 0000000000..6fa0e8924c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/current.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CURRENT_BASE_DIMENSION_HPP +#define BOOST_UNITS_CURRENT_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of current +struct current_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::current_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// dimension of electric current (I) +typedef current_base_dimension::dimension_type current_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CURRENT_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/dose_equivalent.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/dose_equivalent.hpp new file mode 100644 index 0000000000..ae13d2f385 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/dose_equivalent.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DOSE_EQUIVALENT_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_DOSE_EQUIVALENT_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for dose equivalent : L^2 T^-2 +typedef derived_dimension::type dose_equivalent_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_DOSE_EQUIVALENT_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/dynamic_viscosity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/dynamic_viscosity.hpp new file mode 100644 index 0000000000..029f1fabea --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/dynamic_viscosity.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_DYNAMIC_VISCOSITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_DYNAMIC_VISCOSITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for dynamic viscosity : M L^-1 T^-1 +typedef derived_dimension::type dynamic_viscosity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_DYNAMIC_VISCOSITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/electric_charge.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/electric_charge.hpp new file mode 100644 index 0000000000..36836462c9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/electric_charge.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ELECTRIC_CHARGE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ELECTRIC_CHARGE_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for electric charge : T^1 I^1 +typedef derived_dimension::type electric_charge_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ELECTRIC_CHARGE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/electric_potential.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/electric_potential.hpp new file mode 100644 index 0000000000..1ef028c129 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/electric_potential.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ELECTRIC_POTENTIAL_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ELECTRIC_POTENTIAL_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for electric potential : L^2 M T^-3 I^-1 +typedef derived_dimension::type electric_potential_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ELECTRIC_POTENTIAL_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/energy.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/energy.hpp new file mode 100644 index 0000000000..bf0dbe34a9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/energy.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ENERGY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ENERGY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for energy : L^2 M T^-2 +typedef derived_dimension::type energy_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ENERGY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/energy_density.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/energy_density.hpp new file mode 100644 index 0000000000..d30e1e122b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/energy_density.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ENERGY_DENSITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ENERGY_DENSITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for energy density : L^-1 M^1 T^-2 +typedef derived_dimension::type energy_density_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ENERGY_DENSITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/force.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/force.hpp new file mode 100644 index 0000000000..a1ed955b16 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/force.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_FORCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_FORCE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for force : L M T^-2 +typedef derived_dimension::type force_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_FORCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/frequency.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/frequency.hpp new file mode 100644 index 0000000000..e2af7ee048 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/frequency.hpp @@ -0,0 +1,28 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for frequency : T^-1 +typedef derived_dimension::type frequency_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_FREQUENCY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/heat_capacity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/heat_capacity.hpp new file mode 100644 index 0000000000..3cbfa57c22 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/heat_capacity.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_HEAT_CAPACITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_HEAT_CAPACITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for heat capacity : L^2 M T^-2 Theta^-1 +typedef derived_dimension::type heat_capacity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_HEAT_CAPACITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/illuminance.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/illuminance.hpp new file mode 100644 index 0000000000..a24daf476a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/illuminance.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ILLUMINANCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_ILLUMINANCE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for illuminance : L^-2 I QS +typedef derived_dimension::type illuminance_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ILLUMINANCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/impedance.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/impedance.hpp new file mode 100644 index 0000000000..177fc607e4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/impedance.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_IMPEDANCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_IMPEDANCE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for impedance : L^2 M T^-3 I^-2 +typedef derived_dimension::type impedance_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_IMPEDANCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/inductance.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/inductance.hpp new file mode 100644 index 0000000000..1506364c30 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/inductance.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_INDUCTANCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_INDUCTANCE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for inductance : L^2 M T^-2 I^-2 +typedef derived_dimension::type inductance_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_INDUCTANCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/kinematic_viscosity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/kinematic_viscosity.hpp new file mode 100644 index 0000000000..e5c5261eef --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/kinematic_viscosity.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for kinematic viscosity : L^2 T^-1 +typedef derived_dimension::type kinematic_viscosity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_KINEMATIC_VISCOSITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/length.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/length.hpp new file mode 100644 index 0000000000..22bbec43c3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/length.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_LENGTH_BASE_DIMENSION_HPP +#define BOOST_UNITS_LENGTH_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of length +struct length_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::length_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// dimension of length (L) +typedef length_base_dimension::dimension_type length_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_LENGTH_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminance.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminance.hpp new file mode 100644 index 0000000000..f2e6f24873 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminance.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_LUMINANCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_LUMINANCE_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for luminance : L^-2 I +typedef derived_dimension::type luminance_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_LUMINANCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminous_flux.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminous_flux.hpp new file mode 100644 index 0000000000..4c725efeeb --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminous_flux.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_LUMINOUS_FLUX_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_LUMINOUS_FLUX_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for luminous flux : I QS +typedef derived_dimension::type luminous_flux_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_LUMINOUS_FLUX_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminous_intensity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminous_intensity.hpp new file mode 100644 index 0000000000..1da041d99a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/luminous_intensity.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_LUMINOUS_INTENSITY_BASE_DIMENSION_HPP +#define BOOST_UNITS_LUMINOUS_INTENSITY_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of luminous intensity +struct luminous_intensity_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::luminous_intensity_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// dimension of luminous intensity (J) +typedef luminous_intensity_base_dimension::dimension_type luminous_intensity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_LUMINOUS_INTENSITY_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_field_intensity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_field_intensity.hpp new file mode 100644 index 0000000000..665e5bc26c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_field_intensity.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MAGNETIC_FIELD_INTENSITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_MAGNETIC_FIELD_INTENSITY_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for magnetic field intensity : L^-1 I +typedef derived_dimension::type magnetic_field_intensity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MAGNETIC_FIELD_INTENSITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_flux.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_flux.hpp new file mode 100644 index 0000000000..c247e5605d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_flux.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MAGNETIC_FLUX_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_MAGNETIC_FLUX_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for magnetic flux : L^2 M T^-2 I^-1 +typedef derived_dimension::type magnetic_flux_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MAGNETIC_FLUX_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_flux_density.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_flux_density.hpp new file mode 100644 index 0000000000..d7fb7bbb14 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/magnetic_flux_density.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MAGNETIC_FLUX_DENSITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_MAGNETIC_FLUX_DENSITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for magnetic flux density : M T^-2 I^-1 +typedef derived_dimension::type magnetic_flux_density_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MAGNETIC_FLUX_DENSITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/mass.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/mass.hpp new file mode 100644 index 0000000000..7aaa75ccfc --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/mass.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MASS_BASE_DIMENSION_HPP +#define BOOST_UNITS_MASS_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of mass +struct mass_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::mass_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// dimension of mass (M) +typedef mass_base_dimension::dimension_type mass_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MASS_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/mass_density.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/mass_density.hpp new file mode 100644 index 0000000000..e632f2474f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/mass_density.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MASS_DENSITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_MASS_DENSITY_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for mass density : L^-3 M +typedef derived_dimension::type mass_density_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MASS_DENSITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/molar_energy.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/molar_energy.hpp new file mode 100644 index 0000000000..2f83bbf551 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/molar_energy.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MOLAR_ENERGY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_MOLAR_ENERGY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for molar energy : L^2 M T^-2 N^-1 +typedef derived_dimension::type molar_energy_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MOLAR_ENERGY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/molar_heat_capacity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/molar_heat_capacity.hpp new file mode 100644 index 0000000000..48e147bdb3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/molar_heat_capacity.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MOLAR_HEAT_CAPACITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_MOLAR_HEAT_CAPACITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for molar heat capacity : L^2 M T^-2 Theta^-1 N^-1 +typedef derived_dimension::type molar_heat_capacity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MOLAR_HEAT_CAPACITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/moment_of_inertia.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/moment_of_inertia.hpp new file mode 100644 index 0000000000..58c85c80d1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/moment_of_inertia.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MOMENT_OF_INERTIA_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_MOMENT_OF_INERTIA_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for moment of inertia : L^2 M QP^-2 +typedef derived_dimension::type moment_of_inertia_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MOMENT_OF_INERTIA_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/momentum.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/momentum.hpp new file mode 100644 index 0000000000..13e8b8c67c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/momentum.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_MOMENTUM_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_MOMENTUM_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for linear momentum : L M T^-1 +typedef derived_dimension::type momentum_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_MOMENTUM_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/permeability.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/permeability.hpp new file mode 100644 index 0000000000..a0ea30cdaa --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/permeability.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_PERMEABILITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_PERMEABILITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for permeability : L M T^-2 I^-2 +typedef derived_dimension::type permeability_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_PERMEABILITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/permittivity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/permittivity.hpp new file mode 100644 index 0000000000..01994c5cea --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/permittivity.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for permittivity : L^-3 M^-1 T^4 I^2 +typedef derived_dimension::type permittivity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_PERMITTIVITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/plane_angle.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/plane_angle.hpp new file mode 100644 index 0000000000..ae700321f8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/plane_angle.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_PLANE_ANGLE_BASE_DIMENSION_HPP +#define BOOST_UNITS_PLANE_ANGLE_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of plane angle +struct plane_angle_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::plane_angle_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// base dimension of plane angle (QP) +typedef plane_angle_base_dimension::dimension_type plane_angle_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_PLANE_ANGLE_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/power.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/power.hpp new file mode 100644 index 0000000000..77e04cf4ee --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/power.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for power : L^2 M T^-3 +typedef derived_dimension::type power_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_POWER_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/pressure.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/pressure.hpp new file mode 100644 index 0000000000..666b4c704b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/pressure.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_PRESSURE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_PRESSURE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for pressure : L^-1 M T^-2 +typedef derived_dimension::type pressure_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_PRESSURE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/reluctance.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/reluctance.hpp new file mode 100644 index 0000000000..56be33b480 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/reluctance.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for reluctance : L^-2 M^-1 T^2 I^2 +typedef derived_dimension::type reluctance_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_RELUCTANCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/resistance.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/resistance.hpp new file mode 100644 index 0000000000..3b1491d2bf --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/resistance.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for resistance : L^2 M T^-3 I^-2 +typedef derived_dimension::type resistance_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_RESISTANCE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/resistivity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/resistivity.hpp new file mode 100644 index 0000000000..a82b900c47 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/resistivity.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_RESISTIVITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_RESISTIVITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for resistivity : L^3 M T^-3 I^-2 +typedef derived_dimension::type resistivity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_RESISTIVITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/solid_angle.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/solid_angle.hpp new file mode 100644 index 0000000000..1d035c02f8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/solid_angle.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SOLID_ANGLE_BASE_DIMENSION_HPP +#define BOOST_UNITS_SOLID_ANGLE_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of solid angle +struct solid_angle_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::solid_angle_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// base dimension of solid angle (QS) +typedef solid_angle_base_dimension::dimension_type solid_angle_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SOLID_ANGLE_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_energy.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_energy.hpp new file mode 100644 index 0000000000..e74a29371f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_energy.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SPECIFIC_ENERGY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_SPECIFIC_ENERGY_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for specific energy : L^2 T^-2 +typedef derived_dimension::type specific_energy_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SPECIFIC_ENERGY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_heat_capacity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_heat_capacity.hpp new file mode 100644 index 0000000000..9e48faec0c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_heat_capacity.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SPECIFIC_HEAT_CAPACITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_SPECIFIC_HEAT_CAPACITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for specific heat capacity : L^2 T^-2 Theta^-1 +typedef derived_dimension::type specific_heat_capacity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SPECIFIC_HEAT_CAPACITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_volume.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_volume.hpp new file mode 100644 index 0000000000..85ed8896b7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/specific_volume.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SPECIFIC_VOLUME_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_SPECIFIC_VOLUME_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for specific volume : L^3 M^-1 +typedef derived_dimension::type specific_volume_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SPECIFIC_VOLUME_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/stress.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/stress.hpp new file mode 100644 index 0000000000..d989c8c405 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/stress.hpp @@ -0,0 +1,32 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_STRESS_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_STRESS_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for stress : L^-1 M T^-2 +typedef derived_dimension::type stress_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_STRESS_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/surface_density.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/surface_density.hpp new file mode 100644 index 0000000000..898e8f4a24 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/surface_density.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SURFACE_DENSITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_SURFACE_DENSITY_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for surface density : L^-2 M +typedef derived_dimension::type surface_density_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SURFACE_DENSITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/surface_tension.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/surface_tension.hpp new file mode 100644 index 0000000000..630509fd6d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/surface_tension.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SURFACE_TENSION_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_SURFACE_TENSION_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for surface tension : M T^-2 +typedef derived_dimension::type surface_tension_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SURFACE_TENSION_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/temperature.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/temperature.hpp new file mode 100644 index 0000000000..f6bc788203 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/temperature.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_TEMPERATURE_BASE_DIMENSION_HPP +#define BOOST_UNITS_TEMPERATURE_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of temperature +struct temperature_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::temperature_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// dimension of temperature (Theta) +typedef temperature_base_dimension::dimension_type temperature_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_TEMPERATURE_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/thermal_conductivity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/thermal_conductivity.hpp new file mode 100644 index 0000000000..abc82c7f18 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/thermal_conductivity.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_THERMAL_CONDUCTIVITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_THERMAL_CONDUCTIVITY_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for thermal_conductivity : L^1 M^1 T^-3 Theta^-1 +typedef derived_dimension::type thermal_conductivity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_THERMAL_CONDUCTIVITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/time.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/time.hpp new file mode 100644 index 0000000000..0b9a3e1f32 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/time.hpp @@ -0,0 +1,49 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_TIME_BASE_DIMENSION_HPP +#define BOOST_UNITS_TIME_BASE_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// base dimension of time +struct time_base_dimension : + boost::units::base_dimension +{ }; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TYPE(boost::units::time_base_dimension) + +#endif + +namespace boost { + +namespace units { + +/// dimension of time (T) +typedef time_base_dimension::dimension_type time_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_TIME_BASE_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/torque.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/torque.hpp new file mode 100644 index 0000000000..61c41a139f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/torque.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for torque : L^2 M T^-2 QP^-1 +typedef derived_dimension::type torque_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_TORQUE_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/velocity.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/velocity.hpp new file mode 100644 index 0000000000..eb3d41215a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/velocity.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_VELOCITY_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_VELOCITY_DERIVED_DIMENSION_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for velocity : L T^-1 +typedef derived_dimension::type velocity_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_VELOCITY_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/volume.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/volume.hpp new file mode 100644 index 0000000000..a2cdd88f25 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/volume.hpp @@ -0,0 +1,28 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for volume : l^3 +typedef derived_dimension::type volume_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_VOLUME_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/physical_dimensions/wavenumber.hpp b/deal.II/contrib/boost/include/boost/units/physical_dimensions/wavenumber.hpp new file mode 100644 index 0000000000..abaf0acc5d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/physical_dimensions/wavenumber.hpp @@ -0,0 +1,28 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_WAVENUMBER_DERIVED_DIMENSION_HPP +#define BOOST_UNITS_WAVENUMBER_DERIVED_DIMENSION_HPP + +#include +#include + +namespace boost { + +namespace units { + +/// derived dimension for wavenumber : L^-1 +typedef derived_dimension::type wavenumber_dimension; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_WAVENUMBER_DERIVED_DIMENSION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/pow.hpp b/deal.II/contrib/boost/include/boost/units/pow.hpp new file mode 100644 index 0000000000..ed0b3e4af4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/pow.hpp @@ -0,0 +1,112 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_POW_HPP +#define BOOST_UNITS_POW_HPP + +#include +#include + +#include +#include +#include + +/// \file +/// \brief Raise values to exponents known at compile-time + +namespace boost { + +namespace units { + +/// raise a value to a @c static_rational power +template +inline typename power_typeof_helper::type +pow(const Y& x) +{ + return power_typeof_helper::value(x); +} + +/// raise a value to an integer power +template +inline typename power_typeof_helper >::type +pow(const Y& x) +{ + return power_typeof_helper >::value(x); +} + +#ifndef BOOST_UNITS_DOXYGEN + +/// raise @c T to a @c static_rational power +template +struct power_typeof_helper > +{ + typedef typename mpl::if_, double, T>::type internal_type; + typedef detail::static_rational_power_impl, internal_type> impl; + typedef typename impl::type type; + + static type value(const T& x) + { + return impl::call(x); + } +}; + +/// raise @c float to a @c static_rational power +template +struct power_typeof_helper > +{ + // N.B. pathscale doesn't accept inheritence for some reason. + typedef power_typeof_helper > base; + typedef typename base::type type; + static type value(const double& x) + { + return base::value(x); + } +}; + +#endif + +/// take the @c static_rational root of a value +template +typename root_typeof_helper::type +root(const Y& x) +{ + return root_typeof_helper::value(x); +} + +/// take the integer root of a value +template +typename root_typeof_helper >::type +root(const Y& x) +{ + return root_typeof_helper >::value(x); +} + +#ifndef BOOST_UNITS_DOXYGEN + +/// take @c static_rational root of an @c T +template +struct root_typeof_helper > +{ + // N.B. pathscale doesn't accept inheritence for some reason. + typedef power_typeof_helper > base; + typedef typename base::type type; + static type value(const T& x) + { + return(base::value(x)); + } +}; + +#endif + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_STATIC_RATIONAL_HPP diff --git a/deal.II/contrib/boost/include/boost/units/quantity.hpp b/deal.II/contrib/boost/include/boost/units/quantity.hpp new file mode 100644 index 0000000000..4fe916dcc4 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/quantity.hpp @@ -0,0 +1,1218 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_QUANTITY_HPP +#define BOOST_UNITS_QUANTITY_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace detail { + +template +struct is_base_unit : mpl::false_ {}; + +template +struct is_base_unit : mpl::true_ {}; + +template +struct is_narrowing_conversion_impl : mpl::bool_<(sizeof(Source) > sizeof(Destination))> {}; + +template +struct is_non_narrowing_conversion : + mpl::and_< + boost::is_convertible, + mpl::not_< + mpl::and_< + boost::is_arithmetic, + boost::is_arithmetic, + mpl::or_< + mpl::and_< + is_integral, + mpl::not_ > + >, + is_narrowing_conversion_impl + > + > + > + > +{}; + +template<> +struct is_non_narrowing_conversion : mpl::false_ {}; + +// msvc 7.1 needs extra disambiguation +template +struct disable_if_is_same +{ + typedef void type; +}; + +template +struct disable_if_is_same {}; + +} + +/// class declaration +template +class quantity +{ + // base units are not the same as units. + BOOST_MPL_ASSERT_NOT((detail::is_base_unit)); + enum { force_instantiation_of_unit = sizeof(Unit) }; + typedef void (quantity::*unspecified_null_pointer_constant_type)(int*******); + public: + typedef quantity this_type; + + typedef Y value_type; + typedef Unit unit_type; + + quantity() : val_() + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + quantity(unspecified_null_pointer_constant_type) : val_() + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + quantity(const this_type& source) : val_(source.val_) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + // Need to make sure that the destructor of + // Unit which contains the checking is instantiated, + // on sun. + #ifdef __SUNPRO_CC + ~quantity() { + unit_type force_unit_instantiation; + } + #endif + + //~quantity() { } + + this_type& operator=(const this_type& source) + { + val_ = source.val_; + + return *this; + } + + #ifndef BOOST_NO_SFINAE + + /// implicit conversion between value types is allowed if allowed for value types themselves + template + quantity(const quantity& source, + typename boost::enable_if >::type* = 0) : + val_(source.value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + /// implicit conversion between value types is not allowed if not allowed for value types themselves + template + explicit quantity(const quantity& source, + typename boost::disable_if >::type* = 0) : + val_(static_cast(source.value())) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + #else + + /// implicit conversion between value types is allowed if allowed for value types themselves + template + quantity(const quantity& source) : + val_(source.value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + } + + #endif + + /// implicit assignment between value types is allowed if allowed for value types themselves + template + this_type& operator=(const quantity& source) + { + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + + *this = this_type(source); + + return *this; + } + + #ifndef BOOST_NO_SFINAE + + /// explicit conversion between different unit systems is allowed if implicit conversion is disallowed + template + explicit + quantity(const quantity& source, + typename boost::disable_if< + mpl::and_< + //is_implicitly_convertible should be undefined when the + //units are not convertible at all + typename is_implicitly_convertible::type, + detail::is_non_narrowing_conversion + >, + typename detail::disable_if_is_same::type + >::type* = 0) + : val_(conversion_helper,this_type>::convert(source).value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + } + + /// implicit conversion between different unit systems is allowed if each fundamental dimension is implicitly convertible + template + quantity(const quantity& source, + typename boost::enable_if< + mpl::and_< + typename is_implicitly_convertible::type, + detail::is_non_narrowing_conversion + >, + typename detail::disable_if_is_same::type + >::type* = 0) + : val_(conversion_helper,this_type>::convert(source).value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + } + + #else + + /// without SFINAE we can't distinguish between explicit and implicit conversions so + /// the conversion is always explicit + template + explicit quantity(const quantity& source) + : val_(conversion_helper,this_type>::convert(source).value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + } + + #endif + + /// implicit assignment between different unit systems is allowed if each fundamental dimension is implicitly convertible + template + this_type& operator=(const quantity& source) + { + + BOOST_STATIC_ASSERT((is_implicitly_convertible::value == true)); + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + + *this = this_type(source); + + return *this; + } + + const value_type& value() const { return val_; } ///< constant accessor to value + + ///< can add a quantity of the same type if add_typeof_helper::type is convertible to value_type + template + this_type& operator+=(const quantity& source) + { + BOOST_STATIC_ASSERT((boost::is_same::type, Unit>::value)); + val_ += source.value(); + return *this; + } + + ///< can subtract a quantity of the same type if subtract_typeof_helper::type is convertible to value_type + template + this_type& operator-=(const quantity& source) + { + BOOST_STATIC_ASSERT((boost::is_same::type, Unit>::value)); + val_ -= source.value(); + return *this; + } + + template + this_type& operator*=(const quantity& source) + { + BOOST_STATIC_ASSERT((boost::is_same::type, Unit>::value)); + val_ *= source.value(); + return *this; + } + + template + this_type& operator/=(const quantity& source) + { + BOOST_STATIC_ASSERT((boost::is_same::type, Unit>::value)); + val_ /= source.value(); + return *this; + } + + ///< can multiply a quantity by a scalar value_type if multiply_typeof_helper::type is convertible to value_type + this_type& operator*=(const value_type& source) { val_ *= source; return *this; } + ///< can divide a quantity by a scalar value_type if divide_typeof_helper::type is convertible to value_type + this_type& operator/=(const value_type& source) { val_ /= source; return *this; } + + /// Construct quantity directly from @c value_type (potentially dangerous). + static this_type from_value(const value_type& val) { return this_type(val, 0); } + + protected: + explicit quantity(const value_type& val, int) : val_(val) { } + + private: + value_type val_; +}; + +/// Specialization for dimensionless quantities. Implicit conversions between +/// unit systems are allowed because all dimensionless quantities are equivalent. +/// Implicit construction and assignment from and conversion to @c value_type is +/// also allowed. +template +class quantity +{ + public: + typedef quantity,Y> this_type; + + typedef Y value_type; + typedef System system_type; + typedef dimensionless_type dimension_type; + typedef unit unit_type; + + quantity() : val_() + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + /// construction from raw @c value_type is allowed + quantity(value_type val) : val_(val) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + quantity(const this_type& source) : val_(source.val_) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + //~quantity() { } + + this_type& operator=(const this_type& source) + { + val_ = source.val_; + + return *this; + } + + #ifndef BOOST_NO_SFINAE + + /// implicit conversion between value types is allowed if allowed for value types themselves + template + quantity(const quantity,YY>& source, + typename boost::enable_if >::type* = 0) : + val_(source.value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + /// implicit conversion between value types is not allowed if not allowed for value types themselves + template + explicit quantity(const quantity,YY>& source, + typename boost::disable_if >::type* = 0) : + val_(static_cast(source.value())) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + #else + + /// implicit conversion between value types is allowed if allowed for value types themselves + template + quantity(const quantity,YY>& source) : + val_(source.value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + } + + #endif + + /// implicit assignment between value types is allowed if allowed for value types themselves + template + this_type& operator=(const quantity,YY>& source) + { + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + + *this = this_type(source); + + return *this; + } + + #if 1 + + /// implicit conversion between different unit systems is allowed + template + quantity(const quantity,Y2>& source, + #ifdef __SUNPRO_CC + typename boost::enable_if< + boost::mpl::and_< + detail::is_non_narrowing_conversion, + detail::is_dimensionless_system + > + >::type* = 0 + #else + typename boost::enable_if >::type* = 0, + typename detail::disable_if_is_same::type* = 0, + typename boost::enable_if >::type* = 0 + #endif + ) : + val_(source.value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + /// implicit conversion between different unit systems is allowed + template + explicit quantity(const quantity,Y2>& source, + #ifdef __SUNPRO_CC + typename boost::enable_if< + boost::mpl::and_< + boost::mpl::not_ >, + detail::is_dimensionless_system + > + >::type* = 0 + #else + typename boost::disable_if >::type* = 0, + typename detail::disable_if_is_same::type* = 0, + typename boost::enable_if >::type* = 0 + #endif + ) : + val_(static_cast(source.value())) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + #else + + /// implicit conversion between different unit systems is allowed + template + quantity(const quantity >,Y2>& source) : + val_(source.value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + BOOST_STATIC_ASSERT((boost::is_convertible::value == true)); + } + + #endif + + /// conversion between different unit systems is explicit when + /// the units are not equivalent. + template + explicit quantity(const quantity,Y2>& source, + typename boost::disable_if >::type* = 0) : + val_(conversion_helper,Y2>, this_type>::convert(source).value()) + { + BOOST_UNITS_CHECK_LAYOUT_COMPATIBILITY(this_type, Y); + } + + #ifndef __SUNPRO_CC + + /// implicit assignment between different unit systems is allowed + template + this_type& operator=(const quantity& source) + { + *this = this_type(source); + + return *this; + } + + #endif + + /// implicit conversion to @c value_type is allowed + operator value_type() const { return val_; } + + const value_type& value() const { return val_; } ///< constant accessor to value + + ///< can add a quantity of the same type if add_typeof_helper::type is convertible to value_type + this_type& operator+=(const this_type& source) { val_ += source.val_; return *this; } + + ///< can subtract a quantity of the same type if subtract_typeof_helper::type is convertible to value_type + this_type& operator-=(const this_type& source) { val_ -= source.val_; return *this; } + + ///< can multiply a quantity by a scalar value_type if multiply_typeof_helper::type is convertible to value_type + this_type& operator*=(const value_type& val) { val_ *= val; return *this; } + + ///< can divide a quantity by a scalar value_type if divide_typeof_helper::type is convertible to value_type + this_type& operator/=(const value_type& val) { val_ /= val; return *this; } + + /// Construct quantity directly from @c value_type. + static this_type from_value(const value_type& val) { return this_type(val); } + + private: + value_type val_; +}; + +#ifdef BOOST_MSVC +// HACK: For some obscure reason msvc 8.0 needs these specializations +template +class quantity, T> {}; +template +class quantity {}; +#endif + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::quantity, 2) + +#endif + +namespace boost { + +namespace units { + +namespace detail { + +/// helper class for quantity_cast +template struct quantity_cast_helper; + +/// specialization for casting to the value type +template +struct quantity_cast_helper > +{ + typedef Y type; + + type operator()(quantity& source) { return const_cast(source.value()); } +}; + +/// specialization for casting to the value type +template +struct quantity_cast_helper > +{ + typedef Y type; + + type operator()(const quantity& source) { return source.value(); } +}; + +} // namespace detail + +/// quantity_cast provides mutating access to underlying quantity value_type +template +inline +X +quantity_cast(Y& source) +{ + detail::quantity_cast_helper qch; + + return qch(source); +} + +template +inline +X +quantity_cast(const Y& source) +{ + detail::quantity_cast_helper qch; + + return qch(source); +} + +/// swap quantities +template +inline void swap(quantity& lhs, quantity& rhs) +{ + using std::swap; + swap(quantity_cast(lhs),quantity_cast(rhs)); +} + +/// specialize unary plus typeof helper +/// INTERNAL ONLY +template +struct unary_plus_typeof_helper< quantity > +{ + typedef typename unary_plus_typeof_helper::type value_type; + typedef typename unary_plus_typeof_helper::type unit_type; + typedef quantity type; +}; + +/// specialize unary minus typeof helper +/// INTERNAL ONLY +template +struct unary_minus_typeof_helper< quantity > +{ + typedef typename unary_minus_typeof_helper::type value_type; + typedef typename unary_minus_typeof_helper::type unit_type; + typedef quantity type; +}; + +/// specialize add typeof helper +/// INTERNAL ONLY +template +struct add_typeof_helper< quantity,quantity > +{ + typedef typename add_typeof_helper::type value_type; + typedef typename add_typeof_helper::type unit_type; + typedef quantity type; +}; + +/// for sun CC we need to invoke SFINAE at +/// the top level, otherwise it will silently +/// return int. +template +struct add_typeof_helper< quantity,X>,quantity,Y> > +{ +}; + +template +struct add_typeof_helper< quantity,X>,quantity,Y> > +{ + typedef typename add_typeof_helper::type value_type; + typedef unit unit_type; + typedef quantity type; +}; + +/// specialize subtract typeof helper +/// INTERNAL ONLY +template +struct subtract_typeof_helper< quantity,quantity > +{ + typedef typename subtract_typeof_helper::type value_type; + typedef typename subtract_typeof_helper::type unit_type; + typedef quantity type; +}; + +// Force adding different units to fail on sun. +template +struct subtract_typeof_helper< quantity,X>,quantity,Y> > +{ +}; + +template +struct subtract_typeof_helper< quantity,X>,quantity,Y> > +{ + typedef typename subtract_typeof_helper::type value_type; + typedef unit unit_type; + typedef quantity type; +}; + +/// scalar times unit typeof helper +/// INTERNAL ONLY +template +struct multiply_typeof_helper< X,unit > +{ + typedef X value_type; + typedef unit unit_type; + typedef quantity type; +}; + +/// unit times scalar typeof helper +/// INTERNAL ONLY +template +struct multiply_typeof_helper< unit,X > +{ + typedef X value_type; + typedef unit unit_type; + typedef quantity type; +}; + +/// scalar times quantity typeof helper +/// INTERNAL ONLY +template +struct multiply_typeof_helper< X,quantity > +{ + typedef typename multiply_typeof_helper::type value_type; + typedef Unit unit_type; + typedef quantity type; +}; + +/// quantity times scalar typeof helper +/// INTERNAL ONLY +template +struct multiply_typeof_helper< quantity,Y > +{ + typedef typename multiply_typeof_helper::type value_type; + typedef Unit unit_type; + typedef quantity type; +}; + +/// unit times quantity typeof helper +/// INTERNAL ONLY +template +struct multiply_typeof_helper< unit,quantity > +{ + typedef X value_type; + typedef typename multiply_typeof_helper< unit,Unit >::type unit_type; + typedef quantity type; +}; + +/// quantity times unit typeof helper +/// INTERNAL ONLY +template +struct multiply_typeof_helper< quantity,unit > +{ + typedef X value_type; + typedef typename multiply_typeof_helper< Unit,unit >::type unit_type; + typedef quantity type; +}; + +/// quantity times quantity typeof helper +/// INTERNAL ONLY +template +struct multiply_typeof_helper< quantity,quantity > +{ + typedef typename multiply_typeof_helper::type value_type; + typedef typename multiply_typeof_helper::type unit_type; + typedef quantity type; +}; + +/// scalar divided by unit typeof helper +/// INTERNAL ONLY +template +struct divide_typeof_helper< X,unit > +{ + typedef X value_type; + typedef typename power_typeof_helper< unit,static_rational<-1> >::type unit_type; + typedef quantity type; +}; + +/// unit divided by scalar typeof helper +/// INTERNAL ONLY +template +struct divide_typeof_helper< unit,X > +{ + typedef typename divide_typeof_helper::type value_type; + typedef unit unit_type; + typedef quantity type; +}; + +/// scalar divided by quantity typeof helper +/// INTERNAL ONLY +template +struct divide_typeof_helper< X,quantity > +{ + typedef typename divide_typeof_helper::type value_type; + typedef typename power_typeof_helper< Unit,static_rational<-1> >::type unit_type; + typedef quantity type; +}; + +/// quantity divided by scalar typeof helper +/// INTERNAL ONLY +template +struct divide_typeof_helper< quantity,Y > +{ + typedef typename divide_typeof_helper::type value_type; + typedef Unit unit_type; + typedef quantity type; +}; + +/// unit divided by quantity typeof helper +/// INTERNAL ONLY +template +struct divide_typeof_helper< unit,quantity > +{ + typedef typename divide_typeof_helper::type value_type; + typedef typename divide_typeof_helper< unit,Unit >::type unit_type; + typedef quantity type; +}; + +/// quantity divided by unit typeof helper +/// INTERNAL ONLY +template +struct divide_typeof_helper< quantity,unit > +{ + typedef X value_type; + typedef typename divide_typeof_helper< Unit,unit >::type unit_type; + typedef quantity type; +}; + +/// quantity divided by quantity typeof helper +/// INTERNAL ONLY +template +struct divide_typeof_helper< quantity,quantity > +{ + typedef typename divide_typeof_helper::type value_type; + typedef typename divide_typeof_helper::type unit_type; + typedef quantity type; +}; + +/// specialize power typeof helper +/// INTERNAL ONLY +template +struct power_typeof_helper< quantity,static_rational > +{ + typedef typename power_typeof_helper >::type value_type; + typedef typename power_typeof_helper >::type unit_type; + typedef quantity type; + + static type value(const quantity& x) + { + return type::from_value(power_typeof_helper >::value(x.value())); + } +}; + +/// specialize root typeof helper +/// INTERNAL ONLY +template +struct root_typeof_helper< quantity,static_rational > +{ + typedef typename root_typeof_helper >::type value_type; + typedef typename root_typeof_helper >::type unit_type; + typedef quantity type; + + static type value(const quantity& x) + { + return type::from_value(root_typeof_helper >::value(x.value())); + } +}; + +/// runtime unit times scalar +/// INTERNAL ONLY +template +inline +typename multiply_typeof_helper< unit,Y >::type +operator*(const unit&,const Y& rhs) +{ + typedef typename multiply_typeof_helper< unit,Y >::type type; + + return type::from_value(rhs); +} + +/// runtime unit divided by scalar +template +inline +typename divide_typeof_helper< unit,Y >::type +operator/(const unit&,const Y& rhs) +{ + typedef typename divide_typeof_helper,Y>::type type; + + return type::from_value(Y(1)/rhs); +} + +/// runtime scalar times unit +template +inline +typename multiply_typeof_helper< Y,unit >::type +operator*(const Y& lhs,const unit&) +{ + typedef typename multiply_typeof_helper< Y,unit >::type type; + + return type::from_value(lhs); +} + +/// runtime scalar divided by unit +template +inline +typename divide_typeof_helper< Y,unit >::type +operator/(const Y& lhs,const unit&) +{ + typedef typename divide_typeof_helper< Y,unit >::type type; + + return type::from_value(lhs); +} + +///// runtime quantity times scalar +//template +//inline +//typename multiply_typeof_helper< quantity,Y >::type +//operator*(const quantity& lhs,const Y& rhs) +//{ +// typedef typename multiply_typeof_helper< quantity,Y >::type type; +// +// return type::from_value(lhs.value()*rhs); +//} +// +///// runtime scalar times quantity +//template +//inline +//typename multiply_typeof_helper< X,quantity >::type +//operator*(const X& lhs,const quantity& rhs) +//{ +// typedef typename multiply_typeof_helper< X,quantity >::type type; +// +// return type::from_value(lhs*rhs.value()); +//} + +/// runtime quantity times scalar +template +inline +typename multiply_typeof_helper< quantity,X >::type +operator*(const quantity& lhs,const X& rhs) +{ + typedef typename multiply_typeof_helper< quantity,X >::type type; + + return type::from_value(lhs.value()*rhs); +} + +/// runtime scalar times quantity +template +inline +typename multiply_typeof_helper< X,quantity >::type +operator*(const X& lhs,const quantity& rhs) +{ + typedef typename multiply_typeof_helper< X,quantity >::type type; + + return type::from_value(lhs*rhs.value()); +} + +///// runtime quantity divided by scalar +//template +//inline +//typename divide_typeof_helper< quantity,Y >::type +//operator/(const quantity& lhs,const Y& rhs) +//{ +// typedef typename divide_typeof_helper< quantity,Y >::type type; +// +// return type::from_value(lhs.value()/rhs); +//} +// +///// runtime scalar divided by quantity +//template +//inline +//typename divide_typeof_helper< X,quantity >::type +//operator/(const X& lhs,const quantity& rhs) +//{ +// typedef typename divide_typeof_helper< X,quantity >::type type; +// +// return type::from_value(lhs/rhs.value()); +//} + +/// runtime quantity divided by scalar +template +inline +typename divide_typeof_helper< quantity,X >::type +operator/(const quantity& lhs,const X& rhs) +{ + typedef typename divide_typeof_helper< quantity,X >::type type; + + return type::from_value(lhs.value()/rhs); +} + +/// runtime scalar divided by quantity +template +inline +typename divide_typeof_helper< X,quantity >::type +operator/(const X& lhs,const quantity& rhs) +{ + typedef typename divide_typeof_helper< X,quantity >::type type; + + return type::from_value(lhs/rhs.value()); +} + +/// runtime unit times quantity +template +inline +typename multiply_typeof_helper< unit,quantity >::type +operator*(const unit&,const quantity& rhs) +{ + typedef typename multiply_typeof_helper< unit,quantity >::type type; + + return type::from_value(rhs.value()); +} + +/// runtime unit divided by quantity +template +inline +typename divide_typeof_helper< unit,quantity >::type +operator/(const unit&,const quantity& rhs) +{ + typedef typename divide_typeof_helper< unit,quantity >::type type; + + return type::from_value(Y(1)/rhs.value()); +} + +/// runtime quantity times unit +template +inline +typename multiply_typeof_helper< quantity,unit >::type +operator*(const quantity& lhs,const unit&) +{ + typedef typename multiply_typeof_helper< quantity,unit >::type type; + + return type::from_value(lhs.value()); +} + +/// runtime quantity divided by unit +template +inline +typename divide_typeof_helper< quantity,unit >::type +operator/(const quantity& lhs,const unit&) +{ + typedef typename divide_typeof_helper< quantity,unit >::type type; + + return type::from_value(lhs.value()); +} + +/// runtime unary plus quantity +template +typename unary_plus_typeof_helper< quantity >::type +operator+(const quantity& val) +{ + typedef typename unary_plus_typeof_helper< quantity >::type type; + + return type::from_value(+val.value()); +} + +/// runtime unary minus quantity +template +typename unary_minus_typeof_helper< quantity >::type +operator-(const quantity& val) +{ + typedef typename unary_minus_typeof_helper< quantity >::type type; + + return type::from_value(-val.value()); +} + +/// runtime quantity plus quantity +template +inline +typename add_typeof_helper< quantity,quantity >::type +operator+(const quantity& lhs, + const quantity& rhs) +{ + typedef typename add_typeof_helper< quantity,quantity >::type type; + + return type::from_value(lhs.value()+rhs.value()); +} + +/// runtime quantity minus quantity +template +inline +typename subtract_typeof_helper< quantity,quantity >::type +operator-(const quantity& lhs, + const quantity& rhs) +{ + typedef typename subtract_typeof_helper< quantity,quantity >::type type; + + return type::from_value(lhs.value()-rhs.value()); +} + +/// runtime quantity times quantity +template +inline +typename multiply_typeof_helper< quantity,quantity >::type +operator*(const quantity& lhs, + const quantity& rhs) +{ + typedef typename multiply_typeof_helper< quantity, + quantity >::type type; + + return type::from_value(lhs.value()*rhs.value()); +} + +/// runtime quantity divided by quantity +template +inline +typename divide_typeof_helper< quantity,quantity >::type +operator/(const quantity& lhs, + const quantity& rhs) +{ + typedef typename divide_typeof_helper< quantity, + quantity >::type type; + + return type::from_value(lhs.value()/rhs.value()); +} + +/// runtime operator== +template +inline +bool +operator==(const quantity& val1, + const quantity& val2) +{ + return val1.value() == val2.value(); +} + +/// runtime operator!= +template +inline +bool +operator!=(const quantity& val1, + const quantity& val2) +{ + return val1.value() != val2.value(); +} + +/// runtime operator< +template +inline +bool +operator<(const quantity& val1, + const quantity& val2) +{ + return val1.value() < val2.value(); +} + +/// runtime operator<= +template +inline +bool +operator<=(const quantity& val1, + const quantity& val2) +{ + return val1.value() <= val2.value(); +} + +/// runtime operator> +template +inline +bool +operator>(const quantity& val1, + const quantity& val2) +{ + return val1.value() > val2.value(); +} + +/// runtime operator>= +template +inline +bool +operator>=(const quantity& val1, + const quantity& val2) +{ + return val1.value() >= val2.value(); +} + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_QUANTITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/reduce_unit.hpp b/deal.II/contrib/boost/include/boost/units/reduce_unit.hpp new file mode 100644 index 0000000000..5c6742b8eb --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/reduce_unit.hpp @@ -0,0 +1,38 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_REDUCE_UNIT_HPP_INCLUDED +#define BOOST_UNITS_REDUCE_UNIT_HPP_INCLUDED + +namespace boost { +namespace units { + +#ifdef BOOST_UNITS_DOXYGEN + +/// Returns a unique type for every unit. +template +struct reduce_unit { + typedef detail::unspecified type; +}; + +#else + +// default implementation: return Unit unchanged. +template +struct reduce_unit { + typedef Unit type; +}; + +#endif + +} +} + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/scale.hpp b/deal.II/contrib/boost/include/boost/units/scale.hpp new file mode 100644 index 0000000000..05a389f61f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/scale.hpp @@ -0,0 +1,137 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2007-2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SCALE_HPP_INCLUDED +#define BOOST_UNITS_SCALE_HPP_INCLUDED + +#include + +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +template +struct scaled_base_unit; + +/// class representing a scaling factor such as 10^3 +/// The exponent should be a static rational. +template +struct scale +{ + static const long base = Base; + typedef Exponent exponent; + typedef double value_type; + static value_type value() { return(detail::static_rational_power(static_cast(base))); } + // These need to be defined in specializations for + // printing to work. + // static std::string name(); + // static std::string symbol(); +}; + +template +const long scale::base; + +/// INTERNAL ONLY +template +struct scale > +{ + static const long base = Base; + typedef static_rational<0> exponent; + typedef one value_type; + static one value() { one result; return(result); } + static std::string name() { return(""); } + static std::string symbol() { return(""); } +}; + +template +const long scale >::base; + +template +std::string symbol_string(const scale&) +{ + return scale::symbol(); +} + +template +std::string name_string(const scale&) +{ + return scale::name(); +} + +#ifndef BOOST_UNITS_DOXYGEN + +#define BOOST_UNITS_SCALE_SPECIALIZATION(base_,exponent_,val_,name_,symbol_) \ +template<> \ +struct scale \ +{ \ + static const long base = base_; \ + typedef exponent_ exponent; \ + typedef double value_type; \ + static value_type value() { return(val_); } \ + static std::string name() { return(#name_); } \ + static std::string symbol() { return(#symbol_); } \ +} + +#define BOOST_UNITS_SCALE_DEF(exponent_,value_,name_,symbol_) \ +BOOST_UNITS_SCALE_SPECIALIZATION(10,static_rational,value_, name_, symbol_) + +BOOST_UNITS_SCALE_DEF(-24, 1e-24 ,yocto, y); +BOOST_UNITS_SCALE_DEF(-21, 1e-21, zepto, z); +BOOST_UNITS_SCALE_DEF(-18, 1e-18, atto, a); +BOOST_UNITS_SCALE_DEF(-15, 1e-15, femto, f); +BOOST_UNITS_SCALE_DEF(-12, 1e-12, pico, p); +BOOST_UNITS_SCALE_DEF(-9, 1e-9, nano, n); +BOOST_UNITS_SCALE_DEF(-6, 1e-6, micro, u); +BOOST_UNITS_SCALE_DEF(-3, 1e-3, milli, m); +BOOST_UNITS_SCALE_DEF(-2, 1e-2, centi, c); +BOOST_UNITS_SCALE_DEF(-1, 1e-1, deci, d); + +BOOST_UNITS_SCALE_DEF(1, 1e1, deka, da); +BOOST_UNITS_SCALE_DEF(2, 1e2, hecto, h); +BOOST_UNITS_SCALE_DEF(3, 1e3, kilo, k); +BOOST_UNITS_SCALE_DEF(6, 1e6, mega, M); +BOOST_UNITS_SCALE_DEF(9, 1e9, giga, G); +BOOST_UNITS_SCALE_DEF(12, 1e12, tera, T); +BOOST_UNITS_SCALE_DEF(15, 1e15, peta, P); +BOOST_UNITS_SCALE_DEF(18, 1e18, exa, E); +BOOST_UNITS_SCALE_DEF(21, 1e21, zetta, Z); +BOOST_UNITS_SCALE_DEF(24, 1e24, yotta, Y); + +BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<10>, 1024.0, kibi, Ki); +BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<20>, 1048576.0, mebi, Mi); +BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<30>, 1073741824.0, gibi, Gi); +BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<40>, 1099511627776.0, tebi, Ti); +BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<50>, 1125899906842624.0, pebi, Pi); +BOOST_UNITS_SCALE_SPECIALIZATION(2, static_rational<60>, 1152921504606846976.0, exbi, Ei); + +#undef BOOST_UNITS_SCALE_DEF +#undef BOOST_UNITS_SCALE_SPECIALIZATION + +#endif + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::scale, (long)(class)) + +#endif + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/scaled_base_unit.hpp b/deal.II/contrib/boost/include/boost/units/scaled_base_unit.hpp new file mode 100644 index 0000000000..201de5e85d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/scaled_base_unit.hpp @@ -0,0 +1,146 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SCALED_BASE_UNIT_HPP_INCLUDED +#define BOOST_UNITS_SCALED_BASE_UNIT_HPP_INCLUDED + +#include + +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +template +struct heterogeneous_system; + +template +struct heterogeneous_system_impl; + +template +struct heterogeneous_system_dim; + +template +struct base_unit_info; + +/// INTERNAL ONLY +struct scaled_base_unit_tag {}; + +template +struct scaled_base_unit +{ + /// INTERNAL ONLY + typedef void boost_units_is_base_unit_type; + typedef scaled_base_unit type; + typedef scaled_base_unit_tag tag; + typedef S system_type; + typedef Scale scale_type; + typedef typename S::dimension_type dimension_type; + +#ifdef BOOST_UNITS_DOXYGEN + + typedef detail::unspecified unit_type; + +#else + + typedef unit< + dimension_type, + heterogeneous_system< + heterogeneous_system_impl< + list< + heterogeneous_system_dim >, + dimensionless_type + >, + dimension_type, + dimensionless_type + > + > + > unit_type; + +#endif + + static std::string symbol() + { + return(Scale::symbol() + base_unit_info::symbol()); + } + static std::string name() + { + return(Scale::name() + base_unit_info::name()); + } +}; + +} // namespace units + +} // namespace boost + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::scaled_base_unit, (class)(class)) + +#endif + +namespace boost { + +#ifndef BOOST_UNITS_DOXYGEN + +namespace mpl { + +/// INTERNAL ONLY +template +struct less_impl +{ + template + struct apply : mpl::bool_< + boost::type_traits::ice_or<(mpl::less::value), + (boost::type_traits::ice_and::value, (T0::scale_type::exponent::Numerator) < 0>::value)>::value> {}; +}; + +/// INTERNAL ONLY +template +struct less_impl +{ + template + struct apply : mpl::bool_< + boost::type_traits::ice_or<(mpl::less::value), + boost::type_traits::ice_and<(boost::is_same::value), ((T1::scale_type::exponent::Numerator) > 0)>::value>::value> {}; +}; + +/// INTERNAL ONLY +template<> +struct less_impl +{ + template + struct apply : mpl::bool_< + boost::type_traits::ice_or<(mpl::less::value), + boost::type_traits::ice_and<(boost::is_same::value), + boost::type_traits::ice_or<((T0::scale_type::base) < (T1::scale_type::base)), + boost::type_traits::ice_and<((T0::scale_type::base) == (T1::scale_type::base)), + (mpl::less::value)>::value>::value>::value>::value> {}; +}; + +} // namespace mpl + +#endif + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/static_constant.hpp b/deal.II/contrib/boost/include/boost/units/static_constant.hpp new file mode 100644 index 0000000000..9026b3fde2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/static_constant.hpp @@ -0,0 +1,57 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_STATIC_CONSTANT_HPP +#define BOOST_UNITS_STATIC_CONSTANT_HPP + +#include + +/// A convenience macro that allows definition of static +/// constants in headers in an ODR-safe way. +#define BOOST_UNITS_STATIC_CONSTANT(name, type) \ +template \ +struct name##_instance_t \ +{ \ + static const type instance; \ +}; \ + \ +namespace \ +{ \ + static const type& name = name##_instance_t::instance; \ +} \ + \ +template \ +const type name##_instance_t::instance + +/// A convenience macro for static constants with auto +/// type deduction. +#if BOOST_UNITS_HAS_TYPEOF + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#define BOOST_UNITS_AUTO_STATIC_CONSTANT(name, value) \ +BOOST_TYPEOF_NESTED_TYPEDEF(name##_nested_t, value) \ +BOOST_UNITS_STATIC_CONSTANT(name, name##_nested_t::type) = (value) + +#elif BOOST_UNITS_HAS_MWERKS_TYPEOF + +#define BOOST_UNITS_AUTO_STATIC_CONSTANT(name, value) \ +BOOST_UNITS_STATIC_CONSTANT(name, __typeof__(value)) = (value) + +#elif BOOST_UNITS_HAS_GNU_TYPEOF + +#define BOOST_UNITS_AUTO_STATIC_CONSTANT(name, value) \ +BOOST_UNITS_STATIC_CONSTANT(name, typeof(value)) = (value) + +#endif // BOOST_UNITS_HAS_BOOST_TYPEOF + +#endif // BOOST_UNITS_HAS_TYPEOF + +#endif // BOOST_UNITS_STATIC_CONSTANT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/static_rational.hpp b/deal.II/contrib/boost/include/boost/units/static_rational.hpp new file mode 100644 index 0000000000..2a630ec4c0 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/static_rational.hpp @@ -0,0 +1,349 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_STATIC_RATIONAL_HPP +#define BOOST_UNITS_STATIC_RATIONAL_HPP + +#include +#include +#include + +#ifdef __BORLANDC__ +#include +#include +#include +#endif + +#include +#include + +/// \file +/// \brief Compile-time rational numbers and operators. + +namespace boost { + +namespace units { + +namespace detail { + +struct static_rational_tag {}; + +} + +typedef long integer_type; + +/// Compile time absolute value. +template +struct static_abs +{ + BOOST_STATIC_CONSTANT(integer_type,value = Value < 0 ? -Value : Value); +}; + +/// Compile time rational number. +/** +This is an implementation of a compile time rational number, where @c static_rational represents +a rational number with numerator @c N and denominator @c D. Because of the potential for ambiguity arising +from multiple equivalent values of @c static_rational (e.g. @c static_rational<6,2>==static_rational<3>), +static rationals should always be accessed through @c static_rational::type. Template specialization +prevents instantiation of zero denominators (i.e. @c static_rational). The following compile-time +arithmetic operators are provided for static_rational variables only (no operators are defined between +long and static_rational): + - @c mpl::negate + - @c mpl::plus + - @c mpl::minus + - @c mpl::times + - @c mpl::divides + +Neither @c static_power nor @c static_root are defined for @c static_rational. This is because template types +may not be floating point values, while powers and roots of rational numbers can produce floating point +values. +*/ +#ifdef __BORLANDC__ + +template +struct make_integral_c { + typedef boost::mpl::integral_c type; +}; + +template +class static_rational +{ + public: + + typedef static_rational this_type; + + typedef boost::mpl::integral_c N_type; + typedef boost::mpl::integral_c D_type; + + typedef typename make_integral_c< + (::boost::math::static_gcd< + ::boost::units::static_abs::value, + ::boost::units::static_abs::value + >::value)>::type gcd_type; + typedef typename boost::mpl::eval_if< + boost::mpl::less< + D_type, + boost::mpl::integral_c + >, + boost::mpl::negate, + gcd_type + >::type den_type; + + public: + // for mpl arithmetic support + typedef detail::static_rational_tag tag; + + BOOST_STATIC_CONSTANT(integer_type, Numerator = + (::boost::mpl::divides::value)); + BOOST_STATIC_CONSTANT(integer_type, Denominator = + (::boost::mpl::divides::value)); + + /// INTERNAL ONLY + typedef static_rational this_type; + + /// static_rational reduced by GCD + typedef static_rational< + (::boost::mpl::divides::value), + (::boost::mpl::divides::value) + > type; + + static integer_type numerator() { return Numerator; } + static integer_type denominator() { return Denominator; } + + // INTERNAL ONLY + static_rational() { } + //~static_rational() { } +}; +#else +template +class static_rational +{ + private: + + static const integer_type nabs = static_abs::value, + dabs = static_abs::value; + + /// greatest common divisor of N and D + // need cast to signed because static_gcd returns unsigned long + static const integer_type den = + static_cast(boost::math::static_gcd::value) * ((D < 0) ? -1 : 1); + + public: + // for mpl arithmetic support + typedef detail::static_rational_tag tag; + + static const integer_type Numerator = N/den, + Denominator = D/den; + + /// INTERNAL ONLY + typedef static_rational this_type; + + /// static_rational reduced by GCD + typedef static_rational type; + + static integer_type numerator() { return Numerator; } + static integer_type denominator() { return Denominator; } + + // INTERNAL ONLY + static_rational() { } + //~static_rational() { } +}; +#endif + +} + +} + +#if BOOST_UNITS_HAS_BOOST_TYPEOF + +#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP() + +BOOST_TYPEOF_REGISTER_TEMPLATE(boost::units::static_rational, (long)(long)) + +#endif + +namespace boost { + +namespace units { + +// prohibit zero denominator +template class static_rational; + +/// get decimal value of @c static_rational +template +inline typename divide_typeof_helper::type +value(const static_rational&) +{ + return T(N)/T(D); +} + +} // namespace units + +#ifndef BOOST_UNITS_DOXYGEN + +namespace mpl { + +#ifdef __BORLANDC__ + +template<> +struct plus_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + ::boost::mpl::plus< + boost::mpl::times, + boost::mpl::times + >::value, + ::boost::mpl::times::value + >::type type; + }; +}; + +template<> +struct minus_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + ::boost::mpl::minus< + boost::mpl::times, + boost::mpl::times + >::value, + ::boost::mpl::times::value + >::type type; + }; +}; + +template<> +struct times_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + ::boost::mpl::times::value, + ::boost::mpl::times::value + >::type type; + }; +}; + +template<> +struct divides_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + ::boost::mpl::times::value, + ::boost::mpl::times::value + >::type type; + }; +}; + +template<> +struct negate_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + ::boost::mpl::negate::value, + ::boost::mpl::identity::type::Denominator + >::type type; + }; +}; + +template<> +struct less_impl +{ + template + struct apply + { + typedef mpl::bool_<((mpl::minus::type::Numerator) < 0)> type; + }; +}; + +#else + +template<> +struct plus_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + T0::Numerator*T1::Denominator+T1::Numerator*T0::Denominator, + T0::Denominator*T1::Denominator + >::type type; + }; +}; + +template<> +struct minus_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + T0::Numerator*T1::Denominator-T1::Numerator*T0::Denominator, + T0::Denominator*T1::Denominator + >::type type; + }; +}; + +template<> +struct times_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + T0::Numerator*T1::Numerator, + T0::Denominator*T1::Denominator + >::type type; + }; +}; + +template<> +struct divides_impl +{ + template + struct apply { + typedef typename boost::units::static_rational< + T0::Numerator*T1::Denominator, + T0::Denominator*T1::Numerator + >::type type; + }; +}; + +template<> +struct negate_impl +{ + template + struct apply { + typedef typename boost::units::static_rational<-T0::Numerator,T0::Denominator>::type type; + }; +}; + +template<> +struct less_impl +{ + template + struct apply + { + typedef mpl::bool_<((mpl::minus::type::Numerator) < 0)> type; + }; +}; + +#endif + + +} + +#endif + +} // namespace boost + +#endif // BOOST_UNITS_STATIC_RATIONAL_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/abstract.hpp b/deal.II/contrib/boost/include/boost/units/systems/abstract.hpp new file mode 100644 index 0000000000..9b449d68c8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/abstract.hpp @@ -0,0 +1,139 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ABSTRACT_HPP +#define BOOST_UNITS_ABSTRACT_HPP + +#include + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace abstract { + +struct length_unit_tag : base_unit { }; +struct mass_unit_tag : base_unit { }; +struct time_unit_tag : base_unit { }; +struct current_unit_tag : base_unit { }; +struct temperature_unit_tag : base_unit { }; +struct amount_unit_tag : base_unit { }; +struct luminous_intensity_unit_tag : base_unit { }; +struct plane_angle_unit_tag : base_unit { }; +struct solid_angle_unit_tag : base_unit { }; + +typedef make_system< + length_unit_tag, + mass_unit_tag, + time_unit_tag, + current_unit_tag, + temperature_unit_tag, + amount_unit_tag, + luminous_intensity_unit_tag, + plane_angle_unit_tag, + solid_angle_unit_tag +>::type system; + +typedef unit length; ///< abstract unit of length +typedef unit mass; ///< abstract unit of mass +typedef unit time; ///< abstract unit of time +typedef unit current; ///< abstract unit of current +typedef unit temperature; ///< abstract unit of temperature +typedef unit amount; ///< abstract unit of amount +typedef unit luminous_intensity; ///< abstract unit of luminous intensity +typedef unit plane_angle; ///< abstract unit of plane angle +typedef unit solid_angle; ///< abstract unit of solid angle + +} // namespace abstract + +template<> +struct base_unit_info +{ + static std::string name() { return "[Length]"; } + static std::string symbol() { return "[L]"; } +}; + +template<> +struct base_unit_info +{ + static std::string name() { return "[Mass]"; } + static std::string symbol() { return "[M]"; } +}; + +template<> +struct base_unit_info +{ + static std::string name() { return "[Time]"; } + static std::string symbol() { return "[T]"; } +}; + +template<> +struct base_unit_info +{ + static std::string name() { return "[Electric Current]"; } + static std::string symbol() { return "[I]"; } +}; + +template<> +struct base_unit_info +{ + static std::string name() { return "[Temperature]"; } + static std::string symbol() { return "[Theta]"; } +}; + +template<> +struct base_unit_info +{ + static std::string name() { return "[Amount]"; } + static std::string symbol() { return "[N]"; } +}; + +template<> +struct base_unit_info +{ + static std::string name() { return "[Luminous Intensity]"; } + static std::string symbol() { return "[J]"; } +}; + +template<> +struct base_unit_info +{ + static std::string name() { return "[Plane Angle]"; } + static std::string symbol() { return "[QP]"; } +}; + +template<> +struct base_unit_info +{ + static std::string name() { return "[Solid Angle]"; } + static std::string symbol() { return "[QS]"; } +}; + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ABSTRACT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/angle/degrees.hpp b/deal.II/contrib/boost/include/boost/units/systems/angle/degrees.hpp new file mode 100644 index 0000000000..5aa8250563 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/angle/degrees.hpp @@ -0,0 +1,43 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGLE_DEGREE_HPP +#define BOOST_UNITS_ANGLE_DEGREE_HPP + +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace degree { + +typedef make_system::type system; + +typedef unit dimensionless; +typedef unit plane_angle; ///< angle degree unit constant + +BOOST_UNITS_STATIC_CONSTANT(degree,plane_angle); +BOOST_UNITS_STATIC_CONSTANT(degrees,plane_angle); + +} // namespace degree + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ANGLE_DEGREE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/angle/gradians.hpp b/deal.II/contrib/boost/include/boost/units/systems/angle/gradians.hpp new file mode 100644 index 0000000000..3fc23f7e48 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/angle/gradians.hpp @@ -0,0 +1,43 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGLE_GRADIANS_HPP +#define BOOST_UNITS_ANGLE_GRADIANS_HPP + +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace gradian { + +typedef make_system::type system; + +typedef unit dimensionless; +typedef unit plane_angle; ///< angle gradian unit constant + +BOOST_UNITS_STATIC_CONSTANT(gradian,plane_angle); +BOOST_UNITS_STATIC_CONSTANT(gradians,plane_angle); + +} // namespace gradian + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ANGLE_GRADIANS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/angle/revolutions.hpp b/deal.II/contrib/boost/include/boost/units/systems/angle/revolutions.hpp new file mode 100644 index 0000000000..835a34ed50 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/angle/revolutions.hpp @@ -0,0 +1,43 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_ANGLE_REVOLUTIONS_HPP +#define BOOST_UNITS_ANGLE_REVOLUTIONS_HPP + +#include + +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace revolution { + +typedef make_system::type system; + +typedef unit dimensionless; +typedef unit plane_angle; ///< angle revolution unit constant + +BOOST_UNITS_STATIC_CONSTANT(revolution,plane_angle); +BOOST_UNITS_STATIC_CONSTANT(revolutions,plane_angle); + +} // namespace revolution + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_ANGLE_REVOLUTIONS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs.hpp new file mode 100644 index 0000000000..0d61bfc428 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs.hpp @@ -0,0 +1,44 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_HPP +#define BOOST_UNITS_CGS_HPP + +/// \file +/// Includes all the cgs unit headers + +#include + +#include + +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // BOOST_UNITS_CGS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/acceleration.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/acceleration.hpp new file mode 100644 index 0000000000..f84c715ac5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/acceleration.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_ACCELERATION_HPP +#define BOOST_UNITS_CGS_ACCELERATION_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit acceleration; + +BOOST_UNITS_STATIC_CONSTANT(gal,acceleration); +BOOST_UNITS_STATIC_CONSTANT(gals,acceleration); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_ACCELERATION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/area.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/area.hpp new file mode 100644 index 0000000000..106925173f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/area.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_AREA_HPP +#define BOOST_UNITS_CGS_AREA_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit area; + +BOOST_UNITS_STATIC_CONSTANT(square_centimeter,area); +BOOST_UNITS_STATIC_CONSTANT(square_centimeters,area); +BOOST_UNITS_STATIC_CONSTANT(square_centimetre,area); +BOOST_UNITS_STATIC_CONSTANT(square_centimetres,area); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_AREA_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/base.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/base.hpp new file mode 100644 index 0000000000..bc536065df --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/base.hpp @@ -0,0 +1,46 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_BASE_HPP +#define BOOST_UNITS_CGS_BASE_HPP + +#include + +#include +#include +#include + +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +/// placeholder class defining cgs unit system +typedef make_system::type system; + +/// various unit typedefs for convenience +typedef unit dimensionless; + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_BASE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/current.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/current.hpp new file mode 100644 index 0000000000..f80821e012 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/current.hpp @@ -0,0 +1,33 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_CURRENT_HPP +#define BOOST_UNITS_CGS_CURRENT_HPP + +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit current; + +BOOST_UNITS_STATIC_CONSTANT(biot,current); +BOOST_UNITS_STATIC_CONSTANT(biots,current); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_CURRENT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/dimensionless.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/dimensionless.hpp new file mode 100644 index 0000000000..7f2b3c2b5f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/dimensionless.hpp @@ -0,0 +1,30 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_DIMENSIONLESS_HPP +#define BOOST_UNITS_CGS_DIMENSIONLESS_HPP + +#include + +namespace boost { + +namespace units { + +namespace cgs { + +BOOST_UNITS_STATIC_CONSTANT(cgs_dimensionless,dimensionless); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_DIMENSIONLESS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/dynamic_viscosity.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/dynamic_viscosity.hpp new file mode 100644 index 0000000000..af1a17030a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/dynamic_viscosity.hpp @@ -0,0 +1,33 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_DYNAMIC_VISCOSITY_HPP +#define BOOST_UNITS_CGS_DYNAMIC_VISCOSITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit dynamic_viscosity; + +BOOST_UNITS_STATIC_CONSTANT(poise,dynamic_viscosity); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_DYNAMIC_VISCOSITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/energy.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/energy.hpp new file mode 100644 index 0000000000..f71099692f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/energy.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_ENERGY_HPP +#define BOOST_UNITS_CGS_ENERGY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit energy; + +BOOST_UNITS_STATIC_CONSTANT(erg,energy); +BOOST_UNITS_STATIC_CONSTANT(ergs,energy); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_ENERGY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/force.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/force.hpp new file mode 100644 index 0000000000..3328b5d10d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/force.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_FORCE_HPP +#define BOOST_UNITS_CGS_FORCE_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit force; + +BOOST_UNITS_STATIC_CONSTANT(dyne,force); +BOOST_UNITS_STATIC_CONSTANT(dynes,force); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_FORCE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/frequency.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/frequency.hpp new file mode 100644 index 0000000000..ef90aea21c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/frequency.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_FREQUENCY_HPP +#define BOOST_UNITS_CGS_FREQUENCY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit frequency; + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_FREQUENCY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/io.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/io.hpp new file mode 100644 index 0000000000..6f57b1e045 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/io.hpp @@ -0,0 +1,50 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_IO_HPP +#define BOOST_UNITS_CGS_IO_HPP + +#include +#include +#include + +namespace boost { + +namespace units { + +inline std::string name_string(const reduce_unit::type&) { return "galileo"; } +inline std::string symbol_string(const reduce_unit::type&) { return "Gal"; } + +inline std::string name_string(const reduce_unit::type&) { return "biot"; } +inline std::string symbol_string(const reduce_unit::type&) { return "Bi"; } + +inline std::string name_string(const reduce_unit::type&) { return "poise"; } +inline std::string symbol_string(const reduce_unit::type&) { return "P"; } + +inline std::string name_string(const reduce_unit::type&) { return "erg"; } +inline std::string symbol_string(const reduce_unit::type&) { return "erg"; } + +inline std::string name_string(const reduce_unit::type&) { return "dyne"; } +inline std::string symbol_string(const reduce_unit::type&) { return "dyn"; } + +inline std::string name_string(const reduce_unit::type&) { return "stoke"; } +inline std::string symbol_string(const reduce_unit::type&) { return "St"; } + +inline std::string name_string(const reduce_unit::type&) { return "barye"; } +inline std::string symbol_string(const reduce_unit::type&) { return "Ba"; } + +inline std::string name_string(const reduce_unit::type&) { return "kayser"; } +inline std::string symbol_string(const reduce_unit::type&) { return "K"; } + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_IO_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/kinematic_viscosity.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/kinematic_viscosity.hpp new file mode 100644 index 0000000000..185582b865 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/kinematic_viscosity.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_KINEMATIC_VISCOSITY_HPP +#define BOOST_UNITS_CGS_KINEMATIC_VISCOSITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit kinematic_viscosity; + +BOOST_UNITS_STATIC_CONSTANT(stoke,kinematic_viscosity); +BOOST_UNITS_STATIC_CONSTANT(stokes,kinematic_viscosity); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_KINEMATIC_VISCOSITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/length.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/length.hpp new file mode 100644 index 0000000000..6d04cfe002 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/length.hpp @@ -0,0 +1,35 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_LENGTH_HPP +#define BOOST_UNITS_CGS_LENGTH_HPP + +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit length; + +BOOST_UNITS_STATIC_CONSTANT(centimeter,length); +BOOST_UNITS_STATIC_CONSTANT(centimeters,length); +BOOST_UNITS_STATIC_CONSTANT(centimetre,length); +BOOST_UNITS_STATIC_CONSTANT(centimetres,length); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_LENGTH_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/mass.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/mass.hpp new file mode 100644 index 0000000000..70bf7c4875 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/mass.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_MASS_HPP +#define BOOST_UNITS_CGS_MASS_HPP + +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit mass; + +BOOST_UNITS_STATIC_CONSTANT(gram,mass); +BOOST_UNITS_STATIC_CONSTANT(grams,mass); +BOOST_UNITS_STATIC_CONSTANT(gramme,mass); +BOOST_UNITS_STATIC_CONSTANT(grammes,mass); + + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_MASS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/mass_density.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/mass_density.hpp new file mode 100644 index 0000000000..5b2ce9e799 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/mass_density.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_MASS_DENSITY_HPP +#define BOOST_UNITS_CGS_MASS_DENSITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit mass_density; + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_MASS_DENSITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/momentum.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/momentum.hpp new file mode 100644 index 0000000000..6325a95a54 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/momentum.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_MOMENTUM_HPP +#define BOOST_UNITS_CGS_MOMENTUM_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit momentum; + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_MOMENTUM_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/power.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/power.hpp new file mode 100644 index 0000000000..3ecb353143 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/power.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_POWER_HPP +#define BOOST_UNITS_CGS_POWER_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit power; + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_POWER_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/pressure.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/pressure.hpp new file mode 100644 index 0000000000..faef178bb1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/pressure.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_PRESSURE_HPP +#define BOOST_UNITS_CGS_PRESSURE_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit pressure; + +BOOST_UNITS_STATIC_CONSTANT(barye,pressure); +BOOST_UNITS_STATIC_CONSTANT(baryes,pressure); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_PRESSURE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/time.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/time.hpp new file mode 100644 index 0000000000..2ac3b040c7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/time.hpp @@ -0,0 +1,33 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_TIME_HPP +#define BOOST_UNITS_CGS_TIME_HPP + +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit time; + +BOOST_UNITS_STATIC_CONSTANT(second,time); +BOOST_UNITS_STATIC_CONSTANT(seconds,time); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_TIME_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/velocity.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/velocity.hpp new file mode 100644 index 0000000000..152240a61b --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/velocity.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_VELOCITY_HPP +#define BOOST_UNITS_CGS_VELOCITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit velocity; + +BOOST_UNITS_STATIC_CONSTANT(centimeter_per_second,velocity); +BOOST_UNITS_STATIC_CONSTANT(centimeters_per_second,velocity); +BOOST_UNITS_STATIC_CONSTANT(centimetre_per_second,velocity); +BOOST_UNITS_STATIC_CONSTANT(centimetres_per_second,velocity); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_VELOCITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/volume.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/volume.hpp new file mode 100644 index 0000000000..5e40cba09f --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/volume.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_VOLUME_HPP +#define BOOST_UNITS_CGS_VOLUME_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit volume; + +BOOST_UNITS_STATIC_CONSTANT(cubic_centimeter,volume); +BOOST_UNITS_STATIC_CONSTANT(cubic_centimeters,volume); +BOOST_UNITS_STATIC_CONSTANT(cubic_centimetre,volume); +BOOST_UNITS_STATIC_CONSTANT(cubic_centimetres,volume); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_VOLUME_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/cgs/wavenumber.hpp b/deal.II/contrib/boost/include/boost/units/systems/cgs/wavenumber.hpp new file mode 100644 index 0000000000..69c99ca5da --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/cgs/wavenumber.hpp @@ -0,0 +1,38 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CGS_WAVENUMBER_HPP +#define BOOST_UNITS_CGS_WAVENUMBER_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace cgs { + +typedef unit wavenumber; + +BOOST_UNITS_STATIC_CONSTANT(kayser,wavenumber); +BOOST_UNITS_STATIC_CONSTANT(kaysers,wavenumber); +BOOST_UNITS_STATIC_CONSTANT(reciprocal_centimeter,wavenumber); +BOOST_UNITS_STATIC_CONSTANT(reciprocal_centimeters,wavenumber); +BOOST_UNITS_STATIC_CONSTANT(reciprocal_centimetre,wavenumber); +BOOST_UNITS_STATIC_CONSTANT(reciprocal_centimetres,wavenumber); + +} // namespace cgs + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CGS_WAVENUMBER_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/detail/constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/detail/constants.hpp new file mode 100644 index 0000000000..fac9b612cc --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/detail/constants.hpp @@ -0,0 +1,201 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CONSTANTS_HPP +#define BOOST_UNITS_CONSTANTS_HPP + +#include +#include +#include + +#include + +#include +#include +#include + +namespace boost { + +namespace units { + +template +struct constant +{ + typedef typename Base::value_type value_type; + operator value_type() const { return Base().value(); } + value_type value() const { return Base().value(); } + value_type uncertainty() const { return Base().uncertainty(); } + value_type lower_bound() const { return Base().lower_bound(); } + value_type upper_bound() const { return Base().upper_bound(); } +}; + +template +struct physical_constant +{ + typedef typename Base::value_type value_type; + operator value_type() const { return Base().value(); } + value_type value() const { return Base().value(); } + value_type uncertainty() const { return Base().uncertainty(); } + value_type lower_bound() const { return Base().lower_bound(); } + value_type upper_bound() const { return Base().upper_bound(); } +}; + +#define BOOST_UNITS_DEFINE_HELPER(name, symbol, template_name) \ + \ +template \ +struct name ## _typeof_helper, template_name >\ +{ \ + typedef typename name ## _typeof_helper >::type type;\ +}; \ + \ +template \ +struct name ## _typeof_helper, constant >\ +{ \ + typedef typename name ## _typeof_helper, typename T::value_type>::type type;\ +}; \ + \ +template \ +typename name ## _typeof_helper >::type \ +operator symbol(const constant& t, const template_name& u)\ +{ \ + return(t.value() symbol u); \ +} \ + \ +template \ +typename name ## _typeof_helper, typename T::value_type>::type \ +operator symbol(const template_name& u, const constant& t)\ +{ \ + return(u symbol t.value()); \ +} + +BOOST_UNITS_DEFINE_HELPER(add, +, unit) +BOOST_UNITS_DEFINE_HELPER(add, +, quantity) +BOOST_UNITS_DEFINE_HELPER(subtract, -, unit) +BOOST_UNITS_DEFINE_HELPER(subtract, -, quantity) +BOOST_UNITS_DEFINE_HELPER(multiply, *, unit) +BOOST_UNITS_DEFINE_HELPER(multiply, *, quantity) +BOOST_UNITS_DEFINE_HELPER(divide, /, unit) +BOOST_UNITS_DEFINE_HELPER(divide, /, quantity) + +#undef BOOST_UNITS_DEFINE_HELPER + +#define BOOST_UNITS_DEFINE_HELPER(name, symbol) \ + \ +template \ +struct name ## _typeof_helper, constant > \ +{ \ + typedef typename name ## _typeof_helper::type type;\ +}; \ + \ +template \ +typename name ## _typeof_helper::type \ +operator symbol(const constant& t, const constant& u) \ +{ \ + return(t.value() symbol u.value()); \ +} \ + \ +template \ +struct name ## _typeof_helper, T2> \ +{ \ + typedef typename name ## _typeof_helper::type type;\ +}; \ + \ +template \ +struct name ## _typeof_helper > \ +{ \ + typedef typename name ## _typeof_helper::type type;\ +}; \ + \ +template \ +typename name ## _typeof_helper::type \ +operator symbol(const constant& t, const T2& u) \ +{ \ + return(t.value() symbol u); \ +} \ + \ +template \ +typename name ## _typeof_helper::type \ +operator symbol(const T1& t, const constant& u) \ +{ \ + return(t symbol u.value()); \ +} + +BOOST_UNITS_DEFINE_HELPER(add, +) +BOOST_UNITS_DEFINE_HELPER(subtract, -) +BOOST_UNITS_DEFINE_HELPER(multiply, *) +BOOST_UNITS_DEFINE_HELPER(divide, /) + +#undef BOOST_UNITS_DEFINE_HELPER + +#define BOOST_UNITS_PHYSICAL_CONSTANT(name, type, value_, uncertainty_) \ +struct name ## _t { \ + typedef type value_type; \ + operator value_type() const { return value_; } \ + value_type value() const { return value_; } \ + value_type uncertainty() const { return uncertainty_; } \ + value_type lower_bound() const { return value_-uncertainty_; } \ + value_type upper_bound() const { return value_+uncertainty_; } \ +}; \ +BOOST_UNITS_STATIC_CONSTANT(name, boost::units::constant >) = { } + +// stream output +template +inline +std::basic_ostream& operator<<(std::basic_ostream& os,const physical_constant& val) +{ + boost::io::ios_precision_saver precision_saver(os); + //boost::io::ios_width_saver width_saver(os); + boost::io::ios_flags_saver flags_saver(os); + + //os << std::setw(21); + typedef typename Y::value_type value_type; + + if (val.uncertainty() > value_type()) + { + const double relative_uncertainty = std::abs(val.uncertainty()/val.value()); + + const double exponent = std::log10(relative_uncertainty); + const long digits_of_precision = static_cast(std::ceil(std::abs(exponent)))+3; + + // should try to replicate NIST CODATA syntax + os << std::setprecision(digits_of_precision) + //<< std::setw(digits_of_precision+8) + //<< std::scientific + << val.value(); +// << long(10*(relative_uncertainty/std::pow(Y(10),Y(exponent)))); + + os << " (rel. unc. = " + << std::setprecision(1) + //<< std::setw(7) + << std::scientific + << relative_uncertainty << ")"; + } + else + { + os << val.value() << " (exact)"; + } + + return os; +} + +// stream output +template +inline +std::basic_ostream& operator<<(std::basic_ostream& os,const constant&) +{ + os << Y(); + return os; +} + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si.hpp b/deal.II/contrib/boost/include/boost/units/systems/si.hpp new file mode 100644 index 0000000000..727982b44a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si.hpp @@ -0,0 +1,77 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_HPP +#define BOOST_UNITS_SI_HPP + +/// \file +/// Includes all the si unit headers + +#include + +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif // BOOST_UNITS_SI_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/absorbed_dose.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/absorbed_dose.hpp new file mode 100644 index 0000000000..f59ec513b1 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/absorbed_dose.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_ABSORBED_DOSE_HPP +#define BOOST_UNITS_SI_ABSORBED_DOSE_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit absorbed_dose; + +BOOST_UNITS_STATIC_CONSTANT(gray,absorbed_dose); +BOOST_UNITS_STATIC_CONSTANT(grays,absorbed_dose); + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_ABSORBED_DOSE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/acceleration.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/acceleration.hpp new file mode 100644 index 0000000000..54ac29f0b8 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/acceleration.hpp @@ -0,0 +1,36 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_ACCELERATION_HPP +#define BOOST_UNITS_SI_ACCELERATION_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit acceleration; + +BOOST_UNITS_STATIC_CONSTANT(meter_per_second_squared,acceleration); +BOOST_UNITS_STATIC_CONSTANT(meters_per_second_squared,acceleration); +BOOST_UNITS_STATIC_CONSTANT(metre_per_second_squared,acceleration); +BOOST_UNITS_STATIC_CONSTANT(metres_per_second_squared,acceleration); + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_ACCELERATION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/action.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/action.hpp new file mode 100644 index 0000000000..43b6629369 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/action.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_ACTION_HPP +#define BOOST_UNITS_SI_ACTION_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit action; + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_ACTION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/activity.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/activity.hpp new file mode 100644 index 0000000000..d31f0028d2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/activity.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_ACTIVITY_HPP +#define BOOST_UNITS_SI_ACTIVITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit activity; + +BOOST_UNITS_STATIC_CONSTANT(becquerel,activity); +BOOST_UNITS_STATIC_CONSTANT(becquerels,activity); + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_ACTIVITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/amount.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/amount.hpp new file mode 100644 index 0000000000..7fe8f413cd --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/amount.hpp @@ -0,0 +1,33 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_AMOUNT_HPP +#define BOOST_UNITS_SI_AMOUNT_HPP + +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit amount; + +BOOST_UNITS_STATIC_CONSTANT(mole,amount); +BOOST_UNITS_STATIC_CONSTANT(moles,amount); + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_AMOUNT_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/angular_acceleration.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/angular_acceleration.hpp new file mode 100644 index 0000000000..ff20102691 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/angular_acceleration.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_ANGULAR_ACCELERATION_HPP +#define BOOST_UNITS_SI_ANGULAR_ACCELERATION_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit angular_acceleration; + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_ANGULAR_ACCELERATION_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/angular_momentum.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/angular_momentum.hpp new file mode 100644 index 0000000000..7c20f5b4b5 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/angular_momentum.hpp @@ -0,0 +1,31 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_ANGULAR_MOMENTUM_HPP +#define BOOST_UNITS_SI_ANGULAR_MOMENTUM_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit angular_momentum; + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_ANGULAR_MOMENTUM_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/angular_velocity.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/angular_velocity.hpp new file mode 100644 index 0000000000..3149dc6eef --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/angular_velocity.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_ANGULAR_VELOCITY_HPP +#define BOOST_UNITS_SI_ANGULAR_VELOCITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit angular_velocity; + +BOOST_UNITS_STATIC_CONSTANT(radian_per_second,angular_velocity); +BOOST_UNITS_STATIC_CONSTANT(radians_per_second,angular_velocity); + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_ANGULAR_VELOCITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/area.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/area.hpp new file mode 100644 index 0000000000..90a3230e2c --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/area.hpp @@ -0,0 +1,39 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_AREA_HPP +#define BOOST_UNITS_SI_AREA_HPP + +#include +#include + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit area; + +BOOST_UNITS_STATIC_CONSTANT(square_meter,area); +BOOST_UNITS_STATIC_CONSTANT(square_meters,area); +BOOST_UNITS_STATIC_CONSTANT(square_metre,area); +BOOST_UNITS_STATIC_CONSTANT(square_metres,area); + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_AREA_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/base.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/base.hpp new file mode 100644 index 0000000000..469b294297 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/base.hpp @@ -0,0 +1,56 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_BASE_HPP +#define BOOST_UNITS_SI_BASE_HPP + +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +/// placeholder class defining si unit system +typedef make_system::type system; + +/// dimensionless si unit +typedef unit dimensionless; + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_BASE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/capacitance.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/capacitance.hpp new file mode 100644 index 0000000000..076de71de9 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/capacitance.hpp @@ -0,0 +1,34 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_CAPACITANCE_HPP +#define BOOST_UNITS_SI_CAPACITANCE_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +typedef unit capacitance; + +BOOST_UNITS_STATIC_CONSTANT(farad,capacitance); +BOOST_UNITS_STATIC_CONSTANT(farads,capacitance); + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_CAPACITANCE_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/catalytic_activity.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/catalytic_activity.hpp new file mode 100644 index 0000000000..2a2e538657 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/catalytic_activity.hpp @@ -0,0 +1,37 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_SI_CATALYTIC_ACTIVITY_HPP +#define BOOST_UNITS_SI_CATALYTIC_ACTIVITY_HPP + +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +/// catalytic activity : T^-1 A^1 +typedef derived_dimension::type catalytic_activity_dim; + +typedef unit catalytic_activity; + +BOOST_UNITS_STATIC_CONSTANT(katal,catalytic_activity); +BOOST_UNITS_STATIC_CONSTANT(katals,catalytic_activity); + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_SI_CATALYTIC_ACTIVITY_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/alpha_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/alpha_constants.hpp new file mode 100644 index 0000000000..1b1846f2e3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/alpha_constants.hpp @@ -0,0 +1,65 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_ALPHA_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_ALPHA_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// alpha particle mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_alpha,quantity,6.64465620e-27*kilograms,3.3e-34*kilograms); +/// alpha-electron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_alpha_over_m_e,quantity,7294.2995365*dimensionless(),3.1e-6*dimensionless()); +/// alpha-proton mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_alpha_over_m_p,quantity,3.97259968951*dimensionless(),4.1e-10*dimensionless()); +/// alpha molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_alpha,quantity,4.001506179127e-3*kilograms/mole,6.2e-14*kilograms/mole); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_ALPHA_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/atomic-nuclear_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/atomic-nuclear_constants.hpp new file mode 100644 index 0000000000..80b4c279e2 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/atomic-nuclear_constants.hpp @@ -0,0 +1,56 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_ATOMIC_AND_NUCLEAR_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_ATOMIC_AND_NUCLEAR_CONSTANTS_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +// ATOMIC AND NUCLEAR +/// fine structure constant +BOOST_UNITS_PHYSICAL_CONSTANT(alpha,quantity,7.2973525376e-3*dimensionless(),5.0e-12*dimensionless()); +/// Rydberg constant +BOOST_UNITS_PHYSICAL_CONSTANT(R_infinity,quantity,10973731.568527/meter,7.3e-5/meter); +/// Bohr radius +BOOST_UNITS_PHYSICAL_CONSTANT(a_0,quantity,0.52917720859e-10*meters,3.6e-20*meters); +/// Hartree energy +BOOST_UNITS_PHYSICAL_CONSTANT(E_h,quantity,4.35974394e-18*joules,2.2e-25*joules); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_ATOMIC_AND_NUCLEAR_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/deuteron_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/deuteron_constants.hpp new file mode 100644 index 0000000000..a92b6664db --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/deuteron_constants.hpp @@ -0,0 +1,81 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_DEUTERON_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_DEUTERON_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// deuteron mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_d,quantity,3.34358320e-27*kilograms,1.7e-34*kilograms); +/// deuteron-electron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_d_over_m_e,quantity,3670.4829654*dimensionless(),1.6e-6*dimensionless()); +/// deuteron-proton mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_d_over_m_p,quantity,1.99900750108*dimensionless(),2.2e-10*dimensionless()); +/// deuteron molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_d,quantity,2.013553212724e-3*kilograms/mole,7.8e-14*kilograms/mole); +/// deuteron rms charge radius +BOOST_UNITS_PHYSICAL_CONSTANT(R_d,quantity,2.1402e-15*meters,2.8e-18*meters); +/// deuteron magnetic moment +BOOST_UNITS_PHYSICAL_CONSTANT(mu_d,quantity,0.433073465e-26*joules/tesla,1.1e-34*joules/tesla); +/// deuteron-Bohr magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_d_over_mu_B,quantity,0.4669754556e-3*dimensionless(),3.9e-12*dimensionless()); +/// deuteron-nuclear magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_d_over_mu_N,quantity,0.8574382308*dimensionless(),7.2e-9*dimensionless()); +/// deuteron g-factor +BOOST_UNITS_PHYSICAL_CONSTANT(g_d,quantity,0.8574382308*dimensionless(),7.2e-9*dimensionless()); +/// deuteron-electron magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_d_over_mu_e,quantity,-4.664345537e-4*dimensionless(),3.9e-12*dimensionless()); +/// deuteron-proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_d_over_mu_p,quantity,0.3070122070*dimensionless(),2.4e-9*dimensionless()); +/// deuteron-neutron magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_d_over_mu_n,quantity,-0.44820652*dimensionless(),1.1e-7*dimensionless()); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_DEUTERON_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/electromagnetic_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/electromagnetic_constants.hpp new file mode 100644 index 0000000000..9cc6f498f3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/electromagnetic_constants.hpp @@ -0,0 +1,73 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_ELECTROMAGNETIC_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_ELECTROMAGNETIC_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental electromagnetic constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +// ELECTROMAGNETIC +/// elementary charge +BOOST_UNITS_PHYSICAL_CONSTANT(e,quantity,1.602176487e-19*coulombs,4.0e-27*coulombs); +/// elementary charge to Planck constant ratio +BOOST_UNITS_PHYSICAL_CONSTANT(e_over_h,quantity,2.417989454e14*amperes/joule,6.0e6*amperes/joule); +/// magnetic flux quantum +BOOST_UNITS_PHYSICAL_CONSTANT(Phi_0,quantity,2.067833667e-15*webers,5.2e-23*webers); +/// conductance quantum +BOOST_UNITS_PHYSICAL_CONSTANT(G_0,quantity,7.7480917004e-5*siemens,5.3e-14*siemens); +/// Josephson constant +BOOST_UNITS_PHYSICAL_CONSTANT(K_J,quantity,483597.891e9*hertz/volt,1.2e7*hertz/volt); +/// von Klitzing constant +BOOST_UNITS_PHYSICAL_CONSTANT(R_K,quantity,25812.807557*ohms,1.77e-5*ohms); +/// Bohr magneton +BOOST_UNITS_PHYSICAL_CONSTANT(mu_B,quantity,927.400915e-26*joules/tesla,2.3e-31*joules/tesla); +/// nuclear magneton +BOOST_UNITS_PHYSICAL_CONSTANT(mu_N,quantity,5.05078324e-27*joules/tesla,1.3e-34*joules/tesla); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_ELECTROMAGNETIC_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/electron_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/electron_constants.hpp new file mode 100644 index 0000000000..131ba92395 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/electron_constants.hpp @@ -0,0 +1,105 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_ELECTRON_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_ELECTRON_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// electron mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_e,quantity,9.10938215e-31*kilograms,4.5e-38*kilograms); +/// electron-muon mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_e_over_m_mu,quantity,4.83633171e-3*dimensionless(),1.2e-10*dimensionless()); +/// electron-tau mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_e_over_m_tau,quantity,2.87564e-4*dimensionless(),4.7e-8*dimensionless()); +/// electron-proton mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_e_over_m_p,quantity,5.4461702177e-4*dimensionless(),2.4e-13*dimensionless()); +/// electron-neutron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_e_over_m_n,quantity,5.4386734459e-4*dimensionless(),3.3e-13*dimensionless()); +/// electron-deuteron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_e_over_m_d,quantity,2.7244371093e-4*dimensionless(),1.2e-13*dimensionless()); +/// electron-alpha particle mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_e_over_m_alpha,quantity,1.37093355570e-4*dimensionless(),5.8e-14*dimensionless()); +/// electron charge to mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(e_over_m_e,quantity,1.758820150e11*coulombs/kilogram,4.4e3*coulombs/kilogram); +/// electron molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_e,quantity,5.4857990943e-7*kilograms/mole,2.3e-16*kilograms/mole); +/// Compton wavelength +BOOST_UNITS_PHYSICAL_CONSTANT(lambda_C,quantity,2.4263102175e-12*meters,3.3e-21*meters); +/// classical electron radius +BOOST_UNITS_PHYSICAL_CONSTANT(r_e,quantity,2.8179402894e-15*meters,5.8e-24*meters); +/// Thompson cross section +BOOST_UNITS_PHYSICAL_CONSTANT(sigma_e,quantity,0.6652458558e-28*square_meters,2.7e-37*square_meters); +/// electron magnetic moment +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e,quantity,-928.476377e-26*joules/tesla,2.3e-31*joules/tesla); +/// electron-Bohr magenton moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e_over_mu_B,quantity,-1.00115965218111*dimensionless(),7.4e-13*dimensionless()); +/// electron-nuclear magneton moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e_over_mu_N,quantity,-183.28197092*dimensionless(),8.0e-7*dimensionless()); +/// electron magnetic moment anomaly +BOOST_UNITS_PHYSICAL_CONSTANT(a_e,quantity,1.15965218111e-3*dimensionless(),7.4e-13*dimensionless()); +/// electron g-factor +BOOST_UNITS_PHYSICAL_CONSTANT(g_e,quantity,-2.0023193043622*dimensionless(),1.5e-12*dimensionless()); +/// electron-muon magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e_over_mu_mu,quantity,206.7669877*dimensionless(),5.2e-6*dimensionless()); +/// electron-proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e_over_mu_p,quantity,-658.2106848*dimensionless(),5.4e-6*dimensionless()); +/// electron-shielded proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e_over_mu_p_prime,quantity,-658.2275971*dimensionless(),7.2e-6*dimensionless()); +/// electron-neutron magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e_over_mu_n,quantity,960.92050*dimensionless(),2.3e-4*dimensionless()); +/// electron-deuteron magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e_over_mu_d,quantity,-2143.923498*dimensionless(),1.8e-5*dimensionless()); +/// electron-shielded helion magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_e_over_mu_h_prime,quantity,864.058257*dimensionless(),1.0e-5*dimensionless()); +/// electron gyromagnetic ratio +BOOST_UNITS_PHYSICAL_CONSTANT(gamma_e,quantity,1.760859770e11/second/tesla,4.4e3/second/tesla); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_ELECTRON_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/helion_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/helion_constants.hpp new file mode 100644 index 0000000000..56665f3d08 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/helion_constants.hpp @@ -0,0 +1,77 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_HELION_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_HELION_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// helion mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_h,quantity,5.00641192e-27*kilograms,2.5e-34*kilograms); +/// helion-electron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_h_over_m_e,quantity,5495.8852765*dimensionless(),5.2e-6*dimensionless()); +/// helion-proton mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_h_over_m_p,quantity,2.9931526713*dimensionless(),2.6e-9*dimensionless()); +/// helion molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_h,quantity,3.0149322473e-3*kilograms/mole,2.6e-12*kilograms/mole); +/// helion shielded magnetic moment +BOOST_UNITS_PHYSICAL_CONSTANT(mu_h_prime,quantity,-1.074552982e-26*joules/tesla,3.0e-34*joules/tesla); +/// shielded helion-Bohr magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_h_prime_over_mu_B,quantity,-1.158671471e-3*dimensionless(),1.4e-11*dimensionless()); +/// shielded helion-nuclear magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_h_prime_over_mu_N,quantity,-2.127497718*dimensionless(),2.5e-8*dimensionless()); +/// shielded helion-proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_h_prime_over_mu_p,quantity,-0.761766558*dimensionless(),1.1e-8*dimensionless()); +/// shielded helion-shielded proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_h_prime_over_mu_p_prime,quantity,-0.7617861313*dimensionless(),3.3e-8*dimensionless()); +/// shielded helion gyromagnetic ratio +BOOST_UNITS_PHYSICAL_CONSTANT(gamma_h_prime,quantity,2.037894730e8/second/tesla,5.6e-0/second/tesla); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_HELION_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/muon_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/muon_constants.hpp new file mode 100644 index 0000000000..12afdf162d --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/muon_constants.hpp @@ -0,0 +1,83 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_MUON_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_MUON_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// muon mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_mu,quantity,1.88353130e-28*kilograms,1.1e-35*kilograms); +/// muon-electron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_mu_over_m_e,quantity,206.7682823*dimensionless(),5.2e-6*dimensionless()); +/// muon-tau mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_mu_over_m_tau,quantity,5.94592e-2*dimensionless(),9.7e-6*dimensionless()); +/// muon-proton mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_mu_over_m_p,quantity,0.1126095261*dimensionless(),2.9e-9*dimensionless()); +/// muon-neutron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_mu_over_m_n,quantity,0.1124545167*dimensionless(),2.9e-9*dimensionless()); +/// muon molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_mu,quantity,0.1134289256e-3*kilograms/mole,2.9e-12*kilograms/mole); +/// muon Compton wavelength +BOOST_UNITS_PHYSICAL_CONSTANT(lambda_C_mu,quantity,11.73444104e-15*meters,3.0e-22*meters); +/// muon magnetic moment +BOOST_UNITS_PHYSICAL_CONSTANT(mu_mu,quantity,-4.49044786e-26*joules/tesla,1.6e-33*joules/tesla); +/// muon-Bohr magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_mu_over_mu_B,quantity,-4.84197049e-3*dimensionless(),1.2e-10*dimensionless()); +/// muon-nuclear magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_mu_over_mu_N,quantity,-8.89059705*dimensionless(),2.3e-7*dimensionless()); +/// muon magnetic moment anomaly +BOOST_UNITS_PHYSICAL_CONSTANT(a_mu,quantity,1.16592069e-3*dimensionless(),6.0e-10*dimensionless()); +/// muon g-factor +BOOST_UNITS_PHYSICAL_CONSTANT(g_mu,quantity,-2.0023318414*dimensionless(),1.2e-9*dimensionless()); +/// muon-proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_mu_over_mu_p,quantity,-3.183345137*dimensionless(),8.5e-8*dimensionless()); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_MUON_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/neutron_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/neutron_constants.hpp new file mode 100644 index 0000000000..44d89bc089 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/neutron_constants.hpp @@ -0,0 +1,83 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_NEUTRON_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_NEUTRON_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// neutron mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_n,quantity,1.674927211e-27*kilograms,8.4e-35*kilograms); +/// neutron-electron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_n_over_m_e,quantity,1838.6836605*dimensionless(),1.1e-6*dimensionless()); +/// neutron-muon mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_n_over_m_mu,quantity,8.89248409*dimensionless(),2.3e-7*dimensionless()); +/// neutron-tau mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_n_over_m_tau,quantity,0.528740*dimensionless(),8.6e-5*dimensionless()); +/// neutron-proton mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_n_over_m_p,quantity,1.00137841918*dimensionless(),4.6e-10*dimensionless()); +/// neutron molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_n,quantity,1.00866491597e-3*kilograms/mole,4.3e-13*kilograms/mole); +/// neutron Compton wavelength +BOOST_UNITS_PHYSICAL_CONSTANT(lambda_C_n,quantity,1.3195908951e-15*meters,2.0e-24*meters); +/// neutron magnetic moment +BOOST_UNITS_PHYSICAL_CONSTANT(mu_n,quantity,-0.96623641e-26*joules/tesla,2.3e-33*joules/tesla); +/// neutron g-factor +BOOST_UNITS_PHYSICAL_CONSTANT(g_n,quantity,-3.82608545*dimensionless(),9.0e-7*dimensionless()); +/// neutron-electron magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_n_over_mu_e,quantity,1.04066882e-3*dimensionless(),2.5e-10*dimensionless()); +/// neutron-proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_n_over_mu_p,quantity,-0.68497934*dimensionless(),1.6e-7*dimensionless()); +/// neutron-shielded proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_n_over_mu_p_prime,quantity,-0.68499694*dimensionless(),1.6e-7*dimensionless()); +/// neutron gyromagnetic ratio +BOOST_UNITS_PHYSICAL_CONSTANT(gamma_n,quantity,1.83247185e8/second/tesla,4.3e1/second/tesla); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_NEUTRON_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/physico-chemical_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/physico-chemical_constants.hpp new file mode 100644 index 0000000000..0cde3ac4df --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/physico-chemical_constants.hpp @@ -0,0 +1,78 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_PHYSICO_CHEMICAL_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_PHYSICO_CHEMICAL_CONSTANTS_HPP + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental physico-chemical constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +// PHYSICO-CHEMICAL +/// Avogadro constant +BOOST_UNITS_PHYSICAL_CONSTANT(N_A,quantity,6.02214179e23/mole,3.0e16/mole); +/// atomic mass constant +BOOST_UNITS_PHYSICAL_CONSTANT(m_u,quantity,1.660538782e-27*kilograms,8.3e-35*kilograms); +/// Faraday constant +BOOST_UNITS_PHYSICAL_CONSTANT(F,quantity,96485.3399*coulombs/mole,2.4e-3*coulombs/mole); +/// molar gas constant +BOOST_UNITS_PHYSICAL_CONSTANT(R,quantity,8.314472*joules/kelvin/mole,1.5e-5*joules/kelvin/mole); +/// Boltzmann constant +BOOST_UNITS_PHYSICAL_CONSTANT(k_B,quantity,1.3806504e-23*joules/kelvin,2.4e-29*joules/kelvin); +/// Stefan-Boltzmann constant +BOOST_UNITS_PHYSICAL_CONSTANT(sigma_SB,quantity,5.670400e-8*watts/square_meter/pow<4>(kelvin),4.0e-13*watts/square_meter/pow<4>(kelvin)); +/// first radiation constant +BOOST_UNITS_PHYSICAL_CONSTANT(c_1,quantity,3.74177118e-16*watt*square_meters,1.9e-23*watt*square_meters); +/// first radiation constant for spectral radiance +BOOST_UNITS_PHYSICAL_CONSTANT(c_1L,quantity,1.191042759e-16*watt*square_meters/steradian,5.9e-24*watt*square_meters/steradian); +/// second radiation constant +BOOST_UNITS_PHYSICAL_CONSTANT(c_2,quantity,1.4387752e-2*meter*kelvin,2.5e-8*meter*kelvin); +/// Wien displacement law constant : lambda_max T +BOOST_UNITS_PHYSICAL_CONSTANT(b,quantity,2.8977685e-3*meter*kelvin,5.1e-9*meter*kelvin); +/// Wien displacement law constant : nu_max/T +BOOST_UNITS_PHYSICAL_CONSTANT(b_prime,quantity,5.878933e10*hertz/kelvin,1.0e15*hertz/kelvin); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_PHYSICO_CHEMICAL_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/proton_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/proton_constants.hpp new file mode 100644 index 0000000000..14c1ee06f3 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/proton_constants.hpp @@ -0,0 +1,97 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_PROTON_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_PROTON_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// proton mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_p,quantity,1.672621637e-27*kilograms,8.3e-35*kilograms); +/// proton-electron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_p_over_m_e,quantity,1836.15267247*dimensionless(),8.0e-7*dimensionless()); +/// proton-muon mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_p_over_m_mu,quantity,8.88024339*dimensionless(),2.3e-7*dimensionless()); +/// proton-tau mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_p_over_m_tau,quantity,0.528012*dimensionless(),8.6e-5*dimensionless()); +/// proton-neutron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_p_over_m_n,quantity,0.99862347824*dimensionless(),4.6e-10*dimensionless()); +/// proton charge to mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(e_over_m_p,quantity,9.57883392e7*coulombs/kilogram,2.4e0*coulombs/kilogram); +/// proton molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_p,quantity,1.00727646677e-3*kilograms/mole,1.0e-13*kilograms/mole); +/// proton Compton wavelength +BOOST_UNITS_PHYSICAL_CONSTANT(lambda_C_p,quantity,1.3214098446e-15*meters,1.9e-24*meters); +/// proton rms charge radius +BOOST_UNITS_PHYSICAL_CONSTANT(R_p,quantity,0.8768e-15*meters,6.9e-18*meters); +/// proton magnetic moment +BOOST_UNITS_PHYSICAL_CONSTANT(mu_p,quantity,1.410606662e-26*joules/tesla,3.7e-34*joules/tesla); +/// proton-Bohr magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_p_over_mu_B,quantity,1.521032209e-3*dimensionless(),1.2e-11*dimensionless()); +/// proton-nuclear magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_p_over_mu_N,quantity,2.792847356*dimensionless(),2.3e-8*dimensionless()); +/// proton g-factor +BOOST_UNITS_PHYSICAL_CONSTANT(g_p,quantity,5.585694713*dimensionless(),4.6e-8*dimensionless()); +/// proton-neutron magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_p_over_mu_n,quantity,-1.45989806*dimensionless(),3.4e-7*dimensionless()); +/// shielded proton magnetic moment +BOOST_UNITS_PHYSICAL_CONSTANT(mu_p_prime,quantity,1.410570419e-26*joules/tesla,3.8e-34*joules/tesla); +/// shielded proton-Bohr magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_p_prime_over_mu_B,quantity,1.520993128e-3*dimensionless(),1.7e-11*dimensionless()); +/// shielded proton-nuclear magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_p_prime_over_mu_N,quantity,2.792775598*dimensionless(),3.0e-8*dimensionless()); +/// proton magnetic shielding correction +BOOST_UNITS_PHYSICAL_CONSTANT(sigma_p_prime,quantity,25.694e-6*dimensionless(),1.4e-8*dimensionless()); +/// proton gyromagnetic ratio +BOOST_UNITS_PHYSICAL_CONSTANT(gamma_p,quantity,2.675222099e8/second/tesla,7.0e0/second/tesla); +/// shielded proton gyromagnetic ratio +BOOST_UNITS_PHYSICAL_CONSTANT(gamma_p_prime,quantity,2.675153362e8/second/tesla,7.3e0/second/tesla); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_PROTON_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/tau_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/tau_constants.hpp new file mode 100644 index 0000000000..653019e04a --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/tau_constants.hpp @@ -0,0 +1,71 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_TAU_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_TAU_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// tau mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_tau,quantity,3.16777e-27*kilograms,5.2e-31*kilograms); +/// tau-electron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_tau_over_m_e,quantity,3477.48*dimensionless(),5.7e-1*dimensionless()); +/// tau-muon mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_tau_over_m_mu,quantity,16.8183*dimensionless(),2.7e-3*dimensionless()); +/// tau-proton mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_tau_over_m_p,quantity,1.89390*dimensionless(),3.1e-4*dimensionless()); +/// tau-neutron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_tau_over_m_n,quantity,1.89129*dimensionless(),3.1e-4*dimensionless()); +/// tau molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_tau,quantity,1.90768e-3*kilograms/mole,3.1e-7*kilograms/mole); +/// tau Compton wavelength +BOOST_UNITS_PHYSICAL_CONSTANT(lambda_C_tau,quantity,0.69772e-15*meters,1.1e-19*meters); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_TAU_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/triton_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/triton_constants.hpp new file mode 100644 index 0000000000..24448abda7 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/triton_constants.hpp @@ -0,0 +1,79 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_TRITON_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_TRITON_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +/// \file +/// CODATA recommended values of fundamental atomic and nuclear constants +/// CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +/// triton mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_t,quantity,5.00735588e-27*kilograms,2.5e-34*kilograms); +/// triton-electron mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_t_over_m_e,quantity,5496.9215269*dimensionless(),5.1e-6*dimensionless()); +/// triton-proton mass ratio +BOOST_UNITS_PHYSICAL_CONSTANT(m_t_over_m_p,quantity,2.9937170309*dimensionless(),2.5e-9*dimensionless()); +/// triton molar mass +BOOST_UNITS_PHYSICAL_CONSTANT(M_t,quantity,3.0155007134e-3*kilograms/mole,2.5e-12*kilograms/mole); +/// triton magnetic moment +BOOST_UNITS_PHYSICAL_CONSTANT(mu_t,quantity,1.504609361e-26*joules/tesla,4.2e-34*joules/tesla); +/// triton-Bohr magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_t_over_mu_B,quantity,1.622393657e-3*dimensionless(),2.1e-11*dimensionless()); +/// triton-nuclear magneton ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_t_over_mu_N,quantity,2.978962448*dimensionless(),3.8e-8*dimensionless()); +/// triton g-factor +BOOST_UNITS_PHYSICAL_CONSTANT(g_t,quantity,5.957924896*dimensionless(),7.6e-8*dimensionless()); +/// triton-electron magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_t_over_mu_e,quantity,-1.620514423e-3*dimensionless(),2.1e-11*dimensionless()); +/// triton-proton magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_t_over_mu_p,quantity,1.066639908*dimensionless(),1.0e-8*dimensionless()); +/// triton-neutron magnetic moment ratio +BOOST_UNITS_PHYSICAL_CONSTANT(mu_t_over_mu_n,quantity,-1.55718553*dimensionless(),3.7e-7*dimensionless()); + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif // BOOST_UNITS_CODATA_TRITON_CONSTANTS_HPP diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/typedefs.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/typedefs.hpp new file mode 100644 index 0000000000..27330ce061 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/typedefs.hpp @@ -0,0 +1,79 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_TYPEDEFS_HPP +#define BOOST_UNITS_CODATA_TYPEDEFS_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +typedef divide_typeof_helper::type frequency_over_electric_potential; +typedef divide_typeof_helper::type electric_charge_over_mass; +typedef divide_typeof_helper::type mass_over_amount; +typedef divide_typeof_helper::type energy_over_magnetic_flux_density; +typedef divide_typeof_helper::type frequency_over_magnetic_flux_density; +typedef divide_typeof_helper::type current_over_energy; +typedef divide_typeof_helper::type inverse_amount; +typedef divide_typeof_helper::type energy_over_temperature; +typedef divide_typeof_helper::type energy_over_temperature_amount; +typedef divide_typeof_helper< + divide_typeof_helper::type, + power_typeof_helper >::type + >::type power_over_area_temperature_4; +typedef multiply_typeof_helper::type power_area; +typedef divide_typeof_helper::type power_area_over_solid_angle; +typedef multiply_typeof_helper::type length_temperature; +typedef divide_typeof_helper::type frequency_over_temperature; +typedef divide_typeof_helper::type,current>::type force_over_current_squared; +typedef divide_typeof_helper::type capacitance_over_length; +typedef divide_typeof_helper< + divide_typeof_helper::type,time>::type, + time + >::type volume_over_mass_time_squared; +typedef multiply_typeof_helper::type energy_time; +typedef divide_typeof_helper::type electric_charge_over_amount; + +} // namespace codata + +} // namespace constants + +} // namespace si + +} // namespace units + +} // namespace boost + +#endif diff --git a/deal.II/contrib/boost/include/boost/units/systems/si/codata/universal_constants.hpp b/deal.II/contrib/boost/include/boost/units/systems/si/codata/universal_constants.hpp new file mode 100644 index 0000000000..21f076b741 --- /dev/null +++ b/deal.II/contrib/boost/include/boost/units/systems/si/codata/universal_constants.hpp @@ -0,0 +1,80 @@ +// Boost.Units - A C++ library for zero-overhead dimensional analysis and +// unit/quantity manipulation and conversion +// +// Copyright (C) 2003-2008 Matthias Christian Schabel +// Copyright (C) 2008 Steven Watanabe +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP +#define BOOST_UNITS_CODATA_UNIVERSAL_CONSTANTS_HPP + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/// \file +/// CODATA recommended values of fundamental universal constants +/// using CODATA 2006 values as of 2007/03/30 + +namespace boost { + +namespace units { + +namespace si { + +namespace constants { + +namespace codata { + +/// CODATA recommended values of the fundamental physical constants: NIST SP 961 + +// UNIVERSAL +/// speed of light +BOOST_UNITS_PHYSICAL_CONSTANT(c,quantity,299792458.0*meters/second,0.0*meters/second); +/// magnetic constant (exactly 4 pi x 10^(-7) - error is due to finite precision of pi) +BOOST_UNITS_PHYSICAL_CONSTANT(mu_0,quantity,12.56637061435917295385057353311801153679e-7*newtons/ampere/ampere,0.0*newtons/ampere/ampere); +/// electric constant +BOOST_UNITS_PHYSICAL_CONSTANT(epsilon_0,quantity,8.854187817620389850536563031710750260608e-12*farad/meter,0.0*farad/meter); +/// characteristic impedance of vacuum +BOOST_UNITS_PHYSICAL_CONSTANT(Z_0,quantity,376.7303134617706554681984004203193082686*ohm,0.0*ohm); +/// Newtonian constant of gravitation +BOOST_UNITS_PHYSICAL_CONSTANT(G,quantity,6.67428e-11*cubic_meters/kilogram/second/second,6.7e-15*cubic_meters/kilogram/second/second); +/// Planck constant +BOOST_UNITS_PHYSICAL_CONSTANT(h,quantity,6.62606896e-34*joule*seconds,3.3e-41*joule*seconds); +/// Dirac constant +BOOST_UNITS_PHYSICAL_CONSTANT(hbar,quantity,1.054571628e-34*joule*seconds,5.3e-42*joule*seconds); +/// Planck mass +BOOST_UNITS_PHYSICAL_CONSTANT(m_P,quantity,2.17644e-8*kilograms,1.1e-12*kilograms); +/// Planck temperature +BOOST_UNITS_PHYSICAL_CONSTANT(T_P,quantity,1.416785e32*kelvin,7.1e27*kelvin); +/// Planck length +BOOST_UNITS_PHYSICAL_CONSTANT(l_P,quantity,1.616252e-35*meters,8.1e-40*meters); +/// Planck time +BOOST_UNITS_PHYSICAL_CONSTANT(t_P,quantity