diff options
author | bugaevskiy <bugaevskiy@yandex-team.com> | 2022-09-13 06:22:47 +0300 |
---|---|---|
committer | bugaevskiy <bugaevskiy@yandex-team.com> | 2022-09-13 06:22:47 +0300 |
commit | 0449d8f2b5a071aa6a45feccbe4598e700c1bc0f (patch) | |
tree | 1f2398657039a6354fc82588eb02b89f0c4626be /contrib/restricted | |
parent | b0c690860440ffc6a8aa3e53ed3822fb0ca69c86 (diff) | |
download | ydb-0449d8f2b5a071aa6a45feccbe4598e700c1bc0f.tar.gz |
Remove unused boost/mpi library
Diffstat (limited to 'contrib/restricted')
372 files changed, 26 insertions, 73469 deletions
diff --git a/contrib/restricted/boost/boost/graph/breadth_first_search.hpp b/contrib/restricted/boost/boost/graph/breadth_first_search.hpp index b0d10ad5f3..d9c53fcc51 100644 --- a/contrib/restricted/boost/boost/graph/breadth_first_search.hpp +++ b/contrib/restricted/boost/boost/graph/breadth_first_search.hpp @@ -27,7 +27,7 @@ #include <boost/concept/assert.hpp> #ifdef BOOST_GRAPH_USE_MPI -#include <boost/graph/distributed/concepts.hpp> +#error #include <boost/graph/distributed/concepts.hpp> #endif // BOOST_GRAPH_USE_MPI namespace boost { @@ -406,7 +406,7 @@ namespace boost { } // namespace boost #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/breadth_first_search.hpp> +#error # include <boost/graph/distributed/breadth_first_search.hpp> #endif #endif // BOOST_GRAPH_BREADTH_FIRST_SEARCH_HPP diff --git a/contrib/restricted/boost/boost/graph/connected_components.hpp b/contrib/restricted/boost/boost/graph/connected_components.hpp index 9279110f19..b861c56141 100644 --- a/contrib/restricted/boost/boost/graph/connected_components.hpp +++ b/contrib/restricted/boost/boost/graph/connected_components.hpp @@ -101,7 +101,7 @@ namespace boost { } // namespace boost #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/connected_components.hpp> +#error # include <boost/graph/distributed/connected_components.hpp> #endif #endif // BOOST_GRAPH_CONNECTED_COMPONENTS_HPP diff --git a/contrib/restricted/boost/boost/graph/depth_first_search.hpp b/contrib/restricted/boost/boost/graph/depth_first_search.hpp index cf60e1ac84..68bf97026e 100644 --- a/contrib/restricted/boost/boost/graph/depth_first_search.hpp +++ b/contrib/restricted/boost/boost/graph/depth_first_search.hpp @@ -367,7 +367,7 @@ namespace boost { } // namespace boost #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/depth_first_search.hpp> +#error # include <boost/graph/distributed/depth_first_search.hpp> #endif #endif diff --git a/contrib/restricted/boost/boost/graph/dijkstra_shortest_paths.hpp b/contrib/restricted/boost/boost/graph/dijkstra_shortest_paths.hpp index 25c982d14b..785fa6ece5 100644 --- a/contrib/restricted/boost/boost/graph/dijkstra_shortest_paths.hpp +++ b/contrib/restricted/boost/boost/graph/dijkstra_shortest_paths.hpp @@ -617,7 +617,7 @@ namespace boost { } // namespace boost #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/dijkstra_shortest_paths.hpp> +#error # include <boost/graph/distributed/dijkstra_shortest_paths.hpp> #endif #endif // BOOST_GRAPH_DIJKSTRA_HPP diff --git a/contrib/restricted/boost/boost/graph/fruchterman_reingold.hpp b/contrib/restricted/boost/boost/graph/fruchterman_reingold.hpp index 01d080a418..78caf27e0d 100644 --- a/contrib/restricted/boost/boost/graph/fruchterman_reingold.hpp +++ b/contrib/restricted/boost/boost/graph/fruchterman_reingold.hpp @@ -434,7 +434,7 @@ fruchterman_reingold_force_directed_layout } // end namespace boost #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/fruchterman_reingold.hpp> +#error # include <boost/graph/distributed/fruchterman_reingold.hpp> #endif #endif // BOOST_GRAPH_FRUCHTERMAN_REINGOLD_FORCE_DIRECTED_LAYOUT_HPP diff --git a/contrib/restricted/boost/boost/graph/graphviz.hpp b/contrib/restricted/boost/boost/graph/graphviz.hpp index a8caad3538..764aed95c6 100644 --- a/contrib/restricted/boost/boost/graph/graphviz.hpp +++ b/contrib/restricted/boost/boost/graph/graphviz.hpp @@ -952,7 +952,7 @@ bool read_graphviz(std::istream& in, MutableGraph& graph, } // namespace boost #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/graphviz.hpp> +#error # include <boost/graph/distributed/graphviz.hpp> #endif #endif // BOOST_GRAPHVIZ_HPP diff --git a/contrib/restricted/boost/boost/graph/one_bit_color_map.hpp b/contrib/restricted/boost/boost/graph/one_bit_color_map.hpp index b153b732f7..0bab842d6b 100644 --- a/contrib/restricted/boost/boost/graph/one_bit_color_map.hpp +++ b/contrib/restricted/boost/boost/graph/one_bit_color_map.hpp @@ -100,5 +100,5 @@ make_one_bit_color_map(std::size_t n, const IndexMap& index_map) #endif // BOOST_ONE_BIT_COLOR_MAP_HPP #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/one_bit_color_map.hpp> +#error # include <boost/graph/distributed/one_bit_color_map.hpp> #endif diff --git a/contrib/restricted/boost/boost/graph/page_rank.hpp b/contrib/restricted/boost/boost/graph/page_rank.hpp index a8987046d3..c34546742e 100644 --- a/contrib/restricted/boost/boost/graph/page_rank.hpp +++ b/contrib/restricted/boost/boost/graph/page_rank.hpp @@ -155,7 +155,7 @@ remove_dangling_links(MutableGraph& g } } // end namespace boost::graph #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/page_rank.hpp> +#error # include <boost/graph/distributed/page_rank.hpp> #endif #endif // BOOST_GRAPH_PAGE_RANK_HPP diff --git a/contrib/restricted/boost/boost/graph/rmat_graph_generator.hpp b/contrib/restricted/boost/boost/graph/rmat_graph_generator.hpp index f083fc5558..146151b5f9 100644 --- a/contrib/restricted/boost/boost/graph/rmat_graph_generator.hpp +++ b/contrib/restricted/boost/boost/graph/rmat_graph_generator.hpp @@ -589,7 +589,7 @@ namespace boost { } // end namespace boost #ifdef BOOST_GRAPH_USE_MPI -#include <boost/graph/distributed/rmat_graph_generator.hpp> +#error #include <boost/graph/distributed/rmat_graph_generator.hpp> #endif // BOOST_GRAPH_USE_MPI #endif // BOOST_GRAPH_RMAT_GENERATOR_HPP diff --git a/contrib/restricted/boost/boost/graph/strong_components.hpp b/contrib/restricted/boost/boost/graph/strong_components.hpp index f1bd56d6f7..6f9ed29fb6 100644 --- a/contrib/restricted/boost/boost/graph/strong_components.hpp +++ b/contrib/restricted/boost/boost/graph/strong_components.hpp @@ -337,7 +337,7 @@ namespace boost { } // namespace boost #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/strong_components.hpp> +#error # include <boost/graph/distributed/strong_components.hpp> #endif #endif // BOOST_GRAPH_STRONG_COMPONENTS_HPP diff --git a/contrib/restricted/boost/boost/graph/two_bit_color_map.hpp b/contrib/restricted/boost/boost/graph/two_bit_color_map.hpp index 3d55eabc70..ece7871e2d 100644 --- a/contrib/restricted/boost/boost/graph/two_bit_color_map.hpp +++ b/contrib/restricted/boost/boost/graph/two_bit_color_map.hpp @@ -105,5 +105,5 @@ make_two_bit_color_map(std::size_t n, const IndexMap& index_map) #endif // BOOST_TWO_BIT_COLOR_MAP_HPP #ifdef BOOST_GRAPH_USE_MPI -# include <boost/graph/distributed/two_bit_color_map.hpp> +#error # include <boost/graph/distributed/two_bit_color_map.hpp> #endif diff --git a/contrib/restricted/boost/boost/mpi.hpp b/contrib/restricted/boost/boost/mpi.hpp deleted file mode 100644 index d9ed0c1fd2..0000000000 --- a/contrib/restricted/boost/boost/mpi.hpp +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -// Message Passing Interface - -// See www.boost.org/libs/mpi for documentation. - -/** @file mpi.hpp - * - * This file is a top-level convenience header that includes all of - * the Boost.MPI library headers. Users concerned about compile time - * may wish to include only specific headers from the Boost.MPI - * library. - * - */ -#ifndef BOOST_MPI_HPP -#define BOOST_MPI_HPP - -#include <boost/mpi/allocator.hpp> -#include <boost/mpi/collectives.hpp> -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/mpi/graph_communicator.hpp> -#include <boost/mpi/group.hpp> -#include <boost/mpi/intercommunicator.hpp> -#include <boost/mpi/nonblocking.hpp> -#include <boost/mpi/operations.hpp> -#include <boost/mpi/skeleton_and_content.hpp> -#include <boost/mpi/timer.hpp> - -#endif // BOOST_MPI_HPP diff --git a/contrib/restricted/boost/boost/mpi/allocator.hpp b/contrib/restricted/boost/boost/mpi/allocator.hpp deleted file mode 100644 index 32514b40a1..0000000000 --- a/contrib/restricted/boost/boost/mpi/allocator.hpp +++ /dev/null @@ -1,210 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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) - -/** @file allocator.hpp - * - * This header provides an STL-compliant allocator that uses the - * MPI-2 memory allocation facilities. - */ -#ifndef BOOST_MPI_ALLOCATOR_HPP -#define BOOST_MPI_ALLOCATOR_HPP - -#include <boost/mpi/config.hpp> -#include <boost/mpi/exception.hpp> -#include <cstddef> -#include <memory> -#include <boost/limits.hpp> - -namespace boost { namespace mpi { - -#if defined(BOOST_MPI_HAS_MEMORY_ALLOCATION) -template<typename T> class allocator; - -/** @brief Allocator specialization for @c void value types. - * - * The @c void specialization of @c allocator is useful only for - * rebinding to another, different value type. - */ -template<> -class BOOST_MPI_DECL allocator<void> -{ -public: - typedef void* pointer; - typedef const void* const_pointer; - typedef void value_type; - - template <class U> - struct rebind - { - typedef allocator<U> other; - }; -}; - -/** @brief Standard Library-compliant allocator for the MPI-2 memory - * allocation routines. - * - * This allocator provides a standard C++ interface to the @c - * MPI_Alloc_mem and @c MPI_Free_mem routines of MPI-2. It is - * intended to be used with the containers in the Standard Library - * (@c vector, in particular) in cases where the contents of the - * container will be directly transmitted via MPI. This allocator is - * also used internally by the library for character buffers that - * will be used in the transmission of data. - * - * The @c allocator class template only provides MPI memory - * allocation when the underlying MPI implementation is either MPI-2 - * compliant or is known to provide @c MPI_Alloc_mem and @c - * MPI_Free_mem as extensions. When the MPI memory allocation - * routines are not available, @c allocator is brought in directly - * from namespace @c std, so that standard allocators are used - * throughout. The macro @c BOOST_MPI_HAS_MEMORY_ALLOCATION will be - * defined when the MPI-2 memory allocation facilities are available. - */ -template<typename T> -class BOOST_MPI_DECL allocator -{ -public: - /// Holds the size of objects - typedef std::size_t size_type; - - /// Holds the number of elements between two pointers - typedef std::ptrdiff_t difference_type; - - /// A pointer to an object of type @c T - typedef T* pointer; - - /// A pointer to a constant object of type @c T - typedef const T* const_pointer; - - /// A reference to an object of type @c T - typedef T& reference; - - /// A reference to a constant object of type @c T - typedef const T& const_reference; - - /// The type of memory allocated by this allocator - typedef T value_type; - - /** @brief Retrieve the type of an allocator similar to this - * allocator but for a different value type. - */ - template <typename U> - struct rebind - { - typedef allocator<U> other; - }; - - /** Default-construct an allocator. */ - allocator() noexcept { } - - /** Copy-construct an allocator. */ - allocator(const allocator&) noexcept { } - - /** - * Copy-construct an allocator from another allocator for a - * different value type. - */ - template <typename U> - allocator(const allocator<U>&) noexcept { } - - /** Destroy an allocator. */ - ~allocator() { } - - /** Returns the address of object @p x. */ - pointer address(reference x) const - { - return &x; - } - - /** Returns the address of object @p x. */ - const_pointer address(const_reference x) const - { - return &x; - } - - /** - * Allocate enough memory for @p n elements of type @c T. - * - * @param n The number of elements for which memory should be - * allocated. - * - * @return a pointer to the newly-allocated memory - */ - pointer allocate(size_type n, allocator<void>::const_pointer /*hint*/ = 0) - { - pointer result; - BOOST_MPI_CHECK_RESULT(MPI_Alloc_mem, - (static_cast<MPI_Aint>(n * sizeof(T)), - MPI_INFO_NULL, - &result)); - return result; - } - - /** - * Deallocate memory referred to by the pointer @c p. - * - * @param p The pointer whose memory should be deallocated. This - * pointer shall have been returned from the @c allocate() function - * and not have already been freed. - */ - void deallocate(pointer p, size_type /*n*/) - { - BOOST_MPI_CHECK_RESULT(MPI_Free_mem, (p)); - } - - /** - * Returns the maximum number of elements that can be allocated - * with @c allocate(). - */ - size_type max_size() const noexcept - { - return (std::numeric_limits<std::size_t>::max)() / sizeof(T); - } - - /** Construct a copy of @p val at the location referenced by @c p. */ - void construct(pointer p, const T& val) - { - new ((void *)p) T(val); - } - - /** Destroy the object referenced by @c p. */ - void destroy(pointer p) - { - ((T*)p)->~T(); - } -}; - -/** @brief Compare two allocators for equality. - * - * Since MPI allocators have no state, all MPI allocators are equal. - * - * @returns @c true - */ -template<typename T1, typename T2> -inline bool operator==(const allocator<T1>&, const allocator<T2>&) noexcept -{ - return true; -} - -/** @brief Compare two allocators for inequality. - * - * Since MPI allocators have no state, all MPI allocators are equal. - * - * @returns @c false - */ -template<typename T1, typename T2> -inline bool operator!=(const allocator<T1>&, const allocator<T2>&) noexcept -{ - return false; -} -#else -// Bring in the default allocator from namespace std. -using std::allocator; -#endif - -} } /// end namespace boost::mpi - -#endif // BOOST_MPI_ALLOCATOR_HPP diff --git a/contrib/restricted/boost/boost/mpi/cartesian_communicator.hpp b/contrib/restricted/boost/boost/mpi/cartesian_communicator.hpp deleted file mode 100644 index 7a31bce093..0000000000 --- a/contrib/restricted/boost/boost/mpi/cartesian_communicator.hpp +++ /dev/null @@ -1,382 +0,0 @@ -// Copyright Alain Miniussi 2014. -// Distributed under the 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: Alain Miniussi - -/** @file cartesian_communicator.hpp - * - * This header defines facilities to support MPI communicators with - * cartesian topologies. - * If known at compiled time, the dimension of the implied grid - * can be statically enforced, through the templatized communicator - * class. Otherwise, a non template, dynamic, base class is provided. - * - */ -#ifndef BOOST_MPI_CARTESIAN_COMMUNICATOR_HPP -#define BOOST_MPI_CARTESIAN_COMMUNICATOR_HPP - -#include <boost/mpi/communicator.hpp> - -#include <vector> -#include <utility> -#include <iostream> -#include <utility> -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) -#include <initializer_list> -#endif // BOOST_NO_CXX11_HDR_INITIALIZER_LIST - -// Headers required to implement cartesian topologies -#include <boost/shared_array.hpp> -#include <boost/assert.hpp> -#include <boost/foreach.hpp> - -namespace boost { namespace mpi { - -/** - * @brief Specify the size and periodicity of the grid in a single dimension. - * - * POD lightweight object. - */ -struct cartesian_dimension { - /** The size of the grid n this dimension. */ - int size; - /** Is the grid periodic in this dimension. */ - bool periodic; - - cartesian_dimension(int sz = 0, bool p = false) : size(sz), periodic(p) {} - -private: - friend class boost::serialization::access; - template<class Archive> - void serialize(Archive & ar, const unsigned int version) - { - ar & size & periodic; - } - -}; - -template <> -struct is_mpi_datatype<cartesian_dimension> : mpl::true_ { }; - -/** - * @brief Test if the dimensions values are identical. - */ -inline -bool -operator==(cartesian_dimension const& d1, cartesian_dimension const& d2) { - return &d1 == &d2 || (d1.size == d2.size && d1.periodic == d2.periodic); -} - -/** - * @brief Test if the dimension values are different. - */ -inline -bool -operator!=(cartesian_dimension const& d1, cartesian_dimension const& d2) { - return !(d1 == d2); -} - -/** - * @brief Pretty printing of a cartesian dimension (size, periodic) - */ -std::ostream& operator<<(std::ostream& out, cartesian_dimension const& d); - -/** - * @brief Describe the topology of a cartesian grid. - * - * Behave mostly like a sequence of @c cartesian_dimension with the notable - * exception that its size is fixed. - * This is a lightweight object, so that any constructor that could be considered - * missing could be replaced with a function (move constructor provided when supported). - */ -class BOOST_MPI_DECL cartesian_topology - : private std::vector<cartesian_dimension> { - friend class cartesian_communicator; - typedef std::vector<cartesian_dimension> super; - public: - /** - * Retrieve a specific dimension. - */ - using super::operator[]; - /** - * @brief Topology dimentionality. - */ - using super::size; - using super::begin; - using super::end; - using super::swap; - -#if !defined(BOOST_NO_CXX11_DELETED_FUNCTIONS) - cartesian_topology() = delete; -#endif -#if !defined(BOOST_NO_CXX11_DEFAULTED_FUNCTIONS) - cartesian_topology(cartesian_topology const&) = default; - cartesian_topology& operator=(cartesian_topology const&) = default; - // There is apparently no macro for checking the support of move constructor. - // Assume that defaulted function is close enough. - cartesian_topology(cartesian_topology const&& other) : super(other) {} - cartesian_topology& operator=(cartesian_topology const&& other) { - (*this) = std::move(other.stl()); - return *this; - } - - ~cartesian_topology() = default; -#endif - /** - * @brief Create a N dimension space. - * Each dimension is initialized as non periodic of size 0. - */ - cartesian_topology(int ndim) - : super(ndim) {} - - /** - * @brief Use the provided dimensions specification as initial values. - */ - cartesian_topology(std::vector<cartesian_dimension> const& dims) - : super(dims) {} - - /** - * @brief Use dimensions specification provided in the sequence container as initial values. - * #param dims must be a sequence container. - */ - template<class InitArr> - explicit cartesian_topology(InitArr dims) - : super(0) { - BOOST_FOREACH(cartesian_dimension const& d, dims) { - push_back(d); - } - } -#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST) - /** - * @brief Use dimensions specification provided in the initialization list as initial values. - * #param dims can be of the form { dim_1, false}, .... {dim_n, true} - */ - explicit cartesian_topology(std::initializer_list<cartesian_dimension> dims) - : super(dims) {} -#endif - /** - * @brief Use dimensions specification provided in the array. - * #param dims can be of the form { dim_1, false}, .... {dim_n, true} - */ - template<int NDIM> - explicit cartesian_topology(cartesian_dimension (&dims)[NDIM]) - : super(dims, dims+NDIM) {} - - /** - * @brief Use dimensions specification provided in the input ranges - * The ranges do not need to be the same size. If the sizes are different, - * the missing values will be complete with zeros of the dim and assumed non periodic. - * @param dim_rg the dimensions, values must convert to integers. - * @param period_rg the periodicities, values must convert to booleans. - * #param dims can be of the form { dim_1, false}, .... {dim_n, true} - */ - template<class DimRg, class PerRg> - cartesian_topology(DimRg const& dim_rg, PerRg const& period_rg) - : super(0) { - BOOST_FOREACH(int d, dim_rg) { - super::push_back(cartesian_dimension(d)); - } - super::iterator it = begin(); - BOOST_FOREACH(bool p, period_rg) { - if (it < end()) { - it->periodic = p; - } else { - push_back(cartesian_dimension(0,p)); - } - ++it; - } - } - - - /** - * @brief Iterator based initializer. - * Will use the first n iterated values. - * Both iterators can be single pass. - * @param dit dimension iterator, value must convert to integer type. - * @param pit periodicity iterator, value must convert to booleans.. - */ - template<class DimIter, class PerIter> - cartesian_topology(DimIter dit, PerIter pit, int n) - : super(n) { - for(int i = 0; i < n; ++i) { - (*this)[i] = cartesian_dimension(*dit++, *pit++); - } - } - - /** - * Export as an stl sequence. - */ - std::vector<cartesian_dimension>& stl() { return *this; } - /** - * Export as an stl sequence. - */ - std::vector<cartesian_dimension> const& stl() const{ return *this; } - /** - * Split the topology in two sequences of sizes and periodicities. - */ - void split(std::vector<int>& dims, std::vector<bool>& periodics) const; -}; - -inline -bool -operator==(cartesian_topology const& t1, cartesian_topology const& t2) { - return t1.stl() == t2.stl(); -} - -inline -bool -operator!=(cartesian_topology const& t1, cartesian_topology const& t2) { - return t1.stl() != t2.stl(); -} - -/** - * @brief Pretty printing of a cartesian topology - */ -std::ostream& operator<<(std::ostream& out, cartesian_topology const& t); - -/** - * @brief An MPI communicator with a cartesian topology. - * - * A @c cartesian_communicator is a communicator whose topology is - * expressed as a grid. Cartesian communicators have the same - * functionality as (intra)communicators, but also allow one to query - * the relationships among processes and the properties of the grid. - */ -class BOOST_MPI_DECL cartesian_communicator : public communicator -{ - friend class communicator; - - /** - * INTERNAL ONLY - * - * Construct a cartesian communicator given a shared pointer to the - * underlying MPI_Comm (which must have a cartesian topology). - * This operation is used for "casting" from a communicator to - * a cartesian communicator. - */ - explicit cartesian_communicator(const shared_ptr<MPI_Comm>& comm_ptr) - : communicator() - { - this->comm_ptr = comm_ptr; - BOOST_ASSERT(has_cartesian_topology()); - } - -public: - /** - * Build a new Boost.MPI cartesian communicator based on the MPI - * communicator @p comm with cartesian topology. - * - * @p comm may be any valid MPI communicator. If @p comm is - * MPI_COMM_NULL, an empty communicator (that cannot be used for - * communication) is created and the @p kind parameter is - * ignored. Otherwise, the @p kind parameter determines how the - * Boost.MPI communicator will be related to @p comm: - * - * - If @p kind is @c comm_duplicate, duplicate @c comm to create - * a new communicator. This new communicator will be freed when - * the Boost.MPI communicator (and all copies of it) is - * destroyed. This option is only permitted if the underlying MPI - * implementation supports MPI 2.0; duplication of - * intercommunicators is not available in MPI 1.x. - * - * - If @p kind is @c comm_take_ownership, take ownership of @c - * comm. It will be freed automatically when all of the Boost.MPI - * communicators go out of scope. - * - * - If @p kind is @c comm_attach, this Boost.MPI communicator - * will reference the existing MPI communicator @p comm but will - * not free @p comm when the Boost.MPI communicator goes out of - * scope. This option should only be used when the communicator is - * managed by the user. - */ - cartesian_communicator(const MPI_Comm& comm, comm_create_kind kind) - : communicator(comm, kind) - { - BOOST_ASSERT(has_cartesian_topology()); - } - - /** - * Create a new communicator whose topology is described by the - * given cartesian. The indices of the vertices in the cartesian will be - * assumed to be the ranks of the processes within the - * communicator. There may be fewer vertices in the cartesian than - * there are processes in the communicator; in this case, the - * resulting communicator will be a NULL communicator. - * - * @param comm The communicator that the new, cartesian communicator - * will be based on. - * - * @param dims the cartesian dimension of the new communicator. The size indicate - * the number of dimension. Some dimensions be set to zero, in which case - * the corresponding dimension value is left to the system. - * - * @param reorder Whether MPI is permitted to re-order the process - * ranks within the returned communicator, to better optimize - * communication. If false, the ranks of each process in the - * returned process will match precisely the rank of that process - * within the original communicator. - */ - cartesian_communicator(const communicator& comm, - const cartesian_topology& dims, - bool reorder = false); - - /** - * Create a new cartesian communicator whose topology is a subset of - * an existing cartesian cimmunicator. - * @param comm the original communicator. - * @param keep and array containiing the dimension to keep from the existing - * communicator. - */ - cartesian_communicator(const cartesian_communicator& comm, - const std::vector<int>& keep ); - - using communicator::rank; - - /** - * Retrive the number of dimension of the underlying toppology. - */ - int ndims() const; - - /** - * Return the rank of the process at the given coordinates. - * @param coords the coordinates. the size must match the communicator's topology. - */ - int rank(const std::vector<int>& coords) const; - /** - * Return the rank of the source and target destination process through a shift. - * @param dim the dimension in which the shift takes place. 0 <= dim <= ndim(). - * @param disp the shift displacement, can be positive (upward) or negative (downward). - */ - std::pair<int, int> shifted_ranks(int dim, int disp) const; - /** - * Provides the coordinates of the process with the given rank. - * @param rk the ranks in this communicator. - * @returns the coordinates. - */ - std::vector<int> coordinates(int rk) const; - /** - * Retrieve the topology and coordinates of this process in the grid. - * - */ - void topology( cartesian_topology& dims, std::vector<int>& coords ) const; - /** - * Retrieve the topology of the grid. - * - */ - cartesian_topology topology() const; -}; - -/** - * Given en number of processes, and a partially filled sequence - * of dimension, try to complete the dimension sequence. - * @param nb_proc the numer of mpi processes.fill a sequence of dimension. - * @param dims a sequence of positive or null dimensions. Non zero dimension - * will be left untouched. - */ -std::vector<int>& cartesian_dimensions(int nb_proc, std::vector<int>& dims); - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_CARTESIAN_COMMUNICATOR_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives.hpp b/contrib/restricted/boost/boost/mpi/collectives.hpp deleted file mode 100644 index 72c4294606..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives.hpp +++ /dev/null @@ -1,697 +0,0 @@ -// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -// Message Passing Interface 1.1 -- Section 4. MPI Collectives - -/** @file collectives.hpp - * - * This header contains MPI collective operations, which implement - * various parallel algorithms that require the coordination of all - * processes within a communicator. The header @c collectives_fwd.hpp - * provides forward declarations for each of these operations. To - * include only specific collective algorithms, use the headers @c - * boost/mpi/collectives/algorithm_name.hpp. - */ -#ifndef BOOST_MPI_COLLECTIVES_HPP -#define BOOST_MPI_COLLECTIVES_HPP - -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/inplace.hpp> -#include <vector> - -namespace boost { namespace mpi { -/** - * @brief Gather the values stored at every process into vectors of - * values from each process. - * - * @c all_gather is a collective algorithm that collects the values - * stored at each process into a vector of values indexed by the - * process number they came from. The type @c T of the values may be - * any type that is serializable or has an associated MPI data type. - * - * When the type @c T has an associated MPI data type, this routine - * invokes @c MPI_Allgather to gather the values. - * - * @param comm The communicator over which the all-gather will - * occur. - * - * @param in_value The value to be transmitted by each process. To - * gather an array of values, @c in_values points to the @c n local - * values to be transmitted. - * - * @param out_values A vector or pointer to storage that will be - * populated with the values from each process, indexed by the - * process ID number. If it is a vector, the vector will be resized - * accordingly. - */ -template<typename T> -void -all_gather(const communicator& comm, const T& in_value, - std::vector<T>& out_values); - -/** - * \overload - */ -template<typename T> -void -all_gather(const communicator& comm, const T& in_value, T* out_values); - -/** - * \overload - */ -template<typename T> -void -all_gather(const communicator& comm, const T* in_values, int n, - std::vector<T>& out_values); - -/** - * \overload - */ -template<typename T> -void -all_gather(const communicator& comm, const T* in_values, int n, T* out_values); - -/** - * @brief Combine the values stored by each process into a single - * value available to all processes. - * - * @c all_reduce is a collective algorithm that combines the values - * stored by each process into a single value available to all - * processes. The values are combined in a user-defined way, - * specified via a function object. The type @c T of the values may - * be any type that is serializable or has an associated MPI data - * type. One can think of this operation as a @c all_gather, followed - * by an @c std::accumulate() over the gather values and using the - * operation @c op. - * - * When the type @c T has an associated MPI data type, this routine - * invokes @c MPI_Allreduce to perform the reduction. If possible, - * built-in MPI operations will be used; otherwise, @c all_reduce() - * will create a custom MPI_Op for the call to MPI_Allreduce. - * - * @param comm The communicator over which the reduction will - * occur. - * @param value The local value to be combined with the local - * values of every other process. For reducing arrays, @c in_values - * is a pointer to the local values to be reduced and @c n is the - * number of values to reduce. See @c reduce for more information. - * - * If wrapped in a @c inplace_t object, combine the usage of both - * input and $c out_value and the local value will be overwritten - * (a convenience function @c inplace is provided for the wrapping). - * - * @param out_value Will receive the result of the reduction - * operation. If this parameter is omitted, the outgoing value will - * instead be returned. - * - * @param op The binary operation that combines two values of type - * @c T and returns a third value of type @c T. For types @c T that has - * ssociated MPI data types, @c op will either be translated into - * an @c MPI_Op (via @c MPI_Op_create) or, if possible, mapped - * directly to a built-in MPI operation. See @c is_mpi_op in the @c - * operations.hpp header for more details on this mapping. For any - * non-built-in operation, commutativity will be determined by the - * @c is_commmutative trait (also in @c operations.hpp): users are - * encouraged to mark commutative operations as such, because it - * gives the implementation additional lattitude to optimize the - * reduction operation. - * - * @param n Indicated the size of the buffers of array type. - * @returns If no @p out_value parameter is supplied, returns the - * result of the reduction operation. - */ -template<typename T, typename Op> -void -all_reduce(const communicator& comm, const T* value, int n, T* out_value, - Op op); -/** - * \overload - */ -template<typename T, typename Op> -void -all_reduce(const communicator& comm, const T& value, T& out_value, Op op); -/** - * \overload - */ -template<typename T, typename Op> -T all_reduce(const communicator& comm, const T& value, Op op); - -/** - * \overload - */ -template<typename T, typename Op> -void -all_reduce(const communicator& comm, inplace_t<T*> value, int n, - Op op); -/** - * \overload - */ -template<typename T, typename Op> -void -all_reduce(const communicator& comm, inplace_t<T> value, Op op); - -/** - * @brief Send data from every process to every other process. - * - * @c all_to_all is a collective algorithm that transmits @c p values - * from every process to every other process. On process i, jth value - * of the @p in_values vector is sent to process j and placed in the - * ith position of the @p out_values vector in process @p j. The type - * @c T of the values may be any type that is serializable or has an - * associated MPI data type. If @c n is provided, then arrays of @p n - * values will be transferred from one process to another. - * - * When the type @c T has an associated MPI data type, this routine - * invokes @c MPI_Alltoall to scatter the values. - * - * @param comm The communicator over which the all-to-all - * communication will occur. - * - * @param in_values A vector or pointer to storage that contains - * the values to send to each process, indexed by the process ID - * number. - * - * @param out_values A vector or pointer to storage that will be - * updated to contain the values received from other processes. The - * jth value in @p out_values will come from the procss with rank j. - */ -template<typename T> -void -all_to_all(const communicator& comm, const std::vector<T>& in_values, - std::vector<T>& out_values); - -/** - * \overload - */ -template<typename T> -void all_to_all(const communicator& comm, const T* in_values, T* out_values); - -/** - * \overload - */ -template<typename T> -void -all_to_all(const communicator& comm, const std::vector<T>& in_values, int n, - std::vector<T>& out_values); - -/** - * \overload - */ -template<typename T> -void -all_to_all(const communicator& comm, const T* in_values, int n, T* out_values); - -/** - * @brief Broadcast a value from a root process to all other - * processes. - * - * @c broadcast is a collective algorithm that transfers a value from - * an arbitrary @p root process to every other process that is part of - * the given communicator. The @c broadcast algorithm can transmit any - * Serializable value, values that have associated MPI data types, - * packed archives, skeletons, and the content of skeletons; see the - * @c send primitive for communicators for a complete list. The type - * @c T shall be the same for all processes that are a part of the - * communicator @p comm, unless packed archives are being transferred: - * with packed archives, the root sends a @c packed_oarchive or @c - * packed_skeleton_oarchive whereas the other processes receive a - * @c packed_iarchive or @c packed_skeleton_iarchve, respectively. - * - * When the type @c T has an associated MPI data type, this routine - * invokes @c MPI_Bcast to perform the broadcast. - * - * @param comm The communicator over which the broadcast will - * occur. - * - * @param value The value (or values, if @p n is provided) to be - * transmitted (if the rank of @p comm is equal to @p root) or - * received (if the rank of @p comm is not equal to @p root). When - * the @p value is a @c skeleton_proxy, only the skeleton of the - * object will be broadcast. In this case, the @p root will build a - * skeleton from the object help in the proxy and all of the - * non-roots will reshape the objects held in their proxies based on - * the skeleton sent from the root. - * - * @param n When supplied, the number of values that the pointer @p - * values points to, for broadcasting an array of values. The value - * of @p n must be the same for all processes in @p comm. - * - * @param root The rank/process ID of the process that will be - * transmitting the value. - */ -template<typename T> -void broadcast(const communicator& comm, T& value, int root); - -/** - * \overload - */ -template<typename T> -void broadcast(const communicator& comm, T* values, int n, int root); - -/** - * \overload - */ -template<typename T> -void broadcast(const communicator& comm, skeleton_proxy<T>& value, int root); - -/** - * \overload - */ -template<typename T> -void -broadcast(const communicator& comm, const skeleton_proxy<T>& value, int root); - -/** - * @brief Gather the values stored at every process into a vector at - * the root process. - * - * @c gather is a collective algorithm that collects the values - * stored at each process into a vector of values at the @p root - * process. This vector is indexed by the process number that the - * value came from. The type @c T of the values may be any type that - * is serializable or has an associated MPI data type. - * - * When the type @c T has an associated MPI data type, this routine - * invokes @c MPI_Gather to gather the values. - * - * @param comm The communicator over which the gather will occur. - * - * @param in_value The value to be transmitted by each process. For - * gathering arrays of values, @c in_values points to storage for - * @c n*comm.size() values. - * - * @param out_values A vector or pointer to storage that will be - * populated with the values from each process, indexed by the - * process ID number. If it is a vector, it will be resized - * accordingly. For non-root processes, this parameter may be - * omitted. If it is still provided, however, it will be unchanged. - * - * @param root The process ID number that will collect the - * values. This value must be the same on all processes. - */ -template<typename T> -void -gather(const communicator& comm, const T& in_value, std::vector<T>& out_values, - int root); - -/** - * \overload - */ -template<typename T> -void -gather(const communicator& comm, const T& in_value, T* out_values, int root); - -/** - * \overload - */ -template<typename T> -void gather(const communicator& comm, const T& in_value, int root); - -/** - * \overload - */ -template<typename T> -void -gather(const communicator& comm, const T* in_values, int n, - std::vector<T>& out_values, int root); - -/** - * \overload - */ -template<typename T> -void -gather(const communicator& comm, const T* in_values, int n, T* out_values, - int root); - -/** - * \overload - */ -template<typename T> -void gather(const communicator& comm, const T* in_values, int n, int root); - -/** - * @brief Similar to boost::mpi::gather with the difference that the number - * of values to be send by non-root processes can vary. - * - * @param comm The communicator over which the gather will occur. - * - * @param in_values The array of values to be transmitted by each process. - * - * @param in_size For each non-root process this specifies the size - * of @p in_values. - * - * @param out_values A pointer to storage that will be populated with - * the values from each process. For non-root processes, this parameter - * may be omitted. If it is still provided, however, it will be unchanged. - * - * @param sizes A vector containing the number of elements each non-root - * process will send. - * - * @param displs A vector such that the i-th entry specifies the - * displacement (relative to @p out_values) from which to take the ingoing - * data at the @p root process. Overloaded versions for which @p displs is - * omitted assume that the data is to be placed contiguously at the root process. - * - * @param root The process ID number that will collect the - * values. This value must be the same on all processes. - */ -template<typename T> -void -gatherv(const communicator& comm, const std::vector<T>& in_values, - T* out_values, const std::vector<int>& sizes, const std::vector<int>& displs, - int root); - -/** - * \overload - */ -template<typename T> -void -gatherv(const communicator& comm, const T* in_values, int in_size, - T* out_values, const std::vector<int>& sizes, const std::vector<int>& displs, - int root); - -/** - * \overload - */ -template<typename T> -void gatherv(const communicator& comm, const std::vector<T>& in_values, int root); - -/** - * \overload - */ -template<typename T> -void gatherv(const communicator& comm, const T* in_values, int in_size, int root); - -/** - * \overload - */ -template<typename T> -void -gatherv(const communicator& comm, const T* in_values, int in_size, - T* out_values, const std::vector<int>& sizes, int root); - -/** - * \overload - */ -template<typename T> -void -gatherv(const communicator& comm, const std::vector<T>& in_values, - T* out_values, const std::vector<int>& sizes, int root); - -/** - * @brief Scatter the values stored at the root to all processes - * within the communicator. - * - * @c scatter is a collective algorithm that scatters the values - * stored in the @p root process (inside a vector) to all of the - * processes in the communicator. The vector @p out_values (only - * significant at the @p root) is indexed by the process number to - * which the corresponding value will be sent. The type @c T of the - * values may be any type that is serializable or has an associated - * MPI data type. - * - * When the type @c T has an associated MPI data type, this routine - * invokes @c MPI_Scatter to scatter the values. - * - * @param comm The communicator over which the scatter will occur. - * - * @param in_values A vector or pointer to storage that will contain - * the values to send to each process, indexed by the process rank. - * For non-root processes, this parameter may be omitted. If it is - * still provided, however, it will be unchanged. - * - * @param out_value The value received by each process. When - * scattering an array of values, @p out_values points to the @p n - * values that will be received by each process. - * - * @param root The process ID number that will scatter the - * values. This value must be the same on all processes. - */ -template<typename T> -void -scatter(const communicator& comm, const std::vector<T>& in_values, T& out_value, - int root); - -/** - * \overload - */ -template<typename T> -void -scatter(const communicator& comm, const T* in_values, T& out_value, int root); - -/** - * \overload - */ -template<typename T> -void scatter(const communicator& comm, T& out_value, int root); - -/** - * \overload - */ -template<typename T> -void -scatter(const communicator& comm, const std::vector<T>& in_values, - T* out_values, int n, int root); - -/** - * \overload - */ -template<typename T> -void -scatter(const communicator& comm, const T* in_values, T* out_values, int n, - int root); - -/** - * \overload - */ -template<typename T> -void scatter(const communicator& comm, T* out_values, int n, int root); - -/** - * @brief Similar to boost::mpi::scatter with the difference that the number - * of values stored at the root process does not need to be a multiple of - * the communicator's size. - * - * @param comm The communicator over which the scatter will occur. - * - * @param in_values A vector or pointer to storage that will contain - * the values to send to each process, indexed by the process rank. - * For non-root processes, this parameter may be omitted. If it is - * still provided, however, it will be unchanged. - * - * @param sizes A vector containing the number of elements each non-root - * process will receive. - * - * @param displs A vector such that the i-th entry specifies the - * displacement (relative to @p in_values) from which to take the outgoing - * data to process i. Overloaded versions for which @p displs is omitted - * assume that the data is contiguous at the @p root process. - * - * @param out_values The array of values received by each process. - * - * @param out_size For each non-root process this will contain the size - * of @p out_values. - * - * @param root The process ID number that will scatter the - * values. This value must be the same on all processes. - */ -template<typename T> -void -scatterv(const communicator& comm, const std::vector<T>& in_values, - const std::vector<int>& sizes, const std::vector<int>& displs, - T* out_values, int out_size, int root); - -/** - * \overload - */ -template<typename T> -void -scatterv(const communicator& comm, const T* in_values, - const std::vector<int>& sizes, const std::vector<int>& displs, - T* out_values, int out_size, int root); - -/** - * \overload - */ -template<typename T> -void scatterv(const communicator& comm, T* out_values, int out_size, int root); - -/** - * \overload - */ -template<typename T> -void -scatterv(const communicator& comm, const T* in_values, - const std::vector<int>& sizes, T* out_values, int root); - -/** - * \overload - */ -template<typename T> -void -scatterv(const communicator& comm, const std::vector<T>& in_values, - const std::vector<int>& sizes, T* out_values, int root); - -/** - * @brief Combine the values stored by each process into a single - * value at the root. - * - * @c reduce is a collective algorithm that combines the values - * stored by each process into a single value at the @c root. The - * values can be combined arbitrarily, specified via a function - * object. The type @c T of the values may be any type that is - * serializable or has an associated MPI data type. One can think of - * this operation as a @c gather to the @p root, followed by an @c - * std::accumulate() over the gathered values and using the operation - * @c op. - * - * When the type @c T has an associated MPI data type, this routine - * invokes @c MPI_Reduce to perform the reduction. If possible, - * built-in MPI operations will be used; otherwise, @c reduce() will - * create a custom MPI_Op for the call to MPI_Reduce. - * - * @param comm The communicator over which the reduction will - * occur. - * - * @param in_value The local value to be combined with the local - * values of every other process. For reducing arrays, @c in_values - * contains a pointer to the local values. In this case, @c n is - * the number of values that will be reduced. Reduction occurs - * independently for each of the @p n values referenced by @p - * in_values, e.g., calling reduce on an array of @p n values is - * like calling @c reduce @p n separate times, one for each - * location in @p in_values and @p out_values. - * - * @param out_value Will receive the result of the reduction - * operation, but only for the @p root process. Non-root processes - * may omit if parameter; if they choose to supply the parameter, - * it will be unchanged. For reducing arrays, @c out_values - * contains a pointer to the storage for the output values. - * - * @param op The binary operation that combines two values of type - * @c T into a third value of type @c T. For types @c T that has - * ssociated MPI data types, @c op will either be translated into - * an @c MPI_Op (via @c MPI_Op_create) or, if possible, mapped - * directly to a built-in MPI operation. See @c is_mpi_op in the @c - * operations.hpp header for more details on this mapping. For any - * non-built-in operation, commutativity will be determined by the - * @c is_commmutative trait (also in @c operations.hpp): users are - * encouraged to mark commutative operations as such, because it - * gives the implementation additional lattitude to optimize the - * reduction operation. - * - * @param root The process ID number that will receive the final, - * combined value. This value must be the same on all processes. - */ -template<typename T, typename Op> -void -reduce(const communicator& comm, const T& in_value, T& out_value, Op op, - int root); - -/** - * \overload - */ -template<typename T, typename Op> -void reduce(const communicator& comm, const T& in_value, Op op, int root); - -/** - * \overload - */ -template<typename T, typename Op> -void -reduce(const communicator& comm, const T* in_values, int n, T* out_values, - Op op, int root); - -/** - * \overload - */ -template<typename T, typename Op> -void -reduce(const communicator& comm, const T* in_values, int n, Op op, int root); - -/** - * @brief Compute a prefix reduction of values from all processes in - * the communicator. - * - * @c scan is a collective algorithm that combines the values stored - * by each process with the values of all processes with a smaller - * rank. The values can be arbitrarily combined, specified via a - * function object @p op. The type @c T of the values may be any type - * that is serializable or has an associated MPI data type. One can - * think of this operation as a @c gather to some process, followed - * by an @c std::prefix_sum() over the gathered values using the - * operation @c op. The ith process returns the ith value emitted by - * @c std::prefix_sum(). - * - * When the type @c T has an associated MPI data type, this routine - * invokes @c MPI_Scan to perform the reduction. If possible, - * built-in MPI operations will be used; otherwise, @c scan() will - * create a custom @c MPI_Op for the call to MPI_Scan. - * - * @param comm The communicator over which the prefix reduction - * will occur. - * - * @param in_value The local value to be combined with the local - * values of other processes. For the array variant, the @c - * in_values parameter points to the @c n local values that will be - * combined. - * - * @param out_value If provided, the ith process will receive the - * value @c op(in_value[0], op(in_value[1], op(..., in_value[i]) - * ... )). For the array variant, @c out_values contains a pointer - * to storage for the @c n output values. The prefix reduction - * occurs independently for each of the @p n values referenced by - * @p in_values, e.g., calling scan on an array of @p n values is - * like calling @c scan @p n separate times, one for each location - * in @p in_values and @p out_values. - * - * @param op The binary operation that combines two values of type - * @c T into a third value of type @c T. For types @c T that has - * ssociated MPI data types, @c op will either be translated into - * an @c MPI_Op (via @c MPI_Op_create) or, if possible, mapped - * directly to a built-in MPI operation. See @c is_mpi_op in the @c - * operations.hpp header for more details on this mapping. For any - * non-built-in operation, commutativity will be determined by the - * @c is_commmutative trait (also in @c operations.hpp). - * - * @returns If no @p out_value parameter is provided, returns the - * result of prefix reduction. - */ -template<typename T, typename Op> -void -scan(const communicator& comm, const T& in_value, T& out_value, Op op); - -/** - * \overload - */ -template<typename T, typename Op> -T -scan(const communicator& comm, const T& in_value, Op op); - -/** - * \overload - */ -template<typename T, typename Op> -void -scan(const communicator& comm, const T* in_values, int n, T* out_values, Op op); - -} } // end namespace boost::mpi -#endif // BOOST_MPI_COLLECTIVES_HPP - -#ifndef BOOST_MPI_COLLECTIVES_FORWARD_ONLY -// Include implementations of each of the collectives -# include <boost/mpi/collectives/all_gather.hpp> -# include <boost/mpi/collectives/all_reduce.hpp> -# include <boost/mpi/collectives/all_to_all.hpp> -# include <boost/mpi/collectives/broadcast.hpp> -# include <boost/mpi/collectives/gather.hpp> -# include <boost/mpi/collectives/gatherv.hpp> -# include <boost/mpi/collectives/scatter.hpp> -# include <boost/mpi/collectives/scatterv.hpp> -# include <boost/mpi/collectives/reduce.hpp> -# include <boost/mpi/collectives/scan.hpp> -#endif - diff --git a/contrib/restricted/boost/boost/mpi/collectives/all_gather.hpp b/contrib/restricted/boost/boost/mpi/collectives/all_gather.hpp deleted file mode 100644 index 4adaeb9c87..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/all_gather.hpp +++ /dev/null @@ -1,137 +0,0 @@ -// Copyright (C) 2005, 2006 Douglas Gregor. - -// 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) - -// Message Passing Interface 1.1 -- Section 4.5. Gather -#ifndef BOOST_MPI_ALLGATHER_HPP -#define BOOST_MPI_ALLGATHER_HPP - -#include <cassert> -#include <cstddef> -#include <numeric> -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> -#include <vector> -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> -#include <boost/mpi/detail/point_to_point.hpp> -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/mpi/detail/offsets.hpp> -#include <boost/mpi/detail/antiques.hpp> -#include <boost/assert.hpp> - -namespace boost { namespace mpi { - -namespace detail { -// We're all-gathering for a type that has an associated MPI -// datatype, so we'll use MPI_Gather to do all of the work. -template<typename T> -void -all_gather_impl(const communicator& comm, const T* in_values, int n, - T* out_values, mpl::true_) -{ - MPI_Datatype type = get_mpi_datatype<T>(*in_values); - BOOST_MPI_CHECK_RESULT(MPI_Allgather, - (const_cast<T*>(in_values), n, type, - out_values, n, type, comm)); -} - -// We're all-gathering for a type that does not have an -// associated MPI datatype, so we'll need to serialize -// it. -template<typename T> -void -all_gather_impl(const communicator& comm, const T* in_values, int n, - T* out_values, int const* sizes, int const* skips, mpl::false_) -{ - int nproc = comm.size(); - // first, gather all size, these size can be different for - // each process - packed_oarchive oa(comm); - for (int i = 0; i < n; ++i) { - oa << in_values[i]; - } - std::vector<int> oasizes(nproc); - int oasize = oa.size(); - BOOST_MPI_CHECK_RESULT(MPI_Allgather, - (&oasize, 1, MPI_INTEGER, - c_data(oasizes), 1, MPI_INTEGER, - MPI_Comm(comm))); - // Gather the archives, which can be of different sizes, so - // we need to use allgatherv. - // Every thing is contiguous, so the offsets can be - // deduced from the collected sizes. - std::vector<int> offsets(nproc); - sizes2offsets(oasizes, offsets); - packed_iarchive::buffer_type recv_buffer(std::accumulate(oasizes.begin(), oasizes.end(), 0)); - BOOST_MPI_CHECK_RESULT(MPI_Allgatherv, - (const_cast<void*>(oa.address()), int(oa.size()), MPI_BYTE, - c_data(recv_buffer), c_data(oasizes), c_data(offsets), MPI_BYTE, - MPI_Comm(comm))); - for (int src = 0; src < nproc; ++src) { - int nb = sizes ? sizes[src] : n; - int skip = skips ? skips[src] : 0; - std::advance(out_values, skip); - if (src == comm.rank()) { // this is our local data - for (int i = 0; i < nb; ++i) { - *out_values++ = *in_values++; - } - } else { - packed_iarchive ia(comm, recv_buffer, boost::archive::no_header, offsets[src]); - for (int i = 0; i < nb; ++i) { - ia >> *out_values++; - } - } - } -} - -// We're all-gathering for a type that does not have an -// associated MPI datatype, so we'll need to serialize -// it. -template<typename T> -void -all_gather_impl(const communicator& comm, const T* in_values, int n, - T* out_values, mpl::false_ isnt_mpi_type) -{ - all_gather_impl(comm, in_values, n, out_values, (int const*)0, (int const*)0, isnt_mpi_type); -} -} // end namespace detail - -template<typename T> -void -all_gather(const communicator& comm, const T& in_value, T* out_values) -{ - detail::all_gather_impl(comm, &in_value, 1, out_values, is_mpi_datatype<T>()); -} - -template<typename T> -void -all_gather(const communicator& comm, const T& in_value, std::vector<T>& out_values) -{ - using detail::c_data; - out_values.resize(comm.size()); - ::boost::mpi::all_gather(comm, in_value, c_data(out_values)); -} - -template<typename T> -void -all_gather(const communicator& comm, const T* in_values, int n, T* out_values) -{ - detail::all_gather_impl(comm, in_values, n, out_values, is_mpi_datatype<T>()); -} - -template<typename T> -void -all_gather(const communicator& comm, const T* in_values, int n, std::vector<T>& out_values) -{ - using detail::c_data; - out_values.resize(comm.size() * n); - ::boost::mpi::all_gather(comm, in_values, n, c_data(out_values)); -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_ALL_GATHER_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/all_gatherv.hpp b/contrib/restricted/boost/boost/mpi/collectives/all_gatherv.hpp deleted file mode 100644 index 064412f5d7..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/all_gatherv.hpp +++ /dev/null @@ -1,140 +0,0 @@ -// Copyright (C) 2005, 2006 Douglas Gregor. - -// 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) - -// Message Passing Interface 1.1 -- Section 4.5. Gatherv -#ifndef BOOST_MPI_ALLGATHERV_HPP -#define BOOST_MPI_ALLGATHERV_HPP - -#include <cassert> -#include <cstddef> -#include <numeric> -#include <vector> - -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> -#include <boost/mpi/detail/point_to_point.hpp> -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/mpi/detail/offsets.hpp> -#include <boost/mpi/detail/antiques.hpp> -#include <boost/assert.hpp> -#include <boost/scoped_array.hpp> - -namespace boost { namespace mpi { - -namespace detail { -// We're all-gathering for a type that has an associated MPI -// datatype, so we'll use MPI_Gather to do all of the work. -template<typename T> -void -all_gatherv_impl(const communicator& comm, const T* in_values, - T* out_values, int const* sizes, int const* displs, mpl::true_) -{ - // Make displacements if not provided - scoped_array<int> new_offsets_mem(make_offsets(comm, sizes, displs, -1)); - if (new_offsets_mem) displs = new_offsets_mem.get(); - MPI_Datatype type = get_mpi_datatype<T>(*in_values); - BOOST_MPI_CHECK_RESULT(MPI_Allgatherv, - (const_cast<T*>(in_values), sizes[comm.rank()], type, - out_values, - const_cast<int*>(sizes), - const_cast<int*>(displs), - type, - comm)); -} - -// We're all-gathering for a type that does not have an -// associated MPI datatype, so we'll need to serialize -// it. -template<typename T> -void -all_gatherv_impl(const communicator& comm, const T* in_values, - T* out_values, int const* sizes, int const* displs, - mpl::false_ isnt_mpi_type) -{ - // convert displacement to offsets to skip - scoped_array<int> skipped(make_skipped_slots(comm, sizes, displs)); - all_gather_impl(comm, in_values, sizes[comm.rank()], out_values, - sizes, skipped.get(), isnt_mpi_type); -} -} // end namespace detail - -template<typename T> -void -all_gatherv(const communicator& comm, const T& in_value, T* out_values, - const std::vector<int>& sizes) -{ - using detail::c_data; - assert(sizes.size() == comm.size()); - assert(sizes[comm.rank()] == 1); - detail::all_gatherv_impl(comm, &in_value, out_values, c_data(sizes), 0, is_mpi_datatype<T>()); -} - -template<typename T> -void -all_gatherv(const communicator& comm, const T* in_values, T* out_values, - const std::vector<int>& sizes) -{ - using detail::c_data; - assert(int(sizes.size()) == comm.size()); - detail::all_gatherv_impl(comm, in_values, out_values, c_data(sizes), 0, is_mpi_datatype<T>()); -} - -template<typename T> -void -all_gatherv(const communicator& comm, std::vector<T> const& in_values, std::vector<T>& out_values, - const std::vector<int>& sizes) -{ - using detail::c_data; - assert(int(sizes.size()) == comm.size()); - assert(int(in_values.size()) == sizes[comm.rank()]); - out_values.resize(std::accumulate(sizes.begin(), sizes.end(), 0)); - ::boost::mpi::all_gatherv(comm, c_data(in_values), c_data(out_values), sizes); -} - - -template<typename T> -void -all_gatherv(const communicator& comm, const T& in_value, T* out_values, - const std::vector<int>& sizes, const std::vector<int>& displs) -{ - using detail::c_data; - assert(sizes.size() == comm.size()); - assert(displs.size() == comm.size()); - detail::all_gatherv_impl(comm, &in_value, 1, out_values, - c_data(sizes), c_data(displs), is_mpi_datatype<T>()); -} - -template<typename T> -void -all_gatherv(const communicator& comm, const T* in_values, T* out_values, - const std::vector<int>& sizes, const std::vector<int>& displs) -{ - using detail::c_data; - assert(sizes.size() == comm.size()); - assert(displs.size() == comm.size()); - detail::all_gatherv_impl(comm, in_values, out_values, - c_data(sizes), c_data(displs), is_mpi_datatype<T>()); -} - -template<typename T> -void -all_gatherv(const communicator& comm, std::vector<T> const& in_values, std::vector<T>& out_values, - const std::vector<int>& sizes, const std::vector<int>& displs) -{ - using detail::c_data; - assert(sizes.size() == comm.size()); - assert(displs.size() == comm.size()); - assert(in_values.size() == sizes[comm.rank()]); - out_values.resize(std::accumulate(sizes.begin(), sizes.end(), 0)); - ::boost::mpi::all_gatherv(comm, c_data(in_values), c_data(out_values), sizes, displs); -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_ALL_GATHERV_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/all_reduce.hpp b/contrib/restricted/boost/boost/mpi/collectives/all_reduce.hpp deleted file mode 100644 index 06e116a65e..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/all_reduce.hpp +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor -at- gmail.com> -// Copyright (C) 2004 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 -// Andrew Lumsdaine - -// Message Passing Interface 1.1 -- Section 4.9.1. Reduce -#ifndef BOOST_MPI_ALL_REDUCE_HPP -#define BOOST_MPI_ALL_REDUCE_HPP - -#include <vector> - -#include <boost/mpi/inplace.hpp> - -// All-reduce falls back to reduce() + broadcast() in some cases. -#include <boost/mpi/collectives/broadcast.hpp> -#include <boost/mpi/collectives/reduce.hpp> - -namespace boost { namespace mpi { -namespace detail { - /********************************************************************** - * Simple reduction with MPI_Allreduce * - **********************************************************************/ - // We are reducing for a type that has an associated MPI - // datatype and operation, so we'll use MPI_Allreduce directly. - template<typename T, typename Op> - void - all_reduce_impl(const communicator& comm, const T* in_values, int n, - T* out_values, Op /*op*/, mpl::true_ /*is_mpi_op*/, - mpl::true_ /*is_mpi_datatype*/) - { - BOOST_MPI_CHECK_RESULT(MPI_Allreduce, - (const_cast<T*>(in_values), out_values, n, - boost::mpi::get_mpi_datatype<T>(*in_values), - (is_mpi_op<Op, T>::op()), comm)); - } - - /********************************************************************** - * User-defined reduction with MPI_Allreduce * - **********************************************************************/ - // We are reducing at the root for a type that has an associated MPI - // datatype but with a custom operation. We'll use MPI_Reduce - // directly, but we'll need to create an MPI_Op manually. - template<typename T, typename Op> - void - all_reduce_impl(const communicator& comm, const T* in_values, int n, - T* out_values, Op op, mpl::false_ /*is_mpi_op*/, - mpl::true_ /*is_mpi_datatype*/) - { - user_op<Op, T> mpi_op(op); - BOOST_MPI_CHECK_RESULT(MPI_Allreduce, - (const_cast<T*>(in_values), out_values, n, - boost::mpi::get_mpi_datatype<T>(*in_values), - mpi_op.get_mpi_op(), comm)); - } - - /********************************************************************** - * User-defined, tree-based reduction for non-MPI data types * - **********************************************************************/ - // We are reducing at the root for a type that has no associated MPI - // datatype and operation, so we'll use a simple tree-based - // algorithm. - template<typename T, typename Op> - void - all_reduce_impl(const communicator& comm, const T* in_values, int n, - T* out_values, Op op, mpl::false_ /*is_mpi_op*/, - mpl::false_ /*is_mpi_datatype*/) - { - if (in_values == MPI_IN_PLACE) { - // if in_values matches the in place tag, then the output - // buffer actually contains the input data. - // But we can just go back to the out of place - // implementation in this case. - // it's not clear how/if we can avoid the copy. - std::vector<T> tmp_in( out_values, out_values + n); - reduce(comm, &(tmp_in[0]), n, out_values, op, 0); - } else { - reduce(comm, in_values, n, out_values, op, 0); - } - broadcast(comm, out_values, n, 0); - } -} // end namespace detail - -template<typename T, typename Op> -inline void -all_reduce(const communicator& comm, const T* in_values, int n, T* out_values, - Op op) -{ - detail::all_reduce_impl(comm, in_values, n, out_values, op, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); -} - -template<typename T, typename Op> -inline void -all_reduce(const communicator& comm, inplace_t<T*> inout_values, int n, Op op) -{ - all_reduce(comm, static_cast<const T*>(MPI_IN_PLACE), n, inout_values.buffer, op); -} - -template<typename T, typename Op> -inline void -all_reduce(const communicator& comm, inplace_t<T> inout_values, Op op) -{ - all_reduce(comm, static_cast<const T*>(MPI_IN_PLACE), 1, &(inout_values.buffer), op); -} - -template<typename T, typename Op> -inline void -all_reduce(const communicator& comm, const T& in_value, T& out_value, Op op) -{ - detail::all_reduce_impl(comm, &in_value, 1, &out_value, op, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); -} - -template<typename T, typename Op> -T all_reduce(const communicator& comm, const T& in_value, Op op) -{ - T result; - ::boost::mpi::all_reduce(comm, in_value, result, op); - return result; -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_ALL_REDUCE_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/all_to_all.hpp b/contrib/restricted/boost/boost/mpi/collectives/all_to_all.hpp deleted file mode 100644 index 4f20be73d5..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/all_to_all.hpp +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (C) 2005, 2006 Douglas Gregor. - -// 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) - -// Message Passing Interface 1.1 -- Section 4.8. All-to-all -#ifndef BOOST_MPI_ALL_TO_ALL_HPP -#define BOOST_MPI_ALL_TO_ALL_HPP - -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> -#include <vector> -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/assert.hpp> -#include <boost/mpi/collectives_fwd.hpp> -#include <boost/mpi/allocator.hpp> - -namespace boost { namespace mpi { - -namespace detail { - // We're performing an all-to-all with a type that has an - // associated MPI datatype, so we'll use MPI_Alltoall to do all of - // the work. - template<typename T> - void - all_to_all_impl(const communicator& comm, const T* in_values, int n, - T* out_values, mpl::true_) - { - MPI_Datatype type = get_mpi_datatype<T>(*in_values); - BOOST_MPI_CHECK_RESULT(MPI_Alltoall, - (const_cast<T*>(in_values), n, type, - out_values, n, type, comm)); - } - - // We're performing an all-to-all with a type that does not have an - // associated MPI datatype, so we'll need to serialize - // it. - template<typename T> - void - all_to_all_impl(const communicator& comm, const T* in_values, int n, - T* out_values, mpl::false_) - { - int size = comm.size(); - int rank = comm.rank(); - - // The amount of data to be sent to each process - std::vector<int> send_sizes(size); - - // The displacements for each outgoing value. - std::vector<int> send_disps(size); - - // The buffer that will store all of the outgoing values - std::vector<char, allocator<char> > outgoing; - - // Pack the buffer with all of the outgoing values. - for (int dest = 0; dest < size; ++dest) { - // Keep track of the displacements - send_disps[dest] = outgoing.size(); - - // Our own value will never be transmitted, so don't pack it. - if (dest != rank) { - packed_oarchive oa(comm, outgoing); - for (int i = 0; i < n; ++i) - oa << in_values[dest * n + i]; - } - - // Keep track of the sizes - send_sizes[dest] = outgoing.size() - send_disps[dest]; - } - - // Determine how much data each process will receive. - std::vector<int> recv_sizes(size); - all_to_all(comm, send_sizes, recv_sizes); - - // Prepare a buffer to receive the incoming data. - std::vector<int> recv_disps(size); - int sum = 0; - for (int src = 0; src < size; ++src) { - recv_disps[src] = sum; - sum += recv_sizes[src]; - } - std::vector<char, allocator<char> > incoming(sum > 0? sum : 1); - - // Make sure we don't try to reference an empty vector - if (outgoing.empty()) - outgoing.push_back(0); - - // Transmit the actual data - BOOST_MPI_CHECK_RESULT(MPI_Alltoallv, - (&outgoing[0], &send_sizes[0], - &send_disps[0], MPI_PACKED, - &incoming[0], &recv_sizes[0], - &recv_disps[0], MPI_PACKED, - comm)); - - // Deserialize data from the iarchive - for (int src = 0; src < size; ++src) { - if (src == rank) - std::copy(in_values + src * n, in_values + (src + 1) * n, - out_values + src * n); - else { - packed_iarchive ia(comm, incoming, boost::archive::no_header, - recv_disps[src]); - for (int i = 0; i < n; ++i) - ia >> out_values[src * n + i]; - } - } - } -} // end namespace detail - -template<typename T> -inline void -all_to_all(const communicator& comm, const T* in_values, T* out_values) -{ - detail::all_to_all_impl(comm, in_values, 1, out_values, is_mpi_datatype<T>()); -} - -template<typename T> -void -all_to_all(const communicator& comm, const std::vector<T>& in_values, - std::vector<T>& out_values) -{ - BOOST_ASSERT((int)in_values.size() == comm.size()); - out_values.resize(comm.size()); - ::boost::mpi::all_to_all(comm, &in_values[0], &out_values[0]); -} - -template<typename T> -inline void -all_to_all(const communicator& comm, const T* in_values, int n, T* out_values) -{ - detail::all_to_all_impl(comm, in_values, n, out_values, is_mpi_datatype<T>()); -} - -template<typename T> -void -all_to_all(const communicator& comm, const std::vector<T>& in_values, int n, - std::vector<T>& out_values) -{ - BOOST_ASSERT((int)in_values.size() == comm.size() * n); - out_values.resize(comm.size() * n); - ::boost::mpi::all_to_all(comm, &in_values[0], n, &out_values[0]); -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_ALL_TO_ALL_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/broadcast.hpp b/contrib/restricted/boost/boost/mpi/collectives/broadcast.hpp deleted file mode 100644 index f8b27f0b4f..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/broadcast.hpp +++ /dev/null @@ -1,158 +0,0 @@ -// Copyright (C) 2005, 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -// Message Passing Interface 1.1 -- Section 4.4. Broadcast -#ifndef BOOST_MPI_BROADCAST_HPP -#define BOOST_MPI_BROADCAST_HPP - -#include <boost/mpi/collectives_fwd.hpp> -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/mpi/communicator.hpp> - -namespace boost { namespace mpi { - -/************************************************************************ - * Specializations * - ************************************************************************/ - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL void -broadcast<const packed_oarchive>(const communicator& comm, - const packed_oarchive& oa, - int root); - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL void -broadcast<packed_oarchive>(const communicator& comm, packed_oarchive& oa, - int root); - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL void -broadcast<packed_iarchive>(const communicator& comm, packed_iarchive& ia, - int root); - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL void -broadcast<const packed_skeleton_oarchive>(const communicator& comm, - const packed_skeleton_oarchive& oa, - int root); - -/** - * INTERNAL ONLY - */ -template<> -void -broadcast<packed_skeleton_oarchive>(const communicator& comm, - packed_skeleton_oarchive& oa, int root); - -/** - * INTERNAL ONLY - */ -template<> -void -broadcast<packed_skeleton_iarchive>(const communicator& comm, - packed_skeleton_iarchive& ia, int root); - -/** - * INTERNAL ONLY - */ -template<> -void broadcast<content>(const communicator& comm, content& c, int root); - -/** - * INTERNAL ONLY - */ -template<> -void broadcast<const content>(const communicator& comm, const content& c, - int root); - -/************************************************************************ - * broadcast() implementation * - ************************************************************************/ -namespace detail { - // We're sending a type that has an associated MPI datatype, so - // we'll use MPI_Bcast to do all of the work. - template<typename T> - void - broadcast_impl(const communicator& comm, T* values, int n, int root, - mpl::true_) - { - BOOST_MPI_CHECK_RESULT(MPI_Bcast, - (values, n, - boost::mpi::get_mpi_datatype<T>(*values), - root, MPI_Comm(comm))); - } - - // We're sending a type that does not have an associated MPI - // datatype, so we'll need to serialize it. - template<typename T> - void - broadcast_impl(const communicator& comm, T* values, int n, int root, - mpl::false_ non_mpi_datatype) - { - // Implementation proposed by Lorenz Hübschle-Schneider - if (comm.rank() == root) { - packed_oarchive oa(comm); - for (int i = 0; i < n; ++i) { - oa << values[i]; - } - std::size_t asize = oa.size(); - broadcast(comm, asize, root); - void const* aptr = oa.address(); - BOOST_MPI_CHECK_RESULT(MPI_Bcast, - (const_cast<void*>(aptr), asize, - MPI_BYTE, - root, MPI_Comm(comm))); - } else { - packed_iarchive ia(comm); - std::size_t asize; - broadcast(comm, asize, root); - ia.resize(asize); - void* aptr = ia.address(); - BOOST_MPI_CHECK_RESULT(MPI_Bcast, - (aptr, asize, - MPI_BYTE, - root, MPI_Comm(comm))); - for (int i = 0; i < n; ++i) - ia >> values[i]; - } - } -} // end namespace detail - -template<typename T> -void broadcast(const communicator& comm, T& value, int root) -{ - detail::broadcast_impl(comm, &value, 1, root, is_mpi_datatype<T>()); -} - -template<typename T> -void broadcast(const communicator& comm, T* values, int n, int root) -{ - detail::broadcast_impl(comm, values, n, root, is_mpi_datatype<T>()); -} - -} } // end namespace boost::mpi - -// If the user has already included skeleton_and_content.hpp, include -// the code to broadcast skeletons and content. -#ifdef BOOST_MPI_SKELETON_AND_CONTENT_HPP -# include <boost/mpi/detail/broadcast_sc.hpp> -#endif - -#endif // BOOST_MPI_BROADCAST_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/gather.hpp b/contrib/restricted/boost/boost/mpi/collectives/gather.hpp deleted file mode 100644 index 386bfdd1a1..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/gather.hpp +++ /dev/null @@ -1,176 +0,0 @@ -// Copyright (C) 2005, 2006 Douglas Gregor. - -// 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) - -// Message Passing Interface 1.1 -- Section 4.5. Gather -#ifndef BOOST_MPI_GATHER_HPP -#define BOOST_MPI_GATHER_HPP - -#include <cassert> -#include <cstddef> -#include <numeric> -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> -#include <vector> -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> -#include <boost/mpi/detail/point_to_point.hpp> -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/mpi/detail/offsets.hpp> -#include <boost/mpi/detail/antiques.hpp> -#include <boost/assert.hpp> - -namespace boost { namespace mpi { - -namespace detail { -// We're gathering at the root for a type that has an associated MPI -// datatype, so we'll use MPI_Gather to do all of the work. -template<typename T> -void -gather_impl(const communicator& comm, const T* in_values, int n, - T* out_values, int root, mpl::true_) -{ - MPI_Datatype type = get_mpi_datatype<T>(*in_values); - BOOST_MPI_CHECK_RESULT(MPI_Gather, - (const_cast<T*>(in_values), n, type, - out_values, n, type, root, comm)); -} - -// We're gathering from a non-root for a type that has an associated MPI -// datatype, so we'll use MPI_Gather to do all of the work. -template<typename T> -void -gather_impl(const communicator& comm, const T* in_values, int n, int root, - mpl::true_ is_mpi_type) -{ - assert(comm.rank() != root); - gather_impl(comm, in_values, n, (T*)0, root, is_mpi_type); -} - -// We're gathering at the root for a type that does not have an -// associated MPI datatype, so we'll need to serialize -// it. -template<typename T> -void -gather_impl(const communicator& comm, const T* in_values, int n, T* out_values, - int const* nslot, int const* nskip, int root, mpl::false_) -{ - int nproc = comm.size(); - // first, gather all size, these size can be different for - // each process - packed_oarchive oa(comm); - for (int i = 0; i < n; ++i) { - oa << in_values[i]; - } - bool is_root = comm.rank() == root; - std::vector<int> oasizes(is_root ? nproc : 0); - int oasize = oa.size(); - BOOST_MPI_CHECK_RESULT(MPI_Gather, - (&oasize, 1, MPI_INTEGER, - c_data(oasizes), 1, MPI_INTEGER, - root, MPI_Comm(comm))); - // Gather the archives, which can be of different sizes, so - // we need to use gatherv. - // Everything is contiguous (in the transmitted archive), so - // the offsets can be deduced from the collected sizes. - std::vector<int> offsets; - if (is_root) sizes2offsets(oasizes, offsets); - packed_iarchive::buffer_type recv_buffer(is_root ? std::accumulate(oasizes.begin(), oasizes.end(), 0) : 0); - BOOST_MPI_CHECK_RESULT(MPI_Gatherv, - (const_cast<void*>(oa.address()), int(oa.size()), MPI_BYTE, - c_data(recv_buffer), c_data(oasizes), c_data(offsets), MPI_BYTE, - root, MPI_Comm(comm))); - if (is_root) { - for (int src = 0; src < nproc; ++src) { - // handle variadic case - int nb = nslot ? nslot[src] : n; - int skip = nskip ? nskip[src] : 0; - std::advance(out_values, skip); - if (src == root) { - BOOST_ASSERT(nb == n); - for (int i = 0; i < nb; ++i) { - *out_values++ = *in_values++; - } - } else { - packed_iarchive ia(comm, recv_buffer, boost::archive::no_header, offsets[src]); - for (int i = 0; i < nb; ++i) { - ia >> *out_values++; - } - } - } - } -} - -// We're gathering at a non-root for a type that does not have an -// associated MPI datatype, so we'll need to serialize -// it. -template<typename T> -void -gather_impl(const communicator& comm, const T* in_values, int n, T* out_values,int root, - mpl::false_ is_mpi_type) -{ - gather_impl(comm, in_values, n, out_values, (int const*)0, (int const*)0, root, is_mpi_type); -} -} // end namespace detail - -template<typename T> -void -gather(const communicator& comm, const T& in_value, T* out_values, int root) -{ - BOOST_ASSERT(out_values || (comm.rank() != root)); - detail::gather_impl(comm, &in_value, 1, out_values, root, is_mpi_datatype<T>()); -} - -template<typename T> -void gather(const communicator& comm, const T& in_value, int root) -{ - BOOST_ASSERT(comm.rank() != root); - detail::gather_impl(comm, &in_value, 1, (T*)0, root, is_mpi_datatype<T>()); -} - -template<typename T> -void -gather(const communicator& comm, const T& in_value, std::vector<T>& out_values, - int root) -{ - using detail::c_data; - if (comm.rank() == root) { - out_values.resize(comm.size()); - } - ::boost::mpi::gather(comm, in_value, c_data(out_values), root); -} - -template<typename T> -void -gather(const communicator& comm, const T* in_values, int n, T* out_values, - int root) -{ - detail::gather_impl(comm, in_values, n, out_values, root, - is_mpi_datatype<T>()); -} - -template<typename T> -void -gather(const communicator& comm, const T* in_values, int n, - std::vector<T>& out_values, int root) -{ - if (comm.rank() == root) { - out_values.resize(comm.size() * n); - } - ::boost::mpi::gather(comm, in_values, n, out_values.data(), root); -} - -template<typename T> -void gather(const communicator& comm, const T* in_values, int n, int root) -{ - BOOST_ASSERT(comm.rank() != root); - detail::gather_impl(comm, in_values, n, root, is_mpi_datatype<T>()); -} - - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_GATHER_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/gatherv.hpp b/contrib/restricted/boost/boost/mpi/collectives/gatherv.hpp deleted file mode 100644 index 6b8d706fc6..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/gatherv.hpp +++ /dev/null @@ -1,147 +0,0 @@ -// Copyright (C) 2011 Júlio Hoffimann. - -// 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) - -// Message Passing Interface 1.1 -- Section 4.5. Gatherv -#ifndef BOOST_MPI_GATHERV_HPP -#define BOOST_MPI_GATHERV_HPP - -#include <vector> - -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> -#include <boost/mpi/detail/point_to_point.hpp> -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/mpi/detail/offsets.hpp> -#include <boost/assert.hpp> -#include <boost/scoped_array.hpp> - -namespace boost { namespace mpi { - -namespace detail { - // We're gathering at the root for a type that has an associated MPI - // datatype, so we'll use MPI_Gatherv to do all of the work. - template<typename T> - void - gatherv_impl(const communicator& comm, const T* in_values, int in_size, - T* out_values, const int* sizes, const int* displs, int root, mpl::true_) - { - MPI_Datatype type = get_mpi_datatype<T>(*in_values); - BOOST_MPI_CHECK_RESULT(MPI_Gatherv, - (const_cast<T*>(in_values), in_size, type, - out_values, const_cast<int*>(sizes), const_cast<int*>(displs), - type, root, comm)); - } - - // We're gathering from a non-root for a type that has an associated MPI - // datatype, so we'll use MPI_Gatherv to do all of the work. - template<typename T> - void - gatherv_impl(const communicator& comm, const T* in_values, int in_size, int root, - mpl::true_) - { - MPI_Datatype type = get_mpi_datatype<T>(*in_values); - BOOST_MPI_CHECK_RESULT(MPI_Gatherv, - (const_cast<T*>(in_values), in_size, type, - 0, 0, 0, type, root, comm)); - } - - // We're gathering at the root for a type that does not have an - // associated MPI datatype, so we'll need to serialize - // it. Unfortunately, this means that we cannot use MPI_Gatherv, so - // we'll just have all of the non-root nodes send individual - // messages to the root. - template<typename T> - void - gatherv_impl(const communicator& comm, const T* in_values, int in_size, - T* out_values, const int* sizes, const int* displs, int root, mpl::false_) - { - // convert displacement to offsets to skip - scoped_array<int> skipped(make_skipped_slots(comm, sizes, displs, root)); - gather_impl(comm, in_values, in_size, out_values, sizes, skipped.get(), root, mpl::false_()); - } - - // We're gathering at a non-root for a type that does not have an - // associated MPI datatype, so we'll need to serialize - // it. - template<typename T> - void - gatherv_impl(const communicator& comm, const T* in_values, int in_size, int root, - mpl::false_) - { - gather_impl(comm, in_values, in_size, (T*)0,(int const*)0,(int const*)0, root, - mpl::false_()); - } -} // end namespace detail - -template<typename T> -void -gatherv(const communicator& comm, const T* in_values, int in_size, - T* out_values, const std::vector<int>& sizes, const std::vector<int>& displs, - int root) -{ - if (comm.rank() == root) - detail::gatherv_impl(comm, in_values, in_size, - out_values, &sizes[0], &displs[0], - root, is_mpi_datatype<T>()); - else - detail::gatherv_impl(comm, in_values, in_size, root, is_mpi_datatype<T>()); -} - -template<typename T> -void -gatherv(const communicator& comm, const std::vector<T>& in_values, - T* out_values, const std::vector<int>& sizes, const std::vector<int>& displs, - int root) -{ - ::boost::mpi::gatherv(comm, &in_values[0], in_values.size(), out_values, sizes, displs, root); -} - -template<typename T> -void gatherv(const communicator& comm, const T* in_values, int in_size, int root) -{ - BOOST_ASSERT(comm.rank() != root); - detail::gatherv_impl(comm, in_values, in_size, root, is_mpi_datatype<T>()); -} - -template<typename T> -void gatherv(const communicator& comm, const std::vector<T>& in_values, int root) -{ - BOOST_ASSERT(comm.rank() != root); - detail::gatherv_impl(comm, &in_values[0], in_values.size(), root, is_mpi_datatype<T>()); -} - -/////////////////////// -// common use versions -/////////////////////// -template<typename T> -void -gatherv(const communicator& comm, const T* in_values, int in_size, - T* out_values, const std::vector<int>& sizes, int root) -{ - int nprocs = comm.size(); - - std::vector<int> displs( nprocs ); - for (int rank = 0, aux = 0; rank < nprocs; ++rank) { - displs[rank] = aux; - aux += sizes[rank]; - } - ::boost::mpi::gatherv(comm, in_values, in_size, out_values, sizes, displs, root); -} - -template<typename T> -void -gatherv(const communicator& comm, const std::vector<T>& in_values, - T* out_values, const std::vector<int>& sizes, int root) -{ - ::boost::mpi::gatherv(comm, &in_values[0], in_values.size(), out_values, sizes, root); -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_GATHERV_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/reduce.hpp b/contrib/restricted/boost/boost/mpi/collectives/reduce.hpp deleted file mode 100644 index 1e2722ee6d..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/reduce.hpp +++ /dev/null @@ -1,376 +0,0 @@ -// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor@gmail.com>. -// Copyright (C) 2004 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 -// Andrew Lumsdaine - -// Message Passing Interface 1.1 -- Section 4.9.1. Reduce -#ifndef BOOST_MPI_REDUCE_HPP -#define BOOST_MPI_REDUCE_HPP - -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> - -// For (de-)serializing sends and receives -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> - -// For packed_[io]archive sends and receives -#include <boost/mpi/detail/point_to_point.hpp> - -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/mpi/detail/computation_tree.hpp> -#include <boost/mpi/operations.hpp> -#include <algorithm> -#include <exception> -#include <boost/assert.hpp> -#include <boost/scoped_array.hpp> - -namespace boost { namespace mpi { - - -/************************************************************************ - * Implementation details * - ************************************************************************/ -namespace detail { - /********************************************************************** - * Simple reduction with MPI_Reduce * - **********************************************************************/ - // We are reducing at the root for a type that has an associated MPI - // datatype and operation, so we'll use MPI_Reduce directly. - template<typename T, typename Op> - void - reduce_impl(const communicator& comm, const T* in_values, int n, - T* out_values, Op /*op*/, int root, mpl::true_ /*is_mpi_op*/, - mpl::true_/*is_mpi_datatype*/) - { - BOOST_MPI_CHECK_RESULT(MPI_Reduce, - (const_cast<T*>(in_values), out_values, n, - boost::mpi::get_mpi_datatype<T>(*in_values), - (is_mpi_op<Op, T>::op()), root, comm)); - } - - // We are reducing to the root for a type that has an associated MPI - // datatype and operation, so we'll use MPI_Reduce directly. - template<typename T, typename Op> - void - reduce_impl(const communicator& comm, const T* in_values, int n, Op /*op*/, - int root, mpl::true_ /*is_mpi_op*/, mpl::true_/*is_mpi_datatype*/) - { - BOOST_MPI_CHECK_RESULT(MPI_Reduce, - (const_cast<T*>(in_values), 0, n, - boost::mpi::get_mpi_datatype<T>(*in_values), - (is_mpi_op<Op, T>::op()), root, comm)); - } - - /********************************************************************** - * User-defined reduction with MPI_Reduce * - **********************************************************************/ - - // We are reducing at the root for a type that has an associated MPI - // datatype but with a custom operation. We'll use MPI_Reduce - // directly, but we'll need to create an MPI_Op manually. - template<typename T, typename Op> - void - reduce_impl(const communicator& comm, const T* in_values, int n, - T* out_values, Op op, int root, mpl::false_ /*is_mpi_op*/, - mpl::true_/*is_mpi_datatype*/) - { - user_op<Op, T> mpi_op(op); - BOOST_MPI_CHECK_RESULT(MPI_Reduce, - (const_cast<T*>(in_values), out_values, n, - boost::mpi::get_mpi_datatype<T>(*in_values), - mpi_op.get_mpi_op(), root, comm)); - } - - // We are reducing to the root for a type that has an associated MPI - // datatype but with a custom operation. We'll use MPI_Reduce - // directly, but we'll need to create an MPI_Op manually. - template<typename T, typename Op> - void - reduce_impl(const communicator& comm, const T* in_values, int n, Op op, - int root, mpl::false_/*is_mpi_op*/, mpl::true_/*is_mpi_datatype*/) - { - user_op<Op, T> mpi_op(op); - BOOST_MPI_CHECK_RESULT(MPI_Reduce, - (const_cast<T*>(in_values), 0, n, - boost::mpi::get_mpi_datatype<T>(*in_values), - mpi_op.get_mpi_op(), root, comm)); - } - - /********************************************************************** - * User-defined, tree-based reduction for non-MPI data types * - **********************************************************************/ - - // Commutative reduction - template<typename T, typename Op> - void - tree_reduce_impl(const communicator& comm, const T* in_values, int n, - T* out_values, Op op, int root, - mpl::true_ /*is_commutative*/) - { - std::copy(in_values, in_values + n, out_values); - - int size = comm.size(); - int rank = comm.rank(); - - // The computation tree we will use. - detail::computation_tree tree(rank, size, root); - - int tag = environment::collectives_tag(); - - MPI_Status status; - int children = 0; - for (int child = tree.child_begin(); - children < tree.branching_factor() && child != root; - ++children, child = (child + 1) % size) { - // Receive archive - packed_iarchive ia(comm); - detail::packed_archive_recv(comm, child, tag, ia, status); - - T incoming; - for (int i = 0; i < n; ++i) { - ia >> incoming; - out_values[i] = op(out_values[i], incoming); - } - } - - // For non-roots, send the result to the parent. - if (tree.parent() != rank) { - packed_oarchive oa(comm); - for (int i = 0; i < n; ++i) - oa << out_values[i]; - detail::packed_archive_send(comm, tree.parent(), tag, oa); - } - } - - // Commutative reduction from a non-root. - template<typename T, typename Op> - void - tree_reduce_impl(const communicator& comm, const T* in_values, int n, Op op, - int root, mpl::true_ /*is_commutative*/) - { - scoped_array<T> results(new T[n]); - detail::tree_reduce_impl(comm, in_values, n, results.get(), op, root, - mpl::true_()); - } - - // Non-commutative reduction - template<typename T, typename Op> - void - tree_reduce_impl(const communicator& comm, const T* in_values, int n, - T* out_values, Op op, int root, - mpl::false_ /*is_commutative*/) - { - int tag = environment::collectives_tag(); - - int left_child = root / 2; - int right_child = (root + comm.size()) / 2; - - MPI_Status status; - if (left_child != root) { - // Receive value from the left child and merge it with the value - // we had incoming. - packed_iarchive ia(comm); - detail::packed_archive_recv(comm, left_child, tag, ia, status); - T incoming; - for (int i = 0; i < n; ++i) { - ia >> incoming; - out_values[i] = op(incoming, in_values[i]); - } - } else { - // There was no left value, so copy our incoming value. - std::copy(in_values, in_values + n, out_values); - } - - if (right_child != root) { - // Receive value from the right child and merge it with the - // value we had incoming. - packed_iarchive ia(comm); - detail::packed_archive_recv(comm, right_child, tag, ia, status); - T incoming; - for (int i = 0; i < n; ++i) { - ia >> incoming; - out_values[i] = op(out_values[i], incoming); - } - } - } - - // Non-commutative reduction from a non-root. - template<typename T, typename Op> - void - tree_reduce_impl(const communicator& comm, const T* in_values, int n, Op op, - int root, mpl::false_ /*is_commutative*/) - { - int size = comm.size(); - int rank = comm.rank(); - - int tag = environment::collectives_tag(); - - // Determine our parents and children in the commutative binary - // computation tree. - int grandparent = root; - int parent = root; - int left_bound = 0; - int right_bound = size; - int left_child, right_child; - do { - left_child = (left_bound + parent) / 2; - right_child = (parent + right_bound) / 2; - - if (rank < parent) { - // Go left. - grandparent = parent; - right_bound = parent; - parent = left_child; - } else if (rank > parent) { - // Go right. - grandparent = parent; - left_bound = parent + 1; - parent = right_child; - } else { - // We've found the parent - break; - } - } while (true); - - // Our parent is the grandparent of our children. This is a slight - // abuse of notation, but it makes the send-to-parent below make - // more sense. - parent = grandparent; - - MPI_Status status; - scoped_array<T> out_values(new T[n]); - if (left_child != rank) { - // Receive value from the left child and merge it with the value - // we had incoming. - packed_iarchive ia(comm); - detail::packed_archive_recv(comm, left_child, tag, ia, status); - T incoming; - for (int i = 0; i < n; ++i) { - ia >> incoming; - out_values[i] = op(incoming, in_values[i]); - } - } else { - // There was no left value, so copy our incoming value. - std::copy(in_values, in_values + n, out_values.get()); - } - - if (right_child != rank) { - // Receive value from the right child and merge it with the - // value we had incoming. - packed_iarchive ia(comm); - detail::packed_archive_recv(comm, right_child, tag, ia, status); - T incoming; - for (int i = 0; i < n; ++i) { - ia >> incoming; - out_values[i] = op(out_values[i], incoming); - } - } - - // Send the combined value to our parent. - packed_oarchive oa(comm); - for (int i = 0; i < n; ++i) - oa << out_values[i]; - detail::packed_archive_send(comm, parent, tag, oa); - } - - // We are reducing at the root for a type that has no associated MPI - // datatype and operation, so we'll use a simple tree-based - // algorithm. - template<typename T, typename Op> - void - reduce_impl(const communicator& comm, const T* in_values, int n, - T* out_values, Op op, int root, mpl::false_ /*is_mpi_op*/, - mpl::false_ /*is_mpi_datatype*/) - { - detail::tree_reduce_impl(comm, in_values, n, out_values, op, root, - is_commutative<Op, T>()); - } - - // We are reducing to the root for a type that has no associated MPI - // datatype and operation, so we'll use a simple tree-based - // algorithm. - template<typename T, typename Op> - void - reduce_impl(const communicator& comm, const T* in_values, int n, Op op, - int root, mpl::false_ /*is_mpi_op*/, - mpl::false_ /*is_mpi_datatype*/) - { - detail::tree_reduce_impl(comm, in_values, n, op, root, - is_commutative<Op, T>()); - } -} // end namespace detail - -template<typename T, typename Op> -void -reduce(const communicator& comm, const T* in_values, int n, T* out_values, - Op op, int root) -{ - if (comm.rank() == root) - detail::reduce_impl(comm, in_values, n, out_values, op, root, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); - else - detail::reduce_impl(comm, in_values, n, op, root, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); -} - -template<typename T, typename Op> -void -reduce(const communicator& comm, const T* in_values, int n, Op op, int root) -{ - BOOST_ASSERT(comm.rank() != root); - - detail::reduce_impl(comm, in_values, n, op, root, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); -} - -template<typename T, typename Op> -void -reduce(const communicator & comm, std::vector<T> const & in_values, Op op, - int root) -{ - reduce(comm, &in_values.front(), in_values.size(), op, root); -} - -template<typename T, typename Op> -void -reduce(const communicator & comm, std::vector<T> const & in_values, - std::vector<T> & out_values, Op op, int root) -{ - if (root == comm.rank()) out_values.resize(in_values.size()); - reduce(comm, &in_values.front(), in_values.size(), &out_values.front(), op, - root); -} - - -template<typename T, typename Op> -void -reduce(const communicator& comm, const T& in_value, T& out_value, Op op, - int root) -{ - if (comm.rank() == root) - detail::reduce_impl(comm, &in_value, 1, &out_value, op, root, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); - else - detail::reduce_impl(comm, &in_value, 1, op, root, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); -} - -template<typename T, typename Op> -void reduce(const communicator& comm, const T& in_value, Op op, int root) -{ - BOOST_ASSERT(comm.rank() != root); - - detail::reduce_impl(comm, &in_value, 1, op, root, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_REDUCE_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/scan.hpp b/contrib/restricted/boost/boost/mpi/collectives/scan.hpp deleted file mode 100644 index 9264838ae8..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/scan.hpp +++ /dev/null @@ -1,168 +0,0 @@ -// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor@gmail.com>. -// Copyright (C) 2004 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 -// Andrew Lumsdaine - -// Message Passing Interface 1.1 -- Section 4.9.1. Scan -#ifndef BOOST_MPI_SCAN_HPP -#define BOOST_MPI_SCAN_HPP - -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> - -// For (de-)serializing sends and receives -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> - -// For packed_[io]archive sends and receives -#include <boost/mpi/detail/point_to_point.hpp> - -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/mpi/detail/computation_tree.hpp> -#include <boost/mpi/operations.hpp> -#include <algorithm> -#include <exception> -#include <boost/assert.hpp> - -namespace boost { namespace mpi { - - -/************************************************************************ - * Implementation details * - ************************************************************************/ -namespace detail { - /********************************************************************** - * Simple prefix reduction with MPI_Scan * - **********************************************************************/ - - // We are performing prefix reduction for a type that has an - // associated MPI datatype and operation, so we'll use MPI_Scan - // directly. - template<typename T, typename Op> - void - scan_impl(const communicator& comm, const T* in_values, int n, T* out_values, - Op /*op*/, mpl::true_ /*is_mpi_op*/, mpl::true_ /*is_mpi_datatype*/) - { - BOOST_MPI_CHECK_RESULT(MPI_Scan, - (const_cast<T*>(in_values), out_values, n, - boost::mpi::get_mpi_datatype<T>(*in_values), - (is_mpi_op<Op, T>::op()), comm)); - } - - /********************************************************************** - * User-defined prefix reduction with MPI_Scan * - **********************************************************************/ - - // We are performing prefix reduction for a type that has an - // associated MPI datatype but with a custom operation. We'll use - // MPI_Scan directly, but we'll need to create an MPI_Op manually. - template<typename T, typename Op> - void - scan_impl(const communicator& comm, const T* in_values, int n, T* out_values, - Op op, mpl::false_ /*is_mpi_op*/, mpl::true_ /*is_mpi_datatype*/) - { - user_op<Op, T> mpi_op(op); - BOOST_MPI_CHECK_RESULT(MPI_Scan, - (const_cast<T*>(in_values), out_values, n, - boost::mpi::get_mpi_datatype<T>(*in_values), - mpi_op.get_mpi_op(), comm)); - } - - /********************************************************************** - * User-defined, tree-based reduction for non-MPI data types * - **********************************************************************/ - - template<typename T, typename Op> - void - upper_lower_scan(const communicator& comm, const T* in_values, int n, - T* out_values, Op& op, int lower, int upper) - { - int tag = environment::collectives_tag(); - int rank = comm.rank(); - - if (lower + 1 == upper) { - std::copy(in_values, in_values + n, out_values); - } else { - int middle = (lower + upper) / 2; - - if (rank < middle) { - // Lower half - upper_lower_scan(comm, in_values, n, out_values, op, lower, middle); - - // If we're the last process in the lower half, send our values - // to everyone in the upper half. - if (rank == middle - 1) { - packed_oarchive oa(comm); - for (int i = 0; i < n; ++i) - oa << out_values[i]; - - for (int p = middle; p < upper; ++p) - comm.send(p, tag, oa); - } - } else { - // Upper half - upper_lower_scan(comm, in_values, n, out_values, op, middle, upper); - - // Receive value from the last process in the lower half. - packed_iarchive ia(comm); - comm.recv(middle - 1, tag, ia); - - // Combine value that came from the left with our value - T left_value; - for (int i = 0; i < n; ++i) - { - ia >> left_value; - out_values[i] = op(left_value, out_values[i]); - } - } - } - } - - // We are performing prefix reduction for a type that has no - // associated MPI datatype and operation, so we'll use a simple - // upper/lower algorithm. - template<typename T, typename Op> - inline void - scan_impl(const communicator& comm, const T* in_values, int n, T* out_values, - Op op, mpl::false_ /*is_mpi_op*/, mpl::false_/*is_mpi_datatype*/) - { - upper_lower_scan(comm, in_values, n, out_values, op, 0, comm.size()); - } -} // end namespace detail - - -template<typename T, typename Op> -inline void -scan(const communicator& comm, const T& in_value, T& out_value, Op op) -{ - detail::scan_impl(comm, &in_value, 1, &out_value, op, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); -} - -template<typename T, typename Op> -inline void -scan(const communicator& comm, const T* in_values, int n, T* out_values, Op op) -{ - detail::scan_impl(comm, in_values, n, out_values, op, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); -} - -template<typename T, typename Op> -inline T -scan(const communicator& comm, const T& in_value, Op op) -{ - T out_value; - detail::scan_impl(comm, &in_value, 1, &out_value, op, - is_mpi_op<Op, T>(), is_mpi_datatype<T>()); - return out_value; -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_SCAN_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/scatter.hpp b/contrib/restricted/boost/boost/mpi/collectives/scatter.hpp deleted file mode 100644 index 0c91b1e6aa..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/scatter.hpp +++ /dev/null @@ -1,203 +0,0 @@ -// Copyright (C) 2005, 2006 Douglas Gregor. - -// 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) - -// Message Passing Interface 1.1 -- Section 4.6. Scatter -#ifndef BOOST_MPI_SCATTER_HPP -#define BOOST_MPI_SCATTER_HPP - -#include <boost/mpi/exception.hpp> -#include <boost/mpi/datatype.hpp> -#include <vector> -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> -#include <boost/mpi/detail/point_to_point.hpp> -#include <boost/mpi/communicator.hpp> -#include <boost/mpi/environment.hpp> -#include <boost/mpi/detail/offsets.hpp> -#include <boost/mpi/detail/antiques.hpp> -#include <boost/assert.hpp> - -namespace boost { namespace mpi { - -namespace detail { -// We're scattering from the root for a type that has an associated MPI -// datatype, so we'll use MPI_Scatter to do all of the work. -template<typename T> -void -scatter_impl(const communicator& comm, const T* in_values, T* out_values, - int n, int root, mpl::true_) -{ - MPI_Datatype type = get_mpi_datatype<T>(*in_values); - BOOST_MPI_CHECK_RESULT(MPI_Scatter, - (const_cast<T*>(in_values), n, type, - out_values, n, type, root, comm)); -} - -// We're scattering from a non-root for a type that has an associated MPI -// datatype, so we'll use MPI_Scatter to do all of the work. -template<typename T> -void -scatter_impl(const communicator& comm, T* out_values, int n, int root, - mpl::true_) -{ - MPI_Datatype type = get_mpi_datatype<T>(*out_values); - BOOST_MPI_CHECK_RESULT(MPI_Scatter, - (0, n, type, - out_values, n, type, - root, comm)); -} - -// Fill the sendbuf while keeping trac of the slot's footprints -// Used in the first steps of both scatter and scatterv -// Nslots contains the number of slots being sent -// to each process (identical values for scatter). -// skiped_slots, if present, is deduced from the -// displacement array authorised be the MPI API, -// for some yet to be determined reason. -template<typename T> -void -fill_scatter_sendbuf(const communicator& comm, T const* values, - int const* nslots, int const* skipped_slots, - packed_oarchive::buffer_type& sendbuf, std::vector<int>& archsizes) { - int nproc = comm.size(); - archsizes.resize(nproc); - - for (int dest = 0; dest < nproc; ++dest) { - if (skipped_slots) { // wee need to keep this for backward compatibility - for(int k= 0; k < skipped_slots[dest]; ++k) ++values; - } - packed_oarchive procarchive(comm); - for (int i = 0; i < nslots[dest]; ++i) { - procarchive << *values++; - } - int archsize = procarchive.size(); - sendbuf.resize(sendbuf.size() + archsize); - archsizes[dest] = archsize; - char const* aptr = static_cast<char const*>(procarchive.address()); - std::copy(aptr, aptr+archsize, sendbuf.end()-archsize); - } -} - -template<typename T, class A> -T* -non_const_data(std::vector<T,A> const& v) { - using detail::c_data; - return const_cast<T*>(c_data(v)); -} - -// Dispatch the sendbuf among proc. -// Used in the second steps of both scatter and scatterv -// in_value is only provide in the non variadic case. -template<typename T> -void -dispatch_scatter_sendbuf(const communicator& comm, - packed_oarchive::buffer_type const& sendbuf, std::vector<int> const& archsizes, - T const* in_values, - T* out_values, int n, int root) { - // Distribute the sizes - int myarchsize; - BOOST_MPI_CHECK_RESULT(MPI_Scatter, - (non_const_data(archsizes), 1, MPI_INTEGER, - &myarchsize, 1, MPI_INTEGER, root, comm)); - std::vector<int> offsets; - if (root == comm.rank()) { - sizes2offsets(archsizes, offsets); - } - // Get my proc archive - packed_iarchive::buffer_type recvbuf; - recvbuf.resize(myarchsize); - BOOST_MPI_CHECK_RESULT(MPI_Scatterv, - (non_const_data(sendbuf), non_const_data(archsizes), c_data(offsets), MPI_BYTE, - c_data(recvbuf), recvbuf.size(), MPI_BYTE, - root, MPI_Comm(comm))); - // Unserialize - if ( in_values != 0 && root == comm.rank()) { - // Our own local values are already here: just copy them. - std::copy(in_values + root * n, in_values + (root + 1) * n, out_values); - } else { - // Otherwise deserialize: - packed_iarchive iarchv(comm, recvbuf); - for (int i = 0; i < n; ++i) { - iarchv >> out_values[i]; - } - } -} - -// We're scattering from the root for a type that does not have an -// associated MPI datatype, so we'll need to serialize it. -template<typename T> -void -scatter_impl(const communicator& comm, const T* in_values, T* out_values, - int n, int root, mpl::false_) -{ - packed_oarchive::buffer_type sendbuf; - std::vector<int> archsizes; - - if (root == comm.rank()) { - std::vector<int> nslots(comm.size(), n); - fill_scatter_sendbuf(comm, in_values, c_data(nslots), (int const*)0, sendbuf, archsizes); - } - dispatch_scatter_sendbuf(comm, sendbuf, archsizes, in_values, out_values, n, root); -} - -template<typename T> -void -scatter_impl(const communicator& comm, T* out_values, int n, int root, - mpl::false_ is_mpi_type) -{ - scatter_impl(comm, (T const*)0, out_values, n, root, is_mpi_type); -} -} // end namespace detail - -template<typename T> -void -scatter(const communicator& comm, const T* in_values, T& out_value, int root) -{ - detail::scatter_impl(comm, in_values, &out_value, 1, root, is_mpi_datatype<T>()); -} - -template<typename T> -void -scatter(const communicator& comm, const std::vector<T>& in_values, T& out_value, - int root) -{ - using detail::c_data; - ::boost::mpi::scatter<T>(comm, c_data(in_values), out_value, root); -} - -template<typename T> -void scatter(const communicator& comm, T& out_value, int root) -{ - BOOST_ASSERT(comm.rank() != root); - detail::scatter_impl(comm, &out_value, 1, root, is_mpi_datatype<T>()); -} - -template<typename T> -void -scatter(const communicator& comm, const T* in_values, T* out_values, int n, - int root) -{ - detail::scatter_impl(comm, in_values, out_values, n, root, is_mpi_datatype<T>()); -} - -template<typename T> -void -scatter(const communicator& comm, const std::vector<T>& in_values, - T* out_values, int n, int root) -{ - ::boost::mpi::scatter(comm, &in_values[0], out_values, n, root); -} - -template<typename T> -void scatter(const communicator& comm, T* out_values, int n, int root) -{ - BOOST_ASSERT(comm.rank() != root); - detail::scatter_impl(comm, out_values, n, root, is_mpi_datatype<T>()); -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_SCATTER_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives/scatterv.hpp b/contrib/restricted/boost/boost/mpi/collectives/scatterv.hpp deleted file mode 100644 index 57e073c81f..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives/scatterv.hpp +++ /dev/null @@ -1,167 +0,0 @@ -// Copyright (C) 2011 Júlio Hoffimann. - -// 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) - -// Message Passing Interface 1.1 -- Section 4.6. Scatterv -#ifndef BOOST_MPI_SCATTERV_HPP -#define BOOST_MPI_SCATTERV_HPP - -#include <boost/scoped_array.hpp> -#include <boost/mpi/collectives/scatter.hpp> -#include <boost/mpi/detail/offsets.hpp> -#include <boost/mpi/detail/antiques.hpp> - -namespace boost { namespace mpi { - -namespace detail { - -////////////////////////////////////////////// -/// Implementation for MPI primitive types /// -////////////////////////////////////////////// - -// We're scattering from the root for a type that has an associated MPI -// datatype, so we'll use MPI_Scatterv to do all of the work. -template<typename T> -void -scatterv_impl(const communicator& comm, const T* in_values, T* out_values, int out_size, - const int* sizes, const int* displs, int root, mpl::true_) -{ - assert(!sizes || out_size == sizes[comm.rank()]); - assert(bool(sizes) == bool(in_values)); - - scoped_array<int> new_offsets_mem(make_offsets(comm, sizes, displs, root)); - if (new_offsets_mem) displs = new_offsets_mem.get(); - MPI_Datatype type = get_mpi_datatype<T>(*in_values); - BOOST_MPI_CHECK_RESULT(MPI_Scatterv, - (const_cast<T*>(in_values), const_cast<int*>(sizes), - const_cast<int*>(displs), type, - out_values, out_size, type, root, comm)); -} - -// We're scattering from a non-root for a type that has an associated MPI -// datatype, so we'll use MPI_Scatterv to do all of the work. -template<typename T> -void -scatterv_impl(const communicator& comm, T* out_values, int out_size, int root, - mpl::true_ is_mpi_type) -{ - scatterv_impl(comm, (T const*)0, out_values, out_size, - (const int*)0, (const int*)0, root, is_mpi_type); -} - -////////////////////////////////////////////////// -/// Implementation for non MPI primitive types /// -////////////////////////////////////////////////// - -// We're scattering from the root for a type that does not have an -// associated MPI datatype, so we'll need to serialize it. -template<typename T> -void -scatterv_impl(const communicator& comm, const T* in_values, T* out_values, int out_size, - int const* sizes, int const* displs, int root, mpl::false_) -{ - packed_oarchive::buffer_type sendbuf; - bool is_root = comm.rank() == root; - int nproc = comm.size(); - std::vector<int> archsizes; - if (is_root) { - assert(out_size == sizes[comm.rank()]); - archsizes.resize(nproc); - std::vector<int> skipped; - if (displs) { - skipped.resize(nproc); - offsets2skipped(sizes, displs, c_data(skipped), nproc); - displs = c_data(skipped); - } - fill_scatter_sendbuf(comm, in_values, sizes, (int const*)0, sendbuf, archsizes); - } - dispatch_scatter_sendbuf(comm, sendbuf, archsizes, (T const*)0, out_values, out_size, root); -} - -// We're scattering to a non-root for a type that does not have an -// associated MPI datatype. input data not needed. -// it. -template<typename T> -void -scatterv_impl(const communicator& comm, T* out_values, int n, int root, - mpl::false_ isnt_mpi_type) -{ - assert(root != comm.rank()); - scatterv_impl(comm, (T const*)0, out_values, n, (int const*)0, (int const*)0, root, isnt_mpi_type); -} - -} // end namespace detail - -template<typename T> -void -scatterv(const communicator& comm, const T* in_values, - const std::vector<int>& sizes, const std::vector<int>& displs, - T* out_values, int out_size, int root) -{ - using detail::c_data; - scatterv_impl(comm, in_values, out_values, out_size, c_data(sizes), c_data(displs), - root, is_mpi_datatype<T>()); -} - -template<typename T> -void -scatterv(const communicator& comm, const std::vector<T>& in_values, - const std::vector<int>& sizes, const std::vector<int>& displs, - T* out_values, int out_size, int root) -{ - using detail::c_data; - ::boost::mpi::scatterv(comm, c_data(in_values), sizes, displs, - out_values, out_size, root); -} - -template<typename T> -void scatterv(const communicator& comm, T* out_values, int out_size, int root) -{ - BOOST_ASSERT(comm.rank() != root); - detail::scatterv_impl(comm, out_values, out_size, root, is_mpi_datatype<T>()); -} - -/////////////////////// -// common use versions -/////////////////////// -template<typename T> -void -scatterv(const communicator& comm, const T* in_values, - const std::vector<int>& sizes, T* out_values, int root) -{ - using detail::c_data; - detail::scatterv_impl(comm, in_values, out_values, sizes[comm.rank()], - c_data(sizes), (int const*)0, - root, is_mpi_datatype<T>()); -} - -template<typename T> -void -scatterv(const communicator& comm, const std::vector<T>& in_values, - const std::vector<int>& sizes, T* out_values, int root) -{ - ::boost::mpi::scatterv(comm, &in_values[0], sizes, out_values, root); -} - -template<typename T> -void -scatterv(const communicator& comm, const T* in_values, - T* out_values, int n, int root) -{ - detail::scatterv_impl(comm, in_values, out_values, n, (int const*)0, (int const*)0, - root, is_mpi_datatype<T>()); -} - -template<typename T> -void -scatterv(const communicator& comm, const std::vector<T>& in_values, - T* out_values, int out_size, int root) -{ - ::boost::mpi::scatterv(comm, &in_values[0], out_values, out_size, root); -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_SCATTERV_HPP diff --git a/contrib/restricted/boost/boost/mpi/collectives_fwd.hpp b/contrib/restricted/boost/boost/mpi/collectives_fwd.hpp deleted file mode 100644 index e65392470d..0000000000 --- a/contrib/restricted/boost/boost/mpi/collectives_fwd.hpp +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -// Message Passing Interface 1.1 -- Section 4. MPI Collectives - -/** @file collectives_fwd.hpp - * - * This header provides forward declarations for all of the - * collective operations contained in the header @c collectives.hpp. - */ -#ifndef BOOST_MPI_COLLECTIVES_FWD_HPP -#define BOOST_MPI_COLLECTIVES_FWD_HPP - -/// INTERNAL ONLY -#define BOOST_MPI_COLLECTIVES_FORWARD_ONLY -#include <boost/mpi/collectives.hpp> -#undef BOOST_MPI_COLLECTIVES_FORWARD_ONLY - -#endif // BOOST_MPI_COLLECTIVES_FWD_HPP - diff --git a/contrib/restricted/boost/boost/mpi/communicator.hpp b/contrib/restricted/boost/boost/mpi/communicator.hpp deleted file mode 100644 index af29d1c6ff..0000000000 --- a/contrib/restricted/boost/boost/mpi/communicator.hpp +++ /dev/null @@ -1,1872 +0,0 @@ -// Copyright (C) 2005, 2006 Douglas Gregor <doug.gregor -at- gmail.com>. -// Copyright (C) 2016 K. Noel Belcourt <kbelco -at- sandia.gov>. - -// 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) - -/** @file communicator.hpp - * - * This header defines the @c communicator class, which is the basis - * of all communication within Boost.MPI, and provides point-to-point - * communication operations. - */ -#ifndef BOOST_MPI_COMMUNICATOR_HPP -#define BOOST_MPI_COMMUNICATOR_HPP - -#include <boost/assert.hpp> -#include <boost/mpi/config.hpp> -#include <boost/mpi/exception.hpp> -#include <boost/optional.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/mpi/nonblocking.hpp> -#include <utility> -#include <iterator> -#include <stdexcept> // for std::range_error -#include <vector> - -// For (de-)serializing sends and receives -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> - -// For (de-)serializing skeletons and content -#include <boost/mpi/skeleton_and_content_fwd.hpp> - -// For (de-)serializing arrays -#include <boost/serialization/array.hpp> - -#include <boost/mpi/detail/point_to_point.hpp> -#include <boost/mpi/status.hpp> -#include <boost/mpi/request.hpp> - -#ifdef BOOST_MSVC -# pragma warning(push) -# pragma warning(disable : 4800) // forcing to bool 'true' or 'false' -#endif - -namespace boost { namespace mpi { - -/** - * @brief A constant representing "any process." - * - * This constant may be used for the @c source parameter of @c receive - * operations to indicate that a message may be received from any - * source. - */ -const int any_source = MPI_ANY_SOURCE; - -/** - * @brief A constant representing "any tag." - * - * This constant may be used for the @c tag parameter of @c receive - * operations to indicate that a @c send with any tag will be matched - * by the receive. - */ -const int any_tag = MPI_ANY_TAG; - -/** - * @brief Enumeration used to describe how to adopt a C @c MPI_Comm into - * a Boost.MPI communicator. - * - * The values for this enumeration determine how a Boost.MPI - * communicator will behave when constructed with an MPI - * communicator. The options are: - * - * - @c comm_duplicate: Duplicate the MPI_Comm communicator to - * create a new communicator (e.g., with MPI_Comm_dup). This new - * MPI_Comm communicator will be automatically freed when the - * Boost.MPI communicator (and all copies of it) is destroyed. - * - * - @c comm_take_ownership: Take ownership of the communicator. It - * will be freed automatically when all of the Boost.MPI - * communicators go out of scope. This option must not be used with - * MPI_COMM_WORLD. - * - * - @c comm_attach: The Boost.MPI communicator will reference the - * existing MPI communicator but will not free it when the Boost.MPI - * communicator goes out of scope. This option should only be used - * when the communicator is managed by the user or MPI library - * (e.g., MPI_COMM_WORLD). - */ -enum comm_create_kind { comm_duplicate, comm_take_ownership, comm_attach }; - -/** - * INTERNAL ONLY - * - * Forward declaration of @c group needed for the @c group - * constructor and accessor. - */ -class group; - -/** - * INTERNAL ONLY - * - * Forward declaration of @c intercommunicator needed for the "cast" - * from a communicator to an intercommunicator. - */ -class intercommunicator; - -/** - * INTERNAL ONLY - * - * Forward declaration of @c graph_communicator needed for the "cast" - * from a communicator to a graph communicator. - */ -class graph_communicator; - -/** - * INTERNAL ONLY - * - * Forward declaration of @c cartesian_communicator needed for the "cast" - * from a communicator to a cartesian communicator. - */ -class cartesian_communicator; - -/** - * @brief A communicator that permits communication and - * synchronization among a set of processes. - * - * The @c communicator class abstracts a set of communicating - * processes in MPI. All of the processes that belong to a certain - * communicator can determine the size of the communicator, their rank - * within the communicator, and communicate with any other processes - * in the communicator. - */ -class BOOST_MPI_DECL communicator -{ - public: - /** - * Build a new Boost.MPI communicator for @c MPI_COMM_WORLD. - * - * Constructs a Boost.MPI communicator that attaches to @c - * MPI_COMM_WORLD. This is the equivalent of constructing with - * @c (MPI_COMM_WORLD, comm_attach). - */ - communicator(); - - /** - * Build a new Boost.MPI communicator based on the MPI communicator - * @p comm. - * - * @p comm may be any valid MPI communicator. If @p comm is - * MPI_COMM_NULL, an empty communicator (that cannot be used for - * communication) is created and the @p kind parameter is - * ignored. Otherwise, the @p kind parameters determines how the - * Boost.MPI communicator will be related to @p comm: - * - * - If @p kind is @c comm_duplicate, duplicate @c comm to create - * a new communicator. This new communicator will be freed when - * the Boost.MPI communicator (and all copies of it) is destroyed. - * This option is only permitted if @p comm is a valid MPI - * intracommunicator or if the underlying MPI implementation - * supports MPI 2.0 (which supports duplication of - * intercommunicators). - * - * - If @p kind is @c comm_take_ownership, take ownership of @c - * comm. It will be freed automatically when all of the Boost.MPI - * communicators go out of scope. This option must not be used - * when @c comm is MPI_COMM_WORLD. - * - * - If @p kind is @c comm_attach, this Boost.MPI communicator - * will reference the existing MPI communicator @p comm but will - * not free @p comm when the Boost.MPI communicator goes out of - * scope. This option should only be used when the communicator is - * managed by the user or MPI library (e.g., MPI_COMM_WORLD). - */ - communicator(const MPI_Comm& comm, comm_create_kind kind); - - /** - * Build a new Boost.MPI communicator based on a subgroup of another - * MPI communicator. - * - * This routine will construct a new communicator containing all of - * the processes from communicator @c comm that are listed within - * the group @c subgroup. Equivalent to @c MPI_Comm_create. - * - * @param comm An MPI communicator. - * - * @param subgroup A subgroup of the MPI communicator, @p comm, for - * which we will construct a new communicator. - */ - communicator(const communicator& comm, const boost::mpi::group& subgroup); - - /** - * @brief Determine the rank of the executing process in a - * communicator. - * - * This routine is equivalent to @c MPI_Comm_rank. - * - * @returns The rank of the process in the communicator, which - * will be a value in [0, size()) - */ - int rank() const; - - /** - * @brief Determine the number of processes in a communicator. - * - * This routine is equivalent to @c MPI_Comm_size. - * - * @returns The number of processes in the communicator. - */ - int size() const; - - /** - * This routine constructs a new group whose members are the - * processes within this communicator. Equivalent to - * calling @c MPI_Comm_group. - */ - boost::mpi::group group() const; - - // ---------------------------------------------------------------- - // Point-to-point communication - // ---------------------------------------------------------------- - - /** - * @brief Send data to another process. - * - * This routine executes a potentially blocking send with tag @p tag - * to the process with rank @p dest. It can be received by the - * destination process with a matching @c recv call. - * - * The given @p value must be suitable for transmission over - * MPI. There are several classes of types that meet these - * requirements: - * - * - Types with mappings to MPI data types: If @c - * is_mpi_datatype<T> is convertible to @c mpl::true_, then @p - * value will be transmitted using the MPI data type - * @c get_mpi_datatype<T>(). All primitive C++ data types that have - * MPI equivalents, e.g., @c int, @c float, @c char, @c double, - * etc., have built-in mappings to MPI data types. You may turn a - * Serializable type with fixed structure into an MPI data type by - * specializing @c is_mpi_datatype for your type. - * - * - Serializable types: Any type that provides the @c serialize() - * functionality required by the Boost.Serialization library can be - * transmitted and received. - * - * - Packed archives and skeletons: Data that has been packed into - * an @c mpi::packed_oarchive or the skeletons of data that have - * been backed into an @c mpi::packed_skeleton_oarchive can be - * transmitted, but will be received as @c mpi::packed_iarchive and - * @c mpi::packed_skeleton_iarchive, respectively, to allow the - * values (or skeletons) to be extracted by the destination process. - * - * - Content: Content associated with a previously-transmitted - * skeleton can be transmitted by @c send and received by @c - * recv. The receiving process may only receive content into the - * content of a value that has been constructed with the matching - * skeleton. - * - * For types that have mappings to an MPI data type (including the - * concent of a type), an invocation of this routine will result in - * a single MPI_Send call. For variable-length data, e.g., - * serialized types and packed archives, two messages will be sent - * via MPI_Send: one containing the length of the data and the - * second containing the data itself. Note that the transmission - * mode for variable-length data is an implementation detail that - * is subject to change. - * - * @param dest The rank of the remote process to which the data - * will be sent. - * - * @param tag The tag that will be associated with this message. Tags - * may be any integer between zero and an implementation-defined - * upper limit. This limit is accessible via @c environment::max_tag(). - * - * @param value The value that will be transmitted to the - * receiver. The type @c T of this value must meet the aforementioned - * criteria for transmission. - */ - template<typename T> - void send(int dest, int tag, const T& value) const; - - template<typename T, typename A> - void send(int dest, int tag, const std::vector<T,A>& value) const; - - template<typename T, typename A> - void send_vector(int dest, int tag, const std::vector<T,A>& value, - mpl::true_) const; - - template<typename T, typename A> - void send_vector(int dest, int tag, const std::vector<T,A>& value, - mpl::false_) const; - - /** - * @brief Send the skeleton of an object. - * - * This routine executes a potentially blocking send with tag @p - * tag to the process with rank @p dest. It can be received by the - * destination process with a matching @c recv call. This variation - * on @c send will be used when a send of a skeleton is explicitly - * requested via code such as: - * - * @code - * comm.send(dest, tag, skeleton(object)); - * @endcode - * - * The semantics of this routine are equivalent to that of sending - * a @c packed_skeleton_oarchive storing the skeleton of the @c - * object. - * - * @param dest The rank of the remote process to which the skeleton - * will be sent. - * - * @param tag The tag that will be associated with this message. Tags - * may be any integer between zero and an implementation-defined - * upper limit. This limit is accessible via @c environment::max_tag(). - * - * @param proxy The @c skeleton_proxy containing a reference to the - * object whose skeleton will be transmitted. - * - */ - template<typename T> - void send(int dest, int tag, const skeleton_proxy<T>& proxy) const; - - /** - * @brief Send an array of values to another process. - * - * This routine executes a potentially blocking send of an array of - * data with tag @p tag to the process with rank @p dest. It can be - * received by the destination process with a matching array @c - * recv call. - * - * If @c T is an MPI datatype, an invocation of this routine will - * be mapped to a single call to MPI_Send, using the datatype @c - * get_mpi_datatype<T>(). - * - * @param dest The process rank of the remote process to which - * the data will be sent. - * - * @param tag The tag that will be associated with this message. Tags - * may be any integer between zero and an implementation-defined - * upper limit. This limit is accessible via @c environment::max_tag(). - * - * @param values The array of values that will be transmitted to the - * receiver. The type @c T of these values must be mapped to an MPI - * data type. - * - * @param n The number of values stored in the array. The destination - * process must call receive with at least this many elements to - * correctly receive the message. - */ - template<typename T> - void send(int dest, int tag, const T* values, int n) const; - - /** - * @brief Send a message to another process without any data. - * - * This routine executes a potentially blocking send of a message - * to another process. The message contains no extra data, and can - * therefore only be received by a matching call to @c recv(). - * - * @param dest The process rank of the remote process to which - * the message will be sent. - * - * @param tag The tag that will be associated with this message. Tags - * may be any integer between zero and an implementation-defined - * upper limit. This limit is accessible via @c environment::max_tag(). - * - */ - void send(int dest, int tag) const; - - /** - * @brief Receive data from a remote process. - * - * This routine blocks until it receives a message from the process @p - * source with the given @p tag. The type @c T of the @p value must be - * suitable for transmission over MPI, which includes serializable - * types, types that can be mapped to MPI data types (including most - * built-in C++ types), packed MPI archives, skeletons, and content - * associated with skeletons; see the documentation of @c send for a - * complete description. - * - * @param source The process that will be sending data. This will - * either be a process rank within the communicator or the - * constant @c any_source, indicating that we can receive the - * message from any process. - * - * @param tag The tag that matches a particular kind of message sent - * by the source process. This may be any tag value permitted by @c - * send. Alternatively, the argument may be the constant @c any_tag, - * indicating that this receive matches a message with any tag. - * - * @param value Will contain the value of the message after a - * successful receive. The type of this value must match the value - * transmitted by the sender, unless the sender transmitted a packed - * archive or skeleton: in these cases, the sender transmits a @c - * packed_oarchive or @c packed_skeleton_oarchive and the - * destination receives a @c packed_iarchive or @c - * packed_skeleton_iarchive, respectively. - * - * @returns Information about the received message. - */ - template<typename T> - status recv(int source, int tag, T& value) const; - - template<typename T, typename A> - status recv(int source, int tag, std::vector<T,A>& value) const; - - template<typename T, typename A> - status recv_vector(int source, int tag, std::vector<T,A>& value, - mpl::true_) const; - - template<typename T, typename A> - status recv_vector(int source, int tag, std::vector<T,A>& value, - mpl::false_) const; - - /** - * @brief Receive a skeleton from a remote process. - * - * This routine blocks until it receives a message from the process @p - * source with the given @p tag containing a skeleton. - * - * @param source The process that will be sending data. This will - * either be a process rank within the communicator or the constant - * @c any_source, indicating that we can receive the message from - * any process. - * - * @param tag The tag that matches a particular kind of message - * sent by the source process. This may be any tag value permitted - * by @c send. Alternatively, the argument may be the constant @c - * any_tag, indicating that this receive matches a message with any - * tag. - * - * @param proxy The @c skeleton_proxy containing a reference to the - * object that will be reshaped to match the received skeleton. - * - * @returns Information about the received message. - */ - template<typename T> - status recv(int source, int tag, const skeleton_proxy<T>& proxy) const; - - /** - * @brief Receive a skeleton from a remote process. - * - * This routine blocks until it receives a message from the process @p - * source with the given @p tag containing a skeleton. - * - * @param source The process that will be sending data. This will - * either be a process rank within the communicator or the constant - * @c any_source, indicating that we can receive the message from - * any process. - * - * @param tag The tag that matches a particular kind of message - * sent by the source process. This may be any tag value permitted - * by @c send. Alternatively, the argument may be the constant @c - * any_tag, indicating that this receive matches a message with any - * tag. - * - * @param proxy The @c skeleton_proxy containing a reference to the - * object that will be reshaped to match the received skeleton. - * - * @returns Information about the received message. - */ - template<typename T> - status recv(int source, int tag, skeleton_proxy<T>& proxy) const; - - /** - * @brief Receive an array of values from a remote process. - * - * This routine blocks until it receives an array of values from the - * process @p source with the given @p tag. If the type @c T is - * - * @param source The process that will be sending data. This will - * either be a process rank within the communicator or the - * constant @c any_source, indicating that we can receive the - * message from any process. - * - * @param tag The tag that matches a particular kind of message sent - * by the source process. This may be any tag value permitted by @c - * send. Alternatively, the argument may be the constant @c any_tag, - * indicating that this receive matches a message with any tag. - * - * @param values Will contain the values in the message after a - * successful receive. The type of these elements must match the - * type of the elements transmitted by the sender. - * - * @param n The number of values that can be stored into the @p - * values array. This shall not be smaller than the number of - * elements transmitted by the sender. - * - * @throws std::range_error if the message to be received contains - * more than @p n values. - * - * @returns Information about the received message. - */ - template<typename T> - status recv(int source, int tag, T* values, int n) const; - - /** - * @brief Receive a message from a remote process without any data. - * - * This routine blocks until it receives a message from the process - * @p source with the given @p tag. - * - * @param source The process that will be sending the message. This - * will either be a process rank within the communicator or the - * constant @c any_source, indicating that we can receive the - * message from any process. - * - * @param tag The tag that matches a particular kind of message - * sent by the source process. This may be any tag value permitted - * by @c send. Alternatively, the argument may be the constant @c - * any_tag, indicating that this receive matches a message with any - * tag. - * - * @returns Information about the received message. - */ - status recv(int source, int tag) const; - - /** @brief Send a message to remote process nd receive another message - * from another process. - */ - template<typename T> - status sendrecv(int dest, int stag, const T& sval, int src, int rtag, T& rval) const; - - /** - * @brief Send a message to a remote process without blocking. - * - * The @c isend method is functionality identical to the @c send - * method and transmits data in the same way, except that @c isend - * will not block while waiting for the data to be - * transmitted. Instead, a request object will be immediately - * returned, allowing one to query the status of the communication - * or wait until it has completed. - * - * @param dest The rank of the remote process to which the data - * will be sent. - * - * @param tag The tag that will be associated with this message. Tags - * may be any integer between zero and an implementation-defined - * upper limit. This limit is accessible via @c environment::max_tag(). - * - * @param value The value that will be transmitted to the - * receiver. The type @c T of this value must meet the aforementioned - * criteria for transmission. - * - * @returns a @c request object that describes this communication. - */ - template<typename T> - request isend(int dest, int tag, const T& value) const; - - /** - * @brief Send the skeleton of an object without blocking. - * - * This routine is functionally identical to the @c send method for - * @c skeleton_proxy objects except that @c isend will not block - * while waiting for the data to be transmitted. Instead, a request - * object will be immediately returned, allowing one to query the - * status of the communication or wait until it has completed. - * - * The semantics of this routine are equivalent to a non-blocking - * send of a @c packed_skeleton_oarchive storing the skeleton of - * the @c object. - * - * @param dest The rank of the remote process to which the skeleton - * will be sent. - * - * @param tag The tag that will be associated with this message. Tags - * may be any integer between zero and an implementation-defined - * upper limit. This limit is accessible via @c environment::max_tag(). - * - * @param proxy The @c skeleton_proxy containing a reference to the - * object whose skeleton will be transmitted. - * - * @returns a @c request object that describes this communication. - */ - template<typename T> - request isend(int dest, int tag, const skeleton_proxy<T>& proxy) const; - - /** - * @brief Send an array of values to another process without - * blocking. - * - * This routine is functionally identical to the @c send method for - * arrays except that @c isend will not block while waiting for the - * data to be transmitted. Instead, a request object will be - * immediately returned, allowing one to query the status of the - * communication or wait until it has completed. - * - * @param dest The process rank of the remote process to which - * the data will be sent. - * - * @param tag The tag that will be associated with this message. Tags - * may be any integer between zero and an implementation-defined - * upper limit. This limit is accessible via @c environment::max_tag(). - * - * @param values The array of values that will be transmitted to the - * receiver. The type @c T of these values must be mapped to an MPI - * data type. - * - * @param n The number of values stored in the array. The destination - * process must call receive with at least this many elements to - * correctly receive the message. - * - * @returns a @c request object that describes this communication. - */ - template<typename T> - request isend(int dest, int tag, const T* values, int n) const; - - /** - * @brief Send a message to another process without any data - * without blocking. - * - * This routine is functionally identical to the @c send method for - * sends with no data, except that @c isend will not block while - * waiting for the message to be transmitted. Instead, a request - * object will be immediately returned, allowing one to query the - * status of the communication or wait until it has completed. - * - * @param dest The process rank of the remote process to which - * the message will be sent. - * - * @param tag The tag that will be associated with this message. Tags - * may be any integer between zero and an implementation-defined - * upper limit. This limit is accessible via @c environment::max_tag(). - * - * - * @returns a @c request object that describes this communication. - */ - request isend(int dest, int tag) const; - - /** - * @brief Prepare to receive a message from a remote process. - * - * The @c irecv method is functionally identical to the @c recv - * method and receive data in the same way, except that @c irecv - * will not block while waiting for data to be - * transmitted. Instead, it immediately returns a request object - * that allows one to query the status of the receive or wait until - * it has completed. - * - * @param source The process that will be sending data. This will - * either be a process rank within the communicator or the - * constant @c any_source, indicating that we can receive the - * message from any process. - * - * @param tag The tag that matches a particular kind of message sent - * by the source process. This may be any tag value permitted by @c - * send. Alternatively, the argument may be the constant @c any_tag, - * indicating that this receive matches a message with any tag. - * - * @param value Will contain the value of the message after a - * successful receive. The type of this value must match the value - * transmitted by the sender, unless the sender transmitted a packed - * archive or skeleton: in these cases, the sender transmits a @c - * packed_oarchive or @c packed_skeleton_oarchive and the - * destination receives a @c packed_iarchive or @c - * packed_skeleton_iarchive, respectively. - * - * @returns a @c request object that describes this communication. - */ - template<typename T> - request irecv(int source, int tag, T& value) const; - - /** - * @brief Initiate receipt of an array of values from a remote process. - * - * This routine initiates a receive operation for an array of values - * transmitted by process @p source with the given @p tag. - * - * @param source The process that will be sending data. This will - * either be a process rank within the communicator or the - * constant @c any_source, indicating that we can receive the - * message from any process. - * - * @param tag The tag that matches a particular kind of message sent - * by the source process. This may be any tag value permitted by @c - * send. Alternatively, the argument may be the constant @c any_tag, - * indicating that this receive matches a message with any tag. - * - * @param values Will contain the values in the message after a - * successful receive. The type of these elements must match the - * type of the elements transmitted by the sender. - * - * @param n The number of values that can be stored into the @p - * values array. This shall not be smaller than the number of - * elements transmitted by the sender. - * - * @returns a @c request object that describes this communication. - */ - template<typename T> - request irecv(int source, int tag, T* values, int n) const; - - /** - * @brief Initiate receipt of a message from a remote process that - * carries no data. - * - * This routine initiates a receive operation for a message from - * process @p source with the given @p tag that carries no data. - * - * @param source The process that will be sending the message. This - * will either be a process rank within the communicator or the - * constant @c any_source, indicating that we can receive the - * message from any process. - * - * @param tag The tag that matches a particular kind of message - * sent by the source process. This may be any tag value permitted - * by @c send. Alternatively, the argument may be the constant @c - * any_tag, indicating that this receive matches a message with any - * tag. - * - * @returns a @c request object that describes this communication. - */ - request irecv(int source, int tag) const; - - /** - * @brief Waits until a message is available to be received. - * - * This operation waits until a message matching (@p source, @p tag) - * is available to be received. It then returns information about - * that message. The functionality is equivalent to @c MPI_Probe. To - * check if a message is available without blocking, use @c iprobe. - * - * @param source Determine if there is a message available from - * this rank. If @c any_source, then the message returned may come - * from any source. - * - * @param tag Determine if there is a message available with the - * given tag. If @c any_tag, then the message returned may have any - * tag. - * - * @returns Returns information about the first message that - * matches the given criteria. - */ - status probe(int source = any_source, int tag = any_tag) const; - - /** - * @brief Determine if a message is available to be received. - * - * This operation determines if a message matching (@p source, @p - * tag) is available to be received. If so, it returns information - * about that message; otherwise, it returns immediately with an - * empty optional. The functionality is equivalent to @c - * MPI_Iprobe. To wait until a message is available, use @c wait. - * - * @param source Determine if there is a message available from - * this rank. If @c any_source, then the message returned may come - * from any source. - * - * @param tag Determine if there is a message available with the - * given tag. If @c any_tag, then the message returned may have any - * tag. - * - * @returns If a matching message is available, returns - * information about that message. Otherwise, returns an empty - * @c boost::optional. - */ - optional<status> - iprobe(int source = any_source, int tag = any_tag) const; - -#ifdef barrier - // Linux defines a function-like macro named "barrier". So, we need - // to avoid expanding the macro when we define our barrier() - // function. However, some C++ parsers (Doxygen, for instance) can't - // handle this syntax, so we only use it when necessary. - void (barrier)() const; -#else - /** - * @brief Wait for all processes within a communicator to reach the - * barrier. - * - * This routine is a collective operation that blocks each process - * until all processes have entered it, then releases all of the - * processes "simultaneously". It is equivalent to @c MPI_Barrier. - */ - void barrier() const; -#endif - - /** @brief Determine if this communicator is valid for - * communication. - * - * Evaluates @c true in a boolean context if this communicator is - * valid for communication, i.e., does not represent - * MPI_COMM_NULL. Otherwise, evaluates @c false. - */ - operator bool() const { return (bool)comm_ptr; } - - /** - * @brief Access the MPI communicator associated with a Boost.MPI - * communicator. - * - * This routine permits the implicit conversion from a Boost.MPI - * communicator to an MPI communicator. - * - * @returns The associated MPI communicator. - */ - operator MPI_Comm() const; - - /** - * Split the communicator into multiple, disjoint communicators - * each of which is based on a particular color. This is a - * collective operation that returns a new communicator that is a - * subgroup of @p this. This routine is functionally equivalent to - * @c MPI_Comm_split. - * - * @param color The color of this process. All processes with the - * same @p color value will be placed into the same group. - * - * @returns A new communicator containing all of the processes in - * @p this that have the same @p color. - */ - communicator split(int color) const; - - /** - * Split the communicator into multiple, disjoint communicators - * each of which is based on a particular color. This is a - * collective operation that returns a new communicator that is a - * subgroup of @p this. This routine is functionally equivalent to - * @c MPI_Comm_split. - * - * @param color The color of this process. All processes with the - * same @p color value will be placed into the same group. - * - * @param key A key value that will be used to determine the - * ordering of processes with the same color in the resulting - * communicator. If omitted, the rank of the processes in @p this - * will determine the ordering of processes in the resulting - * group. - * - * @returns A new communicator containing all of the processes in - * @p this that have the same @p color. - */ - communicator split(int color, int key) const; - - /** - * Determine if the communicator is in fact an intercommunicator - * and, if so, return that intercommunicator. - * - * @returns an @c optional containing the intercommunicator, if this - * communicator is in fact an intercommunicator. Otherwise, returns - * an empty @c optional. - */ - optional<intercommunicator> as_intercommunicator() const; - - /** - * Determine if the communicator has a graph topology and, if so, - * return that @c graph_communicator. Even though the communicators - * have different types, they refer to the same underlying - * communication space and can be used interchangeably for - * communication. - * - * @returns an @c optional containing the graph communicator, if this - * communicator does in fact have a graph topology. Otherwise, returns - * an empty @c optional. - */ - optional<graph_communicator> as_graph_communicator() const; - - /** - * Determines whether this communicator has a Graph topology. - */ - bool has_graph_topology() const; - - /** - * Determine if the communicator has a cartesian topology and, if so, - * return that @c cartesian_communicator. Even though the communicators - * have different types, they refer to the same underlying - * communication space and can be used interchangeably for - * communication. - * - * @returns an @c optional containing the cartesian communicator, if this - * communicator does in fact have a cartesian topology. Otherwise, returns - * an empty @c optional. - */ - optional<cartesian_communicator> as_cartesian_communicator() const; - - /** - * Determines whether this communicator has a Cartesian topology. - */ - bool has_cartesian_topology() const; - - /** Abort all tasks in the group of this communicator. - * - * Makes a "best attempt" to abort all of the tasks in the group of - * this communicator. Depending on the underlying MPI - * implementation, this may either abort the entire program (and - * possibly return @p errcode to the environment) or only abort - * some processes, allowing the others to continue. Consult the - * documentation for your MPI implementation. This is equivalent to - * a call to @c MPI_Abort - * - * @param errcode The error code to return from aborted processes. - * @returns Will not return. - */ - void abort(int errcode) const; - - protected: - - /** - * INTERNAL ONLY - * - * Implementation of sendrecv for mpi type. - */ - template<typename T> - status sendrecv_impl(int dest, int stag, const T& sval, int src, int rtag, T& rval, - mpl::true_) const; - - /** - * INTERNAL ONLY - * - * Implementation of sendrecv for complex types, which must be passed as archives. - */ - template<typename T> - status sendrecv_impl(int dest, int stag, const T& sval, int src, int rtag, T& rval, - mpl::false_) const; - - /** - * INTERNAL ONLY - * - * Function object that frees an MPI communicator and deletes the - * memory associated with it. Intended to be used as a deleter with - * shared_ptr. - */ - struct comm_free - { - void operator()(MPI_Comm* comm) const - { - BOOST_ASSERT( comm != 0 ); - BOOST_ASSERT(*comm != MPI_COMM_NULL); - int finalized; - BOOST_MPI_CHECK_RESULT(MPI_Finalized, (&finalized)); - if (!finalized) - BOOST_MPI_CHECK_RESULT(MPI_Comm_free, (comm)); - delete comm; - } - }; - - - /** - * INTERNAL ONLY - * - * We're sending a type that has an associated MPI datatype, so we - * map directly to that datatype. - */ - template<typename T> - void send_impl(int dest, int tag, const T& value, mpl::true_) const; - - /** - * INTERNAL ONLY - * - * We're sending a type that does not have an associated MPI - * datatype, so it must be serialized then sent as MPI_PACKED data, - * to be deserialized on the receiver side. - */ - template<typename T> - void send_impl(int dest, int tag, const T& value, mpl::false_) const; - - /** - * INTERNAL ONLY - * - * We're sending an array of a type that has an associated MPI - * datatype, so we map directly to that datatype. - */ - template<typename T> - void - array_send_impl(int dest, int tag, const T* values, int n, mpl::true_) const; - - /** - * INTERNAL ONLY - * - * We're sending an array of a type that does not have an associated - * MPI datatype, so it must be serialized then sent as MPI_PACKED - * data, to be deserialized on the receiver side. - */ - template<typename T> - void - array_send_impl(int dest, int tag, const T* values, int n, - mpl::false_) const; - - /** - * INTERNAL ONLY - * - * We're sending a type that has an associated MPI datatype, so we - * map directly to that datatype. - */ - template<typename T> - request isend_impl(int dest, int tag, const T& value, mpl::true_) const; - - /** - * INTERNAL ONLY - * - * We're sending a type that does not have an associated MPI - * datatype, so it must be serialized then sent as MPI_PACKED data, - * to be deserialized on the receiver side. - */ - template<typename T> - request isend_impl(int dest, int tag, const T& value, mpl::false_) const; - - /** - * INTERNAL ONLY - * - * We're sending an array of a type that has an associated MPI - * datatype, so we map directly to that datatype. - */ - template<typename T> - request - array_isend_impl(int dest, int tag, const T* values, int n, - mpl::true_) const; - - /** - * INTERNAL ONLY - * - * We're sending an array of a type that does not have an associated - * MPI datatype, so it must be serialized then sent as MPI_PACKED - * data, to be deserialized on the receiver side. - */ - template<typename T> - request - array_isend_impl(int dest, int tag, const T* values, int n, - mpl::false_) const; - - /** - * INTERNAL ONLY - * - * We're receiving a type that has an associated MPI datatype, so we - * map directly to that datatype. - */ - template<typename T> - status recv_impl(int source, int tag, T& value, mpl::true_) const; - - /** - * INTERNAL ONLY - * - * We're receiving a type that does not have an associated MPI - * datatype, so it must have been serialized then sent as - * MPI_PACKED. We'll receive it and then deserialize. - */ - template<typename T> - status recv_impl(int source, int tag, T& value, mpl::false_) const; - - /** - * INTERNAL ONLY - * - * We're receiving an array of a type that has an associated MPI - * datatype, so we map directly to that datatype. - */ - template<typename T> - status - array_recv_impl(int source, int tag, T* values, int n, mpl::true_) const; - - /** - * INTERNAL ONLY - * - * We're receiving a type that does not have an associated MPI - * datatype, so it must have been serialized then sent as - * MPI_PACKED. We'll receive it and then deserialize. - */ - template<typename T> - status - array_recv_impl(int source, int tag, T* values, int n, mpl::false_) const; - - /** - * INTERNAL ONLY - * - * We're receiving a type that has an associated MPI datatype, so we - * map directly to that datatype. - */ - template<typename T> - request irecv_impl(int source, int tag, T& value, mpl::true_) const; - - /** - * INTERNAL ONLY - * - * We're receiving a type that does not have an associated MPI - * datatype, so it must have been serialized then sent as - * MPI_PACKED. We'll receive it and then deserialize. - */ - template<typename T> - request irecv_impl(int source, int tag, T& value, mpl::false_) const; - - /** - * INTERNAL ONLY - * - * We're receiving a type that has an associated MPI datatype, so we - * map directly to that datatype. - */ - template<typename T> - request - array_irecv_impl(int source, int tag, T* values, int n, mpl::true_) const; - - /** - * INTERNAL ONLY - * - * We're receiving a type that does not have an associated MPI - * datatype, so it must have been serialized then sent as - * MPI_PACKED. We'll receive it and then deserialize. - */ - template<typename T> - request - array_irecv_impl(int source, int tag, T* values, int n, mpl::false_) const; - - shared_ptr<MPI_Comm> comm_ptr; -}; - -/** - * @brief Determines whether two communicators are identical. - * - * Equivalent to calling @c MPI_Comm_compare and checking whether the - * result is @c MPI_IDENT. - * - * @returns True when the two communicators refer to the same - * underlying MPI communicator. - */ -BOOST_MPI_DECL bool operator==(const communicator& comm1, const communicator& comm2); - -/** - * @brief Determines whether two communicators are different. - * - * @returns @c !(comm1 == comm2) - */ -inline bool operator!=(const communicator& comm1, const communicator& comm2) -{ - return !(comm1 == comm2); -} - - -/************************************************************************ - * Implementation details * - ************************************************************************/ - -/** - * INTERNAL ONLY (using the same 'end' name might be considerd unfortunate - */ -template<> -BOOST_MPI_DECL void -communicator::send<packed_oarchive>(int dest, int tag, - const packed_oarchive& ar) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL void -communicator::send<packed_skeleton_oarchive> - (int dest, int tag, const packed_skeleton_oarchive& ar) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL void -communicator::send<content>(int dest, int tag, const content& c) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL status -communicator::recv<packed_iarchive>(int source, int tag, - packed_iarchive& ar) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL status -communicator::recv<packed_skeleton_iarchive> - (int source, int tag, packed_skeleton_iarchive& ar) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL status -communicator::recv<const content>(int source, int tag, - const content& c) const; - -/** - * INTERNAL ONLY - */ -template<> -inline status -communicator::recv<content>(int source, int tag, - content& c) const -{ - return recv<const content>(source,tag,c); -} - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL request -communicator::isend<packed_oarchive>(int dest, int tag, - const packed_oarchive& ar) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL request -communicator::isend<packed_skeleton_oarchive> - (int dest, int tag, const packed_skeleton_oarchive& ar) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL request -communicator::isend<content>(int dest, int tag, const content& c) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL request -communicator::irecv<packed_skeleton_iarchive> - (int source, int tag, packed_skeleton_iarchive& ar) const; - -/** - * INTERNAL ONLY - */ -template<> -BOOST_MPI_DECL request -communicator::irecv<const content>(int source, int tag, - const content& c) const; - -/** - * INTERNAL ONLY - */ -template<> -inline request -communicator::irecv<content>(int source, int tag, - content& c) const -{ - return irecv<const content>(source, tag, c); -} - -// Count elements in a message -template<typename T> -inline optional<int> status::count() const -{ - return count_impl<T>(is_mpi_datatype<T>()); -} - -template<typename T> -optional<int> status::count_impl(mpl::true_) const -{ - if (m_count != -1) - return m_count; - - int return_value; - BOOST_MPI_CHECK_RESULT(MPI_Get_count, - (&m_status, get_mpi_datatype<T>(T()), &return_value)); - if (return_value == MPI_UNDEFINED) - return optional<int>(); - else - /* Cache the result. */ - return m_count = return_value; -} - -template<typename T> -inline optional<int> status::count_impl(mpl::false_) const -{ - if (m_count == -1) - return optional<int>(); - else - return m_count; -} - -// We're sending a type that has an associated MPI datatype, so we -// map directly to that datatype. -template<typename T> -void -communicator::send_impl(int dest, int tag, const T& value, mpl::true_) const -{ - BOOST_MPI_CHECK_RESULT(MPI_Send, - (const_cast<T*>(&value), 1, get_mpi_datatype<T>(value), - dest, tag, MPI_Comm(*this))); -} - -// We're sending a type that does not have an associated MPI -// datatype, so it must be serialized then sent as MPI_PACKED data, -// to be deserialized on the receiver side. -template<typename T> -void -communicator::send_impl(int dest, int tag, const T& value, mpl::false_) const -{ - packed_oarchive oa(*this); - oa << value; - send(dest, tag, oa); -} - -// Single-element receive may either send the element directly or -// serialize it via a buffer. -template<typename T> -void communicator::send(int dest, int tag, const T& value) const -{ - this->send_impl(dest, tag, value, is_mpi_datatype<T>()); -} - -// We're sending an array of a type that has an associated MPI -// datatype, so we map directly to that datatype. -template<typename T> -void -communicator::array_send_impl(int dest, int tag, const T* values, int n, - mpl::true_) const -{ - BOOST_MPI_CHECK_RESULT(MPI_Send, - (const_cast<T*>(values), n, - get_mpi_datatype<T>(*values), - dest, tag, MPI_Comm(*this))); -} - -// We're sending an array of a type that does not have an associated -// MPI datatype, so it must be serialized then sent as MPI_PACKED -// data, to be deserialized on the receiver side. -template<typename T> -void -communicator::array_send_impl(int dest, int tag, const T* values, int n, - mpl::false_) const -{ - packed_oarchive oa(*this); - oa << n << boost::serialization::make_array(values, n); - send(dest, tag, oa); -} - -template<typename T, typename A> -void communicator::send_vector(int dest, int tag, - const std::vector<T,A>& value, mpl::true_ true_type) const -{ - // send the vector size - typename std::vector<T,A>::size_type size = value.size(); - send(dest, tag, size); - // send the data - this->array_send_impl(dest, tag, value.data(), size, true_type); -} - -template<typename T, typename A> -void communicator::send_vector(int dest, int tag, - const std::vector<T,A>& value, mpl::false_ false_type) const -{ - this->send_impl(dest, tag, value, false_type); -} - -template<typename T, typename A> -void communicator::send(int dest, int tag, const std::vector<T,A>& value) const -{ - send_vector(dest, tag, value, is_mpi_datatype<T>()); -} - -// Array send must send the elements directly -template<typename T> -void communicator::send(int dest, int tag, const T* values, int n) const -{ - this->array_send_impl(dest, tag, values, n, is_mpi_datatype<T>()); -} - -// We're receiving a type that has an associated MPI datatype, so we -// map directly to that datatype. -template<typename T> -status communicator::recv_impl(int source, int tag, T& value, mpl::true_) const -{ - status stat; - - BOOST_MPI_CHECK_RESULT(MPI_Recv, - (const_cast<T*>(&value), 1, - get_mpi_datatype<T>(value), - source, tag, MPI_Comm(*this), &stat.m_status)); - return stat; -} - -template<typename T> -status -communicator::recv_impl(int source, int tag, T& value, mpl::false_) const -{ - // Receive the message - packed_iarchive ia(*this); - status stat = recv(source, tag, ia); - - // Deserialize the data in the message - ia >> value; - - return stat; -} - -// Single-element receive may either receive the element directly or -// deserialize it from a buffer. -template<typename T> -status communicator::recv(int source, int tag, T& value) const -{ - return this->recv_impl(source, tag, value, is_mpi_datatype<T>()); -} - -template<typename T> -status -communicator::array_recv_impl(int source, int tag, T* values, int n, - mpl::true_) const -{ - status stat; - BOOST_MPI_CHECK_RESULT(MPI_Recv, - (const_cast<T*>(values), n, - get_mpi_datatype<T>(*values), - source, tag, MPI_Comm(*this), &stat.m_status)); - return stat; -} - -template<typename T> -status -communicator::array_recv_impl(int source, int tag, T* values, int n, - mpl::false_) const -{ - // Receive the message - packed_iarchive ia(*this); - status stat = recv(source, tag, ia); - - // Determine how much data we are going to receive - int count; - ia >> count; - - // Deserialize the data in the message - boost::serialization::array_wrapper<T> arr(values, count > n? n : count); - ia >> arr; - - if (count > n) { - boost::throw_exception( - std::range_error("communicator::recv: message receive overflow")); - } - - stat.m_count = count; - return stat; -} - -template<typename T, typename A> -status communicator::recv_vector(int source, int tag, - std::vector<T,A>& value, mpl::true_ true_type) const -{ - // receive the vector size - typename std::vector<T,A>::size_type size = 0; - recv(source, tag, size); - // size the vector - value.resize(size); - // receive the data - return this->array_recv_impl(source, tag, value.data(), size, true_type); -} - -template<typename T, typename A> -status communicator::recv_vector(int source, int tag, - std::vector<T,A>& value, mpl::false_ false_type) const -{ - return this->recv_impl(source, tag, value, false_type); -} - -template<typename T, typename A> -status communicator::recv(int source, int tag, std::vector<T,A>& value) const -{ - return recv_vector(source, tag, value, is_mpi_datatype<T>()); -} - -// Array receive must receive the elements directly into a buffer. -template<typename T> -status communicator::recv(int source, int tag, T* values, int n) const -{ - return this->array_recv_impl(source, tag, values, n, is_mpi_datatype<T>()); -} - - -template<typename T> -status communicator::sendrecv_impl(int dest, int stag, const T& sval, int src, int rtag, T& rval, - mpl::true_) const -{ - status stat; - BOOST_MPI_CHECK_RESULT(MPI_Sendrecv, - (const_cast<T*>(&sval), 1, - get_mpi_datatype<T>(sval), - dest, stag, - &rval, 1, - get_mpi_datatype<T>(rval), - src, rtag, - MPI_Comm(*this), &stat.m_status)); - return stat; -} - -template<typename T> -status communicator::sendrecv_impl(int dest, int stag, const T& sval, int src, int rtag, T& rval, - mpl::false_) const -{ - int const SEND = 0; - int const RECV = 1; - request srrequests[2]; - srrequests[SEND] = this->isend_impl(dest, stag, sval, mpl::false_()); - srrequests[RECV] = this->irecv_impl(src, rtag, rval, mpl::false_()); - status srstatuses[2]; - wait_all(srrequests, srrequests + 2, srstatuses); - return srstatuses[RECV]; -} - -template<typename T> -status communicator::sendrecv(int dest, int stag, const T& sval, int src, int rtag, T& rval) const -{ - return this->sendrecv_impl(dest, stag, sval, src, rtag, rval, is_mpi_datatype<T>()); -} - - -// We're sending a type that has an associated MPI datatype, so we -// map directly to that datatype. -template<typename T> -request -communicator::isend_impl(int dest, int tag, const T& value, mpl::true_) const -{ - request req; - BOOST_MPI_CHECK_RESULT(MPI_Isend, - (const_cast<T*>(&value), 1, - get_mpi_datatype<T>(value), - dest, tag, MPI_Comm(*this), &req.m_requests[0])); - return req; -} - -// We're sending a type that does not have an associated MPI -// datatype, so it must be serialized then sent as MPI_PACKED data, -// to be deserialized on the receiver side. -template<typename T> -request -communicator::isend_impl(int dest, int tag, const T& value, mpl::false_) const -{ - shared_ptr<packed_oarchive> archive(new packed_oarchive(*this)); - *archive << value; - request result = isend(dest, tag, *archive); - result.m_data = archive; - return result; -} - -// Single-element receive may either send the element directly or -// serialize it via a buffer. -template<typename T> -request communicator::isend(int dest, int tag, const T& value) const -{ - return this->isend_impl(dest, tag, value, is_mpi_datatype<T>()); -} - -template<typename T> -request -communicator::array_isend_impl(int dest, int tag, const T* values, int n, - mpl::true_) const -{ - request req; - BOOST_MPI_CHECK_RESULT(MPI_Isend, - (const_cast<T*>(values), n, - get_mpi_datatype<T>(*values), - dest, tag, MPI_Comm(*this), &req.m_requests[0])); - return req; -} - -template<typename T> -request -communicator::array_isend_impl(int dest, int tag, const T* values, int n, - mpl::false_) const -{ - shared_ptr<packed_oarchive> archive(new packed_oarchive(*this)); - *archive << n << boost::serialization::make_array(values, n); - request result = isend(dest, tag, *archive); - result.m_data = archive; - return result; -} - - -// Array isend must send the elements directly -template<typename T> -request communicator::isend(int dest, int tag, const T* values, int n) const -{ - return array_isend_impl(dest, tag, values, n, is_mpi_datatype<T>()); -} - -namespace detail { - /** - * Internal data structure that stores everything required to manage - * the receipt of serialized data via a request object. - */ - template<typename T> - struct serialized_irecv_data - { - serialized_irecv_data(const communicator& comm, int source, int tag, - T& value) - : comm(comm), source(source), tag(tag), ia(comm), value(value) - { - } - - void deserialize(status& stat) - { - ia >> value; - stat.m_count = 1; - } - - communicator comm; - int source; - int tag; - std::size_t count; - packed_iarchive ia; - T& value; - }; - - template<> - struct serialized_irecv_data<packed_iarchive> - { - serialized_irecv_data(const communicator& comm, int source, int tag, - packed_iarchive& ia) - : comm(comm), source(source), tag(tag), ia(ia) { } - - void deserialize(status&) { /* Do nothing. */ } - - communicator comm; - int source; - int tag; - std::size_t count; - packed_iarchive& ia; - }; - - /** - * Internal data structure that stores everything required to manage - * the receipt of an array of serialized data via a request object. - */ - template<typename T> - struct serialized_array_irecv_data - { - serialized_array_irecv_data(const communicator& comm, int source, int tag, - T* values, int n) - : comm(comm), source(source), tag(tag), ia(comm), values(values), n(n) - { - } - - void deserialize(status& stat); - - communicator comm; - int source; - int tag; - std::size_t count; - packed_iarchive ia; - T* values; - int n; - }; - - template<typename T> - void serialized_array_irecv_data<T>::deserialize(status& stat) - { - // Determine how much data we are going to receive - int count; - ia >> count; - - // Deserialize the data in the message - boost::serialization::array_wrapper<T> arr(values, count > n? n : count); - ia >> arr; - - if (count > n) { - boost::throw_exception( - std::range_error("communicator::recv: message receive overflow")); - } - - stat.m_count = count; - } -} - -template<typename T> -optional<status> -request::handle_serialized_irecv(request* self, request_action action) -{ - typedef detail::serialized_irecv_data<T> data_t; - shared_ptr<data_t> data = static_pointer_cast<data_t>(self->m_data); - - if (action == ra_wait) { - status stat; - if (self->m_requests[1] == MPI_REQUEST_NULL) { - // Wait for the count message to complete - BOOST_MPI_CHECK_RESULT(MPI_Wait, - (self->m_requests, &stat.m_status)); - // Resize our buffer and get ready to receive its data - data->ia.resize(data->count); - BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (data->ia.address(), data->ia.size(), MPI_PACKED, - stat.source(), stat.tag(), - MPI_Comm(data->comm), self->m_requests + 1)); - } - - // Wait until we have received the entire message - BOOST_MPI_CHECK_RESULT(MPI_Wait, - (self->m_requests + 1, &stat.m_status)); - - data->deserialize(stat); - return stat; - } else if (action == ra_test) { - status stat; - int flag = 0; - - if (self->m_requests[1] == MPI_REQUEST_NULL) { - // Check if the count message has completed - BOOST_MPI_CHECK_RESULT(MPI_Test, - (self->m_requests, &flag, &stat.m_status)); - if (flag) { - // Resize our buffer and get ready to receive its data - data->ia.resize(data->count); - BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (data->ia.address(), data->ia.size(),MPI_PACKED, - stat.source(), stat.tag(), - MPI_Comm(data->comm), self->m_requests + 1)); - } else - return optional<status>(); // We have not finished yet - } - - // Check if we have received the message data - BOOST_MPI_CHECK_RESULT(MPI_Test, - (self->m_requests + 1, &flag, &stat.m_status)); - if (flag) { - data->deserialize(stat); - return stat; - } else - return optional<status>(); - } else { - return optional<status>(); - } -} - -template<typename T> -optional<status> -request::handle_serialized_array_irecv(request* self, request_action action) -{ - typedef detail::serialized_array_irecv_data<T> data_t; - shared_ptr<data_t> data = static_pointer_cast<data_t>(self->m_data); - - if (action == ra_wait) { - status stat; - if (self->m_requests[1] == MPI_REQUEST_NULL) { - // Wait for the count message to complete - BOOST_MPI_CHECK_RESULT(MPI_Wait, - (self->m_requests, &stat.m_status)); - // Resize our buffer and get ready to receive its data - data->ia.resize(data->count); - BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (data->ia.address(), data->ia.size(), MPI_PACKED, - stat.source(), stat.tag(), - MPI_Comm(data->comm), self->m_requests + 1)); - } - - // Wait until we have received the entire message - BOOST_MPI_CHECK_RESULT(MPI_Wait, - (self->m_requests + 1, &stat.m_status)); - - data->deserialize(stat); - return stat; - } else if (action == ra_test) { - status stat; - int flag = 0; - - if (self->m_requests[1] == MPI_REQUEST_NULL) { - // Check if the count message has completed - BOOST_MPI_CHECK_RESULT(MPI_Test, - (self->m_requests, &flag, &stat.m_status)); - if (flag) { - // Resize our buffer and get ready to receive its data - data->ia.resize(data->count); - BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (data->ia.address(), data->ia.size(),MPI_PACKED, - stat.source(), stat.tag(), - MPI_Comm(data->comm), self->m_requests + 1)); - } else - return optional<status>(); // We have not finished yet - } - - // Check if we have received the message data - BOOST_MPI_CHECK_RESULT(MPI_Test, - (self->m_requests + 1, &flag, &stat.m_status)); - if (flag) { - data->deserialize(stat); - return stat; - } else - return optional<status>(); - } else { - return optional<status>(); - } -} - -// We're receiving a type that has an associated MPI datatype, so we -// map directly to that datatype. -template<typename T> -request -communicator::irecv_impl(int source, int tag, T& value, mpl::true_) const -{ - request req; - BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (const_cast<T*>(&value), 1, - get_mpi_datatype<T>(value), - source, tag, MPI_Comm(*this), &req.m_requests[0])); - return req; -} - -template<typename T> -request -communicator::irecv_impl(int source, int tag, T& value, mpl::false_) const -{ - typedef detail::serialized_irecv_data<T> data_t; - shared_ptr<data_t> data(new data_t(*this, source, tag, value)); - request req; - req.m_data = data; - req.m_handler = request::handle_serialized_irecv<T>; - - BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (&data->count, 1, - get_mpi_datatype<std::size_t>(data->count), - source, tag, MPI_Comm(*this), &req.m_requests[0])); - - return req; -} - -template<typename T> -request -communicator::irecv(int source, int tag, T& value) const -{ - return this->irecv_impl(source, tag, value, is_mpi_datatype<T>()); -} - -template<typename T> -request -communicator::array_irecv_impl(int source, int tag, T* values, int n, - mpl::true_) const -{ - request req; - BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (const_cast<T*>(values), n, - get_mpi_datatype<T>(*values), - source, tag, MPI_Comm(*this), &req.m_requests[0])); - return req; -} - -template<typename T> -request -communicator::array_irecv_impl(int source, int tag, T* values, int n, - mpl::false_) const -{ - typedef detail::serialized_array_irecv_data<T> data_t; - shared_ptr<data_t> data(new data_t(*this, source, tag, values, n)); - request req; - req.m_data = data; - req.m_handler = request::handle_serialized_array_irecv<T>; - - BOOST_MPI_CHECK_RESULT(MPI_Irecv, - (&data->count, 1, - get_mpi_datatype<std::size_t>(data->count), - source, tag, MPI_Comm(*this), &req.m_requests[0])); - - return req; -} - - -// Array receive must receive the elements directly into a buffer. -template<typename T> -request communicator::irecv(int source, int tag, T* values, int n) const -{ - return this->array_irecv_impl(source, tag, values, n, is_mpi_datatype<T>()); -} - -} } // end namespace boost::mpi - -// If the user has already included skeleton_and_content.hpp, include -// the code to send/receive skeletons and content. -#ifdef BOOST_MPI_SKELETON_AND_CONTENT_HPP -# include <boost/mpi/detail/communicator_sc.hpp> -#endif - -#ifdef BOOST_MSVC -# pragma warning(pop) -#endif - -#endif // BOOST_MPI_COMMUNICATOR_HPP diff --git a/contrib/restricted/boost/boost/mpi/config.hpp b/contrib/restricted/boost/boost/mpi/config.hpp deleted file mode 100644 index c83277f66b..0000000000 --- a/contrib/restricted/boost/boost/mpi/config.hpp +++ /dev/null @@ -1,129 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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) - -/** @file config.hpp - * - * This header provides MPI configuration details that expose the - * capabilities of the underlying MPI implementation, and provides - * auto-linking support on Windows. - */ -#ifndef BOOST_MPI_CONFIG_HPP -#define BOOST_MPI_CONFIG_HPP - -/* Force MPICH not to define SEEK_SET, SEEK_CUR, and SEEK_END, which - conflict with the versions in <stdio.h> and <cstdio>. */ -#define MPICH_IGNORE_CXX_SEEK 1 - -#include <mpi.h> -#include <boost/config.hpp> - -/** @brief Comment this macro is you are running in an heterogeneous environment. - * - * When this flag is enabled, we assume some simple, POD-like, type can be - * transmitted without paying the cost of portable serialization. - * - * Comment this if your platform is not homogeneous and that portable - * serialization/deserialization must be performed. - * - * It you do so, check that your MPI implementation supports thats kind of environment. - */ -#define BOOST_MPI_HOMOGENEOUS - -// If this is an MPI-2 implementation, define configuration macros for -// the features we are interested in. -#if defined(MPI_VERSION) && MPI_VERSION >= 2 -/** @brief Determine if the MPI implementation has support for memory - * allocation. - * - * This macro will be defined when the underlying MPI implementation - * has support for the MPI-2 memory allocation routines @c - * MPI_Alloc_mem and @c MPI_Free_mem. When defined, the @c allocator - * class template will provide Standard Library-compliant access to - * these memory-allocation routines. - */ -# define BOOST_MPI_HAS_MEMORY_ALLOCATION - -/** @brief Determine if the MPI implementation has supports initialization - * without command-line arguments. - * - * This macro will be defined when the underlying implementation - * supports initialization of MPI without passing along command-line - * arguments, e.g., @c MPI_Init(NULL, NULL). When defined, the @c - * environment class will provide a default constructor. This macro is - * always defined for MPI-2 implementations. */ -# define BOOST_MPI_HAS_NOARG_INITIALIZATION -#else -// If this is an MPI-1.x implementation, no arg initialization for -// mpi environment could still be available, but not mandatory. -// Undef this if no arg init is available: -//# define BOOST_MPI_HAS_NOARG_INITIALIZATION -#endif - -#if defined(MPIAPI) -# define BOOST_MPI_CALLING_CONVENTION MPIAPI -#else -/** @brief Specifies the calling convention that will be used for callbacks - * from the underlying C MPI. - * - * This is a Windows-specific macro, which will be used internally to state - * the calling convention of any function that is to be used as a callback - * from MPI. For example, the internally-defined functions that are used in - * a call to @c MPI_Op_create. This macro is likely only to be useful to - * users that wish to bypass Boost.MPI, registering their own callbacks in - * certain cases, e.g., through @c MPI_Op_create. - */ -# define BOOST_MPI_CALLING_CONVENTION -#endif - -/** @brief Indicates that MPI_Bcast supports MPI_BOTTOM. - * - * Some implementations have a broken MPI_Bcast wrt to MPI_BOTTOM. - * BullX MPI and LAM seems to be among them, at least for some versions. - * The `broacast_test.cpp` test `test_skeleton_and_content` can be used to - * detect that. - */ -#define BOOST_MPI_BCAST_BOTTOM_WORKS_FINE - -#if defined(LAM_MPI) -// Configuration for LAM/MPI -# define BOOST_MPI_HAS_MEMORY_ALLOCATION -# define BOOST_MPI_HAS_NOARG_INITIALIZATION -# undef BOOST_MPI_BCAST_BOTTOM_WORKS_FINE -#elif defined(MPICH_NAME) -// Configuration for MPICH -#endif - -/***************************************************************************** - * * - * DLL import/export options * - * * - *****************************************************************************/ - -#if (defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_MPI_STATIC_LINK) -# if defined(BOOST_MPI_SOURCE) -# define BOOST_MPI_DECL BOOST_SYMBOL_EXPORT -# define BOOST_MPI_BUILD_DLL -# else -# define BOOST_MPI_DECL BOOST_SYMBOL_IMPORT -# endif -#endif - -#ifndef BOOST_MPI_DECL -# define BOOST_MPI_DECL -#endif - -#if !defined(BOOST_MPI_NO_LIB) && !defined(BOOST_MPI_SOURCE) && !defined(BOOST_ALL_NO_LIB) && defined(__cplusplus) -# define BOOST_LIB_NAME boost_mpi -# if defined(BOOST_MPI_DYN_LINK) || defined(BOOST_ALL_DYN_LINK) -# define BOOST_DYN_LINK -# endif -# ifdef BOOST_MPI_DIAG -# define BOOST_LIB_DIAGNOSTIC -# endif -# include <boost/config/auto_link.hpp> -#endif - -#endif // BOOST_MPI_CONFIG_HPP diff --git a/contrib/restricted/boost/boost/mpi/datatype.hpp b/contrib/restricted/boost/boost/mpi/datatype.hpp deleted file mode 100644 index 1f069977d0..0000000000 --- a/contrib/restricted/boost/boost/mpi/datatype.hpp +++ /dev/null @@ -1,374 +0,0 @@ -// Copyright 2004 The Trustees of Indiana University. -// Copyright 2005 Matthias Troyer. -// Copyright 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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 -// Andrew Lumsdaine -// Matthias Troyer - -/** @file datatype.hpp - * - * This header provides the mapping from C++ types to MPI data types. - */ -#ifndef BOOST_MPI_DATATYPE_HPP -#define BOOST_MPI_DATATYPE_HPP - -#include <boost/mpi/config.hpp> -#include <boost/mpi/datatype_fwd.hpp> -#include <mpi.h> -#include <boost/config.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/or.hpp> -#include <boost/mpl/and.hpp> -#include <boost/mpi/detail/mpi_datatype_cache.hpp> -#include <boost/mpl/assert.hpp> -#include <boost/archive/basic_archive.hpp> -#include <boost/serialization/item_version_type.hpp> -#include <utility> // for std::pair - -#if defined(__cplusplus) && (201103L <= __cplusplus) -#include <array> -#endif - -namespace boost { namespace mpi { - -/** - * @brief Type trait that determines if there exists a built-in - * integer MPI data type for a given C++ type. - * - * This type trait determines when there is a direct mapping from a - * C++ type to an MPI data type that is classified as an integer data - * type. See @c is_mpi_builtin_datatype for general information about - * built-in MPI data types. - */ -template<typename T> -struct is_mpi_integer_datatype - : public boost::mpl::false_ { }; - -/** - * @brief Type trait that determines if there exists a built-in - * floating point MPI data type for a given C++ type. - * - * This type trait determines when there is a direct mapping from a - * C++ type to an MPI data type that is classified as a floating - * point data type. See @c is_mpi_builtin_datatype for general - * information about built-in MPI data types. - */ -template<typename T> -struct is_mpi_floating_point_datatype - : public boost::mpl::false_ { }; - -/** - * @brief Type trait that determines if there exists a built-in - * logical MPI data type for a given C++ type. - * - * This type trait determines when there is a direct mapping from a - * C++ type to an MPI data type that is classified as an logical data - * type. See @c is_mpi_builtin_datatype for general information about - * built-in MPI data types. - */ -template<typename T> -struct is_mpi_logical_datatype - : public boost::mpl::false_ { }; - -/** - * @brief Type trait that determines if there exists a built-in - * complex MPI data type for a given C++ type. - * - * This type trait determines when there is a direct mapping from a - * C++ type to an MPI data type that is classified as an complex data - * type. See @c is_mpi_builtin_datatype for general information about - * built-in MPI data types. - */ -template<typename T> -struct is_mpi_complex_datatype - : public boost::mpl::false_ { }; - -/** - * @brief Type trait that determines if there exists a built-in - * byte MPI data type for a given C++ type. - * - * This type trait determines when there is a direct mapping from a - * C++ type to an MPI data type that is classified as an byte data - * type. See @c is_mpi_builtin_datatype for general information about - * built-in MPI data types. - */ -template<typename T> -struct is_mpi_byte_datatype - : public boost::mpl::false_ { }; - -/** @brief Type trait that determines if there exists a built-in MPI - * data type for a given C++ type. - * - * This type trait determines when there is a direct mapping from a - * C++ type to an MPI type. For instance, the C++ @c int type maps - * directly to the MPI type @c MPI_INT. When there is a direct - * mapping from the type @c T to an MPI type, @c - * is_mpi_builtin_datatype will derive from @c mpl::true_ and the MPI - * data type will be accessible via @c get_mpi_datatype. - * - * In general, users should not need to specialize this - * trait. However, if you have an additional C++ type that can map - * directly to only of MPI's built-in types, specialize either this - * trait or one of the traits corresponding to categories of MPI data - * types (@c is_mpi_integer_datatype, @c - * is_mpi_floating_point_datatype, @c is_mpi_logical_datatype, @c - * is_mpi_complex_datatype, or @c is_mpi_builtin_datatype). @c - * is_mpi_builtin_datatype derives @c mpl::true_ if any of the traits - * corresponding to MPI data type categories derived @c mpl::true_. - */ -template<typename T> -struct is_mpi_builtin_datatype - : boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_floating_point_datatype<T>, - is_mpi_logical_datatype<T>, - is_mpi_complex_datatype<T>, - is_mpi_byte_datatype<T> > -{ -}; - -/** @brief Type trait that determines if a C++ type can be mapped to - * an MPI data type. - * - * This type trait determines if it is possible to build an MPI data - * type that represents a C++ data type. When this is the case, @c - * is_mpi_datatype derives @c mpl::true_ and the MPI data type will - * be accessible via @c get_mpi_datatype. - - * For any C++ type that maps to a built-in MPI data type (see @c - * is_mpi_builtin_datatype), @c is_mpi_data_type is trivially - * true. However, any POD ("Plain Old Data") type containing types - * that themselves can be represented by MPI data types can itself be - * represented as an MPI data type. For instance, a @c point3d class - * containing three @c double values can be represented as an MPI - * data type. To do so, first make the data type Serializable (using - * the Boost.Serialization library); then, specialize the @c - * is_mpi_datatype trait for the point type so that it will derive @c - * mpl::true_: - * - * @code - * namespace boost { namespace mpi { - * template<> struct is_mpi_datatype<point> - * : public mpl::true_ { }; - * } } - * @endcode - */ -template<typename T> -struct is_mpi_datatype - : public is_mpi_builtin_datatype<T> -{ -}; - -/** @brief Returns an MPI data type for a C++ type. - * - * The function creates an MPI data type for the given object @c - * x. The first time it is called for a class @c T, the MPI data type - * is created and cached. Subsequent calls for objects of the same - * type @c T return the cached MPI data type. The type @c T must - * allow creation of an MPI data type. That is, it must be - * Serializable and @c is_mpi_datatype<T> must derive @c mpl::true_. - * - * For fundamental MPI types, a copy of the MPI data type of the MPI - * library is returned. - * - * Note that since the data types are cached, the caller should never - * call @c MPI_Type_free() for the MPI data type returned by this - * call. - * - * @param x for an optimized call, a constructed object of the type - * should be passed; otherwise, an object will be - * default-constructed. - * - * @returns The MPI data type corresponding to type @c T. - */ -template<typename T> MPI_Datatype get_mpi_datatype(const T& x) -{ - BOOST_MPL_ASSERT((is_mpi_datatype<T>)); - return detail::mpi_datatype_cache().datatype(x); -} - -// Don't parse this part when we're generating Doxygen documentation. -#ifndef BOOST_MPI_DOXYGEN - -/// INTERNAL ONLY -#define BOOST_MPI_DATATYPE(CppType, MPIType, Kind) \ -template<> \ -inline MPI_Datatype \ -get_mpi_datatype< CppType >(const CppType&) { return MPIType; } \ - \ -template<> \ - struct BOOST_JOIN(is_mpi_,BOOST_JOIN(Kind,_datatype))< CppType > \ -: boost::mpl::true_ \ -{} - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(packed, MPI_PACKED, builtin); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(char, MPI_CHAR, builtin); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(short, MPI_SHORT, integer); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(int, MPI_INT, integer); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(long, MPI_LONG, integer); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(float, MPI_FLOAT, floating_point); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(double, MPI_DOUBLE, floating_point); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(long double, MPI_LONG_DOUBLE, floating_point); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(unsigned char, MPI_UNSIGNED_CHAR, builtin); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(unsigned short, MPI_UNSIGNED_SHORT, integer); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(unsigned, MPI_UNSIGNED, integer); - -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(unsigned long, MPI_UNSIGNED_LONG, integer); - -/// INTERNAL ONLY -#define BOOST_MPI_LIST2(A, B) A, B -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair<BOOST_MPI_LIST2(float, int)>, MPI_FLOAT_INT, - builtin); -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair<BOOST_MPI_LIST2(double, int)>, MPI_DOUBLE_INT, - builtin); -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair<BOOST_MPI_LIST2(long double, int)>, - MPI_LONG_DOUBLE_INT, builtin); -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair<BOOST_MPI_LIST2(long, int>), MPI_LONG_INT, - builtin); -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair<BOOST_MPI_LIST2(short, int>), MPI_SHORT_INT, - builtin); -/// INTERNAL ONLY -BOOST_MPI_DATATYPE(std::pair<BOOST_MPI_LIST2(int, int>), MPI_2INT, builtin); -#undef BOOST_MPI_LIST2 - -/// specialization of is_mpi_datatype for pairs -template <class T, class U> -struct is_mpi_datatype<std::pair<T,U> > - : public mpl::and_<is_mpi_datatype<T>,is_mpi_datatype<U> > -{ -}; - -/// specialization of is_mpi_datatype for arrays -#if defined(__cplusplus) && (201103L <= __cplusplus) -template<class T, std::size_t N> -struct is_mpi_datatype<std::array<T, N> > - : public is_mpi_datatype<T> -{ -}; -#endif - -// Define wchar_t specialization of is_mpi_datatype, if possible. -#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) && \ - (defined(MPI_WCHAR) || (defined(MPI_VERSION) && MPI_VERSION >= 2)) -BOOST_MPI_DATATYPE(wchar_t, MPI_WCHAR, builtin); -#endif - -// Define long long or __int64 specialization of is_mpi_datatype, if possible. -#if defined(BOOST_HAS_LONG_LONG) && \ - (defined(MPI_LONG_LONG_INT) || (defined(MPI_VERSION) && MPI_VERSION >= 2)) -BOOST_MPI_DATATYPE(long long, MPI_LONG_LONG_INT, builtin); -#elif defined(BOOST_HAS_MS_INT64) && \ - (defined(MPI_LONG_LONG_INT) || (defined(MPI_VERSION) && MPI_VERSION >= 2)) -BOOST_MPI_DATATYPE(__int64, MPI_LONG_LONG_INT, builtin); -#endif - -// Define unsigned long long or unsigned __int64 specialization of -// is_mpi_datatype, if possible. We separate this from the check for -// the (signed) long long/__int64 because some MPI implementations -// (e.g., MPICH-MX) have MPI_LONG_LONG_INT but not -// MPI_UNSIGNED_LONG_LONG. -#if defined(BOOST_HAS_LONG_LONG) && \ - (defined(MPI_UNSIGNED_LONG_LONG) \ - || (defined(MPI_VERSION) && MPI_VERSION >= 2)) -BOOST_MPI_DATATYPE(unsigned long long, MPI_UNSIGNED_LONG_LONG, builtin); -#elif defined(BOOST_HAS_MS_INT64) && \ - (defined(MPI_UNSIGNED_LONG_LONG) \ - || (defined(MPI_VERSION) && MPI_VERSION >= 2)) -BOOST_MPI_DATATYPE(unsigned __int64, MPI_UNSIGNED_LONG_LONG, builtin); -#endif - -// Define signed char specialization of is_mpi_datatype, if possible. -#if defined(MPI_SIGNED_CHAR) || (defined(MPI_VERSION) && MPI_VERSION >= 2) -BOOST_MPI_DATATYPE(signed char, MPI_SIGNED_CHAR, builtin); -#endif - - -#endif // Doxygen - -namespace detail { - inline MPI_Datatype build_mpi_datatype_for_bool() - { - MPI_Datatype type; - MPI_Type_contiguous(sizeof(bool), MPI_BYTE, &type); - MPI_Type_commit(&type); - return type; - } -} - -/// Support for bool. There is no corresponding MPI_BOOL. -/// INTERNAL ONLY -template<> -inline MPI_Datatype get_mpi_datatype<bool>(const bool&) -{ - static MPI_Datatype type = detail::build_mpi_datatype_for_bool(); - return type; -} - -/// INTERNAL ONLY -template<> -struct is_mpi_datatype<bool> - : boost::mpl::bool_<true> -{}; - - -#ifndef BOOST_MPI_DOXYGEN -// direct support for special primitive data types of the serialization library -BOOST_MPI_DATATYPE(boost::archive::library_version_type, get_mpi_datatype(uint_least16_t()), integer); -BOOST_MPI_DATATYPE(boost::archive::version_type, get_mpi_datatype(uint_least8_t()), integer); -BOOST_MPI_DATATYPE(boost::archive::class_id_type, get_mpi_datatype(int_least16_t()), integer); -BOOST_MPI_DATATYPE(boost::archive::class_id_reference_type, get_mpi_datatype(int_least16_t()), integer); -BOOST_MPI_DATATYPE(boost::archive::class_id_optional_type, get_mpi_datatype(int_least16_t()), integer); -BOOST_MPI_DATATYPE(boost::archive::object_id_type, get_mpi_datatype(uint_least32_t()), integer); -BOOST_MPI_DATATYPE(boost::archive::object_reference_type, get_mpi_datatype(uint_least32_t()), integer); -BOOST_MPI_DATATYPE(boost::archive::tracking_type, get_mpi_datatype(bool()), builtin); -BOOST_MPI_DATATYPE(boost::serialization::collection_size_type, get_mpi_datatype(std::size_t()), integer); -BOOST_MPI_DATATYPE(boost::serialization::item_version_type, get_mpi_datatype(uint_least8_t()), integer); -#endif // Doxygen - - -} } // end namespace boost::mpi - -// direct support for special primitive data types of the serialization library -// in the case of homogeneous systems -// define a macro to make explicit designation of this more transparent -#define BOOST_IS_MPI_DATATYPE(T) \ -namespace boost { \ -namespace mpi { \ -template<> \ -struct is_mpi_datatype< T > : mpl::true_ {}; \ -}} \ -/**/ - - -#endif // BOOST_MPI_MPI_DATATYPE_HPP diff --git a/contrib/restricted/boost/boost/mpi/datatype_fwd.hpp b/contrib/restricted/boost/boost/mpi/datatype_fwd.hpp deleted file mode 100644 index 3a5f941392..0000000000 --- a/contrib/restricted/boost/boost/mpi/datatype_fwd.hpp +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -/** @file datatype_fwd.hpp - * - * This header provides forward declarations for the contents of the - * header @c datatype.hpp. It is expected to be used primarily by - * user-defined C++ classes that need to specialize @c - * is_mpi_datatype. - */ -#ifndef BOOST_MPI_DATATYPE_FWD_HPP -#define BOOST_MPI_DATATYPE_FWD_HPP - -#include <boost/mpi/config.hpp> - -namespace boost { namespace mpi { - -template<typename T> struct is_mpi_builtin_datatype; -template<typename T> struct is_mpi_integer_datatype; -template<typename T> struct is_mpi_floating_point_datatype; -template<typename T> struct is_mpi_logical_datatype; -template<typename T> struct is_mpi_complex_datatype; -template<typename T> struct is_mpi_byte_datatype; -template<typename T> struct is_mpi_datatype; -template<typename T> MPI_Datatype get_mpi_datatype(const T& x); -template<typename T> MPI_Datatype get_mpi_datatype() - { return get_mpi_datatype(T());} - -/// a dummy data type giving MPI_PACKED as its MPI_Datatype -struct packed {}; -} } // end namespace boost::mpi - -#endif // BOOST_MPI_MPI_DATATYPE_FWD_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/antiques.hpp b/contrib/restricted/boost/boost/mpi/detail/antiques.hpp deleted file mode 100644 index 0bd235b2c1..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/antiques.hpp +++ /dev/null @@ -1,40 +0,0 @@ -// Copyright Alain Miniussi 2014. -// Distributed under the 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: Alain Miniussi - -#ifndef BOOST_MPI_ANTIQUES_HPP -#define BOOST_MPI_ANTIQUES_HPP - -#include <vector> - -// Support for some obsolette compilers - -namespace boost { namespace mpi { -namespace detail { - // Some old gnu compiler have no support for vector<>::data - // Use this in the mean time, the cumbersome syntax should - // serve as an incentive to get rid of this when those compilers - // are dropped. - template <typename T, typename A> - T* c_data(std::vector<T,A>& v) { return &(v[0]); } - - template <typename T, typename A> - T const* c_data(std::vector<T,A> const& v) { return &(v[0]); } - - // Some old MPI implementation (OpenMPI 1.6 for example) have non - // conforming API w.r.t. constness. - // We choose to fix this trhough this converter in order to - // explain/remember why we're doing this and remove it easilly - // when support for those MPI is dropped. - // The fix is as specific (un templatized, for one) as possible - // in order to encourage it usage for the probleme at hand. - // Problematic API include MPI_Send - inline - void *unconst(void const* addr) { return const_cast<void*>(addr); } - -} } } - -#endif diff --git a/contrib/restricted/boost/boost/mpi/detail/binary_buffer_iprimitive.hpp b/contrib/restricted/boost/boost/mpi/detail/binary_buffer_iprimitive.hpp deleted file mode 100644 index 388cd44c14..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/binary_buffer_iprimitive.hpp +++ /dev/null @@ -1,123 +0,0 @@ -// (C) Copyright 2005-2007 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_BINARY_BUFFER_IPRIMITIVE_HPP -#define BOOST_MPI_BINARY_BUFFER_IPRIMITIVE_HPP - -#include <mpi.h> -#include <iostream> -#include <cstddef> // size_t -#include <boost/config.hpp> -#include <boost/mpi/exception.hpp> -#include <boost/assert.hpp> -#include <boost/mpl/assert.hpp> -#include <boost/serialization/array.hpp> -#include <boost/serialization/is_bitwise_serializable.hpp> -#include <vector> -#include <boost/mpi/allocator.hpp> -#include <cstring> // for memcpy -#include <cassert> - -namespace boost { namespace mpi { - -/// deserialization using MPI_Unpack - -class BOOST_MPI_DECL binary_buffer_iprimitive -{ -public: - /// the type of the buffer from which the data is unpacked upon deserialization - typedef std::vector<char, allocator<char> > buffer_type; - - binary_buffer_iprimitive(buffer_type & b, MPI_Comm const &, int position = 0) - : buffer_(b), - position(position) - { - } - - void* address () - { - return &buffer_.front(); - } - - void const* address () const - { - return &buffer_.front(); - } - - const std::size_t& size() const - { - return size_ = buffer_.size(); - } - - void resize(std::size_t s) - { - buffer_.resize(s); - } - - void load_binary(void *address, std::size_t count) - { - load_impl(address,count); - } - - // fast saving of arrays of fundamental types - template<class T> - void load_array(serialization::array_wrapper<T> const& x, unsigned int /* file_version */) - { - BOOST_MPL_ASSERT((serialization::is_bitwise_serializable<BOOST_DEDUCED_TYPENAME remove_const<T>::type>)); - if (x.count()) - load_impl(x.address(), sizeof(T)*x.count()); - } - - typedef serialization::is_bitwise_serializable<mpl::_1> use_array_optimization; - - template<class T> - void load(serialization::array_wrapper<T> const& x) - { - load_array(x,0u); - } - - // default saving of primitives. - template<class T> - void load( T & t) - { - BOOST_MPL_ASSERT((serialization::is_bitwise_serializable<BOOST_DEDUCED_TYPENAME remove_const<T>::type>)); - load_impl(&t, sizeof(T)); - } - - template<class CharType> - void load(std::basic_string<CharType> & s) - { - unsigned int l; - load(l); - // borland de-allocator fixup - #if BOOST_WORKAROUND(_RWSTD_VER, BOOST_TESTED_AT(20101)) - if(NULL != s.data()) - #endif - s.resize(l); - // note breaking a rule here - could be a problem on some platform - load_impl(const_cast<char *>(s.data()),l); - } - -private: - - void load_impl(void * p, int l) - { - assert(position+l<=static_cast<int>(buffer_.size())); - if (l) - std::memcpy(p,&buffer_[position],l); - position += l; - } - - buffer_type & buffer_; - mutable std::size_t size_; - int position; -}; - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_PACKED_IPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/binary_buffer_oprimitive.hpp b/contrib/restricted/boost/boost/mpi/detail/binary_buffer_oprimitive.hpp deleted file mode 100644 index 313097b795..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/binary_buffer_oprimitive.hpp +++ /dev/null @@ -1,109 +0,0 @@ -// (C) Copyright 2005-2007 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_BINARY_BUFFER_OPRIMITIVE_HPP -#define BOOST_MPI_BINARY_BUFFER_OPRIMITIVE_HPP - -#include <mpi.h> -#include <iostream> -#include <cstddef> // size_t -#include <boost/config.hpp> - -#include <boost/serialization/array.hpp> -#include <boost/serialization/is_bitwise_serializable.hpp> -#include <boost/assert.hpp> -#include <boost/mpl/assert.hpp> -#include <vector> -#include <boost/mpi/allocator.hpp> -#include <boost/mpl/always.hpp> -#include <boost/type_traits/remove_const.hpp> - -namespace boost { namespace mpi { - -/// serialization using binary copy into a buffer - -class BOOST_MPI_DECL binary_buffer_oprimitive -{ -public: - /// the type of the buffer into which the data is packed upon serialization - typedef std::vector<char, allocator<char> > buffer_type; - - binary_buffer_oprimitive(buffer_type & b, MPI_Comm const &) - : buffer_(b) - { - } - - void const * address() const - { - return &buffer_.front(); - } - - const std::size_t& size() const - { - return size_ = buffer_.size(); - } - - const std::size_t* size_ptr() const - { - return &size(); - } - - void save_binary(void const *address, std::size_t count) - { - save_impl(address,count); - } - - // fast saving of arrays - template<class T> - void save_array(serialization::array_wrapper<T> const& x, unsigned int /* file_version */) - { - - BOOST_MPL_ASSERT((serialization::is_bitwise_serializable<BOOST_DEDUCED_TYPENAME remove_const<T>::type>)); - if (x.count()) - save_impl(x.address(), x.count()*sizeof(T)); - } - - template<class T> - void save(serialization::array_wrapper<T> const& x) - { - save_array(x,0u); - } - - typedef serialization::is_bitwise_serializable<mpl::_1> use_array_optimization; - - // default saving of primitives. - template<class T> - void save(const T & t) - { - BOOST_MPL_ASSERT((serialization::is_bitwise_serializable<BOOST_DEDUCED_TYPENAME remove_const<T>::type>)); - save_impl(&t, sizeof(T)); - } - - template<class CharType> - void save(const std::basic_string<CharType> &s) - { - unsigned int l = static_cast<unsigned int>(s.size()); - save(l); - save_impl(s.data(),s.size()); - } - -private: - - void save_impl(void const * p, int l) - { - char const* ptr = reinterpret_cast<char const*>(p); - buffer_.insert(buffer_.end(),ptr,ptr+l); - } - - buffer_type& buffer_; - mutable std::size_t size_; -}; - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_BINARY_BUFFER_OPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/broadcast_sc.hpp b/contrib/restricted/boost/boost/mpi/detail/broadcast_sc.hpp deleted file mode 100644 index c84da662a2..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/broadcast_sc.hpp +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright (C) 2005, 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -// Allows broadcast of skeletons via proxy. - -// This header may only be included after both the broadcast.hpp and -// and skeleton_and_content.hpp headers have been included. -#ifndef BOOST_MPI_BROADCAST_SC_HPP -#define BOOST_MPI_BROADCAST_SC_HPP - -namespace boost { namespace mpi { - -template<typename T> -inline void -broadcast(const communicator& comm, skeleton_proxy<T>& proxy, int root) -{ - const skeleton_proxy<T>& const_proxy(proxy); - broadcast(comm, const_proxy, root); -} - -template<typename T> -void -broadcast(const communicator& comm, const skeleton_proxy<T>& proxy, int root) -{ - if (comm.rank() == root) { - packed_skeleton_oarchive oa(comm); - oa << proxy.object; - broadcast(comm, oa, root); - } else { - packed_skeleton_iarchive ia(comm); - broadcast(comm, ia, root); - ia >> proxy.object; - } -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_BROADCAST_SC_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/communicator_sc.hpp b/contrib/restricted/boost/boost/mpi/detail/communicator_sc.hpp deleted file mode 100644 index 1dfcc3c52d..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/communicator_sc.hpp +++ /dev/null @@ -1,96 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -// Skeleton and content support for communicators - -// This header should be included only after both communicator.hpp and -// skeleton_and_content.hpp have been included. -#ifndef BOOST_MPI_COMMUNICATOR_SC_HPP -#define BOOST_MPI_COMMUNICATOR_SC_HPP - -namespace boost { namespace mpi { - -template<typename T> -void -communicator::send(int dest, int tag, const skeleton_proxy<T>& proxy) const -{ - packed_skeleton_oarchive ar(*this); - ar << proxy.object; - send(dest, tag, ar); -} - -template<typename T> -status -communicator::recv(int source, int tag, const skeleton_proxy<T>& proxy) const -{ - packed_skeleton_iarchive ar(*this); - status result = recv(source, tag, ar); - ar >> proxy.object; - return result; -} - -template<typename T> -status communicator::recv(int source, int tag, skeleton_proxy<T>& proxy) const -{ - packed_skeleton_iarchive ar(*this); - status result = recv(source, tag, ar); - ar >> proxy.object; - return result; -} - -template<typename T> -request -communicator::isend(int dest, int tag, const skeleton_proxy<T>& proxy) const -{ - shared_ptr<packed_skeleton_oarchive> - archive(new packed_skeleton_oarchive(*this)); - - *archive << proxy.object; - request result = isend(dest, tag, *archive); - result.m_data = archive; - return result; -} - -namespace detail { - template<typename T> - struct serialized_irecv_data<const skeleton_proxy<T> > - { - serialized_irecv_data(const communicator& comm, int source, int tag, - skeleton_proxy<T> proxy) - : comm(comm), source(source), tag(tag), isa(comm), - ia(isa.get_skeleton()), proxy(proxy) { } - - void deserialize(status& stat) - { - isa >> proxy.object; - stat.m_count = 1; - } - - communicator comm; - int source; - int tag; - std::size_t count; - packed_skeleton_iarchive isa; - packed_iarchive& ia; - skeleton_proxy<T> proxy; - }; - - template<typename T> - struct serialized_irecv_data<skeleton_proxy<T> > - : public serialized_irecv_data<const skeleton_proxy<T> > - { - typedef serialized_irecv_data<const skeleton_proxy<T> > inherited; - - serialized_irecv_data(const communicator& comm, int source, int tag, - const skeleton_proxy<T>& proxy) - : inherited(comm, source, tag, proxy) { } - }; -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_COMMUNICATOR_SC_HPP - diff --git a/contrib/restricted/boost/boost/mpi/detail/computation_tree.hpp b/contrib/restricted/boost/boost/mpi/detail/computation_tree.hpp deleted file mode 100644 index 83acd72d8c..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/computation_tree.hpp +++ /dev/null @@ -1,86 +0,0 @@ -// Copyright (C) 2005 Douglas Gregor. - -// 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) - -// Compute parents, children, levels, etc. to effect a parallel -// computation tree. -#ifndef BOOST_MPI_COMPUTATION_TREE_HPP -#define BOOST_MPI_COMPUTATION_TREE_HPP - -namespace boost { namespace mpi { namespace detail { - -/** - * @brief Aids tree-based parallel collective algorithms. - * - * Objects of this type - */ -class computation_tree -{ - public: - computation_tree(int rank, int size, int root, int branching_factor = -1); - - /// Returns the branching factor of the tree. - int branching_factor() const { return branching_factor_; } - - /// Returns the level in the tree on which this process resides. - int level() const { return level_; } - - /** - * Returns the index corresponding to the n^th level of the tree. - * - * @param n The level in the tree whose index will be returned. - */ - int level_index(int n) const; - - /** - * @brief Returns the parent of this process. - * - * @returns If this process is the root, returns itself. Otherwise, - * returns the process number that is the parent in the computation - * tree. - */ - int parent() const; - - /// Returns the index for the first child of this process. - int child_begin() const; - - /** - * @brief The default branching factor within the computation tree. - * - * This is the default branching factor for the computation tree, to - * be used by any computation tree that does not fix the branching - * factor itself. The default is initialized to 3, but may be - * changed by the application so long as all processes have the same - * branching factor. - */ - static int default_branching_factor; - - protected: - /// The rank of this process in the computation tree. - int rank; - - /// The number of processes participating in the computation tree. - int size; - - /// The process number that is acting as the root in the computation - /// tree. - int root; - - /** - * @brief The branching factor within the computation tree. - * - * This is the default number of children that each node in a - * computation tree will have. This value will be used for - * collective operations that use tree-based algorithms. - */ - int branching_factor_; - - /// The level in the tree at which this process resides. - int level_; -}; - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_COMPUTATION_TREE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/content_oarchive.hpp b/contrib/restricted/boost/boost/mpi/detail/content_oarchive.hpp deleted file mode 100644 index 2158847249..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/content_oarchive.hpp +++ /dev/null @@ -1,66 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP -#define BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP - -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/archive/basic_archive.hpp> -#include <boost/mpi/detail/ignore_skeleton_oarchive.hpp> -#include <boost/mpi/detail/mpi_datatype_primitive.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/archive/detail/register_archive.hpp> - -namespace boost { namespace mpi { - -namespace detail { - // an archive wrapper that stores only the data members but not the - // special types defined by the serialization library - // to define the data skeletons (classes, pointers, container sizes, ...) - - class BOOST_MPI_DECL content_oarchive - : public mpi_datatype_primitive, - public ignore_skeleton_oarchive<content_oarchive> - { - public: - content_oarchive() - : committed(false) - {} - - content get_content() - { - if (!committed) - { - // create the content holder only once - c=this->get_mpi_datatype(); - committed=true; - } - return c; - } - - private: - bool committed; - content c; - }; -} // end namespace detail - -template <class T> -const content get_content(const T& x) -{ - detail::content_oarchive ar; - ar << x; - return ar.get_content(); -} - -} } // end namespace boost::mpi - -// required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::content_oarchive) -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::content_oarchive>) -BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::detail::content_oarchive) -#endif // BOOST_MPI_DETAIL_CONTENT_OARCHIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/forward_iprimitive.hpp b/contrib/restricted/boost/boost/mpi/detail/forward_iprimitive.hpp deleted file mode 100644 index 33d39fd580..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/forward_iprimitive.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#include <boost/serialization/array.hpp> - -#ifndef BOOST_MPI_DETAIL_FORWARD_IPRIMITIVE_HPP -#define BOOST_MPI_DETAIL_FORWARD_IPRIMITIVE_HPP - -namespace boost { namespace mpi { namespace detail { - -/// @brief a minimal input archive, which forwards reading to another archive -/// -/// This class template is designed to use the loading facilities of another -/// input archive (the "implementation archive", whose type is specified by -/// the template argument, to handle serialization of primitive types, -/// while serialization for specific types can be overriden independently -/// of that archive. - -template <class ImplementationArchive> -class forward_iprimitive -{ -public: - - /// the type of the archive to which the loading of primitive types will be forwarded - typedef ImplementationArchive implementation_archive_type; - - /// the constructor takes a reference to the implementation archive used for loading primitve types - forward_iprimitive(implementation_archive_type& ar) - : implementation_archive(ar) - {} - - /// binary loading is forwarded to the implementation archive - void load_binary(void * address, std::size_t count ) - { - implementation_archive.load_binary(address,count); - } - - /// loading of arrays is forwarded to the implementation archive - template<class T> - void load_array(serialization::array_wrapper<T> & x, unsigned int file_version ) - { - implementation_archive.load_array(x,file_version); - } - - typedef typename ImplementationArchive::use_array_optimization use_array_optimization; - -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS - friend class archive::load_access; -protected: -#else -public: -#endif - - /// loading of primitives is forwarded to the implementation archive - template<class T> - void load(T & t) - { - implementation_archive >> t; - } - -private: - implementation_archive_type& implementation_archive; -}; - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_DETAIL_FORWARD_IPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/forward_oprimitive.hpp b/contrib/restricted/boost/boost/mpi/detail/forward_oprimitive.hpp deleted file mode 100644 index 78f7ca02f6..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/forward_oprimitive.hpp +++ /dev/null @@ -1,73 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_FORWARD_OPRIMITIVE_HPP -#define BOOST_MPI_DETAIL_FORWARD_OPRIMITIVE_HPP - -#include <boost/config.hpp> -#include <boost/serialization/array.hpp> - -namespace boost { namespace mpi { namespace detail { - -/// @brief a minimal output archive, which forwards saving to another archive -/// -/// This class template is designed to use the saving facilities of another -/// output archive (the "implementation archive", whose type is specified by -/// the template argument, to handle serialization of primitive types, -/// while serialization for specific types can be overriden independently -/// of that archive. - -template <class ImplementationArchive> -class forward_oprimitive -{ -public: - - /// the type of the archive to which the saving of primitive types will be forwarded - typedef ImplementationArchive implementation_archive_type; - - /// the constructor takes a reference to the implementation archive used for saving primitve types - forward_oprimitive(implementation_archive_type& ar) - : implementation_archive(ar) - {} - - /// binary saving is forwarded to the implementation archive - void save_binary(const void * address, std::size_t count) - { - implementation_archive.save_binary(address,count); - } - - /// saving of arrays is forwarded to the implementation archive - template<class T> - void save_array(serialization::array_wrapper<T> const& x, unsigned int file_version ) - { - implementation_archive.save_array(x,file_version); - } - - typedef typename ImplementationArchive::use_array_optimization use_array_optimization; - -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS - friend class archive::save_access; -protected: -#else -public: -#endif - - /// saving of primitives is forwarded to the implementation archive - template<class T> - void save(const T & t) - { - implementation_archive << t; - } - -private: - implementation_archive_type& implementation_archive; -}; - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_DETAIL_FORWARD_OPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/forward_skeleton_iarchive.hpp b/contrib/restricted/boost/boost/mpi/detail/forward_skeleton_iarchive.hpp deleted file mode 100644 index 0dfcaf9748..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/forward_skeleton_iarchive.hpp +++ /dev/null @@ -1,80 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP -#define BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP - -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/archive/detail/iserializer.hpp> -#include <boost/archive/detail/interface_iarchive.hpp> -#include <boost/archive/detail/common_iarchive.hpp> -#include <boost/serialization/collection_size_type.hpp> - -namespace boost { namespace mpi { namespace detail { - -template<class Archive, class ImplementationArchive> -class forward_skeleton_iarchive - : public archive::detail::common_iarchive<Archive> -{ -public: - - typedef ImplementationArchive implementation_archive_type; - - forward_skeleton_iarchive(implementation_archive_type& ar) - : archive::detail::common_iarchive<Archive>(archive::no_header), - implementation_archive(ar) - { - } - -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS -public: -#else - friend class archive::detail::interface_iarchive<Archive>; - friend class archive::load_access; -protected: -#endif - - template<class T> - void load_override(T & t) - { - archive::load(* this->This(), t); - } - -#define BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(T) \ - void load_override(T & t) \ - { \ - implementation_archive >> t; \ - } - -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_optional_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::version_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_reference_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_id_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_reference_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::tracking_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_name_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(serialization::collection_size_type) - - void load_override(std::string & s) - { - serialization::collection_size_type length(s.size()); - load_override(length); - s.resize(length); - } - -#undef BOOST_ARCHIVE_FORWARD_IMPLEMENTATION -protected: - /// the actual archive used to serialize the information we actually want to store - implementation_archive_type& implementation_archive; -}; - - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_DETAIL_FORWARD_SKELETON_IARCHIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/forward_skeleton_oarchive.hpp b/contrib/restricted/boost/boost/mpi/detail/forward_skeleton_oarchive.hpp deleted file mode 100644 index 1a170b4ab7..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/forward_skeleton_oarchive.hpp +++ /dev/null @@ -1,78 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_FORWARD_SKELETON_OARCHIVE_HPP -#define BOOST_MPI_DETAIL_FORWARD_SKELETON_OARCHIVE_HPP - -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/archive/detail/oserializer.hpp> -#include <boost/archive/detail/interface_oarchive.hpp> -#include <boost/archive/detail/common_oarchive.hpp> -#include <boost/serialization/collection_size_type.hpp> - -namespace boost { namespace mpi { namespace detail { - -template<class Archive, class ImplementationArchive> -class forward_skeleton_oarchive - : public archive::detail::common_oarchive<Archive> -{ -public: - - typedef ImplementationArchive implementation_archive_type; - - forward_skeleton_oarchive(implementation_archive_type& ar) - : archive::detail::common_oarchive<Archive>(archive::no_header), - implementation_archive(ar) - { - } - -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS -public: -#else - friend class archive::detail::interface_oarchive<Archive>; - friend class archive::save_access; -protected: -#endif - - template<class T> - void save_override(T const& t) - { - archive::save(* this->This(), t); - } - -#define BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(T) \ - void save_override(T const & t) \ - { \ - implementation_archive << t; \ - } - -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_optional_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::version_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_id_reference_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_id_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::object_reference_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::tracking_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(archive::class_name_type) -BOOST_ARCHIVE_FORWARD_IMPLEMENTATION(serialization::collection_size_type) - - void save_override(std::string const & t) - { - save_override(serialization::collection_size_type(t.size())); - } - - -#undef BOOST_ARCHIVE_FORWARD_IMPLEMENTATION -protected: - /// the actual archive used to serialize the information we actually want to store - implementation_archive_type& implementation_archive; -}; - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_DETAIL_FORWARD_SKELETON_OARCHIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/ignore_iprimitive.hpp b/contrib/restricted/boost/boost/mpi/detail/ignore_iprimitive.hpp deleted file mode 100644 index 151ed0b348..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/ignore_iprimitive.hpp +++ /dev/null @@ -1,54 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_IGNORE_IPRIMITIVE_HPP -#define BOOST_MPI_DETAIL_IGNORE_IPRIMITIVE_HPP - -#include <boost/config.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/serialization/array.hpp> - - -namespace boost { namespace mpi { namespace detail { - -/// @brief a minimal input archive, which ignores any load -/// -/// This class implements a minimal input archive, probably an input archive -/// archetype, doing nothing at any load. It's use, besides acting as an -/// archetype is as a base class to implement special archives that ignore -/// loading of most types - -class ignore_iprimitive -{ -public: - /// a trivial default constructor - ignore_iprimitive() - {} - - - /// don't do anything when loading binary data - void load_binary(void *, std::size_t ) - {} - - /// don't do anything when loading arrays - template<class T> - void load_array(serialization::array_wrapper<T> &, unsigned int ) - {} - - typedef is_mpi_datatype<mpl::_1> use_array_optimization; - - /// don't do anything when loading primitive types - template<class T> - void load(T &) - { - } -}; - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_DETAIL_IGNORE_IPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/ignore_oprimitive.hpp b/contrib/restricted/boost/boost/mpi/detail/ignore_oprimitive.hpp deleted file mode 100644 index 4f2994bfc7..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/ignore_oprimitive.hpp +++ /dev/null @@ -1,62 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_IGNORE_OPRIMITIVE_HPP -#define BOOST_MPI_DETAIL_IGNORE_OPRIMITIVE_HPP - -#include <boost/config.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/serialization/array.hpp> - -namespace boost { namespace mpi { namespace detail { - -/// @brief a minimal output archive, which ignores any save -/// -/// This class implements a minimal output archive, probably an output archive -/// archetype, doing nothing at any save. It's use, besides acting as an -/// archetype is as a base class to implement special archives that ignore -/// saving of most types - -class ignore_oprimitive -{ -public: - /// a trivial default constructor - ignore_oprimitive() - {} - - /// don't do anything when saving binary data - void save_binary(const void *, std::size_t ) - { - } - - /// don't do anything when saving arrays - template<class T> - void save_array(serialization::array_wrapper<T> const&, unsigned int ) - { - } - - typedef is_mpi_datatype<mpl::_1> use_array_optimization; - - -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS - friend class archive::save_access; -protected: -#else -public: -#endif - - /// don't do anything when saving primitive types - template<class T> - void save(const T &) - { - } -}; - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_DETAIL_IGNORE_OPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/ignore_skeleton_oarchive.hpp b/contrib/restricted/boost/boost/mpi/detail/ignore_skeleton_oarchive.hpp deleted file mode 100644 index f9285a25d3..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/ignore_skeleton_oarchive.hpp +++ /dev/null @@ -1,73 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP -#define BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP - -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/archive/detail/common_oarchive.hpp> -#include <boost/archive/basic_archive.hpp> -#include <boost/archive/detail/oserializer.hpp> -#include <boost/serialization/collection_size_type.hpp> -#include <boost/serialization/array.hpp> -#include <boost/serialization/item_version_type.hpp> - -namespace boost { namespace mpi { namespace detail { - -template<class Archive> -class ignore_skeleton_oarchive - : public archive::detail::common_oarchive<Archive> -{ -public: - ignore_skeleton_oarchive() - : archive::detail::common_oarchive<Archive>(archive::no_header) - { - } - -#ifdef BOOST_NO_MEMBER_TEMPLATE_FRIENDS -public: -#else - friend class archive::detail::interface_oarchive<Archive>; - friend class archive::save_access; -protected: -#endif - template<class T> - void save_override(T const& t) - { - archive::save(* this->This(), t); - } - -#define BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(T) \ - void save_override(T const &) \ - {} - -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_optional_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::version_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::library_version_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_id_reference_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::object_id_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::object_reference_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::tracking_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(archive::class_name_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(serialization::collection_size_type) -BOOST_ARCHIVE_IGNORE_IMPLEMENTATION(serialization::item_version_type) - - void save_override(std::string const & s) - { - if (s.size()) - save_override(serialization::make_array(s.data(),s.size())); - } - -#undef BOOST_ARCHIVE_IGNORE_IMPLEMENTATION -}; - - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_DETAIL_IGNORE_SKELETON_OARCHIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_cache.hpp b/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_cache.hpp deleted file mode 100644 index c99ddb1e84..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_cache.hpp +++ /dev/null @@ -1,99 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_TYPE_MPI_DATATYPE_CACHE_HPP -#define BOOST_MPI_DETAIL_TYPE_MPI_DATATYPE_CACHE_HPP - -#include <boost/mpi/datatype_fwd.hpp> -#include <boost/mpi/detail/mpi_datatype_oarchive.hpp> -#include <boost/mpi/exception.hpp> -#include <boost/utility/enable_if.hpp> -#include <boost/mpl/assert.hpp> -#include <boost/noncopyable.hpp> -#include <typeinfo> - -// The std::type_info::before function in Visual C++ 8.0 (and probably earlier) -// incorrectly returns an "int" instead of a "bool". Then the compiler has the -// audacity to complain when that "int" is converted to a "bool". Silence -// this warning. -#ifdef BOOST_MSVC -# pragma warning(push) -# pragma warning(disable : 4800) -#endif - -namespace boost { namespace mpi { namespace detail { - -/// @brief comparison function object for two std::type_info pointers -/// -/// is implemented using the before() member function of the std::type_info -/// class - -struct type_info_compare -{ - bool operator()(std::type_info const* lhs, std::type_info const* rhs) const - { - return lhs->before(*rhs); - } -}; - - -/// @brief a map of MPI data types, indexed by their type_info -/// -/// -class BOOST_MPI_DECL mpi_datatype_map - : public boost::noncopyable -{ - struct implementation; - - implementation *impl; - -public: - mpi_datatype_map(); - ~mpi_datatype_map(); - - template <class T> - MPI_Datatype datatype(const T& x = T(), typename boost::enable_if<is_mpi_builtin_datatype<T> >::type* =0) - { - return get_mpi_datatype<T>(x); - } - - template <class T> - MPI_Datatype datatype(const T& x =T(), typename boost::disable_if<is_mpi_builtin_datatype<T> >::type* =0 ) - { - BOOST_MPL_ASSERT((is_mpi_datatype<T>)); - - // check whether the type already exists - std::type_info const* t = &typeid(T); - MPI_Datatype datatype = get(t); - if (datatype == MPI_DATATYPE_NULL) { - // need to create a type - mpi_datatype_oarchive ar(x); - datatype = ar.get_mpi_datatype(); - set(t, datatype); - } - - return datatype; - } - - void clear(); - -private: - MPI_Datatype get(const std::type_info* t); - void set(const std::type_info* t, MPI_Datatype datatype); -}; - -/// Retrieve the MPI datatype cache -BOOST_MPI_DECL mpi_datatype_map& mpi_datatype_cache(); - -} } } // end namespace boost::mpi::detail - -#ifdef BOOST_MSVC -# pragma warning(pop) -#endif - -#endif // BOOST_MPI_DETAIL_TYPE_MPI_DATATYPE_CACHE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_oarchive.hpp b/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_oarchive.hpp deleted file mode 100644 index 68f9abb6b5..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_oarchive.hpp +++ /dev/null @@ -1,75 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_MPI_DATATYPE_OARCHIVE_HPP -#define BOOST_MPI_DETAIL_MPI_DATATYPE_OARCHIVE_HPP - -#include <boost/type_traits/is_enum.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/archive/detail/oserializer.hpp> -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/archive/basic_archive.hpp> -#include <boost/mpi/detail/ignore_skeleton_oarchive.hpp> -#include <boost/mpi/detail/mpi_datatype_primitive.hpp> -#include <boost/mpi/datatype_fwd.hpp> -#include <boost/mpl/assert.hpp> -#include <boost/static_assert.hpp> -#include <boost/integer.hpp> -#include <boost/archive/detail/register_archive.hpp> - -namespace boost { namespace mpi { namespace detail { - - -// an archive wrapper that stores only the data members but not the -// special types defined by the serialization library -// to define the data skeletons (classes, pointers, container sizes, ...) - -class mpi_datatype_oarchive - : public mpi_datatype_primitive, - public ignore_skeleton_oarchive<mpi_datatype_oarchive> -{ -public: - template <class T> - mpi_datatype_oarchive(const T& x) - : mpi_datatype_primitive(&x) // register address - { - BOOST_MPL_ASSERT((is_mpi_datatype<T>)); - *this << x; // serialize the object - } - - template<class T> - void save_override(T const& t) - { - save_enum(t,boost::is_enum<T>()); - } - - template<class T> - void save_enum(T const& t, mpl::false_) - { - ignore_skeleton_oarchive<mpi_datatype_oarchive>::save_override(t); - } - - template<class T> - void save_enum(T const& t, mpl::true_) - { - // select the right sized integer for the enum - typedef typename boost::uint_t<8*sizeof(T)>::least int_type; - BOOST_STATIC_ASSERT((sizeof(T)==sizeof(int_type))); - this->save(*reinterpret_cast<int_type const*>(&t)); - } - -}; - -} } } // end namespace boost::mpi::detail - -// required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::mpi_datatype_oarchive) -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::ignore_skeleton_oarchive<boost::mpi::detail::mpi_datatype_oarchive>) -BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::detail::mpi_datatype_oarchive) - -#endif // BOOST_MPI_DETAIL_MPI_DATATYPE_OARCHIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_primitive.hpp b/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_primitive.hpp deleted file mode 100644 index 6a82624e43..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/mpi_datatype_primitive.hpp +++ /dev/null @@ -1,152 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_DETAIL_MPI_DATATYPE_OPRIMITIVE_HPP -#define BOOST_MPI_DETAIL_MPI_DATATYPE_OPRIMITIVE_HPP - -#include <boost/mpi/config.hpp> -#include <cstddef> // size_t - -#include <boost/config.hpp> -#if defined(BOOST_NO_STDC_NAMESPACE) -namespace std{ - using ::size_t; -} // namespace std -#endif - -#include <boost/mpi/datatype_fwd.hpp> -#include <boost/mpi/exception.hpp> -#include <boost/mpi/detail/antiques.hpp> -#include <boost/throw_exception.hpp> -#include <boost/assert.hpp> -#include <boost/mpl/placeholders.hpp> -#include <boost/serialization/array.hpp> -#include <stdexcept> -#include <iostream> -#include <vector> -#include <boost/mpi/detail/antiques.hpp> - -namespace boost { namespace mpi { namespace detail { - -///////////////////////////////////////////////////////////////////////// -// class mpi_data_type_oprimitive - creation of custom MPI data types - -class mpi_datatype_primitive -{ -public: - - // trivial default constructor - mpi_datatype_primitive() - : is_committed(false), - origin(0) - {} - - mpi_datatype_primitive(void const* orig) - : is_committed(false), - origin() - { -#if defined(MPI_VERSION) && MPI_VERSION >= 2 - BOOST_MPI_CHECK_RESULT(MPI_Get_address,(const_cast<void*>(orig), &origin)); -#else - BOOST_MPI_CHECK_RESULT(MPI_Address,(const_cast<void*>(orig), &origin)); -#endif - } - - void save_binary(void const *address, std::size_t count) - { - save_impl(address,MPI_BYTE,count); - } - - // fast saving of arrays of MPI types - template<class T> - void save_array(serialization::array_wrapper<T> const& x, unsigned int /* version */) - { - if (x.count()) - save_impl(x.address(), boost::mpi::get_mpi_datatype(*x.address()), x.count()); - } - - typedef is_mpi_datatype<mpl::_1> use_array_optimization; - - // create and return the custom MPI data type - MPI_Datatype get_mpi_datatype() - { - if (!is_committed) - { -#if defined(MPI_VERSION) && MPI_VERSION >= 2 - BOOST_MPI_CHECK_RESULT(MPI_Type_create_struct, - ( - addresses.size(), - c_data(lengths), - c_data(addresses), - c_data(types), - &datatype_ - )); -#else - BOOST_MPI_CHECK_RESULT(MPI_Type_struct, - ( - addresses.size(), - c_data(lengths), - c_data(addresses), - c_data(types), - &datatype_ - )); -#endif - BOOST_MPI_CHECK_RESULT(MPI_Type_commit,(&datatype_)); - - is_committed = true; - } - - return datatype_; - } - - // default saving of primitives. - template<class T> - void save(const T & t) - { - save_impl(&t, boost::mpi::get_mpi_datatype(t), 1); - } - -private: - - void save_impl(void const * p, MPI_Datatype t, int l) - { - BOOST_ASSERT ( !is_committed ); - - // store address, type and length - - MPI_Aint a; -#if defined(MPI_VERSION) && MPI_VERSION >= 2 - BOOST_MPI_CHECK_RESULT(MPI_Get_address,(const_cast<void*>(p), &a)); -#else - BOOST_MPI_CHECK_RESULT(MPI_Address,(const_cast<void*>(p), &a)); -#endif - addresses.push_back(a-origin); - types.push_back(t); - lengths.push_back(l); - } - - template <class T> - static T* get_data(std::vector<T>& v) - { - return v.empty() ? 0 : &(v[0]); - } - - std::vector<MPI_Aint> addresses; - std::vector<MPI_Datatype> types; - std::vector<int> lengths; - - bool is_committed; - MPI_Datatype datatype_; - MPI_Aint origin; -}; - - -} } } // end namespace boost::mpi::detail - - -#endif // BOOST_MPI_DETAIL_MPI_DATATYPE_OPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/offsets.hpp b/contrib/restricted/boost/boost/mpi/detail/offsets.hpp deleted file mode 100644 index 7e5ab7dff6..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/offsets.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright Alain Miniussi 2014. -// Distributed under the 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: Alain Miniussi - -#ifndef BOOST_MPI_OFFSETS_HPP -#define BOOST_MPI_OFFSETS_HPP - -#include <vector> -#include <boost/mpi/communicator.hpp> - -namespace boost { namespace mpi { -namespace detail { - -// Convert a sequence of sizes [S0..Sn] to a sequence displacement -// [O0..On] where O[0] = 0 and O[k+1] = O[k]+S[k]. -void sizes2offsets(int const* sizes, int* offsets, int n); - -// Same as size2offset(sizes.data(), offsets.data(), sizes.size()) -void sizes2offsets(std::vector<int> const& sizes, std::vector<int>& offsets); - -// Given a sequence of sizes (typically the number of records dispatched -// to each process in a scater) and a sequence of displacements (typically the -// slot index at with those record starts), convert the later to a number -// of skipped slots. -void offsets2skipped(int const* sizes, int const* offsets, int* skipped, int n); - -// Reconstruct offsets from sizes assuming no padding. -// Only takes place if on the root process and if -// displs are not already provided. -// If memory was allocated, returns a pointer to it -// otherwise null. -int* make_offsets(communicator const& comm, int const* sizes, int const* displs, int root = -1); - -// Reconstruct skip slots from sizes and offsets. -// Only takes place if on the root process and if -// displs are provided. -// If memory was allocated, returns a pointer to it -// otherwise null. -int* make_skipped_slots(communicator const& comm, int const* sizes, int const* displs, int root = -1); - -} -}}// end namespace boost::mpi - -#endif // BOOST_MPI_OFFSETS_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/packed_iprimitive.hpp b/contrib/restricted/boost/boost/mpi/detail/packed_iprimitive.hpp deleted file mode 100644 index 85a4010fea..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/packed_iprimitive.hpp +++ /dev/null @@ -1,118 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_PACKED_IPRIMITIVE_HPP -#define BOOST_MPI_PACKED_IPRIMITIVE_HPP - -#include <boost/mpi/config.hpp> -#include <cstddef> // size_t -#include <boost/config.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/mpi/exception.hpp> -#include <boost/mpi/detail/antiques.hpp> -#include <boost/serialization/array.hpp> -#include <vector> -#include <boost/mpi/detail/antiques.hpp> -#include <boost/mpi/allocator.hpp> - -namespace boost { namespace mpi { - -/// deserialization using MPI_Unpack - -class BOOST_MPI_DECL packed_iprimitive -{ -public: - /// the type of the buffer from which the data is unpacked upon deserialization - typedef std::vector<char, allocator<char> > buffer_type; - - packed_iprimitive(buffer_type & b, MPI_Comm const & comm, int position = 0) - : buffer_(b), - comm(comm), - position(position) - { - } - - void* address () - { - return &buffer_[0]; - } - - void const* address () const - { - return &buffer_[0]; - } - - const std::size_t& size() const - { - return size_ = buffer_.size(); - } - - void resize(std::size_t s) - { - buffer_.resize(s); - } - - void load_binary(void *address, std::size_t count) - { - load_impl(address,MPI_BYTE,count); - } - - // fast saving of arrays of fundamental types - template<class T> - void load_array(serialization::array_wrapper<T> const& x, unsigned int /* file_version */) - { - if (x.count()) - load_impl(x.address(), get_mpi_datatype(*x.address()), x.count()); - } - -/* - template<class T> - void load(serialization::array_wrapper<T> const& x) - { - load_array(x,0u); - } -*/ - - typedef is_mpi_datatype<mpl::_1> use_array_optimization; - - // default saving of primitives. - template<class T> - void load( T & t) - { - load_impl(&t, get_mpi_datatype(t), 1); - } - - template<class CharType> - void load(std::basic_string<CharType> & s) - { - unsigned int l; - load(l); - s.resize(l); - // note breaking a rule here - could be a problem on some platform - if (l) - load_impl(const_cast<CharType *>(s.data()), - get_mpi_datatype(CharType()),l); - } - -private: - - void load_impl(void * p, MPI_Datatype t, int l) - { - BOOST_MPI_CHECK_RESULT(MPI_Unpack, - (const_cast<char*>(detail::c_data(buffer_)), buffer_.size(), &position, p, l, t, comm)); - } - - buffer_type & buffer_; - mutable std::size_t size_; - MPI_Comm comm; - int position; -}; - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_PACKED_IPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/packed_oprimitive.hpp b/contrib/restricted/boost/boost/mpi/detail/packed_oprimitive.hpp deleted file mode 100644 index 4ca8e07240..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/packed_oprimitive.hpp +++ /dev/null @@ -1,127 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_PACKED_OPRIMITIVE_HPP -#define BOOST_MPI_PACKED_OPRIMITIVE_HPP - -#include <boost/mpi/config.hpp> -#include <cstddef> // size_t -#include <boost/config.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/mpi/exception.hpp> -#include <boost/mpi/detail/antiques.hpp> -#include <boost/serialization/array.hpp> -#include <boost/assert.hpp> -#include <vector> -#include <boost/mpi/allocator.hpp> - -namespace boost { namespace mpi { - -/// serialization using MPI::Pack - -class BOOST_MPI_DECL packed_oprimitive -{ -public: - /// the type of the buffer into which the data is packed upon serialization - typedef std::vector<char, allocator<char> > buffer_type; - - packed_oprimitive(buffer_type & b, MPI_Comm const & comm) - : buffer_(b), - comm(comm) - { - } - - void const * address() const - { - return &buffer_[0]; - } - - const std::size_t& size() const - { - return size_ = buffer_.size(); - } - - const std::size_t* size_ptr() const - { - return &size(); - } - - void save_binary(void const *address, std::size_t count) - { - save_impl(address,MPI_BYTE,count); - } - - // fast saving of arrays - template<class T> - void save_array(serialization::array_wrapper<T> const& x, unsigned int /* file_version */) - { - if (x.count()) - save_impl(x.address(), get_mpi_datatype(*x.address()), x.count()); - } - - typedef is_mpi_datatype<mpl::_1> use_array_optimization; - -#ifndef BOOST_NO_MEMBER_TEMPLATE_FRIENDS - friend class archive::save_access; -protected: -#else -public: -#endif - - // default saving of primitives. - template<class T> - void save(const T & t) - { - save_impl(&t, get_mpi_datatype<T>(t), 1); - } - - template<class CharType> - void save(const std::basic_string<CharType> &s) - { - unsigned int l = static_cast<unsigned int>(s.size()); - save(l); - if (l) - save_impl(s.data(),get_mpi_datatype(CharType()),s.size()); - } - -private: - - void save_impl(void const * p, MPI_Datatype t, int l) - { - // allocate enough memory - int memory_needed; - BOOST_MPI_CHECK_RESULT(MPI_Pack_size,(l,t,comm,&memory_needed)); - - int position = buffer_.size(); - buffer_.resize(position + memory_needed); - - // pack the data into the buffer - BOOST_MPI_CHECK_RESULT(MPI_Pack, - (const_cast<void*>(p),l,t, - detail::c_data(buffer_), - buffer_.size(), - &position,comm)); - // reduce the buffer size if needed - BOOST_ASSERT(std::size_t(position) <= buffer_.size()); - if (std::size_t(position) < buffer_.size()) - buffer_.resize(position); - } - - static buffer_type::value_type* get_data(buffer_type& b) - { - return b.empty() ? 0 : &(b[0]); - } - - buffer_type& buffer_; - mutable std::size_t size_; - MPI_Comm comm; -}; - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_PACKED_OPRIMITIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/point_to_point.hpp b/contrib/restricted/boost/boost/mpi/detail/point_to_point.hpp deleted file mode 100644 index 06db34ce94..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/point_to_point.hpp +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright 2005 Douglas Gregor. - -// 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) - -// Message Passing Interface 1.1 -- Section 3. MPI Point-to-point -#ifndef BOOST_MPI_DETAIL_POINT_TO_POINT_HPP -#define BOOST_MPI_DETAIL_POINT_TO_POINT_HPP - -// For (de-)serializing sends and receives -#include <boost/mpi/config.hpp> -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/packed_iarchive.hpp> - -namespace boost { namespace mpi { namespace detail { - -/** Sends a packed archive using MPI_Send. */ -BOOST_MPI_DECL void -packed_archive_send(MPI_Comm comm, int dest, int tag, - const packed_oarchive& ar); - -/** Sends a packed archive using MPI_Isend. - * - * This routine may split sends into multiple packets. The MPI_Request - * for each packet will be placed into the out_requests array, up to - * num_out_requests packets. The number of packets sent will be - * returned from the function. - * - * @pre num_out_requests >= 2 - */ -BOOST_MPI_DECL int -packed_archive_isend(MPI_Comm comm, int dest, int tag, - const packed_oarchive& ar, - MPI_Request* out_requests, int num_out_requests); - -/** - * \overload - */ -BOOST_MPI_DECL int -packed_archive_isend(MPI_Comm comm, int dest, int tag, - const packed_iarchive& ar, - MPI_Request* out_requests, int num_out_requests); - -/** Receives a packed archive using MPI_Recv. */ -BOOST_MPI_DECL void -packed_archive_recv(MPI_Comm comm, int source, int tag, packed_iarchive& ar, - MPI_Status& status); - -} } } // end namespace boost::mpi::detail - -#endif // BOOST_MPI_DETAIL_POINT_TO_POINT_HPP diff --git a/contrib/restricted/boost/boost/mpi/detail/text_skeleton_oarchive.hpp b/contrib/restricted/boost/boost/mpi/detail/text_skeleton_oarchive.hpp deleted file mode 100644 index 5bf48ebf9d..0000000000 --- a/contrib/restricted/boost/boost/mpi/detail/text_skeleton_oarchive.hpp +++ /dev/null @@ -1,50 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer - -// 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: Matthias Troyer - -#ifndef BOOST_MPI_TEXT_SKELETON_OARCHIVE_HPP -#define BOOST_MPI_TEXT_SKELETON_OARCHIVE_HPP - -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/archive/text_oarchive.hpp> -#include <boost/mpi/detail/forward_skeleton_oarchive.hpp> -#include <boost/mpi/detail/ignore_oprimitive.hpp> -#include <boost/archive/detail/register_archive.hpp> - -namespace boost { namespace mpi { - -// an archive that writes a text skeleton into a stream - -class text_skeleton_oarchive - : public detail::ignore_oprimitive, - public detail::forward_skeleton_oarchive<text_skeleton_oarchive,boost::archive::text_oarchive> -{ -public: - text_skeleton_oarchive(std::ostream & s, unsigned int flags = 0) - : detail::forward_skeleton_oarchive<text_skeleton_oarchive,boost::archive::text_oarchive>(skeleton_archive_) - , skeleton_archive_(s,flags) - {} - -private: - boost::archive::text_oarchive skeleton_archive_; -}; - -namespace detail { - -typedef boost::mpi::detail::forward_skeleton_oarchive<boost::mpi::text_skeleton_oarchive,boost::archive::text_oarchive> type3; - -} - - -} } // end namespace boost::mpi - -// required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::text_skeleton_oarchive) -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::type3) - - -#endif // BOOST_MPI_TEXT_SKELETON_OARCHIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/environment.hpp b/contrib/restricted/boost/boost/mpi/environment.hpp deleted file mode 100644 index cb90b6d046..0000000000 --- a/contrib/restricted/boost/boost/mpi/environment.hpp +++ /dev/null @@ -1,287 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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) - -/** @file environment.hpp - * - * This header provides the @c environment class, which provides - * routines to initialize, finalization, and query the status of the - * Boost MPI environment. - */ -#ifndef BOOST_MPI_ENVIRONMENT_HPP -#define BOOST_MPI_ENVIRONMENT_HPP - -#include <boost/mpi/config.hpp> -#include <boost/noncopyable.hpp> -#include <boost/optional.hpp> -#include <string> -#include <iosfwd> - -namespace boost { namespace mpi { -namespace threading { -/** @brief specify the supported threading level. - * - * Based on MPI 2 standard/8.7.3 - */ -enum level { - /** Only one thread will execute. - */ - single = MPI_THREAD_SINGLE, - /** Only main thread will do MPI calls. - * - * The process may be multi-threaded, but only the main - * thread will make MPI calls (all MPI calls are ``funneled'' - * to the main thread). - */ - funneled = MPI_THREAD_FUNNELED, - /** Only one thread at the time do MPI calls. - * - * The process may be multi-threaded, and multiple - * threads may make MPI calls, but only one at a time: - * MPI calls are not made concurrently from two distinct - * threads (all MPI calls are ``serialized''). - */ - serialized = MPI_THREAD_SERIALIZED, - /** Multiple thread may do MPI calls. - * - * Multiple threads may call MPI, with no restrictions. - */ - multiple = MPI_THREAD_MULTIPLE -}; - -/** Formated output for threading level. */ -std::ostream& operator<<(std::ostream& out, level l); - -/** Formated input for threading level. */ -std::istream& operator>>(std::istream& in, level& l); -} // namespace threading -/** @brief Initialize, finalize, and query the MPI environment. - * - * The @c environment class is used to initialize, finalize, and - * query the MPI environment. It will typically be used in the @c - * main() function of a program, which will create a single instance - * of @c environment initialized with the arguments passed to the - * program: - * - * @code - * int main(int argc, char* argv[]) - * { - * mpi::environment env(argc, argv); - * } - * @endcode - * - * The instance of @c environment will initialize MPI (by calling @c - * MPI_Init) in its constructor and finalize MPI (by calling @c - * MPI_Finalize for normal termination or @c MPI_Abort for an - * uncaught exception) in its destructor. - * - * The use of @c environment is not mandatory. Users may choose to - * invoke @c MPI_Init and @c MPI_Finalize manually. In this case, no - * @c environment object is needed. If one is created, however, it - * will do nothing on either construction or destruction. - */ -class BOOST_MPI_DECL environment : noncopyable { -public: -#ifdef BOOST_MPI_HAS_NOARG_INITIALIZATION - /** Initialize the MPI environment. - * - * If the MPI environment has not already been initialized, - * initializes MPI with a call to @c MPI_Init. Since this - * constructor does not take command-line arguments (@c argc and @c - * argv), it is only available when the underlying MPI - * implementation supports calling @c MPI_Init with @c NULL - * arguments, indicated by the macro @c - * BOOST_MPI_HAS_NOARG_INITIALIZATION. - * - * @param abort_on_exception When true, this object will abort the - * program if it is destructed due to an uncaught exception. - */ - explicit environment(bool abort_on_exception = true); - /** Initialize the MPI environment. - * - * If the MPI environment has not already been initialized, - * initializes MPI with a call to @c MPI_Init_thread. Since this - * constructor does not take command-line arguments (@c argc and @c - * argv), it is only available when the underlying MPI - * implementation supports calling @c MPI_Init with @c NULL - * arguments, indicated by the macro @c - * BOOST_MPI_HAS_NOARG_INITIALIZATION. - * - * @param mt_level the required level of threading support. - * - * @param abort_on_exception When true, this object will abort the - * program if it is destructed due to an uncaught exception. - */ - explicit environment(threading::level mt_level, bool abort_on_exception = true); -#endif - - /** Initialize the MPI environment. - * - * If the MPI environment has not already been initialized, - * initializes MPI with a call to @c MPI_Init. - * - * @param argc The number of arguments provided in @p argv, as - * passed into the program's @c main function. - * - * @param argv The array of argument strings passed to the program - * via @c main. - * - * @param abort_on_exception When true, this object will abort the - * program if it is destructed due to an uncaught exception. - */ - environment(int& argc, char** &argv, bool abort_on_exception = true); - - /** Initialize the MPI environment. - * - * If the MPI environment has not already been initialized, - * initializes MPI with a call to @c MPI_Init_thread. - * - * @param argc The number of arguments provided in @p argv, as - * passed into the program's @c main function. - * - * @param argv The array of argument strings passed to the program - * via @c main. - * - * @param mt_level the required level of threading support - * - * @param abort_on_exception When true, this object will abort the - * program if it is destructed due to an uncaught exception. - */ - environment(int& argc, char** &argv, threading::level mt_level, - bool abort_on_exception = true); - - /** Shuts down the MPI environment. - * - * If this @c environment object was used to initialize the MPI - * environment, and the MPI environment has not already been shut - * down (finalized), this destructor will shut down the MPI - * environment. Under normal circumstances, this only involves - * invoking @c MPI_Finalize. However, if destruction is the result - * of an uncaught exception and the @c abort_on_exception parameter - * of the constructor had the value @c true, this destructor will - * invoke @c MPI_Abort with @c MPI_COMM_WORLD to abort the entire - * MPI program with a result code of -1. - */ - ~environment(); - - /** Abort all MPI processes. - * - * Aborts all MPI processes and returns to the environment. The - * precise behavior will be defined by the underlying MPI - * implementation. This is equivalent to a call to @c MPI_Abort - * with @c MPI_COMM_WORLD. - * - * @param errcode The error code to return to the environment. - * @returns Will not return. - */ - static void abort(int errcode); - - /** Determine if the MPI environment has already been initialized. - * - * This routine is equivalent to a call to @c MPI_Initialized. - * - * @returns @c true if the MPI environment has been initialized. - */ - static bool initialized(); - - /** Determine if the MPI environment has already been finalized. - * - * The routine is equivalent to a call to @c MPI_Finalized. - * - * @returns @c true if the MPI environment has been finalized. - */ - static bool finalized(); - - /** Retrieves the maximum tag value. - * - * Returns the maximum value that may be used for the @c tag - * parameter of send/receive operations. This value will be - * somewhat smaller than the value of @c MPI_TAG_UB, because the - * Boost.MPI implementation reserves some tags for collective - * operations. - * - * @returns the maximum tag value. - */ - static int max_tag(); - - /** The tag value used for collective operations. - * - * Returns the reserved tag value used by the Boost.MPI - * implementation for collective operations. Although users are not - * permitted to use this tag to send or receive messages, it may be - * useful when monitoring communication patterns. - * - * @returns the tag value used for collective operations. - */ - static int collectives_tag(); - - /** Retrieves the rank of the host process, if one exists. - * - * If there is a host process, this routine returns the rank of - * that process. Otherwise, it returns an empty @c - * optional<int>. MPI does not define the meaning of a "host" - * process: consult the documentation for the MPI - * implementation. This routine examines the @c MPI_HOST attribute - * of @c MPI_COMM_WORLD. - * - * @returns The rank of the host process, if one exists. - */ - static optional<int> host_rank(); - - /** Retrieves the rank of a process that can perform input/output. - * - * This routine returns the rank of a process that can perform - * input/output via the standard C and C++ I/O facilities. If every - * process can perform I/O using the standard facilities, this - * routine will return @c any_source; if no process can perform - * I/O, this routine will return no value (an empty @c - * optional). This routine examines the @c MPI_IO attribute of @c - * MPI_COMM_WORLD. - * - * @returns the rank of the process that can perform I/O, @c - * any_source if every process can perform I/O, or no value if no - * process can perform I/O. - */ - static optional<int> io_rank(); - - /** Retrieve the name of this processor. - * - * This routine returns the name of this processor. The actual form - * of the name is unspecified, but may be documented by the - * underlying MPI implementation. This routine is implemented as a - * call to @c MPI_Get_processor_name. - * - * @returns the name of this processor. - */ - static std::string processor_name(); - - /** Query the current level of thread support. - */ - static threading::level thread_level(); - - /** Are we in the main thread? - */ - static bool is_main_thread(); - - /** @brief MPI version. - * - * Returns a pair with the version and sub-version number. - */ - static std::pair<int, int> version(); - -private: - /// Whether this environment object called MPI_Init - bool i_initialized; - - /// Whether we should abort if the destructor is - bool abort_on_exception; - - /// The number of reserved tags. - static const int num_reserved_tags = 1; -}; - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_ENVIRONMENT_HPP diff --git a/contrib/restricted/boost/boost/mpi/exception.hpp b/contrib/restricted/boost/boost/mpi/exception.hpp deleted file mode 100644 index 62de0cadde..0000000000 --- a/contrib/restricted/boost/boost/mpi/exception.hpp +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -/** @file exception.hpp - * - * This header provides exception classes that report MPI errors to - * the user and macros that translate MPI error codes into Boost.MPI - * exceptions. - */ -#ifndef BOOST_MPI_EXCEPTION_HPP -#define BOOST_MPI_EXCEPTION_HPP - -#include <boost/mpi/config.hpp> -#include <exception> -#include <cassert> -#include <string> -#include <boost/config.hpp> -#include <boost/throw_exception.hpp> - -namespace boost { namespace mpi { - -/** @brief Catch-all exception class for MPI errors. - * - * Instances of this class will be thrown when an MPI error - * occurs. MPI failures that trigger these exceptions may or may not - * be recoverable, depending on the underlying MPI - * implementation. Consult the documentation for your MPI - * implementation to determine the effect of MPI errors. - */ -class BOOST_MPI_DECL exception : public std::exception -{ - public: - /** - * Build a new @c exception exception. - * - * @param routine The MPI routine in which the error - * occurred. This should be a pointer to a string constant: it - * will not be copied. - * - * @param result_code The result code returned from the MPI - * routine that aborted with an error. - */ - exception(const char* routine, int result_code); - - virtual ~exception(); - - /** - * A description of the error that occurred. - */ - virtual const char * what () const noexcept - { - return this->message.c_str(); - } - - /** Retrieve the name of the MPI routine that reported the error. */ - const char* routine() const { return routine_; } - - /** - * @brief Retrieve the result code returned from the MPI routine - * that reported the error. - */ - int result_code() const { return result_code_; } - - /** - * @brief Returns the MPI error class associated with the error that - * triggered this exception. - */ - int error_class() const - { - int result; - MPI_Error_class(result_code_, &result); - return result; - } - - protected: - /// The MPI routine that triggered the error - const char* routine_; - - /// The failed result code reported by the MPI implementation. - int result_code_; - - /// The formatted error message - std::string message; -}; - -/** - * Call the MPI routine MPIFunc with arguments Args (surrounded by - * parentheses). If the result is not MPI_SUCCESS, use - * boost::throw_exception to throw an exception or abort, depending on - * BOOST_NO_EXCEPTIONS. - */ -#define BOOST_MPI_CHECK_RESULT( MPIFunc, Args ) \ - { \ - int _check_result = MPIFunc Args; \ - assert(_check_result == MPI_SUCCESS); \ - if (_check_result != MPI_SUCCESS) \ - boost::throw_exception(boost::mpi::exception(#MPIFunc, \ - _check_result)); \ - } - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_EXCEPTION_HPP diff --git a/contrib/restricted/boost/boost/mpi/graph_communicator.hpp b/contrib/restricted/boost/boost/mpi/graph_communicator.hpp deleted file mode 100644 index 6cafb1fea9..0000000000 --- a/contrib/restricted/boost/boost/mpi/graph_communicator.hpp +++ /dev/null @@ -1,575 +0,0 @@ -// Copyright (C) 2007 Trustees of Indiana University - -// Authors: Douglas Gregor -// Andrew Lumsdaine - -// 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) - -/** @file graph_communicator.hpp - * - * This header defines facilities to support MPI communicators with - * graph topologies, using the graph interface defined by the Boost - * Graph Library. One can construct a communicator whose topology is - * described by any graph meeting the requirements of the Boost Graph - * Library's graph concepts. Likewise, any communicator that has a - * graph topology can be viewed as a graph by the Boost Graph - * Library, permitting one to use the BGL's graph algorithms on the - * process topology. - */ -#ifndef BOOST_MPI_GRAPH_COMMUNICATOR_HPP -#define BOOST_MPI_GRAPH_COMMUNICATOR_HPP - -#include <boost/mpi/communicator.hpp> -#include <vector> -#include <utility> - -// Headers required to implement graph topologies -#include <boost/graph/graph_traits.hpp> -#include <boost/graph/properties.hpp> -#include <boost/property_map/property_map.hpp> -#include <boost/iterator/counting_iterator.hpp> -#include <boost/graph/iteration_macros.hpp> -#include <boost/shared_array.hpp> -#include <boost/assert.hpp> - -namespace boost { namespace mpi { - -/** - * @brief An MPI communicator with a graph topology. - * - * A @c graph_communicator is a communicator whose topology is - * expressed as a graph. Graph communicators have the same - * functionality as (intra)communicators, but also allow one to query - * the relationships among processes. Those relationships are - * expressed via a graph, using the interface defined by the Boost - * Graph Library. The @c graph_communicator class meets the - * requirements of the BGL Graph, Incidence Graph, Adjacency Graph, - * Vertex List Graph, and Edge List Graph concepts. - */ -class BOOST_MPI_DECL graph_communicator : public communicator -{ - friend class communicator; - - /** - * INTERNAL ONLY - * - * Construct a graph communicator given a shared pointer to the - * underlying MPI_Comm. This operation is used for "casting" from a - * communicator to a graph communicator. - */ - explicit graph_communicator(const shared_ptr<MPI_Comm>& comm_ptr) - { -#ifndef BOOST_DISABLE_ASSERTS - int status; - BOOST_MPI_CHECK_RESULT(MPI_Topo_test, ((MPI_Comm)*this, &status)); - BOOST_ASSERT(status == MPI_GRAPH); -#endif - this->comm_ptr = comm_ptr; - } - -public: - /** - * Build a new Boost.MPI graph communicator based on the MPI - * communicator @p comm with graph topology. - * - * @p comm may be any valid MPI communicator. If @p comm is - * MPI_COMM_NULL, an empty communicator (that cannot be used for - * communication) is created and the @p kind parameter is - * ignored. Otherwise, the @p kind parameter determines how the - * Boost.MPI communicator will be related to @p comm: - * - * - If @p kind is @c comm_duplicate, duplicate @c comm to create - * a new communicator. This new communicator will be freed when - * the Boost.MPI communicator (and all copies of it) is - * destroyed. This option is only permitted if the underlying MPI - * implementation supports MPI 2.0; duplication of - * intercommunicators is not available in MPI 1.x. - * - * - If @p kind is @c comm_take_ownership, take ownership of @c - * comm. It will be freed automatically when all of the Boost.MPI - * communicators go out of scope. - * - * - If @p kind is @c comm_attach, this Boost.MPI communicator - * will reference the existing MPI communicator @p comm but will - * not free @p comm when the Boost.MPI communicator goes out of - * scope. This option should only be used when the communicator is - * managed by the user. - */ - graph_communicator(const MPI_Comm& comm, comm_create_kind kind) - : communicator(comm, kind) - { -#ifndef BOOST_DISABLE_ASSERTS - int status; - BOOST_MPI_CHECK_RESULT(MPI_Topo_test, ((MPI_Comm)*this, &status)); - BOOST_ASSERT(status == MPI_GRAPH); -#endif - } - - /** - * Create a new communicator whose topology is described by the - * given graph. The indices of the vertices in the graph will be - * assumed to be the ranks of the processes within the - * communicator. There may be fewer vertices in the graph than - * there are processes in the communicator; in this case, the - * resulting communicator will be a NULL communicator. - * - * @param comm The communicator that the new, graph communicator - * will be based on. - * - * @param graph Any type that meets the requirements of the - * Incidence Graph and Vertex List Graph concepts from the Boost Graph - * Library. This structure of this graph will become the topology - * of the communicator that is returned. - * - * @param reorder Whether MPI is permitted to re-order the process - * ranks within the returned communicator, to better optimize - * communication. If false, the ranks of each process in the - * returned process will match precisely the rank of that process - * within the original communicator. - */ - template<typename Graph> - explicit - graph_communicator(const communicator& comm, const Graph& graph, - bool reorder = false); - - /** - * Create a new communicator whose topology is described by the - * given graph. The rank map (@p rank) gives the mapping from - * vertices in the graph to ranks within the communicator. There - * may be fewer vertices in the graph than there are processes in - * the communicator; in this case, the resulting communicator will - * be a NULL communicator. - * - * @param comm The communicator that the new, graph communicator - * will be based on. The ranks in @c rank refer to the processes in - * this communicator. - * - * @param graph Any type that meets the requirements of the - * Incidence Graph and Vertex List Graph concepts from the Boost Graph - * Library. This structure of this graph will become the topology - * of the communicator that is returned. - * - * @param rank This map translates vertices in the @c graph into - * ranks within the current communicator. It must be a Readable - * Property Map (see the Boost Property Map library) whose key type - * is the vertex type of the @p graph and whose value type is @c - * int. - * - * @param reorder Whether MPI is permitted to re-order the process - * ranks within the returned communicator, to better optimize - * communication. If false, the ranks of each process in the - * returned process will match precisely the rank of that process - * within the original communicator. - */ - template<typename Graph, typename RankMap> - explicit - graph_communicator(const communicator& comm, const Graph& graph, - RankMap rank, bool reorder = false); - -protected: - /** - * INTERNAL ONLY - * - * Used by the constructors to create the new communicator with a - * graph topology. - */ - template<typename Graph, typename RankMap> - void - setup_graph(const communicator& comm, const Graph& graph, RankMap rank, - bool reorder); -}; - -/**************************************************************************** - * Implementation Details * - ****************************************************************************/ - -template<typename Graph> -graph_communicator::graph_communicator(const communicator& comm, - const Graph& graph, - bool reorder) -{ - this->setup_graph(comm, graph, get(vertex_index, graph), reorder); -} - -template<typename Graph, typename RankMap> -graph_communicator::graph_communicator(const communicator& comm, - const Graph& graph, - RankMap rank, bool reorder) -{ - this->setup_graph(comm, graph, rank, reorder); -} - - -template<typename Graph, typename RankMap> -void -graph_communicator::setup_graph(const communicator& comm, const Graph& graph, - RankMap rank, bool reorder) -{ - typedef typename graph_traits<Graph>::vertex_descriptor vertex_descriptor; - - // Build a mapping from ranks to vertices - std::vector<vertex_descriptor> vertex_with_rank(num_vertices(graph)); - if (vertex_with_rank.empty()) - return; - - BGL_FORALL_VERTICES_T(v, graph, Graph) - vertex_with_rank[get(rank, v)] = v; - - // Build the representation of the graph required by - // MPI_Graph_create. - std::vector<int> indices(num_vertices(graph)); - std::vector<int> edges; - int nvertices = indices.size(); - for (int vertex_index = 0; vertex_index < nvertices; ++vertex_index) { - vertex_descriptor v = vertex_with_rank[vertex_index]; - - BGL_FORALL_OUTEDGES_T(v, e, graph, Graph) - edges.push_back(get(rank, target(e, graph))); - - indices[vertex_index] = edges.size(); - } - - // Create the new communicator - MPI_Comm newcomm; - BOOST_MPI_CHECK_RESULT(MPI_Graph_create, - ((MPI_Comm)comm, - nvertices, - &indices[0], - edges.empty()? (int*)0 : &edges[0], - reorder, - &newcomm)); - this->comm_ptr.reset(new MPI_Comm(newcomm), comm_free()); -} - -/**************************************************************************** - * Communicator with Graph Topology as BGL Graph * - ****************************************************************************/ -namespace detail { - /** - * INTERNAL ONLY - * - * The iterator used to access the outgoing edges within a - * communicator's graph topology. - */ - class comm_out_edge_iterator - : public iterator_facade<comm_out_edge_iterator, - std::pair<int, int>, - random_access_traversal_tag, - const std::pair<int, int>&, - int> - { - public: - comm_out_edge_iterator() { } - - comm_out_edge_iterator(int source, shared_array<int> neighbors, int index) - : edge(source, -1), neighbors(neighbors), index(index) { } - - protected: - friend class boost::iterator_core_access; - - const std::pair<int, int>& dereference() const - { - edge.second = neighbors[index]; - return edge; - } - - bool equal(const comm_out_edge_iterator& other) const - { - return (edge.first == other.edge.first - && index == other.index); - } - - void increment() { ++index; } - - void decrement() { --index; } - - void advance(int n) { index += n; } - - int distance_to(const comm_out_edge_iterator& other) const - { - return other.index - index; - } - - mutable std::pair<int, int> edge; - shared_array<int> neighbors; - int index; - }; - - /** - * INTERNAL ONLY - * - * The iterator used to access the adjacent vertices within a - * communicator's graph topology. - */ - class comm_adj_iterator - : public iterator_facade<comm_adj_iterator, - int, - random_access_traversal_tag, - int, - int> - { - public: - comm_adj_iterator() { } - - comm_adj_iterator(shared_array<int> neighbors, int index) - : neighbors(neighbors), index(index) { } - - protected: - friend class boost::iterator_core_access; - - int dereference() const { return neighbors[index]; } - - bool equal(const comm_adj_iterator& other) const - { - return (neighbors == other.neighbors - && index == other.index); - } - - void increment() { ++index; } - - void decrement() { --index; } - - void advance(int n) { index += n; } - - int distance_to(const comm_adj_iterator& other) const - { - return other.index - index; - } - - shared_array<int> neighbors; - int index; - }; - - /** - * INTERNAL ONLY - * - * The iterator used to access the edges in a communicator's graph - * topology. - */ - class comm_edge_iterator - : public iterator_facade<comm_edge_iterator, - std::pair<int, int>, - forward_traversal_tag, - const std::pair<int, int>&, - int> - { - public: - comm_edge_iterator() { } - - /// Constructor for a past-the-end iterator - comm_edge_iterator(int nedges) : edge_index(nedges) { } - - comm_edge_iterator(shared_array<int> indices, shared_array<int> edges) - : indices(indices), edges(edges), edge_index(0), edge(0, 0) - { } - - protected: - friend class boost::iterator_core_access; - - const std::pair<int, int>& dereference() const - { - while (edge_index == indices[edge.first]) - ++edge.first; - edge.second = edges[edge_index]; - return edge; - } - - bool equal(const comm_edge_iterator& other) const - { - return edge_index == other.edge_index; - } - - void increment() - { - ++edge_index; - } - - shared_array<int> indices; - shared_array<int> edges; - int edge_index; - mutable std::pair<int, int> edge; - }; - -} // end namespace detail - -// Incidence Graph requirements - -/** - * @brief Returns the source vertex from an edge in the graph topology - * of a communicator. - */ -inline int source(const std::pair<int, int>& edge, const graph_communicator&) -{ - return edge.first; -} - -/** - * @brief Returns the target vertex from an edge in the graph topology - * of a communicator. - */ -inline int target(const std::pair<int, int>& edge, const graph_communicator&) -{ - return edge.second; -} - -/** - * @brief Returns an iterator range containing all of the edges - * outgoing from the given vertex in a graph topology of a - * communicator. - */ -std::pair<detail::comm_out_edge_iterator, detail::comm_out_edge_iterator> -out_edges(int vertex, const graph_communicator& comm); - - -/** - * @brief Returns the out-degree of a vertex in the graph topology of - * a communicator. - */ -int out_degree(int vertex, const graph_communicator& comm); - -// Adjacency Graph requirements - -/** - * @brief Returns an iterator range containing all of the neighbors of - * the given vertex in the communicator's graph topology. - */ -std::pair<detail::comm_adj_iterator, detail::comm_adj_iterator> -adjacent_vertices(int vertex, const graph_communicator& comm); - -// Vertex List Graph requirements - -/** - * @brief Returns an iterator range that contains all of the vertices - * with the communicator's graph topology, i.e., all of the process - * ranks in the communicator. - */ -inline std::pair<counting_iterator<int>, counting_iterator<int> > -vertices(const graph_communicator& comm) -{ - return std::make_pair(counting_iterator<int>(0), - counting_iterator<int>(comm.size())); -} - -/** - * @brief Returns the number of vertices within the graph topology of - * the communicator, i.e., the number of processes in the - * communicator. - */ -inline int num_vertices(const graph_communicator& comm) { return comm.size(); } - -// Edge List Graph requirements - -/** - * @brief Returns an iterator range that contains all of the edges - * with the communicator's graph topology. - */ -std::pair<detail::comm_edge_iterator, detail::comm_edge_iterator> -edges(const graph_communicator& comm); - -/** - * @brief Returns the number of edges in the communicator's graph - * topology. - */ -int num_edges(const graph_communicator& comm); - -// Property Graph requirements - -/** - * @brief Returns a property map that maps from vertices in a - * communicator's graph topology to their index values. - * - * Since the vertices are ranks in the communicator, the returned - * property map is the identity property map. - */ -inline identity_property_map get(vertex_index_t, const graph_communicator&) -{ - return identity_property_map(); -} - -/** - * @brief Returns the index of a vertex in the communicator's graph - * topology. - * - * Since the vertices are ranks in the communicator, this is the - * identity function. - */ -inline int get(vertex_index_t, const graph_communicator&, int vertex) -{ - return vertex; -} - -} } // end namespace boost::mpi - -namespace boost { - -/** - * @brief Traits structure that allows a communicator with graph - * topology to be view as a graph by the Boost Graph Library. - * - * The specialization of @c graph_traits for an MPI communicator - * allows a communicator with graph topology to be viewed as a - * graph. An MPI communicator with graph topology meets the - * requirements of the Graph, Incidence Graph, Adjacency Graph, Vertex - * List Graph, and Edge List Graph concepts from the Boost Graph - * Library. - */ -template<> -struct graph_traits<mpi::graph_communicator> { - // Graph concept requirements - typedef int vertex_descriptor; - typedef std::pair<int, int> edge_descriptor; - typedef directed_tag directed_category; - typedef disallow_parallel_edge_tag edge_parallel_category; - - /** - * INTERNAL ONLY - */ - struct traversal_category - : incidence_graph_tag, - adjacency_graph_tag, - vertex_list_graph_tag, - edge_list_graph_tag - { - }; - - /** - * @brief Returns a vertex descriptor that can never refer to any - * valid vertex. - */ - static vertex_descriptor null_vertex() { return -1; } - - // Incidence Graph requirements - typedef mpi::detail::comm_out_edge_iterator out_edge_iterator; - typedef int degree_size_type; - - // Adjacency Graph requirements - typedef mpi::detail::comm_adj_iterator adjacency_iterator; - - // Vertex List Graph requirements - typedef counting_iterator<int> vertex_iterator; - typedef int vertices_size_type; - - // Edge List Graph requirements - typedef mpi::detail::comm_edge_iterator edge_iterator; - typedef int edges_size_type; -}; - -// Property Graph requirements - -/** - * INTERNAL ONLY - */ -template<> -struct property_map<mpi::graph_communicator, vertex_index_t> -{ - typedef identity_property_map type; - typedef identity_property_map const_type; -}; - -} // end namespace boost - - - -#endif // BOOST_MPI_GRAPH_COMMUNICATOR_HPP diff --git a/contrib/restricted/boost/boost/mpi/group.hpp b/contrib/restricted/boost/boost/mpi/group.hpp deleted file mode 100644 index 103b35a118..0000000000 --- a/contrib/restricted/boost/boost/mpi/group.hpp +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (C) 2007 Trustees of Indiana University - -// Authors: Douglas Gregor -// Andrew Lumsdaine - -// 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) - -/** @file group.hpp - * - * This header defines the @c group class, which allows one to - * manipulate and query groups of processes. - */ -#ifndef BOOST_MPI_GROUP_HPP -#define BOOST_MPI_GROUP_HPP - -#include <boost/mpi/exception.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/optional.hpp> -#include <vector> - -namespace boost { namespace mpi { - -/** - * @brief A @c group is a representation of a subset of the processes - * within a @c communicator. - * - * The @c group class allows one to create arbitrary subsets of the - * processes within a communicator. One can compute the union, - * intersection, or difference of two groups, or create new groups by - * specifically including or excluding certain processes. Given a - * group, one can create a new communicator containing only the - * processes in that group. - */ -class BOOST_MPI_DECL group -{ -public: - /** - * @brief Constructs an empty group. - */ - group() : group_ptr() { } - - /** - * @brief Constructs a group from an @c MPI_Group. - * - * This routine allows one to construct a Boost.MPI @c group from a - * C @c MPI_Group. The @c group object can (optionally) adopt the @c - * MPI_Group, after which point the @c group object becomes - * responsible for freeing the @c MPI_Group when the last copy of @c - * group disappears. - * - * @param in_group The @c MPI_Group used to construct this @c group. - * - * @param adopt Whether the @c group should adopt the @c - * MPI_Group. When true, the @c group object (or one of its copies) - * will free the group (via @c MPI_Comm_free) when the last copy is - * destroyed. Otherwise, the user is responsible for calling @c - * MPI_Group_free. - */ - group(const MPI_Group& in_group, bool adopt); - - /** - * @brief Determine the rank of the calling process in the group. - * - * This routine is equivalent to @c MPI_Group_rank. - * - * @returns The rank of the calling process in the group, which will - * be a value in [0, size()). If the calling process is not in the - * group, returns an empty value. - */ - optional<int> rank() const; - - /** - * @brief Determine the number of processes in the group. - * - * This routine is equivalent to @c MPI_Group_size. - * - * @returns The number of processes in the group. - */ - int size() const; - - /** - * @brief Translates the ranks from one group into the ranks of the - * same processes in another group. - * - * This routine translates each of the integer rank values in the - * iterator range @c [first, last) from the current group into rank - * values of the corresponding processes in @p to_group. The - * corresponding rank values are written via the output iterator @c - * out. When there is no correspondence between a rank in the - * current group and a rank in @c to_group, the value @c - * MPI_UNDEFINED is written to the output iterator. - * - * @param first Beginning of the iterator range of ranks in the - * current group. - * - * @param last Past the end of the iterator range of ranks in the - * current group. - * - * @param to_group The group that we are translating ranks to. - * - * @param out The output iterator to which the translated ranks will - * be written. - * - * @returns the output iterator, which points one step past the last - * rank written. - */ - template<typename InputIterator, typename OutputIterator> - OutputIterator translate_ranks(InputIterator first, InputIterator last, - const group& to_group, OutputIterator out); - - /** - * @brief Determines whether the group is non-empty. - * - * @returns True if the group is not empty, false if it is empty. - */ - operator bool() const { return (bool)group_ptr; } - - /** - * @brief Retrieves the underlying @c MPI_Group associated with this - * group. - * - * @returns The @c MPI_Group handle manipulated by this object. If - * this object represents the empty group, returns @c - * MPI_GROUP_EMPTY. - */ - operator MPI_Group() const - { - if (group_ptr) - return *group_ptr; - else - return MPI_GROUP_EMPTY; - } - - /** - * @brief Creates a new group including a subset of the processes - * in the current group. - * - * This routine creates a new @c group which includes only those - * processes in the current group that are listed in the integer - * iterator range @c [first, last). Equivalent to @c - * MPI_Group_incl. - * - * @c first The beginning of the iterator range of ranks to include. - * - * @c last Past the end of the iterator range of ranks to include. - * - * @returns A new group containing those processes with ranks @c - * [first, last) in the current group. - */ - template<typename InputIterator> - group include(InputIterator first, InputIterator last); - - /** - * @brief Creates a new group from all of the processes in the - * current group, exluding a specific subset of the processes. - * - * This routine creates a new @c group which includes all of the - * processes in the current group except those whose ranks are - * listed in the integer iterator range @c [first, - * last). Equivalent to @c MPI_Group_excl. - * - * @c first The beginning of the iterator range of ranks to exclude. - * - * @c last Past the end of the iterator range of ranks to exclude. - * - * @returns A new group containing all of the processes in the - * current group except those processes with ranks @c [first, last) - * in the current group. - */ - template<typename InputIterator> - group exclude(InputIterator first, InputIterator last); - - -protected: - /** - * INTERNAL ONLY - * - * Function object that frees an MPI group and deletes the - * memory associated with it. Intended to be used as a deleter with - * shared_ptr. - */ - struct group_free - { - void operator()(MPI_Group* comm) const - { - int finalized; - BOOST_MPI_CHECK_RESULT(MPI_Finalized, (&finalized)); - if (!finalized) - BOOST_MPI_CHECK_RESULT(MPI_Group_free, (comm)); - delete comm; - } - }; - - /** - * The underlying MPI group. This is a shared pointer, so the actual - * MPI group which will be shared among all related instances of the - * @c group class. When there are no more such instances, the group - * will be automatically freed. - */ - shared_ptr<MPI_Group> group_ptr; -}; - -/** - * @brief Determines whether two process groups are identical. - * - * Equivalent to calling @c MPI_Group_compare and checking whether the - * result is @c MPI_IDENT. - * - * @returns True when the two process groups contain the same - * processes in the same order. - */ -BOOST_MPI_DECL bool operator==(const group& g1, const group& g2); - -/** - * @brief Determines whether two process groups are not identical. - * - * Equivalent to calling @c MPI_Group_compare and checking whether the - * result is not @c MPI_IDENT. - * - * @returns False when the two process groups contain the same - * processes in the same order. - */ -inline bool operator!=(const group& g1, const group& g2) -{ - return !(g1 == g2); -} - -/** - * @brief Computes the union of two process groups. - * - * This routine returns a new @c group that contains all processes - * that are either in group @c g1 or in group @c g2 (or both). The - * processes that are in @c g1 will be first in the resulting group, - * followed by the processes from @c g2 (but not also in @c - * g1). Equivalent to @c MPI_Group_union. - */ -BOOST_MPI_DECL group operator|(const group& g1, const group& g2); - -/** - * @brief Computes the intersection of two process groups. - * - * This routine returns a new @c group that contains all processes - * that are in group @c g1 and in group @c g2, ordered in the same way - * as @c g1. Equivalent to @c MPI_Group_intersection. - */ -BOOST_MPI_DECL group operator&(const group& g1, const group& g2); - -/** - * @brief Computes the difference between two process groups. - * - * This routine returns a new @c group that contains all processes - * that are in group @c g1 but not in group @c g2, ordered in the same way - * as @c g1. Equivalent to @c MPI_Group_difference. - */ -BOOST_MPI_DECL group operator-(const group& g1, const group& g2); - -/************************************************************************ - * Implementation details * - ************************************************************************/ -template<typename InputIterator, typename OutputIterator> -OutputIterator -group::translate_ranks(InputIterator first, InputIterator last, - const group& to_group, OutputIterator out) -{ - std::vector<int> in_array(first, last); - if (in_array.empty()) - return out; - - std::vector<int> out_array(in_array.size()); - BOOST_MPI_CHECK_RESULT(MPI_Group_translate_ranks, - ((MPI_Group)*this, - in_array.size(), - &in_array[0], - (MPI_Group)to_group, - &out_array[0])); - - for (std::vector<int>::size_type i = 0, n = out_array.size(); i < n; ++i) - *out++ = out_array[i]; - return out; -} - -/** - * INTERNAL ONLY - * - * Specialization of translate_ranks that handles the one case where - * we can avoid any memory allocation or copying. - */ -template<> -BOOST_MPI_DECL int* -group::translate_ranks(int* first, int* last, const group& to_group, int* out); - -template<typename InputIterator> -group group::include(InputIterator first, InputIterator last) -{ - if (first == last) - return group(); - - std::vector<int> ranks(first, last); - MPI_Group result; - BOOST_MPI_CHECK_RESULT(MPI_Group_incl, - ((MPI_Group)*this, ranks.size(), &ranks[0], &result)); - return group(result, /*adopt=*/true); -} - -/** - * INTERNAL ONLY - * - * Specialization of group::include that handles the one case where we - * can avoid any memory allocation or copying before creating the - * group. - */ -template<> BOOST_MPI_DECL group group::include(int* first, int* last); - -template<typename InputIterator> -group group::exclude(InputIterator first, InputIterator last) -{ - if (first == last) - return group(); - - std::vector<int> ranks(first, last); - MPI_Group result; - BOOST_MPI_CHECK_RESULT(MPI_Group_excl, - ((MPI_Group)*this, ranks.size(), &ranks[0], &result)); - return group(result, /*adopt=*/true); -} - -/** - * INTERNAL ONLY - * - * Specialization of group::exclude that handles the one case where we - * can avoid any memory allocation or copying before creating the - * group. - */ -template<> BOOST_MPI_DECL group group::exclude(int* first, int* last); - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_GROUP_HPP diff --git a/contrib/restricted/boost/boost/mpi/inplace.hpp b/contrib/restricted/boost/boost/mpi/inplace.hpp deleted file mode 100644 index d84d07db59..0000000000 --- a/contrib/restricted/boost/boost/mpi/inplace.hpp +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (C) 2005-2006 Alain Miniussi <alain.miniussi -at- oca.eu>. - -// 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) - -// Message Passing Interface 1.1 -- Section 4. MPI Collectives - -/** @file inplace.hpp - * - * This header provides helpers to indicate to MPI collective operation - * that a buffer can be use both as an input and output. - */ -#ifndef BOOST_MPI_INPLACE_HPP -#define BOOST_MPI_INPLACE_HPP - -#include <boost/mpi/communicator.hpp> -#include <vector> - -namespace boost { namespace mpi { - -/** - * @brief Wrapper type to explicitly indicate that a input data - * can be overriden with an output value. - */ -template <typename T> -struct inplace_t { - inplace_t(T& inout) : buffer(inout) {} - T& buffer; -}; - -template <typename T> -struct inplace_t<T*> { - inplace_t(T* inout) : buffer(inout) {} - T* buffer; -}; - - -/** - * @brief Wrapp a input data to indicate that it can be overriden - * with an ouput value. - * @param inout the contributing input value, it will be overriden - * with the output value where one is expected. If it is a pointer, - * the number of elements will be provided separatly. - * @returns The wrapped value or pointer. - */ -template<typename T> -inplace_t<T> -inplace(T& inout) { - return inplace_t<T>(inout); -} -/** - * \overload - */ -template<typename T> -inplace_t<T*> -inplace(T* inout) { - return inplace_t<T*>(inout); -} -} } // end namespace boost::mpi - -#endif // BOOST_MPI_INPLACE_HPP - diff --git a/contrib/restricted/boost/boost/mpi/intercommunicator.hpp b/contrib/restricted/boost/boost/mpi/intercommunicator.hpp deleted file mode 100644 index ad246b595b..0000000000 --- a/contrib/restricted/boost/boost/mpi/intercommunicator.hpp +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (C) 2007 The Trustees of Indiana University. - -// Authors: Douglas Gregor -// Andrew Lumsdaine - -// 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) - -/** @file intercommunicator.hpp - * - * This header defines the @c intercommunicator class, which permits - * communication between different process groups. - */ -#ifndef BOOST_MPI_INTERCOMMUNICATOR_HPP -#define BOOST_MPI_INTERCOMMUNICATOR_HPP - -#include <boost/mpi/communicator.hpp> - -namespace boost { namespace mpi { - -/** - * INTERNAL ONLY - * - * Forward declaration of the MPI "group" representation, for use in - * the description of the @c intercommunicator class. - */ -class group; - -/** - * @brief Communication facilities among processes in different - * groups. - * - * The @c intercommunicator class provides communication facilities - * among processes from different groups. An intercommunicator is - * always associated with two process groups: one "local" process - * group, containing the process that initiates an MPI operation - * (e.g., the sender in a @c send operation), and one "remote" process - * group, containing the process that is the target of the MPI - * operation. - * - * While intercommunicators have essentially the same point-to-point - * operations as intracommunicators (the latter communicate only - * within a single process group), all communication with - * intercommunicators occurs between the processes in the local group - * and the processes in the remote group; communication within a group - * must use a different (intra-)communicator. - * - */ -class BOOST_MPI_DECL intercommunicator : public communicator -{ -private: - friend class communicator; - - /** - * INTERNAL ONLY - * - * Construct an intercommunicator given a shared pointer to the - * underlying MPI_Comm. This operation is used for "casting" from a - * communicator to an intercommunicator. - */ - explicit intercommunicator(const shared_ptr<MPI_Comm>& cp) - { - this->comm_ptr = cp; - } - -public: - /** - * Build a new Boost.MPI intercommunicator based on the MPI - * intercommunicator @p comm. - * - * @p comm may be any valid MPI intercommunicator. If @p comm is - * MPI_COMM_NULL, an empty communicator (that cannot be used for - * communication) is created and the @p kind parameter is - * ignored. Otherwise, the @p kind parameter determines how the - * Boost.MPI communicator will be related to @p comm: - * - * - If @p kind is @c comm_duplicate, duplicate @c comm to create - * a new communicator. This new communicator will be freed when - * the Boost.MPI communicator (and all copies of it) is - * destroyed. This option is only permitted if the underlying MPI - * implementation supports MPI 2.0; duplication of - * intercommunicators is not available in MPI 1.x. - * - * - If @p kind is @c comm_take_ownership, take ownership of @c - * comm. It will be freed automatically when all of the Boost.MPI - * communicators go out of scope. - * - * - If @p kind is @c comm_attach, this Boost.MPI communicator - * will reference the existing MPI communicator @p comm but will - * not free @p comm when the Boost.MPI communicator goes out of - * scope. This option should only be used when the communicator is - * managed by the user. - */ - intercommunicator(const MPI_Comm& comm, comm_create_kind kind) - : communicator(comm, kind) { } - - /** - * Constructs a new intercommunicator whose local group is @p local - * and whose remote group is @p peer. The intercommunicator can then - * be used to communicate between processes in the two groups. This - * constructor is equivalent to a call to @c MPI_Intercomm_create. - * - * @param local The intracommunicator containing all of the - * processes that will go into the local group. - * - * @param local_leader The rank within the @p local - * intracommunicator that will serve as its leader. - * - * @param peer The intracommunicator containing all of the processes - * that will go into the remote group. - * - * @param remote_leader The rank within the @p peer group that will - * serve as its leader. - */ - intercommunicator(const communicator& local, int local_leader, - const communicator& peer, int remote_leader); - - /** - * Returns the size of the local group, i.e., the number of local - * processes that are part of the group. - */ - int local_size() const { return this->size(); } - - /** - * Returns the local group, containing all of the local processes in - * this intercommunicator. - */ - boost::mpi::group local_group() const; - - /** - * Returns the rank of this process within the local group. - */ - int local_rank() const { return this->rank(); } - - /** - * Returns the size of the remote group, i.e., the number of - * processes that are part of the remote group. - */ - int remote_size() const; - - /** - * Returns the remote group, containing all of the remote processes - * in this intercommunicator. - */ - boost::mpi::group remote_group() const; - - /** - * Merge the local and remote groups in this intercommunicator into - * a new intracommunicator containing the union of the processes in - * both groups. This method is equivalent to @c MPI_Intercomm_merge. - * - * @param high Whether the processes in this group should have the - * higher rank numbers than the processes in the other group. Each - * of the processes within a particular group shall have the same - * "high" value. - * - * @returns the new, merged intracommunicator - */ - communicator merge(bool high) const; -}; - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_INTERCOMMUNICATOR_HPP diff --git a/contrib/restricted/boost/boost/mpi/nonblocking.hpp b/contrib/restricted/boost/boost/mpi/nonblocking.hpp deleted file mode 100644 index 1fc1ecd038..0000000000 --- a/contrib/restricted/boost/boost/mpi/nonblocking.hpp +++ /dev/null @@ -1,738 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -/** @file nonblocking.hpp - * - * This header defines operations for completing non-blocking - * communication requests. - */ -#ifndef BOOST_MPI_NONBLOCKING_HPP -#define BOOST_MPI_NONBLOCKING_HPP - -#include <boost/mpi/config.hpp> -#include <vector> -#include <iterator> // for std::iterator_traits -#include <boost/optional.hpp> -#include <utility> // for std::pair -#include <algorithm> // for iter_swap, reverse -#include <boost/static_assert.hpp> -#include <boost/mpi/request.hpp> -#include <boost/mpi/status.hpp> -#include <boost/mpi/exception.hpp> - -namespace boost { namespace mpi { - -/** - * @brief Wait until any non-blocking request has completed. - * - * This routine takes in a set of requests stored in the iterator - * range @c [first,last) and waits until any of these requests has - * been completed. It provides functionality equivalent to - * @c MPI_Waitany. - * - * @param first The iterator that denotes the beginning of the - * sequence of request objects. - * - * @param last The iterator that denotes the end of the sequence of - * request objects. This may not be equal to @c first. - * - * @returns A pair containing the status object that corresponds to - * the completed operation and the iterator referencing the completed - * request. - */ -template<typename ForwardIterator> -std::pair<status, ForwardIterator> -wait_any(ForwardIterator first, ForwardIterator last) -{ - using std::advance; - - BOOST_ASSERT(first != last); - - typedef typename std::iterator_traits<ForwardIterator>::difference_type - difference_type; - - bool all_trivial_requests = true; - difference_type n = 0; - ForwardIterator current = first; - while (true) { - // Check if we have found a completed request. If so, return it. - if (current->m_requests[0] != MPI_REQUEST_NULL && - (current->m_requests[1] != MPI_REQUEST_NULL || - current->m_handler)) { - if (optional<status> result = current->test()) - return std::make_pair(*result, current); - } - - // Check if this request (and all others before it) are "trivial" - // requests, e.g., they can be represented with a single - // MPI_Request. - all_trivial_requests = - all_trivial_requests - && !current->m_handler - && current->m_requests[1] == MPI_REQUEST_NULL; - - // Move to the next request. - ++n; - if (++current == last) { - // We have reached the end of the list. If all requests thus far - // have been trivial, we can call MPI_Waitany directly, because - // it may be more efficient than our busy-wait semantics. - if (all_trivial_requests) { - std::vector<MPI_Request> requests; - requests.reserve(n); - for (current = first; current != last; ++current) - requests.push_back(current->m_requests[0]); - - // Let MPI wait until one of these operations completes. - int index; - status stat; - BOOST_MPI_CHECK_RESULT(MPI_Waitany, - (n, &requests[0], &index, &stat.m_status)); - - // We don't have a notion of empty requests or status objects, - // so this is an error. - if (index == MPI_UNDEFINED) - boost::throw_exception(exception("MPI_Waitany", MPI_ERR_REQUEST)); - - // Find the iterator corresponding to the completed request. - current = first; - advance(current, index); - current->m_requests[0] = requests[index]; - return std::make_pair(stat, current); - } - - // There are some nontrivial requests, so we must continue our - // busy waiting loop. - n = 0; - current = first; - all_trivial_requests = true; - } - } - - // We cannot ever get here - BOOST_ASSERT(false); -} - -/** - * @brief Test whether any non-blocking request has completed. - * - * This routine takes in a set of requests stored in the iterator - * range @c [first,last) and tests whether any of these requests has - * been completed. This routine is similar to @c wait_any, but will - * not block waiting for requests to completed. It provides - * functionality equivalent to @c MPI_Testany. - * - * @param first The iterator that denotes the beginning of the - * sequence of request objects. - * - * @param last The iterator that denotes the end of the sequence of - * request objects. - * - * @returns If any outstanding requests have completed, a pair - * containing the status object that corresponds to the completed - * operation and the iterator referencing the completed - * request. Otherwise, an empty @c optional<>. - */ -template<typename ForwardIterator> -optional<std::pair<status, ForwardIterator> > -test_any(ForwardIterator first, ForwardIterator last) -{ - while (first != last) { - // Check if we have found a completed request. If so, return it. - if (optional<status> result = first->test()) { - return std::make_pair(*result, first); - } - ++first; - } - - // We found nothing - return optional<std::pair<status, ForwardIterator> >(); -} - -/** - * @brief Wait until all non-blocking requests have completed. - * - * This routine takes in a set of requests stored in the iterator - * range @c [first,last) and waits until all of these requests have - * been completed. It provides functionality equivalent to - * @c MPI_Waitall. - * - * @param first The iterator that denotes the beginning of the - * sequence of request objects. - * - * @param last The iterator that denotes the end of the sequence of - * request objects. - * - * @param out If provided, an output iterator through which the - * status of each request will be emitted. The @c status objects are - * emitted in the same order as the requests are retrieved from - * @c [first,last). - * - * @returns If an @p out parameter was provided, the value @c out - * after all of the @c status objects have been emitted. - */ -template<typename ForwardIterator, typename OutputIterator> -OutputIterator -wait_all(ForwardIterator first, ForwardIterator last, OutputIterator out) -{ - typedef typename std::iterator_traits<ForwardIterator>::difference_type - difference_type; - - using std::distance; - - difference_type num_outstanding_requests = distance(first, last); - - std::vector<status> results(num_outstanding_requests); - std::vector<bool> completed(num_outstanding_requests); - - while (num_outstanding_requests > 0) { - bool all_trivial_requests = true; - difference_type idx = 0; - for (ForwardIterator current = first; current != last; ++current, ++idx) { - if (!completed[idx]) { - if (optional<status> stat = current->test()) { - // This outstanding request has been completed. We're done. - results[idx] = *stat; - completed[idx] = true; - --num_outstanding_requests; - all_trivial_requests = false; - } else { - // Check if this request (and all others before it) are "trivial" - // requests, e.g., they can be represented with a single - // MPI_Request. - all_trivial_requests = - all_trivial_requests - && !current->m_handler - && current->m_requests[1] == MPI_REQUEST_NULL; - } - } - } - - // If we have yet to fulfill any requests and all of the requests - // are trivial (i.e., require only a single MPI_Request to be - // fulfilled), call MPI_Waitall directly. - if (all_trivial_requests - && num_outstanding_requests == (difference_type)results.size()) { - std::vector<MPI_Request> requests; - requests.reserve(num_outstanding_requests); - for (ForwardIterator current = first; current != last; ++current) - requests.push_back(current->m_requests[0]); - - // Let MPI wait until all of these operations completes. - std::vector<MPI_Status> stats(num_outstanding_requests); - BOOST_MPI_CHECK_RESULT(MPI_Waitall, - (num_outstanding_requests, &requests[0], - &stats[0])); - - for (std::vector<MPI_Status>::iterator i = stats.begin(); - i != stats.end(); ++i, ++out) { - status stat; - stat.m_status = *i; - *out = stat; - } - - return out; - } - - all_trivial_requests = false; - } - - return std::copy(results.begin(), results.end(), out); -} - -/** - * \overload - */ -template<typename ForwardIterator> -void -wait_all(ForwardIterator first, ForwardIterator last) -{ - typedef typename std::iterator_traits<ForwardIterator>::difference_type - difference_type; - - using std::distance; - - difference_type num_outstanding_requests = distance(first, last); - - std::vector<bool> completed(num_outstanding_requests); - - while (num_outstanding_requests > 0) { - bool all_trivial_requests = true; - - difference_type idx = 0; - for (ForwardIterator current = first; current != last; ++current, ++idx) { - if (!completed[idx]) { - if (optional<status> stat = current->test()) { - // This outstanding request has been completed. - completed[idx] = true; - --num_outstanding_requests; - all_trivial_requests = false; - } else { - // Check if this request (and all others before it) are "trivial" - // requests, e.g., they can be represented with a single - // MPI_Request. - all_trivial_requests = - all_trivial_requests - && !current->m_handler - && current->m_requests[1] == MPI_REQUEST_NULL; - } - } - } - - // If we have yet to fulfill any requests and all of the requests - // are trivial (i.e., require only a single MPI_Request to be - // fulfilled), call MPI_Waitall directly. - if (all_trivial_requests - && num_outstanding_requests == (difference_type)completed.size()) { - std::vector<MPI_Request> requests; - requests.reserve(num_outstanding_requests); - for (ForwardIterator current = first; current != last; ++current) - requests.push_back(current->m_requests[0]); - - // Let MPI wait until all of these operations completes. - BOOST_MPI_CHECK_RESULT(MPI_Waitall, - (num_outstanding_requests, &requests[0], - MPI_STATUSES_IGNORE)); - - // Signal completion - num_outstanding_requests = 0; - } - } -} - -/** - * @brief Tests whether all non-blocking requests have completed. - * - * This routine takes in a set of requests stored in the iterator - * range @c [first,last) and determines whether all of these requests - * have been completed. However, due to limitations of the underlying - * MPI implementation, if any of the requests refers to a - * non-blocking send or receive of a serialized data type, @c - * test_all will always return the equivalent of @c false (i.e., the - * requests cannot all be finished at this time). This routine - * performs the same functionality as @c wait_all, except that this - * routine will not block. This routine provides functionality - * equivalent to @c MPI_Testall. - * - * @param first The iterator that denotes the beginning of the - * sequence of request objects. - * - * @param last The iterator that denotes the end of the sequence of - * request objects. - * - * @param out If provided and all requests hav been completed, an - * output iterator through which the status of each request will be - * emitted. The @c status objects are emitted in the same order as - * the requests are retrieved from @c [first,last). - * - * @returns If an @p out parameter was provided, the value @c out - * after all of the @c status objects have been emitted (if all - * requests were completed) or an empty @c optional<>. If no @p out - * parameter was provided, returns @c true if all requests have - * completed or @c false otherwise. - */ -template<typename ForwardIterator, typename OutputIterator> -optional<OutputIterator> -test_all(ForwardIterator first, ForwardIterator last, OutputIterator out) -{ - std::vector<MPI_Request> requests; - for (; first != last; ++first) { - // If we have a non-trivial request, then no requests can be - // completed. - if (first->m_handler || first->m_requests[1] != MPI_REQUEST_NULL) - return optional<OutputIterator>(); - - requests.push_back(first->m_requests[0]); - } - - int flag = 0; - int n = requests.size(); - std::vector<MPI_Status> stats(n); - BOOST_MPI_CHECK_RESULT(MPI_Testall, (n, &requests[0], &flag, &stats[0])); - if (flag) { - for (int i = 0; i < n; ++i, ++out) { - status stat; - stat.m_status = stats[i]; - *out = stat; - } - return out; - } else { - return optional<OutputIterator>(); - } -} - -/** - * \overload - */ -template<typename ForwardIterator> -bool -test_all(ForwardIterator first, ForwardIterator last) -{ - std::vector<MPI_Request> requests; - for (; first != last; ++first) { - // If we have a non-trivial request, then no requests can be - // completed. - if (first->m_handler || first->m_requests[1] != MPI_REQUEST_NULL) - return false; - - requests.push_back(first->m_requests[0]); - } - - int flag = 0; - int n = requests.size(); - BOOST_MPI_CHECK_RESULT(MPI_Testall, - (n, &requests[0], &flag, MPI_STATUSES_IGNORE)); - return flag != 0; -} - -/** - * @brief Wait until some non-blocking requests have completed. - * - * This routine takes in a set of requests stored in the iterator - * range @c [first,last) and waits until at least one of the requests - * has completed. It then completes all of the requests it can, - * partitioning the input sequence into pending requests followed by - * completed requests. If an output iterator is provided, @c status - * objects will be emitted for each of the completed requests. This - * routine provides functionality equivalent to @c MPI_Waitsome. - * - * @param first The iterator that denotes the beginning of the - * sequence of request objects. - * - * @param last The iterator that denotes the end of the sequence of - * request objects. This may not be equal to @c first. - * - * @param out If provided, the @c status objects corresponding to - * completed requests will be emitted through this output iterator. - - * @returns If the @p out parameter was provided, a pair containing - * the output iterator @p out after all of the @c status objects have - * been written through it and an iterator referencing the first - * completed request. If no @p out parameter was provided, only the - * iterator referencing the first completed request will be emitted. - */ -template<typename BidirectionalIterator, typename OutputIterator> -std::pair<OutputIterator, BidirectionalIterator> -wait_some(BidirectionalIterator first, BidirectionalIterator last, - OutputIterator out) -{ - using std::advance; - - if (first == last) - return std::make_pair(out, first); - - typedef typename std::iterator_traits<BidirectionalIterator>::difference_type - difference_type; - - bool all_trivial_requests = true; - difference_type n = 0; - BidirectionalIterator current = first; - BidirectionalIterator start_of_completed = last; - while (true) { - // Check if we have found a completed request. - if (optional<status> result = current->test()) { - using std::iter_swap; - - // Emit the resulting status object - *out++ = *result; - - // We're expanding the set of completed requests - --start_of_completed; - - if (current == start_of_completed) { - // If we have hit the end of the list of pending - // requests. Finish up by fixing the order of the completed - // set to match the order in which we emitted status objects, - // then return. - std::reverse(start_of_completed, last); - return std::make_pair(out, start_of_completed); - } - - // Swap the request we just completed with the last request that - // has not yet been tested. - iter_swap(current, start_of_completed); - - continue; - } - - // Check if this request (and all others before it) are "trivial" - // requests, e.g., they can be represented with a single - // MPI_Request. - all_trivial_requests = - all_trivial_requests - && !current->m_handler - && current->m_requests[1] == MPI_REQUEST_NULL; - - // Move to the next request. - ++n; - if (++current == start_of_completed) { - if (start_of_completed != last) { - // We have satisfied some requests. Make the order of the - // completed requests match that of the status objects we've - // already emitted and we're done. - std::reverse(start_of_completed, last); - return std::make_pair(out, start_of_completed); - } - - // We have reached the end of the list. If all requests thus far - // have been trivial, we can call MPI_Waitsome directly, because - // it may be more efficient than our busy-wait semantics. - if (all_trivial_requests) { - std::vector<MPI_Request> requests; - std::vector<int> indices(n); - std::vector<MPI_Status> stats(n); - requests.reserve(n); - for (current = first; current != last; ++current) - requests.push_back(current->m_requests[0]); - - // Let MPI wait until some of these operations complete. - int num_completed; - BOOST_MPI_CHECK_RESULT(MPI_Waitsome, - (n, &requests[0], &num_completed, &indices[0], - &stats[0])); - - // Translate the index-based result of MPI_Waitsome into a - // partitioning on the requests. - int current_offset = 0; - current = first; - for (int index = 0; index < num_completed; ++index, ++out) { - using std::iter_swap; - - // Move "current" to the request object at this index - advance(current, indices[index] - current_offset); - current_offset = indices[index]; - - // Emit the status object - status stat; - stat.m_status = stats[index]; - *out = stat; - - // Finish up the request and swap it into the "completed - // requests" partition. - current->m_requests[0] = requests[indices[index]]; - --start_of_completed; - iter_swap(current, start_of_completed); - } - - // We have satisfied some requests. Make the order of the - // completed requests match that of the status objects we've - // already emitted and we're done. - std::reverse(start_of_completed, last); - return std::make_pair(out, start_of_completed); - } - - // There are some nontrivial requests, so we must continue our - // busy waiting loop. - n = 0; - current = first; - } - } - - // We cannot ever get here - BOOST_ASSERT(false); -} - -/** - * \overload - */ -template<typename BidirectionalIterator> -BidirectionalIterator -wait_some(BidirectionalIterator first, BidirectionalIterator last) -{ - using std::advance; - - if (first == last) - return first; - - typedef typename std::iterator_traits<BidirectionalIterator>::difference_type - difference_type; - - bool all_trivial_requests = true; - difference_type n = 0; - BidirectionalIterator current = first; - BidirectionalIterator start_of_completed = last; - while (true) { - // Check if we have found a completed request. - if (optional<status> result = current->test()) { - using std::iter_swap; - - // We're expanding the set of completed requests - --start_of_completed; - - // If we have hit the end of the list of pending requests, we're - // done. - if (current == start_of_completed) - return start_of_completed; - - // Swap the request we just completed with the last request that - // has not yet been tested. - iter_swap(current, start_of_completed); - - continue; - } - - // Check if this request (and all others before it) are "trivial" - // requests, e.g., they can be represented with a single - // MPI_Request. - all_trivial_requests = - all_trivial_requests - && !current->m_handler - && current->m_requests[1] == MPI_REQUEST_NULL; - - // Move to the next request. - ++n; - if (++current == start_of_completed) { - // If we have satisfied some requests, we're done. - if (start_of_completed != last) - return start_of_completed; - - // We have reached the end of the list. If all requests thus far - // have been trivial, we can call MPI_Waitsome directly, because - // it may be more efficient than our busy-wait semantics. - if (all_trivial_requests) { - std::vector<MPI_Request> requests; - std::vector<int> indices(n); - requests.reserve(n); - for (current = first; current != last; ++current) - requests.push_back(current->m_requests[0]); - - // Let MPI wait until some of these operations complete. - int num_completed; - BOOST_MPI_CHECK_RESULT(MPI_Waitsome, - (n, &requests[0], &num_completed, &indices[0], - MPI_STATUSES_IGNORE)); - - // Translate the index-based result of MPI_Waitsome into a - // partitioning on the requests. - int current_offset = 0; - current = first; - for (int index = 0; index < num_completed; ++index) { - using std::iter_swap; - - // Move "current" to the request object at this index - advance(current, indices[index] - current_offset); - current_offset = indices[index]; - - // Finish up the request and swap it into the "completed - // requests" partition. - current->m_requests[0] = requests[indices[index]]; - --start_of_completed; - iter_swap(current, start_of_completed); - } - - // We have satisfied some requests, so we are done. - return start_of_completed; - } - - // There are some nontrivial requests, so we must continue our - // busy waiting loop. - n = 0; - current = first; - } - } - - // We cannot ever get here - BOOST_ASSERT(false); -} - -/** - * @brief Test whether some non-blocking requests have completed. - * - * This routine takes in a set of requests stored in the iterator - * range @c [first,last) and tests to see if any of the requests has - * completed. It completes all of the requests it can, partitioning - * the input sequence into pending requests followed by completed - * requests. If an output iterator is provided, @c status objects - * will be emitted for each of the completed requests. This routine - * is similar to @c wait_some, but does not wait until any requests - * have completed. This routine provides functionality equivalent to - * @c MPI_Testsome. - * - * @param first The iterator that denotes the beginning of the - * sequence of request objects. - * - * @param last The iterator that denotes the end of the sequence of - * request objects. This may not be equal to @c first. - * - * @param out If provided, the @c status objects corresponding to - * completed requests will be emitted through this output iterator. - - * @returns If the @p out parameter was provided, a pair containing - * the output iterator @p out after all of the @c status objects have - * been written through it and an iterator referencing the first - * completed request. If no @p out parameter was provided, only the - * iterator referencing the first completed request will be emitted. - */ -template<typename BidirectionalIterator, typename OutputIterator> -std::pair<OutputIterator, BidirectionalIterator> -test_some(BidirectionalIterator first, BidirectionalIterator last, - OutputIterator out) -{ - BidirectionalIterator current = first; - BidirectionalIterator start_of_completed = last; - while (current != start_of_completed) { - // Check if we have found a completed request. - if (optional<status> result = current->test()) { - using std::iter_swap; - - // Emit the resulting status object - *out++ = *result; - - // We're expanding the set of completed requests - --start_of_completed; - - // Swap the request we just completed with the last request that - // has not yet been tested. - iter_swap(current, start_of_completed); - - continue; - } - - // Move to the next request. - ++current; - } - - // Finish up by fixing the order of the completed set to match the - // order in which we emitted status objects, then return. - std::reverse(start_of_completed, last); - return std::make_pair(out, start_of_completed); -} - -/** - * \overload - */ -template<typename BidirectionalIterator> -BidirectionalIterator -test_some(BidirectionalIterator first, BidirectionalIterator last) -{ - BidirectionalIterator current = first; - BidirectionalIterator start_of_completed = last; - while (current != start_of_completed) { - // Check if we have found a completed request. - if (optional<status> result = current->test()) { - using std::iter_swap; - - // We're expanding the set of completed requests - --start_of_completed; - - // Swap the request we just completed with the last request that - // has not yet been tested. - iter_swap(current, start_of_completed); - - continue; - } - - // Move to the next request. - ++current; - } - - return start_of_completed; -} - -} } // end namespace boost::mpi - - -#endif // BOOST_MPI_NONBLOCKING_HPP diff --git a/contrib/restricted/boost/boost/mpi/operations.hpp b/contrib/restricted/boost/boost/mpi/operations.hpp deleted file mode 100644 index b72b13d79a..0000000000 --- a/contrib/restricted/boost/boost/mpi/operations.hpp +++ /dev/null @@ -1,340 +0,0 @@ -// Copyright (C) 2004 The Trustees of Indiana University. -// Copyright (C) 2005-2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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 -// Andrew Lumsdaine - -/** @file operations.hpp - * - * This header provides a mapping from function objects to @c MPI_Op - * constants used in MPI collective operations. It also provides - * several new function object types not present in the standard @c - * <functional> header that have direct mappings to @c MPI_Op. - */ -#ifndef BOOST_MPI_IS_MPI_OP_HPP -#define BOOST_MPI_IS_MPI_OP_HPP - -#include <boost/mpi/config.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/if.hpp> -#include <boost/mpl/and.hpp> -#include <boost/mpi/datatype.hpp> -#include <boost/utility/enable_if.hpp> -#include <functional> - -namespace boost { namespace mpi { - -template<typename Op, typename T> struct is_mpi_op; - -/** - * @brief Determine if a function object type is commutative. - * - * This trait determines if an operation @c Op is commutative when - * applied to values of type @c T. Parallel operations such as @c - * reduce and @c prefix_sum can be implemented more efficiently with - * commutative operations. To mark an operation as commutative, users - * should specialize @c is_commutative and derive from the class @c - * mpl::true_. - */ -template<typename Op, typename T> -struct is_commutative : public mpl::false_ { }; - -/************************************************************************** - * Function objects for MPI operations not in <functional> header * - **************************************************************************/ - -/** - * @brief Compute the maximum of two values. - * - * This binary function object computes the maximum of the two values - * it is given. When used with MPI and a type @c T that has an - * associated, built-in MPI data type, translates to @c MPI_MAX. - */ -template<typename T> -struct maximum -{ - typedef T first_argument_type; - typedef T second_argument_type; - typedef T result_type; - /** @returns the maximum of x and y. */ - const T& operator()(const T& x, const T& y) const - { - return x < y? y : x; - } -}; - -/** - * @brief Compute the minimum of two values. - * - * This binary function object computes the minimum of the two values - * it is given. When used with MPI and a type @c T that has an - * associated, built-in MPI data type, translates to @c MPI_MIN. - */ -template<typename T> -struct minimum -{ - typedef T first_argument_type; - typedef T second_argument_type; - typedef T result_type; - /** @returns the minimum of x and y. */ - const T& operator()(const T& x, const T& y) const - { - return x < y? x : y; - } -}; - - -/** - * @brief Compute the bitwise AND of two integral values. - * - * This binary function object computes the bitwise AND of the two - * values it is given. When used with MPI and a type @c T that has an - * associated, built-in MPI data type, translates to @c MPI_BAND. - */ -template<typename T> -struct bitwise_and -{ - typedef T first_argument_type; - typedef T second_argument_type; - typedef T result_type; - /** @returns @c x & y. */ - T operator()(const T& x, const T& y) const - { - return x & y; - } -}; - -/** - * @brief Compute the bitwise OR of two integral values. - * - * This binary function object computes the bitwise OR of the two - * values it is given. When used with MPI and a type @c T that has an - * associated, built-in MPI data type, translates to @c MPI_BOR. - */ -template<typename T> -struct bitwise_or -{ - typedef T first_argument_type; - typedef T second_argument_type; - typedef T result_type; - /** @returns the @c x | y. */ - T operator()(const T& x, const T& y) const - { - return x | y; - } -}; - -/** - * @brief Compute the logical exclusive OR of two integral values. - * - * This binary function object computes the logical exclusive of the - * two values it is given. When used with MPI and a type @c T that has - * an associated, built-in MPI data type, translates to @c MPI_LXOR. - */ -template<typename T> -struct logical_xor -{ - typedef T first_argument_type; - typedef T second_argument_type; - typedef T result_type; - /** @returns the logical exclusive OR of x and y. */ - T operator()(const T& x, const T& y) const - { - return (x || y) && !(x && y); - } -}; - -/** - * @brief Compute the bitwise exclusive OR of two integral values. - * - * This binary function object computes the bitwise exclusive OR of - * the two values it is given. When used with MPI and a type @c T that - * has an associated, built-in MPI data type, translates to @c - * MPI_BXOR. - */ -template<typename T> -struct bitwise_xor -{ - typedef T first_argument_type; - typedef T second_argument_type; - typedef T result_type; - /** @returns @c x ^ y. */ - T operator()(const T& x, const T& y) const - { - return x ^ y; - } -}; - -/************************************************************************** - * MPI_Op queries * - **************************************************************************/ - -/** - * @brief Determine if a function object has an associated @c MPI_Op. - * - * This trait determines if a function object type @c Op, when used - * with argument type @c T, has an associated @c MPI_Op. If so, @c - * is_mpi_op<Op,T> will derive from @c mpl::false_ and will - * contain a static member function @c op that takes no arguments but - * returns the associated @c MPI_Op value. For instance, @c - * is_mpi_op<std::plus<int>,int>::op() returns @c MPI_SUM. - * - * Users may specialize @c is_mpi_op for any other class templates - * that map onto operations that have @c MPI_Op equivalences, such as - * bitwise OR, logical and, or maximum. However, users are encouraged - * to use the standard function objects in the @c functional and @c - * boost/mpi/operations.hpp headers whenever possible. For - * function objects that are class templates with a single template - * parameter, it may be easier to specialize @c is_builtin_mpi_op. - */ -template<typename Op, typename T> -struct is_mpi_op : public mpl::false_ { }; - -/// INTERNAL ONLY -template<typename T> -struct is_mpi_op<maximum<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_floating_point_datatype<T> > -{ - static MPI_Op op() { return MPI_MAX; } -}; - -/// INTERNAL ONLY -template<typename T> -struct is_mpi_op<minimum<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_floating_point_datatype<T> > -{ - static MPI_Op op() { return MPI_MIN; } -}; - -/// INTERNAL ONLY -template<typename T> - struct is_mpi_op<std::plus<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_floating_point_datatype<T>, - is_mpi_complex_datatype<T> > -{ - static MPI_Op op() { return MPI_SUM; } -}; - -/// INTERNAL ONLY -template<typename T> - struct is_mpi_op<std::multiplies<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_floating_point_datatype<T>, - is_mpi_complex_datatype<T> > -{ - static MPI_Op op() { return MPI_PROD; } -}; - -/// INTERNAL ONLY -template<typename T> - struct is_mpi_op<std::logical_and<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_logical_datatype<T> > -{ - static MPI_Op op() { return MPI_LAND; } -}; - -/// INTERNAL ONLY -template<typename T> - struct is_mpi_op<std::logical_or<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_logical_datatype<T> > -{ - static MPI_Op op() { return MPI_LOR; } -}; - -/// INTERNAL ONLY -template<typename T> - struct is_mpi_op<logical_xor<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_logical_datatype<T> > -{ - static MPI_Op op() { return MPI_LXOR; } -}; - -/// INTERNAL ONLY -template<typename T> - struct is_mpi_op<bitwise_and<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_byte_datatype<T> > -{ - static MPI_Op op() { return MPI_BAND; } -}; - -/// INTERNAL ONLY -template<typename T> - struct is_mpi_op<bitwise_or<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_byte_datatype<T> > -{ - static MPI_Op op() { return MPI_BOR; } -}; - -/// INTERNAL ONLY -template<typename T> - struct is_mpi_op<bitwise_xor<T>, T> - : public boost::mpl::or_<is_mpi_integer_datatype<T>, - is_mpi_byte_datatype<T> > -{ - static MPI_Op op() { return MPI_BXOR; } -}; - -namespace detail { - // A helper class used to create user-defined MPI_Ops - template<typename Op, typename T> - class user_op - { - public: - explicit user_op(Op& op) - { - BOOST_MPI_CHECK_RESULT(MPI_Op_create, - (&user_op<Op, T>::perform, - is_commutative<Op, T>::value, - &mpi_op)); - - op_ptr = &op; - } - - ~user_op() - { - if (std::uncaught_exception()) { - // Ignore failure cases: there are obviously other problems - // already, and we don't want to cause program termination if - // MPI_Op_free fails. - MPI_Op_free(&mpi_op); - } else { - BOOST_MPI_CHECK_RESULT(MPI_Op_free, (&mpi_op)); - } - } - - MPI_Op& get_mpi_op() - { - return mpi_op; - } - - private: - MPI_Op mpi_op; - static Op* op_ptr; - - static void BOOST_MPI_CALLING_CONVENTION perform(void* vinvec, void* voutvec, int* plen, MPI_Datatype*) - { - T* invec = static_cast<T*>(vinvec); - T* outvec = static_cast<T*>(voutvec); - std::transform(invec, invec + *plen, outvec, outvec, *op_ptr); - } - }; - - template<typename Op, typename T> Op* user_op<Op, T>::op_ptr = 0; - -} // end namespace detail - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_GET_MPI_OP_HPP diff --git a/contrib/restricted/boost/boost/mpi/packed_iarchive.hpp b/contrib/restricted/boost/boost/mpi/packed_iarchive.hpp deleted file mode 100644 index bb8094b41c..0000000000 --- a/contrib/restricted/boost/boost/mpi/packed_iarchive.hpp +++ /dev/null @@ -1,159 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer -// (C) Copyright 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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: Matthias Troyer -// Douglas Gregor - -/** @file packed_iarchive.hpp - * - * This header provides the facilities for packing Serializable data - * types into a buffer using @c MPI_Pack. The buffers can then be - * transmitted via MPI and then be unpacked either via the facilities - * in @c packed_oarchive.hpp or @c MPI_Unpack. - */ -#ifndef BOOST_MPI_PACKED_IARCHIVE_HPP -#define BOOST_MPI_PACKED_IARCHIVE_HPP - -#include <boost/mpi/datatype.hpp> -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/archive/detail/common_iarchive.hpp> -#include <boost/archive/basic_archive.hpp> -#include <boost/mpi/detail/packed_iprimitive.hpp> -#include <boost/mpi/detail/binary_buffer_iprimitive.hpp> -#include <boost/serialization/string.hpp> -#include <boost/serialization/collection_size_type.hpp> -#include <boost/serialization/item_version_type.hpp> -#include <boost/assert.hpp> - -namespace boost { namespace mpi { - -#ifdef BOOST_MPI_HOMOGENEOUS - typedef binary_buffer_iprimitive iprimitive; -#else - typedef packed_iprimitive iprimitive; -#endif - - -/** @brief An archive that unpacks binary data from an MPI buffer. - * - * The @c packed_oarchive class is an Archiver (as in the - * Boost.Serialization library) that unpacks binary data from a - * buffer received via MPI. It can operate on any Serializable data - * type and will use the @c MPI_Unpack function of the underlying MPI - * implementation to perform deserialization. - */ - -class BOOST_MPI_DECL packed_iarchive - : public iprimitive - , public archive::detail::common_iarchive<packed_iarchive> -{ -public: - /** - * Construct a @c packed_iarchive to receive data over the given - * MPI communicator and with an initial buffer. - * - * @param comm The communicator over which this archive will be - * received. - * - * @param b A user-defined buffer that contains the binary - * representation of serialized objects. - * - * @param flags Control the serialization of the data types. Refer - * to the Boost.Serialization documentation before changing the - * default flags. - */ - - packed_iarchive(MPI_Comm const & comm, buffer_type & b, unsigned int flags = boost::archive::no_header, int position = 0) - : iprimitive(b,comm,position), - archive::detail::common_iarchive<packed_iarchive>(flags) - {} - - /** - * Construct a @c packed_iarchive to receive data over the given - * MPI communicator. - * - * @param comm The communicator over which this archive will be - * received. - * - * @param flags Control the serialization of the data types. Refer - * to the Boost.Serialization documentation before changing the - * default flags. - */ - - packed_iarchive - ( MPI_Comm const & comm , std::size_t s=0, - unsigned int flags = boost::archive::no_header) - : iprimitive(internal_buffer_,comm) - , archive::detail::common_iarchive<packed_iarchive>(flags) - , internal_buffer_(s) - {} - - // Load everything else in the usual way, forwarding on to the Base class - template<class T> - void load_override(T& x, mpl::false_) - { - archive::detail::common_iarchive<packed_iarchive>::load_override(x); - } - - // Load it directly using the primnivites - template<class T> - void load_override(T& x, mpl::true_) - { - iprimitive::load(x); - } - - // Load all supported datatypes directly - template<class T> - void load_override(T& x) - { - typedef typename mpl::apply1<use_array_optimization - , BOOST_DEDUCED_TYPENAME remove_const<T>::type - >::type use_optimized; - load_override(x, use_optimized()); - } - - // input archives need to ignore the optional information - void load_override(archive::class_id_optional_type & /*t*/){} - - void load_override(archive::class_id_type & t){ - int_least16_t x=0; - * this->This() >> x; - t = boost::archive::class_id_type(x); - } - - void load_override(archive::version_type & t){ - int_least8_t x=0; - * this->This() >> x; - t = boost::archive::version_type(x); - } - - void load_override(archive::class_id_reference_type & t){ - load_override(static_cast<archive::class_id_type &>(t)); - } - - void load_override(archive::class_name_type & t) - { - std::string cn; - cn.reserve(BOOST_SERIALIZATION_MAX_KEY_SIZE); - * this->This() >> cn; - std::memcpy(t, cn.data(), cn.size()); - // borland tweak - t.t[cn.size()] = '\0'; - } - -private: - /// An internal buffer to be used when the user does not supply his - /// own buffer. - buffer_type internal_buffer_; -}; - -} } // end namespace boost::mpi - -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::packed_iarchive) -BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::packed_iarchive) - -#endif // BOOST_MPI_PACKED_IARCHIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/packed_oarchive.hpp b/contrib/restricted/boost/boost/mpi/packed_oarchive.hpp deleted file mode 100644 index c6c0173ae6..0000000000 --- a/contrib/restricted/boost/boost/mpi/packed_oarchive.hpp +++ /dev/null @@ -1,147 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer -// (C) Copyright 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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: Matthias Troyer -// Douglas Gregor - -/** @file packed_oarchive.hpp - * - * This header provides the facilities for unpacking Serializable - * data types from a buffer using @c MPI_Unpack. The buffers are - * typically received via MPI and have been packed either by via the - * facilities in @c packed_iarchive.hpp or @c MPI_Pack. - */ -#ifndef BOOST_MPI_PACKED_OARCHIVE_HPP -#define BOOST_MPI_PACKED_OARCHIVE_HPP - -#include <boost/mpi/datatype.hpp> -#include <boost/archive/basic_archive.hpp> -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/archive/detail/common_oarchive.hpp> -#include <boost/mpi/detail/packed_oprimitive.hpp> -#include <boost/mpi/detail/binary_buffer_oprimitive.hpp> -#include <boost/serialization/string.hpp> -#include <boost/serialization/collection_size_type.hpp> -#include <boost/serialization/item_version_type.hpp> - -namespace boost { namespace mpi { - -#ifdef BOOST_MPI_HOMOGENEOUS - typedef binary_buffer_oprimitive oprimitive; -#else - typedef packed_oprimitive oprimitive; -#endif - -/** @brief An archive that packs binary data into an MPI buffer. - * - * The @c packed_iarchive class is an Archiver (as in the - * Boost.Serialization library) that packs binary data into a buffer - * for transmission via MPI. It can operate on any Serializable data - * type and will use the @c MPI_Pack function of the underlying MPI - * implementation to perform serialization. - */ - -class BOOST_MPI_DECL packed_oarchive - : public oprimitive - , public archive::detail::common_oarchive<packed_oarchive> -{ -public: - /** - * Construct a @c packed_oarchive for transmission over the given - * MPI communicator and with an initial buffer. - * - * @param comm The communicator over which this archive will be - * sent. - * - * @param b A user-defined buffer that will be filled with the - * binary representation of serialized objects. - * - * @param flags Control the serialization of the data types. Refer - * to the Boost.Serialization documentation before changing the - * default flags. - * - * @param position Set the offset into buffer @p b at which - * deserialization will begin. - */ - packed_oarchive( MPI_Comm const & comm, buffer_type & b, unsigned int flags = boost::archive::no_header) - : oprimitive(b,comm), - archive::detail::common_oarchive<packed_oarchive>(flags) - {} - - /** - * Construct a @c packed_oarchive for transmission over the given - * MPI communicator. - * - * @param comm The communicator over which this archive will be - * sent. - * - * @param s The size of the buffer to be received. - * - * @param flags Control the serialization of the data types. Refer - * to the Boost.Serialization documentation before changing the - * default flags. - */ - packed_oarchive ( MPI_Comm const & comm, unsigned int flags = boost::archive::no_header) - : oprimitive(internal_buffer_,comm), - archive::detail::common_oarchive<packed_oarchive>(flags) - {} - - // Save everything else in the usual way, forwarding on to the Base class - template<class T> - void save_override(T const& x, mpl::false_) - { - archive::detail::common_oarchive<packed_oarchive>::save_override(x); - } - - // Save it directly using the primitives - template<class T> - void save_override(T const& x, mpl::true_) - { - oprimitive::save(x); - } - - // Save all supported datatypes directly - template<class T> - void save_override(T const& x) - { - typedef typename mpl::apply1<use_array_optimization,T>::type use_optimized; - save_override(x, use_optimized()); - } - - // output archives need to ignore the optional information - void save_override(const archive::class_id_optional_type & ){} - - // explicitly convert to char * to avoid compile ambiguities - void save_override(const archive::class_name_type & t){ - const std::string s(t); - * this->This() << s; - } - - void save_override(const archive::class_id_type & t){ - const boost::int_least16_t x = t; - * this->This() << x; - } - - void save_override(const archive::version_type & t){ - const boost::int_least8_t x = t; - * this->This() << x; - } -private: - /// An internal buffer to be used when the user does not supply his - /// own buffer. - buffer_type internal_buffer_; -}; - -} } // end namespace boost::mpi - -// required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::packed_oarchive) -BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::packed_oarchive) - - - -#endif // BOOST_MPI_PACKED_OARCHIVE_HPP diff --git a/contrib/restricted/boost/boost/mpi/python.hpp b/contrib/restricted/boost/boost/mpi/python.hpp deleted file mode 100644 index bc0d077009..0000000000 --- a/contrib/restricted/boost/boost/mpi/python.hpp +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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 -#ifndef BOOST_MPI_PYTHON_HPP -#define BOOST_MPI_PYTHON_HPP - -#include <boost/python/object.hpp> - -/** @file python.hpp - * - * This header interacts with the Python bindings for Boost.MPI. The - * routines in this header can be used to register user-defined and - * library-defined data types with Boost.MPI for efficient - * (de-)serialization and separate transmission of skeletons and - * content. - * - */ - -namespace boost { namespace mpi { namespace python { - -/** - * @brief Register the type T for direct serialization within Boost.MPI - * - * The @c register_serialized function registers a C++ type for direct - * serialization within Boost.MPI. Direct serialization elides the use - * of the Python @c pickle package when serializing Python objects - * that represent C++ values. Direct serialization can be beneficial - * both to improve serialization performance (Python pickling can be - * very inefficient) and to permit serialization for Python-wrapped - * C++ objects that do not support pickling. - * - * @param value A sample value of the type @c T. This may be used - * to compute the Python type associated with the C++ type @c T. - * - * @param type The Python type associated with the C++ type @c - * T. If not provided, it will be computed from the same value @p - * value. - */ -template<typename T> -void -register_serialized(const T& value = T(), PyTypeObject* type = 0); - -/** - * @brief Registers a type for use with the skeleton/content mechanism - * in Python. - * - * The skeleton/content mechanism can only be used from Python with - * C++ types that have previously been registered via a call to this - * function. Both the sender and the transmitter must register the - * type. It is permitted to call this function multiple times for the - * same type @c T, but only one call per process per type is - * required. The type @c T must be Serializable. - * - * @param value A sample object of type T that will be used to - * determine the Python type associated with T, if @p type is not - * specified. - * - * @param type The Python type associated with the C++ type @c - * T. If not provided, it will be computed from the same value @p - * value. - */ -template<typename T> -void -register_skeleton_and_content(const T& value = T(), PyTypeObject* type = 0); - -} } } // end namespace boost::mpi::python - -#ifndef BOOST_MPI_PYTHON_FORWARD_ONLY -# include <boost/mpi/python/serialize.hpp> -# include <boost/mpi/python/skeleton_and_content.hpp> -#else -# undef BOOST_MPI_PYTHON_FORWARD_ONLY -#endif - -#endif // BOOST_MPI_PYTHON_HPP diff --git a/contrib/restricted/boost/boost/mpi/python/config.hpp b/contrib/restricted/boost/boost/mpi/python/config.hpp deleted file mode 100644 index 6126d955b2..0000000000 --- a/contrib/restricted/boost/boost/mpi/python/config.hpp +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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) - -/** @file config.hpp - * - * This header provides auto-linking and configuration support for the - * Boost.MPI python bindings. - */ -#ifndef BOOST_MPI_PYTHON_CONFIG_HPP -#define BOOST_MPI_PYTHON_CONFIG_HPP - -#include <boost/mpi/config.hpp> - -/***************************************************************************** - * * - * DLL import/export options * - * * - *****************************************************************************/ - -#if (defined(BOOST_MPI_PYTHON_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_MPI_PYTHON_STATIC_LINK) -# if defined(BOOST_MPI_PYTHON_SOURCE) -# define BOOST_MPI_PYTHON_DECL BOOST_SYMBOL_EXPORT -# define BOOST_MPI_PYTHON_BUILD_DLL -# else -# define BOOST_MPI_PYTHON_DECL BOOST_SYMBOL_IMPORT -# endif -#endif - -#ifndef BOOST_MPI_PYTHON_DECL -# define BOOST_MPI_PYTHON_DECL -#endif - -#if !defined(BOOST_MPI_PYTHON_NO_LIB) && !defined(BOOST_MPI_PYTHON_SOURCE) && !defined(BOOST_ALL_NO_LIB) -# define BOOST_LIB_NAME boost_mpi_python -# if defined(BOOST_MPI_PYTHON_DYN_LINK) || defined(BOOST_ALL_DYN_LINK) -# define BOOST_DYN_LINK -# endif -# ifdef BOOST_MPI_PYTHON_DIAG -# define BOOST_LIB_DIAGNOSTIC -# endif -# include <boost/config/auto_link.hpp> -#endif - -#endif // BOOST_MPI_PYTHON_CONFIG_HPP diff --git a/contrib/restricted/boost/boost/mpi/python/serialize.hpp b/contrib/restricted/boost/boost/mpi/python/serialize.hpp deleted file mode 100644 index feb703d836..0000000000 --- a/contrib/restricted/boost/boost/mpi/python/serialize.hpp +++ /dev/null @@ -1,540 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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 - -/** @file serialize.hpp - * - * This file provides Boost.Serialization support for Python objects - * within Boost.MPI. Python objects can be serialized in one of two - * ways. The default serialization method involves using the Python - * "pickle" module to pickle the Python objects, transmits the - * pickled representation, and unpickles the result when - * received. For C++ types that have been exposed to Python and - * registered with register_serialized(), objects are directly - * serialized for transmissing, skipping the pickling step. - */ -#ifndef BOOST_MPI_PYTHON_SERIALIZE_HPP -#define BOOST_MPI_PYTHON_SERIALIZE_HPP - -#include <boost/mpi/python/config.hpp> - -#include <boost/python/object.hpp> -#include <boost/python/str.hpp> -#include <boost/python/extract.hpp> - -#include <map> - -#include <boost/function/function3.hpp> - -#include <boost/mpl/bool.hpp> -#include <boost/mpl/if.hpp> - -#include <boost/serialization/split_free.hpp> -#include <boost/serialization/array.hpp> -#include <boost/serialization/array_wrapper.hpp> -#include <boost/smart_ptr/scoped_array.hpp> - -#include <boost/assert.hpp> - -#include <boost/type_traits/is_fundamental.hpp> - -#define BOOST_MPI_PYTHON_FORWARD_ONLY -#include <boost/mpi/python.hpp> - -/************************************************************************ - * Boost.Python Serialization Section * - ************************************************************************/ -#if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE) -/** - * @brief Declare IArchive and OArchive as a Boost.Serialization - * archives that can be used for Python objects. - * - * This macro can only be expanded from the global namespace. It only - * requires that Archiver be forward-declared. IArchiver and OArchiver - * will only support Serialization of Python objects by pickling - * them. If the Archiver type should also support "direct" - * serialization (for C++ types), use - * BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE instead. - */ -# define BOOST_PYTHON_SERIALIZATION_ARCHIVE(IArchiver, OArchiver) \ -namespace boost { namespace python { namespace api { \ - template<typename R, typename T> \ - struct enable_binary< IArchiver , R, T> {}; \ - \ - template<typename R, typename T> \ - struct enable_binary< OArchiver , R, T> {}; \ -} } } -# else -# define BOOST_PYTHON_SERIALIZATION_ARCHIVE(IArchiver, OArchiver) -#endif - -/** - * @brief Declare IArchiver and OArchiver as a Boost.Serialization - * archives that can be used for Python objects and C++ objects - * wrapped in Python. - * - * This macro can only be expanded from the global namespace. It only - * requires that IArchiver and OArchiver be forward-declared. However, - * note that you will also need to write - * BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE_IMPL(IArchiver, - * OArchiver) in one of your translation units. - -DPG PICK UP HERE - */ -#define BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE(IArchiver, OArchiver) \ -BOOST_PYTHON_SERIALIZATION_ARCHIVE(IArchiver, OArchiver) \ -namespace boost { namespace python { namespace detail { \ -template<> \ -BOOST_MPI_PYTHON_DECL direct_serialization_table< IArchiver , OArchiver >& \ - get_direct_serialization_table< IArchiver , OArchiver >(); \ -} \ - \ -template<> \ -struct has_direct_serialization< IArchiver , OArchiver> : mpl::true_ { }; \ - \ -template<> \ -struct output_archiver< IArchiver > { typedef OArchiver type; }; \ - \ -template<> \ -struct input_archiver< OArchiver > { typedef IArchiver type; }; \ -} } - -/** - * @brief Define the implementation for Boost.Serialization archivers - * that can be used for Python objects and C++ objects wrapped in - * Python. - * - * This macro can only be expanded from the global namespace. It only - * requires that IArchiver and OArchiver be forward-declared. Before - * using this macro, you will need to declare IArchiver and OArchiver - * as direct serialization archives with - * BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE(IArchiver, OArchiver). - */ -#define BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE_IMPL(IArchiver, OArchiver) \ -namespace boost { namespace python { namespace detail { \ -template \ - class BOOST_MPI_PYTHON_DECL direct_serialization_table< IArchiver , OArchiver >; \ - \ -template<> \ - BOOST_MPI_PYTHON_DECL \ - direct_serialization_table< IArchiver , OArchiver >& \ - get_direct_serialization_table< IArchiver , OArchiver >( ) \ -{ \ - static direct_serialization_table< IArchiver, OArchiver > table; \ - return table; \ -} \ -} } } - -namespace boost { namespace python { - -/** - * INTERNAL ONLY - * - * Provides access to the Python "pickle" module from within C++. - */ -class BOOST_MPI_PYTHON_DECL pickle { - struct data_t; - -public: - static str dumps(object obj, int protocol = -1); - static object loads(str s); - -private: - static void initialize_data(); - - static data_t* data; -}; - -/** - * @brief Whether the input/output archiver pair has "direct" - * serialization for C++ objects exposed in Python. - * - * Users do not typically need to specialize this trait, as it will be - * specialized as part of the macro - * BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE. - */ -template<typename IArchiver, typename OArchiver> -struct has_direct_serialization : mpl::false_ { }; - -/** - * @brief A metafunction that determines the output archiver for the - * given input archiver. - * - * Users do not typically need to specialize this trait, as it will be - * specialized as part of the macro - * BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE. - */ -template<typename IArchiver> struct output_archiver { }; - -/** - * @brief A metafunction that determines the input archiver for the - * given output archiver. - * - * Users do not typically need to specialize this trait, as it will be - * specialized as part of the macro - * BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE. - * - */ -template<typename OArchiver> struct input_archiver { }; - -namespace detail { - - /** - * INTERNAL ONLY - * - * This class contains the direct-serialization code for the given - * IArchiver/OArchiver pair. It is intended to be used as a - * singleton class, and will be accessed when (de-)serializing a - * Boost.Python object with an archiver that supports direct - * serializations. Do not create instances of this class directly: - * instead, use get_direct_serialization_table. - */ - template<typename IArchiver, typename OArchiver> - class BOOST_MPI_PYTHON_DECL direct_serialization_table - { - public: - typedef boost::function3<void, OArchiver&, const object&, const unsigned int> - saver_t; - typedef boost::function3<void, IArchiver&, object&, const unsigned int> - loader_t; - - typedef std::map<PyTypeObject*, std::pair<int, saver_t> > savers_t; - typedef std::map<int, loader_t> loaders_t; - - /** - * Retrieve the saver (serializer) associated with the Python - * object @p obj. - * - * @param obj The object we want to save. Only its (Python) type - * is important. - * - * @param descriptor The value of the descriptor associated to - * the returned saver. Will be set to zero if no saver was found - * for @p obj. - * - * @returns a function object that can be used to serialize this - * object (and other objects of the same type), if possible. If - * no saver can be found, returns an empty function object.. - */ - saver_t saver(const object& obj, int& descriptor) - { - typename savers_t::iterator pos = savers.find(obj.ptr()->ob_type); - if (pos != savers.end()) { - descriptor = pos->second.first; - return pos->second.second; - } - else { - descriptor = 0; - return saver_t(); - } - } - - /** - * Retrieve the loader (deserializer) associated with the given - * descriptor. - * - * @param descriptor The descriptor number provided by saver() - * when determining the saver for this type. - * - * @returns a function object that can be used to deserialize an - * object whose type is the same as that corresponding to the - * descriptor. If the descriptor is unknown, the return value - * will be an empty function object. - */ - loader_t loader(int descriptor) - { - typename loaders_t::iterator pos = loaders.find(descriptor); - if (pos != loaders.end()) - return pos->second; - else - return loader_t(); - } - - /** - * Register the type T for direct serialization. - * - * @param value A sample value of the type @c T. This may be used - * to compute the Python type associated with the C++ type @c T. - * - * @param type The Python type associated with the C++ type @c - * T. If not provided, it will be computed from the same value @p - * value. - */ - template<typename T> - void register_type(const T& value = T(), PyTypeObject* type = 0) - { - // If the user did not provide us with a Python type, figure it - // out for ourselves. - if (!type) { - object obj(value); - type = obj.ptr()->ob_type; - } - - register_type(default_saver<T>(), default_loader<T>(type), value, type); - } - - /** - * Register the type T for direct serialization. - * - * @param saver A function object that will serialize a - * Boost.Python object (that represents a C++ object of type @c - * T) to an @c OArchive. - * - * @param loader A function object that will deserialize from an - * @c IArchive into a Boost.Python object that represents a C++ - * object of type @c T. - * - * @param value A sample value of the type @c T. This may be used - * to compute the Python type associated with the C++ type @c T. - * - * @param type The Python type associated with the C++ type @c - * T. If not provided, it will be computed from the same value @p - * value. - */ - template<typename T> - void register_type(const saver_t& saver, const loader_t& loader, - const T& value = T(), PyTypeObject* type = 0) - { - // If the user did not provide us with a Python type, figure it - // out for ourselves. - if (!type) { - object obj(value); - type = obj.ptr()->ob_type; - } - - int descriptor = savers.size() + 1; - if (savers.find(type) != savers.end()) - return; - - savers[type] = std::make_pair(descriptor, saver); - loaders[descriptor] = loader; - } - - protected: - template<typename T> - struct default_saver { - void operator()(OArchiver& ar, const object& obj, const unsigned int) { - T value = extract<T>(obj)(); - ar << value; - } - }; - - template<typename T> - struct default_loader { - default_loader(PyTypeObject* type) : type(type) { } - - void operator()(IArchiver& ar, object& obj, const unsigned int) { - // If we can, extract the object in place. - if (!is_fundamental<T>::value && obj && obj.ptr()->ob_type == type) { - ar >> extract<T&>(obj)(); - } else { - T value; - ar >> value; - obj = object(value); - } - } - - private: - PyTypeObject* type; - }; - - savers_t savers; - loaders_t loaders; - }; - - /** - * @brief Retrieve the direct-serialization table for an - * IArchiver/OArchiver pair. - * - * This function is responsible for returning a reference to the - * singleton direct-serialization table. Its primary template is - * left undefined, to force the use of an explicit specialization - * with a definition in a single translation unit. Use the macro - * BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE_IMPL to define this - * explicit specialization. - */ - template<typename IArchiver, typename OArchiver> - direct_serialization_table<IArchiver, OArchiver>& - get_direct_serialization_table(); -} // end namespace detail - -/** - * @brief Register the type T for direct serialization. - * - * The @c register_serialized function registers a C++ type for direct - * serialization with the given @c IArchiver/@c OArchiver pair. Direct - * serialization elides the use of the Python @c pickle package when - * serializing Python objects that represent C++ values. Direct - * serialization can be beneficial both to improve serialization - * performance (Python pickling can be very inefficient) and to permit - * serialization for Python-wrapped C++ objects that do not support - * pickling. - * - * @param value A sample value of the type @c T. This may be used - * to compute the Python type associated with the C++ type @c T. - * - * @param type The Python type associated with the C++ type @c - * T. If not provided, it will be computed from the same value @p - * value. - */ -template<typename IArchiver, typename OArchiver, typename T> -void -register_serialized(const T& value = T(), PyTypeObject* type = 0) -{ - detail::direct_serialization_table<IArchiver, OArchiver>& table = - detail::get_direct_serialization_table<IArchiver, OArchiver>(); - table.register_type(value, type); -} - -namespace detail { - -/// Save a Python object by pickling it. -template<typename Archiver> -void -save_impl(Archiver& ar, const boost::python::object& obj, - const unsigned int /*version*/, - mpl::false_ /*has_direct_serialization*/) -{ - boost::python::str py_string = boost::python::pickle::dumps(obj); - int len = boost::python::extract<int>(py_string.attr("__len__")()); - const char* string = boost::python::extract<const char*>(py_string); - ar << len << boost::serialization::make_array(string, len); -} - -/// Try to save a Python object by directly serializing it; fall back -/// on pickling if required. -template<typename Archiver> -void -save_impl(Archiver& ar, const boost::python::object& obj, - const unsigned int version, - mpl::true_ /*has_direct_serialization*/) -{ - typedef Archiver OArchiver; - typedef typename input_archiver<OArchiver>::type IArchiver; - typedef typename direct_serialization_table<IArchiver, OArchiver>::saver_t - saver_t; - - direct_serialization_table<IArchiver, OArchiver>& table = - get_direct_serialization_table<IArchiver, OArchiver>(); - - int descriptor = 0; - if (saver_t saver = table.saver(obj, descriptor)) { - ar << descriptor; - saver(ar, obj, version); - } else { - // Pickle it - ar << descriptor; - detail::save_impl(ar, obj, version, mpl::false_()); - } -} - -/// Load a Python object by unpickling it -template<typename Archiver> -void -load_impl(Archiver& ar, boost::python::object& obj, - const unsigned int /*version*/, - mpl::false_ /*has_direct_serialization*/) -{ - int len; - ar >> len; - - boost::scoped_array<char> string(new char[len]); - ar >> boost::serialization::make_array(string.get(), len); - boost::python::str py_string(string.get(), len); - obj = boost::python::pickle::loads(py_string); -} - -/// Try to load a Python object by directly deserializing it; fall back -/// on unpickling if required. -template<typename Archiver> -void -load_impl(Archiver& ar, boost::python::object& obj, - const unsigned int version, - mpl::true_ /*has_direct_serialization*/) -{ - typedef Archiver IArchiver; - typedef typename output_archiver<IArchiver>::type OArchiver; - typedef typename direct_serialization_table<IArchiver, OArchiver>::loader_t - loader_t; - - direct_serialization_table<IArchiver, OArchiver>& table = - get_direct_serialization_table<IArchiver, OArchiver>(); - - int descriptor; - ar >> descriptor; - - if (descriptor) { - loader_t loader = table.loader(descriptor); - BOOST_ASSERT(loader); - - loader(ar, obj, version); - } else { - // Unpickle it - detail::load_impl(ar, obj, version, mpl::false_()); - } -} - -} // end namespace detail - -template<typename Archiver> -void -save(Archiver& ar, const boost::python::object& obj, - const unsigned int version) -{ - typedef Archiver OArchiver; - typedef typename input_archiver<OArchiver>::type IArchiver; - - detail::save_impl(ar, obj, version, - has_direct_serialization<IArchiver, OArchiver>()); -} - -template<typename Archiver> -void -load(Archiver& ar, boost::python::object& obj, - const unsigned int version) -{ - typedef Archiver IArchiver; - typedef typename output_archiver<IArchiver>::type OArchiver; - - detail::load_impl(ar, obj, version, - has_direct_serialization<IArchiver, OArchiver>()); -} - -template<typename Archive> -inline void -serialize(Archive& ar, boost::python::object& obj, const unsigned int version) -{ - boost::serialization::split_free(ar, obj, version); -} - -} } // end namespace boost::python - -/************************************************************************ - * Boost.MPI-Specific Section * - ************************************************************************/ -namespace boost { namespace mpi { - class packed_iarchive; - class packed_oarchive; -} } // end namespace boost::mpi - -BOOST_PYTHON_DIRECT_SERIALIZATION_ARCHIVE( - ::boost::mpi::packed_iarchive, - ::boost::mpi::packed_oarchive) - -namespace boost { namespace mpi { namespace python { - -template<typename T> -void -register_serialized(const T& value, PyTypeObject* type) -{ - using boost::python::register_serialized; - register_serialized<packed_iarchive, packed_oarchive>(value, type); -} - -} } } // end namespace boost::mpi::python - -#endif // BOOST_MPI_PYTHON_SERIALIZE_HPP diff --git a/contrib/restricted/boost/boost/mpi/python/skeleton_and_content.hpp b/contrib/restricted/boost/boost/mpi/python/skeleton_and_content.hpp deleted file mode 100644 index 2d64382fe6..0000000000 --- a/contrib/restricted/boost/boost/mpi/python/skeleton_and_content.hpp +++ /dev/null @@ -1,209 +0,0 @@ -// (C) Copyright 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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 -#ifndef BOOST_MPI_PYTHON_SKELETON_AND_CONTENT_HPP -#define BOOST_MPI_PYTHON_SKELETON_AND_CONTENT_HPP - -/** @file skeleton_and_content.hpp - * - * This file reflects the skeleton/content facilities into Python. - */ -#include <boost/python.hpp> -#include <boost/mpi.hpp> -#include <boost/function/function1.hpp> -#define BOOST_MPI_PYTHON_FORWARD_ONLY -#include <boost/mpi/python.hpp> -#include <boost/mpi/python/serialize.hpp> - - -namespace boost { namespace mpi { namespace python { - -/** - * INTERNAL ONLY - * - * This @c content class is a wrapper around the C++ "content" - * retrieved from get_content. This wrapper is only needed to store a - * copy of the Python object on which get_content() was called. - */ -class content : public boost::mpi::content -{ - typedef boost::mpi::content inherited; - - public: - content(const inherited& base, boost::python::object object) - : inherited(base), object(object) { } - - inherited& base() { return *this; } - const inherited& base() const { return *this; } - - boost::python::object object; -}; - -/** - * INTERNAL ONLY - * - * A class specific to the Python bindings that mimics the behavior of - * the skeleton_proxy<T> template. In the case of Python skeletons, we - * only need to know the object (and its type) to transmit the - * skeleton. This is the only user-visible skeleton proxy type, - * although instantiations of its derived classes (@c - * skeleton_proxy<T>) will be returned from the Python skeleton() - * function. - */ -class skeleton_proxy_base -{ -public: - skeleton_proxy_base(const boost::python::object& object) : object(object) { } - - boost::python::object object; -}; - -/** - * INTERNAL ONLY - * - * The templated @c skeleton_proxy class represents a skeleton proxy - * in Python. The only data is stored in the @c skeleton_proxy_base - * class (which is the type actually exposed as @c skeleton_proxy in - * Python). However, the type of @c skeleton_proxy<T> is important for - * (de-)serialization of @c skeleton_proxy<T>'s for transmission. - */ -template<typename T> -class skeleton_proxy : public skeleton_proxy_base -{ - public: - skeleton_proxy(const boost::python::object& object) - : skeleton_proxy_base(object) { } -}; - -namespace detail { - using boost::python::object; - using boost::python::extract; - - extern BOOST_MPI_DECL boost::python::object skeleton_proxy_base_type; - - template<typename T> - struct skeleton_saver - { - void - operator()(packed_oarchive& ar, const object& obj, const unsigned int) - { - packed_skeleton_oarchive pso(ar); - pso << extract<T&>(obj.attr("object"))(); - } - }; - - template<typename T> - struct skeleton_loader - { - void - operator()(packed_iarchive& ar, object& obj, const unsigned int) - { - packed_skeleton_iarchive psi(ar); - extract<skeleton_proxy<T>&> proxy(obj); - if (!proxy.check()) - obj = object(skeleton_proxy<T>(object(T()))); - - psi >> extract<T&>(obj.attr("object"))(); - } - }; - - /** - * The @c skeleton_content_handler structure contains all of the - * information required to extract a skeleton and content from a - * Python object with a certain C++ type. - */ - struct skeleton_content_handler { - function1<object, const object&> get_skeleton_proxy; - function1<content, const object&> get_content; - }; - - /** - * A function object that extracts the skeleton from of a Python - * object, which is actually a wrapped C++ object of type T. - */ - template<typename T> - struct do_get_skeleton_proxy - { - object operator()(object value) { - return object(skeleton_proxy<T>(value)); - } - }; - - /** - * A function object that extracts the content of a Python object, - * which is actually a wrapped C++ object of type T. - */ - template<typename T> - struct do_get_content - { - content operator()(object value_obj) { - T& value = extract<T&>(value_obj)(); - return content(boost::mpi::get_content(value), value_obj); - } - }; - - /** - * Determine if a skeleton and content handler for @p type has - * already been registered. - */ - BOOST_MPI_PYTHON_DECL bool - skeleton_and_content_handler_registered(PyTypeObject* type); - - /** - * Register a skeleton/content handler with a particular Python type - * (which actually wraps a C++ type). - */ - BOOST_MPI_PYTHON_DECL void - register_skeleton_and_content_handler(PyTypeObject*, - const skeleton_content_handler&); -} // end namespace detail - -template<typename T> -void register_skeleton_and_content(const T& value, PyTypeObject* type) -{ - using boost::python::detail::direct_serialization_table; - using boost::python::detail::get_direct_serialization_table; - using namespace boost::python; - - // Determine the type - if (!type) - type = object(value).ptr()->ob_type; - - // Don't re-register the same type. - if (detail::skeleton_and_content_handler_registered(type)) - return; - - // Register the skeleton proxy type - { - boost::python::scope proxy_scope(detail::skeleton_proxy_base_type); - std::string name("skeleton_proxy<"); - name += typeid(T).name(); - name += ">"; - class_<skeleton_proxy<T>, bases<skeleton_proxy_base> >(name.c_str(), - no_init); - } - - // Register the saver and loader for the associated skeleton and - // proxy, to allow (de-)serialization of skeletons via the proxy. - direct_serialization_table<packed_iarchive, packed_oarchive>& table = - get_direct_serialization_table<packed_iarchive, packed_oarchive>(); - table.register_type(detail::skeleton_saver<T>(), - detail::skeleton_loader<T>(), - skeleton_proxy<T>(object(value))); - - // Register the rest of the skeleton/content mechanism, including - // handlers that extract a skeleton proxy from a Python object and - // extract the content from a Python object. - detail::skeleton_content_handler handler; - handler.get_skeleton_proxy = detail::do_get_skeleton_proxy<T>(); - handler.get_content = detail::do_get_content<T>(); - detail::register_skeleton_and_content_handler(type, handler); -} - -} } } // end namespace boost::mpi::python - -#endif // BOOST_MPI_PYTHON_SKELETON_AND_CONTENT_HPP diff --git a/contrib/restricted/boost/boost/mpi/request.hpp b/contrib/restricted/boost/boost/mpi/request.hpp deleted file mode 100644 index cb36cc5ab8..0000000000 --- a/contrib/restricted/boost/boost/mpi/request.hpp +++ /dev/null @@ -1,102 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -/** @file request.hpp - * - * This header defines the class @c request, which contains a request - * for non-blocking communication. - */ -#ifndef BOOST_MPI_REQUEST_HPP -#define BOOST_MPI_REQUEST_HPP - -#include <boost/mpi/config.hpp> -#include <boost/optional.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/mpi/packed_iarchive.hpp> - -namespace boost { namespace mpi { - -class status; -class communicator; - -/** - * @brief A request for a non-blocking send or receive. - * - * This structure contains information about a non-blocking send or - * receive and will be returned from @c isend or @c irecv, - * respectively. - */ -class BOOST_MPI_DECL request -{ - public: - /** - * Constructs a NULL request. - */ - request(); - - /** - * Wait until the communication associated with this request has - * completed, then return a @c status object describing the - * communication. - */ - status wait(); - - /** - * Determine whether the communication associated with this request - * has completed successfully. If so, returns the @c status object - * describing the communication. Otherwise, returns an empty @c - * optional<> to indicate that the communication has not completed - * yet. Note that once @c test() returns a @c status object, the - * request has completed and @c wait() should not be called. - */ - optional<status> test(); - - /** - * Cancel a pending communication, assuming it has not already been - * completed. - */ - void cancel(); - - private: - enum request_action { ra_wait, ra_test, ra_cancel }; - typedef optional<status> (*handler_type)(request* self, - request_action action); - - /** - * INTERNAL ONLY - * - * Handles the non-blocking receive of a serialized value. - */ - template<typename T> - static optional<status> - handle_serialized_irecv(request* self, request_action action); - - /** - * INTERNAL ONLY - * - * Handles the non-blocking receive of an array of serialized values. - */ - template<typename T> - static optional<status> - handle_serialized_array_irecv(request* self, request_action action); - - public: // template friends are not portable - - /// INTERNAL ONLY - MPI_Request m_requests[2]; - - /// INTERNAL ONLY - handler_type m_handler; - - /// INTERNAL ONLY - shared_ptr<void> m_data; - - friend class communicator; -}; - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_REQUEST_HPP diff --git a/contrib/restricted/boost/boost/mpi/skeleton_and_content.hpp b/contrib/restricted/boost/boost/mpi/skeleton_and_content.hpp deleted file mode 100644 index dcd13bfe57..0000000000 --- a/contrib/restricted/boost/boost/mpi/skeleton_and_content.hpp +++ /dev/null @@ -1,392 +0,0 @@ -// (C) Copyright 2005 Matthias Troyer -// (C) Copyright 2006 Douglas Gregor <doug.gregor -at gmail.com> - -// 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: Matthias Troyer -// Douglas Gregor - -/** @file skeleton_and_content.hpp - * - * This header provides facilities that allow the structure of data - * types (called the "skeleton") to be transmitted and received - * separately from the content stored in those data types. These - * facilities are useful when the data in a stable data structure - * (e.g., a mesh or a graph) will need to be transmitted - * repeatedly. In this case, transmitting the skeleton only once - * saves both communication effort (it need not be sent again) and - * local computation (serialization need only be performed once for - * the content). - */ -#ifndef BOOST_MPI_SKELETON_AND_CONTENT_HPP -#define BOOST_MPI_SKELETON_AND_CONTENT_HPP - -#include <boost/mpi/config.hpp> -#include <boost/archive/detail/auto_link_archive.hpp> -#include <boost/mpi/packed_iarchive.hpp> -#include <boost/mpi/packed_oarchive.hpp> -#include <boost/mpi/detail/forward_skeleton_iarchive.hpp> -#include <boost/mpi/detail/forward_skeleton_oarchive.hpp> -#include <boost/mpi/detail/ignore_iprimitive.hpp> -#include <boost/mpi/detail/ignore_oprimitive.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/archive/detail/register_archive.hpp> - -namespace boost { namespace mpi { - -/** - * @brief A proxy that requests that the skeleton of an object be - * transmitted. - * - * The @c skeleton_proxy is a lightweight proxy object used to - * indicate that the skeleton of an object, not the object itself, - * should be transmitted. It can be used with the @c send and @c recv - * operations of communicators or the @c broadcast collective. When a - * @c skeleton_proxy is sent, Boost.MPI generates a description - * containing the structure of the stored object. When that skeleton - * is received, the receiving object is reshaped to match the - * structure. Once the skeleton of an object as been transmitted, its - * @c content can be transmitted separately (often several times) - * without changing the structure of the object. - */ -template <class T> -struct BOOST_MPI_DECL skeleton_proxy -{ - /** - * Constructs a @c skeleton_proxy that references object @p x. - * - * @param x the object whose structure will be transmitted or - * altered. - */ - skeleton_proxy(T& x) - : object(x) - {} - - T& object; -}; - -/** - * @brief Create a skeleton proxy object. - * - * This routine creates an instance of the skeleton_proxy class. It - * will typically be used when calling @c send, @c recv, or @c - * broadcast, to indicate that only the skeleton (structure) of an - * object should be transmitted and not its contents. - * - * @param x the object whose structure will be transmitted. - * - * @returns a skeleton_proxy object referencing @p x - */ -template <class T> -inline const skeleton_proxy<T> skeleton(T& x) -{ - return skeleton_proxy<T>(x); -} - -namespace detail { - /// @brief a class holding an MPI datatype - /// INTERNAL ONLY - /// the type is freed upon destruction - class BOOST_MPI_DECL mpi_datatype_holder : public boost::noncopyable - { - public: - mpi_datatype_holder() - : is_committed(false) - {} - - mpi_datatype_holder(MPI_Datatype t, bool committed = true) - : d(t) - , is_committed(committed) - {} - - void commit() - { - BOOST_MPI_CHECK_RESULT(MPI_Type_commit,(&d)); - is_committed=true; - } - - MPI_Datatype get_mpi_datatype() const - { - return d; - } - - ~mpi_datatype_holder() - { - int finalized=0; - BOOST_MPI_CHECK_RESULT(MPI_Finalized,(&finalized)); - if (!finalized && is_committed) - BOOST_MPI_CHECK_RESULT(MPI_Type_free,(&d)); - } - - private: - MPI_Datatype d; - bool is_committed; - }; -} // end namespace detail - -/** @brief A proxy object that transfers the content of an object - * without its structure. - * - * The @c content class indicates that Boost.MPI should transmit or - * receive the content of an object, but without any information - * about the structure of the object. It is only meaningful to - * transmit the content of an object after the receiver has already - * received the skeleton for the same object. - * - * Most users will not use @c content objects directly. Rather, they - * will invoke @c send, @c recv, or @c broadcast operations using @c - * get_content(). - */ -class BOOST_MPI_DECL content -{ -public: - /** - * Constructs an empty @c content object. This object will not be - * useful for any Boost.MPI operations until it is reassigned. - */ - content() {} - - /** - * This routine initializes the @c content object with an MPI data - * type that refers to the content of an object without its structure. - * - * @param d the MPI data type referring to the content of the object. - * - * @param committed @c true indicates that @c MPI_Type_commit has - * already been excuted for the data type @p d. - */ - content(MPI_Datatype d, bool committed=true) - : holder(new detail::mpi_datatype_holder(d,committed)) - {} - - /** - * Replace the MPI data type referencing the content of an object. - * - * @param d the new MPI data type referring to the content of the - * object. - * - * @returns *this - */ - const content& operator=(MPI_Datatype d) - { - holder.reset(new detail::mpi_datatype_holder(d)); - return *this; - } - - /** - * Retrieve the MPI data type that refers to the content of the - * object. - * - * @returns the MPI data type, which should only be transmitted or - * received using @c MPI_BOTTOM as the address. - */ - MPI_Datatype get_mpi_datatype() const - { - return holder->get_mpi_datatype(); - } - - /** - * Commit the MPI data type referring to the content of the - * object. - */ - void commit() - { - holder->commit(); - } - -private: - boost::shared_ptr<detail::mpi_datatype_holder> holder; -}; - -/** @brief Returns the content of an object, suitable for transmission - * via Boost.MPI. - * - * The function creates an absolute MPI datatype for the object, - * where all offsets are counted from the address 0 (a.k.a. @c - * MPI_BOTTOM) instead of the address @c &x of the object. This - * allows the creation of MPI data types for complex data structures - * containing pointers, such as linked lists or trees. - * - * The disadvantage, compared to relative MPI data types is that for - * each object a new MPI data type has to be created. - * - * The contents of an object can only be transmitted when the - * receiver already has an object with the same structure or shape as - * the sender. To accomplish this, first transmit the skeleton of the - * object using, e.g., @c skeleton() or @c skeleton_proxy. - * - * The type @c T has to allow creation of an absolute MPI data type - * (content). - * - * @param x the object for which the content will be transmitted. - * - * @returns the content of the object @p x, which can be used for - * transmission via @c send, @c recv, or @c broadcast. - */ -template <class T> const content get_content(const T& x); - -/** @brief An archiver that reconstructs a data structure based on the - * binary skeleton stored in a buffer. - * - * The @c packed_skeleton_iarchive class is an Archiver (as in the - * Boost.Serialization library) that can construct the the shape of a - * data structure based on a binary skeleton stored in a buffer. The - * @c packed_skeleton_iarchive is typically used by the receiver of a - * skeleton, to prepare a data structure that will eventually receive - * content separately. - * - * Users will not generally need to use @c packed_skeleton_iarchive - * directly. Instead, use @c skeleton or @c get_skeleton. - */ -class BOOST_MPI_DECL packed_skeleton_iarchive - : public detail::ignore_iprimitive, - public detail::forward_skeleton_iarchive<packed_skeleton_iarchive,packed_iarchive> -{ -public: - /** - * Construct a @c packed_skeleton_iarchive for the given - * communicator. - * - * @param comm The communicator over which this archive will be - * transmitted. - * - * @param flags Control the serialization of the skeleton. Refer to - * the Boost.Serialization documentation before changing the - * default flags. - */ - packed_skeleton_iarchive(MPI_Comm const & comm, - unsigned int flags = boost::archive::no_header) - : detail::forward_skeleton_iarchive<packed_skeleton_iarchive,packed_iarchive>(skeleton_archive_) - , skeleton_archive_(comm,flags) - {} - - /** - * Construct a @c packed_skeleton_iarchive that unpacks a skeleton - * from the given @p archive. - * - * @param archive the archive from which the skeleton will be - * unpacked. - * - */ - explicit packed_skeleton_iarchive(packed_iarchive & archive) - : detail::forward_skeleton_iarchive<packed_skeleton_iarchive,packed_iarchive>(archive) - , skeleton_archive_(MPI_COMM_WORLD, boost::archive::no_header) - {} - - /** - * Retrieve the archive corresponding to this skeleton. - */ - const packed_iarchive& get_skeleton() const - { - return this->implementation_archive; - } - - /** - * Retrieve the archive corresponding to this skeleton. - */ - packed_iarchive& get_skeleton() - { - return this->implementation_archive; - } - -private: - /// Store the actual archive that holds the structure, unless the - /// user overrides this with their own archive. - packed_iarchive skeleton_archive_; -}; - -/** @brief An archiver that records the binary skeleton of a data - * structure into a buffer. - * - * The @c packed_skeleton_oarchive class is an Archiver (as in the - * Boost.Serialization library) that can record the shape of a data - * structure (called the "skeleton") into a binary representation - * stored in a buffer. The @c packed_skeleton_oarchive is typically - * used by the send of a skeleton, to pack the skeleton of a data - * structure for transmission separately from the content. - * - * Users will not generally need to use @c packed_skeleton_oarchive - * directly. Instead, use @c skeleton or @c get_skeleton. - */ -class BOOST_MPI_DECL packed_skeleton_oarchive - : public detail::ignore_oprimitive, - public detail::forward_skeleton_oarchive<packed_skeleton_oarchive,packed_oarchive> -{ -public: - /** - * Construct a @c packed_skeleton_oarchive for the given - * communicator. - * - * @param comm The communicator over which this archive will be - * transmitted. - * - * @param flags Control the serialization of the skeleton. Refer to - * the Boost.Serialization documentation before changing the - * default flags. - */ - packed_skeleton_oarchive(MPI_Comm const & comm, - unsigned int flags = boost::archive::no_header) - : detail::forward_skeleton_oarchive<packed_skeleton_oarchive,packed_oarchive>(skeleton_archive_) - , skeleton_archive_(comm,flags) - {} - - /** - * Construct a @c packed_skeleton_oarchive that packs a skeleton - * into the given @p archive. - * - * @param archive the archive to which the skeleton will be packed. - * - */ - explicit packed_skeleton_oarchive(packed_oarchive & archive) - : detail::forward_skeleton_oarchive<packed_skeleton_oarchive,packed_oarchive>(archive) - , skeleton_archive_(MPI_COMM_WORLD, boost::archive::no_header) - {} - - /** - * Retrieve the archive corresponding to this skeleton. - */ - const packed_oarchive& get_skeleton() const - { - return this->implementation_archive; - } - -private: - /// Store the actual archive that holds the structure. - packed_oarchive skeleton_archive_; -}; - -namespace detail { - typedef boost::mpi::detail::forward_skeleton_oarchive<boost::mpi::packed_skeleton_oarchive,boost::mpi::packed_oarchive> type1; - typedef boost::mpi::detail::forward_skeleton_iarchive<boost::mpi::packed_skeleton_iarchive,boost::mpi::packed_iarchive> type2; -} - - -} } // end namespace boost::mpi - -#include <boost/mpi/detail/content_oarchive.hpp> - -// For any headers that have provided declarations based on forward -// declarations of the contents of this header, include definitions -// for those declarations. This means that the inclusion of -// skeleton_and_content.hpp enables the use of skeleton/content -// transmission throughout the library. -#ifdef BOOST_MPI_BROADCAST_HPP -# include <boost/mpi/detail/broadcast_sc.hpp> -#endif - -#ifdef BOOST_MPI_COMMUNICATOR_HPP -# include <boost/mpi/detail/communicator_sc.hpp> -#endif - -// required by export -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::packed_skeleton_oarchive) -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::packed_skeleton_iarchive) -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::type1) -BOOST_SERIALIZATION_REGISTER_ARCHIVE(boost::mpi::detail::type2) - -BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::packed_skeleton_oarchive) -BOOST_SERIALIZATION_USE_ARRAY_OPTIMIZATION(boost::mpi::packed_skeleton_iarchive) - -#endif // BOOST_MPI_SKELETON_AND_CONTENT_HPP diff --git a/contrib/restricted/boost/boost/mpi/skeleton_and_content_fwd.hpp b/contrib/restricted/boost/boost/mpi/skeleton_and_content_fwd.hpp deleted file mode 100644 index 9df47fa317..0000000000 --- a/contrib/restricted/boost/boost/mpi/skeleton_and_content_fwd.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// (C) Copyright 2006 Douglas Gregor <doug.gregor -at gmail.com> - -// 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 - -/** @file skeleton_and_content_fwd.hpp - * - * This header contains all of the forward declarations required to - * use transmit skeletons of data structures and the content of data - * structures separately. To actually transmit skeletons or content, - * include the header @c boost/mpi/skeleton_and_content.hpp. - */ - -#ifndef BOOST_MPI_SKELETON_AND_CONTENT_FWD_HPP -#define BOOST_MPI_SKELETON_AND_CONTENT_FWD_HPP - -namespace boost { namespace mpi { - -template <class T> struct skeleton_proxy; -template <class T> const skeleton_proxy<T> skeleton(T& x); -class content; -template <class T> const content get_content(const T& x); -class packed_skeleton_iarchive; -class packed_skeleton_oarchive; - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_SKELETON_AND_CONTENT_FWD_HPP diff --git a/contrib/restricted/boost/boost/mpi/status.hpp b/contrib/restricted/boost/boost/mpi/status.hpp deleted file mode 100644 index d444faa41d..0000000000 --- a/contrib/restricted/boost/boost/mpi/status.hpp +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com>. - -// 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) - -/** @file status.hpp - * - * This header defines the class @c status, which reports on the - * results of point-to-point communication. - */ -#ifndef BOOST_MPI_STATUS_HPP -#define BOOST_MPI_STATUS_HPP - -#include <boost/mpi/config.hpp> -#include <boost/optional.hpp> - -namespace boost { namespace mpi { - -class request; -class communicator; - -/** @brief Contains information about a message that has been or can - * be received. - * - * This structure contains status information about messages that - * have been received (with @c communicator::recv) or can be received - * (returned from @c communicator::probe or @c - * communicator::iprobe). It permits access to the source of the - * message, message tag, error code (rarely used), or the number of - * elements that have been transmitted. - */ -class BOOST_MPI_DECL status -{ - public: - status() : m_count(-1) { } - - status(MPI_Status const& s) : m_status(s), m_count(-1) {} - - /** - * Retrieve the source of the message. - */ - int source() const { return m_status.MPI_SOURCE; } - - /** - * Retrieve the message tag. - */ - int tag() const { return m_status.MPI_TAG; } - - /** - * Retrieve the error code. - */ - int error() const { return m_status.MPI_ERROR; } - - /** - * Determine whether the communication associated with this object - * has been successfully cancelled. - */ - bool cancelled() const; - - /** - * Determines the number of elements of type @c T contained in the - * message. The type @c T must have an associated data type, i.e., - * @c is_mpi_datatype<T> must derive @c mpl::true_. In cases where - * the type @c T does not match the transmitted type, this routine - * will return an empty @c optional<int>. - * - * @returns the number of @c T elements in the message, if it can be - * determined. - */ - template<typename T> optional<int> count() const; - - /** - * References the underlying @c MPI_Status - */ - operator MPI_Status&() { return m_status; } - - /** - * References the underlying @c MPI_Status - */ - operator const MPI_Status&() const { return m_status; } - - private: - /** - * INTERNAL ONLY - */ - template<typename T> optional<int> count_impl(mpl::true_) const; - - /** - * INTERNAL ONLY - */ - template<typename T> optional<int> count_impl(mpl::false_) const; - - public: // friend templates are not portable - - /// INTERNAL ONLY - mutable MPI_Status m_status; - mutable int m_count; - - friend class communicator; - friend class request; -}; - - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_STATUS_HPP diff --git a/contrib/restricted/boost/boost/mpi/timer.hpp b/contrib/restricted/boost/boost/mpi/timer.hpp deleted file mode 100644 index fb17618395..0000000000 --- a/contrib/restricted/boost/boost/mpi/timer.hpp +++ /dev/null @@ -1,91 +0,0 @@ -// Copyright (C) 2006 Douglas Gregor <doug.gregor -at- gmail.com> - -// 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) - -/** @file timer.hpp - * - * This header provides the @c timer class, which provides access to - * the MPI timers. - */ -#ifndef BOOST_MPI_TIMER_HPP -#define BOOST_MPI_TIMER_HPP - -#include <boost/mpi/config.hpp> -#include <boost/limits.hpp> - -namespace boost { namespace mpi { - -/** @brief A simple timer that provides access to the MPI timing - * facilities. - * - * The @c timer class is a simple wrapper around the MPI timing - * facilities that mimics the interface of the Boost Timer library. - */ -class BOOST_MPI_DECL timer { -public: - /** Initializes the timer - * - * @post @c elapsed() == 0 - */ - timer(); - - /** Restart the timer. - * - * @post @c elapsed() == 0 - */ - void restart(); - - /** Return the amount of time that has elapsed since the last - * construction or reset, in seconds. - */ - double elapsed() const; - - /** Return an estimate of the maximum possible value of - * elapsed(). Note that this routine may return too high a value on - * some systems. - */ - double elapsed_max() const; - - /** Returns the minimum non-zero value that @c elapsed() may - * return. This is the resolution of the timer. - */ - double elapsed_min() const; - - /** Determines whether the elapsed time values are global times or - local processor times. */ - static bool time_is_global(); - -private: - double start_time; -}; // timer - -inline timer::timer() -{ - restart(); -} - -inline void timer::restart() -{ - start_time = MPI_Wtime(); -} - -inline double timer::elapsed() const -{ - return MPI_Wtime() - start_time; -} - -inline double timer::elapsed_max() const -{ - return (std::numeric_limits<double>::max)(); -} - -inline double timer::elapsed_min() const -{ - return MPI_Wtick(); -} - -} } // end namespace boost::mpi - -#endif // BOOST_MPI_TIMER_HPP diff --git a/contrib/restricted/boost/boost/numeric/odeint.hpp b/contrib/restricted/boost/boost/numeric/odeint.hpp deleted file mode 100644 index e0100899ca..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint.hpp - - [begin_description] - Forward include for odeint. Includes nearly everything. - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2010-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_HPP_INCLUDED - -#include <boost/numeric/odeint/version.hpp> -#include <boost/numeric/odeint/config.hpp> - -// start with ublas wrapper because we need its specializations before including state_wrapper.hpp -#include <boost/numeric/odeint/util/ublas_wrapper.hpp> - -#include <boost/numeric/odeint/stepper/euler.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta4.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp> - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> - -#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp> - -#include <boost/numeric/odeint/stepper/bulirsch_stoer.hpp> - -#ifndef __CUDACC__ -/* Bulirsch Stoer with Dense Output does not compile with nvcc - * because of the binomial library used there which relies on unsupported SSE functions - */ -#include <boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp> -#endif - -#include <boost/numeric/odeint/stepper/symplectic_euler.hpp> -#include <boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp> -#include <boost/numeric/odeint/stepper/velocity_verlet.hpp> - -#include <boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp> - -#include <boost/numeric/odeint/stepper/implicit_euler.hpp> -#include <boost/numeric/odeint/stepper/rosenbrock4.hpp> -#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp> -#include <boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp> - -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/multi_array_algebra.hpp> -#include <boost/numeric/odeint/util/multi_array_adaption.hpp> -/* - * Including this algebra slows down the compilation time - */ -// #include <boost/numeric/odeint/algebra/fusion_algebra.hpp> - -#include <boost/numeric/odeint/integrate/integrate.hpp> -#include <boost/numeric/odeint/integrate/integrate_adaptive.hpp> -#include <boost/numeric/odeint/integrate/integrate_const.hpp> -#include <boost/numeric/odeint/integrate/integrate_n_steps.hpp> -#include <boost/numeric/odeint/integrate/integrate_times.hpp> - -#include <boost/numeric/odeint/integrate/observer_collection.hpp> -#include <boost/numeric/odeint/integrate/max_step_checker.hpp> - -#include <boost/numeric/odeint/stepper/generation.hpp> - -#include <boost/numeric/odeint/iterator/adaptive_iterator.hpp> -#include <boost/numeric/odeint/iterator/adaptive_time_iterator.hpp> -#include <boost/numeric/odeint/iterator/const_step_iterator.hpp> -#include <boost/numeric/odeint/iterator/const_step_time_iterator.hpp> - - -#endif // BOOST_NUMERIC_ODEINT_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/algebra_dispatcher.hpp deleted file mode 100644 index 88cf159e03..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/algebra_dispatcher.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/algebra_dispatcher.hpp - - [begin_description] - Algebra dispatcher to automatically chose suitable algebra. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_ALGEBRA_DISPATCHER_HPP_INCLUDED - -#include <boost/numeric/odeint/config.hpp> - -#include <complex> -#include <boost/type_traits/is_floating_point.hpp> - -#include <boost/numeric/ublas/vector.hpp> -#include <boost/numeric/ublas/matrix.hpp> - -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/array_algebra.hpp> -#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> - -#include <boost/array.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -template< class StateType , class Enabler = void > -struct algebra_dispatcher_sfinae -{ - // range_algebra is the standard algebra - typedef range_algebra algebra_type; -}; - -template< class StateType > -struct algebra_dispatcher : algebra_dispatcher_sfinae< StateType > { }; - -// specialize for array -template< class T , size_t N > -struct algebra_dispatcher< boost::array< T , N > > -{ - typedef array_algebra algebra_type; -}; - -//specialize for some integral types -template< typename T > -struct algebra_dispatcher_sfinae< T , typename boost::enable_if< typename boost::is_floating_point< T >::type >::type > -{ - typedef vector_space_algebra algebra_type; -}; - -template< typename T > -struct algebra_dispatcher< std::complex<T> > -{ - typedef vector_space_algebra algebra_type; -}; - -///* think about that again.... -// specialize for ublas vector and matrix types -template< class T , class A > -struct algebra_dispatcher< boost::numeric::ublas::vector< T , A > > -{ - typedef vector_space_algebra algebra_type; -}; - -template< class T , class L , class A > -struct algebra_dispatcher< boost::numeric::ublas::matrix< T , L , A > > -{ - typedef vector_space_algebra algebra_type; -}; -//*/ - -} -} -} - -#ifdef BOOST_NUMERIC_ODEINT_CXX11 - -// c++11 mode: specialization for std::array if available - -#include <array> - -namespace boost { -namespace numeric { -namespace odeint { - -// specialize for std::array -template< class T , size_t N > -struct algebra_dispatcher< std::array< T , N > > -{ - typedef array_algebra algebra_type; -}; - -} } } - -#endif - - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/array_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/array_algebra.hpp deleted file mode 100644 index 471e866fe5..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/array_algebra.hpp +++ /dev/null @@ -1,293 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/array_algebra.hpp - - [begin_description] - Algebra for Arrays. Highly specialized for odeint. Const arguments are - introduce to work with odeint. - The Array algebra can be used for Array structures with two template - parameters: - Array<T, N> - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_ARRAY_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_ARRAY_ALGEBRA_HPP_INCLUDED - -#include <algorithm> -#include <boost/array.hpp> - -#include <boost/numeric/odeint/algebra/norm_result_type.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -struct array_algebra -{ - //template< typename T , size_t dim , class Op > - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each1( Array< T, dim > &s1, Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each2( Array< T, dim > &s1, const Array< T, dim > &s2, - Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each3( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] ); - } - - /* different const signature - required for the scale_sum_swap2 operation */ - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each3( Array< T , dim > &s1 , - Array< T , dim > &s2 , - const Array< T , dim > &s3 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each4( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each5( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each6( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each7( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each8( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , - const Array< T , dim > &s8 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each9( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , - const Array< T , dim > &s8 , - const Array< T , dim > &s9 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each10( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , - const Array< T , dim > &s8 , - const Array< T , dim > &s9 , - const Array< T , dim > &s10 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each11( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , - const Array< T , dim > &s8 , - const Array< T , dim > &s9 , - const Array< T , dim > &s10 , - const Array< T , dim > &s11 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each12( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , - const Array< T , dim > &s8 , - const Array< T , dim > &s9 , - const Array< T , dim > &s10 , - const Array< T , dim > &s11 , - const Array< T , dim > &s12 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] , s12[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each13( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , - const Array< T , dim > &s8 , - const Array< T , dim > &s9 , - const Array< T , dim > &s10 , - const Array< T , dim > &s11 , - const Array< T , dim > &s12 , - const Array< T , dim > &s13 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] , s12[i] , s13[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each14( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , - const Array< T , dim > &s8 , - const Array< T , dim > &s9 , - const Array< T , dim > &s10 , - const Array< T , dim > &s11 , - const Array< T , dim > &s12 , - const Array< T , dim > &s13 , - const Array< T , dim > &s14 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] , s12[i] , s13[i] , s14[i] ); - } - - template < template < typename, size_t > class Array, typename T, - size_t dim, class Op > - static void for_each15( Array< T , dim > &s1 , - const Array< T , dim > &s2 , - const Array< T , dim > &s3 , - const Array< T , dim > &s4 , - const Array< T , dim > &s5 , - const Array< T , dim > &s6 , - const Array< T , dim > &s7 , - const Array< T , dim > &s8 , - const Array< T , dim > &s9 , - const Array< T , dim > &s10 , - const Array< T , dim > &s11 , - const Array< T , dim > &s12 , - const Array< T , dim > &s13 , - const Array< T , dim > &s14 , - const Array< T , dim > &s15 , Op op ) - { - for( size_t i=0 ; i<dim ; ++i ) - op( s1[i] , s2[i] , s3[i] , s4[i] , s5[i] , s6[i] , s7[i] , s8[i] , s9[i] , s10[i] , s11[i] , s12[i] , s13[i] , s14[i] , s15[i] ); - } - - - template < template < typename, size_t > class Array, typename T, - size_t dim> - static typename norm_result_type< Array< T , dim > >::type norm_inf( const Array< T , dim > &s ) - { - BOOST_USING_STD_MAX(); - using std::abs; - typedef typename norm_result_type< Array< T , dim > >::type result_type; - result_type init = static_cast< result_type >( 0 ); - for( size_t i=0 ; i<dim ; ++i ) - init = max BOOST_PREVENT_MACRO_SUBSTITUTION ( init , static_cast< result_type >(abs(s[i])) ); - return init; - } - -}; - -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_ARRAY_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/default_operations.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/default_operations.hpp deleted file mode 100644 index 56139083cc..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/default_operations.hpp +++ /dev/null @@ -1,599 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/default_operations.hpp - - [begin_description] - Default operations. They work with the default numerical types, like float, double, complex< double> ... - [end_description] - - Copyright 2010-2012 Karsten Ahnert - Copyright 2010-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DEFAULT_OPERATIONS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_DEFAULT_OPERATIONS_HPP_INCLUDED - -#include <algorithm> - -#include <boost/config.hpp> -#include <boost/array.hpp> - -#include <boost/numeric/odeint/util/unit_helper.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - - -/* - * Notes: - * - * * the results structs are needed in order to work with fusion_algebra - */ -struct default_operations -{ - - template< class Fac1 = double > - struct scale - { - const Fac1 m_alpha1; - - scale( Fac1 alpha1 ) : m_alpha1( alpha1 ) { } - - template< class T1 > - void operator()( T1 &t1 ) const - { - t1 *= m_alpha1; - } - - typedef void result_type; - }; - - template< class Fac1 = double > - struct scale_sum1 - { - const Fac1 m_alpha1; - - scale_sum1( Fac1 alpha1 ) : m_alpha1( alpha1 ) { } - - template< class T1 , class T2 > - void operator()( T1 &t1 , const T2 &t2 ) const - { - t1 = m_alpha1 * t2; - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 > - struct scale_sum2 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - - scale_sum2( Fac1 alpha1 , Fac2 alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { } - - template< class T1 , class T2 , class T3 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3; - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 > - struct scale_sum3 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - - scale_sum3( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) { } - - template< class T1 , class T2 , class T3 , class T4 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4; - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 > - struct scale_sum4 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - - scale_sum4( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5; - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 > - struct scale_sum5 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - - scale_sum5( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6; - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 > - struct scale_sum6 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - - scale_sum6( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 , Fac6 alpha6 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ){ } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 ,const T7 &t7) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7; - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 > - struct scale_sum7 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - - scale_sum7( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , - Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8; - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 > - struct scale_sum8 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - const Fac8 m_alpha8; - - scale_sum8( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , - Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9; - } - - typedef void result_type; - }; - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 > - struct scale_sum9 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - const Fac8 m_alpha8; - const Fac9 m_alpha9; - - scale_sum9( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , - Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10; - } - - typedef void result_type; - }; - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 > - struct scale_sum10 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - const Fac8 m_alpha8; - const Fac9 m_alpha9; - const Fac10 m_alpha10; - - scale_sum10( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , - Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 , Fac10 alpha10 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11; - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 , class Fac11 = Fac10 > - struct scale_sum11 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - const Fac8 m_alpha8; - const Fac9 m_alpha9; - const Fac10 m_alpha10; - const Fac11 m_alpha11; - - scale_sum11( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , - Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 , - Fac10 alpha10 , Fac11 alpha11 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 , const T12 &t12 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12; - } - - typedef void result_type; - }; - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 , class Fac11 = Fac10 , class Fac12 = Fac11 > - struct scale_sum12 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - const Fac8 m_alpha8; - const Fac9 m_alpha9; - const Fac10 m_alpha10; - const Fac11 m_alpha11; - const Fac12 m_alpha12; - - scale_sum12( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , - Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 , - Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 , const T12 &t12 , const T13 &t13 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13; - } - - typedef void result_type; - }; - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 , class Fac11 = Fac10 , class Fac12 = Fac11 , class Fac13 = Fac12 > - struct scale_sum13 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - const Fac8 m_alpha8; - const Fac9 m_alpha9; - const Fac10 m_alpha10; - const Fac11 m_alpha11; - const Fac12 m_alpha12; - const Fac13 m_alpha13; - - scale_sum13( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , - Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 , - Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 , Fac13 alpha13 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) , m_alpha13( alpha13 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 , const T12 &t12 , const T13 &t13 , const T14 &t14 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13 + m_alpha13 * t14; - } - - typedef void result_type; - }; - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 , class Fac8 = Fac7 , class Fac9 = Fac8 , class Fac10 = Fac9 , class Fac11 = Fac10 , class Fac12 = Fac11 , class Fac13 = Fac12 , class Fac14 = Fac13 > - struct scale_sum14 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - const Fac8 m_alpha8; - const Fac9 m_alpha9; - const Fac10 m_alpha10; - const Fac11 m_alpha11; - const Fac12 m_alpha12; - const Fac13 m_alpha13; - const Fac14 m_alpha14; - - scale_sum14( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , - Fac5 alpha5 , Fac6 alpha6 , Fac7 alpha7 , Fac8 alpha8 , Fac9 alpha9 , - Fac10 alpha10 , Fac11 alpha11 , Fac12 alpha12 , Fac13 alpha13 , Fac14 alpha14 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) , m_alpha8( alpha8 ) , m_alpha9( alpha9 ) , m_alpha10( alpha10 ) , m_alpha11( alpha11 ) , m_alpha12( alpha12 ) , m_alpha13( alpha13 ) , m_alpha14( alpha14 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 , class T7 , class T8 , class T9 , class T10 , class T11 , class T12 , class T13 , class T14 , class T15 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 , const T7 &t7 , const T8 &t8 , const T9 &t9 , const T10 &t10 , const T11 &t11 , const T12 &t12 , const T13 &t13 , const T14 &t14 , const T15 &t15 ) const - { - t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6 + m_alpha6 * t7 + m_alpha7 * t8 + m_alpha8 * t9 + m_alpha9 * t10 + m_alpha10 * t11 + m_alpha11 * t12 + m_alpha12 * t13 + m_alpha13 * t14 + m_alpha14 * t15; - } - - typedef void result_type; - }; - - template< class Fac1 = double , class Fac2 = Fac1 > - struct scale_sum_swap2 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - - scale_sum_swap2( Fac1 alpha1 , Fac2 alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { } - - template< class T1 , class T2 , class T3 > - void operator()( T1 &t1 , T2 &t2 , const T3 &t3) const - { - const T1 tmp( t1 ); - t1 = m_alpha1 * t2 + m_alpha2 * t3; - t2 = tmp; - } - - typedef void result_type; - }; - - /* - * for usage in for_each2 - * - * Works with boost::units by eliminating the unit - */ - template< class Fac1 = double > - struct rel_error - { - const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt; - - rel_error( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt ) - : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) { } - - - template< class T1 , class T2 , class T3 > - void operator()( T3 &t3 , const T1 &t1 , const T2 &t2 ) const - { - using std::abs; - set_unit_value( t3 , abs( get_unit_value( t3 ) ) / ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value( t1 ) ) + m_a_dxdt * abs( get_unit_value( t2 ) ) ) ) ); - } - - typedef void result_type; - }; - - - /* - * for usage in for_each3 - * - * used in the controller for the rosenbrock4 method - * - * Works with boost::units by eliminating the unit - */ - template< class Fac1 = double > - struct default_rel_error - { - const Fac1 m_eps_abs , m_eps_rel ; - - default_rel_error( Fac1 eps_abs , Fac1 eps_rel ) - : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) { } - - - /* - * xerr = xerr / ( eps_abs + eps_rel * max( x , x_old ) ) - */ - template< class T1 , class T2 , class T3 > - void operator()( T3 &t3 , const T1 &t1 , const T2 &t2 ) const - { - BOOST_USING_STD_MAX(); - using std::abs; - Fac1 x1 = abs( get_unit_value( t1 ) ) , x2 = abs( get_unit_value( t2 ) ); - set_unit_value( t3 , abs( get_unit_value( t3 ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( x1 , x2 ) ) ); - } - - typedef void result_type; - }; - - - - /* - * for usage in reduce - */ - - template< class Value > - struct maximum - { - template< class Fac1 , class Fac2 > - Value operator()( Fac1 t1 , const Fac2 t2 ) const - { - using std::abs; - Value a1 = abs( get_unit_value( t1 ) ) , a2 = abs( get_unit_value( t2 ) ); - return ( a1 < a2 ) ? a2 : a1 ; - } - - typedef Value result_type; - }; - - - template< class Fac1 = double > - struct rel_error_max - { - const Fac1 m_eps_abs , m_eps_rel; - - rel_error_max( Fac1 eps_abs , Fac1 eps_rel ) - : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) - { } - - template< class Res , class T1 , class T2 , class T3 > - Res operator()( Res r , const T1 &x_old , const T2 &x , const T3 &x_err ) - { - BOOST_USING_STD_MAX(); - using std::abs; - Res tmp = abs( get_unit_value( x_err ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( abs( x_old ) , abs( x ) ) ); - return max BOOST_PREVENT_MACRO_SUBSTITUTION ( r , tmp ); - } - }; - - - template< class Fac1 = double > - struct rel_error_max2 - { - const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt; - - rel_error_max2( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt ) - : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) - { } - - template< class Res , class T1 , class T2 , class T3 , class T4 > - Res operator()( Res r , const T1 &x_old , const T2 &/*x*/ , const T3 &dxdt_old , const T4 &x_err ) - { - BOOST_USING_STD_MAX(); - using std::abs; - Res tmp = abs( get_unit_value( x_err ) ) / - ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value( x_old ) ) + m_a_dxdt * abs( get_unit_value( dxdt_old ) ) ) ); - return max BOOST_PREVENT_MACRO_SUBSTITUTION ( r , tmp ); - } - }; - - - - - template< class Fac1 = double > - struct rel_error_l2 - { - const Fac1 m_eps_abs , m_eps_rel; - - rel_error_l2( Fac1 eps_abs , Fac1 eps_rel ) - : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) - { } - - template< class Res , class T1 , class T2 , class T3 > - Res operator()( Res r , const T1 &x_old , const T2 &x , const T3 &x_err ) - { - BOOST_USING_STD_MAX(); - using std::abs; - Res tmp = abs( get_unit_value( x_err ) ) / ( m_eps_abs + m_eps_rel * max BOOST_PREVENT_MACRO_SUBSTITUTION ( abs( x_old ) , abs( x ) ) ); - return r + tmp * tmp; - } - }; - - - - - template< class Fac1 = double > - struct rel_error_l2_2 - { - const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt; - - rel_error_l2_2( Fac1 eps_abs , Fac1 eps_rel , Fac1 a_x , Fac1 a_dxdt ) - : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) - { } - - template< class Res , class T1 , class T2 , class T3 , class T4 > - Res operator()( Res r , const T1 &x_old , const T2 &/*x*/ , const T3 &dxdt_old , const T4 &x_err ) - { - using std::abs; - Res tmp = abs( get_unit_value( x_err ) ) / - ( m_eps_abs + m_eps_rel * ( m_a_x * abs( get_unit_value( x_old ) ) + m_a_dxdt * abs( get_unit_value( dxdt_old ) ) ) ); - return r + tmp * tmp; - } - }; - - - - - - -}; - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DEFAULT_OPERATIONS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/extract_value_type.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/extract_value_type.hpp deleted file mode 100644 index c5246bb6f4..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/extract_value_type.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/detail/extract_value_type.hpp - - [begin_description] - Extract true value type from complex types (eg. std::complex) - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_EXTRACT_VALUE_TYPE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_EXTRACT_VALUE_TYPE_HPP_INCLUDED - -#include <boost/utility.hpp> -#include <boost/mpl/has_xxx.hpp> - -BOOST_MPL_HAS_XXX_TRAIT_DEF(value_type) - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< typename S , typename Enabler = void > -struct extract_value_type {}; - -// as long as value_types are defined we go down the value_type chain -// e.g. returning S::value_type::value_type::value_type - -template< typename S > -struct extract_value_type<S , typename boost::disable_if< has_value_type<S> >::type > -{ - // no value_type defined, return S - typedef S type; -}; - -template< typename S > -struct extract_value_type< S , typename boost::enable_if< has_value_type<S> >::type > -{ - // go down the value_type - typedef typename extract_value_type< typename S::value_type >::type type; -}; - -} } } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/for_each.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/for_each.hpp deleted file mode 100644 index 5387a47db6..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/for_each.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/detail/for_each.hpp - - [begin_description] - Default for_each implementations. - [end_description] - - Copyright 2010-2012 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_FOR_EACH_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_FOR_EACH_HPP_INCLUDED - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - - - template< class Iterator1 , class Operation > - inline void for_each1( Iterator1 first1 , Iterator1 last1 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ ); - } - - - template< class Iterator1 , class Iterator2 , class Operation > - inline void for_each2( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ ); - } - - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Operation > - inline void for_each3( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ ); - } - - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Operation > - inline void for_each4( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, Iterator4 first4, Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ ); - } - - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Operation > - inline void for_each5( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ ); - } - - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Operation > - inline void for_each6( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ ); - } - - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Operation > - inline void for_each7( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ ); - } - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Operation > - inline void for_each8( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ ); - } - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Operation > - inline void for_each9( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , - Iterator9 first9 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ ); - } - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Operation > - inline void for_each10( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , - Iterator9 first9 , Iterator10 first10 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ ); - } - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Operation > - inline void for_each11( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , - Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ ); - } - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Iterator12 , class Operation > - inline void for_each12( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , - Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Iterator12 first12 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ ); - } - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Iterator12 , class Iterator13 , class Operation > - inline void for_each13( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , - Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Iterator12 first12 , Iterator13 first13 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ , *first13++ ); - } - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Iterator12 , class Iterator13 , class Iterator14 , class Operation > - inline void for_each14( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , - Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Iterator12 first12 , Iterator13 first13 , - Iterator14 first14 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ , *first13++ , *first14++ ); - } - - template< class Iterator1 , class Iterator2 , class Iterator3 , class Iterator4 , class Iterator5 , class Iterator6 , class Iterator7 , class Iterator8 , class Iterator9 , class Iterator10 , class Iterator11 , class Iterator12 , class Iterator13 , class Iterator14 , class Iterator15 , class Operation > - inline void for_each15( Iterator1 first1 , Iterator1 last1 , Iterator2 first2 , Iterator3 first3, - Iterator4 first4, Iterator5 first5, Iterator6 first6 , Iterator7 first7 , Iterator8 first8 , - Iterator9 first9 , Iterator10 first10 , Iterator11 first11 , Iterator12 first12 , Iterator13 first13 , - Iterator14 first14 , Iterator15 first15 , Operation op ) - { - for( ; first1 != last1 ; ) - op( *first1++ , *first2++ , *first3++ , *first4++ , *first5++ , *first6++ , *first7++ , *first8++ , *first9++ , *first10++ , *first11++ , *first12++ , *first13++ , *first14++ , *first15++ ); - } - - -} // detail -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_FOR_EACH_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/macros.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/macros.hpp deleted file mode 100644 index 9e18a8a2f0..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/macros.hpp +++ /dev/null @@ -1,43 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/detail/macros.hpp - - [begin_description] - Some macros for type checking. - [end_description] - - Copyright 2010-2012 Karsten Ahnert - Copyright 2010 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED - - -//type traits aren't working with nvcc -#ifndef __CUDACC__ -#include <boost/type_traits.hpp> -#include <boost/static_assert.hpp> - -#define BOOST_ODEINT_CHECK_CONTAINER_TYPE( Type1 , Type2 ) \ - BOOST_STATIC_ASSERT(( boost::is_same< typename boost::remove_const< Type1 >::type , Type2 >::value )) - -#else -//empty macro for nvcc -#define BOOST_ODEINT_CHECK_CONTAINER_TYPE( Type1 , Type2 ) - -#endif // __CUDACC__ - - - -/* -#define BOOST_ODEINT_CHECK_OPERATION_ARITY( Operation , Arity ) \ - BOOST_STATIC_ASSERT(( boost::function_traits< Operation >::arity == Arity )) - */ - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_MACROS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/norm_inf.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/norm_inf.hpp deleted file mode 100644 index 3d32c99bee..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/detail/norm_inf.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/detail/norm_inf.hpp - - [begin_description] - Default reduce implementation. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED - -#include <cmath> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< typename Value , class Iterator1 > -inline Value norm_inf( Iterator1 first1 , Iterator1 last1 , Value init ) -{ - using std::max; - using std::abs; - for( ; first1 != last1 ; ) - init = max( init , abs( *first1++ ) ); - return init; -} - - -} // detail -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_DETAIL_NORM_INF_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/fusion_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/fusion_algebra.hpp deleted file mode 100644 index 0055e5d4de..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/fusion_algebra.hpp +++ /dev/null @@ -1,216 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/fusion_algebra.hpp - - [begin_description] - Algebra for boost::fusion sequences. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_HPP_INCLUDED - -#include <algorithm> - -#include <boost/numeric/odeint/config.hpp> - -#include <boost/fusion/container/vector.hpp> -#include <boost/fusion/algorithm/iteration/for_each.hpp> -#include <boost/fusion/view/zip_view.hpp> -#include <boost/fusion/functional/generation/make_fused.hpp> -#include <boost/fusion/algorithm/iteration/accumulate.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -namespace detail { - - template< class Value > - struct fusion_maximum - { - template< class Fac1 , class Fac2 > - Value operator()( Fac1 t1 , const Fac2 t2 ) const - { - using std::abs; - Value a1 = abs( get_unit_value( t1 ) ) , a2 = abs( get_unit_value( t2 ) ); - return ( a1 < a2 ) ? a2 : a1 ; - } - - typedef Value result_type; - }; -} - -/* specialize this if the fundamental numeric type in your fusion sequence is - * anything else but double (most likely not) - */ -template< typename Sequence > -struct fusion_traits { - typedef double value_type; -}; - -struct fusion_algebra -{ - template< class S1 , class Op > - static void for_each1( S1 &s1 , Op op ) - { - boost::fusion::for_each( s1 , op ); - }; - - - template< class S1 , class S2 , class Op > - static void for_each2( S1 &s1 , S2 &s2 , Op op ) - { - typedef boost::fusion::vector< S1& , S2& > Sequences; - Sequences sequences( s1 , s2 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - - template< class S1 , class S2 , class S3 , class Op > - static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op ) - { - typedef boost::fusion::vector< S1& , S2& , S3& > Sequences; - Sequences sequences( s1 , s2 , s3 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S1 , class S2 , class S3 , class S4 , class Op > - static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) - { - typedef boost::fusion::vector< S1& , S2& , S3& , S4& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op > - static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) - { - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op > - static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) - { - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class Op > - static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) - { - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class Op > - static void for_each8( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) - { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 8 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class Op > - static void for_each9( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op ) - { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 9 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class Op > - static void for_each10( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op ) - { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 10 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class Op > - static void for_each11( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op ) - { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 11 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 11 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op > - static void for_each12( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op ) - { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 12 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 12 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& , S12& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op > - static void for_each13( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op ) - { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 13 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 13 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& , S12& , S13& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op > - static void for_each14( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op ) - { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 14 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 14 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& , S12& , S13& , S14& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 , s14 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class S15 , class Op > - static void for_each15( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , S15 &s15 , Op op ) - { - BOOST_STATIC_ASSERT_MSG( BOOST_FUSION_INVOKE_MAX_ARITY >= 15 , "Macro Parameter BOOST_FUSION_INVOKE_MAX_ARITY to small!" ); - BOOST_STATIC_ASSERT_MSG( BOOST_RESULT_OF_NUM_ARGS >= 15 , "Macro Parameter BOOST_RESULT_OF_NUM_ARGS to small!" ); - typedef boost::fusion::vector< S1& , S2& , S3& , S4& , S5& , S6& , S7& , S8& , S9& , S10& , S11& , S12& , S13& , S14& , S15& > Sequences; - Sequences sequences( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 , s14 , s15 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( op ) ); - } - - template< class S > - static typename fusion_traits< S >::value_type norm_inf( const S &s ) - { - typedef typename fusion_traits< S >::value_type value_type; - return boost::fusion::accumulate( s , static_cast<value_type>(0) , - detail::fusion_maximum<value_type>() ); - } - -}; - - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/fusion_algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/fusion_algebra_dispatcher.hpp deleted file mode 100644 index 4bfc5c26ba..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/fusion_algebra_dispatcher.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/fusion_algebra_dispatcher.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_DISPATCHER_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_DISPATCHER_HPP_DEFINED - -#include <boost/numeric/odeint/algebra/fusion_algebra.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> - -#include <boost/utility/enable_if.hpp> -#include <boost/fusion/include/is_sequence.hpp> - - - -namespace boost { -namespace numeric { -namespace odeint { - -// specialization for fusion sequences -template< class FusionSequence > -struct algebra_dispatcher_sfinae< FusionSequence , - typename boost::enable_if< - typename boost::fusion::traits::is_sequence< FusionSequence >::type >::type > -{ - typedef fusion_algebra algebra_type; -}; - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_FUSION_ALGEBRA_DISPATCHER_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/multi_array_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/multi_array_algebra.hpp deleted file mode 100644 index 0bc476e631..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/multi_array_algebra.hpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/multi_array_algebra.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED - - -#include <boost/numeric/odeint/algebra/detail/for_each.hpp> -#include <boost/numeric/odeint/algebra/detail/norm_inf.hpp> -#include <boost/numeric/odeint/algebra/norm_result_type.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -// not ready -struct multi_array_algebra -{ - template< class S1 , class Op > - static void for_each1( S1 &s1 , Op op ) - { - detail::for_each1( s1.data() , s1.data() + s1.num_elements() , op ); - } - - template< class S1 , class S2 , class Op > - static void for_each2( S1 &s1 , S2 &s2 , Op op ) - { - detail::for_each2( s1.data() , s1.data() + s1.num_elements() , s2.data() , op ); - } - - template< class S1 , class S2 , class S3 , class Op > - static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op ) - { - detail::for_each3( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class Op > - static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) - { - detail::for_each4( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op > - static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) - { - detail::for_each5( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op > - static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) - { - detail::for_each6( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op > - static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) - { - detail::for_each7( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class Op > - static void for_each8( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) - { - detail::for_each8( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class Op > - static void for_each9( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op ) - { - detail::for_each9( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class Op > - static void for_each10( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op ) - { - detail::for_each10( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class Op > - static void for_each11( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op ) - { - detail::for_each11( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op > - static void for_each12( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op ) - { - detail::for_each12( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , s12.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op > - static void for_each13( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op ) - { - detail::for_each13( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , s12.data() , s13.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op > - static void for_each14( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op ) - { - detail::for_each14( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , s12.data() , s13.data() , s14.data() , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class S15 , class Op > - static void for_each15( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , S15 &s15 , Op op ) - { - detail::for_each15( s1.data() , s1.data() + s1.num_elements() , s2.data() , s3.data() , s4.data() , s5.data() , s6.data() , s7.data() , s8.data() , s9.data() , s10.data() , s11.data() , s12.data() , s13.data() , s14.data() , s15.data() , op ); - } - - template< typename S > - static typename norm_result_type<S>::type norm_inf( const S &s ) - { - return detail::norm_inf( s.data() , s.data() + s.num_elements() , static_cast< typename norm_result_type<S>::type >( 0 ) ); - } -}; - -// template< class T , size_t N > -// struct algebra_dispatcher< boost::array< T , N > > -// { -// typedef array_algebra algebra_type; -// }; - - - - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_MULTI_ARRAY_ALGEBRA_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/norm_result_type.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/norm_result_type.hpp deleted file mode 100644 index 0e99e8fcc2..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/norm_result_type.hpp +++ /dev/null @@ -1,33 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/norm_result_type.hpp - - [begin_description] - Calculates the type of the norm_inf operation for container types - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_NORM_RESULT_TYPE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_NORM_RESULT_TYPE_HPP_INCLUDED - -#include <boost/numeric/odeint/algebra/detail/extract_value_type.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< typename S , typename Enabler = void > -struct norm_result_type { - typedef typename detail::extract_value_type< S >::type type; -}; - -} } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/operations_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/operations_dispatcher.hpp deleted file mode 100644 index faeb5e884d..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/operations_dispatcher.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/operations_dispatcher.hpp - - [begin_description] - Operations dispatcher to automatically chose suitable operations. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_OPERATIONS_DISPATCHER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_OPERATIONS_DISPATCHER_HPP_INCLUDED - -#include <boost/numeric/odeint/algebra/default_operations.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< class StateType , class Enabler = void > -struct operations_dispatcher_sfinae -{ - typedef default_operations operations_type; -}; - -template< class StateType > -struct operations_dispatcher : operations_dispatcher_sfinae< StateType > {}; - -// no further specializations required - -} -} -} - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/range_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/range_algebra.hpp deleted file mode 100644 index 3d7695c812..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/range_algebra.hpp +++ /dev/null @@ -1,142 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/range_algebra.hpp - - [begin_description] - Default algebra, which works with the most state types, like vector< double >, boost::array< double >, boost::range. - Internally is uses boost::range to obtain the begin and end iterator of the according sequence. - [end_description] - - Copyright 2010-2013 Karsten Ahnert - Copyright 2010-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED - -#include <boost/range.hpp> -#include <boost/mpl/size_t.hpp> - -#include <boost/numeric/odeint/algebra/detail/macros.hpp> -#include <boost/numeric/odeint/algebra/detail/for_each.hpp> -#include <boost/numeric/odeint/algebra/detail/norm_inf.hpp> -#include <boost/numeric/odeint/algebra/norm_result_type.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -struct range_algebra -{ - template< class S1 , class Op > - static void for_each1( S1 &s1 , Op op ) - { - detail::for_each1( boost::begin( s1 ) , boost::end( s1 ) , - op ); - } - - template< class S1 , class S2 , class Op > - static void for_each2( S1 &s1 , S2 &s2 , Op op ) - { - detail::for_each2( boost::begin( s1 ) , boost::end( s1 ) , - boost::begin( s2 ) , op ); - } - - template< class S1 , class S2 , class S3 , class Op > - static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op ) - { - detail::for_each3( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class Op > - static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) - { - detail::for_each4( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op > - static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) - { - detail::for_each5( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op > - static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) - { - detail::for_each6( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op > - static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) - { - detail::for_each7( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class Op > - static void for_each8( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) - { - detail::for_each8( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class Op > - static void for_each9( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op ) - { - detail::for_each9( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class Op > - static void for_each10( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op ) - { - detail::for_each10( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class Op > - static void for_each11( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op ) - { - detail::for_each11( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op > - static void for_each12( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op ) - { - detail::for_each12( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op > - static void for_each13( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op ) - { - detail::for_each13( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op > - static void for_each14( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op ) - { - detail::for_each14( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , boost::begin( s14 ) , op ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class S15 , class Op > - static void for_each15( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , S15 &s15 , Op op ) - { - detail::for_each15( boost::begin( s1 ) , boost::end( s1 ) , boost::begin( s2 ) , boost::begin( s3 ) , boost::begin( s4 ) , boost::begin( s5 ) , boost::begin( s6 ) , boost::begin( s7 ) , boost::begin( s8 ) , boost::begin( s9 ) , boost::begin( s10 ) , boost::begin( s11 ) , boost::begin( s12 ) , boost::begin( s13 ) , boost::begin( s14 ) , boost::begin( s15 ) , op ); - } - - template< typename S > - static typename norm_result_type<S>::type norm_inf( const S &s ) - { - return detail::norm_inf( boost::begin( s ) , boost::end( s ) , - static_cast< typename norm_result_type<S>::type >( 0 ) ); - } - -}; - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_RANGE_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/algebra/vector_space_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/algebra/vector_space_algebra.hpp deleted file mode 100644 index 17ff007eef..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/algebra/vector_space_algebra.hpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/algebra/vector_space_algebra.hpp - - [begin_description] - An algebra for types which have vector space semantics, hence types on which the operators +,-,* are well defined. - [end_description] - - Copyright 2010-2012 Karsten Ahnert - Copyright 2010-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ALGEBRA_VECTOR_SPACE_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ALGEBRA_VECTOR_SPACE_ALGEBRA_HPP_INCLUDED - -#include <complex> - -#include <boost/type_traits/remove_reference.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -/* - * This class template has to be overload in order to call vector_space_algebra::norm_inf - */ -template< class State > struct vector_space_norm_inf; - -/* - * Example: instantiation for sole doubles and complex - */ -template<> -struct vector_space_norm_inf< double > -{ - typedef double result_type; - double operator()( double x ) const - { - using std::abs; - return abs(x); - } -}; - -template<> -struct vector_space_norm_inf< float > -{ - typedef float result_type; - result_type operator()( float x ) const - { - using std::abs; - return abs(x); - } -}; - -template< typename T > -struct vector_space_norm_inf< std::complex<T> > -{ - typedef T result_type; - result_type operator()( std::complex<T> x ) const - { - using std::abs; - return abs( x ); - } -}; - -struct vector_space_algebra -{ - template< class S1 , class Op > - static void for_each1( S1 &s1 , Op op ) - { - // ToDo : build checks, that the +-*/ operators are well defined - op( s1 ); - } - - template< class S1 , class S2 , class Op > - static void for_each2( S1 &s1 , S2 &s2 , Op op ) - { - op( s1 , s2 ); - } - - template< class S1 , class S2 , class S3 , class Op > - static void for_each3( S1 &s1 , S2 &s2 , S3 &s3 , Op op ) - { - op( s1 , s2 , s3 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class Op > - static void for_each4( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) - { - op( s1 , s2 , s3 , s4 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class Op > - static void for_each5( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op > - static void for_each6( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class Op > - static void for_each7( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class Op > - static void for_each8( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class Op > - static void for_each9( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class Op > - static void for_each10( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class Op > - static void for_each11( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op > - static void for_each12( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op > - static void for_each13( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op > - static void for_each14( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 , s14 ); - } - - template< class S1 , class S2 , class S3 , class S4 , class S5 , class S6 ,class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class S15 , class Op > - static void for_each15( S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , S15 &s15 , Op op ) - { - op( s1 , s2 , s3 , s4 , s5 , s6 , s7 , s8 , s9 , s10 , s11 , s12 , s13 , s14 , s15 ); - } - - template< class S > - static typename boost::numeric::odeint::vector_space_norm_inf< S >::result_type norm_inf( const S &s ) - { - boost::numeric::odeint::vector_space_norm_inf< S > n; - return n( s ); - } -}; - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_ALGEBRA_VECTOR_SPACE_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/config.hpp b/contrib/restricted/boost/boost/numeric/odeint/config.hpp deleted file mode 100644 index f191582558..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/config.hpp +++ /dev/null @@ -1,53 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/config.hpp - - [begin_description] - Sets configurations for odeint and used libraries. Should be included before any other odeint library - [end_description] - - Copyright 2011-2012 Mario Mulansky - Copyright 2011-2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED - - -//increase macro variable to allow rk78 scheme -#ifndef FUSION_MAX_VECTOR_SIZE -#define FUSION_MAX_VECTOR_SIZE 15 -#endif - - -/* - * the following definitions are only required if fusion vectors are used as state types - * in the rk78 scheme - * they should be defined by the user if required, see e.g. libs/numeric/examples/harmonic_oscillator_units.cpp - */ -#ifndef BOOST_FUSION_INVOKE_MAX_ARITY -#define BOOST_FUSION_INVOKE_MAX_ARITY 15 -#endif - -#ifndef BOOST_RESULT_OF_NUM_ARGS -#define BOOST_RESULT_OF_NUM_ARGS 15 -#endif - - - - - -#include <boost/config.hpp> - -#if __cplusplus >= 201103L -#define BOOST_NUMERIC_ODEINT_CXX11 1 -#endif - - - - -#endif // BOOST_NUMERIC_ODEINT_CONFIG_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/blaze/blaze_algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/blaze/blaze_algebra_dispatcher.hpp deleted file mode 100644 index 29bf78621d..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/blaze/blaze_algebra_dispatcher.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/blaze/blaze_algebra_dispatcher.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED - -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <blaze/math/dense/StaticVector.h> -#include <blaze/math/dense/DynamicVector.h> - - - - - - -namespace boost { -namespace numeric { -namespace odeint { - -template< typename T , size_t N , bool TF > -struct algebra_dispatcher< blaze::StaticVector< T , N , TF > > -{ - typedef vector_space_algebra algebra_type; -}; - -template< typename T , bool TF > -struct algebra_dispatcher< blaze::DynamicVector< T , TF > > -{ - typedef vector_space_algebra algebra_type; -}; - - - - - -} -} -} - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_ALGEBRA_DISPATCHER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/blaze/blaze_resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/blaze/blaze_resize.hpp deleted file mode 100644 index 3c5f2d46a0..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/blaze/blaze_resize.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/blaze/blaze_resize.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_RESIZE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_RESIZE_HPP_INCLUDED - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> - -#include <blaze/math/dense/DynamicVector.h> - -namespace boost { -namespace numeric { -namespace odeint { - -template< typename T , bool TF > -struct is_resizeable< blaze::DynamicVector< T , TF > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - -template< typename T1 , bool TF1, typename T2 , bool TF2 > -struct same_size_impl< blaze::DynamicVector< T1 , TF1 > , blaze::DynamicVector< T2 , TF2 > > -{ - static bool same_size( const blaze::DynamicVector< T1 , TF1 > &x1 , const blaze::DynamicVector< T2 , TF2 > &x2 ) - { - return x1.size() == x2.size(); - } -}; - -template< typename T1 , bool TF1, typename T2 , bool TF2 > -struct resize_impl< blaze::DynamicVector< T1 , TF1 > , blaze::DynamicVector< T2 , TF2 > > -{ - static void resize( blaze::DynamicVector< T1 , TF1 > &x1 , const blaze::DynamicVector< T2 , TF2 > &x2 ) - { - x1.resize( x2.size() ); - } -}; - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_BLAZE_BLAZE_RESIZE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute.hpp deleted file mode 100644 index fe04b581e7..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/compute/compute.hpp - - [begin_description] - includes all headers required for using odeint with Boost.Compute - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_HPP_DEFINED - -#include <boost/numeric/odeint/external/compute/compute_algebra.hpp> -#include <boost/numeric/odeint/external/compute/compute_operations.hpp> -#include <boost/numeric/odeint/external/compute/compute_algebra_dispatcher.hpp> -#include <boost/numeric/odeint/external/compute/compute_operations_dispatcher.hpp> -#include <boost/numeric/odeint/external/compute/compute_resize.hpp> - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_algebra.hpp deleted file mode 100644 index 9cd3912eea..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_algebra.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/compute/compute_algebra.hpp - - [begin_description] - An algebra for Boost.Compute vectors. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_ALGEBRA_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_ALGEBRA_HPP_DEFINED - -#include <boost/preprocessor/repetition.hpp> -#include <boost/compute.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -struct compute_algebra -{ - -#define BOOST_ODEINT_COMPUTE_STATE_PARAM(z, n, unused) \ - StateType ## n &s ## n, - -#define BOOST_ODEINT_COMPUTE_ALGEBRA(z, n, unused) \ - template< BOOST_PP_ENUM_PARAMS(n, class StateType), class Operation > \ - static void for_each ## n( \ - BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_STATE_PARAM, ~) \ - Operation op \ - ) \ - { \ - op( BOOST_PP_ENUM_PARAMS(n, s) ); \ - } - -BOOST_PP_REPEAT_FROM_TO(3, 9, BOOST_ODEINT_COMPUTE_ALGEBRA, ~) - -#undef BOOST_ODEINT_COMPUTE_ALGEBRA -#undef BOOST_ODEINT_COMPUTE_STATE_PARAM - - template < class S > - static typename S::value_type norm_inf( const S &s ) { - typedef typename S::value_type value_type; - - BOOST_COMPUTE_FUNCTION(value_type, max_abs, (value_type, value_type), - { - return max(_1, fabs(_2)); - }); - - return boost::compute::accumulate(s.begin(), s.end(), value_type(), max_abs); - } -}; -} // odeint -} // numeric -} // boost - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_algebra_dispatcher.hpp deleted file mode 100644 index 6df360b76d..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_algebra_dispatcher.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/compute/compute_algebra_dispatcher.hpp - - [begin_description] - algebra_dispatcher specialization for Boost.Compute - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_ALGEBRA_DISPATCHER_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_ALGEBRA_DISPATCHER_HPP_DEFINED - -#include <boost/compute/container/vector.hpp> - -#include <boost/numeric/odeint/external/compute/compute_algebra.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -// specialization for Boost.Compute vector -template< class T , class A > -struct algebra_dispatcher< boost::compute::vector< T , A > > -{ - typedef compute_algebra algebra_type; -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_ALGEBRA_DISPATCHER_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_operations.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_operations.hpp deleted file mode 100644 index 58d5f692ff..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_operations.hpp +++ /dev/null @@ -1,198 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/compute/compute_operations.hpp - - [begin_description] - Operations of Boost.Compute zipped iterators. Is the counterpart of the compute_algebra. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_HPP_DEFINED - -#include <boost/preprocessor/repetition.hpp> -#include <boost/compute.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -struct compute_operations { - -#define BOOST_ODEINT_COMPUTE_TEMPL_FAC(z, n, unused) \ - , class Fac ## n = BOOST_PP_CAT(Fac, BOOST_PP_DEC(n)) - -#define BOOST_ODEINT_COMPUTE_MEMB_FAC(z, n, unused) \ - const Fac ## n m_alpha ## n; - -#define BOOST_ODEINT_COMPUTE_PRM_FAC(z, n, unused) \ - BOOST_PP_COMMA_IF(n) const Fac ## n alpha ## n - -#define BOOST_ODEINT_COMPUTE_INIT_FAC(z, n, unused) \ - BOOST_PP_COMMA_IF(n) m_alpha ## n (alpha ## n) - -#define BOOST_ODEINT_COMPUTE_PRM_STATE(z, n, unused) \ - BOOST_PP_COMMA_IF(n) StateType ## n &s ## n - -#define BOOST_ODEINT_COMPUTE_BEGIN_STATE(z, n, unused) \ - BOOST_PP_COMMA_IF( BOOST_PP_DEC(n) ) s ## n.begin() - -#define BOOST_ODEINT_COMPUTE_END_STATE(z, n, unused) \ - BOOST_PP_COMMA_IF( BOOST_PP_DEC(n) ) s ## n.end() - -#define BOOST_ODEINT_COMPUTE_LAMBDA(z, n, unused) \ - BOOST_PP_EXPR_IF(n, +) m_alpha ## n * bc::lambda::get< n >(bc::_1) - -#define BOOST_ODEINT_COMPUTE_OPERATIONS(z, n, unused) \ - template< \ - class Fac0 = double \ - BOOST_PP_REPEAT_FROM_TO(1, n, BOOST_ODEINT_COMPUTE_TEMPL_FAC, ~) \ - > \ - struct scale_sum ## n { \ - BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_MEMB_FAC, ~) \ - scale_sum ## n( \ - BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_PRM_FAC, ~) \ - ) \ - : BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_INIT_FAC, ~) \ - { } \ - template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), class StateType) > \ - void operator()( \ - BOOST_PP_REPEAT( \ - BOOST_PP_INC(n), \ - BOOST_ODEINT_COMPUTE_PRM_STATE, ~) \ - ) const \ - { \ - namespace bc = boost::compute; \ - bc::transform( \ - bc::make_zip_iterator( \ - boost::make_tuple( \ - BOOST_PP_REPEAT_FROM_TO( \ - 1, BOOST_PP_INC(n), \ - BOOST_ODEINT_COMPUTE_BEGIN_STATE, ~) \ - ) \ - ), \ - bc::make_zip_iterator( \ - boost::make_tuple( \ - BOOST_PP_REPEAT_FROM_TO( \ - 1, BOOST_PP_INC(n), \ - BOOST_ODEINT_COMPUTE_END_STATE, ~) \ - ) \ - ), \ - s0.begin(), \ - BOOST_PP_REPEAT(n, BOOST_ODEINT_COMPUTE_LAMBDA, ~) \ - ); \ - } \ - }; - -BOOST_PP_REPEAT_FROM_TO(2, 8, BOOST_ODEINT_COMPUTE_OPERATIONS, ~) - -#undef BOOST_ODEINT_COMPUTE_TEMPL_FAC -#undef BOOST_ODEINT_COMPUTE_MEMB_FAC -#undef BOOST_ODEINT_COMPUTE_PRM_FAC -#undef BOOST_ODEINT_COMPUTE_INIT_FAC -#undef BOOST_ODEINT_COMPUTE_PRM_STATE -#undef BOOST_ODEINT_COMPUTE_BEGIN_STATE -#undef BOOST_ODEINT_COMPUTE_END_STATE -#undef BOOST_ODEINT_COMPUTE_LAMBDA -#undef BOOST_ODEINT_COMPUTE_OPERATIONS - - template<class Fac1 = double, class Fac2 = Fac1> - struct scale_sum_swap2 { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - - scale_sum_swap2(const Fac1 alpha1, const Fac2 alpha2) - : m_alpha1(alpha1), m_alpha2(alpha2) { } - - template<class State0, class State1, class State2> - void operator()(State0 &s0, State1 &s1, State2 &s2) const { - namespace bc = boost::compute; - - bc::command_queue &queue = bc::system::default_queue(); - const bc::context &context = queue.get_context(); - - const char source[] = BOOST_COMPUTE_STRINGIZE_SOURCE( - kernel void scale_sum_swap2( - F1 a1, F2 a2, - global T0 *x0, global T1 *x1, global T2 *x2, - ) - { - uint i = get_global_id(0); - T0 tmp = x0[i]; - x0[i] = a1 * x1[i] + a2 * x2[i]; - x1[i] = tmp; - } - ); - - std::stringstream options; - options - << " -DT0=" << bc::type_name<typename State0::value_type>() - << " -DT1=" << bc::type_name<typename State1::value_type>() - << " -DT2=" << bc::type_name<typename State2::value_type>() - << " -DF1=" << bc::type_name<Fac1>() - << " -DF2=" << bc::type_name<Fac2>(); - - bc::program program = - bc::program::build_with_source(source, context, options.str()); - - bc::kernel kernel(program, "scale_sum_swap2"); - kernel.set_arg(0, m_alpha1); - kernel.set_arg(1, m_alpha2); - kernel.set_arg(2, s0.get_buffer()); - kernel.set_arg(3, s1.get_buffer()); - kernel.set_arg(4, s2.get_buffer()); - - queue.enqueue_1d_range_kernel(kernel, 0, s0.size()); - - } - }; - - template<class Fac1 = double> - struct rel_error { - const Fac1 m_eps_abs, m_eps_rel, m_a_x, m_a_dxdt; - - rel_error(const Fac1 eps_abs, const Fac1 eps_rel, const Fac1 a_x, const Fac1 a_dxdt) - : m_eps_abs(eps_abs), m_eps_rel(eps_rel), m_a_x(a_x), m_a_dxdt(a_dxdt) { } - - - template <class State0, class State1, class State2> - void operator()(State0 &s0, State1 &s1, State2 &s2) const { - namespace bc = boost::compute; - using bc::_1; - using bc::lambda::get; - - bc::for_each( - bc::make_zip_iterator( - boost::make_tuple( - s0.begin(), - s1.begin(), - s2.begin() - ) - ), - bc::make_zip_iterator( - boost::make_tuple( - s0.end(), - s1.end(), - s2.end() - ) - ), - get<0>(_1) = abs( get<0>(_1) ) / - (m_eps_abs + m_eps_rel * (m_a_x * abs(get<1>(_1) + m_a_dxdt * abs(get<2>(_1))))) - ); - } - }; -}; - -} // odeint -} // numeric -} // boost - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_operations_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_operations_dispatcher.hpp deleted file mode 100644 index 76df2f37d5..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_operations_dispatcher.hpp +++ /dev/null @@ -1,44 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/compute/compute_operations_dispatcher.hpp - - [begin_description] - operations_dispatcher specialization for Boost.Compute - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_DISPATCHER_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_DISPATCHER_HPP_DEFINED - -#include <boost/compute/container/vector.hpp> - -#include <boost/numeric/odeint/external/compute/compute_operations.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -// specialization for Boost.Compute vector -template< class T , class A > -struct operations_dispatcher< boost::compute::vector< T , A > > -{ - typedef compute_operations operations_type; -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_OPERATIONS_DISPATCHER_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_resize.hpp deleted file mode 100644 index 013a7acc41..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/compute/compute_resize.hpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/compute/compute_resize.hpp - - [begin_description] - Enable resizing for Boost.Compute vector - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED - -#include <boost/compute/container/vector.hpp> - -#include <boost/numeric/odeint/util/copy.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< class T, class A > -struct is_resizeable< boost::compute::vector< T , A > > -{ - struct type : public boost::true_type { }; - const static bool value = type::value; -}; - -template< class T, class A > -struct same_size_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > > -{ - static bool same_size( const boost::compute::vector< T, A > &x , const boost::compute::vector< T, A > &y ) - { - return x.size() == y.size(); - } -}; - -template< class T, class A > -struct resize_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > > -{ - static void resize( boost::compute::vector< T, A > &x , const boost::compute::vector< T, A > &y ) - { - x.resize( y.size() ); - } -}; - - -template< class Container1, class T, class A > -struct copy_impl< Container1 , boost::compute::vector< T, A > > -{ - static void copy( const Container1 &from , boost::compute::vector< T, A > &to ) - { - boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) ); - } -}; - -template< class T, class A, class Container2 > -struct copy_impl< boost::compute::vector< T, A > , Container2 > -{ - static void copy( const boost::compute::vector< T, A > &from , Container2 &to ) - { - boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) ); - } -}; - -template< class T, class A > -struct copy_impl< boost::compute::vector< T, A > , boost::compute::vector< T, A > > -{ - static void copy( const boost::compute::vector< T, A > &from , boost::compute::vector< T, A > &to ) - { - boost::compute::copy( boost::begin( from ) , boost::end( from ) , boost::begin( to ) ); - } -}; - - - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_COMPUTE_COMPUTE_RESIZE_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen.hpp deleted file mode 100644 index 620acae51f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/eigen/eigen.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED - - -#include <boost/numeric/odeint/external/eigen/eigen_algebra.hpp> -#include <boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp> -#include <boost/numeric/odeint/external/eigen/eigen_resize.hpp> - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_algebra.hpp deleted file mode 100644 index b4ee5c3b1f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_algebra.hpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/eigen/eigen_algebra.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2013 Christian Shelton - Copyright 2013 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED - -#include <Eigen/Dense> -#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> - -// Necessary routines for Eigen matrices to work with vector_space_algebra -// from odeint -// (that is, it lets odeint treat the eigen matrices correctly, knowing -// how to add, multiply, compute the norm, etc) - -namespace Eigen { - - -template<typename D> -inline const -typename Eigen::CwiseUnaryOp< - typename Eigen::internal::scalar_add_op< - typename Eigen::internal::traits<D>::Scalar>, - const D > -operator+(const typename Eigen::MatrixBase<D> &m, - const typename Eigen::internal::traits<D>::Scalar &s) { - return Eigen::CwiseUnaryOp< - typename Eigen::internal::scalar_add_op< - typename Eigen::internal::traits<D>::Scalar>, - const D >(m.derived(),Eigen::internal::scalar_add_op< - typename Eigen::internal::traits<D>::Scalar>(s)); -} - -template<typename D> -inline const -typename Eigen::CwiseUnaryOp< - typename Eigen::internal::scalar_add_op< - typename Eigen::internal::traits<D>::Scalar>, - const D > -operator+(const typename Eigen::internal::traits<D>::Scalar &s, -const typename Eigen::MatrixBase<D> &m) { - return Eigen::CwiseUnaryOp< - typename Eigen::internal::scalar_add_op< - typename Eigen::internal::traits<D>::Scalar>, - const D >(m.derived(),Eigen::internal::scalar_add_op< - typename Eigen::internal::traits<D>::Scalar>(s)); -} - - - -template<typename D1,typename D2> -inline const -typename Eigen::CwiseBinaryOp< - typename Eigen::internal::scalar_quotient_op< - typename Eigen::internal::traits<D1>::Scalar>, - const D1, const D2> -operator/(const Eigen::MatrixBase<D1> &x1, const Eigen::MatrixBase<D2> &x2) { - return x1.cwiseQuotient(x2); -} - - -template< typename D > -inline const -typename Eigen::CwiseUnaryOp< - typename Eigen::internal::scalar_abs_op< - typename Eigen::internal::traits< D >::Scalar > , - const D > -abs( const Eigen::MatrixBase< D > &m ) { - return m.cwiseAbs(); -} - - - -} // end Eigen namespace - - - - - -namespace boost { -namespace numeric { -namespace odeint { - -template<typename B,int S1,int S2,int O, int M1, int M2> -struct vector_space_norm_inf< Eigen::Matrix<B,S1,S2,O,M1,M2> > -{ - typedef B result_type; - result_type operator()( const Eigen::Matrix<B,S1,S2,O,M1,M2> &m ) const - { - return m.template lpNorm<Eigen::Infinity>(); - } -}; - -} } } // end boost::numeric::odeint namespace - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp deleted file mode 100644 index 6c8a3a276f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/eigen/eigen_algebra_dispatcher.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED - - -namespace boost { -namespace numeric { -namespace odeint { - - -template< class Derived > -struct algebra_dispatcher_sfinae< Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type > -{ - typedef vector_space_algebra algebra_type; -}; - - -template < class Derived > -struct algebra_dispatcher_sfinae< Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type > -{ - typedef vector_space_algebra algebra_type; -}; - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_ALGEBRA_DISPATCHER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_resize.hpp deleted file mode 100644 index 1989cc36c1..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/eigen/eigen_resize.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/eigen/eigen_resize.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2013 Ankur Sinha - Copyright 2013 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED - - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> - -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_base_of.hpp> - -#include <Eigen/Dense> - -namespace boost { -namespace numeric { -namespace odeint { - - - -template< class Derived > -struct is_resizeable_sfinae< Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - - -template < class Derived > -struct is_resizeable_sfinae< Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - - - -template< class Derived > -struct same_size_impl_sfinae< Derived , Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type > -{ - static bool same_size( const Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 ) - - { - return ( ( m1.innerSize () == m2.innerSize () ) && ( m1.outerSize() == m2.outerSize() ) ); - } -}; - -template< class Derived > -struct same_size_impl_sfinae< Derived , Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type > -{ - static bool same_size( const Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived > &v2 ) - { - return ( ( v1.innerSize () == v2.innerSize () ) && ( v1.outerSize() == v2.outerSize() ) ); - } -}; - - - - -template< class Derived > -struct resize_impl_sfinae< Derived , Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::MatrixBase< Derived > , Derived >::type >::type > -{ - static void resize( Eigen::MatrixBase< Derived > &m1 , const Eigen::MatrixBase< Derived > &m2 ) - { - m1.derived().resizeLike(m2); - } -}; - -template< class Derived > -struct resize_impl_sfinae< Derived , Derived , - typename boost::enable_if< typename boost::is_base_of< Eigen::ArrayBase< Derived > , Derived >::type >::type > -{ - static void resize( Eigen::ArrayBase< Derived > &v1 , const Eigen::ArrayBase< Derived > &v2 ) - { - v1.derived().resizeLike(v2); - } -}; - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_EIGEN_EIGEN_RESIZE_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp deleted file mode 100644 index a856f6e8a1..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/gsl/gsl_wrapper.hpp +++ /dev/null @@ -1,229 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/gsl/gsl_wrapper.hpp - - [begin_description] - Wrapper for gsl_vector. - [end_description] - - Copyright 2011-2012 Mario Mulansky - Copyright 2011 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_GSL_GSL_WRAPPER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_GSL_GSL_WRAPPER_HPP_INCLUDED - -#include <new> - -#include <gsl/gsl_vector.h> - -#include <boost/type_traits/integral_constant.hpp> -#include <boost/range.hpp> -#include <boost/iterator/iterator_facade.hpp> - - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/copy.hpp> - -class const_gsl_vector_iterator; - -/* - * defines an iterator for gsl_vector - */ -class gsl_vector_iterator : public boost::iterator_facade< gsl_vector_iterator , double , boost::random_access_traversal_tag > -{ -public : - - gsl_vector_iterator( void ): m_p(0) , m_stride( 0 ) { } - explicit gsl_vector_iterator( gsl_vector *p ) : m_p( p->data ) , m_stride( p->stride ) { } - friend gsl_vector_iterator end_iterator( gsl_vector * ); - -private : - - friend class boost::iterator_core_access; - friend class const_gsl_vector_iterator; - - void increment( void ) { m_p += m_stride; } - void decrement( void ) { m_p -= m_stride; } - void advance( ptrdiff_t n ) { m_p += n*m_stride; } - bool equal( const gsl_vector_iterator &other ) const { return this->m_p == other.m_p; } - bool equal( const const_gsl_vector_iterator &other ) const; - double& dereference( void ) const { return *m_p; } - - double *m_p; - size_t m_stride; -}; - - - -/* - * defines an const iterator for gsl_vector - */ -class const_gsl_vector_iterator : public boost::iterator_facade< const_gsl_vector_iterator , const double , boost::random_access_traversal_tag > -{ -public : - - const_gsl_vector_iterator( void ): m_p(0) , m_stride( 0 ) { } - explicit const_gsl_vector_iterator( const gsl_vector *p ) : m_p( p->data ) , m_stride( p->stride ) { } - const_gsl_vector_iterator( const gsl_vector_iterator &p ) : m_p( p.m_p ) , m_stride( p.m_stride ) { } - -private : - - friend class boost::iterator_core_access; - friend class gsl_vector_iterator; - friend const_gsl_vector_iterator end_iterator( const gsl_vector * ); - - void increment( void ) { m_p += m_stride; } - void decrement( void ) { m_p -= m_stride; } - void advance( ptrdiff_t n ) { m_p += n*m_stride; } - bool equal( const const_gsl_vector_iterator &other ) const { return this->m_p == other.m_p; } - bool equal( const gsl_vector_iterator &other ) const { return this->m_p == other.m_p; } - const double& dereference( void ) const { return *m_p; } - - const double *m_p; - size_t m_stride; -}; - - -bool gsl_vector_iterator::equal( const const_gsl_vector_iterator &other ) const { return this->m_p == other.m_p; } - - -gsl_vector_iterator end_iterator( gsl_vector *x ) -{ - gsl_vector_iterator iter( x ); - iter.m_p += iter.m_stride * x->size; - return iter; -} - -const_gsl_vector_iterator end_iterator( const gsl_vector *x ) -{ - const_gsl_vector_iterator iter( x ); - iter.m_p += iter.m_stride * x->size; - return iter; -} - - - - -namespace boost -{ -template<> -struct range_mutable_iterator< gsl_vector* > -{ - typedef gsl_vector_iterator type; -}; - -template<> -struct range_const_iterator< gsl_vector* > -{ - typedef const_gsl_vector_iterator type; -}; -} // namespace boost - - - - -// template<> -inline gsl_vector_iterator range_begin( gsl_vector *x ) -{ - return gsl_vector_iterator( x ); -} - -// template<> -inline const_gsl_vector_iterator range_begin( const gsl_vector *x ) -{ - return const_gsl_vector_iterator( x ); -} - -// template<> -inline gsl_vector_iterator range_end( gsl_vector *x ) -{ - return end_iterator( x ); -} - -// template<> -inline const_gsl_vector_iterator range_end( const gsl_vector *x ) -{ - return end_iterator( x ); -} - - - - - - - -namespace boost { -namespace numeric { -namespace odeint { - - -template<> -struct is_resizeable< gsl_vector* > -{ - //struct type : public boost::true_type { }; - typedef boost::true_type type; - const static bool value = type::value; -}; - -template <> -struct same_size_impl< gsl_vector* , gsl_vector* > -{ - static bool same_size( const gsl_vector* x , const gsl_vector* y ) - { - return x->size == y->size; - } -}; - -template <> -struct resize_impl< gsl_vector* , gsl_vector* > -{ - static void resize( gsl_vector* &x , const gsl_vector* y ) - { - gsl_vector_free( x ); - x = gsl_vector_alloc( y->size ); - } -}; - -template<> -struct state_wrapper< gsl_vector* > -{ - typedef double value_type; - typedef gsl_vector* state_type; - typedef state_wrapper< gsl_vector* > state_wrapper_type; - - state_type m_v; - - state_wrapper( ) - { - m_v = gsl_vector_alloc( 1 ); - } - - state_wrapper( const state_wrapper_type &x ) - { - resize( m_v , x.m_v ); - gsl_vector_memcpy( m_v , x.m_v ); - } - - - ~state_wrapper() - { - gsl_vector_free( m_v ); - } - -}; - -} // odeint -} // numeric -} // boost - - - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_GSL_GSL_WRAPPER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mkl/mkl_operations.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mkl/mkl_operations.hpp deleted file mode 100644 index 59ac4b83cb..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mkl/mkl_operations.hpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/mkl/mkl_operations.hpp - - [begin_description] - Wrapper classes for intel math kernel library types. - Get a free, non-commercial download of MKL at - http://software.intel.com/en-us/articles/non-commercial-software-download/ - [end_description] - - Copyright 2010-2011 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MKL_MKL_OPERATIONS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_MKL_MKL_OPERATIONS_HPP_INCLUDED - -#include <iostream> - -#include <mkl_cblas.h> -#include <boost/numeric/odeint/algebra/default_operations.hpp> - -/* exemplary example for writing bindings to the Intel MKL library - * see test/mkl for how to use mkl with odeint - * this is a quick and dirty implementation showing the general possibility. - * It works only with containers based on double and sequential memory allocation. - */ - -namespace boost { -namespace numeric { -namespace odeint { - -/* only defined for doubles */ -struct mkl_operations -{ - //template< class Fac1 , class Fac2 > struct scale_sum2; - - template< class F1 = double , class F2 = F1 > - struct scale_sum2 - { - typedef double Fac1; - typedef double Fac2; - const Fac1 m_alpha1; - const Fac2 m_alpha2; - - scale_sum2( const Fac1 alpha1 , const Fac2 alpha2 ) : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { } - - template< class T1 , class T2 , class T3 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3) const - { // t1 = m_alpha1 * t2 + m_alpha2 * t3; - // we get Containers that have size() and [i]-access - - const int n = t1.size(); - //boost::numeric::odeint::copy( t1 , t3 ); - if( &(t2[0]) != &(t1[0]) ) - { - cblas_dcopy( n , &(t2[0]) , 1 , &(t1[0]) , 1 ); - } - cblas_dscal( n , m_alpha1 , &(t1[0]) , 1 ); - cblas_daxpy( n , m_alpha2 , &(t3[0]) , 1 , &(t1[0]) , 1 ); - //daxpby( &n , &m_alpha2 , &(t3[0]) , &one , &m_alpha1 , &(t1[0]) , &one ); - } - }; - - template< class F1 = double , class F2 = F1 , class F3 = F2 > - struct scale_sum3 - { - typedef double Fac1; - typedef double Fac2; - typedef double Fac3; - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - - scale_sum3( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) { } - - template< class T1 , class T2 , class T3 , class T4 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 ) const - { // t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4; - // we get Containers that have size() and [i]-access - - const int n = t1.size(); - //boost::numeric::odeint::copy( t1 , t3 ); - if( &(t2[0]) != &(t1[0]) ) - { - cblas_dcopy( n , &(t2[0]) , 1 , &(t1[0]) , 1 ); - } - cblas_dscal( n , m_alpha1 , &(t1[0]) , 1 ); - cblas_daxpy( n , m_alpha2 , &(t3[0]) , 1 , &(t1[0]) , 1 ); - //daxpby( &n , &m_alpha2 , &(t3[0]) , &one , &m_alpha1 , &(t1[0]) , &one ); - cblas_daxpy( n , m_alpha3 , &(t4[0]) , 1 , &(t1[0]) , 1 ); - } - }; - - template< class F1 = double , class F2 = F1 , class F3 = F2 , class F4 = F3 > - struct scale_sum4 - { - typedef double Fac1; - typedef double Fac2; - typedef double Fac3; - typedef double Fac4; - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - - scale_sum4( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , const Fac4 alpha4 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 ) const - { // t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5; - // we get Containers that have size() and [i]-access - - const int n = t1.size(); - //boost::numeric::odeint::copy( t1 , t3 ); - if( &(t2[0]) != &(t1[0]) ) - { - cblas_dcopy( n , &(t2[0]) , 1 , &(t1[0]) , 1 ); - } - - cblas_dscal( n , m_alpha1 , &(t1[0]) , 1 ); - cblas_daxpy( n , m_alpha2 , &(t3[0]) , 1 , &(t1[0]) , 1 ); - //daxpby( &n , &m_alpha2 , &(t3[0]) , &one , &m_alpha1 , &(t1[0]) , &one ); - cblas_daxpy( n , m_alpha3 , &(t4[0]) , 1 , &(t1[0]) , 1 ); - cblas_daxpy( n , m_alpha4 , &(t5[0]) , 1 , &(t1[0]) , 1 ); - } - }; - - - template< class F1 = double , class F2 = F1 , class F3 = F2 , class F4 = F3 , class F5 = F4 > - struct scale_sum5 - { - typedef double Fac1; - typedef double Fac2; - typedef double Fac3; - typedef double Fac4; - typedef double Fac5; - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - - scale_sum5( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , const Fac4 alpha4 , const Fac5 alpha5 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 > - void operator()( T1 &t1 , const T2 &t2 , const T3 &t3 , const T4 &t4 , const T5 &t5 , const T6 &t6 ) const - { // t1 = m_alpha1 * t2 + m_alpha2 * t3 + m_alpha3 * t4 + m_alpha4 * t5 + m_alpha5 * t6; - // we get Containers that have size() and [i]-access - - const int n = t1.size(); - //boost::numeric::odeint::copy( t1 , t3 ); - if( &(t2[0]) != &(t1[0]) ) - { - cblas_dcopy( n , &(t2[0]) , 1 , &(t1[0]) , 1 ); - } - - cblas_dscal( n , m_alpha1 , &(t1[0]) , 1 ); - cblas_daxpy( n , m_alpha2 , &(t3[0]) , 1 , &(t1[0]) , 1 ); - //daxpby( &n , &m_alpha2 , &(t3[0]) , &one , &m_alpha1 , &(t1[0]) , &one ); - cblas_daxpy( n , m_alpha3 , &(t4[0]) , 1 , &(t1[0]) , 1 ); - cblas_daxpy( n , m_alpha4 , &(t5[0]) , 1 , &(t1[0]) , 1 ); - cblas_daxpy( n , m_alpha5 , &(t6[0]) , 1 , &(t1[0]) , 1 ); - } - }; - -}; - -} // odeint -} // numeric -} // boost - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_MKL_MKL_OPERATIONS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi.hpp deleted file mode 100644 index 26e1ae991a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/mpi/mpi.hpp - - [begin_description] - Wrappers for MPI. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_HPP_INCLUDED - -#include <boost/numeric/odeint/external/mpi/mpi_vector_state.hpp> -#include <boost/numeric/odeint/external/mpi/mpi_nested_algebra.hpp> - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_nested_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_nested_algebra.hpp deleted file mode 100644 index 5d9022582a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_nested_algebra.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/mpi/mpi_nested_algebra.hpp - - [begin_description] - Nested parallelized algebra for MPI. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_NESTED_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_NESTED_ALGEBRA_HPP_INCLUDED - -#include <boost/numeric/odeint/algebra/norm_result_type.hpp> -#include <boost/numeric/odeint/util/n_ary_helper.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -/** \brief MPI-parallelized algebra, wrapping another algebra. - */ -template< class InnerAlgebra > -struct mpi_nested_algebra -{ - -// execute the InnerAlgebra on each node's local data. -#define BOOST_ODEINT_GEN_BODY(n) \ - InnerAlgebra::for_each##n( \ - BOOST_PP_ENUM_BINARY_PARAMS(n, s, () BOOST_PP_INTERCEPT) , \ - op \ - ); -BOOST_ODEINT_GEN_FOR_EACH(BOOST_ODEINT_GEN_BODY) -#undef BOOST_ODEINT_GEN_BODY - - - template< class NestedState > - static typename norm_result_type< typename NestedState::value_type >::type norm_inf( const NestedState &s ) - { - typedef typename norm_result_type< typename NestedState::value_type >::type result_type; - // local maximum - result_type value = InnerAlgebra::norm_inf( s() ); - // global maximum - return boost::mpi::all_reduce(s.world, value, boost::mpi::maximum<result_type>()); - } - -}; - - -} -} -} - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_state.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_state.hpp deleted file mode 100644 index aba179c09c..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_state.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/mpi/mpi_state.hpp - - [begin_description] - A generic split state, storing partial data on each node. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_STATE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_STATE_HPP_INCLUDED - -#include <vector> -#include <algorithm> -#include <boost/mpi.hpp> -#include <boost/numeric/odeint/util/copy.hpp> -#include <boost/numeric/odeint/util/split.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/external/mpi/mpi_nested_algebra.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -/** \brief A container which has its contents distributed among the nodes. - */ -template< class InnerState > -struct mpi_state -{ - typedef InnerState value_type; - - // the node's local data. - InnerState m_data; - - boost::mpi::communicator world; - - mpi_state() {} - mpi_state(boost::mpi::communicator comm) : world(comm) {} - - inline InnerState &operator()() { return m_data; } - inline const InnerState &operator()() const { return m_data; } -}; - - - - -template< class InnerState > -struct is_resizeable< mpi_state< InnerState > > - : is_resizeable< InnerState > { }; - - -template< class InnerState1 , class InnerState2 > -struct same_size_impl< mpi_state< InnerState1 > , mpi_state< InnerState2 > > -{ - static bool same_size( const mpi_state< InnerState1 > &x , const mpi_state< InnerState2 > &y ) - { - const bool local = boost::numeric::odeint::same_size(x(), y()); - return boost::mpi::all_reduce(x.world, local, mpi::bitwise_and<bool>()); - } -}; - - -template< class InnerState1 , class InnerState2 > -struct resize_impl< mpi_state< InnerState1 > , mpi_state< InnerState2 > > -{ - static void resize( mpi_state< InnerState1 > &x , const mpi_state< InnerState2 > &y ) - { - // resize local parts on each node. - boost::numeric::odeint::resize(x(), y()); - } -}; - - -/** \brief Copy data between mpi_states of same size. */ -template< class InnerState1 , class InnerState2 > -struct copy_impl< mpi_state< InnerState1 > , mpi_state< InnerState2 > > -{ - static void copy( const mpi_state< InnerState1 > &from , mpi_state< InnerState2 > &to ) - { - // copy local parts on each node. - boost::numeric::odeint::copy(from(), to()); - } -}; - - - -/** \brief Use `mpi_algebra` for `mpi_state`. */ -template< class InnerState > -struct algebra_dispatcher< mpi_state< InnerState > > -{ - typedef mpi_nested_algebra< - typename algebra_dispatcher< InnerState >::algebra_type - > algebra_type; -}; - - -} -} -} - - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_vector_state.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_vector_state.hpp deleted file mode 100644 index 096d40a655..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mpi/mpi_vector_state.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/mpi/mpi_vector_state.hpp - - [begin_description] - Copying a container from/to an mpi_state splits/joins it. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_VECTOR_STATE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_MPI_MPI_VECTOR_STATE_HPP_INCLUDED - -#include <vector> -#include <algorithm> -#include <boost/mpi.hpp> -#include <boost/numeric/odeint/util/copy.hpp> -#include <boost/numeric/odeint/util/split_adaptor.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/external/mpi/mpi_state.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/** \brief Split data from some container on node 0 to the slaves. - * Source must be a model of Random Access Range. */ -template< class Source , class InnerState > -struct split_impl< Source, mpi_state< InnerState >, - typename boost::enable_if< boost::has_range_const_iterator<Source> >::type > -{ - typedef typename boost::range_iterator<const Source>::type iterator; - - static void split( const Source &from, mpi_state< InnerState > &to ) - { - std::vector< InnerState > pieces; - if(to.world.rank() == 0) { - const size_t num = static_cast<size_t>(to.world.size()); - pieces.resize(num); - for(size_t i = 0 ; i < num ; i++) { - iterator_range<iterator> part = detail::make_split_range(from, i, num); - boost::numeric::odeint::resize(pieces[i], part); - boost::numeric::odeint::copy(part, pieces[i]); - } - } - // send to nodes - boost::mpi::scatter(to.world, pieces, to(), 0); - } -}; - -/** \brief Merge data from an mpi_state to some container on node 0. - * Target must be a model Single Pass Range. */ -template< class Target, class InnerState > -struct unsplit_impl< mpi_state< InnerState >, Target, - typename boost::enable_if< boost::has_range_iterator<Target> >::type > -{ - typedef typename boost::range_iterator<Target>::type iterator; - - static void unsplit( const mpi_state< InnerState > &from , Target &to ) - { - std::vector< InnerState > pieces; - // send data to root - boost::mpi::gather(from.world, from(), pieces, 0); - if(from.world.rank() == 0) { - // check target size - size_t total_size = 0; - for(size_t i = 0 ; i < pieces.size() ; i++) - total_size += boost::size(pieces[i]); - BOOST_ASSERT( total_size <= boost::size(to) ); - // copy parts - iterator out = boost::begin(to); - for(size_t i = 0 ; i < pieces.size() ; i++) - out = boost::copy(pieces[i], out); - } - } -}; - - -} -} -} - - -#endif - diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp deleted file mode 100644 index a3f03507cd..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/implicit_euler_mtl4.hpp +++ /dev/null @@ -1,162 +0,0 @@ -/* -[begin_description] -Modification of the implicit Euler method, works with the MTL4 matrix library only. -[end_description] - -Copyright 2012-2013 Andreas Angelopoulos -Copyright 2012-2013 Karsten Ahnert -Copyright 2012-2013 Mario Mulansky - -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or -copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_IMPLICIT_EULER_MTL4_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_IMPLICIT_EULER_MTL4_HPP_INCLUDED - - -#include <utility> - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/external/mtl4/mtl4_resize.hpp> - -#include <boost/numeric/mtl/mtl.hpp> -#include <boost/numeric/itl/itl.hpp> - - - - -namespace boost { -namespace numeric { -namespace odeint { - - -template< class ValueType , class Resizer = initially_resizer > -class implicit_euler_mtl4 -{ - -public: - - typedef ValueType value_type; - typedef value_type time_type; - typedef mtl::dense_vector<value_type> state_type; - - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_type deriv_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef mtl::compressed2D< value_type > matrix_type; - typedef state_wrapper< matrix_type > wrapped_matrix_type; - - typedef Resizer resizer_type; - typedef stepper_tag stepper_category; - - typedef implicit_euler_mtl4< ValueType , Resizer > stepper_type; - - - implicit_euler_mtl4( const value_type epsilon = 1E-6 ) - : m_epsilon( epsilon ) , m_resizer() , - m_dxdt() , m_x() , - m_identity() , m_jacobi() - { } - - - template< class System > - void do_step( System system , state_type &x , time_type t , time_type dt ) - { - typedef typename odeint::unwrap_reference< System >::type system_type; - typedef typename odeint::unwrap_reference< typename system_type::first_type >::type deriv_func_type; - typedef typename odeint::unwrap_reference< typename system_type::second_type >::type jacobi_func_type; - system_type &sys = system; - deriv_func_type &deriv_func = sys.first; - jacobi_func_type &jacobi_func = sys.second; - - m_resizer.adjust_size( x , detail::bind( - &stepper_type::template resize_impl< state_type > , detail::ref( *this ) , detail::_1 ) ); - - m_identity.m_v = 1; - - t += dt; - m_x.m_v = x; - - deriv_func( x , m_dxdt.m_v , t ); - jacobi_func( x , m_jacobi.m_v , t ); - - - m_dxdt.m_v *= -dt; - - m_jacobi.m_v *= dt; - m_jacobi.m_v -= m_identity.m_v ; - - - - // using ilu_0 preconditioning -incomplete LU factorisation - // itl::pc::diagonal<matrix_type,double> L(m_jacobi.m_v); - itl::pc::ilu_0<matrix_type> L( m_jacobi.m_v ); - - solve( m_jacobi.m_v , m_x.m_v , m_dxdt.m_v , L ); - x+= m_x.m_v; - - - } - - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_impl( x ); - } - - -private: - - - /* - Applying approximate iterative linear solvers - default solver is Biconjugate gradient stabilized method - itl::bicgstab(A, x, b, L, iter); - */ - template < class LinearOperator, class HilbertSpaceX, class HilbertSpaceB, class Preconditioner> - void solve(const LinearOperator& A, HilbertSpaceX& x, const HilbertSpaceB& b, - const Preconditioner& L, int max_iteractions =500) - { - // Termination criterion: r < 1e-6 * b or N iterations - itl::basic_iteration< double > iter( b , max_iteractions , 1e-6 ); - itl::bicgstab( A , x , b , L , iter ); - - } - - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_x , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_identity , x , typename is_resizeable<matrix_type>::type() ); - resized |= adjust_size_by_resizeability( m_jacobi , x , typename is_resizeable<matrix_type>::type() ); - return resized; - } - - -private: - - value_type m_epsilon; - resizer_type m_resizer; - wrapped_deriv_type m_dxdt; - wrapped_state_type m_x; - wrapped_matrix_type m_identity; - wrapped_matrix_type m_jacobi; -}; - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_IMPLICIT_EULER_MTL4_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4.hpp deleted file mode 100644 index 9b9ebf71d0..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/* - [auto_generated] - /boost/numeric/odeint/external/mtl4/mtl4.hpp - - [begin_description] - includes all headers required for using mtl4 with odeint - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_MTL4_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_MTL4_HPP_INCLUDED - -#include <boost/numeric/odeint/external/mtl4/mtl4_algebra_dispatcher.hpp> -#include <boost/numeric/odeint/external/mtl4/mtl4_resize.hpp> - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_MTL4_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4_algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4_algebra_dispatcher.hpp deleted file mode 100644 index 8f6bfbe32e..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4_algebra_dispatcher.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/mtl4/mtl4_algebra_dispatcher.hpp - - [begin_description] - specialization of the algebra dispatcher for mtl4 - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_MTL4_MTL4_ALGEBRA_DISPATCHER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_MTL4_MTL4_ALGEBRA_DISPATCHER_HPP_INCLUDED - -#include <boost/numeric/mtl/mtl.hpp> - -#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template<typename Value, typename Parameters> -struct algebra_dispatcher< mtl::dense_vector< Value , Parameters > > -{ - typedef vector_space_algebra algebra_type; -}; - -template<typename Value, typename Parameters> -struct algebra_dispatcher< mtl::dense2D< Value , Parameters > > -{ - typedef vector_space_algebra algebra_type; -}; - -template<typename Value , size_t BitMask , typename Parameters> -struct algebra_dispatcher< mtl::morton_dense< Value , BitMask, Parameters > > -{ - typedef vector_space_algebra algebra_type; -}; - -template<typename Value, typename Parameters> -struct algebra_dispatcher< mtl::compressed2D< Value , Parameters > > -{ - typedef vector_space_algebra algebra_type; -}; - -// specialization of infinity norm calculation - -template<typename Value, typename Parameters> -struct vector_space_norm_inf< mtl::dense_vector< Value , Parameters > > -{ - typedef Value result_type; - Value operator()( const mtl::dense_vector< Value , Parameters > &x ) const - { - return mtl::infinity_norm(x); - } -}; - -template<typename Value, typename Parameters> -struct vector_space_norm_inf< mtl::dense2D< Value , Parameters > > -{ - typedef Value result_type; - Value operator()( const mtl::dense2D< Value , Parameters > &x ) const - { - return mtl::infinity_norm(x); - } -}; - -template<typename Value , size_t BitMask , typename Parameters> -struct vector_space_norm_inf< mtl::morton_dense< Value , BitMask , Parameters > > -{ - typedef Value result_type; - Value operator()( const mtl::morton_dense< Value , BitMask , Parameters > &x ) const - { - return mtl::infinity_norm(x); - } -}; - -template<typename Value, typename Parameters> -struct vector_space_norm_inf< mtl::compressed2D< Value , Parameters > > -{ - typedef Value result_type; - Value operator()( const mtl::compressed2D< Value , Parameters > &x ) const - { - return mtl::infinity_norm(x); - } -}; - -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_MTL4_MTL4_ALGEBRA_DISPATCHER_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4_resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4_resize.hpp deleted file mode 100644 index 6295c03a64..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/mtl4/mtl4_resize.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/* -[begin_description] -Modification of the implicit Euler method, works with the MTL4 matrix library only. -[end_description] - -Copyright 2012-2013 Andreas Angelopoulos -Copyright 2012-2013 Karsten Ahnert -Copyright 2012-2013 Mario Mulansky - -Distributed under the Boost Software License, Version 1.0. -(See accompanying file LICENSE_1_0.txt or -copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_RESIZE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_RESIZE_HPP_INCLUDED - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> - -#include <boost/numeric/mtl/vector/dense_vector.hpp> -#include <boost/numeric/mtl/matrix/dense2D.hpp> -#include <boost/numeric/mtl/matrix/compressed2D.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - -template< class Value , class Parameters > -struct is_resizeable< mtl::dense_vector< Value , Parameters > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - -template< class Value , class Parameters > -struct is_resizeable< mtl::dense2D< Value , Parameters > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - -template< class Value , class Parameters > -struct is_resizeable< mtl::compressed2D< Value , Parameters > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - - - - -template< class Value , class Parameters > -struct same_size_impl< mtl::dense_vector< Value , Parameters > , mtl::dense_vector< Value , Parameters > > -{ - static bool same_size( const mtl::dense_vector< Value , Parameters > &v1 , - const mtl::dense_vector< Value , Parameters > &v2 ) - { - return mtl::size( v1 ) == mtl::size( v2 ); - } -}; - -template< class Value , class Parameters > -struct resize_impl< mtl::dense_vector< Value , Parameters > , mtl::dense_vector< Value , Parameters > > -{ - static void resize( mtl::dense_vector< Value , Parameters > &v1 , - const mtl::dense_vector< Value , Parameters > &v2 ) - { - v1.change_dim( mtl::size( v2 ) ); - } -}; - - - -template< class Value , class MatrixParameters , class VectorParameters > -struct same_size_impl< mtl::dense2D< Value , MatrixParameters > , mtl::dense_vector< Value , VectorParameters > > -{ - static bool same_size( const mtl::dense2D< Value , MatrixParameters > &m , - const mtl::dense_vector< Value , VectorParameters > &v ) - { - return ( ( mtl::size( v ) == m.num_cols() ) && ( mtl::size( v ) == m.num_rows() ) ); - } -}; - -template< class Value , class MatrixParameters , class VectorParameters > -struct resize_impl< mtl::dense2D< Value , MatrixParameters > , mtl::dense_vector< Value , VectorParameters > > -{ - static void resize( mtl::dense2D< Value , MatrixParameters > &m , - const mtl::dense_vector< Value , VectorParameters > &v ) - { - m.change_dim( mtl::size( v ) , mtl::size( v ) , false ); - } -}; - - - - -template< class Value , class MatrixParameters , class VectorParameters > -struct same_size_impl< mtl::compressed2D< Value , MatrixParameters > , mtl::dense_vector< Value , VectorParameters > > -{ - static bool same_size( const mtl::compressed2D< Value , MatrixParameters > &m , - const mtl::dense_vector< Value , VectorParameters > &v ) - { - return ( ( mtl::size( v ) == m.num_cols() ) && ( mtl::size( v ) == m.num_rows() ) ); - } -}; - -template< class Value , class MatrixParameters , class VectorParameters > -struct resize_impl< mtl::compressed2D< Value , MatrixParameters > , mtl::dense_vector< Value , VectorParameters > > -{ - static void resize( mtl::compressed2D< Value , MatrixParameters > &m , - const mtl::dense_vector< Value , VectorParameters > &v ) - { - m.change_dim( mtl::size( v ) , mtl::size( v ) ); - } -}; - - - - - - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_MTL4_RESIZE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_algebra_dispatcher.hpp deleted file mode 100644 index 7b82a8b315..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_algebra_dispatcher.hpp +++ /dev/null @@ -1,25 +0,0 @@ -//============================================================================== -// Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI -// Copyright 2014 NumScale SAS -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt -//============================================================================== -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_ALGEBRA_DISPATCHER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_ALGEBRA_DISPATCHER_HPP_INCLUDED - -#include <nt2/core/container/table/table.hpp> - -#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> - -namespace boost { namespace numeric { namespace odeint { -template<typename T, typename S> -struct algebra_dispatcher<nt2::container::table<T,S> > -{ - typedef vector_space_algebra algebra_type; -}; -} } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_copy.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_copy.hpp deleted file mode 100644 index 0fd558843c..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_copy.hpp +++ /dev/null @@ -1,33 +0,0 @@ -//============================================================================== -// Copyright 2014 LASMEA UMR 6602 CNRS/Univ. Clermont II -// Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI -// Copyright 2014 MetaScale SAS -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt -//============================================================================== -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_COPY_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_COPY_HPP_INCLUDED - -#include <nt2/core/container/table/table.hpp> - -#include <boost/numeric/odeint/util/copy.hpp> - -namespace boost { namespace numeric { namespace odeint { - -template<typename T, typename S> -struct copy_impl< nt2::container::table<T,S> - , nt2::container::table<T,S> - > -{ - static void copy ( const nt2::container::table<T,S> &v1 - , nt2::container::table<T,S> &v2 - ) - { - v2 = v1; - } -}; -} } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_norm_inf.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_norm_inf.hpp deleted file mode 100644 index 81f867e353..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_norm_inf.hpp +++ /dev/null @@ -1,31 +0,0 @@ -//============================================================================== -// Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI -// Copyright 2014 NumScale SAS -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt -//============================================================================== -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_NORM_INF_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_NORM_INF_HPP_INCLUDED - -#include <nt2/core/container/table/table.hpp> -#include <nt2/include/functions/globalmax.hpp> -#include <nt2/include/functions/abs.hpp> - -#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> - -namespace boost { namespace numeric { namespace odeint -{ - template<typename T, typename S> - struct vector_space_norm_inf<nt2::container::table<T,S> > - { - typedef T result_type; - result_type operator()(const nt2::container::table<T,S> &v1) const - { - return nt2::globalmax(nt2::abs(v1)); - } - }; -} } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_resize.hpp deleted file mode 100644 index d9c2359c3e..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/nt2/nt2_resize.hpp +++ /dev/null @@ -1,52 +0,0 @@ -//============================================================================== -// Copyright 2014 LRI UMR 8623 CNRS/Univ Paris Sud XI -// Copyright 2014 NumScale SAS -// -// Distributed under the Boost Software License, Version 1.0. -// See accompanying file LICENSE.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt -//============================================================================== -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_RESIZE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_NT2_NT2_RESIZE_HPP_INCLUDED - -#include <nt2/core/container/table/table.hpp> - -#include <boost/numeric/odeint/util/same_size.hpp> - -namespace boost { namespace numeric { namespace odeint { - -template<typename T, typename S> -struct is_resizeable< nt2::container::table<T,S> > -{ - typedef boost::true_type type; - static const bool value = type::value; -}; - -template<typename T, typename S> -struct same_size_impl< nt2::container::table<T,S> - , nt2::container::table<T,S> - > -{ - static bool same_size ( const nt2::container::table<T,S> &v1 - , const nt2::container::table<T,S> &v2 - ) - { - return v1.extent() == v2.extent(); - } -}; - -template<typename T, typename S> -struct resize_impl< nt2::container::table<T,S> - , nt2::container::table<T,S> - > -{ - static void resize ( nt2::container::table<T,S> &v1 - , const nt2::container::table<T,S> &v2 - ) - { - v1.resize( v2.extent() ); - } -}; -} } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp.hpp deleted file mode 100644 index 0d6fb0b855..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/openmp/openmp.hpp - - [begin_description] - Wrappers for OpenMP. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_HPP_INCLUDED - -// level 1: parallel iteration over random access container -#include <boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp> - -// level 2: split range state -#include <boost/numeric/odeint/external/openmp/openmp_state.hpp> - -// level 3: process a random access container of sub-states in parallel -#include <boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp> - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp deleted file mode 100644 index a3d299f0a7..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp +++ /dev/null @@ -1,281 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp - - [begin_description] - Nested parallelized algebra for OpenMP. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_NESTED_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_NESTED_ALGEBRA_HPP_INCLUDED - -#include <boost/assert.hpp> -#include <boost/range.hpp> -#include <boost/numeric/odeint/algebra/norm_result_type.hpp> -#include <boost/numeric/odeint/util/n_ary_helper.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -/** \brief OpenMP-parallelized algebra, wrapping another, non-parallelized algebra. - * - * NestedState must be a model of Random Access Range, where the elements are sub-states - * which will be processed in parallel. - */ -template< class InnerAlgebra > -struct openmp_nested_algebra -{ - -#if __cplusplus >= 201103L // C++11 supports _Pragma - -#define BOOST_ODEINT_GEN_LOCAL(z, n, unused) \ - BOOST_ASSERT_MSG( len == boost::size(s ## n), "All nested state ranges must have the same size." ); \ - typename boost::range_iterator<S ## n>::type beg ## n = boost::begin(s ## n); -#define BOOST_ODEINT_GEN_BODY(n) \ - const size_t len = boost::size(s0); \ - BOOST_PP_REPEAT(n, BOOST_ODEINT_GEN_LOCAL, ~) \ - _Pragma("omp parallel for schedule(runtime)") \ - for( size_t i = 0 ; i < len ; i++ ) \ - InnerAlgebra::for_each##n( \ - BOOST_PP_ENUM_BINARY_PARAMS(n, beg, [i] BOOST_PP_INTERCEPT) , \ - op \ - ); -BOOST_ODEINT_GEN_FOR_EACH(BOOST_ODEINT_GEN_BODY) -#undef BOOST_ODEINT_GEN_BODY -#undef BOOST_ODEINT_GEN_LOCAL - -#else - - template< class S0 , class Op > static void for_each1 ( S0 &s0 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each1( beg0 [i] , op ); - } - template< class S0 , class S1 , class Op > static void for_each2 ( S0 &s0 , S1 &s1 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each2( beg0 [i] , beg1 [i] , op ); - } - template< class S0 , class S1 , class S2 , class Op > static void for_each3 ( S0 &s0 , S1 &s1 , S2 &s2 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each3( beg0 [i] , beg1 [i] , beg2 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class Op > static void for_each4 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each4( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class Op > static void for_each5 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each5( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class Op > static void for_each6 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each6( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op > static void for_each7 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each7( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class Op > static void for_each8 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each8( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class Op > static void for_each9 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each9( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class Op > static void for_each10 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each10( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class Op > static void for_each11 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each11( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class Op > static void for_each12 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - typename boost::range_iterator<S11>::type beg11 = boost::begin(s11); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each12( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op > static void for_each13 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - typename boost::range_iterator<S11>::type beg11 = boost::begin(s11); - typename boost::range_iterator<S12>::type beg12 = boost::begin(s12); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each13( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op > static void for_each14 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - typename boost::range_iterator<S11>::type beg11 = boost::begin(s11); - typename boost::range_iterator<S12>::type beg12 = boost::begin(s12); - typename boost::range_iterator<S13>::type beg13 = boost::begin(s13); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each14( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] , beg13 [i] , op ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op > static void for_each15 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - typename boost::range_iterator<S11>::type beg11 = boost::begin(s11); - typename boost::range_iterator<S12>::type beg12 = boost::begin(s12); - typename boost::range_iterator<S13>::type beg13 = boost::begin(s13); - typename boost::range_iterator<S14>::type beg14 = boost::begin(s14); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) InnerAlgebra::for_each15( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] , beg13 [i] , beg14 [i] , op ); - } - -#endif - - - template< class NestedState > - static typename norm_result_type< typename NestedState::value_type >::type norm_inf( const NestedState &s ) - { - typedef typename boost::range_iterator<const NestedState>::type iterator; - typedef typename std::iterator_traits<iterator>::value_type value_type; - typedef typename norm_result_type<value_type>::type result_type; - result_type init = static_cast< result_type >( 0 ); - const size_t len = boost::size(s); - iterator beg = boost::begin(s); -# pragma omp parallel for reduction(max: init) schedule(dynamic) - for( size_t i = 0 ; i < len ; i++ ) - init = (std::max)( init , InnerAlgebra::norm_inf( beg[i] ) ); - return init; - } - -}; - - -} -} -} - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp deleted file mode 100644 index 295db647d4..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp +++ /dev/null @@ -1,276 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp - - [begin_description] - Range algebra for OpenMP. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_RANGE_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_RANGE_ALGEBRA_HPP_INCLUDED - -#include <boost/assert.hpp> -#include <boost/range.hpp> -#include <boost/numeric/odeint/algebra/norm_result_type.hpp> -#include <boost/numeric/odeint/util/n_ary_helper.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -/** \brief OpenMP-parallelized range algebra. - * - * State must be a model of Random Access Range. - */ -struct openmp_range_algebra -{ - -#if __cplusplus >= 201103L // C++11 supports _Pragma - -#define BOOST_ODEINT_GEN_LOCAL(z, n, unused) \ - BOOST_ASSERT_MSG( len == boost::size(s ## n), "All state ranges must have the same size." ); \ - typename boost::range_iterator<S ## n>::type beg ## n = boost::begin(s ## n); -#define BOOST_ODEINT_GEN_BODY(n) \ - const size_t len = boost::size(s0); \ - BOOST_PP_REPEAT(n, BOOST_ODEINT_GEN_LOCAL, ~) \ - _Pragma("omp parallel for schedule(runtime)") \ - for( size_t i = 0 ; i < len ; i++ ) \ - op( BOOST_PP_ENUM_BINARY_PARAMS(n, beg, [i] BOOST_PP_INTERCEPT) ); -BOOST_ODEINT_GEN_FOR_EACH(BOOST_ODEINT_GEN_BODY) -#undef BOOST_ODEINT_GEN_BODY -#undef BOOST_ODEINT_GEN_LOCAL - -#else - - template< class S0 , class Op > static void for_each1 ( S0 &s0 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] ); - } - template< class S0 , class S1 , class Op > static void for_each2 ( S0 &s0 , S1 &s1 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] ); - } - template< class S0 , class S1 , class S2 , class Op > static void for_each3 ( S0 &s0 , S1 &s1 , S2 &s2 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class Op > static void for_each4 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class Op > static void for_each5 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class Op > static void for_each6 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class Op > static void for_each7 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class Op > static void for_each8 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class Op > static void for_each9 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class Op > static void for_each10 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class Op > static void for_each11 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class Op > static void for_each12 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - typename boost::range_iterator<S11>::type beg11 = boost::begin(s11); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class Op > static void for_each13 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - typename boost::range_iterator<S11>::type beg11 = boost::begin(s11); - typename boost::range_iterator<S12>::type beg12 = boost::begin(s12); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class Op > static void for_each14 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - typename boost::range_iterator<S11>::type beg11 = boost::begin(s11); - typename boost::range_iterator<S12>::type beg12 = boost::begin(s12); - typename boost::range_iterator<S13>::type beg13 = boost::begin(s13); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] , beg13 [i] ); - } - template< class S0 , class S1 , class S2 , class S3 , class S4 , class S5 , class S6 , class S7 , class S8 , class S9 , class S10 , class S11 , class S12 , class S13 , class S14 , class Op > static void for_each15 ( S0 &s0 , S1 &s1 , S2 &s2 , S3 &s3 , S4 &s4 , S5 &s5 , S6 &s6 , S7 &s7 , S8 &s8 , S9 &s9 , S10 &s10 , S11 &s11 , S12 &s12 , S13 &s13 , S14 &s14 , Op op ) { - const size_t len = boost::size(s0); - typename boost::range_iterator<S0>::type beg0 = boost::begin(s0); - typename boost::range_iterator<S1>::type beg1 = boost::begin(s1); - typename boost::range_iterator<S2>::type beg2 = boost::begin(s2); - typename boost::range_iterator<S3>::type beg3 = boost::begin(s3); - typename boost::range_iterator<S4>::type beg4 = boost::begin(s4); - typename boost::range_iterator<S5>::type beg5 = boost::begin(s5); - typename boost::range_iterator<S6>::type beg6 = boost::begin(s6); - typename boost::range_iterator<S7>::type beg7 = boost::begin(s7); - typename boost::range_iterator<S8>::type beg8 = boost::begin(s8); - typename boost::range_iterator<S9>::type beg9 = boost::begin(s9); - typename boost::range_iterator<S10>::type beg10 = boost::begin(s10); - typename boost::range_iterator<S11>::type beg11 = boost::begin(s11); - typename boost::range_iterator<S12>::type beg12 = boost::begin(s12); - typename boost::range_iterator<S13>::type beg13 = boost::begin(s13); - typename boost::range_iterator<S14>::type beg14 = boost::begin(s14); - #pragma omp parallel for schedule(runtime) - for( size_t i = 0 ; i < len ; i++ ) op( beg0 [i] , beg1 [i] , beg2 [i] , beg3 [i] , beg4 [i] , beg5 [i] , beg6 [i] , beg7 [i] , beg8 [i] , beg9 [i] , beg10 [i] , beg11 [i] , beg12 [i] , beg13 [i] , beg14 [i] ); - } - -#endif - - - template< class S > - static typename norm_result_type< S >::type norm_inf( const S &s ) - { - using std::max; - using std::abs; - typedef typename norm_result_type< S >::type result_type; - result_type init = static_cast< result_type >( 0 ); - const size_t len = boost::size(s); - typename boost::range_iterator<const S>::type beg = boost::begin(s); -# pragma omp parallel for reduction(max: init) schedule(dynamic) - for( size_t i = 0 ; i < len ; ++i ) - init = max( init , abs( beg[i] ) ); - return init; - } - -}; - - -} -} -} - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_state.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_state.hpp deleted file mode 100644 index 83bbc19232..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/openmp/openmp_state.hpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/openmp/openmp_state.hpp - - [begin_description] - Wrappers for OpenMP. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_STATE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_OPENMP_OPENMP_STATE_HPP_INCLUDED - -#include <omp.h> -#include <vector> -#include <algorithm> -#include <boost/range/adaptor/sliced.hpp> -#include <boost/numeric/odeint/util/copy.hpp> -#include <boost/numeric/odeint/util/split.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/external/openmp/openmp_nested_algebra.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -/** \brief A container that is split into distinct parts, for threading. - * Just a wrapper for vector<vector<T>>, use `copy` for splitting/joining. - */ -template< class T > -struct openmp_state : public std::vector< std::vector< T > > -{ - openmp_state() {} - - openmp_state(size_t n, const std::vector<T>& val = std::vector<T>()) - : std::vector< std::vector< T > >(n, val) {} - - template<class InputIterator> - openmp_state(InputIterator first, InputIterator last) - : std::vector< std::vector< T > >(first, last) {} - - openmp_state(const std::vector< std::vector< T > > &orig) - : std::vector< std::vector< T > >(orig) {} - -}; - - - - -template< class T > -struct is_resizeable< openmp_state< T > > : boost::true_type { }; - - -template< class T > -struct same_size_impl< openmp_state< T > , openmp_state< T > > -{ - static bool same_size( const openmp_state< T > &x , const openmp_state< T > &y ) - { - if( x.size() != y.size() ) return false; - for( size_t i = 0 ; i != x.size() ; i++ ) - if( x[i].size() != y[i].size() ) return false; - return true; - } -}; - - -template< class T > -struct resize_impl< openmp_state< T > , openmp_state< T > > -{ - static void resize( openmp_state< T > &x , const openmp_state< T > &y ) - { - x.resize( y.size() ); -# pragma omp parallel for schedule(dynamic) - for(size_t i = 0 ; i < x.size() ; i++) - x[i].resize( y[i].size() ); - } -}; - - -/** \brief Copy data between openmp_states of same size. */ -template< class T > -struct copy_impl< openmp_state< T >, openmp_state< T > > -{ - static void copy( const openmp_state< T > &from, openmp_state< T > &to ) - { -# pragma omp parallel for schedule(dynamic) - for(size_t i = 0 ; i < from.size() ; i++) - std::copy( from[i].begin() , from[i].end() , to.begin() ); - } -}; - - - -/** \brief Copy data from some container to an openmp_state and resize it. - * Target container size will determine number of blocks to split into. - * If it is empty, it will be resized to the maximum number of OpenMP threads. - * SourceContainer must support `s::value_type`, `s::const_iterator`, `s.begin()`, `s.end()` and `s.size()`, - * with Random Access Iterators; i.e. it must be a Random Access Container. */ -template< class SourceContainer > -struct split_impl< SourceContainer, openmp_state< typename SourceContainer::value_type > > -{ - static void split( const SourceContainer &from, openmp_state< typename SourceContainer::value_type > &to ) - { - if(to.size() == 0) to.resize( omp_get_max_threads() ); - const size_t part = from.size() / to.size(); -# pragma omp parallel for schedule(dynamic) - for(size_t i = 0 ; i < to.size() ; i++) { - typedef typename SourceContainer::const_iterator it_t; - const it_t begin = from.begin() + i * part; - it_t end = begin + part; - // for cases where from.size() % to.size() > 0 - if(i + 1 == to.size() || end > from.end()) end = from.end(); - to[i].resize(end - begin); - std::copy(begin, end, to[i].begin()); - } - } -}; - -/** \brief Copy data from an openmp_state to some container and resize it. - * TargetContainer must support `s::value_type`, `s::iterator`, `s.begin()` and `s.resize(n)`, - * i.e. it must be a `std::vector`. */ -template< class TargetContainer > -struct unsplit_impl< openmp_state< typename TargetContainer::value_type >, TargetContainer > -{ - static void unsplit( const openmp_state< typename TargetContainer::value_type > &from , TargetContainer &to ) - { - // resize target - size_t total_size = 0; - for(size_t i = 0 ; i < from.size() ; i++) - total_size += from[i].size(); - to.resize( total_size ); - // copy parts - typename TargetContainer::iterator out = to.begin(); - for(size_t i = 0 ; i < from.size() ; i++) - out = std::copy(from[i].begin(), from[i].end(), out); - } -}; - - - - -/** \brief OpenMP-parallelized algebra. - * For use with openmp_state. - */ -typedef openmp_nested_algebra< range_algebra > openmp_algebra; - - - -/** \brief Use `openmp_algebra` for `openmp_state`. */ -template< class T > -struct algebra_dispatcher< openmp_state< T > > -{ - typedef openmp_algebra algebra_type; -}; - - -} -} -} - - -#endif - diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust.hpp deleted file mode 100644 index 5c4987cfbb..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust.hpp +++ /dev/null @@ -1,27 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/thrust/thrust.hpp - - [begin_description] - includes all headers required for using odeint with thrust - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_HPP_DEFINED - -#include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp> -#include <boost/numeric/odeint/external/thrust/thrust_operations.hpp> -#include <boost/numeric/odeint/external/thrust/thrust_algebra_dispatcher.hpp> -#include <boost/numeric/odeint/external/thrust/thrust_operations_dispatcher.hpp> -#include <boost/numeric/odeint/external/thrust/thrust_resize.hpp> - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_algebra.hpp deleted file mode 100644 index f33e86296f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_algebra.hpp +++ /dev/null @@ -1,217 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/thrust/thrust_algebra.hpp - - [begin_description] - An algebra for thrusts device_vectors. - [end_description] - - Copyright 2010-2013 Mario Mulansky - Copyright 2010-2011 Karsten Ahnert - Copyright 2013 Kyle Lutz - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_HPP_INCLUDED - - -#include <thrust/device_vector.h> -#include <thrust/for_each.h> -#include <thrust/iterator/zip_iterator.h> - -#include <boost/range.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -namespace detail { - - // to use in thrust::reduce - template< class Value > - struct maximum - { - template< class Fac1 , class Fac2 > - __host__ __device__ - Value operator()( const Fac1 t1 , const Fac2 t2 ) const - { - return ( abs( t1 ) < abs( t2 ) ) ? t2 : t1 ; - } - - typedef Value result_type; - }; - -} - - - - -/** ToDO extend until for_each14 for rk78 */ - -/* - * The const versions are needed for boost.range to work, i.e. - * it allows you to do - * for_each1( make_pair( vec1.begin() , vec1.begin() + 10 ) , op ); - */ - -struct thrust_algebra -{ - template< class StateType , class Operation > - static void for_each1( StateType &s , Operation op ) - { - thrust::for_each( boost::begin(s) , boost::end(s) , op ); - } - - template< class StateType1 , class StateType2 , class Operation > - static void for_each2( StateType1 &s1 , StateType2 &s2 , Operation op ) - { - thrust::for_each( - thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , - boost::begin(s2) ) ) , - thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , - boost::end(s2) ) ) , - op); - } - - template< class StateType1 , class StateType2 , class StateType3 , class Operation > - static void for_each3( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , Operation op ) - { - thrust::for_each( - thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , - boost::begin(s2) , - boost::begin(s3) ) ) , - thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , - boost::end(s2) , - boost::end(s3) ) ) , - op); - } - - template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , - class Operation > - static void for_each4( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , - Operation op ) - { - thrust::for_each( - thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , - boost::begin(s2) , - boost::begin(s3) , - boost::begin(s4) ) ) , - thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , - boost::end(s2) , - boost::end(s3) , - boost::end(s4) ) ) , - op); - } - - template< class StateType1 , class StateType2 , class StateType3 , - class StateType4 , class StateType5 ,class Operation > - static void for_each5( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , - StateType5 &s5 , Operation op ) - { - thrust::for_each( - thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , - boost::begin(s2) , - boost::begin(s3) , - boost::begin(s4) , - boost::begin(s5) ) ) , - thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , - boost::end(s2) , - boost::end(s3) , - boost::end(s4) , - boost::end(s5) ) ) , - op); - } - - template< class StateType1 , class StateType2 , class StateType3 , - class StateType4 , class StateType5 , class StateType6 , class Operation > - static void for_each6( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , - StateType5 &s5 , StateType6 &s6 , Operation op ) - { - thrust::for_each( - thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , - boost::begin(s2) , - boost::begin(s3) , - boost::begin(s4) , - boost::begin(s5) , - boost::begin(s6) ) ) , - thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , - boost::end(s2) , - boost::end(s3) , - boost::end(s4) , - boost::end(s5) , - boost::end(s6) ) ) , - op); - } - - template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , - class StateType5 , class StateType6 , class StateType7 , class Operation > - static void for_each7( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , - StateType5 &s5 , StateType6 &s6 , StateType7 &s7 , Operation op ) - { - thrust::for_each( - thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , - boost::begin(s2) , - boost::begin(s3) , - boost::begin(s4) , - boost::begin(s5) , - boost::begin(s6) , - boost::begin(s7) ) ) , - thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , - boost::end(s2) , - boost::end(s3) , - boost::end(s4) , - boost::end(s5) , - boost::end(s6) , - boost::end(s7) ) ) , - op); - } - - template< class StateType1 , class StateType2 , class StateType3 , class StateType4 , - class StateType5 , class StateType6 , class StateType7 , class StateType8 , class Operation > - static void for_each8( StateType1 &s1 , StateType2 &s2 , StateType3 &s3 , StateType4 &s4 , - StateType5 &s5 , StateType6 &s6 , StateType7 &s7 , StateType8 &s8 , Operation op ) - { - thrust::for_each( - thrust::make_zip_iterator( thrust::make_tuple( boost::begin(s1) , - boost::begin(s2) , - boost::begin(s3) , - boost::begin(s4) , - boost::begin(s5) , - boost::begin(s6) , - boost::begin(s7) , - boost::begin(s8) ) ) , - thrust::make_zip_iterator( thrust::make_tuple( boost::end(s1) , - boost::end(s2) , - boost::end(s3) , - boost::end(s4) , - boost::end(s5) , - boost::end(s6) , - boost::end(s7) , - boost::end(s8) ) ) , - op); - } - - template< class S > - static typename S::value_type norm_inf( const S &s ) - { - typedef typename S::value_type value_type; - return thrust::reduce( boost::begin( s ) , boost::end( s ) , - static_cast<value_type>(0) , - detail::maximum<value_type>() ); - } - -}; - - -} // odeint -} // numeric -} // boost - - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_algebra_dispatcher.hpp deleted file mode 100644 index 0961346350..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_algebra_dispatcher.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/thrust/thrust_algebra_dispatcher.hpp - - [begin_description] - algebra_dispatcher specialization for thrust - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_DISPATCHER_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_DISPATCHER_HPP_DEFINED - -#include <thrust/host_vector.h> -#include <thrust/device_vector.h> - -#include <boost/numeric/odeint/external/thrust/thrust_algebra.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> - -// specializations for the standard thrust containers - -namespace boost { -namespace numeric { -namespace odeint { - -// specialization for thrust host_vector -template< class T , class A > -struct algebra_dispatcher< thrust::host_vector< T , A > > -{ - typedef thrust_algebra algebra_type; -}; - -// specialization for thrust device_vector -template< class T , class A > -struct algebra_dispatcher< thrust::device_vector< T , A > > -{ - typedef thrust_algebra algebra_type; -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -// add support for thrust backend vectors, if available - -#include <thrust/version.h> - -#if THRUST_VERSION >= 100600 - -// specialization for thrust cpp vector -#include <thrust/system/cpp/vector.h> -namespace boost { namespace numeric { namespace odeint { - template< class T , class A > - struct algebra_dispatcher< thrust::cpp::vector< T , A > > - { - typedef thrust_algebra algebra_type; - }; -} } } - -// specialization for thrust omp vector -#ifdef _OPENMP -#include <thrust/system/omp/vector.h> -namespace boost { namespace numeric { namespace odeint { - template< class T , class A > - struct algebra_dispatcher< thrust::omp::vector< T , A > > - { - typedef thrust_algebra algebra_type; - }; -} } } -#endif // _OPENMP - -// specialization for thrust tbb vector -#ifdef TBB_VERSION_MAJOR -#include <thrust/system/tbb/vector.h> -namespace boost { namespace numeric { namespace odeint { - template< class T , class A > - struct algebra_dispatcher< thrust::tbb::vector< T , A > > - { - typedef thrust_algebra algebra_type; - }; -} } } -#endif // TBB_VERSION_MAJOR - -// specialization for thrust cuda vector -#ifdef __CUDACC__ -#include <thrust/system/cuda/vector.h> -namespace boost { namespace numeric { namespace odeint { - template< class T , class A > - struct algebra_dispatcher< thrust::cuda::vector< T , A > > - { - typedef thrust_algebra algebra_type; - }; -} } } -#endif // __CUDACC__ - -#endif // THRUST_VERSION >= 100600 - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_ALGEBRA_DISPATCHER_HPP_DEFINED - diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_operations.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_operations.hpp deleted file mode 100644 index ce2d372925..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_operations.hpp +++ /dev/null @@ -1,233 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/thrust/thrust_operations.hpp - - [begin_description] - Operations of thrust zipped iterators. Is the counterpart of the thrust_algebra. - [end_description] - - Copyright 2010-2013 Mario Mulansky - Copyright 2010-2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_HPP_INCLUDED - -namespace boost { -namespace numeric { -namespace odeint { - -#include <thrust/tuple.h> -#include <thrust/iterator/zip_iterator.h> - -/**ToDo extend to scale_sum13 for rk78 */ - -struct thrust_operations -{ - template< class Fac1 = double , class Fac2 = Fac1 > - struct scale_sum2 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - - scale_sum2( const Fac1 alpha1 , const Fac2 alpha2 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { } - - template< class Tuple > - __host__ __device__ - void operator()( Tuple t ) const - { - thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + m_alpha2 * thrust::get<2>(t); - } - }; - - template< class Fac1 = double , class Fac2 = Fac1 > - struct scale_sum_swap2 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - - scale_sum_swap2( const Fac1 alpha1 , const Fac2 alpha2 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) { } - - template< class Tuple > - __host__ __device__ - void operator()( Tuple t ) const - { - typename thrust::tuple_element<0,Tuple>::type tmp = thrust::get<0>(t); - thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + m_alpha2 * thrust::get<2>(t); - thrust::get<1>(t) = tmp; - } - }; - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 > - struct scale_sum3 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - - scale_sum3( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) { } - - template< class Tuple > - __host__ __device__ - void operator()( Tuple t ) const - { - thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + - m_alpha2 * thrust::get<2>(t) + - m_alpha3 * thrust::get<3>(t); - } - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 > - struct scale_sum4 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - - scale_sum4( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , const Fac4 alpha4 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ){ } - - template< class Tuple > - __host__ __device__ - void operator()( Tuple t ) const - { - thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + - m_alpha2 * thrust::get<2>(t) + - m_alpha3 * thrust::get<3>(t) + - m_alpha4 * thrust::get<4>(t); - } - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , - class Fac4 = Fac3 , class Fac5 = Fac4 > - struct scale_sum5 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - - scale_sum5( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , - const Fac4 alpha4 , const Fac5 alpha5 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , - m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { } - - template< class Tuple > - __host__ __device__ - void operator()( Tuple t ) const - { - thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + - m_alpha2 * thrust::get<2>(t) + - m_alpha3 * thrust::get<3>(t) + - m_alpha4 * thrust::get<4>(t) + - m_alpha5 * thrust::get<5>(t); - } - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , - class Fac4 = Fac3 , class Fac5 = Fac4 , class Fac6 = Fac5 > - struct scale_sum6 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - - scale_sum6( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , - const Fac4 alpha4 , const Fac5 alpha5 , const Fac6 alpha6 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , - m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) { } - - template< class Tuple > - __host__ __device__ - void operator()( Tuple t ) const - { - thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + - m_alpha2 * thrust::get<2>(t) + - m_alpha3 * thrust::get<3>(t) + - m_alpha4 * thrust::get<4>(t) + - m_alpha5 * thrust::get<5>(t) + - m_alpha6 * thrust::get<6>(t); - } - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , - class Fac5 = Fac4 , class Fac6 = Fac5 , class Fac7 = Fac6 > - struct scale_sum7 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - const Fac6 m_alpha6; - const Fac7 m_alpha7; - - scale_sum7( const Fac1 alpha1 , const Fac2 alpha2 , const Fac3 alpha3 , - const Fac4 alpha4 , const Fac5 alpha5 , const Fac6 alpha6 , const Fac7 alpha7 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , - m_alpha4( alpha4 ) , m_alpha5( alpha5 ) , m_alpha6( alpha6 ) , m_alpha7( alpha7 ) { } - - template< class Tuple > - __host__ __device__ - void operator()( Tuple t ) const - { - thrust::get<0>(t) = m_alpha1 * thrust::get<1>(t) + - m_alpha2 * thrust::get<2>(t) + - m_alpha3 * thrust::get<3>(t) + - m_alpha4 * thrust::get<4>(t) + - m_alpha5 * thrust::get<5>(t) + - m_alpha6 * thrust::get<6>(t) + - m_alpha7 * thrust::get<7>(t) ; - } - }; - - - - - template< class Fac1 = double > - struct rel_error - { - const Fac1 m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt; - - rel_error( const Fac1 eps_abs , const Fac1 eps_rel , const Fac1 a_x , const Fac1 a_dxdt ) - : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) { } - - - template< class Tuple > - __host__ __device__ - void operator()( Tuple t ) const - { - using std::abs; - thrust::get< 0 >( t ) = abs( thrust::get< 0 >( t ) ) / - ( m_eps_abs + m_eps_rel * ( m_a_x * abs( thrust::get< 1 >( t ) + m_a_dxdt * abs( thrust::get< 2 >( t ) ) ) ) ); - } - - typedef void result_type; - }; - - -}; - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_operations_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_operations_dispatcher.hpp deleted file mode 100644 index e9b3a64234..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_operations_dispatcher.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/thrust/thrust_operations_dispatcher.hpp - - [begin_description] - operations_dispatcher specialization for thrust - [end_description] - - Copyright 2013-2014 Karsten Ahnert - Copyright 2013-2014 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_DISPATCHER_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_DISPATCHER_HPP_DEFINED - -#include <thrust/host_vector.h> -#include <thrust/device_vector.h> - -#include <boost/numeric/odeint/external/thrust/thrust_operations.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -// support for the standard thrust containers - -namespace boost { -namespace numeric { -namespace odeint { - -// specialization for thrust host_vector -template< class T , class A > -struct operations_dispatcher< thrust::host_vector< T , A > > -{ - typedef thrust_operations operations_type; -}; - -// specialization for thrust device_vector -template< class T , class A > -struct operations_dispatcher< thrust::device_vector< T , A > > -{ - typedef thrust_operations operations_type; -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - -// add support for thrust backend vectors, if available - -#include <thrust/version.h> - -#if THRUST_VERSION >= 100600 - -// specialization for thrust cpp vector -#include <thrust/system/cpp/vector.h> -namespace boost { namespace numeric { namespace odeint { - template< class T , class A > - struct operations_dispatcher< thrust::cpp::vector< T , A > > - { - typedef thrust_operations operations_type; - }; -} } } - -// specialization for thrust omp vector -#ifdef _OPENMP -#include <thrust/system/omp/vector.h> -namespace boost { namespace numeric { namespace odeint { - template< class T , class A > - struct operations_dispatcher< thrust::omp::vector< T , A > > - { - typedef thrust_operations operations_type; - }; -} } } -#endif // _OPENMP - -// specialization for thrust tbb vector -#ifdef TBB_VERSION_MAJOR -#include <thrust/system/tbb/vector.h> -namespace boost { namespace numeric { namespace odeint { - template< class T , class A > - struct operations_dispatcher< thrust::tbb::vector< T , A > > - { - typedef thrust_operations operations_type; - }; -} } } -#endif // TBB_VERSION_MAJOR - -// specialization for thrust cuda vector -#ifdef __CUDACC__ -#include <thrust/system/cuda/vector.h> -namespace boost { namespace numeric { namespace odeint { - template< class T , class A > - struct operations_dispatcher< thrust::cuda::vector< T , A > > - { - typedef thrust_operations operations_type; - }; -} } } -#endif // __CUDACC__ - -#endif // THRUST_VERSION >= 100600 - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_OPERATIONS_DISPATCHER_HPP_DEFINED - diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_resize.hpp deleted file mode 100644 index 2f7f7b23b1..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/thrust/thrust_resize.hpp +++ /dev/null @@ -1,185 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/thrust/thrust_resize.hpp - - [begin_description] - Enable resizing for thrusts device and host_vector. - [end_description] - - Copyright 2010-2014 Mario Mulansky - Copyright 2010-2011 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_RESIZE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_RESIZE_HPP_INCLUDED - -#include <boost/range.hpp> - -#include <thrust/device_vector.h> -#include <thrust/host_vector.h> -#include <thrust/distance.h> - -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> -#include <boost/numeric/odeint/util/copy.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -// some macros that define the necessary utilities - -#define ODEINT_THRUST_VECTOR_IS_RESIZEABLE( THRUST_VECTOR ) \ -template< class T , class A > \ -struct is_resizeable< THRUST_VECTOR<T,A> > \ -{ \ - struct type : public boost::true_type { }; \ - const static bool value = type::value; \ -}; \ - -#define ODEINT_TRHUST_VECTOR_RESIZE_IMPL( THRUST_VECTOR ) \ -template< class T, class A > \ -struct resize_impl< THRUST_VECTOR<T,A> , THRUST_VECTOR<T,A> > \ -{ \ - static void resize( THRUST_VECTOR<T,A> &x , \ - const THRUST_VECTOR<T,A> &y ) \ - { \ - x.resize( y.size() ); \ - } \ -}; \ -template< class T, class A, typename Range > \ -struct resize_impl< THRUST_VECTOR<T,A> , Range > \ -{ \ - static void resize( THRUST_VECTOR<T,A> &x , \ - const Range &y ) \ - { \ - x.resize( thrust::distance(boost::begin(y), \ - boost::end(y))); \ - } \ -}; \ - - -#define ODEINT_THRUST_SAME_SIZE_IMPL( THRUST_VECTOR ) \ -template< class T , class A > \ -struct same_size_impl< THRUST_VECTOR<T,A> , THRUST_VECTOR<T,A> > \ -{ \ - static bool same_size( const THRUST_VECTOR<T,A> &x , \ - const THRUST_VECTOR<T,A> &y ) \ - { \ - return x.size() == y.size(); \ - } \ -}; \ -template< class T , class A, typename Range > \ -struct same_size_impl< THRUST_VECTOR<T,A> , Range > \ -{ \ - static bool same_size( const THRUST_VECTOR<T,A> &x , \ - const Range &y ) \ - { \ - return x.size() == thrust::distance(boost::begin(y), \ - boost::end(y)); \ - } \ -}; \ - - -#define ODEINT_THRUST_COPY_IMPL( THRUST_VECTOR ) \ -template< class Container1 , class T , class A > \ -struct copy_impl< Container1 , THRUST_VECTOR<T,A> > \ -{ \ - static void copy( const Container1 &from , THRUST_VECTOR<T,A> &to ) \ - { \ - thrust::copy( boost::begin( from ) , boost::end( from ) , \ - boost::begin( to ) ); \ - } \ -}; \ - \ -template< class T , class A , class Container2 > \ -struct copy_impl< THRUST_VECTOR<T,A> , Container2 > \ -{ \ - static void copy( const THRUST_VECTOR<T,A> &from , Container2 &to ) \ - { \ - thrust::copy( boost::begin( from ) , boost::end( from ) , \ - boost::begin( to ) ); \ - } \ -}; \ - \ -template< class T , class A > \ -struct copy_impl< THRUST_VECTOR<T,A> , THRUST_VECTOR<T,A> > \ -{ \ - static void copy( const THRUST_VECTOR<T,A> &from , \ - THRUST_VECTOR<T,A> &to ) \ - { \ - thrust::copy( boost::begin( from ) , boost::end( from ) , \ - boost::begin( to ) ); \ - } \ -}; \ - -// add support for the standard thrust containers - -ODEINT_THRUST_VECTOR_IS_RESIZEABLE( thrust::device_vector ) -ODEINT_TRHUST_VECTOR_RESIZE_IMPL( thrust::device_vector ) -ODEINT_THRUST_SAME_SIZE_IMPL( thrust::device_vector ) -ODEINT_THRUST_COPY_IMPL( thrust::device_vector ) - - -ODEINT_THRUST_VECTOR_IS_RESIZEABLE( thrust::host_vector ) -ODEINT_TRHUST_VECTOR_RESIZE_IMPL( thrust::host_vector ) -ODEINT_THRUST_SAME_SIZE_IMPL( thrust::host_vector ) -ODEINT_THRUST_COPY_IMPL( thrust::host_vector ) - - -} // odeint -} // numeric -} // boost - -// add support for thrust backend vectors, if available - -#include <thrust/version.h> - -#if THRUST_VERSION >= 100600 - -#include <thrust/system/cpp/vector.h> -namespace boost { namespace numeric { namespace odeint { - ODEINT_THRUST_VECTOR_IS_RESIZEABLE( thrust::cpp::vector ) - ODEINT_TRHUST_VECTOR_RESIZE_IMPL( thrust::cpp::vector ) - ODEINT_THRUST_SAME_SIZE_IMPL( thrust::cpp::vector ) - ODEINT_THRUST_COPY_IMPL( thrust::cpp::vector ) -} } } - -#ifdef _OPENMP -#include <thrust/system/omp/vector.h> -namespace boost { namespace numeric { namespace odeint { - ODEINT_THRUST_VECTOR_IS_RESIZEABLE( thrust::omp::vector ) - ODEINT_TRHUST_VECTOR_RESIZE_IMPL( thrust::omp::vector ) - ODEINT_THRUST_SAME_SIZE_IMPL( thrust::omp::vector ) - ODEINT_THRUST_COPY_IMPL( thrust::omp::vector ) -} } } -#endif // _OPENMP - -#ifdef TBB_VERSION_MAJOR -#include <thrust/system/tbb/vector.h> -namespace boost { namespace numeric { namespace odeint { - ODEINT_THRUST_VECTOR_IS_RESIZEABLE( thrust::tbb::vector ) - ODEINT_TRHUST_VECTOR_RESIZE_IMPL( thrust::tbb::vector ) - ODEINT_THRUST_SAME_SIZE_IMPL( thrust::tbb::vector ) - ODEINT_THRUST_COPY_IMPL( thrust::tbb::vector ) -} } } -#endif // TBB_VERSION_MAJOR - -#ifdef __CUDACC__ -#include <thrust/system/cuda/vector.h> -namespace boost { namespace numeric { namespace odeint { - ODEINT_THRUST_VECTOR_IS_RESIZEABLE( thrust::cuda::vector ) - ODEINT_TRHUST_VECTOR_RESIZE_IMPL( thrust::cuda::vector ) - ODEINT_THRUST_SAME_SIZE_IMPL( thrust::cuda::vector ) - ODEINT_THRUST_COPY_IMPL( thrust::cuda::vector ) -} } } -#endif // __CUDACC__ - -#endif // THRUST_VERSION >= 100600 - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_THRUST_THRUST_RESIZE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl.hpp deleted file mode 100644 index 0a99e27c8a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl.hpp +++ /dev/null @@ -1,28 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/vexcl/vexcl.hpp - - [begin_description] - includes all headers required for using vexcl in odeint - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_HPP_DEFINED - -#include <boost/numeric/odeint/external/vexcl/vexcl_algebra_dispatcher.hpp> -#include <boost/numeric/odeint/external/vexcl/vexcl_resize.hpp> -#include <boost/numeric/odeint/external/vexcl/vexcl_same_instance.hpp> -#include <boost/numeric/odeint/external/vexcl/vexcl_norm_inf.hpp> -#include <boost/numeric/odeint/external/vexcl/vexcl_abs.hpp> -#include <boost/numeric/odeint/external/vexcl/vexcl_copy.hpp> - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_abs.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_abs.hpp deleted file mode 100644 index c5e5c73329..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_abs.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/vexcl/vexcl_abs.hpp - - [begin_description] - abs() specialization for vexcl - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED - -#include <vexcl/vector.hpp> -#include <vexcl/multivector.hpp> -#include <vexcl/operations.hpp> - -namespace vex { - -template <typename T, size_t N> -typename std::enable_if< - std::is_integral<T>::value, - typename boost::proto::result_of::make_expr< - boost::proto::tag::function, - abs_func, - const vex::multivector<T, N>& - >::type const ->::type -abs(const multivector<T, N> &arg) { - return boost::proto::make_expr<boost::proto::tag::function>( - abs_func(), - boost::ref(arg) - ); -} - -template <typename T, size_t N> -typename std::enable_if< - !std::is_integral<T>::value, - typename boost::proto::result_of::make_expr< - boost::proto::tag::function, - fabs_func, - const vex::multivector<T, N>& - >::type const ->::type -abs(const multivector<T, N> &arg) { - return boost::proto::make_expr<boost::proto::tag::function>( - fabs_func(), - boost::ref(arg) - ); -} - -} // namespace vex - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ABS_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_algebra_dispatcher.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_algebra_dispatcher.hpp deleted file mode 100644 index 95111376de..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_algebra_dispatcher.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/vexcl/vexcl_algebra_dispatcher.hpp - - [begin_description] - algebra_dispatcher specialization for vexcl - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ALGEBRA_DISPATCHER_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ALGEBRA_DISPATCHER_HPP_DEFINED - -#include <vexcl/vector.hpp> -#include <vexcl/multivector.hpp> - -#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -// specialization for vexcl vector -template< typename T > -struct algebra_dispatcher< vex::vector< T > > -{ - typedef vector_space_algebra algebra_type; -}; - -// specialization for vexcl multivector -template< typename T , size_t N > -struct algebra_dispatcher< vex::multivector< T , N > > -{ - typedef vector_space_algebra algebra_type; -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_ALGEBRA_DISPATCHER_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_copy.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_copy.hpp deleted file mode 100644 index 6a5afac9fa..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_copy.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/vexcl/vexcl_copy.hpp - - [begin_description] - copy_impl specializations for vexcl - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_COPY_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_COPY_HPP_INCLUDED - -#include <vexcl/vector.hpp> -#include <vexcl/multivector.hpp> - -#include <boost/numeric/odeint/util/copy.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< typename T1, typename T2 > -struct copy_impl< vex::vector<T1>, vex::vector<T2> > -{ - static void copy( const vex::vector<T1> &from , vex::vector<T2> &to ) - { - to = from; - } -}; - -template< typename T1, typename T2, size_t N > -struct copy_impl< vex::multivector<T1, N>, vex::multivector<T2, N> > -{ - static void copy( const vex::multivector<T1, N> &from , vex::multivector<T2, N> &to ) - { - to = from; - } -}; - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_COPY_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_norm_inf.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_norm_inf.hpp deleted file mode 100644 index a0a62afc04..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_norm_inf.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/vexcl/vexcl_norm_inf.hpp - - [begin_description] - vector_space_norm_inf specialization for vexcl - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_NORM_INF_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_NORM_INF_HPP_DEFINED - -#include <map> -#include <algorithm> - -#include <vexcl/vector.hpp> -#include <vexcl/multivector.hpp> -#include <vexcl/reductor.hpp> - -#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -// specialization for vexcl vector -template <typename T> -struct vector_space_norm_inf< vex::vector<T> > { - typedef T result_type; - - T operator()( const vex::vector<T> &x ) const { - const auto &max = vex::get_reductor<T, vex::MAX>(x.queue_list()); - - return max( fabs(x) ); - } -}; - -// specialization for vexcl multivector -template <typename T, size_t N> -struct vector_space_norm_inf< vex::multivector<T, N> > { - typedef T result_type; - - T operator()( const vex::multivector<T, N> &x ) const { - const auto &max = vex::get_reductor<T, vex::MAX>(x.queue_list()); - - // Reducing a multivector results in std::array<T, N>: - auto m = max( fabs(x) ); - - // We will need to reduce it even further: - return *std::max_element(m.begin(), m.end()); - } -}; - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_NORM_INF_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_resize.hpp deleted file mode 100644 index 2d6291edfe..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_resize.hpp +++ /dev/null @@ -1,94 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/vexcl/vexcl_resize.hpp - - [begin_description] - Enable resizing for vexcl vector and multivector. - [end_description] - - Copyright 2012 Karsten Ahnert - Copyright 2012 Mario Mulansky - Copyright 2012 Denis Demidov - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED - -#include <vexcl/vector.hpp> -#include <vexcl/multivector.hpp> - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - - -/* - * specializations for vex::vector< T > - */ -template< typename T > -struct is_resizeable< vex::vector< T > > : boost::true_type { }; - -template< typename T > -struct resize_impl< vex::vector< T > , vex::vector< T > > -{ - static void resize( vex::vector< T > &x1 , const vex::vector< T > &x2 ) - { - x1.resize( x2.queue_list() , x2.size() ); - } -}; - -template< typename T > -struct same_size_impl< vex::vector< T > , vex::vector< T > > -{ - static bool same_size( const vex::vector< T > &x1 , const vex::vector< T > &x2 ) - { - return x1.size() == x2.size(); - } -}; - - - - - -/* - * specializations for vex::multivector< T > - */ -template< typename T , size_t N > -struct is_resizeable< vex::multivector< T , N > > : boost::true_type { }; - -template< typename T , size_t N > -struct resize_impl< vex::multivector< T , N > , vex::multivector< T , N > > -{ - static void resize( vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 ) - { - x1.resize( x2.queue_list() , x2.size() ); - } -}; - -template< typename T , size_t N > -struct same_size_impl< vex::multivector< T , N > , vex::multivector< T , N > > -{ - static bool same_size( const vex::multivector< T , N > &x1 , const vex::multivector< T , N > &x2 ) - { - return x1.size() == x2.size(); - } -}; - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_RESIZE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_same_instance.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_same_instance.hpp deleted file mode 100644 index f5a7378cd8..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/vexcl/vexcl_same_instance.hpp +++ /dev/null @@ -1,58 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/vexcl/vexcl_same_instance.hpp - - [begin_description] - Check if two VexCL containers are the same instance. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED - -#include <vexcl/vector.hpp> -#include <vexcl/multivector.hpp> - -#include <boost/numeric/odeint/util/same_instance.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template <typename T> -struct same_instance_impl< vex::vector<T> , vex::vector<T> > -{ - static bool same_instance( const vex::vector<T> &x1 , const vex::vector<T> &x2 ) - { - return - static_cast<const vex::vector<T>*>(&x1) == - static_cast<const vex::vector<T>*>(&x2); - } -}; - -template <typename T, size_t N> -struct same_instance_impl< vex::multivector<T, N> , vex::multivector<T, N> > -{ - static bool same_instance( const vex::multivector<T, N> &x1 , const vex::multivector<T, N> &x2 ) - { - return - static_cast<const vex::multivector<T, N>*>(&x1) == - static_cast<const vex::multivector<T, N>*>(&x2); - } -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VEXCL_VEXCL_SAME_INSTANCE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/viennacl/viennacl_operations.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/viennacl/viennacl_operations.hpp deleted file mode 100644 index 662c36a1ed..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/viennacl/viennacl_operations.hpp +++ /dev/null @@ -1,226 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/viennacl_operations.hpp - - [begin_description] - ViennaCL operations. - [end_description] - - Copyright 2012 Denis Demidov - Copyright 2012 Karsten Ahnert - Copyright 2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED - -#include <viennacl/vector.hpp> - -#ifdef VIENNACL_WITH_OPENCL -# include <viennacl/generator/custom_operation.hpp> -#endif - -namespace boost { -namespace numeric { -namespace odeint { - - -#ifdef VIENNACL_WITH_OPENCL -struct viennacl_operations -{ - - template< class Fac1 = double , class Fac2 = Fac1 > - struct scale_sum2 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - - scale_sum2( Fac1 alpha1 , Fac2 alpha2 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) - { } - - template< class T1 , class T2 , class T3 > - void operator()( viennacl::vector<T1> &v1 , - const viennacl::vector<T2> &v2 , - const viennacl::vector<T3> &v3 - ) const - { - using namespace viennacl; - - static generator::symbolic_vector <0, T1> sym_v1; - static generator::symbolic_vector <1, T2> sym_v2; - static generator::symbolic_vector <2, T3> sym_v3; - static generator::cpu_symbolic_scalar<3, Fac1> sym_a1; - static generator::cpu_symbolic_scalar<4, Fac2> sym_a2; - - static generator::custom_operation op( - sym_v1 = sym_a1 * sym_v2 - + sym_a2 * sym_v3, - "scale_sum2" - ); - - ocl::enqueue( op(v1, v2, v3, m_alpha1, m_alpha2) ); - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 > - struct scale_sum3 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - - scale_sum3( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) - { } - - template< class T1 , class T2 , class T3 , class T4 > - void operator()( viennacl::vector<T1> &v1 , - const viennacl::vector<T2> &v2 , - const viennacl::vector<T3> &v3 , - const viennacl::vector<T4> &v4 - ) const - { - using namespace viennacl; - - static generator::symbolic_vector <0, T1> sym_v1; - static generator::symbolic_vector <1, T2> sym_v2; - static generator::symbolic_vector <2, T3> sym_v3; - static generator::symbolic_vector <3, T4> sym_v4; - static generator::cpu_symbolic_scalar<4, Fac1> sym_a1; - static generator::cpu_symbolic_scalar<5, Fac2> sym_a2; - static generator::cpu_symbolic_scalar<6, Fac3> sym_a3; - - static generator::custom_operation op( - sym_v1 = sym_a1 * sym_v2 - + sym_a2 * sym_v3 - + sym_a3 * sym_v4, - "scale_sum3" - ); - - ocl::enqueue( op(v1, v2, v3, v4, m_alpha1, m_alpha2, m_alpha3) ); - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 > - struct scale_sum4 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - - scale_sum4( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 > - void operator()( viennacl::vector<T1> &v1 , - const viennacl::vector<T2> &v2 , - const viennacl::vector<T3> &v3 , - const viennacl::vector<T4> &v4 , - const viennacl::vector<T5> &v5 - ) const - { - using namespace viennacl; - - static generator::symbolic_vector <0, T1> sym_v1; - static generator::symbolic_vector <1, T2> sym_v2; - static generator::symbolic_vector <2, T3> sym_v3; - static generator::symbolic_vector <3, T4> sym_v4; - static generator::symbolic_vector <4, T5> sym_v5; - static generator::cpu_symbolic_scalar<5, Fac1> sym_a1; - static generator::cpu_symbolic_scalar<6, Fac2> sym_a2; - static generator::cpu_symbolic_scalar<7, Fac3> sym_a3; - static generator::cpu_symbolic_scalar<8, Fac4> sym_a4; - - static generator::custom_operation op( - sym_v1 = sym_a1 * sym_v2 - + sym_a2 * sym_v3 - + sym_a3 * sym_v4 - + sym_a4 * sym_v5, - "scale_sum4" - ); - - ocl::enqueue( op(v1, v2, v3, v4, v5, - m_alpha1, m_alpha2, m_alpha3, m_alpha4) ); - } - - typedef void result_type; - }; - - - template< class Fac1 = double , class Fac2 = Fac1 , class Fac3 = Fac2 , class Fac4 = Fac3 , class Fac5 = Fac4 > - struct scale_sum5 - { - const Fac1 m_alpha1; - const Fac2 m_alpha2; - const Fac3 m_alpha3; - const Fac4 m_alpha4; - const Fac5 m_alpha5; - - scale_sum5( Fac1 alpha1 , Fac2 alpha2 , Fac3 alpha3 , Fac4 alpha4 , Fac5 alpha5 ) - : m_alpha1( alpha1 ) , m_alpha2( alpha2 ) , m_alpha3( alpha3 ) , m_alpha4( alpha4 ) , m_alpha5( alpha5 ) { } - - template< class T1 , class T2 , class T3 , class T4 , class T5 , class T6 > - void operator()( viennacl::vector<T1> &v1 , - const viennacl::vector<T2> &v2 , - const viennacl::vector<T3> &v3 , - const viennacl::vector<T4> &v4 , - const viennacl::vector<T5> &v5 , - const viennacl::vector<T6> &v6 - ) const - { - using namespace viennacl; - - static generator::symbolic_vector < 0, T1> sym_v1; - static generator::symbolic_vector < 1, T2> sym_v2; - static generator::symbolic_vector < 2, T3> sym_v3; - static generator::symbolic_vector < 3, T4> sym_v4; - static generator::symbolic_vector < 4, T5> sym_v5; - static generator::symbolic_vector < 5, T6> sym_v6; - static generator::cpu_symbolic_scalar< 6, Fac1> sym_a1; - static generator::cpu_symbolic_scalar< 7, Fac2> sym_a2; - static generator::cpu_symbolic_scalar< 8, Fac3> sym_a3; - static generator::cpu_symbolic_scalar< 9, Fac4> sym_a4; - static generator::cpu_symbolic_scalar<10, Fac5> sym_a5; - - static generator::custom_operation op( - sym_v1 = sym_a1 * sym_v2 - + sym_a2 * sym_v3 - + sym_a3 * sym_v4 - + sym_a4 * sym_v5 - + sym_a5 * sym_v6, - "scale_sum5" - ); - - ocl::enqueue( op(v1, v2, v3, v4, v5, v6, - m_alpha1, m_alpha2, m_alpha3, m_alpha4, m_alpha5) ); - } - - typedef void result_type; - }; - - -}; -#else -struct viennacl_operations : public default_operations {}; -#endif - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_OPERATIONS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/external/viennacl/viennacl_resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/external/viennacl/viennacl_resize.hpp deleted file mode 100644 index d3240705be..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/external/viennacl/viennacl_resize.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/external/viennacl/viennacl_resize.hpp - - [begin_description] - Enable resizing for viennacl vector. - [end_description] - - Copyright 2012 Denis Demidov - Copyright 2012 Karsten Ahnert - Copyright 2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED - -#include <viennacl/vector.hpp> - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - - -/* - * specializations for viennacl::vector< T > - */ -template< typename T > -struct is_resizeable< viennacl::vector< T > > : boost::true_type { }; - -template< typename T > -struct resize_impl< viennacl::vector< T > , viennacl::vector< T > > -{ - static void resize( viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 ) - { - x1.resize( x2.size() , false ); - } -}; - -template< typename T > -struct same_size_impl< viennacl::vector< T > , viennacl::vector< T > > -{ - static bool same_size( const viennacl::vector< T > &x1 , const viennacl::vector< T > &x2 ) - { - return x1.size() == x2.size(); - } -}; - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_EXTERNAL_VIENNACL_VIENNACL_RESIZE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/check_adapter.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/check_adapter.hpp deleted file mode 100644 index 3d3ebd6c88..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/check_adapter.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/check_adapter.hpp - - [begin_description] - Adapters to add checking facility to stepper and observer - [end_description] - - Copyright 2015 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_CHECK_ADAPTER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_CHECK_ADAPTER_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -template<class Stepper, class Checker, - class StepperCategory = typename base_tag<typename Stepper::stepper_category>::type> -class checked_stepper; - - -/** - * \brief Adapter to combine basic stepper and checker. - */ -template<class Stepper, class Checker> -class checked_stepper<Stepper, Checker, stepper_tag> -{ - -public: - typedef Stepper stepper_type; - typedef Checker checker_type; - // forward stepper typedefs - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::time_type time_type; - -private: - stepper_type &m_stepper; - checker_type &m_checker; - -public: - /** - * \brief Construct the checked_stepper. - */ - checked_stepper(stepper_type &stepper, checker_type &checker) - : m_stepper(stepper), m_checker(checker) { } - - /** - * \brief forward of the do_step method - */ - template<class System, class StateInOut> - void do_step(System system, StateInOut &state, const time_type t, const time_type dt) - { - // do the step - m_stepper.do_step(system, state, t, dt); - // call the checker - m_checker(); - } -}; - - -/** - * \brief Adapter to combine controlled stepper and checker. - */ -template<class ControlledStepper, class Checker> -class checked_stepper<ControlledStepper, Checker, controlled_stepper_tag> -{ - -public: - typedef ControlledStepper stepper_type; - typedef Checker checker_type; - // forward stepper typedefs - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::time_type time_type; - -private: - stepper_type &m_stepper; - checker_type &m_checker; - -public: - /** - * \brief Construct the checked_stepper. - */ - checked_stepper(stepper_type &stepper, checker_type &checker) - : m_stepper(stepper), m_checker(checker) { } - - /** - * \brief forward of the do_step method - */ - template< class System , class StateInOut > - controlled_step_result try_step( System system , StateInOut &state , time_type &t , time_type &dt ) - { - // do the step - if( m_stepper.try_step(system, state, t, dt) == success ) - { - // call the checker if step was successful - m_checker(); - return success; - } else - { - // step failed -> return fail - return fail; - } - } -}; - - -/** - * \brief Adapter to combine dense out stepper and checker. - */ -template<class DenseOutStepper, class Checker> -class checked_stepper<DenseOutStepper, Checker, dense_output_stepper_tag> -{ - -public: - typedef DenseOutStepper stepper_type; - typedef Checker checker_type; - // forward stepper typedefs - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::time_type time_type; - -private: - stepper_type &m_stepper; - checker_type &m_checker; - -public: - /** - * \brief Construct the checked_stepper. - */ - checked_stepper(stepper_type &stepper, checker_type &checker) - : m_stepper(stepper), m_checker(checker) { } - - - template< class System > - std::pair< time_type , time_type > do_step( System system ) - { - m_checker(); - return m_stepper.do_step(system); - } - - /* provide the remaining dense out stepper interface */ - template< class StateType > - void initialize( const StateType &x0 , time_type t0 , time_type dt0 ) - { m_stepper.initialize(x0, t0, dt0); } - - - template< class StateOut > - void calc_state( time_type t , StateOut &x ) const - { m_stepper.calc_state(t, x); } - - template< class StateOut > - void calc_state( time_type t , const StateOut &x ) const - { m_stepper.calc_state(t, x); } - - const state_type& current_state( void ) const - { return m_stepper.current_state(); } - - time_type current_time( void ) const - { return m_stepper.current_time(); } - - const state_type& previous_state( void ) const - { return m_stepper.previous_state(); } - - time_type previous_time( void ) const - { return m_stepper.previous_time(); } - - time_type current_time_step( void ) const - { return m_stepper.current_time_step(); } - -}; - - -/** - * \brief Adapter to combine observer and checker. - */ -template<class Observer, class Checker> -class checked_observer -{ -public: - typedef Observer observer_type; - typedef Checker checker_type; - -private: - observer_type &m_observer; - checker_type &m_checker; - -public: - checked_observer(observer_type &observer, checker_type &checker) - : m_observer(observer), m_checker(checker) - {} - - template< class State , class Time > - void operator()(const State& state, Time t) const - { - // call the observer - m_observer(state, t); - // reset the checker - m_checker.reset(); - } -}; - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif
\ No newline at end of file diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/functors.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/functors.hpp deleted file mode 100644 index b239217ac4..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/functors.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/functors.hpp - - [begin_description] - some functors for the iterator based integrate routines - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED - -#include <utility> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - - -template< class Observer > -struct obs_caller { - - size_t &m_n; - Observer m_obs; - - obs_caller( size_t &m , Observer &obs ) : m_n(m) , m_obs( obs ) {} - - template< class State , class Time > - void operator()( std::pair< const State & , const Time & > x ) - { - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - observer_type &obs = m_obs; - obs( x.first , x.second ); - m_n++; - } -}; - -template< class Observer , class Time > -struct obs_caller_time { - - Time &m_t; - Observer m_obs; - - obs_caller_time( Time &t , Observer &obs ) : m_t(t) , m_obs( obs ) {} - - template< class State > - void operator()( std::pair< const State & , const Time & > x ) - { - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - observer_type &obs = m_obs; - obs( x.first , x.second ); - m_t = x.second; - } -}; - -} // namespace detail -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp deleted file mode 100644 index 7516d44087..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp +++ /dev/null @@ -1,161 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp - - [begin_description] - Default Integrate adaptive implementation. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2015 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED - -#include <stdexcept> - -#include <boost/throw_exception.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/integrate/max_step_checker.hpp> -#include <boost/numeric/odeint/integrate/detail/integrate_const.hpp> -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/util/copy.hpp> - -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - - -#include <iostream> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -// forward declaration -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , stepper_tag ); - -/* - * integrate_adaptive for simple stepper is basically an integrate_const + some last step - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , stepper_tag -) -{ - size_t steps = detail::integrate_const( stepper , system , start_state , start_time , - end_time , dt , observer , stepper_tag() ); - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - Time end = start_time + dt*steps; - if( less_with_sign( end , end_time , dt ) ) - { //make a last step to end exactly at end_time - st.do_step( system , start_state , end , end_time - end ); - steps++; - obs( start_state , end_time ); - } - return steps; -} - - -/* - * integrate adaptive for controlled stepper - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time &start_time , Time end_time , Time &dt , - Observer observer , controlled_stepper_tag -) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - failed_step_checker fail_checker; // to throw a runtime_error if step size adjustment fails - size_t count = 0; - while( less_with_sign( start_time , end_time , dt ) ) - { - obs( start_state , start_time ); - if( less_with_sign( end_time , static_cast<Time>(start_time + dt) , dt ) ) - { - dt = end_time - start_time; - } - - controlled_step_result res; - do - { - res = st.try_step( system , start_state , start_time , dt ); - fail_checker(); // check number of failed steps - } - while( res == fail ); - fail_checker.reset(); // if we reach here, the step was successful -> reset fail checker - - ++count; - } - obs( start_state , start_time ); - return count; -} - - -/* - * integrate adaptive for dense output steppers - * - * step size control is used if the stepper supports it - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , dense_output_stepper_tag ) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - size_t count = 0; - st.initialize( start_state , start_time , dt ); - - while( less_with_sign( st.current_time() , end_time , st.current_time_step() ) ) - { - while( less_eq_with_sign( static_cast<Time>(st.current_time() + st.current_time_step()) , - end_time , - st.current_time_step() ) ) - { //make sure we don't go beyond the end_time - obs( st.current_state() , st.current_time() ); - st.do_step( system ); - ++count; - } - // calculate time step to arrive exactly at end time - st.initialize( st.current_state() , st.current_time() , static_cast<Time>(end_time - st.current_time()) ); - } - obs( st.current_state() , st.current_time() ); - // overwrite start_state with the final point - boost::numeric::odeint::copy( st.current_state() , start_state ); - return count; -} - - - - -} // namespace detail -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_const.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_const.hpp deleted file mode 100644 index 7a86b32fa6..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_const.hpp +++ /dev/null @@ -1,167 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/integrate_const.hpp - - [begin_description] - integrate const implementation - [end_description] - - Copyright 2012-2015 Mario Mulansky - Copyright 2012 Christoph Koke - Copyright 2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_INCLUDED - -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> -#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp> - -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -// forward declaration -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time &start_time , Time end_time , Time &dt , - Observer observer , controlled_stepper_tag -); - - -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , stepper_tag -) -{ - - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - Time time = start_time; - int step = 0; - // cast time+dt explicitely in case of expression templates (e.g. multiprecision) - while( less_eq_with_sign( static_cast<Time>(time+dt) , end_time , dt ) ) - { - obs( start_state , time ); - st.do_step( system , start_state , time , dt ); - // direct computation of the time avoids error propagation happening when using time += dt - // we need clumsy type analysis to get boost units working here - ++step; - time = start_time + static_cast< typename unit_value_type<Time>::type >(step) * dt; - } - obs( start_state , time ); - - return step; -} - - - -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , controlled_stepper_tag -) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - - Time time = start_time; - const Time time_step = dt; - int real_steps = 0; - int step = 0; - - while( less_eq_with_sign( static_cast<Time>(time+time_step) , end_time , dt ) ) - { - obs( start_state , time ); - // integrate_adaptive_checked uses the given checker to throw if an overflow occurs - real_steps += detail::integrate_adaptive(stepper, system, start_state, time, - static_cast<Time>(time + time_step), dt, - null_observer(), controlled_stepper_tag()); - // direct computation of the time avoids error propagation happening when using time += dt - // we need clumsy type analysis to get boost units working here - step++; - time = start_time + static_cast< typename unit_value_type<Time>::type >(step) * time_step; - } - obs( start_state , time ); - - return real_steps; -} - - -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , dense_output_stepper_tag -) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - Time time = start_time; - - st.initialize( start_state , time , dt ); - obs( start_state , time ); - time += dt; - - int obs_step( 1 ); - int real_step( 0 ); - - while( less_eq_with_sign( static_cast<Time>(time+dt) , end_time , dt ) ) - { - while( less_eq_with_sign( time , st.current_time() , dt ) ) - { - st.calc_state( time , start_state ); - obs( start_state , time ); - ++obs_step; - // direct computation of the time avoids error propagation happening when using time += dt - // we need clumsy type analysis to get boost units working here - time = start_time + static_cast< typename unit_value_type<Time>::type >(obs_step) * dt; - } - // we have not reached the end, do another real step - if( less_with_sign( static_cast<Time>(st.current_time()+st.current_time_step()) , - end_time , - st.current_time_step() ) ) - { - while( less_eq_with_sign( st.current_time() , time , dt ) ) - { - st.do_step( system ); - ++real_step; - } - } - else if( less_with_sign( st.current_time() , end_time , st.current_time_step() ) ) - { // do the last step ending exactly on the end point - st.initialize( st.current_state() , st.current_time() , end_time - st.current_time() ); - st.do_step( system ); - ++real_step; - } - - } - // last observation, if we are still in observation interval - // might happen due to finite precision problems when computing the the time - if( less_eq_with_sign( time , end_time , dt ) ) - { - st.calc_state( time , start_state ); - obs( start_state , time ); - } - - return real_step; -} - - -} } } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp deleted file mode 100644 index 2ef490d592..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp +++ /dev/null @@ -1,161 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp - - [begin_description] - integrate steps implementation - [end_description] - - Copyright 2012-2015 Mario Mulansky - Copyright 2012 Christoph Koke - Copyright 2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED - -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> - -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -// forward declaration -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive_checked( - Stepper stepper , System system , State &start_state , - Time &start_time , Time end_time , Time &dt , - Observer observer, controlled_stepper_tag -); - - -/* basic version */ -template< class Stepper , class System , class State , class Time , class Observer> -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer , stepper_tag ) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - Time time = start_time; - - for( size_t step = 0; step < num_of_steps ; ++step ) - { - obs( start_state , time ); - st.do_step( system , start_state , time , dt ); - // direct computation of the time avoids error propagation happening when using time += dt - // we need clumsy type analysis to get boost units working here - time = start_time + static_cast< typename unit_value_type<Time>::type >( step+1 ) * dt; - } - obs( start_state , time ); - - return time; -} - - -/* controlled version */ -template< class Stepper , class System , class State , class Time , class Observer > -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer , controlled_stepper_tag ) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - - Time time = start_time; - Time time_step = dt; - - for( size_t step = 0; step < num_of_steps ; ++step ) - { - obs( start_state , time ); - // integrate_adaptive_checked uses the given checker to throw if an overflow occurs - detail::integrate_adaptive(stepper, system, start_state, time, static_cast<Time>(time + time_step), dt, - null_observer(), controlled_stepper_tag()); - // direct computation of the time avoids error propagation happening when using time += dt - // we need clumsy type analysis to get boost units working here - time = start_time + static_cast< typename unit_value_type<Time>::type >(step+1) * time_step; - } - obs( start_state , time ); - - return time; -} - - -/* dense output version */ -template< class Stepper , class System , class State , class Time , class Observer > -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer , dense_output_stepper_tag ) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - Time time = start_time; - const Time end_time = start_time + static_cast< typename unit_value_type<Time>::type >(num_of_steps) * dt; - - st.initialize( start_state , time , dt ); - - size_t step = 0; - - while( step < num_of_steps ) - { - while( less_with_sign( time , st.current_time() , st.current_time_step() ) ) - { - st.calc_state( time , start_state ); - obs( start_state , time ); - ++step; - // direct computation of the time avoids error propagation happening when using time += dt - // we need clumsy type analysis to get boost units working here - time = start_time + static_cast< typename unit_value_type<Time>::type >(step) * dt; - } - - // we have not reached the end, do another real step - if( less_with_sign( static_cast<Time>(st.current_time()+st.current_time_step()) , - end_time , - st.current_time_step() ) ) - { - st.do_step( system ); - } - else if( less_with_sign( st.current_time() , end_time , st.current_time_step() ) ) - { // do the last step ending exactly on the end point - st.initialize( st.current_state() , st.current_time() , static_cast<Time>(end_time - st.current_time()) ); - st.do_step( system ); - } - } - - // make sure we really end exactly where we should end - while( st.current_time() < end_time ) - { - if( less_with_sign( end_time , - static_cast<Time>(st.current_time()+st.current_time_step()) , - st.current_time_step() ) ) - st.initialize( st.current_state() , st.current_time() , static_cast<Time>(end_time - st.current_time()) ); - st.do_step( system ); - } - - // observation at final point - obs( st.current_state() , end_time ); - - return time; -} - - -} -} -} -} - -#endif /* BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED */ diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_times.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_times.hpp deleted file mode 100644 index 2e27990412..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/detail/integrate_times.hpp +++ /dev/null @@ -1,179 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/integrate_times.hpp - - [begin_description] - Default integrate times implementation. - [end_description] - - Copyright 2011-2015 Mario Mulansky - Copyright 2012 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_TIMES_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_TIMES_HPP_INCLUDED - -#include <stdexcept> - -#include <boost/config.hpp> -#include <boost/throw_exception.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> -#include <boost/numeric/odeint/integrate/max_step_checker.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - - - -/* - * integrate_times for simple stepper - */ -template<class Stepper, class System, class State, class TimeIterator, class Time, class Observer> -size_t integrate_times( - Stepper stepper , System system , State &start_state , - TimeIterator start_time , TimeIterator end_time , Time dt , - Observer observer , stepper_tag -) -{ - typedef typename odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - - stepper_type &st = stepper; - observer_type &obs = observer; - typedef typename unit_value_type<Time>::type time_type; - - size_t steps = 0; - Time current_dt = dt; - while( true ) - { - Time current_time = *start_time++; - obs( start_state , current_time ); - if( start_time == end_time ) - break; - while( less_with_sign( current_time , static_cast<time_type>(*start_time) , current_dt ) ) - { - current_dt = min_abs( dt , *start_time - current_time ); - st.do_step( system , start_state , current_time , current_dt ); - current_time += current_dt; - steps++; - } - } - return steps; -} - -/* - * integrate_times for controlled stepper - */ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - TimeIterator start_time , TimeIterator end_time , Time dt , - Observer observer , controlled_stepper_tag -) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - typedef typename unit_value_type<Time>::type time_type; - - failed_step_checker fail_checker; // to throw a runtime_error if step size adjustment fails - size_t steps = 0; - while( true ) - { - Time current_time = *start_time++; - obs( start_state , current_time ); - if( start_time == end_time ) - break; - while( less_with_sign( current_time , static_cast<time_type>(*start_time) , dt ) ) - { - // adjust stepsize to end up exactly at the observation point - Time current_dt = min_abs( dt , *start_time - current_time ); - if( st.try_step( system , start_state , current_time , current_dt ) == success ) - { - ++steps; - // successful step -> reset the fail counter, see #173 - fail_checker.reset(); - // continue with the original step size if dt was reduced due to observation - dt = max_abs( dt , current_dt ); - } - else - { - fail_checker(); // check for possible overflow of failed steps in step size adjustment - dt = current_dt; - } - } - } - return steps; -} - -/* - * integrate_times for dense output stepper - */ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - TimeIterator start_time , TimeIterator end_time , Time dt , - Observer observer , dense_output_stepper_tag -) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - typedef typename unit_value_type<Time>::type time_type; - - if( start_time == end_time ) - return 0; - - TimeIterator last_time_iterator = end_time; - --last_time_iterator; - Time last_time_point = static_cast<time_type>(*last_time_iterator); - - st.initialize( start_state , *start_time , dt ); - obs( start_state , *start_time++ ); - - size_t count = 0; - while( start_time != end_time ) - { - while( ( start_time != end_time ) && less_eq_with_sign( static_cast<time_type>(*start_time) , st.current_time() , st.current_time_step() ) ) - { - st.calc_state( *start_time , start_state ); - obs( start_state , *start_time ); - start_time++; - } - - // we have not reached the end, do another real step - if( less_eq_with_sign( st.current_time() + st.current_time_step() , - last_time_point , - st.current_time_step() ) ) - { - st.do_step( system ); - ++count; - } - else if( start_time != end_time ) - { // do the last step ending exactly on the end point - st.initialize( st.current_state() , st.current_time() , last_time_point - st.current_time() ); - st.do_step( system ); - ++count; - } - } - return count; -} - - -} // namespace detail -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate.hpp deleted file mode 100644 index 446656b58a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate.hpp - - [begin_description] - Convenience methods which choose the stepper for the current ODE. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED - -#include <boost/utility/enable_if.hpp> - -#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp> -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/integrate/null_observer.hpp> -#include <boost/numeric/odeint/integrate/integrate_adaptive.hpp> - -// for has_value_type trait -#include <boost/numeric/odeint/algebra/detail/extract_value_type.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * ToDo : - * - * determine type of dxdt for units - * - */ -template< class System , class State , class Time , class Observer > -typename boost::enable_if< typename has_value_type<State>::type , size_t >::type -integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) -{ - typedef controlled_runge_kutta< runge_kutta_dopri5< State , typename State::value_type , State , Time > > stepper_type; - return integrate_adaptive( stepper_type() , system , start_state , start_time , end_time , dt , observer ); -} - -template< class Value , class System , class State , class Time , class Observer > -size_t -integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) -{ - typedef controlled_runge_kutta< runge_kutta_dopri5< State , Value , State , Time > > stepper_type; - return integrate_adaptive( stepper_type() , system , start_state , start_time , end_time , dt , observer ); -} - - - - -/* - * the two overloads are needed in order to solve the forwarding problem - */ -template< class System , class State , class Time > -size_t integrate( System system , State &start_state , Time start_time , Time end_time , Time dt ) -{ - return integrate( system , start_state , start_time , end_time , dt , null_observer() ); -} - -template< class Value , class System , class State , class Time > -size_t integrate( System system , State &start_state , Time start_time , Time end_time , Time dt ) -{ - return integrate< Value >( system , start_state , start_time , end_time , dt , null_observer() ); -} - - - -/** - * \fn integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) - * \brief Integrates the ODE. - * - * Integrates the ODE given by system from start_time to end_time starting - * with start_state as initial condition and dt as initial time step. - * This function uses a dense output dopri5 stepper and performs an adaptive - * integration with step size control, thus dt changes during the integration. - * This method uses standard error bounds of 1E-6. - * After each step, the observer is called. - * - * \attention A second version of this function template exists which explicitly - * expects the value type as template parameter, i.e. integrate< double >( sys , x , t0 , t1 , dt , obs ); - * - * \param system The system function to solve, hence the r.h.s. of the - * ordinary differential equation. - * \param start_state The initial state. - * \param start_time Start time of the integration. - * \param end_time End time of the integration. - * \param dt Initial step size, will be adjusted during the integration. - * \param observer Observer that will be called after each time step. - * \return The number of steps performed. - */ - - -/** - * \fn integrate( System system , State &start_state , Time start_time , Time end_time , Time dt ) - * \brief Integrates the ODE without observer calls. - * - * Integrates the ODE given by system from start_time to end_time starting - * with start_state as initial condition and dt as initial time step. - * This function uses a dense output dopri5 stepper and performs an adaptive - * integration with step size control, thus dt changes during the integration. - * This method uses standard error bounds of 1E-6. - * No observer is called. - * - * \attention A second version of this function template exists which explicitly - * expects the value type as template parameter, i.e. integrate< double >( sys , x , t0 , t1 , dt ); - * - * \param system The system function to solve, hence the r.h.s. of the - * ordinary differential equation. - * \param start_state The initial state. - * \param start_time Start time of the integration. - * \param end_time End time of the integration. - * \param dt Initial step size, will be adjusted during the integration. - * \return The number of steps performed. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_adaptive.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_adaptive.hpp deleted file mode 100644 index 09997142fc..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_adaptive.hpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate_adaptive.hpp - - [begin_description] - Adaptive integration of ODEs. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2015 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED - -#include <boost/type_traits/is_same.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/integrate/null_observer.hpp> -#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * the two overloads are needed in order to solve the forwarding problem - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_adaptive( - stepper , system , start_state , - start_time , end_time , dt , - observer , stepper_category() ); - - /* - * Suggestion for a new extendable version: - * - * integrator_adaptive< Stepper , System, State , Time , Observer , typename Stepper::stepper_category > integrator; - * return integrator.run( stepper , system , start_state , start_time , end_time , dt , observer ); - */ -} - -/** - * \brief Second version to solve the forwarding problem, - * can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , const State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_adaptive( - stepper , system , start_state , - start_time , end_time , dt , - observer , stepper_category() ); -} - - - - -/** - * \brief integrate_adaptive without an observer. - */ -template< class Stepper , class System , class State , class Time > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt ) -{ - return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() ); -} - -/** - * \brief Second version to solve the forwarding problem, - * can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time > -size_t integrate_adaptive( - Stepper stepper , System system , const State &start_state , - Time start_time , Time end_time , Time dt ) -{ - return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() ); -} - - -/************* DOXYGEN ************/ - - /** - * \fn integrate_adaptive( Stepper stepper , System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) - * \brief Integrates the ODE with adaptive step size. - * - * This function integrates the ODE given by system with the given stepper. - * The observer is called after each step. If the stepper has no error - * control, the step size remains constant and the observer is called at - * equidistant time points t0+n*dt. If the stepper is a ControlledStepper, - * the step size is adjusted and the observer is called in non-equidistant - * intervals. - * - * \param stepper The stepper to be used for numerical integration. - * \param system Function/Functor defining the rhs of the ODE. - * \param start_state The initial condition x0. - * \param start_time The initial time t0. - * \param end_time The final integration time tend. - * \param dt The time step between observer calls, _not_ necessarily the - * time step of the integration. - * \param observer Function/Functor called at equidistant time intervals. - * \return The number of steps performed. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_const.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_const.hpp deleted file mode 100644 index fae683f978..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_const.hpp +++ /dev/null @@ -1,195 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate_const.hpp - - [begin_description] - Constant integration of ODEs, meaning that the state of the ODE is observed on constant time intervals. - The routines makes full use of adaptive and dense-output methods. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2015 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED - -#include <boost/type_traits/is_same.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/integrate/null_observer.hpp> -#include <boost/numeric/odeint/integrate/check_adapter.hpp> -#include <boost/numeric/odeint/integrate/detail/integrate_const.hpp> -#include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * Integrates with constant time step dt. - */ -template<class Stepper, class System, class State, class Time, class Observer, class StepOverflowChecker> -size_t integrate_const( - Stepper stepper, System system, State &start_state, - Time start_time, Time end_time, Time dt, - Observer observer, StepOverflowChecker checker -) { - typedef typename odeint::unwrap_reference<Stepper>::type::stepper_category stepper_category; - // we want to get as fast as possible to the end - // no overflow checks needed - if (boost::is_same<null_observer, Observer>::value) { - return detail::integrate_adaptive( - stepper, system, start_state, - start_time, end_time, dt, - observer, stepper_category()); - } - else { - // unwrap references - typedef typename odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - typedef typename odeint::unwrap_reference< StepOverflowChecker >::type checker_type; - - return detail::integrate_const(checked_stepper<stepper_type, checker_type>(stepper, checker), - system, start_state, - start_time, end_time, dt, - checked_observer<observer_type, checker_type>(observer, checker), - stepper_category()); - } -} - -/** -* \brief Second version to solve the forwarding problem, -* can be called with Boost.Range as start_state. -*/ -template<class Stepper, class System, class State, class Time, class Observer, class StepOverflowChecker > -size_t integrate_const( - Stepper stepper, System system, const State &start_state, - Time start_time, Time end_time, Time dt, - Observer observer, StepOverflowChecker checker -) { - typedef typename odeint::unwrap_reference<Stepper>::type::stepper_category stepper_category; - // we want to get as fast as possible to the end - - if (boost::is_same<null_observer, Observer>::value) { - return detail::integrate_adaptive( - stepper, system, start_state, - start_time, end_time, dt, - observer, stepper_category()); - } - else { - typedef typename odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - typedef typename odeint::unwrap_reference< StepOverflowChecker >::type checker_type; - - return detail::integrate_const(checked_stepper<stepper_type, checker_type>(stepper, checker), - system, start_state, - start_time, end_time, dt, - checked_observer<observer_type, checker_type>(observer, checker), - stepper_category()); - } -} - - -/** -* \brief integrate_const without step overflow checker -*/ -template<class Stepper, class System, class State, class Time, class Observer> -size_t integrate_const( - Stepper stepper, System system, State &start_state, - Time start_time, Time end_time, Time dt, Observer observer) -{ - typedef typename odeint::unwrap_reference<Stepper>::type::stepper_category stepper_category; - return detail::integrate_const(stepper, system, start_state, - start_time, end_time, dt, observer, stepper_category()); -} - -/** -* \brief Second version to solve the forwarding problem, -* can be called with Boost.Range as start_state. -*/ -template<class Stepper, class System, class State, class Time, class Observer> -size_t integrate_const( - Stepper stepper, System system, const State &start_state, - Time start_time, Time end_time, Time dt, Observer observer -) { - typedef typename odeint::unwrap_reference<Stepper>::type::stepper_category stepper_category; - return detail::integrate_const(stepper, system, start_state, - start_time, end_time, dt, observer, stepper_category()); -} - - -/** -* \brief integrate_const without observer calls -*/ -template<class Stepper, class System, class State, class Time> -size_t integrate_const( - Stepper stepper, System system, State &start_state, - Time start_time, Time end_time, Time dt -) { - return integrate_const(stepper, system, start_state, start_time, end_time, dt, null_observer()); -} - -/** -* \brief Second version to solve the forwarding problem, -* can be called with Boost.Range as start_state. -*/ -template<class Stepper, class System, class State, class Time> -size_t integrate_const( - Stepper stepper, System system, const State &start_state, - Time start_time, Time end_time, Time dt -) { - return integrate_const(stepper, system, start_state, start_time, end_time, dt, null_observer()); -} - - - - - - -/********* DOXYGEN *********/ -/** - * \fn integrate_const( Stepper stepper , System system , State &start_state , Time start_time , - * Time end_time , Time dt , Observer observer , StepOverflowChecker checker ) - * \brief Integrates the ODE with constant step size. - * - * Integrates the ODE defined by system using the given stepper. - * This method ensures that the observer is called at constant intervals dt. - * If the Stepper is a normal stepper without step size control, dt is also - * used for the numerical scheme. If a ControlledStepper is provided, the - * algorithm might reduce the step size to meet the error bounds, but it is - * ensured that the observer is always called at equidistant time points - * t0 + n*dt. If a DenseOutputStepper is used, the step size also may vary - * and the dense output is used to call the observer at equidistant time - * points. - * If a max_step_checker is provided as StepOverflowChecker, a - * no_progress_error is thrown if too many steps (default: 500) are performed - * without progress, i.e. in between observer calls. If no checker is provided, - * no such overflow check is performed. - * - * \param stepper The stepper to be used for numerical integration. - * \param system Function/Functor defining the rhs of the ODE. - * \param start_state The initial condition x0. - * \param start_time The initial time t0. - * \param end_time The final integration time tend. - * \param dt The time step between observer calls, _not_ necessarily the - * time step of the integration. - * \param observer [optional] Function/Functor called at equidistant time intervals. - * \param checker [optional] Functor to check for step count overflows, if no - * checker is provided, no exception is thrown. - * \return The number of steps performed. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_n_steps.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_n_steps.hpp deleted file mode 100644 index 5cc8aa0e7b..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_n_steps.hpp +++ /dev/null @@ -1,180 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate_n_steps.hpp - - [begin_description] - Integration of n steps with constant time size. Adaptive and dense-output methods are fully supported. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2015 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED - -#include <boost/type_traits/is_same.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/integrate/null_observer.hpp> -#include <boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp> -#include <boost/numeric/odeint/integrate/check_adapter.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * Integrates n steps - * - * the two overloads are needed in order to solve the forwarding problem - */ -template< class Stepper , class System , class State , class Time , class Observer , class StepOverflowChecker > -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer , StepOverflowChecker checker ) -{ - // unwrap references - typedef typename odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - typedef typename odeint::unwrap_reference< StepOverflowChecker >::type checker_type; - typedef typename stepper_type::stepper_category stepper_category; - - return detail::integrate_n_steps( - checked_stepper<stepper_type, checker_type>(stepper, checker), - system , start_state , - start_time , dt , num_of_steps , - checked_observer<observer_type, checker_type>(observer, checker), - stepper_category() ); -} - -/** - * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time , class Observer , class StepOverflowChecker > -Time integrate_n_steps( - Stepper stepper , System system , const State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer , StepOverflowChecker checker ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - typedef typename odeint::unwrap_reference< StepOverflowChecker >::type checker_type; - typedef typename stepper_type::stepper_category stepper_category; - - return detail::integrate_n_steps( - checked_stepper<stepper_type, checker_type>(stepper, checker), - system , start_state , - start_time , dt , num_of_steps , - checked_observer<observer_type, checker_type>(observer, checker), - stepper_category() ); -} - - -/** -* \brief The same function as above, but without checker. -*/ -template< class Stepper , class System , class State , class Time , class Observer > -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , Observer observer ) -{ - typedef typename odeint::unwrap_reference<Stepper>::type::stepper_category stepper_category; - - return detail::integrate_n_steps( - stepper , system , start_state , - start_time , dt , num_of_steps , - observer , stepper_category() ); -} - -/** -* \brief Solves the forwarding problem, can be called with Boost.Range as start_state. -*/ -template< class Stepper , class System , class State , class Time , class Observer > -Time integrate_n_steps( - Stepper stepper , System system , const State &start_state , - Time start_time , Time dt , size_t num_of_steps , Observer observer ) -{ - typedef typename odeint::unwrap_reference<Stepper>::type::stepper_category stepper_category; - - return detail::integrate_n_steps( - stepper , system , start_state , - start_time , dt , num_of_steps , - observer , stepper_category() ); -} - -/** - * \brief The same function as above, but without observer calls. - */ -template< class Stepper , class System , class State , class Time > -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps ) -{ - return integrate_n_steps(stepper, system, start_state, start_time, - dt, num_of_steps, null_observer()); -} - -/** - * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time > -Time integrate_n_steps( - Stepper stepper , System system , const State &start_state , - Time start_time , Time dt , size_t num_of_steps ) -{ - return integrate_n_steps(stepper, system, start_state, start_time, - dt, num_of_steps, null_observer()); -} - - - -/************* DOXYGEN *************/ - /** - * \fn Time integrate_n_steps( Stepper stepper , System system , State &start_state , Time start_time , Time dt , size_t num_of_steps , Observer observer ) - * \brief Integrates the ODE with constant step size. - * - * This function is similar to integrate_const. The observer is called at - * equidistant time intervals t0 + n*dt. - * If the Stepper is a normal stepper without step size control, dt is also - * used for the numerical scheme. If a ControlledStepper is provided, the - * algorithm might reduce the step size to meet the error bounds, but it is - * ensured that the observer is always called at equidistant time points - * t0 + n*dt. If a DenseOutputStepper is used, the step size also may vary - * and the dense output is used to call the observer at equidistant time - * points. The final integration time is always t0 + num_of_steps*dt. - * If a max_step_checker is provided as StepOverflowChecker, a - * no_progress_errror is thrown if too many steps (default: 500) are - * performed without progress, i.e. in between observer calls. If no - * checker is provided, no such overflow check is performed. - - * - * \param stepper The stepper to be used for numerical integration. - * \param system Function/Functor defining the rhs of the ODE. - * \param start_state The initial condition x0. - * \param start_time The initial time t0. - * \param dt The time step between observer calls, _not_ necessarily the - * time step of the integration. - * \param num_of_steps Number of steps to be performed - * \param observer Function/Functor called at equidistant time intervals. - * \param checker [optional] Functor to check for step count overflows, if no - * checker is provided, no exception is thrown. - * \return The number of steps performed. - */ - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_times.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_times.hpp deleted file mode 100644 index 79fba4f1b3..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/integrate_times.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate_times.hpp - - [begin_description] - Integration of ODEs with observation at user defined points - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2015 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED - -#include <boost/type_traits/is_same.hpp> - -#include <boost/range.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/integrate/null_observer.hpp> -#include <boost/numeric/odeint/integrate/check_adapter.hpp> -#include <boost/numeric/odeint/integrate/detail/integrate_times.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * \brief Integrates while calling the observer at the time points given by sequence [times_start, time_end) - * the two overloads are needed in order to solve the forwarding problem - */ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer , class StepOverflowChecker > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - TimeIterator times_start , TimeIterator times_end , Time dt , - Observer observer , StepOverflowChecker checker ) -{ - // unwrap references - typedef typename odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - typedef typename odeint::unwrap_reference< StepOverflowChecker >::type checker_type; - typedef typename stepper_type::stepper_category stepper_category; - - // pass on checked stepper and observer - // checked_stepper/observer use references internally, so passing by value is fine - return detail::integrate_times( - checked_stepper<stepper_type, checker_type>(stepper, checker) , - system , start_state , - times_start , times_end , dt , - checked_observer<observer_type, checker_type>(observer, checker), - stepper_category() ); -} - -/** - * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer , class StepOverflowChecker > -size_t integrate_times( - Stepper stepper , System system , const State &start_state , - TimeIterator times_start , TimeIterator times_end , Time dt , - Observer observer , StepOverflowChecker checker ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - typedef typename odeint::unwrap_reference< StepOverflowChecker >::type checker_type; - typedef typename stepper_type::stepper_category stepper_category; - - stepper_type &st = stepper; - observer_type &obs = observer; - checker_type &chk = checker; - - return detail::integrate_times( - checked_stepper<stepper_type, checker_type>(stepper, checker) , - system , start_state , - times_start , times_end , dt , - checked_observer<observer_type, checker_type>(observer, checker), - stepper_category() ); -} - -/** - * \brief The same function as above, but with the observation times given as range. - */ -template< class Stepper , class System , class State , class TimeRange , class Time , class Observer , class StepOverflowChecker > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - const TimeRange × , Time dt , - Observer observer , StepOverflowChecker checker ) -{ - return integrate_times( - stepper , system , start_state , - boost::begin( times ) , boost::end( times ) , dt , observer , checker ); -} - -/** - * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class TimeRange , class Time , class Observer , class StepOverflowChecker > -size_t integrate_times( - Stepper stepper , System system , const State &start_state , - const TimeRange × , Time dt , - Observer observer , StepOverflowChecker checker ) -{ - return integrate_times( - stepper , system , start_state , - boost::begin( times ) , boost::end( times ) , dt , observer , checker ); -} - - - - -/* -* The same functions as above, but without a StepOverflowChecker -*/ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - TimeIterator times_start , TimeIterator times_end , Time dt , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - // simply don't use checked_* adapters - return detail::integrate_times( - stepper , system , start_state , - times_start , times_end , dt , - observer , stepper_category() ); -} - -/** -* \brief Solves the forwarding problem, can be called with Boost.Range as start_state. -*/ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , const State &start_state , - TimeIterator times_start , TimeIterator times_end , Time dt , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_times( - stepper , system , start_state , - times_start , times_end , dt , - observer , stepper_category() ); -} - -/** -* \brief The same function as above, but with the observation times given as range. -*/ -template< class Stepper , class System , class State , class TimeRange , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - const TimeRange × , Time dt , - Observer observer ) -{ - return integrate_times( - stepper , system , start_state , - boost::begin( times ) , boost::end( times ) , dt , observer ); -} - -/** -* \brief Solves the forwarding problem, can be called with Boost.Range as start_state. -*/ -template< class Stepper , class System , class State , class TimeRange , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , const State &start_state , - const TimeRange × , Time dt , - Observer observer ) -{ - return integrate_times( - stepper , system , start_state , - boost::begin( times ) , boost::end( times ) , dt , observer); -} - - -/********* DOXYGEN ***********/ - - /** - * \fn size_t integrate_times( Stepper stepper , System system , State &start_state , TimeIterator times_start , TimeIterator times_end , Time dt , Observer observer ) - * \brief Integrates the ODE with observer calls at given time points. - * - * Integrates the ODE given by system using the given stepper. This function - * does observer calls at the subsequent time points given by the range - * times_start, times_end. If the stepper has not step size control, the - * step size might be reduced occasionally to ensure observer calls exactly - * at the time points from the given sequence. If the stepper is a - * ControlledStepper, the step size is adjusted to meet the error bounds, - * but also might be reduced occasionally to ensure correct observer calls. - * If a DenseOutputStepper is provided, the dense output functionality is - * used to call the observer at the given times. The end time of the - * integration is always *(end_time-1). - * If a max_step_checker is provided as StepOverflowChecker, a - * no_progress_error is thrown if too many steps (default: 500) are - * performed without progress, i.e. in between observer calls. If no - * checker is provided, no such overflow check is performed. - * - * \param stepper The stepper to be used for numerical integration. - * \param system Function/Functor defining the rhs of the ODE. - * \param start_state The initial condition x0. - * \param times_start Iterator to the start time - * \param times_end Iterator to the end time - * \param dt The time step between observer calls, _not_ necessarily the - * time step of the integration. - * \param observer Function/Functor called at equidistant time intervals. - * \param checker [optional] Functor to check for step count overflows, if no - * checker is provided, no exception is thrown. - * \return The number of steps performed. - */ - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/max_step_checker.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/max_step_checker.hpp deleted file mode 100644 index 654c95bc7d..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/max_step_checker.hpp +++ /dev/null @@ -1,114 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/max_step_checker.hpp - - [begin_description] - Throws exception if too many steps are performed. - [end_description] - - Copyright 2015 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_MAX_STEP_CHECKER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_MAX_STEP_CHECKER_HPP_INCLUDED - -#include <stdexcept> -#include <cstdio> - -#include <boost/throw_exception.hpp> -#include <boost/numeric/odeint/util/odeint_error.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -/** - * \brief A class for performing overflow checks on the step count in integrate functions. - * - * Provide an instance of this class to integrate functions if you want to throw a runtime error if - * too many steps are performed without progress during the integrate routine. - */ -class max_step_checker -{ -public: - -protected: - const int m_max_steps; - int m_steps; - -public: - /** - * \brief Construct the max_step_checker. - * max_steps is the maximal number of iterations allowed before runtime_error is thrown. - */ - max_step_checker(const int max_steps = 500) - : m_max_steps(max_steps) - { - reset(); - } - - /** - * \brief Resets the max_step_checker by setting the internal counter to 0. - */ - void reset() - { - m_steps = 0; - } - - /** - * \brief Increases the counter and performs the iteration check - */ - void operator()(void) - { - if( m_steps++ >= m_max_steps ) - { - char error_msg[200]; - std::sprintf(error_msg, "Max number of iterations exceeded (%d).", m_max_steps); - BOOST_THROW_EXCEPTION( no_progress_error(error_msg) ); - } - } -}; - - -/** - * \brief A class for performing overflow checks on the failed step count in step size adjustments. - * - * Used internally within the dense output stepper and integrate routines. - */ -class failed_step_checker : public max_step_checker -{ - -public: - /** - * \brief Construct the failed_step_checker. - * max_steps is the maximal number of iterations allowed before runtime_error is thrown. - */ - failed_step_checker(const int max_steps = 500) - : max_step_checker(max_steps) - {} - - /** - * \brief Increases the counter and performs the iteration check - */ - void operator()(void) - { - if( m_steps++ >= m_max_steps ) - { - char error_msg[200]; - std::sprintf(error_msg, "Max number of iterations exceeded (%d). A new step size was not found.", m_max_steps); - BOOST_THROW_EXCEPTION( step_adjustment_error(error_msg) ); - } - } -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/null_observer.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/null_observer.hpp deleted file mode 100644 index 82b86b4582..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/null_observer.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/null_observer.hpp - - [begin_description] - null_observer - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED - -namespace boost { -namespace numeric { -namespace odeint { - -struct null_observer -{ - template< class State , class Time > - void operator()( const State& /* x */ , Time /* t */ ) const - { - - } -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/integrate/observer_collection.hpp b/contrib/restricted/boost/boost/numeric/odeint/integrate/observer_collection.hpp deleted file mode 100644 index f8c9af8e24..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/integrate/observer_collection.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/observer_collection.hpp - - [begin_description] - Collection of observers, which are all called during the evolution of the ODE. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED - -#include <vector> - -#include <boost/function.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< class State , class Time > -class observer_collection -{ -public: - - typedef boost::function< void( const State& , const Time& ) > observer_type; - typedef std::vector< observer_type > collection_type; - - void operator()( const State& x , Time t ) - { - for( size_t i=0 ; i<m_observers.size() ; ++i ) - m_observers[i]( x , t ); - } - - collection_type& observers( void ) { return m_observers; } - const collection_type& observers( void ) const { return m_observers; } - -private: - - collection_type m_observers; -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/adaptive_iterator.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/adaptive_iterator.hpp deleted file mode 100644 index e8313e7690..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/adaptive_iterator.hpp +++ /dev/null @@ -1,183 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/adaptive_iterator.hpp - - [begin_description] - Iterator for iterating throught the solution of an ODE with adaptive step size. The dereferenced types containes also the time. - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_ITERATOR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_ITERATOR_HPP_INCLUDED - -#include <boost/numeric/odeint/util/stepper_traits.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - /* use the adaptive_iterator_impl with the right tags */ - template< class Stepper , class System , class State -#ifndef DOXYGEN_SKIP - , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type -#endif - > - class adaptive_iterator : public adaptive_iterator_impl< - adaptive_iterator< Stepper , System , State , StepperTag > , - Stepper , System , State , detail::ode_state_iterator_tag , StepperTag - > - { - typedef typename traits::time_type< Stepper >::type time_type; - typedef adaptive_iterator< Stepper , System , State , StepperTag > iterator_type; - - public: - adaptive_iterator( Stepper stepper , System sys , State &s , time_type t_start , time_type t_end , time_type dt ) - : adaptive_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s , t_start , t_end , dt ) - {} - - adaptive_iterator( Stepper stepper , System sys , State &s ) - : adaptive_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s ) - {} - }; - - - - - template< class Stepper , class System , class State > - adaptive_iterator< Stepper , System , State > make_adaptive_iterator_begin( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - { - return adaptive_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ); - } - - - template< class Stepper , class System , class State > - adaptive_iterator< Stepper , System , State > make_adaptive_iterator_end( - Stepper stepper , - System system , - State &x ) - { - return adaptive_iterator< Stepper , System , State >( stepper , system , x ); - } - - - template< class Stepper , class System , class State > - std::pair< adaptive_iterator< Stepper , System , State > , adaptive_iterator< Stepper , System , State > > - make_adaptive_range( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - { - return std::make_pair( - adaptive_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ) , - adaptive_iterator< Stepper , System , State >( stepper , system , x ) - ); - } - - /** - * \class adaptive_iterator - * - * \brief ODE Iterator with adaptive step size. The value type of this iterator is the state type of the stepper. - * - * Implements an iterator representing the solution of an ODE from t_start - * to t_end evaluated at steps with an adaptive step size dt. - * After each iteration the iterator dereferences to the state x at the next - * time t+dt where dt is controlled by the stepper. - * This iterator can be used with ControlledSteppers and - * DenseOutputSteppers and it always makes use of the all the given steppers - * capabilities. A for_each over such an iterator range behaves similar to - * the integrate_adaptive routine. - * - * adaptive_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - * \tparam State The state type of the ODE. - */ - - - - - - - /** - * \fn make_adaptive_iterator_begin( Stepper stepper , System system , State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function for adaptive_iterator. Constructs a begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. - * \param t_start The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - * \returns The adaptive iterator. - */ - - - /** - * \fn make_adaptive_iterator_end( Stepper stepper , System system , State &x ) - * \brief Factory function for adaptive_iterator. Constructs a end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. - * \returns The adaptive iterator. - */ - - - /** - * \fn make_adaptive_range( Stepper stepper , System system , State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function to construct a single pass range of adaptive iterators. A range is here a pair of adaptive_iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. - * \param t_start The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - * \returns The adaptive range. - */ - - - - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_ITERATOR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/adaptive_time_iterator.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/adaptive_time_iterator.hpp deleted file mode 100644 index f70d34a6f1..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/adaptive_time_iterator.hpp +++ /dev/null @@ -1,175 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/adaptive_time_iterator.hpp - - [begin_description] - Iterator for iterating throught the solution of an ODE with adaptive step size. The dereferenced types containes also the time. - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2012-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_TIME_ITERATOR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_TIME_ITERATOR_HPP_INCLUDED - - - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/util/stepper_traits.hpp> -#include <boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - /* use the adaptive_iterator_impl with the right tags */ - template< class Stepper , class System , class State -#ifndef DOXYGEN_SKIP - , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type -#endif - > - class adaptive_time_iterator : public adaptive_iterator_impl< - adaptive_time_iterator< Stepper , System , State , StepperTag > , - Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag - > - { - typedef typename traits::time_type< Stepper >::type time_type; - typedef adaptive_time_iterator< Stepper , System , State , StepperTag > iterator_type; - - public: - adaptive_time_iterator( Stepper stepper , System sys , State &s , time_type t_start , time_type t_end , time_type dt ) - : adaptive_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s , t_start , t_end , dt ) - {} - - adaptive_time_iterator( Stepper stepper , System sys , State &s ) - : adaptive_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s ) - {} - }; - - - - - template< class Stepper , class System , class State > - adaptive_time_iterator< Stepper , System , State > make_adaptive_time_iterator_begin( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - { - return adaptive_time_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ); - } - - template< class Stepper , class System , class State > - adaptive_time_iterator< Stepper , System , State > make_adaptive_time_iterator_end( - Stepper stepper , - System system , - State &x ) - { - return adaptive_time_iterator< Stepper , System , State >( stepper , system , x ); - } - - - template< class Stepper , class System , class State > - std::pair< adaptive_time_iterator< Stepper , System , State > , adaptive_time_iterator< Stepper , System , State > > - make_adaptive_time_range( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - { - return std::make_pair( - adaptive_time_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ) , - adaptive_time_iterator< Stepper , System , State >( stepper , system , x ) ); - } - - - - /** - * \class adaptive_time_iterator - * - * \brief ODE Iterator with adaptive step size. The value type of this iterator is a std::pair containing state and time. - * - * Implements an iterator representing the solution of an ODE from t_start - * to t_end evaluated at steps with an adaptive step size dt. - * After each iteration the iterator dereferences to a pair containing state - * and time at the next time point t+dt where dt is controlled by the stepper. - * This iterator can be used with ControlledSteppers and - * DenseOutputSteppers and it always makes use of the all the given steppers - * capabilities. A for_each over such an iterator range behaves similar to - * the integrate_adaptive routine. - * - * adaptive_iterator is a model of single-pass iterator. - * - * The value type of this iterator is a std::pair of state and time of the stepper. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - * \tparam State The state type of the ODE. - */ - - - - /** - * \fn make_adaptive_time_iterator_begin( Stepper stepper , System system , State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function for adaptive_time_iterator. Constructs a begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. adaptive_time_iterator stores a reference of s and changes its value during the iteration. - * \param t_start The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - * \returns The adaptive time iterator. - */ - - - /** - * \fn make_adaptive_time_iterator_end( Stepper stepper , System system , State &x ) - * \brief Factory function for adaptive_time_iterator. Constructs a end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. adaptive_time_iterator stores a reference of s and changes its value during the iteration. - * \returns The adaptive time iterator. - */ - - - /** - * \fn make_adaptive_time_range( Stepper stepper , System system , State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function to construct a single pass range of adaptive time iterators. A range is here a pair of adaptive_time_iterators. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. adaptive_time_iterator stores a reference of s and changes its value during the iteration. - * \param t_start The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - * \returns The adaptive time range. - */ - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_TIME_ITERATOR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/const_step_iterator.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/const_step_iterator.hpp deleted file mode 100644 index fb1bbb1009..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/const_step_iterator.hpp +++ /dev/null @@ -1,180 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/const_step_iterator.hpp - - [begin_description] - Iterator for iterating through the solution of an ODE with constant step size. - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_ODE_ITERATOR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_ODE_ITERATOR_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/stepper_traits.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> -#include <boost/numeric/odeint/iterator/impl/const_step_iterator_impl.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - - /* use the const_step_iterator_impl with the right tags */ - template< class Stepper , class System , class State -#ifndef DOXYGEN_SKIP - , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type -#endif - > - class const_step_iterator : public const_step_iterator_impl< - const_step_iterator< Stepper , System , State , StepperTag > , - Stepper , System , State , detail::ode_state_iterator_tag , StepperTag - > - { - typedef typename traits::time_type< Stepper >::type time_type; - typedef const_step_iterator< Stepper , System , State , StepperTag > iterator_type; - - public: - const_step_iterator( Stepper stepper , System sys , State &s , time_type t_start , time_type t_end , time_type dt ) - : const_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s , t_start , t_end , dt ) - {} - - const_step_iterator( Stepper stepper , System sys , State &s ) - : const_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s ) - {} - }; - - /* make functions */ - - template< class Stepper , class System , class State > - const_step_iterator< Stepper , System, State > make_const_step_iterator_begin( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - { - return const_step_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ); - } - - template< class Stepper , class System , class State > - const_step_iterator< Stepper , System , State > make_const_step_iterator_end( - Stepper stepper , - System system , - State &x ) - { - return const_step_iterator< Stepper , System , State >( stepper , system , x ); - } - - template< class Stepper , class System , class State > - std::pair< const_step_iterator< Stepper , System , State > , const_step_iterator< Stepper , System , State > > - make_const_step_range( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - { - return std::make_pair( - const_step_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ) , - const_step_iterator< Stepper , System , State >( stepper , system , x ) - ); - } - - - - /** - * \class const_step_iterator - * - * \brief ODE Iterator with constant step size. The value type of this iterator is the state type of the stepper. - * - * Implements an iterator representing the solution of an ODE from t_start - * to t_end evaluated at steps with constant step size dt. - * After each iteration the iterator dereferences to the state x at the next - * time t+dt. - * This iterator can be used with Steppers and - * DenseOutputSteppers and it always makes use of the all the given steppers - * capabilities. A for_each over such an iterator range behaves similar to - * the integrate_const routine. - * - * const_step_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - * \tparam State The state type of the ODE. - */ - - - /** - * \fn make_const_step_iterator_begin( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function for const_step_iterator. Constructs a begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t_start The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - * \returns The const step iterator. - */ - - - /** - * \fn make_const_step_iterator_end( Stepper stepper , System system , State &x ) - * \brief Factory function for const_step_iterator. Constructs a end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \returns The const_step_iterator. - */ - - - /** - * \fn make_const_step_range( Stepper stepper , System system , State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function to construct a single pass range of const step iterators. A range is here a pair - * of const_step_iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator store a reference of s and changes its value during the iteration. - * \param t_start The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - * \returns The const step range. - */ - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -//#include <boost/numeric/odeint/iterator/impl/const_step_iterator_dense_output_impl.hpp> - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_ODE_ITERATOR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/const_step_time_iterator.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/const_step_time_iterator.hpp deleted file mode 100644 index 94ec5ddb17..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/const_step_time_iterator.hpp +++ /dev/null @@ -1,173 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/const_step_time_iterator.hpp - - [begin_description] - Iterator for iterating throught the solution of an ODE with constant step size. The dereferences types containes also the time. - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/util/stepper_traits.hpp> -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> -#include <boost/numeric/odeint/iterator/impl/const_step_iterator_impl.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - /* use the const_step_iterator_impl with the right tags */ - template< class Stepper , class System , class State -#ifndef DOXYGEN_SKIP - , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type -#endif - > - class const_step_time_iterator : public const_step_iterator_impl< - const_step_time_iterator< Stepper , System , State , StepperTag > , - Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag - > - { - typedef typename traits::time_type< Stepper >::type time_type; - typedef const_step_time_iterator< Stepper , System , State , StepperTag > iterator_type; - - public: - const_step_time_iterator( Stepper stepper , System sys , State &s , time_type t_start , time_type t_end , time_type dt ) - : const_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s , t_start , t_end , dt ) - {} - - const_step_time_iterator( Stepper stepper , System sys , State &s ) - : const_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s ) - {} - }; - - template< class Stepper , class System , class State > - const_step_time_iterator< Stepper , System , State > make_const_step_time_iterator_begin( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - { - return const_step_time_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ); - } - - template< class Stepper , class System , class State > - const_step_time_iterator< Stepper , System , State > make_const_step_time_iterator_end( - Stepper stepper , - System system , - State &x ) - { - return const_step_time_iterator< Stepper , System , State >( stepper , system , x ); - } - - - template< class Stepper , class System , class State > - std::pair< const_step_time_iterator< Stepper , System , State > , const_step_time_iterator< Stepper , System , State > > - make_const_step_time_range( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - { - return std::make_pair( - const_step_time_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ) , - const_step_time_iterator< Stepper , System , State >( stepper , system , x ) ); - } - - /** - * \class const_step_time_iterator - * - * \brief ODE Iterator with constant step size. The value type of this iterator is a std::pair containing state and time. - * - * Implements an iterator representing the solution of an ODE from t_start - * to t_end evaluated at steps with constant step size dt. - * After each iteration the iterator dereferences to a pair containing - * state and time at the next time point t+dt.. - * This iterator can be used with Steppers and - * DenseOutputSteppers and it always makes use of the all the given steppers - * capabilities. A for_each over such an iterator range behaves similar to - * the integrate_const routine. - * - * const_step_time_iterator is a model of single-pass iterator. - * - * The value type of this iterator is a pair with the state type and time type of the stepper. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - * \tparam State The state type of the ODE. - */ - - - /** - * \fn make_const_step_time_iterator_begin( Stepper stepper , System system , State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function for const_step_time_iterator. Constructs a begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_time_iterator stores a reference of s and changes its value during the iteration. - * \param t_start The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - * \returns The const step time iterator. - */ - - - /** - * \fn make_const_step_time_iterator_end( Stepper stepper , System system , State &x ) - * \brief Factory function for const_step_time_iterator. Constructs a end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_time_iterator store a reference of s and changes its value during the iteration. - * \returns The const step time iterator. - */ - - - /** - * \fn make_const_step_time_range( Stepper stepper , System system , State &x , - typename traits::time_type< Stepper >::type t_start , - typename traits::time_type< Stepper >::type t_end , - typename traits::time_type< Stepper >::type dt) - * - * \brief Factory function to construct a single pass range of const_step_time_iterator. A range is here a pair of const_step_time_iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_time_iterator stores a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - * \returns The const step time range. - */ - - - - - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp deleted file mode 100644 index 5960e188b6..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp +++ /dev/null @@ -1,199 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp - - [begin_description] - Base class for const_step_iterator and adaptive_iterator. - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2012-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ODE_ITERATOR_BASE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ODE_ITERATOR_BASE_HPP_INCLUDED - -#include <boost/iterator/iterator_facade.hpp> - -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - - struct ode_state_iterator_tag {}; - struct ode_state_time_iterator_tag {}; - - template< class Iterator , class Stepper , class System , class State , typename Tag > - class ode_iterator_base; - - - /* Specialization for the state iterator that has only state_type as its value_type */ - template< class Iterator , class Stepper , class System , class State > - class ode_iterator_base< Iterator , Stepper , System , State , ode_state_iterator_tag > - : public boost::iterator_facade - < - Iterator , - typename traits::state_type< Stepper >::type const , - boost::single_pass_traversal_tag - > - { - private: - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef typename unwrapped_stepper_type::time_type time_type; - typedef typename unwrapped_stepper_type::value_type ode_value_type; - - public: - - ode_iterator_base( stepper_type stepper , system_type sys , time_type t , time_type dt ) - : m_stepper( stepper ) , m_system( sys ) , - m_t( t ) , m_dt( dt ) , m_at_end( false ) - { } - - ode_iterator_base( stepper_type stepper , system_type sys ) - : m_stepper( stepper ) , m_system( sys ) , - m_t() , m_dt() , m_at_end( true ) - { } - - // this function is only for testing - bool same( const ode_iterator_base &iter ) const - { - return ( - //( static_cast<Iterator>(*this).get_state() == - // static_cast<Iterator>(iter).get_state ) && - ( m_t == iter.m_t ) && - ( m_dt == iter.m_dt ) && - ( m_at_end == iter.m_at_end ) - ); - } - - - protected: - - friend class boost::iterator_core_access; - - bool equal( ode_iterator_base const& other ) const - { - if( m_at_end == other.m_at_end ) - { - return true; - } - else - { - return false; - } - } - - const state_type& dereference() const - { - return static_cast<const Iterator*>(this)->get_state(); - } - - protected: - - stepper_type m_stepper; - system_type m_system; - time_type m_t; - time_type m_dt; - bool m_at_end; - }; - - - - /* Specialization for the state-time iterator that has pair<state_type,time_type> as its value_type */ - - template< class Iterator , class Stepper , class System , class State > - class ode_iterator_base< Iterator , Stepper , System , State , ode_state_time_iterator_tag > - : public boost::iterator_facade - < - Iterator , - std::pair< const State , const typename traits::time_type< Stepper >::type > , - boost::single_pass_traversal_tag , - std::pair< const State& , const typename traits::time_type< Stepper >::type& > - > - { - private: - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef typename unwrapped_stepper_type::time_type time_type; - typedef typename unwrapped_stepper_type::value_type ode_value_type; - - public: - - ode_iterator_base( stepper_type stepper , system_type sys , - time_type t , time_type dt ) - : m_stepper( stepper ) , m_system( sys ) , - m_t( t ) , m_dt( dt ) , m_at_end( false ) - { } - - ode_iterator_base( stepper_type stepper , system_type sys ) - : m_stepper( stepper ) , m_system( sys ) , m_at_end( true ) - { } - - bool same( ode_iterator_base const& iter ) - { - return ( - //( static_cast<Iterator>(*this).get_state() == - // static_cast<Iterator>(iter).get_state ) && - ( m_t == iter.m_t ) && - ( m_dt == iter.m_dt ) && - ( m_at_end == iter.m_at_end ) - ); - } - - - protected: - - friend class boost::iterator_core_access; - - bool equal( ode_iterator_base const& other ) const - { - if( m_at_end == other.m_at_end ) - { - return true; - } - else - { - return false; - } - } - - std::pair< const state_type& , const time_type& > dereference() const - { - return std::pair< const state_type & , const time_type & >( - static_cast<const Iterator*>(this)->get_state() , m_t ); - } - - stepper_type m_stepper; - system_type m_system; - time_type m_t; - time_type m_dt; - bool m_at_end; - - }; - - - -} // namespace detail -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ODE_ITERATOR_BASE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp deleted file mode 100644 index e5b4b3cf48..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp +++ /dev/null @@ -1,253 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/iterator/detail/adaptive_iterator_impl.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ADAPTIVE_ITERATOR_IMPL_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ADAPTIVE_ITERATOR_IMPL_HPP_DEFINED - -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/throw_exception.hpp> - -#include <boost/numeric/odeint/util/unit_helper.hpp> -#include <boost/numeric/odeint/util/copy.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - - template< class Iterator , class Stepper , class System , class State , typename Tag , typename StepperTag > - class adaptive_iterator_impl; - - /* - * Specilization for controlled steppers - */ - /** - * \brief ODE Iterator with adaptive step size control. The value type of this iterator is the state type of the stepper. - * - * Implements an ODE iterator with adaptive step size control. Uses controlled steppers. adaptive_iterator is a model - * of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - */ - template< class Iterator , class Stepper , class System , class State , typename Tag > - class adaptive_iterator_impl< Iterator , Stepper , System , State , Tag , controlled_stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - public: - - /** - * \brief Constructs an adaptive_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. adaptive_iterator stores a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - */ - adaptive_iterator_impl( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt ) - : base_type( stepper , sys , t , dt ) , m_t_end( t_end ) , m_state( &s ) - { - if( detail::less_with_sign( this->m_t_end , this->m_t , this->m_dt ) ) - this->m_at_end = true; - } - - /** - * \brief Constructs an adaptive_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. adaptive_iterator store a reference of s and changes its value during the iteration. - */ - adaptive_iterator_impl( stepper_type stepper , system_type sys , state_type &s ) - : base_type( stepper , sys ) , m_state( &s ) { } - - protected: - - friend class boost::iterator_core_access; - - void increment() - { - if( detail::less_with_sign( this->m_t , this->m_t_end , this->m_dt) ) - { - if( detail::less_with_sign( this->m_t_end , - static_cast<time_type>(this->m_t + this->m_dt) , - this->m_dt ) ) - { - this->m_dt = this->m_t_end - this->m_t; - } - unwrapped_stepper_type &stepper = this->m_stepper; - const size_t max_attempts = 1000; - size_t trials = 0; - controlled_step_result res = success; - do - { - res = stepper.try_step( this->m_system , *( this->m_state ) , this->m_t , this->m_dt ); - ++trials; - } - while( ( res == fail ) && ( trials < max_attempts ) ); - if( trials == max_attempts ) - { - BOOST_THROW_EXCEPTION( std::overflow_error( "Adaptive iterator : Maximal number of iterations reached. A step size could not be found." )); - } - } else { - this->m_at_end = true; - } - } - public: - const state_type& get_state() const - { - return *this->m_state; - } - - private: - time_type m_t_end; - state_type* m_state; - }; - - - - /* - * Specilization for dense outputer steppers - */ - /** - * \brief ODE Iterator with adaptive step size control. The value type of this iterator is the state type of the stepper. - * - * Implements an ODE iterator with adaptive step size control. Uses dense-output steppers. adaptive_iterator is a model - * of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - */ - template< class Iterator , class Stepper , class System , class State , typename Tag > - class adaptive_iterator_impl< Iterator , Stepper , System , State , Tag , dense_output_stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - - public: - - - /** - * \brief Constructs an adaptive_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. - * \param t The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - */ - adaptive_iterator_impl( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt ) - : base_type( stepper , sys , t , dt ) , m_t_end( t_end ) - { - if( detail::less_eq_with_sign( this->m_t , this->m_t_end , this->m_dt ) ) - { - unwrapped_stepper_type &st = this->m_stepper; - st.initialize( s , this->m_t , this->m_dt ); - } else { - this->m_at_end = true; - } - } - - /** - * \brief Constructs an adaptive_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. - */ - adaptive_iterator_impl( stepper_type stepper , system_type sys , state_type& /* s */ ) - : base_type( stepper , sys ) { } - - protected: - - friend class boost::iterator_core_access; - - void increment() - { - unwrapped_stepper_type &stepper = this->m_stepper; - if( detail::less_with_sign( this->m_t , - this->m_t_end , - stepper.current_time_step() ) ) - { - if( detail::less_with_sign( this->m_t_end , - static_cast<time_type>(this->m_t + stepper.current_time_step()) , - stepper.current_time_step() ) ) - { - // make stpper to end exactly at t_end - stepper.initialize( stepper.current_state() , stepper.current_time() , - static_cast<time_type>(this->m_t_end-this->m_t) ); - } - stepper.do_step( this->m_system ); - this->m_t = stepper.current_time(); - } else { // we have reached t_end - this->m_at_end = true; - } - } - - public: - const state_type& get_state() const - { - const unwrapped_stepper_type &stepper = this->m_stepper; - return stepper.current_state(); - } - - private: - time_type m_t_end; - }; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_ADAPTIVE_ITERATOR_IMPL_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/const_step_iterator_impl.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/const_step_iterator_impl.hpp deleted file mode 100644 index e23474c7af..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/const_step_iterator_impl.hpp +++ /dev/null @@ -1,228 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/iterator/detail/const_step_iterator_impl.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_CONST_STEP_ITERATOR_IMPL_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_CONST_STEP_ITERATOR_IMPL_HPP_DEFINED - -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> - - - -namespace boost { -namespace numeric { -namespace odeint { - - - template< class Iterator , class Stepper , class System , class State , typename Tag , class StepperTag > - class const_step_iterator_impl; - - - /* - * Specilization for steppers and error steppers - */ - template< class Iterator , class Stepper , class System , class State , typename Tag > - class const_step_iterator_impl< Iterator , Stepper , System , State , Tag , stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - public: - - /** - * \brief Constructs a const_step_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - */ - const_step_iterator_impl( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt ) - : base_type( stepper , sys , t , dt ) , m_t_start( t ) , m_t_end( t_end ) , m_state( &s ) , m_step( 0 ) - { - if( detail::less_with_sign( this->m_t_end , this->m_t , this->m_dt ) ) - this->m_at_end = true; - } - - /** - * \brief Constructs a const_step_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - */ - const_step_iterator_impl( stepper_type stepper , system_type sys , state_type& /* s */ ) - : base_type( stepper , sys ) { } - - protected: - - friend class boost::iterator_core_access; - - void increment() - { - if( detail::less_eq_with_sign( static_cast<time_type>(this->m_t+this->m_dt) , - this->m_t_end , this->m_dt ) ) - { - unwrapped_stepper_type &stepper = this->m_stepper; - stepper.do_step( this->m_system , *this->m_state , this->m_t , this->m_dt ); - // use integer to compute current time to reduce roundoff errors - this->m_step++; - this->m_t = this->m_t_start + static_cast< typename unit_value_type<time_type>::type >(this->m_step)*this->m_dt; - } else { - this->m_at_end = true; - } - } - - public: - const state_type& get_state() const - { - return *m_state; - } - - private: - time_type m_t_start; - time_type m_t_end; - state_type* m_state; - size_t m_step; - - }; - - - - /* - * Specilization for dense output stepper - */ - /** - * \brief ODE Iterator with constant step size. The value type of this iterator is the state type of the stepper. - * - * Implements an ODE iterator solving the ODE with constant steps. Uses dense-output steppers. - * const_step_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - */ - template< class Iterator , class Stepper , class System , class State , typename Tag > - class const_step_iterator_impl< Iterator , Stepper , System , State , Tag , dense_output_stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - public: - - /** - * \brief Constructs a const_step_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param t_end The end time, at which the iteration should stop. - * \param dt The initial time step. - */ - const_step_iterator_impl( stepper_type stepper , system_type sys , state_type &s , time_type t , time_type t_end , time_type dt ) - : base_type( stepper , sys , t , dt ) , m_t_start( t ) , m_t_end( t_end ) , m_state( &s ) , m_step( 0 ) - { - if( detail::less_eq_with_sign( this->m_t , this->m_t_end , this->m_dt ) ) - { - unwrapped_stepper_type &st = this->m_stepper; - st.initialize( * ( this->m_state ) , this->m_t , this->m_dt ); - } else { - this->m_at_end = true; - } - } - - /** - * \brief Constructs a const_step_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - */ - const_step_iterator_impl( stepper_type stepper , system_type sys , state_type &s ) - : base_type( stepper , sys ) , m_state( &s ) - { - } - - - - protected: - - friend class boost::iterator_core_access; - - void increment( void ) - { - if( detail::less_eq_with_sign( static_cast<time_type>(this->m_t+this->m_dt) , - this->m_t_end , this->m_dt ) ) - { - unwrapped_stepper_type &stepper = this->m_stepper; - // use integer to compute current time to reduce roundoff errors - this->m_step++; - this->m_t = this->m_t_start + static_cast< typename unit_value_type<time_type>::type >(this->m_step)*this->m_dt; - while( detail::less_with_sign( stepper.current_time() , this->m_t , - stepper.current_time_step() ) ) - { - stepper.do_step( this->m_system ); - } - stepper.calc_state( this->m_t , *( this->m_state ) ); - } else { - this->m_at_end = true; - } - } - - public: - const state_type& get_state() const - { - return *m_state; - } - - private: - time_type m_t_start; - time_type m_t_end; - state_type* m_state; - size_t m_step; - }; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_CONST_STEP_ITERATOR_IMPL_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/n_step_iterator_impl.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/n_step_iterator_impl.hpp deleted file mode 100644 index 7dd167f20a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/n_step_iterator_impl.hpp +++ /dev/null @@ -1,239 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/iterator/detail/n_step_iterator_impl.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_N_STEP_ITERATOR_IMPL_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_N_STEP_ITERATOR_IMPL_HPP_DEFINED - -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> - - - -namespace boost { -namespace numeric { -namespace odeint { - - - template< class Iterator , class Stepper , class System , class State , typename Tag , class StepperTag > - class n_step_iterator_impl; - - - /* - * Specilization for steppers and error steppers - */ - /** - * \brief ODE Iterator performing exactly n steps with constant step size. The value type of this iterator is the state type of the stepper. - * - * Implements an ODE iterator solving the ODE with constant step size. Uses steppers fulfilling the Stepper concept. - * n_step_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - */ - template< class Iterator , class Stepper , class System , class State , typename Tag > - class n_step_iterator_impl< Iterator , Stepper , System , State , Tag , stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - public: - - /** - * \brief Constructs a n_step_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param dt The initial time step. - * \param num_of_steps the number of steps to be executed. - */ - n_step_iterator_impl( stepper_type stepper , system_type sys , state_type &s , - time_type t , time_type dt , size_t num_of_steps ) - : base_type( stepper , sys , t , dt ) , m_t_start( t ) , m_state( &s ) , - m_steps(num_of_steps) , m_step( 0 ) - { } - - /** - * \brief Constructs a const_step_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - */ - n_step_iterator_impl( stepper_type stepper , system_type sys , state_type &s ) - : base_type( stepper , sys ) , m_state( &s ) { } - - protected: - - friend class boost::iterator_core_access; - - void increment() - { - if( this->m_step < this->m_steps ) - { - unwrapped_stepper_type &stepper = this->m_stepper; - stepper.do_step( this->m_system , *this->m_state , this->m_t , this->m_dt ); - // use integer to compute current time to reduce roundoff errors - this->m_step++; - this->m_t = this->m_t_start + static_cast< typename unit_value_type<time_type>::type >(this->m_step)*this->m_dt; - } else { - this->m_at_end = true; - - } - } - - public: - const state_type& get_state() const - { - return *m_state; - } - - - private: - time_type m_t_start; - time_type m_t_end; - state_type* m_state; - size_t m_steps; - size_t m_step; - - }; - - - - - /* - * Specilization for dense output stepper - */ - /** - * \brief ODE Iterator with step-size control and dense output. - * - * Implements an ODE iterator solving the ODE with constant steps. Uses dense-output steppers. - * n_step_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - */ - template< class Iterator , class Stepper , class System , class State , typename Tag > - class n_step_iterator_impl< Iterator , Stepper , System , State , Tag , dense_output_stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - public: - - /** - * \brief Constructs a const_step_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param dt The initial time step. - * \param num_of_steps the number of steps to be executed. - */ - n_step_iterator_impl( stepper_type stepper , system_type sys , state_type &s , - time_type t , time_type dt , size_t num_of_steps ) - : base_type( stepper , sys , t , dt ) , m_t_start( t ) , m_state( &s ) , - m_steps( num_of_steps ) , m_step( 0 ) - { - unwrapped_stepper_type &st = this->m_stepper; - st.initialize( * ( this->m_state ) , this->m_t , this->m_dt ); - } - - /** - * \brief Constructs a const_step_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - */ - n_step_iterator_impl( stepper_type stepper , system_type sys , state_type &s ) - : base_type( stepper , sys ) , m_state( &s ) - { - } - - - - protected: - - friend class boost::iterator_core_access; - - void increment( void ) - { - if( this->m_step < this->m_steps ) - { - unwrapped_stepper_type &stepper = this->m_stepper; - // use integer to compute current time to reduce roundoff errors - this->m_step++; - this->m_t = this->m_t_start + static_cast< typename unit_value_type<time_type>::type >(this->m_step)*this->m_dt; - while( detail::less_with_sign( stepper.current_time() , this->m_t , - stepper.current_time_step() ) ) - { - stepper.do_step( this->m_system ); - } - stepper.calc_state( this->m_t , *( this->m_state ) ); - } else { - this->m_at_end = true; - } - } - - public: - const state_type& get_state() const - { - return *m_state; - } - - - private: - time_type m_t_start; - time_type m_t_end; - state_type* m_state; - size_t m_steps; - size_t m_step; - }; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_N_STEP_ITERATOR_IMPL_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp deleted file mode 100644 index 7a2b48d829..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp +++ /dev/null @@ -1,371 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/iterator/detail/times_iterator_impl.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_TIMES_ITERATOR_IMPL_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_TIMES_ITERATOR_IMPL_HPP_DEFINED - -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/throw_exception.hpp> - -#include <boost/numeric/odeint/util/unit_helper.hpp> -#include <boost/numeric/odeint/util/copy.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - - template< class Iterator , class Stepper , class System , class State , class TimeIterator , - typename Tag , typename StepperTag > - class times_iterator_impl; - - /* - * Specilization for basic steppers - */ - /** - * \brief ODE Iterator with constant step size. - * - * Implements an ODE iterator with observer calls at predefined times. - * Uses controlled steppers. times_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - */ - template< class Iterator , class Stepper , class System , class State , class TimeIterator , typename Tag > - class times_iterator_impl< Iterator , Stepper , System , State , TimeIterator , Tag , stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef TimeIterator time_iterator_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - public: - - /** - * \brief Constructs a times_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. adaptive_iterator stores a reference of s and changes its value during the iteration. - * \param t_start Iterator to the begin of a sequence of time values. - * \param t_end Iterator to the begin of a sequence of time values. - * \param dt The (initial) time step. - */ - times_iterator_impl( stepper_type stepper , system_type sys , state_type &s , - time_iterator_type t_start , time_iterator_type t_end , time_type dt ) - : base_type( stepper , sys , *t_start , dt ) , - m_t_start( t_start ) , m_t_end( t_end ) , m_state( &s ) - { - if( t_start == t_end ) - this->m_at_end = true; - } - - /** - * \brief Constructs an adaptive_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. adaptive_iterator store a reference of s and changes its value during the iteration. - */ - times_iterator_impl( stepper_type stepper , system_type sys , state_type &s ) - : base_type( stepper , sys ) , m_state( &s ) { } - - protected: - - friend class boost::iterator_core_access; - - void increment() - { - unwrapped_stepper_type &stepper = this->m_stepper; - if( ++m_t_start != m_t_end ) - { - while( detail::less_with_sign( this->m_t , static_cast<time_type>(*m_t_start) , this->m_dt ) ) - { - const time_type current_dt = detail::min_abs( this->m_dt , static_cast<time_type>(*m_t_start) - this->m_t ); - stepper.do_step( this->m_system , *( this->m_state ) , this->m_t , current_dt ); - this->m_t += current_dt; - } - - } else { - this->m_at_end = true; - } - } - - public: - const state_type& get_state() const - { - return *m_state; - } - - private: - time_iterator_type m_t_start; - time_iterator_type m_t_end; - state_type* m_state; - }; - - - - /* - * Specilization for controlled steppers - */ - /** - * \brief ODE Iterator with adaptive step size control. The value type of this iterator is the state type of the stepper. - * - * Implements an ODE iterator with observer calls at predefined times. - * Uses controlled steppers. times_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - */ - template< class Iterator , class Stepper , class System , class State , class TimeIterator , typename Tag > - class times_iterator_impl< Iterator , Stepper , System , State , TimeIterator , Tag , controlled_stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef TimeIterator time_iterator_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - public: - - /** - * \brief Constructs a times_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. adaptive_iterator stores a reference of s and changes its value during the iteration. - * \param t_start Iterator to the begin of a sequence of time values. - * \param t_end Iterator to the begin of a sequence of time values. - * \param dt The (initial) time step. - */ - times_iterator_impl( stepper_type stepper , system_type sys , state_type &s , - time_iterator_type t_start , time_iterator_type t_end , time_type dt ) - : base_type( stepper , sys , *t_start , dt ) , - m_t_start( t_start ) , m_t_end( t_end ) , m_state( &s ) - { - if( t_start == t_end ) - this->m_at_end = true; - } - - /** - * \brief Constructs an adaptive_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. adaptive_iterator store a reference of s and changes its value during the iteration. - */ - times_iterator_impl( stepper_type stepper , system_type sys , state_type &s ) - : base_type( stepper , sys ) , m_state( &s ) { } - - protected: - - friend class boost::iterator_core_access; - - void increment() - { - if( ++m_t_start != m_t_end ) - { - while( detail::less_with_sign( this->m_t , static_cast<time_type>(*m_t_start) , this->m_dt ) ) - { - if( detail::less_with_sign( static_cast<time_type>(*m_t_start) - this->m_t , this->m_dt , this->m_dt ) ) - { - // we want to end exactly at the time point - time_type current_dt = static_cast<time_type>(*m_t_start) - this->m_t; - step_loop( current_dt ); - } else { - step_loop( this->m_dt ); - } - } - - } else { - this->m_at_end = true; - } - } - - private: - void step_loop( time_type &dt ) - { - unwrapped_stepper_type &stepper = this->m_stepper; - const size_t max_attempts = 1000; - size_t trials = 0; - controlled_step_result res = success; - do - { - res = stepper.try_step( this->m_system , *( this->m_state ) , this->m_t , dt ); - ++trials; - } - while( ( res == fail ) && ( trials < max_attempts ) ); - if( trials == max_attempts ) - { - BOOST_THROW_EXCEPTION( std::overflow_error( "Adaptive iterator : Maximal number of iterations reached. A step size could not be found." ) ); - } - } - - public: - const state_type& get_state() const - { - return *m_state; - } - - - private: - time_iterator_type m_t_start; - time_iterator_type m_t_end; - state_type* m_state; - }; - - - /* - * Specilization for dense outputer steppers - */ - /** - * \brief ODE Iterator with step size control and dense output. - * Implements an ODE iterator with adaptive step size control. Uses dense-output steppers. - * times_iterator is a model of single-pass iterator. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - */ - template< class Iterator , class Stepper , class System , class State , class TimeIterator , typename Tag > - class times_iterator_impl< Iterator , Stepper , System , State , TimeIterator , Tag , dense_output_stepper_tag > - : public detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > - { - private: - - - typedef Stepper stepper_type; - typedef System system_type; - typedef typename boost::numeric::odeint::unwrap_reference< stepper_type >::type unwrapped_stepper_type; - typedef State state_type; - typedef TimeIterator time_iterator_type; - typedef typename traits::time_type< stepper_type >::type time_type; - typedef typename traits::value_type< stepper_type >::type ode_value_type; - #ifndef DOXYGEN_SKIP - typedef detail::ode_iterator_base< Iterator , Stepper , System , State , Tag > base_type; - #endif - - - public: - - - /** - * \brief Constructs a times_iterator. This constructor should be used to construct the begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. - * \param t_start Iterator to the begin of a sequence of time values. - * \param t_end Iterator to the begin of a sequence of time values. - * \param dt The (initial) time step. - */ - times_iterator_impl( stepper_type stepper , system_type sys , state_type &s , - time_iterator_type t_start , time_iterator_type t_end , time_type dt ) - : base_type( stepper , sys , *t_start , dt ) , - m_t_start( t_start ) , m_t_end( t_end ) , m_final_time( *(t_end-1) ) , - m_state( &s ) - { - if( t_start != t_end ) - { - unwrapped_stepper_type &st = this->m_stepper; - st.initialize( *( this->m_state ) , this->m_t , this->m_dt ); - } else { - this->m_at_end = true; - } - } - - /** - * \brief Constructs a times_iterator. This constructor should be used to construct the end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param sys The system function (ODE) to solve. - * \param s The initial state. - */ - times_iterator_impl( stepper_type stepper , system_type sys , state_type &s ) - : base_type( stepper , sys ) , m_state( &s ) { } - - protected: - - friend class boost::iterator_core_access; - - void increment() - { - unwrapped_stepper_type &st = this->m_stepper; - if( ++m_t_start != m_t_end ) - { - this->m_t = static_cast<time_type>(*m_t_start); - while( detail::less_with_sign( st.current_time() , this->m_t , this->m_dt ) ) - { - // make sure we don't go beyond the last point - if( detail::less_with_sign( m_final_time-st.current_time() , st.current_time_step() , st.current_time_step() ) ) - { - st.initialize( st.current_state() , st.current_time() , m_final_time-st.current_time() ); - } - st.do_step( this->m_system ); - } - st.calc_state( this->m_t , *( this->m_state ) ); - } else { - this->m_at_end = true; - } - } - - public: - const state_type& get_state() const - { - return *m_state; - } - - - private: - time_iterator_type m_t_start; - time_iterator_type m_t_end; - time_type m_final_time; - state_type* m_state; - }; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_DETAIL_TIMES_ITERATOR_IMPL_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/functors.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/functors.hpp deleted file mode 100644 index b239217ac4..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/functors.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/functors.hpp - - [begin_description] - some functors for the iterator based integrate routines - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED - -#include <utility> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - - -template< class Observer > -struct obs_caller { - - size_t &m_n; - Observer m_obs; - - obs_caller( size_t &m , Observer &obs ) : m_n(m) , m_obs( obs ) {} - - template< class State , class Time > - void operator()( std::pair< const State & , const Time & > x ) - { - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - observer_type &obs = m_obs; - obs( x.first , x.second ); - m_n++; - } -}; - -template< class Observer , class Time > -struct obs_caller_time { - - Time &m_t; - Observer m_obs; - - obs_caller_time( Time &t , Observer &obs ) : m_t(t) , m_obs( obs ) {} - - template< class State > - void operator()( std::pair< const State & , const Time & > x ) - { - typedef typename odeint::unwrap_reference< Observer >::type observer_type; - observer_type &obs = m_obs; - obs( x.first , x.second ); - m_t = x.second; - } -}; - -} // namespace detail -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_FUNCTORS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_adaptive.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_adaptive.hpp deleted file mode 100644 index ccbbf497f3..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_adaptive.hpp +++ /dev/null @@ -1,121 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp - - [begin_description] - Default Integrate adaptive implementation. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED - -#include <stdexcept> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/integrate_const.hpp> -#include <boost/numeric/odeint/iterator/adaptive_time_iterator.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/functors.hpp> -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/util/copy.hpp> - -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -// forward declaration -template< class Stepper , class System , class State , class Time , class Observer> -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , stepper_tag ); - -/* - * integrate_adaptive for simple stepper is basically an integrate_const + some last step - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , stepper_tag -) -{ - size_t steps = detail::integrate_const( stepper , system , start_state , start_time , - end_time , dt , observer , stepper_tag() ); - typename odeint::unwrap_reference< Observer >::type &obs = observer; - typename odeint::unwrap_reference< Stepper >::type &st = stepper; - - Time end = start_time + dt*steps; - if( less_with_sign( end , end_time , dt ) ) - { //make a last step to end exactly at end_time - st.do_step( system , start_state , end , end_time - end ); - steps++; - obs( start_state , end_time ); - } - return steps; -} - - -/* - * classical integrate adaptive - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time &start_time , Time end_time , Time &dt , - Observer observer , controlled_stepper_tag -) -{ - size_t obs_calls = 0; - - boost::for_each( make_adaptive_time_range( stepper , system , start_state , - start_time , end_time , dt ) , - obs_caller< Observer >( obs_calls , observer ) ); - - return obs_calls-1; -} - - -/* - * integrate adaptive for dense output steppers - * - * step size control is used if the stepper supports it - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , dense_output_stepper_tag ) -{ - size_t obs_calls = 0; - - boost::for_each( make_adaptive_time_range( stepper , system , start_state , - start_time , end_time , dt ) , - obs_caller< Observer >( obs_calls , observer ) ); - - return obs_calls-1; -} - - - - -} // namespace detail -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_const.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_const.hpp deleted file mode 100644 index 10650369c1..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_const.hpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/integrate_const.hpp - - [begin_description] - integrate const implementation - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_INCLUDED - -#include <boost/range/algorithm/for_each.hpp> - -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> -#include <boost/numeric/odeint/iterator/const_step_time_iterator.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/integrate_adaptive.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/functors.hpp> -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -// forward declaration -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time &start_time , Time end_time , Time &dt , - Observer observer , controlled_stepper_tag -); - - -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , stepper_tag -) -{ - size_t obs_calls = 0; - - boost::for_each( make_const_step_time_range( stepper , system , start_state , - start_time , end_time , dt ) , - // should we use traits<Stepper>::state_type here instead of State? NO! - obs_caller< Observer >( obs_calls , observer ) ); - - // step integration steps gives step+1 observer calls - return obs_calls-1; -} - - - -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , controlled_stepper_tag -) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - - Time time = start_time; - const Time time_step = dt; - int step = 0; - - while( less_eq_with_sign( static_cast<Time>(time+time_step) , end_time , dt ) ) - { - obs( start_state , time ); - detail::integrate_adaptive( stepper , system , start_state , time , time+time_step , dt , - null_observer() , controlled_stepper_tag() ); - // direct computation of the time avoids error propagation happening when using time += dt - // we need clumsy type analysis to get boost units working here - ++step; - time = start_time + static_cast< typename unit_value_type<Time>::type >(step) * time_step; - } - obs( start_state , time ); - - return step; -} - - -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer , dense_output_stepper_tag -) -{ - size_t obs_calls = 0; - - boost::for_each( make_const_step_time_range( stepper , system , start_state , - start_time , end_time , dt ) , - obs_caller< Observer >( obs_calls , observer ) ); - return obs_calls-1; -} - - -} } } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_n_steps.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_n_steps.hpp deleted file mode 100644 index f90f8875ce..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_n_steps.hpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp - - [begin_description] - integrate steps implementation - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED - -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/integrate_adaptive.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/functors.hpp> -#include <boost/numeric/odeint/iterator/n_step_time_iterator.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> - -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -// forward declaration -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time &start_time , Time end_time , Time &dt , - Observer observer , controlled_stepper_tag -); - - -/* basic version */ -template< class Stepper , class System , class State , class Time , class Observer> -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer , stepper_tag ) -{ - // ToDo: is there a better way to extract the final time? - Time t = start_time; // Assignment is only here to avoid warnings. - boost::for_each( make_n_step_time_range( stepper , system , start_state , - start_time , dt , num_of_steps ) , - obs_caller_time< Observer , Time >( t , observer ) ); - return t; -} - - -/* controlled version */ -template< class Stepper , class System , class State , class Time , class Observer> -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer , controlled_stepper_tag ) -{ - typename odeint::unwrap_reference< Observer >::type &obs = observer; - - Time time = start_time; - Time time_step = dt; - - for( size_t step = 0; step < num_of_steps ; ++step ) - { - obs( start_state , time ); - detail::integrate_adaptive( stepper , system , start_state , time , static_cast<Time>(time+time_step) , dt , - null_observer() , controlled_stepper_tag() ); - // direct computation of the time avoids error propagation happening when using time += dt - // we need clumsy type analysis to get boost units working here - time = start_time + static_cast< typename unit_value_type<Time>::type >(step+1) * time_step; - } - obs( start_state , time ); - - return time; -} - - -/* dense output version */ -template< class Stepper , class System , class State , class Time , class Observer> -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer , dense_output_stepper_tag ) -{ - // ToDo: is there a better way to extract the final time? - Time t = start_time; // Assignment is only here to avoid warnings. - boost::for_each( make_n_step_time_range( stepper , system , start_state , - start_time , dt , num_of_steps ) , - obs_caller_time< Observer , Time >( t , observer ) ); - return t; -} - - -} -} -} -} - -#endif /* BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_N_STEPS_HPP_INCLUDED */ diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_times.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_times.hpp deleted file mode 100644 index bccc7c6b03..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/detail/integrate_times.hpp +++ /dev/null @@ -1,67 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/detail/integrate_times.hpp - - [begin_description] - Default integrate times implementation. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_TIMES_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_TIMES_HPP_INCLUDED - -#include <stdexcept> - -#include <boost/config.hpp> -#include <boost/range/algorithm/for_each.hpp> - -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> -#include <boost/numeric/odeint/iterator/times_time_iterator.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/functors.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - - - -/* - * integrate_times for all steppers - */ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer , class StepperTag > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - TimeIterator start_time , TimeIterator end_time , Time dt , - Observer observer , StepperTag -) -{ - size_t obs_calls = 0; - - boost::for_each( make_times_time_range( stepper , system , start_state , - start_time , end_time , dt ) , - // should we use traits<Stepper>::state_type here instead of State? NO! - obs_caller< Observer >( obs_calls , observer ) ); - - // step integration steps gives step+1 observer calls - return obs_calls-1; -} - - -} // namespace detail -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_ADAPTIVE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate.hpp deleted file mode 100644 index 9d88ef9ce1..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate.hpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate.hpp - - [begin_description] - Convenience methods which choose the stepper for the current ODE. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED - -#include <boost/utility/enable_if.hpp> - -#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp> -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/iterator/integrate/null_observer.hpp> -#include <boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp> - -// for has_value_type trait -#include <boost/numeric/odeint/algebra/detail/extract_value_type.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * ToDo : - * - * determine type of dxdt for units - * - */ -template< class System , class State , class Time , class Observer > -typename boost::enable_if< typename has_value_type<State>::type , size_t >::type -integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) -{ - typedef controlled_runge_kutta< runge_kutta_dopri5< State , typename State::value_type , State , Time > > stepper_type; - return integrate_adaptive( stepper_type() , system , start_state , start_time , end_time , dt , observer ); -} - - - -/* - * the two overloads are needed in order to solve the forwarding problem - */ -template< class System , class State , class Time > -size_t integrate( System system , State &start_state , Time start_time , Time end_time , Time dt ) -{ - return integrate( system , start_state , start_time , end_time , dt , null_observer() ); -} - - -/** - * \fn integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) - * \brief Integrates the ODE. - * - * Integrates the ODE given by system from start_time to end_time starting - * with start_state as initial condition and dt as initial time step. - * This function uses a dense output dopri5 stepper and performs an adaptive - * integration with step size control, thus dt changes during the integration. - * This method uses standard error bounds of 1E-6. - * After each step, the observer is called. - * - * \param system The system function to solve, hence the r.h.s. of the - * ordinary differential equation. - * \param start_state The initial state. - * \param start_time Start time of the integration. - * \param end_time End time of the integration. - * \param dt Initial step size, will be adjusted during the integration. - * \param observer Observer that will be called after each time step. - * \return The number of steps performed. - */ - - -/** - * \fn integrate( System system , State &start_state , Time start_time , Time end_time , Time dt ) - * \brief Integrates the ODE without observer calls. - * - * Integrates the ODE given by system from start_time to end_time starting - * with start_state as initial condition and dt as initial time step. - * This function uses a dense output dopri5 stepper and performs an adaptive - * integration with step size control, thus dt changes during the integration. - * This method uses standard error bounds of 1E-6. - * No observer is called. - * - * \param system The system function to solve, hence the r.h.s. of the - * ordinary differential equation. - * \param start_state The initial state. - * \param start_time Start time of the integration. - * \param end_time End time of the integration. - * \param dt Initial step size, will be adjusted during the integration. - * \return The number of steps performed. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp deleted file mode 100644 index 3229a00c6c..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_adaptive.hpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate_adaptive.hpp - - [begin_description] - Adaptive integration of ODEs. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED - -#include <boost/type_traits/is_same.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/integrate/null_observer.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/integrate_adaptive.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * the two overloads are needed in order to solve the forwarding problem - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_adaptive( - stepper , system , start_state , - start_time , end_time , dt , - observer , stepper_category() ); - - /* - * Suggestion for a new extendable version: - * - * integrator_adaptive< Stepper , System, State , Time , Observer , typename Stepper::stepper_category > integrator; - * return integrator.run( stepper , system , start_state , start_time , end_time , dt , observer ); - */ -} - -/** - * \brief Second version to solve the forwarding problem, - * can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_adaptive( - Stepper stepper , System system , const State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_adaptive( - stepper , system , start_state , - start_time , end_time , dt , - observer , stepper_category() ); -} - - - - -/** - * \brief integrate_adaptive without an observer. - */ -template< class Stepper , class System , class State , class Time > -size_t integrate_adaptive( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt ) -{ - return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() ); -} - -/** - * \brief Second version to solve the forwarding problem, - * can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time > -size_t integrate_adaptive( - Stepper stepper , System system , const State &start_state , - Time start_time , Time end_time , Time dt ) -{ - return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() ); -} - - -/************* DOXYGEN ************/ - - /** - * \fn integrate_adaptive( Stepper stepper , System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) - * \brief Integrates the ODE with adaptive step size. - * - * This function integrates the ODE given by system with the given stepper. - * The observer is called after each step. If the stepper has no error - * control, the step size remains constant and the observer is called at - * equidistant time points t0+n*dt. If the stepper is a ControlledStepper, - * the step size is adjusted and the observer is called in non-equidistant - * intervals. - * - * \param stepper The stepper to be used for numerical integration. - * \param system Function/Functor defining the rhs of the ODE. - * \param start_state The initial condition x0. - * \param start_time The initial time t0. - * \param end_time The final integration time tend. - * \param dt The time step between observer calls, _not_ necessarily the - * time step of the integration. - * \param observer Function/Functor called at equidistant time intervals. - * \return The number of steps performed. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_const.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_const.hpp deleted file mode 100644 index ffcea6c193..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_const.hpp +++ /dev/null @@ -1,158 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate_const.hpp - - [begin_description] - Constant integration of ODEs, meaning that the state of the ODE is observed on constant time intervals. - The routines makes full use of adaptive and dense-output methods. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED - -#include <boost/type_traits/is_same.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/integrate/null_observer.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/integrate_const.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/integrate_adaptive.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - - - - -/* - * Integrates with constant time step dt. - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer -) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - // we want to get as fast as possible to the end - if( boost::is_same< null_observer , Observer >::value ) - { - return detail::integrate_adaptive( - stepper , system , start_state , - start_time , end_time , dt , - observer , stepper_category() ); - } - else - { - return detail::integrate_const( stepper , system , start_state , - start_time , end_time , dt , - observer , stepper_category() ); - } -} - -/** - * \brief Second version to solve the forwarding problem, - * can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time , class Observer > -size_t integrate_const( - Stepper stepper , System system , const State &start_state , - Time start_time , Time end_time , Time dt , - Observer observer -) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - // we want to get as fast as possible to the end - if( boost::is_same< null_observer , Observer >::value ) - { - return detail::integrate_adaptive( - stepper , system , start_state , - start_time , end_time , dt , - observer , stepper_category() ); - } - else - { - return detail::integrate_const( stepper , system , start_state , - start_time , end_time , dt , - observer , stepper_category() ); - } -} - - - - - -/** - * \brief integrate_const without observer calls - */ -template< class Stepper , class System , class State , class Time > -size_t integrate_const( - Stepper stepper , System system , State &start_state , - Time start_time , Time end_time , Time dt -) -{ - return integrate_const( stepper , system , start_state , start_time , end_time , dt , null_observer() ); -} - -/** - * \brief Second version to solve the forwarding problem, - * can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time > -size_t integrate_const( - Stepper stepper , System system , const State &start_state , - Time start_time , Time end_time , Time dt -) -{ - return integrate_const( stepper , system , start_state , start_time , end_time , dt , null_observer() ); -} - - - - - - -/********* DOXYGEN *********/ - /** - * \fn integrate_const( Stepper stepper , System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) - * \brief Integrates the ODE with constant step size. - * - * Integrates the ODE defined by system using the given stepper. - * This method ensures that the observer is called at constant intervals dt. - * If the Stepper is a normal stepper without step size control, dt is also - * used for the numerical scheme. If a ControlledStepper is provided, the - * algorithm might reduce the step size to meet the error bounds, but it is - * ensured that the observer is always called at equidistant time points - * t0 + n*dt. If a DenseOutputStepper is used, the step size also may vary - * and the dense output is used to call the observer at equidistant time - * points. - * - * \param stepper The stepper to be used for numerical integration. - * \param system Function/Functor defining the rhs of the ODE. - * \param start_state The initial condition x0. - * \param start_time The initial time t0. - * \param end_time The final integration time tend. - * \param dt The time step between observer calls, _not_ necessarily the - * time step of the integration. - * \param observer Function/Functor called at equidistant time intervals. - * \return The number of steps performed. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_CONST_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_n_steps.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_n_steps.hpp deleted file mode 100644 index 8f30c77969..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_n_steps.hpp +++ /dev/null @@ -1,125 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate_n_steps.hpp - - [begin_description] - Integration of n steps with constant time size. Adaptive and dense-output methods are fully supported. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED - -#include <boost/type_traits/is_same.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/integrate/null_observer.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/integrate_n_steps.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * Integrates n steps - * - * the two overloads are needed in order to solve the forwarding problem - */ -template< class Stepper , class System , class State , class Time , class Observer> -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_n_steps( - stepper , system , start_state , - start_time , dt , num_of_steps , - observer , stepper_category() ); -} - -/** - * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time , class Observer > -Time integrate_n_steps( - Stepper stepper , System system , const State &start_state , - Time start_time , Time dt , size_t num_of_steps , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_n_steps( - stepper , system , start_state , - start_time , dt , num_of_steps , - observer , stepper_category() ); -} - - -/** - * \brief The same function as above, but without observer calls. - */ -template< class Stepper , class System , class State , class Time > -Time integrate_n_steps( - Stepper stepper , System system , State &start_state , - Time start_time , Time dt , size_t num_of_steps ) -{ - return integrate_n_steps( stepper , system , start_state , start_time , dt , num_of_steps , null_observer() ); -} - -/** - * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class Time > -Time integrate_n_steps( - Stepper stepper , System system , const State &start_state , - Time start_time , Time dt , size_t num_of_steps ) -{ - return integrate_n_steps( stepper , system , start_state , start_time , dt , num_of_steps , null_observer() ); -} - - - -/************* DOXYGEN *************/ - /** - * \fn Time integrate_n_steps( Stepper stepper , System system , State &start_state , Time start_time , Time dt , size_t num_of_steps , Observer observer ) - * \brief Integrates the ODE with constant step size. - * - * This function is similar to integrate_const. The observer is called at - * equidistant time intervals t0 + n*dt. - * If the Stepper is a normal stepper without step size control, dt is also - * used for the numerical scheme. If a ControlledStepper is provided, the - * algorithm might reduce the step size to meet the error bounds, but it is - * ensured that the observer is always called at equidistant time points - * t0 + n*dt. If a DenseOutputStepper is used, the step size also may vary - * and the dense output is used to call the observer at equidistant time - * points. The final integration time is always t0 + num_of_steps*dt. - * - * \param stepper The stepper to be used for numerical integration. - * \param system Function/Functor defining the rhs of the ODE. - * \param start_state The initial condition x0. - * \param start_time The initial time t0. - * \param dt The time step between observer calls, _not_ necessarily the - * time step of the integration. - * \param num_of_steps Number of steps to be performed - * \param observer Function/Functor called at equidistant time intervals. - * \return The number of steps performed. - */ - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_times.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_times.hpp deleted file mode 100644 index 1bbd836731..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/integrate_times.hpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/integrate_times.hpp - - [begin_description] - Integration of ODEs with observation at user defined points - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED - -#include <boost/type_traits/is_same.hpp> - -#include <boost/range.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/integrate/null_observer.hpp> -#include <boost/numeric/odeint/iterator/integrate/detail/integrate_times.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * the two overloads are needed in order to solve the forwarding problem - */ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - TimeIterator times_start , TimeIterator times_end , Time dt , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_times( - stepper , system , start_state , - times_start , times_end , dt , - observer , stepper_category() ); -} - -/** - * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , const State &start_state , - TimeIterator times_start , TimeIterator times_end , Time dt , - Observer observer ) -{ - typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category; - return detail::integrate_times( - stepper , system , start_state , - times_start , times_end , dt , - observer , stepper_category() ); -} - -/** - * \brief The same function as above, but without observer calls. - */ -template< class Stepper , class System , class State , class TimeRange , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , State &start_state , - const TimeRange × , Time dt , - Observer observer ) -{ - return integrate_times( - stepper , system , start_state , - boost::begin( times ) , boost::end( times ) , dt , observer ); -} - -/** - * \brief Solves the forwarding problem, can be called with Boost.Range as start_state. - */ -template< class Stepper , class System , class State , class TimeRange , class Time , class Observer > -size_t integrate_times( - Stepper stepper , System system , const State &start_state , - const TimeRange × , Time dt , - Observer observer ) -{ - return integrate_times( - stepper , system , start_state , - boost::begin( times ) , boost::end( times ) , dt , observer ); -} - - - - -/********* DOXYGEN ***********/ - - /** - * \fn size_t integrate_times( Stepper stepper , System system , State &start_state , TimeIterator times_start , TimeIterator times_end , Time dt , Observer observer ) - * \brief Integrates the ODE with observer calls at given time points. - * - * Integrates the ODE given by system using the given stepper. This function - * does observer calls at the subsequent time points given by the range - * times_start, times_end. If the stepper has not step size control, the - * step size might be reduced occasionally to ensure observer calls exactly - * at the time points from the given sequence. If the stepper is a - * ControlledStepper, the step size is adjusted to meet the error bounds, - * but also might be reduced occasionally to ensure correct observer calls. - * If a DenseOutputStepper is provided, the dense output functionality is - * used to call the observer at the given times. The end time of the - * integration is always *(end_time-1). - * - * \param stepper The stepper to be used for numerical integration. - * \param system Function/Functor defining the rhs of the ODE. - * \param start_state The initial condition x0. - * \param times_start Iterator to the start time - * \param times_end Iterator to the end time - * \param dt The time step between observer calls, _not_ necessarily the - * time step of the integration. - * \param observer Function/Functor called at equidistant time intervals. - * \return The number of steps performed. - */ - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/null_observer.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/null_observer.hpp deleted file mode 100644 index 4d9a070a62..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/null_observer.hpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/null_observer.hpp - - [begin_description] - null_observer - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED - -namespace boost { -namespace numeric { -namespace odeint { - -struct null_observer -{ - template< class State , class Time > - void operator()( const State& /* x */ , Time /* t */ ) const - { - - } -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_NULL_OBSERVER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/observer_collection.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/observer_collection.hpp deleted file mode 100644 index 26101a3afc..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/integrate/observer_collection.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/integrate/observer_collection.hpp - - [begin_description] - Collection of observers, which are all called during the evolution of the ODE. - [end_description] - - Copyright 2009-2011 Karsten Ahnert - Copyright 2009-2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED - -#include <vector> - -#include <boost/function.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< class State , class Time > -class observer_collection -{ -public: - - typedef boost::function< void( const State& , const Time& ) > observer_type; - typedef std::vector< observer_type > collection_type; - - void operator()( const State& x , Time t ) - { - for( size_t i=0 ; i<m_observers.size() ; ++i ) - m_observers[i]( x , t ); - } - - collection_type& observers( void ) { return m_observers; } - const collection_type& observers( void ) const { return m_observers; } - -private: - - collection_type m_observers; -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_INTEGRATE_OBSERVER_COLLECTION_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/n_step_iterator.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/n_step_iterator.hpp deleted file mode 100644 index 195e981d65..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/n_step_iterator.hpp +++ /dev/null @@ -1,168 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/n_step_iterator.hpp - - [begin_description] - Iterator for iterating through the solution of an ODE with constant step size performing exactly n steps. - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_N_STEP_ITERATOR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_N_STEP_ITERATOR_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/stepper_traits.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> -#include <boost/numeric/odeint/iterator/impl/n_step_iterator_impl.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - - /* use the n_step_iterator_impl with the right tags */ - template< class Stepper , class System , class State -#ifndef DOXYGEN_SKIP - , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type -#endif - > - class n_step_iterator : public n_step_iterator_impl< - n_step_iterator< Stepper , System , State , StepperTag > , - Stepper , System , State , detail::ode_state_iterator_tag , StepperTag - > - { - typedef typename traits::time_type< Stepper >::type time_type; - typedef n_step_iterator< Stepper , System , State , StepperTag > iterator_type; - - public: - n_step_iterator( Stepper stepper , System sys , State &s , time_type t , time_type dt , size_t num_of_steps ) - : n_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s , t , dt , num_of_steps ) - {} - - n_step_iterator( Stepper stepper , System sys , State &s ) - : n_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s ) - {} - }; - - /* make functions */ - - template< class Stepper , class System , class State > - n_step_iterator< Stepper , System, State > make_n_step_iterator_begin( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t , - typename traits::time_type< Stepper >::type dt , - size_t num_of_steps ) - { - return n_step_iterator< Stepper , System , State >( stepper , system , x , t , dt , num_of_steps ); - } - - template< class Stepper , class System , class State > - n_step_iterator< Stepper , System , State > make_n_step_iterator_end( - Stepper stepper , - System system , - State &x ) - { - return n_step_iterator< Stepper , System , State >( stepper , system , x ); - } - - template< class Stepper , class System , class State > - std::pair< n_step_iterator< Stepper , System , State > , n_step_iterator< Stepper , System , State > > - make_n_step_range( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t , - typename traits::time_type< Stepper >::type dt , - size_t num_of_steps ) - { - return std::make_pair( - n_step_iterator< Stepper , System , State >( stepper , system , x , t , dt , num_of_steps ) , - n_step_iterator< Stepper , System , State >( stepper , system , x ) - ); - } - - - /** - * \class n_step_iterator - * - * \brief ODE Iterator with constant step size. The value type of this iterator is the state type of the stepper. - * - * Implements an iterator representing the solution of an ODE starting from t - * with n steps and a constant step size dt. - * After each iteration the iterator dereferences to the state x at the next - * time t+dt. - * This iterator can be used with Steppers and - * DenseOutputSteppers and it always makes use of the all the given steppers - * capabilities. A for_each over such an iterator range behaves similar to - * the integrate_n_steps routine. - * - * n_step_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - * \tparam State The state type of the ODE. - */ - - - /** - * \fn make_n_step_iterator_begin( Stepper stepper , System system , State &x , typename traits::time_type< Stepper >::type t , typename traits::time_type< Stepper >::type dt , size_t num_of_steps ) - * - * \brief Factory function for n_step_iterator. Constructs a begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param dt The initial time step. - * \param num_of_steps The number of steps to be executed. - * \returns The n-step iterator. - */ - - - /** - * \fn make_n_step_iterator_end( Stepper stepper , System system , State &x ) - * \brief Factory function for n_step_iterator. Constructs an end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \returns The const_step_iterator. - */ - - - /** - * \fn make_n_step_range( Stepper stepper , System system , State &x , typename traits::time_type< Stepper >::type t , typename traits::time_type< Stepper >::type dt , , size_t num_of_steps ) - * - * \brief Factory function to construct a single pass range of n-step iterators. A range is here a pair - * of n_step_iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator store a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param dt The initial time step. - * \param num_of_steps The number of steps to be executed. - * \returns The n-step range. - */ - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_CONST_N_STEP_ITERATOR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/n_step_time_iterator.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/n_step_time_iterator.hpp deleted file mode 100644 index 8ed17dee43..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/n_step_time_iterator.hpp +++ /dev/null @@ -1,169 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/n_step_time_iterator.hpp - - [begin_description] - Iterator for iterating through the solution of an ODE with constant step size performing exactly n steps. - The dereferenced type contains also the time. - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_N_STEP_TIME_ITERATOR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_N_STEP_TIME_ITERATOR_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/stepper_traits.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> -#include <boost/numeric/odeint/iterator/impl/n_step_iterator_impl.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - - /* use the n_step_iterator_impl with the right tags */ - template< class Stepper , class System , class State -#ifndef DOXYGEN_SKIP - , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type -#endif - > - class n_step_time_iterator : public n_step_iterator_impl< - n_step_time_iterator< Stepper , System , State , StepperTag > , - Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag - > - { - typedef typename traits::time_type< Stepper >::type time_type; - typedef n_step_time_iterator< Stepper , System , State , StepperTag > iterator_type; - - public: - n_step_time_iterator( Stepper stepper , System sys , State &s , time_type t , time_type dt , size_t num_of_steps ) - : n_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s , t , dt , num_of_steps ) - {} - - n_step_time_iterator( Stepper stepper , System sys , State &s ) - : n_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s ) - {} - }; - - /* make functions */ - - template< class Stepper , class System , class State > - n_step_time_iterator< Stepper , System, State > make_n_step_time_iterator_begin( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t , - typename traits::time_type< Stepper >::type dt , - size_t num_of_steps ) - { - return n_step_time_iterator< Stepper , System , State >( stepper , system , x , t , dt , num_of_steps ); - } - - template< class Stepper , class System , class State > - n_step_time_iterator< Stepper , System , State > make_n_step_time_iterator_end( - Stepper stepper , - System system , - State &x ) - { - return n_step_time_iterator< Stepper , System , State >( stepper , system , x ); - } - - template< class Stepper , class System , class State > - std::pair< n_step_time_iterator< Stepper , System , State > , n_step_time_iterator< Stepper , System , State > > - make_n_step_time_range( - Stepper stepper , - System system , - State &x , - typename traits::time_type< Stepper >::type t , - typename traits::time_type< Stepper >::type dt , - size_t num_of_steps ) - { - return std::make_pair( - n_step_time_iterator< Stepper , System , State >( stepper , system , x , t , dt , num_of_steps ) , - n_step_time_iterator< Stepper , System , State >( stepper , system , x ) - ); - } - - - /** - * \class n_step_time_iterator - * - * \brief ODE Iterator with constant step size. The value type of this iterator is a std::pair containing state and time. - * - * Implements an iterator representing the solution of an ODE starting from t - * with n steps and a constant step size dt. - * After each iteration the iterator dereferences to a pair of state and time at the next - * time t+dt. - * This iterator can be used with Steppers and - * DenseOutputSteppers and it always makes use of the all the given steppers - * capabilities. A for_each over such an iterator range behaves similar to - * the integrate_n_steps routine. - * - * n_step_time_iterator is a model of single-pass iterator. - * - * The value type of this iterator is pair of state and time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - * \tparam State The state type of the ODE. - */ - - - /** - * \fn make_n_step_time_iterator_begin( Stepper stepper , System system , State &x , typename traits::time_type< Stepper >::type t , typename traits::time_type< Stepper >::type dt , size_t num_of_steps ) - * - * \brief Factory function for n_step_time_iterator. Constructs a begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param dt The initial time step. - * \param num_of_steps The number of steps to be executed. - * \returns The n-step iterator. - */ - - - /** - * \fn make_n_step_time_iterator_end( Stepper stepper , System system , State &x ) - * \brief Factory function for n_step_time_iterator. Constructs an end iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \returns The const_step_iterator. - */ - - - /** - * \fn make_n_step_time_range( Stepper stepper , System system , State &x , typename traits::time_type< Stepper >::type t , typename traits::time_type< Stepper >::type dt , size_t num_of_steps ) - * - * \brief Factory function to construct a single pass range of n-step iterators. A range is here a pair - * of n_step_time_iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator store a reference of s and changes its value during the iteration. - * \param t The initial time. - * \param dt The initial time step. - * \param num_of_steps The number of steps to be executed. - * \returns The n-step range. - */ - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_CONST_N_STEP_TIME_ITERATOR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/times_iterator.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/times_iterator.hpp deleted file mode 100644 index e6c9b85b78..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/times_iterator.hpp +++ /dev/null @@ -1,189 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/times_iterator.hpp - - [begin_description] - Iterator for iterating through the solution of an ODE with oscillator calls at times from a given sequence. - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_TIMES_ITERATOR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_TIMES_ITERATOR_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/stepper_traits.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> -#include <boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - - /* use the times_iterator_impl with the right tags */ - template< class Stepper , class System , class State , class TimeIterator -#ifndef DOXYGEN_SKIP - , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type -#endif - > - class times_iterator : public times_iterator_impl< - times_iterator< Stepper , System , State , TimeIterator , StepperTag > , - Stepper , System , State , TimeIterator , detail::ode_state_iterator_tag , StepperTag - > - { - typedef typename traits::time_type< Stepper >::type time_type; - typedef times_iterator< Stepper , System , State , TimeIterator , StepperTag > iterator_type; - - public: - times_iterator( Stepper stepper , System sys , State &s , - TimeIterator t_start , TimeIterator t_end , time_type dt ) - : times_iterator_impl< iterator_type , Stepper , System , State , TimeIterator, detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s , t_start , t_end , dt ) - {} - - times_iterator( Stepper stepper , System sys , State &s ) - : times_iterator_impl< iterator_type , Stepper , System , State , TimeIterator , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s ) - {} - }; - - /* make functions */ - - template< class Stepper , class System , class State , class TimeIterator > - times_iterator< Stepper , System, State , TimeIterator > make_times_iterator_begin( - Stepper stepper , - System system , - State &x , - TimeIterator t_start , - TimeIterator t_end , - typename traits::time_type< Stepper >::type dt ) - { - return times_iterator< Stepper , System , State , TimeIterator >( stepper , system , x , t_start , t_end , dt ); - } - - // ToDo: requires to specifically provide the TimeIterator template parameter, can this be improved? - template< class TimeIterator , class Stepper , class System , class State > - times_iterator< Stepper , System , State , TimeIterator > make_times_iterator_end( - Stepper stepper , - System system , - State &x ) - //TimeIterator t_end ) - { - return times_iterator< Stepper , System , State , TimeIterator >( stepper , system , x ); - } - - template< class Stepper , class System , class State , class TimeIterator > - std::pair< times_iterator< Stepper , System , State , TimeIterator > , - times_iterator< Stepper , System , State , TimeIterator > > - make_times_range( - Stepper stepper , - System system , - State &x , - TimeIterator t_start , - TimeIterator t_end , - typename traits::time_type< Stepper >::type dt ) - { - return std::make_pair( - times_iterator< Stepper , System , State , TimeIterator >( stepper , system , x , t_start , t_end , dt ) , - times_iterator< Stepper , System , State , TimeIterator >( stepper , system , x ) - ); - } - - - /** - * \class times_iterator - * - * \brief ODE Iterator with given evaluation points. The value type of this iterator is the state type of the stepper. - * - * Implements an iterator representing the solution of an ODE from *t_start - * to *t_end evaluated at time points given by the sequence t_start to t_end. - * t_start and t_end are iterators representing a sequence of time points - * where the solution of the ODE should be evaluated. - * After each iteration the iterator dereferences to the state x at the next - * time *t_start++ until t_end is reached. - * This iterator can be used with Steppers, ControlledSteppers and - * DenseOutputSteppers and it always makes use of the all the given steppers - * capabilities. A for_each over such an iterator range behaves similar to - * the integrate_times routine. - * - * times_iterator is a model of single-pass iterator. - * - * The value type of this iterator is the state type of the stepper. Hence one can only access the state and not the current time. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - * \tparam State The state type of the ODE. - * \tparam TimeIterator The iterator type for the sequence of time points. - */ - - - - /** - * \fn make_times_iterator_begin( Stepper stepper , - System system , - State &x , - TimeIterator t_start , - TimeIterator t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function for times_iterator. Constructs a begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t_start Begin iterator of the sequence of evaluation time points. - * \param t_end End iterator of the sequence of evaluation time points. - * \param dt The initial time step. - * \returns The times iterator. - */ - - - /** - * \fn make_times_iterator_end( Stepper stepper , System system , State &x ) - * \brief Factory function for times_iterator. Constructs an end iterator. - * - * \tparam TimesIterator The iterator type of the time sequence, must be specifically provided. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \returns The times iterator. - * - * This function needs the TimeIterator type specifically defined as a - * template parameter. - */ - - - /** - * \fn make_times_range( Stepper stepper , System system , State &x , - TimeIterator t_start , - TimeIterator t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function to construct a single pass range of times iterators. A range is here a pair - * of times_iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator store a reference of s and changes its value during the iteration. - * \param t_start Begin iterator of the sequence of evaluation time points. - * \param t_end End iterator of the sequence of evaluation time points. - * \param dt The initial time step. - * \returns The times iterator range. - */ - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_TIMES_ITERATOR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/iterator/times_time_iterator.hpp b/contrib/restricted/boost/boost/numeric/odeint/iterator/times_time_iterator.hpp deleted file mode 100644 index 94fd9a3f0f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/iterator/times_time_iterator.hpp +++ /dev/null @@ -1,193 +0,0 @@ - -/* - [auto_generated] - boost/numeric/odeint/iterator/times_time_iterator.hpp - - [begin_description] - Iterator for iterating through the solution of an ODE with oscillator calls at times from a given sequence. - The dereferenced type contains also the time. - [end_description] - - Copyright 2009-2013 Karsten Ahnert - Copyright 2009-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_ITERATOR_TIMES_TIME_ITERATOR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_ITERATOR_TIMES_TIME_ITERATOR_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/stepper_traits.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp> -#include <boost/numeric/odeint/iterator/impl/times_iterator_impl.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - - /* use the times_iterator_impl with the right tags */ - template< class Stepper , class System , class State , class TimeIterator -#ifndef DOXYGEN_SKIP - , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type -#endif - > - class times_time_iterator : public times_iterator_impl< - times_time_iterator< Stepper , System , State , TimeIterator , StepperTag > , - Stepper , System , State , TimeIterator , detail::ode_state_time_iterator_tag , StepperTag - > - { - typedef typename traits::time_type< Stepper >::type time_type; - typedef times_time_iterator< Stepper , System , State , TimeIterator , StepperTag > iterator_type; - - public: - times_time_iterator( Stepper stepper , System sys , State &s , - TimeIterator t_start , TimeIterator t_end , time_type dt ) - : times_iterator_impl< iterator_type , Stepper , System , State , TimeIterator, detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s , t_start , t_end , dt ) - {} - - times_time_iterator( Stepper stepper , System sys , State &s ) - : times_iterator_impl< iterator_type , Stepper , System , State , TimeIterator , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s ) - {} - }; - - /* make functions */ - - template< class Stepper , class System , class State , class TimeIterator > - times_time_iterator< Stepper , System, State , TimeIterator > make_times_time_iterator_begin( - Stepper stepper , - System system , - State &x , - TimeIterator t_start , - TimeIterator t_end , - typename traits::time_type< Stepper >::type dt ) - { - return times_time_iterator< Stepper , System , State , TimeIterator >( stepper , system , x , t_start , t_end , dt ); - } - - // ToDo: requires to specifically provide the TimeIterator template parameter, can this be improved? - template< class TimeIterator , class Stepper , class System , class State > - times_time_iterator< Stepper , System , State , TimeIterator > make_times_time_iterator_end( - Stepper stepper , - System system , - State &x ) - //TimeIterator t_end ) - { - return times_time_iterator< Stepper , System , State , TimeIterator >( stepper , system , x ); - } - - template< class Stepper , class System , class State , class TimeIterator > - std::pair< times_time_iterator< Stepper , System , State , TimeIterator > , - times_time_iterator< Stepper , System , State , TimeIterator > > - make_times_time_range( - Stepper stepper , - System system , - State &x , - TimeIterator t_start , - TimeIterator t_end , - typename traits::time_type< Stepper >::type dt ) - { - return std::make_pair( - times_time_iterator< Stepper , System , State , TimeIterator >( stepper , system , x , t_start , t_end , dt ) , - times_time_iterator< Stepper , System , State , TimeIterator >( stepper , system , x ) - ); - } - - - - - - /** - * \class times_time_iterator - * - * \brief ODE Iterator with given evaluation points. The value type of this iterator is a std::pair containing state and time. - * - * Implements an iterator representing the solution of an ODE from *t_start - * to *t_end evaluated at time points given by the sequence t_start to t_end. - * t_start and t_end are iterators representing a sequence of time points - * where the solution of the ODE should be evaluated. - * After each iteration the iterator dereferences to a pair with the state - * and the time at the next evaluation point *t_start++ until t_end is reached. - * This iterator can be used with Steppers, ControlledSteppers and - * DenseOutputSteppers and it always makes use of the all the given steppers - * capabilities. A for_each over such an iterator range behaves similar to - * the integrate_times routine. - * - * times_time_iterator is a model of single-pass iterator. - * - * The value type of this iterator is a pair of state and time type. - * - * \tparam Stepper The stepper type which should be used during the iteration. - * \tparam System The type of the system function (ODE) which should be solved. - * \tparam State The state type of the ODE. - * \tparam TimeIterator The iterator type for the sequence of time points. - */ - - - - /** - * \fn make_times_time_iterator_begin( Stepper stepper , - System system , - State &x , - TimeIterator t_start , - TimeIterator t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function for times_time_iterator. Constructs a begin iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \param t_start Begin iterator of the sequence of evaluation time points. - * \param t_end End iterator of the sequence of evaluation time points. - * \param dt The initial time step. - * \returns The times_time iterator. - */ - - - /** - * \fn make_times_time_iterator_end( Stepper stepper , System system , State &x ) - * \brief Factory function for times_time_iterator. Constructs an end iterator. - * - * \tparam TimesIterator The iterator type of the time sequence, must be specifically provided. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator stores a reference of s and changes its value during the iteration. - * \returns The times_time iterator. - * - * This function needs the TimeIterator type specifically defined as a - * template parameter. - */ - - - /** - * \fn make_times_time_range( Stepper stepper , System system , State &x , - TimeIterator t_start , - TimeIterator t_end , - typename traits::time_type< Stepper >::type dt ) - * - * \brief Factory function to construct a single pass range of times_time iterators. A range is here a pair - * of times_iterator. - * - * \param stepper The stepper to use during the iteration. - * \param system The system function (ODE) to solve. - * \param x The initial state. const_step_iterator store a reference of s and changes its value during the iteration. - * \param t_start Begin iterator of the sequence of evaluation time points. - * \param t_end End iterator of the sequence of evaluation time points. - * \param dt The initial time step. - * \returns The times_time iterator range. - */ - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_ITERATOR_TIMES_TIME_ITERATOR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_bashforth.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_bashforth.hpp deleted file mode 100644 index 5ff1e8358c..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_bashforth.hpp +++ /dev/null @@ -1,420 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/adams_bashforth.hpp - - [begin_description] - Implementaton of the Adam-Bashforth method a multistep method used for the predictor step in the - Adams-Bashforth-Moulton method. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2013 Mario Mulansky - Copyright 2012 Christoph Koke - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_HPP_INCLUDED - -#include <boost/static_assert.hpp> - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> - -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta4.hpp> -#include <boost/numeric/odeint/stepper/extrapolation_stepper.hpp> - -#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp> - -#include <boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp> -#include <boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp> -#include <boost/numeric/odeint/stepper/detail/rotating_buffer.hpp> - -#include <boost/mpl/arithmetic.hpp> -#include <boost/mpl/min_max.hpp> -#include <boost/mpl/equal_to.hpp> - -namespace mpl = boost::mpl; - - -namespace boost { -namespace numeric { -namespace odeint { - - using mpl::int_; - - /* if N >= 4, returns the smallest even number > N, otherwise returns 4 */ - template < int N > - struct order_helper - : mpl::max< typename mpl::eval_if< - mpl::equal_to< mpl::modulus< int_< N >, int_< 2 > >, - int_< 0 > >, - int_< N >, int_< N + 1 > >::type, - int_< 4 > >::type - { }; - -template< -size_t Steps , -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer , -class InitializingStepper = extrapolation_stepper< order_helper<Steps>::value, - State, Value, Deriv, Time, - Algebra, Operations, Resizer > -> -class adams_bashforth : public algebra_stepper_base< Algebra , Operations > -{ - -#ifndef DOXYGEN_SKIP - BOOST_STATIC_ASSERT(( Steps > 0 )); - BOOST_STATIC_ASSERT(( Steps < 9 )); -#endif - -public : - - typedef State state_type; - typedef state_wrapper< state_type > wrapped_state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef Time time_type; - typedef Resizer resizer_type; - typedef stepper_tag stepper_category; - - typedef InitializingStepper initializing_stepper_type; - - typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type; - typedef typename algebra_stepper_base_type::algebra_type algebra_type; - typedef typename algebra_stepper_base_type::operations_type operations_type; -#ifndef DOXYGEN_SKIP - typedef adams_bashforth< Steps , State , Value , Deriv , Time , Algebra , Operations , Resizer , InitializingStepper > stepper_type; -#endif - static const size_t steps = Steps; - - - - typedef unsigned short order_type; - static const order_type order_value = steps; - - typedef detail::rotating_buffer< wrapped_deriv_type , steps > step_storage_type; - - - - order_type order( void ) const { return order_value; } - - adams_bashforth( const algebra_type &algebra = algebra_type() ) - : algebra_stepper_base_type( algebra ) , - m_step_storage() , m_resizer() , m_coefficients() , - m_steps_initialized( 0 ) , m_initializing_stepper() - { } - - - - /* - * Version 1 : do_step( system , x , t , dt ); - * - * solves the forwarding problem - */ - template< class System , class StateInOut > - void do_step( System system , StateInOut &x , time_type t , time_type dt ) - { - do_step( system , x , t , x , dt ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. - */ - template< class System , class StateInOut > - void do_step( System system , const StateInOut &x , time_type t , time_type dt ) - { - do_step( system , x , t , x , dt ); - } - - - - /* - * Version 2 : do_step( system , in , t , out , dt ); - * - * solves the forwarding problem - */ - - template< class System , class StateIn , class StateOut > - void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - { - do_step_impl( system , in , t , out , dt ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateOut. - */ - template< class System , class StateIn , class StateOut > - void do_step( System system , const StateIn &in , time_type t , const StateOut &out , time_type dt ) - { - do_step_impl( system , in , t , out , dt ); - } - - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_impl( x ); - } - - const step_storage_type& step_storage( void ) const - { - return m_step_storage; - } - - step_storage_type& step_storage( void ) - { - return m_step_storage; - } - - template< class ExplicitStepper , class System , class StateIn > - void initialize( ExplicitStepper explicit_stepper , System system , StateIn &x , time_type &t , time_type dt ) - { - typename odeint::unwrap_reference< ExplicitStepper >::type &stepper = explicit_stepper; - typename odeint::unwrap_reference< System >::type &sys = system; - - m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); - - for( size_t i=0 ; i+1<steps ; ++i ) - { - if( i != 0 ) m_step_storage.rotate(); - sys( x , m_step_storage[0].m_v , t ); - stepper.do_step_dxdt_impl( system, x, m_step_storage[0].m_v, t, - dt ); - t += dt; - } - m_steps_initialized = steps; - } - - template< class System , class StateIn > - void initialize( System system , StateIn &x , time_type &t , time_type dt ) - { - initialize( detail::ref( m_initializing_stepper ) , system , x , t , dt ); - } - - void reset( void ) - { - m_steps_initialized = 0; - } - - bool is_initialized( void ) const - { - return m_steps_initialized >= ( steps - 1 ); - } - - const initializing_stepper_type& initializing_stepper( void ) const { return m_initializing_stepper; } - - initializing_stepper_type& initializing_stepper( void ) { return m_initializing_stepper; } - -private: - - template< class System , class StateIn , class StateOut > - void do_step_impl( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - if( m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ) ) - { - m_steps_initialized = 0; - } - - if( m_steps_initialized + 1 < steps ) - { - if( m_steps_initialized != 0 ) m_step_storage.rotate(); - sys( in , m_step_storage[0].m_v , t ); - m_initializing_stepper.do_step_dxdt_impl( - system, in, m_step_storage[0].m_v, t, out, dt ); - ++m_steps_initialized; - } - else - { - m_step_storage.rotate(); - sys( in , m_step_storage[0].m_v , t ); - detail::adams_bashforth_call_algebra< steps , algebra_type , operations_type >()( this->m_algebra , in , out , m_step_storage , m_coefficients , dt ); - } - } - - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized( false ); - for( size_t i=0 ; i<steps ; ++i ) - { - resized |= adjust_size_by_resizeability( m_step_storage[i] , x , typename is_resizeable<deriv_type>::type() ); - } - return resized; - } - - step_storage_type m_step_storage; - resizer_type m_resizer; - detail::adams_bashforth_coefficients< value_type , steps > m_coefficients; - size_t m_steps_initialized; - initializing_stepper_type m_initializing_stepper; - -}; - - -/***** DOXYGEN *****/ - -/** - * \class adams_bashforth - * \brief The Adams-Bashforth multistep algorithm. - * - * The Adams-Bashforth method is a multi-step algorithm with configurable step - * number. The step number is specified as template parameter Steps and it - * then uses the result from the previous Steps steps. See also - * <a href="http://en.wikipedia.org/wiki/Linear_multistep_method">en.wikipedia.org/wiki/Linear_multistep_method</a>. - * Currently, a maximum of Steps=8 is supported. - * The method is explicit and fulfills the Stepper concept. Step size control - * or continuous output are not provided. - * - * This class derives from algebra_base and inherits its interface via - * CRTP (current recurring template pattern). For more details see - * algebra_stepper_base. - * - * \tparam Steps The number of steps (maximal 8). - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - * \tparam InitializingStepper The stepper for the first two steps. - */ - - /** - * \fn adams_bashforth::adams_bashforth( const algebra_type &algebra ) - * \brief Constructs the adams_bashforth class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored. - */ - - /** - * \fn order_type adams_bashforth::order( void ) const - * \brief Returns the order of the algorithm, which is equal to the number of steps. - * \return order of the method. - */ - - /** - * \fn void adams_bashforth::do_step( System system , StateInOut &x , time_type t , time_type dt ) - * \brief This method performs one step. It transforms the result in-place. - * - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - /** - * \fn void adams_bashforth::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - /** - * \fn void adams_bashforth::adjust_size( const StateType &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - - - /** - * \fn const step_storage_type& adams_bashforth::step_storage( void ) const - * \brief Returns the storage of intermediate results. - * \return The storage of intermediate results. - */ - - /** - * \fn step_storage_type& adams_bashforth::step_storage( void ) - * \brief Returns the storage of intermediate results. - * \return The storage of intermediate results. - */ - - /** - * \fn void adams_bashforth::initialize( ExplicitStepper explicit_stepper , System system , StateIn &x , time_type &t , time_type dt ) - * \brief Initialized the stepper. Does Steps-1 steps with the explicit_stepper to fill the buffer. - * \param explicit_stepper the stepper used to fill the buffer of previous step results - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - /** - * \fn void adams_bashforth::initialize( System system , StateIn &x , time_type &t , time_type dt ) - * \brief Initialized the stepper. Does Steps-1 steps with an internal instance of InitializingStepper to fill the buffer. - * \note The state x and time t are updated to the values after Steps-1 initial steps. - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The initial state of the ODE which should be solved, updated in this method. - * \param t The initial value of the time, updated in this method. - * \param dt The step size. - */ - - /** - * \fn void adams_bashforth::reset( void ) - * \brief Resets the internal buffer of the stepper. - */ - - /** - * \fn bool adams_bashforth::is_initialized( void ) const - * \brief Returns true if the stepper has been initialized. - * \return bool true if stepper is initialized, false otherwise - */ - - /** - * \fn const initializing_stepper_type& adams_bashforth::initializing_stepper( void ) const - * \brief Returns the internal initializing stepper instance. - * \return initializing_stepper - */ - - /** - * \fn const initializing_stepper_type& adams_bashforth::initializing_stepper( void ) const - * \brief Returns the internal initializing stepper instance. - * \return initializing_stepper - */ - - /** - * \fn initializing_stepper_type& adams_bashforth::initializing_stepper( void ) - * \brief Returns the internal initializing stepper instance. - * \return initializing_stepper - */ - -} // odeint -} // numeric -} // boost - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp deleted file mode 100644 index f3edce1989..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp +++ /dev/null @@ -1,314 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp - - [begin_description] - Implementation of the Adams-Bashforth-Moulton method, a predictor-corrector multistep method. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2013 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/bind.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/numeric/odeint/stepper/adams_bashforth.hpp> -#include <boost/numeric/odeint/stepper/adams_moulton.hpp> - - - -namespace boost { -namespace numeric { -namespace odeint { - - -template< -size_t Steps , -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer, -class InitializingStepper = runge_kutta4< State , Value , Deriv , Time , Algebra , Operations, Resizer > -> -class adams_bashforth_moulton -{ - -#ifndef DOXYGEN_SKIP - BOOST_STATIC_ASSERT(( Steps > 0 )); - BOOST_STATIC_ASSERT(( Steps < 9 )); -#endif - -public : - - typedef State state_type; - typedef state_wrapper< state_type > wrapped_state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef Time time_type; - typedef Algebra algebra_type; - typedef Operations operations_type; - typedef Resizer resizer_type; - typedef stepper_tag stepper_category; - typedef InitializingStepper initializing_stepper_type; - - static const size_t steps = Steps; -#ifndef DOXYGEN_SKIP - typedef adams_bashforth< steps , state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type, initializing_stepper_type > adams_bashforth_type; - typedef adams_moulton< steps , state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > adams_moulton_type; - typedef adams_bashforth_moulton< steps , state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type , initializing_stepper_type> stepper_type; -#endif //DOXYGEN_SKIP - typedef unsigned short order_type; - static const order_type order_value = steps; - - /** \brief Constructs the adams_bashforth class. */ - adams_bashforth_moulton( void ) - : m_adams_bashforth() , m_adams_moulton( m_adams_bashforth.algebra() ) - , m_x() , m_resizer() - { } - - adams_bashforth_moulton( const algebra_type &algebra ) - : m_adams_bashforth( algebra ) , m_adams_moulton( m_adams_bashforth.algebra() ) - , m_x() , m_resizer() - { } - - order_type order( void ) const { return order_value; } - - template< class System , class StateInOut > - void do_step( System system , StateInOut &x , time_type t , time_type dt ) - { - do_step_impl1( system , x , t , dt ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. - */ - template< class System , class StateInOut > - void do_step( System system , const StateInOut &x , time_type t , time_type dt ) - { - do_step_impl1( system , x , t , dt ); - } - - template< class System , class StateIn , class StateOut > - void do_step( System system , const StateIn &in , time_type t , const StateOut &out , time_type dt ) - { - do_step_impl2( system , in , t , out , dt ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateOut. - */ - template< class System , class StateIn , class StateOut > - void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - { - do_step_impl2( system , in ,t , out , dt ); - } - - - template< class StateType > - void adjust_size( const StateType &x ) - { - m_adams_bashforth.adjust_size( x ); - m_adams_moulton.adjust_size( x ); - resize_impl( x ); - } - - - template< class ExplicitStepper , class System , class StateIn > - void initialize( ExplicitStepper explicit_stepper , System system , StateIn &x , time_type &t , time_type dt ) - { - m_adams_bashforth.initialize( explicit_stepper , system , x , t , dt ); - } - - - template< class System , class StateIn > - void initialize( System system , StateIn &x , time_type &t , time_type dt ) - { - m_adams_bashforth.initialize( system , x , t , dt ); - } - - - void reset(void) - { - m_adams_bashforth.reset(); - } - - - -private: - - template< typename System , typename StateInOut > - void do_step_impl1( System system , StateInOut &x , time_type t , time_type dt ) - { - if( m_adams_bashforth.is_initialized() ) - { - m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - m_adams_bashforth.do_step( system , x , t , m_x.m_v , dt ); - m_adams_moulton.do_step( system , x , m_x.m_v , t+dt , x , dt , m_adams_bashforth.step_storage() ); - } - else - { - m_adams_bashforth.do_step( system , x , t , dt ); - } - } - - template< typename System , typename StateIn , typename StateInOut > - void do_step_impl2( System system , StateIn const &in , time_type t , StateInOut & out , time_type dt ) - { - if( m_adams_bashforth.is_initialized() ) - { - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - m_adams_bashforth.do_step( system , in , t , m_x.m_v , dt ); - m_adams_moulton.do_step( system , in , m_x.m_v , t+dt , out , dt , m_adams_bashforth.step_storage() ); - } - else - { - m_adams_bashforth.do_step( system , in , t , out , dt ); - } - } - - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_x , x , typename is_resizeable< state_type >::type() ); - } - - adams_bashforth_type m_adams_bashforth; - adams_moulton_type m_adams_moulton; - wrapped_state_type m_x; - resizer_type m_resizer; -}; - - -/********* DOXYGEN ********/ - -/** - * \class adams_bashforth_moulton - * \brief The Adams-Bashforth-Moulton multistep algorithm. - * - * The Adams-Bashforth method is a multi-step predictor-corrector algorithm - * with configurable step number. The step number is specified as template - * parameter Steps and it then uses the result from the previous Steps steps. - * See also - * <a href="http://en.wikipedia.org/wiki/Linear_multistep_method">en.wikipedia.org/wiki/Linear_multistep_method</a>. - * Currently, a maximum of Steps=8 is supported. - * The method is explicit and fulfills the Stepper concept. Step size control - * or continuous output are not provided. - * - * This class derives from algebra_base and inherits its interface via - * CRTP (current recurring template pattern). For more details see - * algebra_stepper_base. - * - * \tparam Steps The number of steps (maximal 8). - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - * \tparam InitializingStepper The stepper for the first two steps. - */ - - /** - * \fn adams_bashforth_moulton::adams_bashforth_moulton( const algebra_type &algebra ) - * \brief Constructs the adams_bashforth class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored. - */ - - /** - * \fn adams_bashforth_moulton::order( void ) const - * \brief Returns the order of the algorithm, which is equal to the number of steps+1. - * \return order of the method. - */ - - /** - * \fn adams_bashforth_moulton::do_step( System system , StateInOut &x , time_type t , time_type dt ) - * \brief This method performs one step. It transforms the result in-place. - * - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - - /** - * \fn adams_bashforth_moulton::do_step( System system , const StateIn &in , time_type t , const StateOut &out , time_type dt ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - /** - * \fn adams_bashforth_moulton::adjust_size( const StateType &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - - /** - * \fn adams_bashforth_moulton::initialize( ExplicitStepper explicit_stepper , System system , StateIn &x , time_type &t , time_type dt ) - * \brief Initialized the stepper. Does Steps-1 steps with the explicit_stepper to fill the buffer. - * \note The state x and time t are updated to the values after Steps-1 initial steps. - * \param explicit_stepper the stepper used to fill the buffer of previous step results - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The initial state of the ODE which should be solved, updated after in this method. - * \param t The initial time, updated in this method. - * \param dt The step size. - */ - - /** - * \fn adams_bashforth_moulton::initialize( System system , StateIn &x , time_type &t , time_type dt ) - * \brief Initialized the stepper. Does Steps-1 steps using the standard initializing stepper - * of the underlying adams_bashforth stepper. - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - /** - * \fn adams_bashforth_moulton::reset( void ) - * \brief Resets the internal buffers of the stepper. - */ - - -} // odeint -} // numeric -} // boost - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_moulton.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_moulton.hpp deleted file mode 100644 index 05b4277735..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/adams_moulton.hpp +++ /dev/null @@ -1,201 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/adams_moulton.hpp - - [begin_description] - Implementation of the Adams-Moulton method. This is method is not a real stepper, it is more a helper class - which computes the corrector step in the Adams-Bashforth-Moulton method. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2013 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_MOULTON_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_MOULTON_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/bind.hpp> - -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp> - -#include <boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp> -#include <boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp> -#include <boost/numeric/odeint/stepper/detail/rotating_buffer.hpp> - - - - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * Static implicit Adams-Moulton multistep-solver without step size control and without dense output. - */ -template< -size_t Steps , -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -class adams_moulton -{ -private: - - -public : - - typedef State state_type; - typedef state_wrapper< state_type > wrapped_state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef Time time_type; - typedef Algebra algebra_type; - typedef Operations operations_type; - typedef Resizer resizer_type; - typedef stepper_tag stepper_category; - - typedef adams_moulton< Steps , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_type; - - static const size_t steps = Steps; - - typedef unsigned short order_type; - static const order_type order_value = steps + 1; - - typedef detail::rotating_buffer< wrapped_deriv_type , steps > step_storage_type; - - adams_moulton( ) - : m_coefficients() , m_dxdt() , m_resizer() , - m_algebra_instance() , m_algebra( m_algebra_instance ) - { } - - adams_moulton( algebra_type &algebra ) - : m_coefficients() , m_dxdt() , m_resizer() , - m_algebra_instance() , m_algebra( algebra ) - { } - - adams_moulton& operator=( const adams_moulton &stepper ) - { - m_dxdt = stepper.m_dxdt; - m_resizer = stepper.m_resizer; - m_algebra = stepper.m_algebra; - return *this; - } - - order_type order( void ) const { return order_value; } - - - /* - * Version 1 : do_step( system , x , t , dt , buf ); - * - * solves the forwarding problem - */ - template< class System , class StateInOut , class StateIn , class ABBuf > - void do_step( System system , StateInOut &x , StateIn const & pred , time_type t , time_type dt , const ABBuf &buf ) - { - do_step( system , x , pred , t , x , dt , buf ); - } - - template< class System , class StateInOut , class StateIn , class ABBuf > - void do_step( System system , const StateInOut &x , StateIn const & pred , time_type t , time_type dt , const ABBuf &buf ) - { - do_step( system , x , pred , t , x , dt , buf ); - } - - - - /* - * Version 2 : do_step( system , in , t , out , dt , buf ); - * - * solves the forwarding problem - */ - template< class System , class StateIn , class PredIn , class StateOut , class ABBuf > - void do_step( System system , const StateIn &in , const PredIn &pred , time_type t , StateOut &out , time_type dt , const ABBuf &buf ) - { - do_step_impl( system , in , pred , t , out , dt , buf ); - } - - template< class System , class StateIn , class PredIn , class StateOut , class ABBuf > - void do_step( System system , const StateIn &in , const PredIn &pred , time_type t , const StateOut &out , time_type dt , const ABBuf &buf ) - { - do_step_impl( system , in , pred , t , out , dt , buf ); - } - - - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_impl( x ); - } - - algebra_type& algebra() - { return m_algebra; } - - const algebra_type& algebra() const - { return m_algebra; } - - -private: - - - template< class System , class StateIn , class PredIn , class StateOut , class ABBuf > - void do_step_impl( System system , const StateIn &in , const PredIn &pred , time_type t , StateOut &out , time_type dt , const ABBuf &buf ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); - sys( pred , m_dxdt.m_v , t ); - detail::adams_moulton_call_algebra< steps , algebra_type , operations_type >()( m_algebra , in , out , m_dxdt.m_v , buf , m_coefficients , dt ); - } - - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - } - - - const detail::adams_moulton_coefficients< value_type , steps > m_coefficients; - wrapped_deriv_type m_dxdt; - resizer_type m_resizer; - -protected: - - algebra_type m_algebra_instance; - algebra_type &m_algebra; -}; - - - - -} // odeint -} // numeric -} // boost - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_ADAMS_MOULTON_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp deleted file mode 100644 index 3b014f8e18..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp - - [begin_description] - Base class for all steppers with an algebra and operations. - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_BASE_ALGEBRA_STEPPER_BASE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_ALGEBRA_STEPPER_BASE_HPP_INCLUDED - - -namespace boost { -namespace numeric { -namespace odeint { - -template< class Algebra , class Operations > -class algebra_stepper_base -{ -public: - - typedef Algebra algebra_type; - typedef Operations operations_type; - - algebra_stepper_base( const algebra_type &algebra = algebra_type() ) - : m_algebra( algebra ) { } - - algebra_type& algebra() - { - return m_algebra; - } - - const algebra_type& algebra() const - { - return m_algebra; - } - -protected: - - algebra_type m_algebra; -}; - - -/******* DOXYGEN *******/ - -/** - * \class algebra_stepper_base - * \brief Base class for all steppers with algebra and operations. - * - * This class serves a base class for all steppers with algebra and operations. It holds the - * algebra and provides access to the algebra. The operations are not instantiated, since they are - * static classes inside the operations class. - * - * \tparam Algebra The type of the algebra. Must fulfill the Algebra Concept, at least partially to work - * with the stepper. - * \tparam Operations The type of the operations. Must fulfill the Operations Concept, at least partially - * to work with the stepper. - */ - - /** - * \fn algebra_stepper_base::algebra_stepper_base( const algebra_type &algebra = algebra_type() ) - * \brief Constructs a algebra_stepper_base and creates the algebra. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra The algebra_stepper_base stores and uses a copy of algebra. - */ - - /** - * \fn algebra_type& algebra_stepper_base::algebra() - * \return A reference to the algebra which is held by this class. - */ - - /** - * \fn const algebra_type& algebra_stepper_base::algebra() const - * \return A const reference to the algebra which is held by this class. - */ - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_ALGEBRA_STEPPER_BASE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp deleted file mode 100644 index 08009dc16b..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp +++ /dev/null @@ -1,588 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp - - [begin_description] - Base class for all explicit Runge Kutta stepper which are also error steppers. - [end_description] - - Copyright 2010-2013 Karsten Ahnert - Copyright 2010-2012 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED - -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_same.hpp> - - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * base class for explicit stepper and error steppers - * models the stepper AND the error stepper concept - * - * this class provides the following do_step variants: - * do_step( sys , x , t , dt ) - * do_step( sys , x , dxdt , t , dt ) - * do_step( sys , in , t , out , dt ) - * do_step( sys , in , dxdt , t , out , dt ) - * do_step( sys , x , t , dt , xerr ) - * do_step( sys , x , dxdt , t , dt , xerr ) - * do_step( sys , in , t , out , dt , xerr ) - * do_step( sys , in , dxdt , t , out , dt , xerr ) - */ -template< -class Stepper , -unsigned short Order , -unsigned short StepperOrder , -unsigned short ErrorOrder , -class State , -class Value , -class Deriv , -class Time , -class Algebra , -class Operations , -class Resizer -> -class explicit_error_stepper_base : public algebra_stepper_base< Algebra , Operations > -{ -public: - - typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type; - typedef typename algebra_stepper_base_type::algebra_type algebra_type; - - - typedef State state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef Time time_type; - typedef Resizer resizer_type; - typedef Stepper stepper_type; - typedef explicit_error_stepper_tag stepper_category; - #ifndef DOXYGEN_SKIP - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef explicit_error_stepper_base< Stepper , Order , StepperOrder , ErrorOrder , - State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type; - #endif - - typedef unsigned short order_type; - static const order_type order_value = Order; - static const order_type stepper_order_value = StepperOrder; - static const order_type error_order_value = ErrorOrder; - - - explicit_error_stepper_base( const algebra_type &algebra = algebra_type() ) - : algebra_stepper_base_type( algebra ) - { } - - order_type order( void ) const - { - return order_value; - } - - order_type stepper_order( void ) const - { - return stepper_order_value; - } - - order_type error_order( void ) const - { - return error_order_value; - } - - - - /* - * Version 1 : do_step( sys , x , t , dt ) - * - * the two overloads are needed in order to solve the forwarding problem - */ - template< class System , class StateInOut > - void do_step( System system , StateInOut &x , time_type t , time_type dt ) - { - do_step_v1( system , x , t , dt ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. - */ - template< class System , class StateInOut > - void do_step( System system , const StateInOut &x , time_type t , time_type dt ) - { - do_step_v1( system , x , t , dt ); - } - - - - /* - * Version 2 : do_step( sys , x , dxdt , t , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - * - * the disable is needed to avoid ambiguous overloads if state_type = time_type - */ - template< class System , class StateInOut , class DerivIn > - typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type - do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt ) - { - this->stepper().do_step_impl( system , x , dxdt , t , x , dt ); - } - - - /* - * named Version 2: do_step_dxdt_impl( sys , in , dxdt , t , dt ) - * - * this version is needed when this stepper is used for initializing - * multistep stepper like adams-bashforth. Hence we provide an explicitely - * named version that is not disabled. Meant for internal use only. - */ - template < class System, class StateInOut, class DerivIn > - void do_step_dxdt_impl( System system, StateInOut &x, const DerivIn &dxdt, - time_type t, time_type dt ) - { - this->stepper().do_step_impl( system , x , dxdt , t , x , dt ); - } - - - - /* - * Version 3 : do_step( sys , in , t , out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - * - * the disable is needed to avoid ambiguous overloads if state_type = time_type - */ - template< class System , class StateIn , class StateOut > - typename boost::disable_if< boost::is_same< StateIn , time_type > , void >::type - do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); - sys( in , m_dxdt.m_v ,t ); - this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt ); - } - - /* - * Version 4 :do_step( sys , in , dxdt , t , out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - * - * the disable is needed to avoid ambiguous overloads if state_type = time_type - */ - template< class System , class StateIn , class DerivIn , class StateOut > - typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type - do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - { - this->stepper().do_step_impl( system , in , dxdt , t , out , dt ); - } - - /* - * named Version 4: do_step_dxdt_impl( sys , in , dxdt , t , out, dt ) - * - * this version is needed when this stepper is used for initializing - * multistep stepper like adams-bashforth. Hence we provide an explicitely - * named version that is not disabled. Meant for internal use only. - */ - template < class System, class StateIn, class DerivIn, class StateOut > - void do_step_dxdt_impl( System system, const StateIn &in, - const DerivIn &dxdt, time_type t, StateOut &out, - time_type dt ) - { - this->stepper().do_step_impl( system , in , dxdt , t , out , dt ); - } - - /* - * Version 5 :do_step( sys , x , t , dt , xerr ) - * - * the two overloads are needed in order to solve the forwarding problem - */ - template< class System , class StateInOut , class Err > - void do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) - { - do_step_v5( system , x , t , dt , xerr ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. - */ - template< class System , class StateInOut , class Err > - void do_step( System system , const StateInOut &x , time_type t , time_type dt , Err &xerr ) - { - do_step_v5( system , x , t , dt , xerr ); - } - - - /* - * Version 6 :do_step( sys , x , dxdt , t , dt , xerr ) - * - * this version does not solve the forwarding problem, boost.range can not be used - * - * the disable is needed to avoid ambiguous overloads if state_type = time_type - */ - template< class System , class StateInOut , class DerivIn , class Err > - typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type - do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt , Err &xerr ) - { - this->stepper().do_step_impl( system , x , dxdt , t , x , dt , xerr ); - } - - - /* - * Version 7 : do_step( sys , in , t , out , dt , xerr ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System , class StateIn , class StateOut , class Err > - void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); - sys( in , m_dxdt.m_v ,t ); - this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt , xerr ); - } - - - /* - * Version 8 : do_step( sys , in , dxdt , t , out , dt , xerr ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System , class StateIn , class DerivIn , class StateOut , class Err > - void do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr ) - { - this->stepper().do_step_impl( system , in , dxdt , t , out , dt , xerr ); - } - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_impl( x ); - } - - - -private: - - template< class System , class StateInOut > - void do_step_v1( System system , StateInOut &x , time_type t , time_type dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl<StateInOut> , detail::ref( *this ) , detail::_1 ) ); - sys( x , m_dxdt.m_v , t ); - this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt ); - } - - template< class System , class StateInOut , class Err > - void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl<StateInOut> , detail::ref( *this ) , detail::_1 ) ); - sys( x , m_dxdt.m_v ,t ); - this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt , xerr ); - } - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - } - - stepper_type& stepper( void ) - { - return *static_cast< stepper_type* >( this ); - } - - const stepper_type& stepper( void ) const - { - return *static_cast< const stepper_type* >( this ); - } - - - resizer_type m_resizer; - -protected: - - wrapped_deriv_type m_dxdt; -}; - - - - -/******** DOXYGEN *******/ - -/** - * \class explicit_error_stepper_base - * \brief Base class for explicit steppers with error estimation. This class can used with - * controlled steppers for step size control. - * - * This class serves as the base class for all explicit steppers with algebra and operations. In contrast to - * explicit_stepper_base it also estimates the error and can be used in a controlled stepper to provide - * step size control. - * - * \note This stepper provides `do_step` methods with and without error estimation. It has therefore three orders, - * one for the order of a step if the error is not estimated. The other two orders are the orders of the step and - * the error step if the error estimation is performed. - * - * explicit_error_stepper_base is used as the interface in a CRTP (currently recurring template - * pattern). In order to work correctly the parent class needs to have a method - * `do_step_impl( system , in , dxdt_in , t , out , dt , xerr )`. - * explicit_error_stepper_base derives from algebra_stepper_base. - * - * explicit_error_stepper_base provides several overloaded `do_step` methods, see the list below. Only two of them - * are needed to fulfill the Error Stepper concept. The other ones are for convenience and for performance. Some - * of them simply update the state out-of-place, while other expect that the first derivative at `t` is passed to the - * stepper. - * - * - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fulfill the Error Stepper concept. The - * state is updated in-place. A type modelling a Boost.Range can be used for x. - * - `do_step( sys , x , dxdt , t , dt )` - This method updates the state in-place, but the derivative at the point `t` - * must be explicitly passed in `dxdt`. - * - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step - * is stored in `out`. - * - `do_step( sys , in , dxdt , t , out , dt )` - This method update the state out-of-place and expects that the - * derivative at the point `t` is explicitly passed in `dxdt`. It is a combination of the two `do_step` methods - * above. - * - `do_step( sys , x , t , dt , xerr )` - This `do_step` method is needed to fulfill the Error Stepper concept. The - * state is updated in-place and an error estimate is calculated. A type modelling a Boost.Range can be used for x. - * - `do_step( sys , x , dxdt , t , dt , xerr )` - This method updates the state in-place, but the derivative at the - * point `t` must be passed in `dxdt`. An error estimate is calculated. - * - `do_step( sys , in , t , out , dt , xerr )` - This method updates the state out-of-place and estimates the error - * during the step. - * - `do_step( sys , in , dxdt , t , out , dt , xerr )` - This methods updates the state out-of-place and estimates - * the error during the step. Furthermore, the derivative at `t` must be passed in `dxdt`. - * - * \note The system is always passed as value, which might result in poor performance if it contains data. In this - * case it can be used with `boost::ref` or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );` - * - * \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate` - * routines or `iterator`s. - * - * \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base - * provides the interface for the Stepper. - * \tparam Order The order of a stepper if the stepper is used without error estimation. - * \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have - * the same value. - * \tparam ErrorOrder The order of the error step if the stepper is used with error estimation. - * \tparam State The state type for the stepper. - * \tparam Value The value type for the stepper. This should be a floating point type, like float, - * double, or a multiprecision type. It must not necessary be the value_type of the State. For example - * the State can be a `vector< complex< double > >` in this case the Value must be double. - * The default value is double. - * \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the - * state type, only if used with Boost.Units both types differ. - * \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is - * used, this type has usually a unit. - * \tparam Algebra The algebra type which must fulfill the Algebra Concept. - * \tparam Operations The type for the operations which must fulfill the Operations Concept. - * \tparam Resizer The resizer policy class. - */ - - - /** - * \fn explicit_error_stepper_base::explicit_error_stepper_base( const algebra_type &algebra = algebra_type() ) - * - * \brief Constructs a explicit_error_stepper_base class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - /** - * \fn explicit_error_stepper_base::order( void ) const - * \return Returns the order of the stepper if it used without error estimation. - */ - - /** - * \fn explicit_error_stepper_base::stepper_order( void ) const - * \return Returns the order of a step if the stepper is used without error estimation. - */ - - /** - * \fn explicit_error_stepper_base::error_order( void ) const - * \return Returns the order of an error step if the stepper is used without error estimation. - */ - - /** - * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , time_type t , time_type dt ) - * \brief This method performs one step. It transforms the result in-place. - * - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - /** - * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt ) - * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method - * the derivative of x is also passed to this method. It is supposed to be used in the following way: - * - * \code - * sys( x , dxdt , t ); - * stepper.do_step( sys , x , dxdt , t , dt ); - * \endcode - * - * The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this - * case the method could not be distinguished from other `do_step` versions. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - /** - * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * This method is disabled if StateIn and Time are the same type. In this case the method can not be distinguished from - * other `do_step` variants. - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - - /** - * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * Furthermore, the derivative of x at t is passed to the stepper. It is supposed to be used in the following way: - * - * \code - * sys( in , dxdt , t ); - * stepper.do_step( sys , in , dxdt , t , out , dt ); - * \endcode - * - * This method is disabled if DerivIn and Time are of same type. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - /** - * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) - * \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE - * is updated in-place. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. x is updated by this method. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - * \param xerr The estimation of the error is stored in xerr. - */ - - /** - * \fn explicit_error_stepper_base::do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt , Err &xerr ) - * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method - * the derivative of x is also passed to this method. It is supposed to be used in the following way: - * - * \code - * sys( x , dxdt , t ); - * stepper.do_step( sys , x , dxdt , t , dt , xerr ); - * \endcode - * - * The result is updated in place in x. This method is disabled if Time and DerivIn are of the same type. In this - * case the method could not be distinguished from other `do_step` versions. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - * \param xerr The error estimate is stored in xerr. - */ - - /** - * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * Furthermore, the error is estimated. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - * \param xerr The error estimate. - */ - - - /** - * \fn explicit_error_stepper_base::do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * Furthermore, the derivative of x at t is passed to the stepper and the error is estimated. It is supposed to be used in the following way: - * - * \code - * sys( in , dxdt , t ); - * stepper.do_step( sys , in , dxdt , t , out , dt ); - * \endcode - * - * This method is disabled if DerivIn and Time are of same type. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - * \param xerr The error estimate. - */ - - - /** - * \fn explicit_error_stepper_base::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} // odeint -} // numeric -} // boost - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_BASE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp deleted file mode 100644 index b1d751a0ce..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp +++ /dev/null @@ -1,677 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp - - [begin_description] - Base class for all explicit first-same-as-last Runge Kutta steppers. - [end_description] - - Copyright 2010-2013 Karsten Ahnert - Copyright 2010-2012 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED - -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_same.hpp> - - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/copy.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -/* - * base class for explicit stepper and error steppers with the fsal property - * models the stepper AND the error stepper fsal concept - * - * this class provides the following do_step overloads - * do_step( sys , x , t , dt ) - * do_step( sys , x , dxdt , t , dt ) - * do_step( sys , in , t , out , dt ) - * do_step( sys , in , dxdt_in , t , out , dxdt_out , dt ) - * do_step( sys , x , t , dt , xerr ) - * do_step( sys , x , dxdt , t , dt , xerr ) - * do_step( sys , in , t , out , dt , xerr ) - * do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr ) - */ -template< -class Stepper , -unsigned short Order , -unsigned short StepperOrder , -unsigned short ErrorOrder , -class State , -class Value , -class Deriv , -class Time , -class Algebra , -class Operations , -class Resizer -> -class explicit_error_stepper_fsal_base : public algebra_stepper_base< Algebra , Operations > -{ -public: - - typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type; - typedef typename algebra_stepper_base_type::algebra_type algebra_type; - - typedef State state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef Time time_type; - typedef Resizer resizer_type; - typedef Stepper stepper_type; - typedef explicit_error_stepper_fsal_tag stepper_category; - - #ifndef DOXYGEN_SKIP - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef explicit_error_stepper_fsal_base< Stepper , Order , StepperOrder , ErrorOrder , - State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type; - #endif - - - typedef unsigned short order_type; - static const order_type order_value = Order; - static const order_type stepper_order_value = StepperOrder; - static const order_type error_order_value = ErrorOrder; - - explicit_error_stepper_fsal_base( const algebra_type &algebra = algebra_type() ) - : algebra_stepper_base_type( algebra ) , m_first_call( true ) - { } - - order_type order( void ) const - { - return order_value; - } - - order_type stepper_order( void ) const - { - return stepper_order_value; - } - - order_type error_order( void ) const - { - return error_order_value; - } - - - /* - * version 1 : do_step( sys , x , t , dt ) - * - * the two overloads are needed in order to solve the forwarding problem - */ - template< class System , class StateInOut > - void do_step( System system , StateInOut &x , time_type t , time_type dt ) - { - do_step_v1( system , x , t , dt ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. - */ - template< class System , class StateInOut > - void do_step( System system , const StateInOut &x , time_type t , time_type dt ) - { - do_step_v1( system , x , t , dt ); - } - - - /* - * version 2 : do_step( sys , x , dxdt , t , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - * - * the disable is needed to avoid ambiguous overloads if state_type = time_type - */ - template< class System , class StateInOut , class DerivInOut > - typename boost::disable_if< boost::is_same< StateInOut , time_type > , void >::type - do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt ) - { - m_first_call = true; - this->stepper().do_step_impl( system , x , dxdt , t , x , dxdt , dt ); - } - - - /* - * named Version 2: do_step_dxdt_impl( sys , in , dxdt , t , dt ) - * - * this version is needed when this stepper is used for initializing - * multistep stepper like adams-bashforth. Hence we provide an explicitely - * named version that is not disabled. Meant for internal use only. - */ - template< class System , class StateInOut , class DerivInOut > - void do_step_dxdt_impl( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt ) - { - m_first_call = true; - this->stepper().do_step_impl( system , x , dxdt , t , x , dxdt , dt ); - } - - /* - * version 3 : do_step( sys , in , t , out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not - * be used. - * - * the disable is needed to avoid ambiguous overloads if - * state_type = time_type - */ - template< class System , class StateIn , class StateOut > - typename boost::disable_if< boost::is_same< StateIn , time_type > , void >::type - do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - { - if( m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) - { - initialize( system , in , t ); - } - this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , m_dxdt.m_v , dt ); - } - - - /* - * version 4 : do_step( sys , in , dxdt_in , t , out , dxdt_out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System, class StateIn, class DerivIn, class StateOut, - class DerivOut > - void do_step( System system, const StateIn &in, const DerivIn &dxdt_in, - time_type t, StateOut &out, DerivOut &dxdt_out, time_type dt ) - { - m_first_call = true; - this->stepper().do_step_impl( system, in, dxdt_in, t, out, dxdt_out, - dt ); - } - - - - - - /* - * version 5 : do_step( sys , x , t , dt , xerr ) - * - * the two overloads are needed in order to solve the forwarding problem - */ - template< class System , class StateInOut , class Err > - void do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) - { - do_step_v5( system , x , t , dt , xerr ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. - */ - template< class System , class StateInOut , class Err > - void do_step( System system , const StateInOut &x , time_type t , time_type dt , Err &xerr ) - { - do_step_v5( system , x , t , dt , xerr ); - } - - - /* - * version 6 : do_step( sys , x , dxdt , t , dt , xerr ) - * - * this version does not solve the forwarding problem, boost.range can not be used - * - * the disable is needed to avoid ambiguous overloads if state_type = time_type - */ - template< class System , class StateInOut , class DerivInOut , class Err > - typename boost::disable_if< boost::is_same< StateInOut , time_type > , void >::type - do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt , Err &xerr ) - { - m_first_call = true; - this->stepper().do_step_impl( system , x , dxdt , t , x , dxdt , dt , xerr ); - } - - - - - /* - * version 7 : do_step( sys , in , t , out , dt , xerr ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System , class StateIn , class StateOut , class Err > - void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr ) - { - if( m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) - { - initialize( system , in , t ); - } - this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , m_dxdt.m_v , dt , xerr ); - } - - - /* - * version 8 : do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut , class Err > - void do_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , - StateOut &out , DerivOut &dxdt_out , time_type dt , Err &xerr ) - { - m_first_call = true; - this->stepper().do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt , xerr ); - } - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_impl( x ); - } - - void reset( void ) - { - m_first_call = true; - } - - template< class DerivIn > - void initialize( const DerivIn &deriv ) - { - boost::numeric::odeint::copy( deriv , m_dxdt.m_v ); - m_first_call = false; - } - - template< class System , class StateIn > - void initialize( System system , const StateIn &x , time_type t ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - sys( x , m_dxdt.m_v , t ); - m_first_call = false; - } - - bool is_initialized( void ) const - { - return ! m_first_call; - } - - - -private: - - template< class System , class StateInOut > - void do_step_v1( System system , StateInOut &x , time_type t , time_type dt ) - { - if( m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) - { - initialize( system , x , t ); - } - this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , m_dxdt.m_v , dt ); - } - - template< class System , class StateInOut , class Err > - void do_step_v5( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) - { - if( m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) - { - initialize( system , x , t ); - } - this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , m_dxdt.m_v , dt , xerr ); - } - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - } - - - stepper_type& stepper( void ) - { - return *static_cast< stepper_type* >( this ); - } - - const stepper_type& stepper( void ) const - { - return *static_cast< const stepper_type* >( this ); - } - - - resizer_type m_resizer; - bool m_first_call; - -protected: - - - wrapped_deriv_type m_dxdt; -}; - - -/******* DOXYGEN *******/ - -/** - * \class explicit_error_stepper_fsal_base - * \brief Base class for explicit steppers with error estimation and stepper fulfilling the FSAL (first-same-as-last) - * property. This class can be used with controlled steppers for step size control. - * - * This class serves as the base class for all explicit steppers with algebra and operations and which fulfill the FSAL - * property. In contrast to explicit_stepper_base it also estimates the error and can be used in a controlled stepper - * to provide step size control. - * - * The FSAL property means that the derivative of the system at t+dt is already used in the current step going from - * t to t +dt. Therefore, some more do_steps method can be introduced and the controlled steppers can explicitly make use - * of this property. - * - * \note This stepper provides `do_step` methods with and without error estimation. It has therefore three orders, - * one for the order of a step if the error is not estimated. The other two orders are the orders of the step and - * the error step if the error estimation is performed. - * - * explicit_error_stepper_fsal_base is used as the interface in a CRTP (currently recurring template - * pattern). In order to work correctly the parent class needs to have a method - * `do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt , xerr )`. - * explicit_error_stepper_fsal_base derives from algebra_stepper_base. - * - * This class can have an intrinsic state depending on the explicit usage of the `do_step` method. This means that some - * `do_step` methods are expected to be called in order. For example the `do_step( sys , x , t , dt , xerr )` will keep track - * of the derivative of `x` which is the internal state. The first call of this method is recognized such that one - * does not explicitly initialize the internal state, so it is safe to use this method like - * - * \code - * stepper_type stepper; - * stepper.do_step( sys , x , t , dt , xerr ); - * stepper.do_step( sys , x , t , dt , xerr ); - * stepper.do_step( sys , x , t , dt , xerr ); - * \endcode - * - * But it is unsafe to call this method with different system functions after each other. Do do so, one must initialize the - * internal state with the `initialize` method or reset the internal state with the `reset` method. - * - * explicit_error_stepper_fsal_base provides several overloaded `do_step` methods, see the list below. Only two of them are needed - * to fulfill the Error Stepper concept. The other ones are for convenience and for better performance. Some of them - * simply update the state out-of-place, while other expect that the first derivative at `t` is passed to the stepper. - * - * - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fulfill the Error Stepper concept. The - * state is updated in-place. A type modelling a Boost.Range can be used for x. - * - `do_step( sys , x , dxdt , t , dt )` - This method updates the state x and the derivative dxdt in-place. It is expected - * that dxdt has the value of the derivative of x at time t. - * - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step - * is stored in `out`. - * - `do_step( sys , in , dxdt_in , t , out , dxdt_out , dt )` - This method updates the state and the derivative - * out-of-place. It expects that the derivative at the point `t` is explicitly passed in `dxdt_in`. - * - `do_step( sys , x , t , dt , xerr )` - This `do_step` method is needed to fulfill the Error Stepper concept. The - * state is updated in-place and an error estimate is calculated. A type modelling a Boost.Range can be used for x. - * - `do_step( sys , x , dxdt , t , dt , xerr )` - This method updates the state and the derivative in-place. It is assumed - * that the dxdt has the value of the derivative of x at time t. An error estimate is calculated. - * - `do_step( sys , in , t , out , dt , xerr )` - This method updates the state out-of-place and estimates the error - * during the step. - * - `do_step( sys , in , dxdt_in , t , out , dxdt_out , dt , xerr )` - This methods updates the state and the derivative - * out-of-place and estimates the error during the step. It is assumed the dxdt_in is derivative of in at time t. - * - * \note The system is always passed as value, which might result in poor performance if it contains data. In this - * case it can be used with `boost::ref` or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );` - * - * \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate` - * routines or `iterator`s. - * - * \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base - * provides the interface for the Stepper. - * \tparam Order The order of a stepper if the stepper is used without error estimation. - * \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have - * the same value. - * \tparam ErrorOrder The order of the error step if the stepper is used with error estimation. - * \tparam State The state type for the stepper. - * \tparam Value The value type for the stepper. This should be a floating point type, like float, - * double, or a multiprecision type. It must not necessary be the value_type of the State. For example - * the State can be a `vector< complex< double > >` in this case the Value must be double. - * The default value is double. - * \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the - * state type, only if used with Boost.Units both types differ. - * \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is - * used, this type has usually a unit. - * \tparam Algebra The algebra type which must fulfill the Algebra Concept. - * \tparam Operations The type for the operations which must fulfill the Operations Concept. - * \tparam Resizer The resizer policy class. - */ - - - - /** - * \fn explicit_error_stepper_fsal_base::explicit_error_stepper_fsal_base( const algebra_type &algebra ) - * \brief Constructs a explicit_stepper_fsal_base class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - - /** - * \fn explicit_error_stepper_fsal_base::order( void ) const - * \return Returns the order of the stepper if it used without error estimation. - */ - - /** - * \fn explicit_error_stepper_fsal_base::stepper_order( void ) const - * \return Returns the order of a step if the stepper is used without error estimation. - */ - - - /** - * \fn explicit_error_stepper_fsal_base::error_order( void ) const - * \return Returns the order of an error step if the stepper is used without error estimation. - */ - - /** - * \fn explicit_error_stepper_fsal_base::do_step( System system , StateInOut &x , time_type t , time_type dt ) - * \brief This method performs one step. It transforms the result in-place. - * - * \note This method uses the internal state of the stepper. - * - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - - /** - * \fn explicit_error_stepper_fsal_base::do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt ) - * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other methods - * the derivative of x is also passed to this method. Therefore, dxdt must be evaluated initially: - * - * \code - * ode( x , dxdt , t ); - * for( ... ) - * { - * stepper.do_step( ode , x , dxdt , t , dt ); - * t += dt; - * } - * \endcode - * - * \note This method does NOT use the initial state, since the first derivative is explicitly passed to this method. - * - * The result is updated in place in x as well as the derivative dxdt. This method is disabled if - * Time and StateInOut are of the same type. In this case the method could not be distinguished from other `do_step` - * versions. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param dxdt The derivative of x at t. After calling `do_step` dxdt is updated to the new value. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - /** - * \fn explicit_error_stepper_fsal_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * This method is disabled if StateIn and Time are the same type. In this case the method can not be distinguished from - * other `do_step` variants. - * - * \note This method uses the internal state of the stepper. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - /** - * \fn explicit_error_stepper_fsal_base::do_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , StateOut &out , DerivOut &dxdt_out , time_type dt ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * Furthermore, the derivative of x at t is passed to the stepper and updated by the stepper to its new value at - * t+dt. - * - * \note This method does not solve the forwarding problem. - * - * \note This method does NOT use the internal state of the stepper. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt_in The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dxdt_out The updated derivative of `out` at `t+dt`. - * \param dt The step size. - */ - - /** - * \fn explicit_error_stepper_fsal_base::do_step( System system , StateInOut &x , time_type t , time_type dt , Err &xerr ) - * \brief The method performs one step with the stepper passed by Stepper and estimates the error. The state of the ODE - * is updated in-place. - * - * - * \note This method uses the internal state of the stepper. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. x is updated by this method. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - * \param xerr The estimation of the error is stored in xerr. - */ - - /** - * \fn explicit_error_stepper_fsal_base::do_step( System system , StateInOut &x , DerivInOut &dxdt , time_type t , time_type dt , Err &xerr ) - * \brief The method performs one step with the stepper passed by Stepper. Additionally to the other method - * the derivative of x is also passed to this method and updated by this method. - * - * \note This method does NOT use the internal state of the stepper. - * - * The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this - * case the method could not be distinguished from other `do_step` versions. This method is disabled if StateInOut and - * Time are of the same type. - * - * \note This method does NOT use the internal state of the stepper. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param dxdt The derivative of x at t. After calling `do_step` this value is updated to the new value at `t+dt`. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - * \param xerr The error estimate is stored in xerr. - */ - - - /** - * \fn explicit_error_stepper_fsal_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt , Err &xerr ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * Furthermore, the error is estimated. - * - * \note This method uses the internal state of the stepper. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - * \param xerr The error estimate. - */ - - /** - * \fn explicit_error_stepper_fsal_base::do_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , StateOut &out , DerivOut &dxdt_out , time_type dt , Err &xerr ) - * \brief The method performs one step with the stepper passed by Stepper. The state of the ODE is updated out-of-place. - * Furthermore, the derivative of x at t is passed to the stepper and the error is estimated. - * - * \note This method does NOT use the internal state of the stepper. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt_in The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dxdt_out The new derivative at `t+dt` is written into this variable. - * \param dt The step size. - * \param xerr The error estimate. - */ - - /** - * \fn explicit_error_stepper_fsal_base::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - - /** - * \fn explicit_error_stepper_fsal_base::reset( void ) - * \brief Resets the internal state of this stepper. After calling this method it is safe to use all - * `do_step` method without explicitly initializing the stepper. - */ - - /** - * \fn explicit_error_stepper_fsal_base::initialize( const DerivIn &deriv ) - * \brief Initializes the internal state of the stepper. - * \param deriv The derivative of x. The next call of `do_step` expects that the derivative of `x` passed to `do_step` - * has the value of `deriv`. - */ - - /** - * \fn explicit_error_stepper_fsal_base::initialize( System system , const StateIn &x , time_type t ) - * \brief Initializes the internal state of the stepper. - * - * This method is equivalent to - * \code - * Deriv dxdt; - * system( x , dxdt , t ); - * stepper.initialize( dxdt ); - * \endcode - * - * \param system The system function for the next calls of `do_step`. - * \param x The current state of the ODE. - * \param t The current time of the ODE. - */ - - /** - * \fn explicit_error_stepper_fsal_base::is_initialized( void ) const - * \brief Returns if the stepper is already initialized. If the stepper is not initialized, the first - * call of `do_step` will initialize the state of the stepper. If the stepper is already initialized - * the system function can not be safely exchanged between consecutive `do_step` calls. - */ - -} // odeint -} // numeric -} // boost - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_ERROR_STEPPER_FSAL_BASE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp deleted file mode 100644 index d81c8c7a71..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp +++ /dev/null @@ -1,415 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp - - [begin_description] - Base class for all explicit Runge Kutta steppers. - [end_description] - - Copyright 2010-2013 Karsten Ahnert - Copyright 2010-2012 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_STEPPER_BASE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_STEPPER_BASE_HPP_INCLUDED - - -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_same.hpp> - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -/* - * base class for explicit steppers - * models the stepper concept - * - * this class provides the following overloads - * do_step( sys , x , t , dt ) - * do_step( sys , in , t , out , dt ) - * do_step( sys , x , dxdt_in , t , dt ) - * do_step( sys , in , dxdt_in , t , out , dt ) - */ - -template< -class Stepper , -unsigned short Order , -class State , -class Value , -class Deriv , -class Time , -class Algebra , -class Operations , -class Resizer -> -class explicit_stepper_base : public algebra_stepper_base< Algebra , Operations > -{ -public: - - #ifndef DOXYGEN_SKIP - typedef explicit_stepper_base< Stepper , Order , State , Value , Deriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type; - #endif // DOXYGEN_SKIP - - - typedef State state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef Time time_type; - typedef Resizer resizer_type; - typedef Stepper stepper_type; - typedef stepper_tag stepper_category; - typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type; - typedef typename algebra_stepper_base_type::algebra_type algebra_type; - typedef typename algebra_stepper_base_type::operations_type operations_type; - typedef unsigned short order_type; - - #ifndef DOXYGEN_SKIP - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - #endif // DOXYGEN_SKIP - - - static const order_type order_value = Order; - - - explicit_stepper_base( const algebra_type &algebra = algebra_type() ) - : algebra_stepper_base_type( algebra ) - { } - - /** - * \return Returns the order of the stepper. - */ - order_type order( void ) const - { - return order_value; - } - - - /* - * Version 1 : do_step( sys , x , t , dt ) - * - * the two overloads are needed in order to solve the forwarding problem - */ - template< class System , class StateInOut > - void do_step( System system , StateInOut &x , time_type t , time_type dt ) - { - do_step_v1( system , x , t , dt ); - } - - /** - * \brief Second version to solve the forwarding problem, can be called with Boost.Range as StateInOut. - */ - template< class System , class StateInOut > - void do_step( System system , const StateInOut &x , time_type t , time_type dt ) - { - do_step_v1( system , x , t , dt ); - } - - /* - * Version 2 : do_step( sys , x , dxdt , t , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - * - * the disable is needed to avoid ambiguous overloads if state_type = time_type - */ - template< class System , class StateInOut , class DerivIn > - typename boost::disable_if< boost::is_same< DerivIn , time_type > , void >::type - do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt ) - { - this->stepper().do_step_impl( system , x , dxdt , t , x , dt ); - } - - - /* - * named Version 2: do_step_dxdt_impl( sys , in , dxdt , t , dt ) - * - * this version is needed when this stepper is used for initializing - * multistep stepper like adams-bashforth. Hence we provide an explicitely - * named version that is not disabled. Meant for internal use only. - */ - template < class System, class StateInOut, class DerivIn > - void do_step_dxdt_impl( System system, StateInOut &x, const DerivIn &dxdt, - time_type t, time_type dt ) - { - this->stepper().do_step_impl( system , x , dxdt , t , x , dt ); - } - - - /* - * Version 3 : do_step( sys , in , t , out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System , class StateIn , class StateOut > - void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( in , detail::bind( &internal_stepper_base_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); - sys( in , m_dxdt.m_v ,t ); - this->stepper().do_step_impl( system , in , m_dxdt.m_v , t , out , dt ); - } - - - /* - * Version 4 : do_step( sys , in , dxdt , t , out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System , class StateIn , class DerivIn , class StateOut > - void do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - { - this->stepper().do_step_impl( system , in , dxdt , t , out , dt ); - } - - - /* - * named Version 4: do_step_dxdt_impl( sys , in , dxdt , t , out, dt ) - * - * this version is needed when this stepper is used for initializing - * multistep stepper like adams-bashforth. Hence we provide an explicitely - * named version. Meant for internal use only. - */ - template < class System, class StateIn, class DerivIn, class StateOut > - void do_step_dxdt_impl( System system, const StateIn &in, - const DerivIn &dxdt, time_type t, StateOut &out, - time_type dt ) - { - this->stepper().do_step_impl( system , in , dxdt , t , out , dt ); - } - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_impl( x ); - } - -private: - - stepper_type& stepper( void ) - { - return *static_cast< stepper_type* >( this ); - } - - const stepper_type& stepper( void ) const - { - return *static_cast< const stepper_type* >( this ); - } - - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - } - - - template< class System , class StateInOut > - void do_step_v1( System system , StateInOut &x , time_type t , time_type dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_resizer.adjust_size( x , detail::bind( &internal_stepper_base_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - sys( x , m_dxdt.m_v ,t ); - this->stepper().do_step_impl( system , x , m_dxdt.m_v , t , x , dt ); - } - - - resizer_type m_resizer; - -protected: - - wrapped_deriv_type m_dxdt; -}; - - -/******* DOXYGEN *********/ - -/** - * \class explicit_stepper_base - * \brief Base class for explicit steppers without step size control and without dense output. - * - * This class serves as the base class for all explicit steppers with algebra and operations. - * Step size control and error estimation as well as dense output are not provided. explicit_stepper_base - * is used as the interface in a CRTP (currently recurring template pattern). In order to work - * correctly the parent class needs to have a method `do_step_impl( system , in , dxdt_in , t , out , dt )`. - * This is method is used by explicit_stepper_base. explicit_stepper_base derives from - * algebra_stepper_base. An example how this class can be used is - * - * \code - * template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resizer > - * class custom_euler : public explicit_stepper_base< 1 , State , Value , Deriv , Time , Algebra , Operations , Resizer > - * { - * public: - * - * typedef explicit_stepper_base< 1 , State , Value , Deriv , Time , Algebra , Operations , Resizer > base_type; - * - * custom_euler( const Algebra &algebra = Algebra() ) { } - * - * template< class Sys , class StateIn , class DerivIn , class StateOut > - * void do_step_impl( Sys sys , const StateIn &in , const DerivIn &dxdt , Time t , StateOut &out , Time dt ) - * { - * m_algebra.for_each3( out , in , dxdt , Operations::scale_sum2< Value , Time >( 1.0 , dt ); - * } - * - * template< class State > - * void adjust_size( const State &x ) - * { - * base_type::adjust_size( x ); - * } - * }; - * \endcode - * - * For the Stepper concept only the `do_step( sys , x , t , dt )` needs to be implemented. But this class - * provides additional `do_step` variants since the stepper is explicit. These methods can be used to increase - * the performance in some situation, for example if one needs to analyze `dxdt` during each step. In this case - * one can use - * - * \code - * sys( x , dxdt , t ); - * stepper.do_step( sys , x , dxdt , t , dt ); // the value of dxdt is used here - * t += dt; - * \endcode - * - * In detail explicit_stepper_base provides the following `do_step` variants - * - `do_step( sys , x , t , dt )` - The classical `do_step` method needed to fulfill the Stepper concept. The state is updated in-place. - * A type modelling a Boost.Range can be used for x. - * - `do_step( sys , in , t , out , dt )` - This method updates the state out-of-place, hence the result of the step is stored in `out`. - * - `do_step( sys , x , dxdt , t , dt )` - This method updates the state in-place, but the derivative at the point `t` must be - * explicitly passed in `dxdt`. For an example see the code snippet above. - * - `do_step( sys , in , dxdt , t , out , dt )` - This method update the state out-of-place and expects that the derivative at the point - * `t` is explicitly passed in `dxdt`. It is a combination of the two `do_step` methods above. - * - * \note The system is always passed as value, which might result in poor performance if it contains data. In this case it can be used with `boost::ref` - * or `std::ref`, for example `stepper.do_step( boost::ref( sys ) , x , t , dt );` - * - * \note The time `t` is not advanced by the stepper. This has to done manually, or by the appropriate `integrate` routines or `iterator`s. - * - * \tparam Stepper The stepper on which this class should work. It is used via CRTP, hence explicit_stepper_base - * provides the interface for the Stepper. - * \tparam Order The order of the stepper. - * \tparam State The state type for the stepper. - * \tparam Value The value type for the stepper. This should be a floating point type, like float, - * double, or a multiprecision type. It must not necessary be the value_type of the State. For example - * the State can be a `vector< complex< double > >` in this case the Value must be double. - * The default value is double. - * \tparam Deriv The type representing time derivatives of the state type. It is usually the same type as the - * state type, only if used with Boost.Units both types differ. - * \tparam Time The type representing the time. Usually the same type as the value type. When Boost.Units is - * used, this type has usually a unit. - * \tparam Algebra The algebra type which must fulfill the Algebra Concept. - * \tparam Operations The type for the operations which must fulfill the Operations Concept. - * \tparam Resizer The resizer policy class. - */ - - - /** - * \fn explicit_stepper_base::explicit_stepper_base( const algebra_type &algebra ) - * \brief Constructs a explicit_stepper_base class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - /** - * \fn explicit_stepper_base::order_type order( void ) const - * \return Returns the order of the stepper. - */ - - /** - * \fn explicit_stepper_base::do_step( System system , StateInOut &x , time_type t , time_type dt ) - * \brief This method performs one step. It transforms the result in-place. - * - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - - /** - * \fn explicit_stepper_base::do_step( System system , StateInOut &x , const DerivIn &dxdt , time_type t , time_type dt ) - - * \brief The method performs one step. Additionally to the other method - * the derivative of x is also passed to this method. It is supposed to be used in the following way: - * - * \code - * sys( x , dxdt , t ); - * stepper.do_step( sys , x , dxdt , t , dt ); - * \endcode - * - * The result is updated in place in x. This method is disabled if Time and Deriv are of the same type. In this - * case the method could not be distinguished from other `do_step` versions. - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. After calling do_step the result is updated in x. - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - /** - * \fn void explicit_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - * \brief The method performs one step. The state of the ODE is updated out-of-place. - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - /** - * \fn void explicit_stepper_base::do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - * \brief The method performs one step. The state of the ODE is updated out-of-place. - * Furthermore, the derivative of x at t is passed to the stepper. - * It is supposed to be used in the following way: - * - * \code - * sys( in , dxdt , t ); - * stepper.do_step( sys , in , dxdt , t , out , dt ); - * \endcode - * - * \note This method does not solve the forwarding problem. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - /** - * \fn void explicit_stepper_base::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} // odeint -} // numeric -} // boost - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_EXPLICIT_STEPPER_BASE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp deleted file mode 100644 index eb09aefc8f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp +++ /dev/null @@ -1,431 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp - - [begin_description] - Base class for symplectic Runge-Kutta-Nystrom steppers. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2013 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED - -#include <boost/array.hpp> - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> - -#include <boost/numeric/odeint/util/copy.hpp> -#include <boost/numeric/odeint/util/is_pair.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp> - - - - -namespace boost { -namespace numeric { -namespace odeint { - - -template< -size_t NumOfStages , -unsigned short Order , -class Coor , -class Momentum , -class Value , -class CoorDeriv , -class MomentumDeriv , -class Time , -class Algebra , -class Operations , -class Resizer -> -class symplectic_nystroem_stepper_base : public algebra_stepper_base< Algebra , Operations > -{ - -public: - - typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type; - typedef typename algebra_stepper_base_type::algebra_type algebra_type; - typedef typename algebra_stepper_base_type::operations_type operations_type; - - const static size_t num_of_stages = NumOfStages; - typedef Coor coor_type; - typedef Momentum momentum_type; - typedef std::pair< coor_type , momentum_type > state_type; - typedef CoorDeriv coor_deriv_type; - typedef state_wrapper< coor_deriv_type> wrapped_coor_deriv_type; - typedef MomentumDeriv momentum_deriv_type; - typedef state_wrapper< momentum_deriv_type > wrapped_momentum_deriv_type; - typedef std::pair< coor_deriv_type , momentum_deriv_type > deriv_type; - typedef Value value_type; - typedef Time time_type; - typedef Resizer resizer_type; - typedef stepper_tag stepper_category; - - #ifndef DOXYGEN_SKIP - typedef symplectic_nystroem_stepper_base< NumOfStages , Order , Coor , Momentum , Value , - CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > internal_stepper_base_type; - #endif - typedef unsigned short order_type; - - static const order_type order_value = Order; - - typedef boost::array< value_type , num_of_stages > coef_type; - - symplectic_nystroem_stepper_base( const coef_type &coef_a , const coef_type &coef_b , const algebra_type &algebra = algebra_type() ) - : algebra_stepper_base_type( algebra ) , m_coef_a( coef_a ) , m_coef_b( coef_b ) , - m_dqdt_resizer() , m_dpdt_resizer() , m_dqdt() , m_dpdt() - { } - - - order_type order( void ) const - { - return order_value; - } - - /* - * Version 1 : do_step( system , x , t , dt ) - * - * This version does not solve the forwarding problem, boost.range can not be used. - */ - template< class System , class StateInOut > - void do_step( System system , const StateInOut &state , time_type t , time_type dt ) - { - typedef typename odeint::unwrap_reference< System >::type system_type; - do_step_impl( system , state , t , state , dt , typename is_pair< system_type >::type() ); - } - - /** - * \brief Same function as above. It differs only in a different const specifier in order - * to solve the forwarding problem, can be used with Boost.Range. - */ - template< class System , class StateInOut > - void do_step( System system , StateInOut &state , time_type t , time_type dt ) - { - typedef typename odeint::unwrap_reference< System >::type system_type; - do_step_impl( system , state , t , state , dt , typename is_pair< system_type >::type() ); - } - - - - - /* - * Version 2 : do_step( system , q , p , t , dt ); - * - * For Convenience - * - * The two overloads are needed in order to solve the forwarding problem. - */ - template< class System , class CoorInOut , class MomentumInOut > - void do_step( System system , CoorInOut &q , MomentumInOut &p , time_type t , time_type dt ) - { - do_step( system , std::make_pair( detail::ref( q ) , detail::ref( p ) ) , t , dt ); - } - - /** - * \brief Same function as do_step( system , q , p , t , dt ). It differs only in a different const specifier in order - * to solve the forwarding problem, can be called with Boost.Range. - */ - template< class System , class CoorInOut , class MomentumInOut > - void do_step( System system , const CoorInOut &q , const MomentumInOut &p , time_type t , time_type dt ) - { - do_step( system , std::make_pair( detail::ref( q ) , detail::ref( p ) ) , t , dt ); - } - - - - - - /* - * Version 3 : do_step( system , in , t , out , dt ) - * - * The forwarding problem is not solved in this version - */ - template< class System , class StateIn , class StateOut > - void do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - { - typedef typename odeint::unwrap_reference< System >::type system_type; - do_step_impl( system , in , t , out , dt , typename is_pair< system_type >::type() ); - } - - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_dqdt( x ); - resize_dpdt( x ); - } - - /** \brief Returns the coefficients a. */ - const coef_type& coef_a( void ) const { return m_coef_a; } - - /** \brief Returns the coefficients b. */ - const coef_type& coef_b( void ) const { return m_coef_b; } - -private: - - // stepper for systems with function for dq/dt = f(p) and dp/dt = -f(q) - template< class System , class StateIn , class StateOut > - void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , boost::mpl::true_ ) - { - typedef typename odeint::unwrap_reference< System >::type system_type; - typedef typename odeint::unwrap_reference< typename system_type::first_type >::type coor_deriv_func_type; - typedef typename odeint::unwrap_reference< typename system_type::second_type >::type momentum_deriv_func_type; - system_type &sys = system; - coor_deriv_func_type &coor_func = sys.first; - momentum_deriv_func_type &momentum_func = sys.second; - - typedef typename odeint::unwrap_reference< StateIn >::type state_in_type; - typedef typename odeint::unwrap_reference< typename state_in_type::first_type >::type coor_in_type; - typedef typename odeint::unwrap_reference< typename state_in_type::second_type >::type momentum_in_type; - const state_in_type &state_in = in; - const coor_in_type &coor_in = state_in.first; - const momentum_in_type &momentum_in = state_in.second; - - typedef typename odeint::unwrap_reference< StateOut >::type state_out_type; - typedef typename odeint::unwrap_reference< typename state_out_type::first_type >::type coor_out_type; - typedef typename odeint::unwrap_reference< typename state_out_type::second_type >::type momentum_out_type; - state_out_type &state_out = out; - coor_out_type &coor_out = state_out.first; - momentum_out_type &momentum_out = state_out.second; - - m_dqdt_resizer.adjust_size( coor_in , detail::bind( &internal_stepper_base_type::template resize_dqdt< coor_in_type > , detail::ref( *this ) , detail::_1 ) ); - m_dpdt_resizer.adjust_size( momentum_in , detail::bind( &internal_stepper_base_type::template resize_dpdt< momentum_in_type > , detail::ref( *this ) , detail::_1 ) ); - - // ToDo: check sizes? - - for( size_t l=0 ; l<num_of_stages ; ++l ) - { - if( l == 0 ) - { - coor_func( momentum_in , m_dqdt.m_v ); - this->m_algebra.for_each3( coor_out , coor_in , m_dqdt.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) ); - momentum_func( coor_out , m_dpdt.m_v ); - this->m_algebra.for_each3( momentum_out , momentum_in , m_dpdt.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) ); - } - else - { - coor_func( momentum_out , m_dqdt.m_v ); - this->m_algebra.for_each3( coor_out , coor_out , m_dqdt.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) ); - momentum_func( coor_out , m_dpdt.m_v ); - this->m_algebra.for_each3( momentum_out , momentum_out , m_dpdt.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) ); - } - } - } - - - // stepper for systems with only function dp /dt = -f(q), dq/dt = p, time not required but still expected for compatibility reasons - template< class System , class StateIn , class StateOut > - void do_step_impl( System system , const StateIn &in , time_type /* t */ , StateOut &out , time_type dt , boost::mpl::false_ ) - { - typedef typename odeint::unwrap_reference< System >::type momentum_deriv_func_type; - momentum_deriv_func_type &momentum_func = system; - - typedef typename odeint::unwrap_reference< StateIn >::type state_in_type; - typedef typename odeint::unwrap_reference< typename state_in_type::first_type >::type coor_in_type; - typedef typename odeint::unwrap_reference< typename state_in_type::second_type >::type momentum_in_type; - const state_in_type &state_in = in; - const coor_in_type &coor_in = state_in.first; - const momentum_in_type &momentum_in = state_in.second; - - typedef typename odeint::unwrap_reference< StateOut >::type state_out_type; - typedef typename odeint::unwrap_reference< typename state_out_type::first_type >::type coor_out_type; - typedef typename odeint::unwrap_reference< typename state_out_type::second_type >::type momentum_out_type; - state_out_type &state_out = out; - coor_out_type &coor_out = state_out.first; - momentum_out_type &momentum_out = state_out.second; - - - // m_dqdt not required when called with momentum_func only - don't resize - // m_dqdt_resizer.adjust_size( coor_in , detail::bind( &internal_stepper_base_type::template resize_dqdt< coor_in_type > , detail::ref( *this ) , detail::_1 ) ); - m_dpdt_resizer.adjust_size( momentum_in , detail::bind( &internal_stepper_base_type::template resize_dpdt< momentum_in_type > , detail::ref( *this ) , detail::_1 ) ); - - - // ToDo: check sizes? - - // step 0 - this->m_algebra.for_each3( coor_out , coor_in , momentum_in , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[0] * dt ) ); - momentum_func( coor_out , m_dpdt.m_v ); - this->m_algebra.for_each3( momentum_out , momentum_in , m_dpdt.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[0] * dt ) ); - - for( size_t l=1 ; l<num_of_stages ; ++l ) - { - this->m_algebra.for_each3( coor_out , coor_out , momentum_out , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_a[l] * dt ) ); - momentum_func( coor_out , m_dpdt.m_v ); - this->m_algebra.for_each3( momentum_out , momentum_out , m_dpdt.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , m_coef_b[l] * dt ) ); - } - } - - template< class StateIn > - bool resize_dqdt( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dqdt , x , typename is_resizeable<coor_deriv_type>::type() ); - } - - template< class StateIn > - bool resize_dpdt( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dpdt , x , typename is_resizeable<momentum_deriv_type>::type() ); - } - - - const coef_type m_coef_a; - const coef_type m_coef_b; - - resizer_type m_dqdt_resizer; - resizer_type m_dpdt_resizer; - wrapped_coor_deriv_type m_dqdt; - wrapped_momentum_deriv_type m_dpdt; - -}; - -/********* DOXYGEN *********/ - -/** - * \class symplectic_nystroem_stepper_base - * \brief Base class for all symplectic steppers of Nystroem type. - * - * This class is the base class for the symplectic Runge-Kutta-Nystroem steppers. Symplectic steppers are usually - * used to solve Hamiltonian systems and they conserve the phase space volume, see - * <a href="http://en.wikipedia.org/wiki/Symplectic_integrator">en.wikipedia.org/wiki/Symplectic_integrator</a>. - * Furthermore, the energy is conserved - * in average. In detail this class of steppers can be used to solve separable Hamiltonian systems which can be written - * in the form H(q,p) = H1(p) + H2(q). q is usually called the coordinate, while p is the momentum. The equations of motion - * are dq/dt = dH1/dp, dp/dt = -dH2/dq. - * - * ToDo : add formula for solver and explanation of the coefficients - * - * symplectic_nystroem_stepper_base uses odeints algebra and operation system. Step size and error estimation are not - * provided for this class of solvers. It derives from algebra_stepper_base. Several `do_step` variants are provided: - * - * - `do_step( sys , x , t , dt )` - The classical `do_step` method. The sys can be either a pair of function objects - * for the coordinate or the momentum part or one function object for the momentum part. `x` is a pair of coordinate - * and momentum. The state is updated in-place. - * - `do_step( sys , q , p , t , dt )` - This method is similar to the method above with the difference that the coordinate - * and the momentum are passed explicitly and not packed into a pair. - * - `do_step( sys , x_in , t , x_out , dt )` - This method transforms the state out-of-place. `x_in` and `x_out` are here pairs - * of coordinate and momentum. - * - * \tparam NumOfStages Number of stages. - * \tparam Order The order of the stepper. - * \tparam Coor The type representing the coordinates q. - * \tparam Momentum The type representing the coordinates p. - * \tparam Value The basic value type. Should be something like float, double or a high-precision type. - * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt. - * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt. - * \tparam Time The type representing the time t. - * \tparam Algebra The algebra. - * \tparam Operations The operations. - * \tparam Resizer The resizer policy. - */ - - /** - * \fn symplectic_nystroem_stepper_base::symplectic_nystroem_stepper_base( const coef_type &coef_a , const coef_type &coef_b , const algebra_type &algebra ) - * \brief Constructs a symplectic_nystroem_stepper_base class. The parameters of the specific Nystroem method and the - * algebra have to be passed. - * \param coef_a The coefficients a. - * \param coef_b The coefficients b. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - /** - * \fn symplectic_nystroem_stepper_base::order( void ) const - * \return Returns the order of the stepper. - */ - - /** - * \fn symplectic_nystroem_stepper_base::do_step( System system , const StateInOut &state , time_type t , time_type dt ) - * \brief This method performs one step. The system can be either a pair of two function object - * describing the momentum part and the coordinate part or one function object describing only - * the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state - * is updated in-place. - * - * \note boost::ref or std::ref can be used for the system as well as for the state. So, it is correct - * to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , make_pair( std::ref( q ) , std::ref( p ) ) , t , dt )`. - * - * \note This method solves the forwarding problem. - * - * \param system The system, can be represented as a pair of two function object or one function object. See above. - * \param state The state of the ODE. It is a pair of Coor and Momentum. The state is updated in-place, therefore, the - * new value of the state will be written into this variable. - * \param t The time of the ODE. It is not advanced by this method. - * \param dt The time step. - */ - - /** - * \fn symplectic_nystroem_stepper_base::do_step( System system , CoorInOut &q , MomentumInOut &p , time_type t , time_type dt ) - * \brief This method performs one step. The system can be either a pair of two function object - * describing the momentum part and the coordinate part or one function object describing only - * the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state - * is updated in-place. - * - * \note boost::ref or std::ref can be used for the system. So, it is correct - * to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , q , p , t , dt )`. - * - * \note This method solves the forwarding problem. - * - * \param system The system, can be represented as a pair of two function object or one function object. See above. - * \param q The coordinate of the ODE. It is updated in-place. Therefore, the new value of the coordinate will be written - * into this variable. - * \param p The momentum of the ODE. It is updated in-place. Therefore, the new value of the momentum will be written info - * this variable. - * \param t The time of the ODE. It is not advanced by this method. - * \param dt The time step. - */ - - /** - * \fn symplectic_nystroem_stepper_base::do_step( System system , const StateIn &in , time_type t , StateOut &out , time_type dt ) - * \brief This method performs one step. The system can be either a pair of two function object - * describing the momentum part and the coordinate part or one function object describing only - * the momentum part. In this case the coordinate is assumed to be trivial dq/dt = p. The state - * is updated out-of-place. - * - * \note boost::ref or std::ref can be used for the system. So, it is correct - * to write `stepper.do_step( make_pair( std::ref( fq ) , std::ref( fp ) ) , x_in , t , x_out , dt )`. - * - * \note This method NOT solve the forwarding problem. - * - * \param system The system, can be represented as a pair of two function object or one function object. See above. - * \param in The state of the ODE, which is a pair of coordinate and momentum. The state is updated out-of-place, therefore the - * new value is written into out - * \param t The time of the ODE. It is not advanced by this method. - * \param out The new state of the ODE. - * \param dt The time step. - */ - - /** - * \fn symplectic_nystroem_stepper_base::adjust_size( const StateType &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_BASE_SYMPLECTIC_RKN_STEPPER_BASE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/bulirsch_stoer.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/bulirsch_stoer.hpp deleted file mode 100644 index 02c37492b9..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/bulirsch_stoer.hpp +++ /dev/null @@ -1,642 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/bulirsch_stoer.hpp - - [begin_description] - Implementation of the Burlish-Stoer method. As described in - Ernst Hairer, Syvert Paul Norsett, Gerhard Wanner - Solving Ordinary Differential Equations I. Nonstiff Problems. - Springer Series in Comput. Mathematics, Vol. 8, Springer-Verlag 1987, Second revised edition 1993. - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_HPP_INCLUDED - - -#include <iostream> - -#include <algorithm> - -#include <boost/config.hpp> // for min/max guidelines - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/modified_midpoint.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< - class State , - class Value = double , - class Deriv = State , - class Time = Value , - class Algebra = typename algebra_dispatcher< State >::algebra_type , - class Operations = typename operations_dispatcher< State >::operations_type , - class Resizer = initially_resizer - > -class bulirsch_stoer { - -public: - - typedef State state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef Time time_type; - typedef Algebra algebra_type; - typedef Operations operations_type; - typedef Resizer resizer_type; -#ifndef DOXYGEN_SKIP - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef controlled_stepper_tag stepper_category; - - typedef bulirsch_stoer< State , Value , Deriv , Time , Algebra , Operations , Resizer > controlled_error_bs_type; - - typedef typename inverse_time< time_type >::type inv_time_type; - - typedef std::vector< value_type > value_vector; - typedef std::vector< time_type > time_vector; - typedef std::vector< inv_time_type > inv_time_vector; //should be 1/time_type for boost.units - typedef std::vector< value_vector > value_matrix; - typedef std::vector< size_t > int_vector; - typedef std::vector< wrapped_state_type > state_table_type; -#endif //DOXYGEN_SKIP - const static size_t m_k_max = 8; - - bulirsch_stoer( - value_type eps_abs = 1E-6 , value_type eps_rel = 1E-6 , - value_type factor_x = 1.0 , value_type factor_dxdt = 1.0 , - time_type max_dt = static_cast<time_type>(0)) - : m_error_checker( eps_abs , eps_rel , factor_x, factor_dxdt ) , m_midpoint() , - m_last_step_rejected( false ) , m_first( true ) , - m_max_dt(max_dt) , - m_interval_sequence( m_k_max+1 ) , - m_coeff( m_k_max+1 ) , - m_cost( m_k_max+1 ) , - m_facmin_table( m_k_max+1 ) , - m_table( m_k_max ) , - STEPFAC1( 0.65 ) , STEPFAC2( 0.94 ) , STEPFAC3( 0.02 ) , STEPFAC4( 4.0 ) , KFAC1( 0.8 ) , KFAC2( 0.9 ) - { - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - /* initialize sequence of stage numbers and work */ - for( unsigned short i = 0; i < m_k_max+1; i++ ) - { - m_interval_sequence[i] = 2 * (i+1); - if( i == 0 ) - m_cost[i] = m_interval_sequence[i]; - else - m_cost[i] = m_cost[i-1] + m_interval_sequence[i]; - m_coeff[i].resize(i); - m_facmin_table[i] = pow BOOST_PREVENT_MACRO_SUBSTITUTION( STEPFAC3 , static_cast< value_type >(1) / static_cast< value_type >( 2*i+1 ) ); - for( size_t k = 0 ; k < i ; ++k ) - { - const value_type r = static_cast< value_type >( m_interval_sequence[i] ) / static_cast< value_type >( m_interval_sequence[k] ); - m_coeff[i][k] = 1.0 / ( r*r - static_cast< value_type >( 1.0 ) ); // coefficients for extrapolation - } - } - reset(); - } - - - /* - * Version 1 : try_step( sys , x , t , dt ) - * - * The overloads are needed to solve the forwarding problem - */ - template< class System , class StateInOut > - controlled_step_result try_step( System system , StateInOut &x , time_type &t , time_type &dt ) - { - return try_step_v1( system , x , t, dt ); - } - - /** - * \brief Second version to solve the forwarding problem, can be used with Boost.Range as StateInOut. - */ - template< class System , class StateInOut > - controlled_step_result try_step( System system , const StateInOut &x , time_type &t , time_type &dt ) - { - return try_step_v1( system , x , t, dt ); - } - - /* - * Version 2 : try_step( sys , x , dxdt , t , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System , class StateInOut , class DerivIn > - controlled_step_result try_step( System system , StateInOut &x , const DerivIn &dxdt , time_type &t , time_type &dt ) - { - m_xnew_resizer.adjust_size( x , detail::bind( &controlled_error_bs_type::template resize_m_xnew< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , dt ); - if( res == success ) - { - boost::numeric::odeint::copy( m_xnew.m_v , x ); - } - return res; - } - - /* - * Version 3 : try_step( sys , in , t , out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - template< class System , class StateIn , class StateOut > - typename boost::disable_if< boost::is_same< StateIn , time_type > , controlled_step_result >::type - try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_error_bs_type::template resize_m_dxdt< StateIn > , detail::ref( *this ) , detail::_1 ) ); - sys( in , m_dxdt.m_v , t ); - return try_step( system , in , m_dxdt.m_v , t , out , dt ); - } - - - /* - * Full version : try_step( sys , in , dxdt_in , t , out , dt ) - * - * contains the actual implementation - */ - template< class System , class StateIn , class DerivIn , class StateOut > - controlled_step_result try_step( System system , const StateIn &in , const DerivIn &dxdt , time_type &t , StateOut &out , time_type &dt ) - { - if( m_max_dt != static_cast<time_type>(0) && detail::less_with_sign(m_max_dt, dt, dt) ) - { - // given step size is bigger then max_dt - // set limit and return fail - dt = m_max_dt; - return fail; - } - - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - - static const value_type val1( 1.0 ); - - if( m_resizer.adjust_size( in , detail::bind( &controlled_error_bs_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) ) - { - reset(); // system resized -> reset - } - - if( dt != m_dt_last ) - { - reset(); // step size changed from outside -> reset - } - - bool reject( true ); - - time_vector h_opt( m_k_max+1 ); - inv_time_vector work( m_k_max+1 ); - - time_type new_h = dt; - - /* m_current_k_opt is the estimated current optimal stage number */ - for( size_t k = 0 ; k <= m_current_k_opt+1 ; k++ ) - { - /* the stage counts are stored in m_interval_sequence */ - m_midpoint.set_steps( m_interval_sequence[k] ); - if( k == 0 ) - { - m_midpoint.do_step( system , in , dxdt , t , out , dt ); - /* the first step, nothing more to do */ - } - else - { - m_midpoint.do_step( system , in , dxdt , t , m_table[k-1].m_v , dt ); - extrapolate( k , m_table , m_coeff , out ); - // get error estimate - m_algebra.for_each3( m_err.m_v , out , m_table[0].m_v , - typename operations_type::template scale_sum2< value_type , value_type >( val1 , -val1 ) ); - const value_type error = m_error_checker.error( m_algebra , in , dxdt , m_err.m_v , dt ); - h_opt[k] = calc_h_opt( dt , error , k ); - work[k] = static_cast<value_type>( m_cost[k] ) / h_opt[k]; - - if( (k == m_current_k_opt-1) || m_first ) - { // convergence before k_opt ? - if( error < 1.0 ) - { - //convergence - reject = false; - if( (work[k] < KFAC2*work[k-1]) || (m_current_k_opt <= 2) ) - { - // leave order as is (except we were in first round) - m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(k)+1 ) ); - new_h = h_opt[k]; - new_h *= static_cast<value_type>( m_cost[k+1] ) / static_cast<value_type>( m_cost[k] ); - } else { - m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(k) ) ); - new_h = h_opt[k]; - } - break; - } - else if( should_reject( error , k ) && !m_first ) - { - reject = true; - new_h = h_opt[k]; - break; - } - } - if( k == m_current_k_opt ) - { // convergence at k_opt ? - if( error < 1.0 ) - { - //convergence - reject = false; - if( (work[k-1] < KFAC2*work[k]) ) - { - m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(m_current_k_opt)-1 ); - new_h = h_opt[m_current_k_opt]; - } - else if( (work[k] < KFAC2*work[k-1]) && !m_last_step_rejected ) - { - m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max-1) , static_cast<int>(m_current_k_opt)+1 ); - new_h = h_opt[k]; - new_h *= static_cast<value_type>(m_cost[m_current_k_opt])/static_cast<value_type>(m_cost[k]); - } else - new_h = h_opt[m_current_k_opt]; - break; - } - else if( should_reject( error , k ) ) - { - reject = true; - new_h = h_opt[m_current_k_opt]; - break; - } - } - if( k == m_current_k_opt+1 ) - { // convergence at k_opt+1 ? - if( error < 1.0 ) - { //convergence - reject = false; - if( work[k-2] < KFAC2*work[k-1] ) - m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(m_current_k_opt)-1 ); - if( (work[k] < KFAC2*work[m_current_k_opt]) && !m_last_step_rejected ) - m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , static_cast<int>(k) ); - new_h = h_opt[m_current_k_opt]; - } else - { - reject = true; - new_h = h_opt[m_current_k_opt]; - } - break; - } - } - } - - if( !reject ) - { - t += dt; - } - - if( !m_last_step_rejected || boost::numeric::odeint::detail::less_with_sign(new_h, dt, dt) ) - { - // limit step size - if( m_max_dt != static_cast<time_type>(0) ) - { - new_h = detail::min_abs(m_max_dt, new_h); - } - m_dt_last = new_h; - dt = new_h; - } - - m_last_step_rejected = reject; - m_first = false; - - if( reject ) - return fail; - else - return success; - } - - /** \brief Resets the internal state of the stepper */ - void reset() - { - m_first = true; - m_last_step_rejected = false; - // crude estimate of optimal order - m_current_k_opt = 4; - /* no calculation because log10 might not exist for value_type! - const value_type logfact( -log10( max BOOST_PREVENT_MACRO_SUBSTITUTION( eps_rel , static_cast< value_type >(1.0E-12) ) ) * 0.6 + 0.5 ); - m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>( 1 ) , min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>( m_k_max-1 ) , logfact )); - */ - } - - - /* Resizer methods */ - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_m_dxdt( x ); - resize_m_xnew( x ); - resize_impl( x ); - m_midpoint.adjust_size( x ); - } - - -private: - - template< class StateIn > - bool resize_m_dxdt( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - } - - template< class StateIn > - bool resize_m_xnew( const StateIn &x ) - { - return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() ); - } - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized( false ); - for( size_t i = 0 ; i < m_k_max ; ++i ) - resized |= adjust_size_by_resizeability( m_table[i] , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_err , x , typename is_resizeable<state_type>::type() ); - return resized; - } - - - template< class System , class StateInOut > - controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_error_bs_type::template resize_m_dxdt< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - sys( x , m_dxdt.m_v ,t ); - return try_step( system , x , m_dxdt.m_v , t , dt ); - } - - - template< class StateInOut > - void extrapolate( size_t k , state_table_type &table , const value_matrix &coeff , StateInOut &xest ) - /* polynomial extrapolation, see http://www.nr.com/webnotes/nr3web21.pdf - uses the obtained intermediate results to extrapolate to dt->0 - */ - { - static const value_type val1 = static_cast< value_type >( 1.0 ); - for( int j=k-1 ; j>0 ; --j ) - { - m_algebra.for_each3( table[j-1].m_v , table[j].m_v , table[j-1].m_v , - typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k][j] , -coeff[k][j] ) ); - } - m_algebra.for_each3( xest , table[0].m_v , xest , - typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k][0] , -coeff[k][0]) ); - } - - time_type calc_h_opt( time_type h , value_type error , size_t k ) const - /* calculates the optimal step size for a given error and stage number */ - { - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - using std::pow; - value_type expo( 1.0/(2*k+1) ); - value_type facmin = m_facmin_table[k]; - value_type fac; - if (error == 0.0) - fac=1.0/facmin; - else - { - fac = STEPFAC2 / pow BOOST_PREVENT_MACRO_SUBSTITUTION( error / STEPFAC1 , expo ); - fac = max BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>(facmin/STEPFAC4) , min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>(1.0/facmin) , fac ) ); - } - return h*fac; - } - - controlled_step_result set_k_opt( size_t k , const inv_time_vector &work , const time_vector &h_opt , time_type &dt ) - /* calculates the optimal stage number */ - { - if( k == 1 ) - { - m_current_k_opt = 2; - return success; - } - if( (work[k-1] < KFAC1*work[k]) || (k == m_k_max) ) - { // order decrease - m_current_k_opt = k-1; - dt = h_opt[ m_current_k_opt ]; - return success; - } - else if( (work[k] < KFAC2*work[k-1]) || m_last_step_rejected || (k == m_k_max-1) ) - { // same order - also do this if last step got rejected - m_current_k_opt = k; - dt = h_opt[ m_current_k_opt ]; - return success; - } - else - { // order increase - only if last step was not rejected - m_current_k_opt = k+1; - dt = h_opt[ m_current_k_opt-1 ] * m_cost[ m_current_k_opt ] / m_cost[ m_current_k_opt-1 ] ; - return success; - } - } - - bool in_convergence_window( size_t k ) const - { - if( (k == m_current_k_opt-1) && !m_last_step_rejected ) - return true; // decrease stepsize only if last step was not rejected - return ( (k == m_current_k_opt) || (k == m_current_k_opt+1) ); - } - - bool should_reject( value_type error , size_t k ) const - { - if( k == m_current_k_opt-1 ) - { - const value_type d = m_interval_sequence[m_current_k_opt] * m_interval_sequence[m_current_k_opt+1] / - (m_interval_sequence[0]*m_interval_sequence[0]); - //step will fail, criterion 17.3.17 in NR - return ( error > d*d ); - } - else if( k == m_current_k_opt ) - { - const value_type d = m_interval_sequence[m_current_k_opt] / m_interval_sequence[0]; - return ( error > d*d ); - } else - return error > 1.0; - } - - default_error_checker< value_type, algebra_type , operations_type > m_error_checker; - modified_midpoint< state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > m_midpoint; - - bool m_last_step_rejected; - bool m_first; - - time_type m_dt_last; - time_type m_t_last; - time_type m_max_dt; - - size_t m_current_k_opt; - - algebra_type m_algebra; - - resizer_type m_dxdt_resizer; - resizer_type m_xnew_resizer; - resizer_type m_resizer; - - wrapped_state_type m_xnew; - wrapped_state_type m_err; - wrapped_deriv_type m_dxdt; - - int_vector m_interval_sequence; // stores the successive interval counts - value_matrix m_coeff; - int_vector m_cost; // costs for interval count - value_vector m_facmin_table; // for precomputed facmin to save pow calls - - state_table_type m_table; // sequence of states for extrapolation - - value_type STEPFAC1 , STEPFAC2 , STEPFAC3 , STEPFAC4 , KFAC1 , KFAC2; -}; - - -/******** DOXYGEN ********/ -/** - * \class bulirsch_stoer - * \brief The Bulirsch-Stoer algorithm. - * - * The Bulirsch-Stoer is a controlled stepper that adjusts both step size - * and order of the method. The algorithm uses the modified midpoint and - * a polynomial extrapolation compute the solution. - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - /** - * \fn bulirsch_stoer::bulirsch_stoer( value_type eps_abs , value_type eps_rel , value_type factor_x , value_type factor_dxdt ) - * \brief Constructs the bulirsch_stoer class, including initialization of - * the error bounds. - * - * \param eps_abs Absolute tolerance level. - * \param eps_rel Relative tolerance level. - * \param factor_x Factor for the weight of the state. - * \param factor_dxdt Factor for the weight of the derivative. - */ - - /** - * \fn bulirsch_stoer::try_step( System system , StateInOut &x , time_type &t , time_type &dt ) - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. Also, the internal order of the stepper is adjusted if required. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. - * It must fulfill the Simple System concept. - * \param x The state of the ODE which should be solved. Overwritten if - * the step is successful. - * \param t The value of the time. Updated if the step is successful. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - - /** - * \fn bulirsch_stoer::try_step( System system , StateInOut &x , const DerivIn &dxdt , time_type &t , time_type &dt ) - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. Also, the internal order of the stepper is adjusted if required. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. - * It must fulfill the Simple System concept. - * \param x The state of the ODE which should be solved. Overwritten if - * the step is successful. - * \param dxdt The derivative of state. - * \param t The value of the time. Updated if the step is successful. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - - /** - * \fn bulirsch_stoer::try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt ) - * \brief Tries to perform one step. - * - * \note This method is disabled if state_type=time_type to avoid ambiguity. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. Also, the internal order of the stepper is adjusted if required. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. - * It must fulfill the Simple System concept. - * \param in The state of the ODE which should be solved. - * \param t The value of the time. Updated if the step is successful. - * \param out Used to store the result of the step. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - - - /** - * \fn bulirsch_stoer::try_step( System system , const StateIn &in , const DerivIn &dxdt , time_type &t , StateOut &out , time_type &dt ) - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. Also, the internal order of the stepper is adjusted if required. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. - * It must fulfill the Simple System concept. - * \param in The state of the ODE which should be solved. - * \param dxdt The derivative of state. - * \param t The value of the time. Updated if the step is successful. - * \param out Used to store the result of the step. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - - - /** - * \fn bulirsch_stoer::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp deleted file mode 100644 index 6a1eed15fb..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp +++ /dev/null @@ -1,838 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp - - [begin_description] - Implementaiton of the Burlish-Stoer method with dense output - [end_description] - - Copyright 2011-2015 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_DENSE_OUT_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_DENSE_OUT_HPP_INCLUDED - - -#include <iostream> - -#include <algorithm> - -#include <boost/config.hpp> // for min/max guidelines - -#include <boost/numeric/odeint/util/bind.hpp> - -#include <boost/math/special_functions/binomial.hpp> - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/modified_midpoint.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> - -#include <boost/numeric/odeint/integrate/max_step_checker.hpp> - -#include <boost/type_traits.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -template< - class State , - class Value = double , - class Deriv = State , - class Time = Value , - class Algebra = typename algebra_dispatcher< State >::algebra_type , - class Operations = typename operations_dispatcher< State >::operations_type , - class Resizer = initially_resizer - > -class bulirsch_stoer_dense_out { - - -public: - - typedef State state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef Time time_type; - typedef Algebra algebra_type; - typedef Operations operations_type; - typedef Resizer resizer_type; - typedef dense_output_stepper_tag stepper_category; -#ifndef DOXYGEN_SKIP - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - - typedef bulirsch_stoer_dense_out< State , Value , Deriv , Time , Algebra , Operations , Resizer > controlled_error_bs_type; - - typedef typename inverse_time< time_type >::type inv_time_type; - - typedef std::vector< value_type > value_vector; - typedef std::vector< time_type > time_vector; - typedef std::vector< inv_time_type > inv_time_vector; //should be 1/time_type for boost.units - typedef std::vector< value_vector > value_matrix; - typedef std::vector< size_t > int_vector; - typedef std::vector< wrapped_state_type > state_vector_type; - typedef std::vector< wrapped_deriv_type > deriv_vector_type; - typedef std::vector< deriv_vector_type > deriv_table_type; -#endif //DOXYGEN_SKIP - - const static size_t m_k_max = 8; - - - - bulirsch_stoer_dense_out( - value_type eps_abs = 1E-6 , value_type eps_rel = 1E-6 , - value_type factor_x = 1.0 , value_type factor_dxdt = 1.0 , - time_type max_dt = static_cast<time_type>(0) , - bool control_interpolation = false ) - : m_error_checker( eps_abs , eps_rel , factor_x, factor_dxdt ) , - m_max_dt(max_dt) , - m_control_interpolation( control_interpolation) , - m_last_step_rejected( false ) , m_first( true ) , - m_current_state_x1( true ) , - m_error( m_k_max ) , - m_interval_sequence( m_k_max+1 ) , - m_coeff( m_k_max+1 ) , - m_cost( m_k_max+1 ) , - m_facmin_table( m_k_max+1 ) , - m_table( m_k_max ) , - m_mp_states( m_k_max+1 ) , - m_derivs( m_k_max+1 ) , - m_diffs( 2*m_k_max+2 ) , - STEPFAC1( 0.65 ) , STEPFAC2( 0.94 ) , STEPFAC3( 0.02 ) , STEPFAC4( 4.0 ) , KFAC1( 0.8 ) , KFAC2( 0.9 ) - { - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - - for( unsigned short i = 0; i < m_k_max+1; i++ ) - { - /* only this specific sequence allows for dense output */ - m_interval_sequence[i] = 2 + 4*i; // 2 6 10 14 ... - m_derivs[i].resize( m_interval_sequence[i] ); - if( i == 0 ) - { - m_cost[i] = m_interval_sequence[i]; - } else - { - m_cost[i] = m_cost[i-1] + m_interval_sequence[i]; - } - m_facmin_table[i] = pow BOOST_PREVENT_MACRO_SUBSTITUTION( STEPFAC3 , static_cast< value_type >(1) / static_cast< value_type >( 2*i+1 ) ); - m_coeff[i].resize(i); - for( size_t k = 0 ; k < i ; ++k ) - { - const value_type r = static_cast< value_type >( m_interval_sequence[i] ) / static_cast< value_type >( m_interval_sequence[k] ); - m_coeff[i][k] = 1.0 / ( r*r - static_cast< value_type >( 1.0 ) ); // coefficients for extrapolation - } - // crude estimate of optimal order - - m_current_k_opt = 4; - /* no calculation because log10 might not exist for value_type! - const value_type logfact( -log10( max BOOST_PREVENT_MACRO_SUBSTITUTION( eps_rel , static_cast< value_type >( 1.0E-12 ) ) ) * 0.6 + 0.5 ); - m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 1 , min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>( m_k_max-1 ) , static_cast<int>( logfact ) )); - */ - } - int num = 1; - for( int i = 2*(m_k_max)+1 ; i >=0 ; i-- ) - { - m_diffs[i].resize( num ); - num += (i+1)%2; - } - } - - template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut > - controlled_step_result try_step( System system , const StateIn &in , const DerivIn &dxdt , time_type &t , StateOut &out , DerivOut &dxdt_new , time_type &dt ) - { - if( m_max_dt != static_cast<time_type>(0) && detail::less_with_sign(m_max_dt, dt, dt) ) - { - // given step size is bigger then max_dt - // set limit and return fail - dt = m_max_dt; - return fail; - } - - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - using std::pow; - - static const value_type val1( 1.0 ); - - bool reject( true ); - - time_vector h_opt( m_k_max+1 ); - inv_time_vector work( m_k_max+1 ); - - m_k_final = 0; - time_type new_h = dt; - - //std::cout << "t=" << t <<", dt=" << dt << ", k_opt=" << m_current_k_opt << ", first: " << m_first << std::endl; - - for( size_t k = 0 ; k <= m_current_k_opt+1 ; k++ ) - { - m_midpoint.set_steps( m_interval_sequence[k] ); - if( k == 0 ) - { - m_midpoint.do_step( system , in , dxdt , t , out , dt , m_mp_states[k].m_v , m_derivs[k]); - } - else - { - m_midpoint.do_step( system , in , dxdt , t , m_table[k-1].m_v , dt , m_mp_states[k].m_v , m_derivs[k] ); - extrapolate( k , m_table , m_coeff , out ); - // get error estimate - m_algebra.for_each3( m_err.m_v , out , m_table[0].m_v , - typename operations_type::template scale_sum2< value_type , value_type >( val1 , -val1 ) ); - const value_type error = m_error_checker.error( m_algebra , in , dxdt , m_err.m_v , dt ); - h_opt[k] = calc_h_opt( dt , error , k ); - work[k] = static_cast<value_type>( m_cost[k] ) / h_opt[k]; - - m_k_final = k; - - if( (k == m_current_k_opt-1) || m_first ) - { // convergence before k_opt ? - if( error < 1.0 ) - { - //convergence - reject = false; - if( (work[k] < KFAC2*work[k-1]) || (m_current_k_opt <= 2) ) - { - // leave order as is (except we were in first round) - m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(k)+1 ) ); - new_h = h_opt[k] * static_cast<value_type>( m_cost[k+1] ) / static_cast<value_type>( m_cost[k] ); - } else { - m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(k) ) ); - new_h = h_opt[k]; - } - break; - } - else if( should_reject( error , k ) && !m_first ) - { - reject = true; - new_h = h_opt[k]; - break; - } - } - if( k == m_current_k_opt ) - { // convergence at k_opt ? - if( error < 1.0 ) - { - //convergence - reject = false; - if( (work[k-1] < KFAC2*work[k]) ) - { - m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(m_current_k_opt)-1 ); - new_h = h_opt[m_current_k_opt]; - } - else if( (work[k] < KFAC2*work[k-1]) && !m_last_step_rejected ) - { - m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , static_cast<int>(m_current_k_opt)+1 ); - new_h = h_opt[k]*static_cast<value_type>( m_cost[m_current_k_opt] ) / static_cast<value_type>( m_cost[k] ); - } else - new_h = h_opt[m_current_k_opt]; - break; - } - else if( should_reject( error , k ) ) - { - reject = true; - new_h = h_opt[m_current_k_opt]; - break; - } - } - if( k == m_current_k_opt+1 ) - { // convergence at k_opt+1 ? - if( error < 1.0 ) - { //convergence - reject = false; - if( work[k-2] < KFAC2*work[k-1] ) - m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( 2 , static_cast<int>(m_current_k_opt)-1 ); - if( (work[k] < KFAC2*work[m_current_k_opt]) && !m_last_step_rejected ) - m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max)-1 , static_cast<int>(k) ); - new_h = h_opt[m_current_k_opt]; - } else - { - reject = true; - new_h = h_opt[m_current_k_opt]; - } - break; - } - } - } - - if( !reject ) - { - - //calculate dxdt for next step and dense output - typename odeint::unwrap_reference< System >::type &sys = system; - sys( out , dxdt_new , t+dt ); - - //prepare dense output - value_type error = prepare_dense_output( m_k_final , in , dxdt , out , dxdt_new , dt ); - - if( error > static_cast<value_type>(10) ) // we are not as accurate for interpolation as for the steps - { - reject = true; - new_h = dt * pow BOOST_PREVENT_MACRO_SUBSTITUTION( error , static_cast<value_type>(-1)/(2*m_k_final+2) ); - } else { - t += dt; - } - } - //set next stepsize - if( !m_last_step_rejected || (new_h < dt) ) - { - // limit step size - if( m_max_dt != static_cast<time_type>(0) ) - { - new_h = detail::min_abs(m_max_dt, new_h); - } - dt = new_h; - } - - m_last_step_rejected = reject; - if( reject ) - return fail; - else - return success; - } - - template< class StateType > - void initialize( const StateType &x0 , const time_type &t0 , const time_type &dt0 ) - { - m_resizer.adjust_size( x0 , detail::bind( &controlled_error_bs_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) ); - boost::numeric::odeint::copy( x0 , get_current_state() ); - m_t = t0; - m_dt = dt0; - reset(); - } - - - /* ======================================================= - * the actual step method that should be called from outside (maybe make try_step private?) - */ - template< class System > - std::pair< time_type , time_type > do_step( System system ) - { - if( m_first ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - sys( get_current_state() , get_current_deriv() , m_t ); - } - - failed_step_checker fail_checker; // to throw a runtime_error if step size adjustment fails - controlled_step_result res = fail; - m_t_last = m_t; - while( res == fail ) - { - res = try_step( system , get_current_state() , get_current_deriv() , m_t , get_old_state() , get_old_deriv() , m_dt ); - m_first = false; - fail_checker(); // check for overflow of failed steps - } - toggle_current_state(); - return std::make_pair( m_t_last , m_t ); - } - - /* performs the interpolation from a calculated step */ - template< class StateOut > - void calc_state( time_type t , StateOut &x ) const - { - do_interpolation( t , x ); - } - - const state_type& current_state( void ) const - { - return get_current_state(); - } - - time_type current_time( void ) const - { - return m_t; - } - - const state_type& previous_state( void ) const - { - return get_old_state(); - } - - time_type previous_time( void ) const - { - return m_t_last; - } - - time_type current_time_step( void ) const - { - return m_dt; - } - - /** \brief Resets the internal state of the stepper. */ - void reset() - { - m_first = true; - m_last_step_rejected = false; - } - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_impl( x ); - m_midpoint.adjust_size( x ); - } - - -private: - - template< class StateInOut , class StateVector > - void extrapolate( size_t k , StateVector &table , const value_matrix &coeff , StateInOut &xest , size_t order_start_index = 0 ) - //polynomial extrapolation, see http://www.nr.com/webnotes/nr3web21.pdf - { - static const value_type val1( 1.0 ); - for( int j=k-1 ; j>0 ; --j ) - { - m_algebra.for_each3( table[j-1].m_v , table[j].m_v , table[j-1].m_v , - typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k + order_start_index][j + order_start_index] , - -coeff[k + order_start_index][j + order_start_index] ) ); - } - m_algebra.for_each3( xest , table[0].m_v , xest , - typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k + order_start_index][0 + order_start_index] , - -coeff[k + order_start_index][0 + order_start_index]) ); - } - - - template< class StateVector > - void extrapolate_dense_out( size_t k , StateVector &table , const value_matrix &coeff , size_t order_start_index = 0 ) - //polynomial extrapolation, see http://www.nr.com/webnotes/nr3web21.pdf - { - // result is written into table[0] - static const value_type val1( 1.0 ); - for( int j=k ; j>1 ; --j ) - { - m_algebra.for_each3( table[j-1].m_v , table[j].m_v , table[j-1].m_v , - typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k + order_start_index][j + order_start_index - 1] , - -coeff[k + order_start_index][j + order_start_index - 1] ) ); - } - m_algebra.for_each3( table[0].m_v , table[1].m_v , table[0].m_v , - typename operations_type::template scale_sum2< value_type , value_type >( val1 + coeff[k + order_start_index][order_start_index] , - -coeff[k + order_start_index][order_start_index]) ); - } - - time_type calc_h_opt( time_type h , value_type error , size_t k ) const - { - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - using std::pow; - - value_type expo = static_cast<value_type>(1)/(m_interval_sequence[k-1]); - value_type facmin = m_facmin_table[k]; - value_type fac; - if (error == 0.0) - fac = static_cast<value_type>(1)/facmin; - else - { - fac = STEPFAC2 / pow BOOST_PREVENT_MACRO_SUBSTITUTION( error / STEPFAC1 , expo ); - fac = max BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>( facmin/STEPFAC4 ) , min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>(static_cast<value_type>(1)/facmin) , fac ) ); - } - return h*fac; - } - - bool in_convergence_window( size_t k ) const - { - if( (k == m_current_k_opt-1) && !m_last_step_rejected ) - return true; // decrease order only if last step was not rejected - return ( (k == m_current_k_opt) || (k == m_current_k_opt+1) ); - } - - bool should_reject( value_type error , size_t k ) const - { - if( k == m_current_k_opt-1 ) - { - const value_type d = m_interval_sequence[m_current_k_opt] * m_interval_sequence[m_current_k_opt+1] / - (m_interval_sequence[0]*m_interval_sequence[0]); - //step will fail, criterion 17.3.17 in NR - return ( error > d*d ); - } - else if( k == m_current_k_opt ) - { - const value_type d = m_interval_sequence[m_current_k_opt+1] / m_interval_sequence[0]; - return ( error > d*d ); - } else - return error > 1.0; - } - - template< class StateIn1 , class DerivIn1 , class StateIn2 , class DerivIn2 > - value_type prepare_dense_output( int k , const StateIn1 &x_start , const DerivIn1 &dxdt_start , - const StateIn2 & /* x_end */ , const DerivIn2 & /*dxdt_end */ , time_type dt ) - /* k is the order to which the result was approximated */ - { - - /* compute the coefficients of the interpolation polynomial - * we parametrize the interval t .. t+dt by theta = -1 .. 1 - * we use 2k+3 values at the interval center theta=0 to obtain the interpolation coefficients - * the values are x(t+dt/2) and the derivatives dx/dt , ... d^(2k+2) x / dt^(2k+2) at the midpoints - * the derivatives are approximated via finite differences - * all values are obtained from interpolation of the results from the increasing orders of the midpoint calls - */ - - // calculate finite difference approximations to derivatives at the midpoint - for( int j = 0 ; j<=k ; j++ ) - { - /* not working with boost units... */ - const value_type d = m_interval_sequence[j] / ( static_cast<value_type>(2) * dt ); - value_type f = 1.0; //factor 1/2 here because our interpolation interval has length 2 !!! - for( int kappa = 0 ; kappa <= 2*j+1 ; ++kappa ) - { - calculate_finite_difference( j , kappa , f , dxdt_start ); - f *= d; - } - - if( j > 0 ) - extrapolate_dense_out( j , m_mp_states , m_coeff ); - } - - time_type d = dt/2; - - // extrapolate finite differences - for( int kappa = 0 ; kappa<=2*k+1 ; kappa++ ) - { - for( int j=1 ; j<=(k-kappa/2) ; ++j ) - extrapolate_dense_out( j , m_diffs[kappa] , m_coeff , kappa/2 ); - - // extrapolation results are now stored in m_diffs[kappa][0] - - // divide kappa-th derivative by kappa because we need these terms for dense output interpolation - m_algebra.for_each1( m_diffs[kappa][0].m_v , typename operations_type::template scale< time_type >( static_cast<time_type>(d) ) ); - - d *= dt/(2*(kappa+2)); - } - - // dense output coefficients a_0 is stored in m_mp_states[0], a_i for i = 1...2k are stored in m_diffs[i-1][0] - - // the error is just the highest order coefficient of the interpolation polynomial - // this is because we use only the midpoint theta=0 as support for the interpolation (remember that theta = -1 .. 1) - - value_type error = 0.0; - if( m_control_interpolation ) - { - boost::numeric::odeint::copy( m_diffs[2*k+1][0].m_v , m_err.m_v ); - error = m_error_checker.error( m_algebra , x_start , dxdt_start , m_err.m_v , dt ); - } - - return error; - } - - template< class DerivIn > - void calculate_finite_difference( size_t j , size_t kappa , value_type fac , const DerivIn &dxdt ) - { - const int m = m_interval_sequence[j]/2-1; - if( kappa == 0) // no calculation required for 0th derivative of f - { - m_algebra.for_each2( m_diffs[0][j].m_v , m_derivs[j][m].m_v , - typename operations_type::template scale_sum1< value_type >( fac ) ); - } - else - { - // calculate the index of m_diffs for this kappa-j-combination - const int j_diffs = j - kappa/2; - - m_algebra.for_each2( m_diffs[kappa][j_diffs].m_v , m_derivs[j][m+kappa].m_v , - typename operations_type::template scale_sum1< value_type >( fac ) ); - value_type sign = -1.0; - int c = 1; - //computes the j-th order finite difference for the kappa-th derivative of f at t+dt/2 using function evaluations stored in m_derivs - for( int i = m+static_cast<int>(kappa)-2 ; i >= m-static_cast<int>(kappa) ; i -= 2 ) - { - if( i >= 0 ) - { - m_algebra.for_each3( m_diffs[kappa][j_diffs].m_v , m_diffs[kappa][j_diffs].m_v , m_derivs[j][i].m_v , - typename operations_type::template scale_sum2< value_type , value_type >( 1.0 , - sign * fac * boost::math::binomial_coefficient< value_type >( kappa , c ) ) ); - } - else - { - m_algebra.for_each3( m_diffs[kappa][j_diffs].m_v , m_diffs[kappa][j_diffs].m_v , dxdt , - typename operations_type::template scale_sum2< value_type , value_type >( 1.0 , sign * fac ) ); - } - sign *= -1; - ++c; - } - } - } - - template< class StateOut > - void do_interpolation( time_type t , StateOut &out ) const - { - // interpolation polynomial is defined for theta = -1 ... 1 - // m_k_final is the number of order-iterations done for the last step - it governs the order of the interpolation polynomial - const value_type theta = 2 * get_unit_value( (t - m_t_last) / (m_t - m_t_last) ) - 1; - // we use only values at interval center, that is theta=0, for interpolation - // our interpolation polynomial is thus of order 2k+2, hence we have 2k+3 terms - - boost::numeric::odeint::copy( m_mp_states[0].m_v , out ); - // add remaining terms: x += a_1 theta + a2 theta^2 + ... + a_{2k} theta^{2k} - value_type theta_pow( theta ); - for( size_t i=0 ; i<=2*m_k_final+1 ; ++i ) - { - m_algebra.for_each3( out , out , m_diffs[i][0].m_v , - typename operations_type::template scale_sum2< value_type >( static_cast<value_type>(1) , theta_pow ) ); - theta_pow *= theta; - } - } - - /* Resizer methods */ - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized( false ); - - resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_err , x , typename is_resizeable<state_type>::type() ); - - for( size_t i = 0 ; i < m_k_max ; ++i ) - resized |= adjust_size_by_resizeability( m_table[i] , x , typename is_resizeable<state_type>::type() ); - for( size_t i = 0 ; i < m_k_max+1 ; ++i ) - resized |= adjust_size_by_resizeability( m_mp_states[i] , x , typename is_resizeable<state_type>::type() ); - for( size_t i = 0 ; i < m_k_max+1 ; ++i ) - for( size_t j = 0 ; j < m_derivs[i].size() ; ++j ) - resized |= adjust_size_by_resizeability( m_derivs[i][j] , x , typename is_resizeable<deriv_type>::type() ); - for( size_t i = 0 ; i < 2*m_k_max+2 ; ++i ) - for( size_t j = 0 ; j < m_diffs[i].size() ; ++j ) - resized |= adjust_size_by_resizeability( m_diffs[i][j] , x , typename is_resizeable<deriv_type>::type() ); - - return resized; - } - - - state_type& get_current_state( void ) - { - return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ; - } - - const state_type& get_current_state( void ) const - { - return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ; - } - - state_type& get_old_state( void ) - { - return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ; - } - - const state_type& get_old_state( void ) const - { - return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ; - } - - deriv_type& get_current_deriv( void ) - { - return m_current_state_x1 ? m_dxdt1.m_v : m_dxdt2.m_v ; - } - - const deriv_type& get_current_deriv( void ) const - { - return m_current_state_x1 ? m_dxdt1.m_v : m_dxdt2.m_v ; - } - - deriv_type& get_old_deriv( void ) - { - return m_current_state_x1 ? m_dxdt2.m_v : m_dxdt1.m_v ; - } - - const deriv_type& get_old_deriv( void ) const - { - return m_current_state_x1 ? m_dxdt2.m_v : m_dxdt1.m_v ; - } - - - void toggle_current_state( void ) - { - m_current_state_x1 = ! m_current_state_x1; - } - - - - default_error_checker< value_type, algebra_type , operations_type > m_error_checker; - modified_midpoint_dense_out< state_type , value_type , deriv_type , time_type , algebra_type , operations_type , resizer_type > m_midpoint; - - time_type m_max_dt; - - bool m_control_interpolation; - - bool m_last_step_rejected; - bool m_first; - - time_type m_t; - time_type m_dt; - time_type m_dt_last; - time_type m_t_last; - - size_t m_current_k_opt; - size_t m_k_final; - - algebra_type m_algebra; - - resizer_type m_resizer; - - wrapped_state_type m_x1 , m_x2; - wrapped_deriv_type m_dxdt1 , m_dxdt2; - wrapped_state_type m_err; - bool m_current_state_x1; - - - - value_vector m_error; // errors of repeated midpoint steps and extrapolations - int_vector m_interval_sequence; // stores the successive interval counts - value_matrix m_coeff; - int_vector m_cost; // costs for interval count - value_vector m_facmin_table; // for precomputed facmin to save pow calls - - state_vector_type m_table; // sequence of states for extrapolation - - //for dense output: - state_vector_type m_mp_states; // sequence of approximations of x at distance center - deriv_table_type m_derivs; // table of function values - deriv_table_type m_diffs; // table of function values - - //wrapped_state_type m_a1 , m_a2 , m_a3 , m_a4; - - value_type STEPFAC1 , STEPFAC2 , STEPFAC3 , STEPFAC4 , KFAC1 , KFAC2; -}; - - - -/********** DOXYGEN **********/ - -/** - * \class bulirsch_stoer_dense_out - * \brief The Bulirsch-Stoer algorithm. - * - * The Bulirsch-Stoer is a controlled stepper that adjusts both step size - * and order of the method. The algorithm uses the modified midpoint and - * a polynomial extrapolation compute the solution. This class also provides - * dense output facility. - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - /** - * \fn bulirsch_stoer_dense_out::bulirsch_stoer_dense_out( value_type eps_abs , value_type eps_rel , value_type factor_x , value_type factor_dxdt , bool control_interpolation ) - * \brief Constructs the bulirsch_stoer class, including initialization of - * the error bounds. - * - * \param eps_abs Absolute tolerance level. - * \param eps_rel Relative tolerance level. - * \param factor_x Factor for the weight of the state. - * \param factor_dxdt Factor for the weight of the derivative. - * \param control_interpolation Set true to additionally control the error of - * the interpolation. - */ - - /** - * \fn bulirsch_stoer_dense_out::try_step( System system , const StateIn &in , const DerivIn &dxdt , time_type &t , StateOut &out , DerivOut &dxdt_new , time_type &dt ) - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. Also, the internal order of the stepper is adjusted if required. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. - * It must fulfill the Simple System concept. - * \param in The state of the ODE which should be solved. - * \param dxdt The derivative of state. - * \param t The value of the time. Updated if the step is successful. - * \param out Used to store the result of the step. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - - /** - * \fn bulirsch_stoer_dense_out::initialize( const StateType &x0 , const time_type &t0 , const time_type &dt0 ) - * \brief Initializes the dense output stepper. - * - * \param x0 The initial state. - * \param t0 The initial time. - * \param dt0 The initial time step. - */ - - /** - * \fn bulirsch_stoer_dense_out::do_step( System system ) - * \brief Does one time step. This is the main method that should be used to - * integrate an ODE with this stepper. - * \note initialize has to be called before using this method to set the - * initial conditions x,t and the stepsize. - * \param system The system function to solve, hence the r.h.s. of the - * ordinary differential equation. It must fulfill the Simple System concept. - * \return Pair with start and end time of the integration step. - */ - - /** - * \fn bulirsch_stoer_dense_out::calc_state( time_type t , StateOut &x ) const - * \brief Calculates the solution at an intermediate point within the last step - * \param t The time at which the solution should be calculated, has to be - * in the current time interval. - * \param x The output variable where the result is written into. - */ - - /** - * \fn bulirsch_stoer_dense_out::current_state( void ) const - * \brief Returns the current state of the solution. - * \return The current state of the solution x(t). - */ - - /** - * \fn bulirsch_stoer_dense_out::current_time( void ) const - * \brief Returns the current time of the solution. - * \return The current time of the solution t. - */ - - /** - * \fn bulirsch_stoer_dense_out::previous_state( void ) const - * \brief Returns the last state of the solution. - * \return The last state of the solution x(t-dt). - */ - - /** - * \fn bulirsch_stoer_dense_out::previous_time( void ) const - * \brief Returns the last time of the solution. - * \return The last time of the solution t-dt. - */ - - /** - * \fn bulirsch_stoer_dense_out::current_time_step( void ) const - * \brief Returns the current step size. - * \return The current step size. - */ - - /** - * \fn bulirsch_stoer_dense_out::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_BULIRSCH_STOER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp deleted file mode 100644 index aac2b02dca..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp +++ /dev/null @@ -1,1014 +0,0 @@ -/* [auto_generated] - boost/numeric/odeint/stepper/controlled_runge_kutta.hpp - - [begin_description] - The default controlled stepper which can be used with all explicit Runge-Kutta error steppers. - [end_description] - - Copyright 2010-2013 Karsten Ahnert - Copyright 2010-2015 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED - - - -#include <cmath> - -#include <boost/config.hpp> -#include <boost/utility/enable_if.hpp> -#include <boost/type_traits/is_same.hpp> - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/util/copy.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> - -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -template -< -class Value , -class Algebra , -class Operations -> -class default_error_checker -{ -public: - - typedef Value value_type; - typedef Algebra algebra_type; - typedef Operations operations_type; - - default_error_checker( - value_type eps_abs = static_cast< value_type >( 1.0e-6 ) , - value_type eps_rel = static_cast< value_type >( 1.0e-6 ) , - value_type a_x = static_cast< value_type >( 1 ) , - value_type a_dxdt = static_cast< value_type >( 1 )) - : m_eps_abs( eps_abs ) , m_eps_rel( eps_rel ) , m_a_x( a_x ) , m_a_dxdt( a_dxdt ) - { } - - - template< class State , class Deriv , class Err, class Time > - value_type error( const State &x_old , const Deriv &dxdt_old , Err &x_err , Time dt ) const - { - return error( algebra_type() , x_old , dxdt_old , x_err , dt ); - } - - template< class State , class Deriv , class Err, class Time > - value_type error( algebra_type &algebra , const State &x_old , const Deriv &dxdt_old , Err &x_err , Time dt ) const - { - using std::abs; - // this overwrites x_err ! - algebra.for_each3( x_err , x_old , dxdt_old , - typename operations_type::template rel_error< value_type >( m_eps_abs , m_eps_rel , m_a_x , m_a_dxdt * abs(get_unit_value( dt )) ) ); - - // value_type res = algebra.reduce( x_err , - // typename operations_type::template maximum< value_type >() , static_cast< value_type >( 0 ) ); - return algebra.norm_inf( x_err ); - } - -private: - - value_type m_eps_abs; - value_type m_eps_rel; - value_type m_a_x; - value_type m_a_dxdt; - -}; - - -template< typename Value, typename Time > -class default_step_adjuster -{ -public: - typedef Time time_type; - typedef Value value_type; - - default_step_adjuster(const time_type max_dt=static_cast<time_type>(0)) - : m_max_dt(max_dt) - {} - - - time_type decrease_step(time_type dt, const value_type error, const int error_order) const - { - // returns the decreased time step - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - using std::pow; - - dt *= max - BOOST_PREVENT_MACRO_SUBSTITUTION( - static_cast<value_type>( static_cast<value_type>(9) / static_cast<value_type>(10) * - pow(error, static_cast<value_type>(-1) / (error_order - 1))), - static_cast<value_type>( static_cast<value_type>(1) / static_cast<value_type> (5))); - if(m_max_dt != static_cast<time_type >(0)) - // limit to maximal stepsize even when decreasing - dt = detail::min_abs(dt, m_max_dt); - return dt; - } - - time_type increase_step(time_type dt, value_type error, const int stepper_order) const - { - // returns the increased time step - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - using std::pow; - - // adjust the size if dt is smaller than max_dt (providede max_dt is not zero) - if(error < 0.5) - { - // error should be > 0 - error = max BOOST_PREVENT_MACRO_SUBSTITUTION ( - static_cast<value_type>( pow( static_cast<value_type>(5.0) , -static_cast<value_type>(stepper_order) ) ) , - error); - // time_type dt_old = dt; unused variable warning - //error too small - increase dt and keep the evolution and limit scaling factor to 5.0 - dt *= static_cast<value_type>(9)/static_cast<value_type>(10) * - pow(error, static_cast<value_type>(-1) / stepper_order); - if(m_max_dt != static_cast<time_type >(0)) - // limit to maximal stepsize - dt = detail::min_abs(dt, m_max_dt); - } - return dt; - } - - bool check_step_size_limit(const time_type dt) - { - if(m_max_dt != static_cast<time_type >(0)) - return detail::less_eq_with_sign(dt, m_max_dt, dt); - return true; - } - - time_type get_max_dt() { return m_max_dt; } - -private: - time_type m_max_dt; -}; - - - -/* - * error stepper category dispatcher - */ -template< -class ErrorStepper , -class ErrorChecker = default_error_checker< typename ErrorStepper::value_type , - typename ErrorStepper::algebra_type , - typename ErrorStepper::operations_type > , -class StepAdjuster = default_step_adjuster< typename ErrorStepper::value_type , - typename ErrorStepper::time_type > , -class Resizer = typename ErrorStepper::resizer_type , -class ErrorStepperCategory = typename ErrorStepper::stepper_category -> -class controlled_runge_kutta ; - - - -/* - * explicit stepper version - * - * this class introduces the following try_step overloads - * try_step( sys , x , t , dt ) - * try_step( sys , x , dxdt , t , dt ) - * try_step( sys , in , t , out , dt ) - * try_step( sys , in , dxdt , t , out , dt ) - */ -/** - * \brief Implements step size control for Runge-Kutta steppers with error - * estimation. - * - * This class implements the step size control for standard Runge-Kutta - * steppers with error estimation. - * - * \tparam ErrorStepper The stepper type with error estimation, has to fulfill the ErrorStepper concept. - * \tparam ErrorChecker The error checker - * \tparam Resizer The resizer policy type. - */ -template< -class ErrorStepper, -class ErrorChecker, -class StepAdjuster, -class Resizer -> -class controlled_runge_kutta< ErrorStepper , ErrorChecker , StepAdjuster, Resizer , - explicit_error_stepper_tag > -{ - -public: - - typedef ErrorStepper stepper_type; - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::algebra_type algebra_type; - typedef typename stepper_type::operations_type operations_type; - typedef Resizer resizer_type; - typedef ErrorChecker error_checker_type; - typedef StepAdjuster step_adjuster_type; - typedef explicit_controlled_stepper_tag stepper_category; - -#ifndef DOXYGEN_SKIP - typedef typename stepper_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type; - - typedef controlled_runge_kutta< ErrorStepper , ErrorChecker , StepAdjuster , - Resizer , explicit_error_stepper_tag > controlled_stepper_type; -#endif //DOXYGEN_SKIP - - - /** - * \brief Constructs the controlled Runge-Kutta stepper. - * \param error_checker An instance of the error checker. - * \param stepper An instance of the underlying stepper. - */ - controlled_runge_kutta( - const error_checker_type &error_checker = error_checker_type( ) , - const step_adjuster_type &step_adjuster = step_adjuster_type() , - const stepper_type &stepper = stepper_type( ) - ) - : m_stepper(stepper), m_error_checker(error_checker) , m_step_adjuster(step_adjuster) - { } - - - - /* - * Version 1 : try_step( sys , x , t , dt ) - * - * The overloads are needed to solve the forwarding problem - */ - /** - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. Overwritten if - * the step is successful. - * \param t The value of the time. Updated if the step is successful. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateInOut > - controlled_step_result try_step( System system , StateInOut &x , time_type &t , time_type &dt ) - { - return try_step_v1( system , x , t, dt ); - } - - /** - * \brief Tries to perform one step. Solves the forwarding problem and - * allows for using boost range as state_type. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. Overwritten if - * the step is successful. Can be a boost range. - * \param t The value of the time. Updated if the step is successful. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateInOut > - controlled_step_result try_step( System system , const StateInOut &x , time_type &t , time_type &dt ) - { - return try_step_v1( system , x , t, dt ); - } - - - - /* - * Version 2 : try_step( sys , x , dxdt , t , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - /** - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. Overwritten if - * the step is successful. - * \param dxdt The derivative of state. - * \param t The value of the time. Updated if the step is successful. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateInOut , class DerivIn > - controlled_step_result try_step( System system , StateInOut &x , const DerivIn &dxdt , time_type &t , time_type &dt ) - { - m_xnew_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_xnew_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , dt ); - if( res == success ) - { - boost::numeric::odeint::copy( m_xnew.m_v , x ); - } - return res; - } - - /* - * Version 3 : try_step( sys , in , t , out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - * - * the disable is needed to avoid ambiguous overloads if state_type = time_type - */ - /** - * \brief Tries to perform one step. - * - * \note This method is disabled if state_type=time_type to avoid ambiguity. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. - * \param t The value of the time. Updated if the step is successful. - * \param out Used to store the result of the step. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateIn , class StateOut > - typename boost::disable_if< boost::is_same< StateIn , time_type > , controlled_step_result >::type - try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); - sys( in , m_dxdt.m_v , t ); - return try_step( system , in , m_dxdt.m_v , t , out , dt ); - } - - - /* - * Version 4 : try_step( sys , in , dxdt , t , out , dt ) - * - * this version does not solve the forwarding problem, boost.range can not be used - */ - /** - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. - * \param dxdt The derivative of state. - * \param t The value of the time. Updated if the step is successful. - * \param out Used to store the result of the step. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateIn , class DerivIn , class StateOut > - controlled_step_result try_step( System system , const StateIn &in , const DerivIn &dxdt , time_type &t , StateOut &out , time_type &dt ) - { - if( !m_step_adjuster.check_step_size_limit(dt) ) - { - // given dt was above step size limit - adjust and return fail; - dt = m_step_adjuster.get_max_dt(); - return fail; - } - - m_xerr_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_xerr_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); - - // do one step with error calculation - m_stepper.do_step( system , in , dxdt , t , out , dt , m_xerr.m_v ); - - value_type max_rel_err = m_error_checker.error( m_stepper.algebra() , in , dxdt , m_xerr.m_v , dt ); - - if( max_rel_err > 1.0 ) - { - // error too big, decrease step size and reject this step - dt = m_step_adjuster.decrease_step(dt, max_rel_err, m_stepper.error_order()); - return fail; - } else - { - // otherwise, increase step size and accept - t += dt; - dt = m_step_adjuster.increase_step(dt, max_rel_err, m_stepper.stepper_order()); - return success; - } - } - - /** - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_m_xerr_impl( x ); - resize_m_dxdt_impl( x ); - resize_m_xnew_impl( x ); - m_stepper.adjust_size( x ); - } - - /** - * \brief Returns the instance of the underlying stepper. - * \returns The instance of the underlying stepper. - */ - stepper_type& stepper( void ) - { - return m_stepper; - } - - /** - * \brief Returns the instance of the underlying stepper. - * \returns The instance of the underlying stepper. - */ - const stepper_type& stepper( void ) const - { - return m_stepper; - } - -private: - - - template< class System , class StateInOut > - controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - sys( x , m_dxdt.m_v ,t ); - return try_step( system , x , m_dxdt.m_v , t , dt ); - } - - template< class StateIn > - bool resize_m_xerr_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() ); - } - - template< class StateIn > - bool resize_m_dxdt_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - } - - template< class StateIn > - bool resize_m_xnew_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() ); - } - - - - stepper_type m_stepper; - error_checker_type m_error_checker; - step_adjuster_type m_step_adjuster; - - resizer_type m_dxdt_resizer; - resizer_type m_xerr_resizer; - resizer_type m_xnew_resizer; - - wrapped_deriv_type m_dxdt; - wrapped_state_type m_xerr; - wrapped_state_type m_xnew; -}; - - - - - - - - - - -/* - * explicit stepper fsal version - * - * the class introduces the following try_step overloads - * try_step( sys , x , t , dt ) - * try_step( sys , in , t , out , dt ) - * try_step( sys , x , dxdt , t , dt ) - * try_step( sys , in , dxdt_in , t , out , dxdt_out , dt ) - */ -/** - * \brief Implements step size control for Runge-Kutta FSAL steppers with - * error estimation. - * - * This class implements the step size control for FSAL Runge-Kutta - * steppers with error estimation. - * - * \tparam ErrorStepper The stepper type with error estimation, has to fulfill the ErrorStepper concept. - * \tparam ErrorChecker The error checker - * \tparam Resizer The resizer policy type. - */ -template< -class ErrorStepper , -class ErrorChecker , -class StepAdjuster , -class Resizer -> -class controlled_runge_kutta< ErrorStepper , ErrorChecker , StepAdjuster , Resizer , explicit_error_stepper_fsal_tag > -{ - -public: - - typedef ErrorStepper stepper_type; - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::algebra_type algebra_type; - typedef typename stepper_type::operations_type operations_type; - typedef Resizer resizer_type; - typedef ErrorChecker error_checker_type; - typedef StepAdjuster step_adjuster_type; - typedef explicit_controlled_stepper_fsal_tag stepper_category; - -#ifndef DOXYGEN_SKIP - typedef typename stepper_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type; - - typedef controlled_runge_kutta< ErrorStepper , ErrorChecker , StepAdjuster , Resizer , explicit_error_stepper_tag > controlled_stepper_type; -#endif // DOXYGEN_SKIP - - /** - * \brief Constructs the controlled Runge-Kutta stepper. - * \param error_checker An instance of the error checker. - * \param stepper An instance of the underlying stepper. - */ - controlled_runge_kutta( - const error_checker_type &error_checker = error_checker_type() , - const step_adjuster_type &step_adjuster = step_adjuster_type() , - const stepper_type &stepper = stepper_type() - ) - : m_stepper( stepper ) , m_error_checker( error_checker ) , m_step_adjuster(step_adjuster) , - m_first_call( true ) - { } - - /* - * Version 1 : try_step( sys , x , t , dt ) - * - * The two overloads are needed in order to solve the forwarding problem - */ - /** - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. Overwritten if - * the step is successful. - * \param t The value of the time. Updated if the step is successful. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateInOut > - controlled_step_result try_step( System system , StateInOut &x , time_type &t , time_type &dt ) - { - return try_step_v1( system , x , t , dt ); - } - - - /** - * \brief Tries to perform one step. Solves the forwarding problem and - * allows for using boost range as state_type. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. Overwritten if - * the step is successful. Can be a boost range. - * \param t The value of the time. Updated if the step is successful. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateInOut > - controlled_step_result try_step( System system , const StateInOut &x , time_type &t , time_type &dt ) - { - return try_step_v1( system , x , t , dt ); - } - - - - /* - * Version 2 : try_step( sys , in , t , out , dt ); - * - * This version does not solve the forwarding problem, boost::range can not be used. - * - * The disabler is needed to solve ambiguous overloads - */ - /** - * \brief Tries to perform one step. - * - * \note This method is disabled if state_type=time_type to avoid ambiguity. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. - * \param t The value of the time. Updated if the step is successful. - * \param out Used to store the result of the step. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateIn , class StateOut > - typename boost::disable_if< boost::is_same< StateIn , time_type > , controlled_step_result >::type - try_step( System system , const StateIn &in , time_type &t , StateOut &out , time_type &dt ) - { - if( m_dxdt_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) - { - initialize( system , in , t ); - } - return try_step( system , in , m_dxdt.m_v , t , out , dt ); - } - - - /* - * Version 3 : try_step( sys , x , dxdt , t , dt ) - * - * This version does not solve the forwarding problem, boost::range can not be used. - */ - /** - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The state of the ODE which should be solved. Overwritten if - * the step is successful. - * \param dxdt The derivative of state. - * \param t The value of the time. Updated if the step is successful. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateInOut , class DerivInOut > - controlled_step_result try_step( System system , StateInOut &x , DerivInOut &dxdt , time_type &t , time_type &dt ) - { - m_xnew_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_xnew_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - m_dxdt_new_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_new_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); - controlled_step_result res = try_step( system , x , dxdt , t , m_xnew.m_v , m_dxdtnew.m_v , dt ); - if( res == success ) - { - boost::numeric::odeint::copy( m_xnew.m_v , x ); - boost::numeric::odeint::copy( m_dxdtnew.m_v , dxdt ); - } - return res; - } - - - /* - * Version 4 : try_step( sys , in , dxdt_in , t , out , dxdt_out , dt ) - * - * This version does not solve the forwarding problem, boost::range can not be used. - */ - /** - * \brief Tries to perform one step. - * - * This method tries to do one step with step size dt. If the error estimate - * is to large, the step is rejected and the method returns fail and the - * step size dt is reduced. If the error estimate is acceptably small, the - * step is performed, success is returned and dt might be increased to make - * the steps as large as possible. This method also updates t if a step is - * performed. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. - * \param dxdt The derivative of state. - * \param t The value of the time. Updated if the step is successful. - * \param out Used to store the result of the step. - * \param dt The step size. Updated. - * \return success if the step was accepted, fail otherwise. - */ - template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut > - controlled_step_result try_step( System system , const StateIn &in , const DerivIn &dxdt_in , time_type &t , - StateOut &out , DerivOut &dxdt_out , time_type &dt ) - { - if( !m_step_adjuster.check_step_size_limit(dt) ) - { - // given dt was above step size limit - adjust and return fail; - dt = m_step_adjuster.get_max_dt(); - return fail; - } - - m_xerr_resizer.adjust_size( in , detail::bind( &controlled_runge_kutta::template resize_m_xerr_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); - - //fsal: m_stepper.get_dxdt( dxdt ); - //fsal: m_stepper.do_step( sys , x , dxdt , t , dt , m_x_err ); - m_stepper.do_step( system , in , dxdt_in , t , out , dxdt_out , dt , m_xerr.m_v ); - - // this potentially overwrites m_x_err! (standard_error_checker does, at least) - value_type max_rel_err = m_error_checker.error( m_stepper.algebra() , in , dxdt_in , m_xerr.m_v , dt ); - - if( max_rel_err > 1.0 ) - { - // error too big, decrease step size and reject this step - dt = m_step_adjuster.decrease_step(dt, max_rel_err, m_stepper.error_order()); - return fail; - } - // otherwise, increase step size and accept - t += dt; - dt = m_step_adjuster.increase_step(dt, max_rel_err, m_stepper.stepper_order()); - return success; - } - - - /** - * \brief Resets the internal state of the underlying FSAL stepper. - */ - void reset( void ) - { - m_first_call = true; - } - - /** - * \brief Initializes the internal state storing an internal copy of the derivative. - * - * \param deriv The initial derivative of the ODE. - */ - template< class DerivIn > - void initialize( const DerivIn &deriv ) - { - boost::numeric::odeint::copy( deriv , m_dxdt.m_v ); - m_first_call = false; - } - - /** - * \brief Initializes the internal state storing an internal copy of the derivative. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param x The initial state of the ODE which should be solved. - * \param t The initial time. - */ - template< class System , class StateIn > - void initialize( System system , const StateIn &x , time_type t ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - sys( x , m_dxdt.m_v , t ); - m_first_call = false; - } - - /** - * \brief Returns true if the stepper has been initialized, false otherwise. - * - * \return true, if the stepper has been initialized, false otherwise. - */ - bool is_initialized( void ) const - { - return ! m_first_call; - } - - - /** - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_m_xerr_impl( x ); - resize_m_dxdt_impl( x ); - resize_m_dxdt_new_impl( x ); - resize_m_xnew_impl( x ); - } - - - /** - * \brief Returns the instance of the underlying stepper. - * \returns The instance of the underlying stepper. - */ - stepper_type& stepper( void ) - { - return m_stepper; - } - - /** - * \brief Returns the instance of the underlying stepper. - * \returns The instance of the underlying stepper. - */ - const stepper_type& stepper( void ) const - { - return m_stepper; - } - - - -private: - - - template< class StateIn > - bool resize_m_xerr_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() ); - } - - template< class StateIn > - bool resize_m_dxdt_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - } - - template< class StateIn > - bool resize_m_dxdt_new_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdtnew , x , typename is_resizeable<deriv_type>::type() ); - } - - template< class StateIn > - bool resize_m_xnew_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() ); - } - - - template< class System , class StateInOut > - controlled_step_result try_step_v1( System system , StateInOut &x , time_type &t , time_type &dt ) - { - if( m_dxdt_resizer.adjust_size( x , detail::bind( &controlled_runge_kutta::template resize_m_dxdt_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ) || m_first_call ) - { - initialize( system , x , t ); - } - return try_step( system , x , m_dxdt.m_v , t , dt ); - } - - - stepper_type m_stepper; - error_checker_type m_error_checker; - step_adjuster_type m_step_adjuster; - - resizer_type m_dxdt_resizer; - resizer_type m_xerr_resizer; - resizer_type m_xnew_resizer; - resizer_type m_dxdt_new_resizer; - - wrapped_deriv_type m_dxdt; - wrapped_state_type m_xerr; - wrapped_state_type m_xnew; - wrapped_deriv_type m_dxdtnew; - bool m_first_call; -}; - - -/********** DOXYGEN **********/ - -/**** DEFAULT ERROR CHECKER ****/ - -/** - * \class default_error_checker - * \brief The default error checker to be used with Runge-Kutta error steppers - * - * This class provides the default mechanism to compare the error estimates - * reported by Runge-Kutta error steppers with user defined error bounds. - * It is used by the controlled_runge_kutta steppers. - * - * \tparam Value The value type. - * \tparam Time The time type. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - */ - - /** - * \fn default_error_checker( value_type eps_abs , value_type eps_rel , value_type a_x , value_type a_dxdt , - * time_type max_dt) - * \brief Constructs the error checker. - * - * The error is calculated as follows: ???? - * - * \param eps_abs Absolute tolerance level. - * \param eps_rel Relative tolerance level. - * \param a_x Factor for the weight of the state. - * \param a_dxdt Factor for the weight of the derivative. - * \param max_dt Maximum allowed step size. - */ - - /** - * \fn error( const State &x_old , const Deriv &dxdt_old , Err &x_err , time_type dt ) const - * \brief Calculates the error level. - * - * If the returned error level is greater than 1, the estimated error was - * larger than the permitted error bounds and the step should be repeated - * with a smaller step size. - * - * \param x_old State at the beginning of the step. - * \param dxdt_old Derivative at the beginning of the step. - * \param x_err Error estimate. - * \param dt Time step. - * \return error - */ - - /** - * \fn error( algebra_type &algebra , const State &x_old , const Deriv &dxdt_old , Err &x_err , time_type dt ) const - * \brief Calculates the error level using a given algebra. - * - * If the returned error level is greater than 1, the estimated error was - * larger than the permitted error bounds and the step should be repeated - * with a smaller step size. - * - * \param algebra The algebra used for calculation of the error. - * \param x_old State at the beginning of the step. - * \param dxdt_old Derivative at the beginning of the step. - * \param x_err Error estimate. - * \param dt Time step. - * \return error - */ - - /** - * \fn time_type decrease_step(const time_type dt, const value_type error, const int error_order) - * \brief Returns a decreased step size based on the given error and order - * - * Calculates a new smaller step size based on the given error and its order. - * - * \param dt The old step size. - * \param error The computed error estimate. - * \param error_order The error order of the stepper. - * \return dt_new The new, reduced step size. - */ - - /** - * \fn time_type increase_step(const time_type dt, const value_type error, const int error_order) - * \brief Returns an increased step size based on the given error and order. - * - * Calculates a new bigger step size based on the given error and its order. If max_dt != 0, the - * new step size is limited to max_dt. - * - * \param dt The old step size. - * \param error The computed error estimate. - * \param error_order The order of the stepper. - * \return dt_new The new, increased step size. - */ - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/controlled_step_result.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/controlled_step_result.hpp deleted file mode 100644 index 7f17726c57..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/controlled_step_result.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/controlled_step_result.hpp - - [begin_description] - Defines the result type for all controlled stepper. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_STEP_RESULT_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_STEP_RESULT_HPP_INCLUDED - - -namespace boost { -namespace numeric { -namespace odeint { - -/** - * \enum controlled_step_result - * - * \brief Enum representing the return values of the controlled steppers. - */ -typedef enum -{ - success , /**< The trial step was successful, hence the state and the time have been advanced. */ - fail /**< The step was not successful and might possibly be repeated with a small step size. */ -} controlled_step_result; - -} // namespace odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_CONTROLLED_STEP_RESULT_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp deleted file mode 100644 index 94abc5af99..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp +++ /dev/null @@ -1,476 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp - - [begin_description] - Implementation of the Dense-output stepper for all steppers. Note, that this class does - not computes the result but serves as an interface. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2015 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED - - -#include <utility> -#include <stdexcept> - -#include <boost/throw_exception.hpp> - -#include <boost/numeric/odeint/util/bind.hpp> - -#include <boost/numeric/odeint/util/copy.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/integrate/max_step_checker.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< class Stepper , class StepperCategory = typename Stepper::stepper_category > -class dense_output_runge_kutta; - - -/** - * \brief The class representing dense-output Runge-Kutta steppers. - * \note In this stepper, the initialize method has to be called before using - * the do_step method. - * - * The dense-output functionality allows to interpolate the solution between - * subsequent integration points using intermediate results obtained during the - * computation. This version works based on a normal stepper without step-size - * control. - * - * - * \tparam Stepper The stepper type of the underlying algorithm. - */ -template< class Stepper > -class dense_output_runge_kutta< Stepper , stepper_tag > -{ - -public: - - /* - * We do not need all typedefs. - */ - typedef Stepper stepper_type; - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::algebra_type algebra_type; - typedef typename stepper_type::operations_type operations_type; - typedef typename stepper_type::resizer_type resizer_type; - typedef dense_output_stepper_tag stepper_category; - typedef dense_output_runge_kutta< Stepper > dense_output_stepper_type; - - - /** - * \brief Constructs the dense_output_runge_kutta class. An instance of the - * underlying stepper can be provided. - * \param stepper An instance of the underlying stepper. - */ - dense_output_runge_kutta( const stepper_type &stepper = stepper_type() ) - : m_stepper( stepper ) , m_resizer() , - m_x1() , m_x2() , m_current_state_x1( true ) , - m_t() , m_t_old() , m_dt() - { } - - - /** - * \brief Initializes the stepper. Has to be called before do_step can be - * used to set the initial conditions and the step size. - * \param x0 The initial state of the ODE which should be solved. - * \param t0 The initial time, at which the step should be performed. - * \param dt0 The step size. - */ - template< class StateType > - void initialize( const StateType &x0 , time_type t0 , time_type dt0 ) - { - m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) ); - boost::numeric::odeint::copy( x0 , get_current_state() ); - m_t = t0; - m_dt = dt0; - } - - /** - * \brief Does one time step. - * \note initialize has to be called before using this method to set the - * initial conditions x,t and the stepsize. - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Simple System concept. - * \return Pair with start and end time of the integration step. - */ - template< class System > - std::pair< time_type , time_type > do_step( System system ) - { - m_stepper.do_step( system , get_current_state() , m_t , get_old_state() , m_dt ); - m_t_old = m_t; - m_t += m_dt; - toggle_current_state(); - return std::make_pair( m_t_old , m_dt ); - } - - /* - * The next two overloads are needed to solve the forwarding problem - */ - - /** - * \brief Calculates the solution at an intermediate point. - * \param t The time at which the solution should be calculated, has to be - * in the current time interval. - * \param x The output variable where the result is written into. - */ - template< class StateOut > - void calc_state( time_type t , StateOut &x ) const - { - if( t == current_time() ) - { - boost::numeric::odeint::copy( get_current_state() , x ); - } - m_stepper.calc_state( x , t , get_old_state() , m_t_old , get_current_state() , m_t ); - } - - /** - * \brief Calculates the solution at an intermediate point. Solves the forwarding problem - * \param t The time at which the solution should be calculated, has to be - * in the current time interval. - * \param x The output variable where the result is written into, can be a boost range. - */ - template< class StateOut > - void calc_state( time_type t , const StateOut &x ) const - { - m_stepper.calc_state( x , t , get_old_state() , m_t_old , get_current_state() , m_t ); - } - - /** - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_impl( x ); - m_stepper.stepper().resize( x ); - } - - /** - * \brief Returns the current state of the solution. - * \return The current state of the solution x(t). - */ - const state_type& current_state( void ) const - { - return get_current_state(); - } - - /** - * \brief Returns the current time of the solution. - * \return The current time of the solution t. - */ - time_type current_time( void ) const - { - return m_t; - } - - /** - * \brief Returns the last state of the solution. - * \return The last state of the solution x(t-dt). - */ - const state_type& previous_state( void ) const - { - return get_old_state(); - } - - /** - * \brief Returns the last time of the solution. - * \return The last time of the solution t-dt. - */ - time_type previous_time( void ) const - { - return m_t_old; - } - - /** - * \brief Returns the current time step. - * \return dt. - */ - time_type current_time_step( void ) const - { - return m_dt; - } - - -private: - - state_type& get_current_state( void ) - { - return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ; - } - - const state_type& get_current_state( void ) const - { - return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ; - } - - state_type& get_old_state( void ) - { - return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ; - } - - const state_type& get_old_state( void ) const - { - return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ; - } - - void toggle_current_state( void ) - { - m_current_state_x1 = ! m_current_state_x1; - } - - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() ); - return resized; - } - - - stepper_type m_stepper; - resizer_type m_resizer; - wrapped_state_type m_x1 , m_x2; - bool m_current_state_x1; // if true, the current state is m_x1 - time_type m_t , m_t_old , m_dt; - -}; - - - - - -/** - * \brief The class representing dense-output Runge-Kutta steppers with FSAL property. - * - * The interface is the same as for dense_output_runge_kutta< Stepper , stepper_tag >. - * This class provides dense output functionality based on methods with step size controlled - * - * - * \tparam Stepper The stepper type of the underlying algorithm. - */ -template< class Stepper > -class dense_output_runge_kutta< Stepper , explicit_controlled_stepper_fsal_tag > -{ -public: - - /* - * We do not need all typedefs. - */ - typedef Stepper controlled_stepper_type; - - typedef typename controlled_stepper_type::stepper_type stepper_type; - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::algebra_type algebra_type; - typedef typename stepper_type::operations_type operations_type; - typedef typename stepper_type::resizer_type resizer_type; - typedef dense_output_stepper_tag stepper_category; - typedef dense_output_runge_kutta< Stepper > dense_output_stepper_type; - - - dense_output_runge_kutta( const controlled_stepper_type &stepper = controlled_stepper_type() ) - : m_stepper( stepper ) , m_resizer() , - m_current_state_x1( true ) , - m_x1() , m_x2() , m_dxdt1() , m_dxdt2() , - m_t() , m_t_old() , m_dt() , - m_is_deriv_initialized( false ) - { } - - - template< class StateType > - void initialize( const StateType &x0 , time_type t0 , time_type dt0 ) - { - m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize< StateType > , detail::ref( *this ) , detail::_1 ) ); - boost::numeric::odeint::copy( x0 , get_current_state() ); - m_t = t0; - m_dt = dt0; - m_is_deriv_initialized = false; - } - - template< class System > - std::pair< time_type , time_type > do_step( System system ) - { - if( !m_is_deriv_initialized ) - { - typename odeint::unwrap_reference< System >::type &sys = system; - sys( get_current_state() , get_current_deriv() , m_t ); - m_is_deriv_initialized = true; - } - - failed_step_checker fail_checker; // to throw a runtime_error if step size adjustment fails - controlled_step_result res = fail; - m_t_old = m_t; - do - { - res = m_stepper.try_step( system , get_current_state() , get_current_deriv() , m_t , - get_old_state() , get_old_deriv() , m_dt ); - fail_checker(); // check for overflow of failed steps - } - while( res == fail ); - toggle_current_state(); - return std::make_pair( m_t_old , m_t ); - } - - - /* - * The two overloads are needed in order to solve the forwarding problem. - */ - template< class StateOut > - void calc_state( time_type t , StateOut &x ) const - { - m_stepper.stepper().calc_state( t , x , get_old_state() , get_old_deriv() , m_t_old , - get_current_state() , get_current_deriv() , m_t ); - } - - template< class StateOut > - void calc_state( time_type t , const StateOut &x ) const - { - m_stepper.stepper().calc_state( t , x , get_old_state() , get_old_deriv() , m_t_old , - get_current_state() , get_current_deriv() , m_t ); - } - - - template< class StateIn > - bool resize( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxdt1 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxdt2 , x , typename is_resizeable<deriv_type>::type() ); - return resized; - } - - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize( x ); - m_stepper.stepper().resize( x ); - } - - const state_type& current_state( void ) const - { - return get_current_state(); - } - - time_type current_time( void ) const - { - return m_t; - } - - const state_type& previous_state( void ) const - { - return get_old_state(); - } - - time_type previous_time( void ) const - { - return m_t_old; - } - - time_type current_time_step( void ) const - { - return m_dt; - } - - -private: - - state_type& get_current_state( void ) - { - return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ; - } - - const state_type& get_current_state( void ) const - { - return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ; - } - - state_type& get_old_state( void ) - { - return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ; - } - - const state_type& get_old_state( void ) const - { - return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ; - } - - deriv_type& get_current_deriv( void ) - { - return m_current_state_x1 ? m_dxdt1.m_v : m_dxdt2.m_v ; - } - - const deriv_type& get_current_deriv( void ) const - { - return m_current_state_x1 ? m_dxdt1.m_v : m_dxdt2.m_v ; - } - - deriv_type& get_old_deriv( void ) - { - return m_current_state_x1 ? m_dxdt2.m_v : m_dxdt1.m_v ; - } - - const deriv_type& get_old_deriv( void ) const - { - return m_current_state_x1 ? m_dxdt2.m_v : m_dxdt1.m_v ; - } - - - void toggle_current_state( void ) - { - m_current_state_x1 = ! m_current_state_x1; - } - - - controlled_stepper_type m_stepper; - resizer_type m_resizer; - bool m_current_state_x1; - wrapped_state_type m_x1 , m_x2; - wrapped_deriv_type m_dxdt1 , m_dxdt2; - time_type m_t , m_t_old , m_dt; - bool m_is_deriv_initialized; - -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp deleted file mode 100644 index cc279abbe0..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/detail/adams_bashforth_call_algebra.hpp - - [begin_description] - Algebra caller for the Adams Bashforth stepper. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_CALL_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_CALL_ALGEBRA_HPP_INCLUDED - -#include <boost/assert.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< size_t Step , class Algebra , class Operations > -struct adams_bashforth_call_algebra; - -template< class Algebra , class Operations > -struct adams_bashforth_call_algebra< 1 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each3( out , in , steps[0].m_v , typename Operations::template scale_sum2< value_type , Time >( 1.0 , dt * coef[0] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_bashforth_call_algebra< 2 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each4( out , in , steps[0].m_v , steps[1].m_v , - typename Operations::template scale_sum3< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_bashforth_call_algebra< 3 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each5( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , - typename Operations::template scale_sum4< value_type , Time , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_bashforth_call_algebra< 4 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each6( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , - typename Operations::template scale_sum5< value_type , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_bashforth_call_algebra< 5 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each7( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , - typename Operations::template scale_sum6< value_type , Time , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_bashforth_call_algebra< 6 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each8( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v , - typename Operations::template scale_sum7< value_type , Time , Time , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_bashforth_call_algebra< 7 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - //BOOST_ASSERT( false ); // not implemented - typedef typename Coefficients::value_type value_type; - algebra.for_each9( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v , steps[6].m_v , - typename Operations::template scale_sum8< value_type , Time , Time , Time , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] , dt * coef[6] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_bashforth_call_algebra< 8 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - //BOOST_ASSERT( false ); // not implemented - typedef typename Coefficients::value_type value_type; - algebra.for_each10( out , in , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v , steps[6].m_v , steps[7].m_v , - typename Operations::template scale_sum9< value_type , Time , Time , Time , Time , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] , dt * coef[6] , dt * coef[7] ) ); - } -}; - - - - -} // detail -} // odeint -} // numeric -} // boost - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_CALL_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp deleted file mode 100644 index 26a9f9a6b4..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp - - [begin_description] - Definition of the coefficients for the Adams-Bashforth method. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED - -#include <boost/array.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< class Value , size_t Steps > -class adams_bashforth_coefficients ; - -template< class Value > -class adams_bashforth_coefficients< Value , 1 > : public boost::array< Value , 1 > -{ -public: - adams_bashforth_coefficients( void ) - : boost::array< Value , 1 >() - { - (*this)[0] = static_cast< Value >( 1 ); - } -}; - - -template< class Value > -class adams_bashforth_coefficients< Value , 2 > : public boost::array< Value , 2 > -{ -public: - adams_bashforth_coefficients( void ) - : boost::array< Value , 2 >() - { - (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 2 ); - (*this)[1] = -static_cast< Value >( 1 ) / static_cast< Value >( 2 ); - } -}; - - -template< class Value > -class adams_bashforth_coefficients< Value , 3 > : public boost::array< Value , 3 > -{ -public: - adams_bashforth_coefficients( void ) - : boost::array< Value , 3 >() - { - (*this)[0] = static_cast< Value >( 23 ) / static_cast< Value >( 12 ); - (*this)[1] = -static_cast< Value >( 4 ) / static_cast< Value >( 3 ); - (*this)[2] = static_cast< Value >( 5 ) / static_cast< Value >( 12 ); - } -}; - - -template< class Value > -class adams_bashforth_coefficients< Value , 4 > : public boost::array< Value , 4 > -{ -public: - adams_bashforth_coefficients( void ) - : boost::array< Value , 4 >() - { - (*this)[0] = static_cast< Value >( 55 ) / static_cast< Value >( 24 ); - (*this)[1] = -static_cast< Value >( 59 ) / static_cast< Value >( 24 ); - (*this)[2] = static_cast< Value >( 37 ) / static_cast< Value >( 24 ); - (*this)[3] = -static_cast< Value >( 3 ) / static_cast< Value >( 8 ); - } -}; - - -template< class Value > -class adams_bashforth_coefficients< Value , 5 > : public boost::array< Value , 5 > -{ -public: - adams_bashforth_coefficients( void ) - : boost::array< Value , 5 >() - { - (*this)[0] = static_cast< Value >( 1901 ) / static_cast< Value >( 720 ); - (*this)[1] = -static_cast< Value >( 1387 ) / static_cast< Value >( 360 ); - (*this)[2] = static_cast< Value >( 109 ) / static_cast< Value >( 30 ); - (*this)[3] = -static_cast< Value >( 637 ) / static_cast< Value >( 360 ); - (*this)[4] = static_cast< Value >( 251 ) / static_cast< Value >( 720 ); - } -}; - - -template< class Value > -class adams_bashforth_coefficients< Value , 6 > : public boost::array< Value , 6 > -{ -public: - adams_bashforth_coefficients( void ) - : boost::array< Value , 6 >() - { - (*this)[0] = static_cast< Value >( 4277 ) / static_cast< Value >( 1440 ); - (*this)[1] = -static_cast< Value >( 2641 ) / static_cast< Value >( 480 ); - (*this)[2] = static_cast< Value >( 4991 ) / static_cast< Value >( 720 ); - (*this)[3] = -static_cast< Value >( 3649 ) / static_cast< Value >( 720 ); - (*this)[4] = static_cast< Value >( 959 ) / static_cast< Value >( 480 ); - (*this)[5] = -static_cast< Value >( 95 ) / static_cast< Value >( 288 ); - } -}; - - -template< class Value > -class adams_bashforth_coefficients< Value , 7 > : public boost::array< Value , 7 > -{ -public: - adams_bashforth_coefficients( void ) - : boost::array< Value , 7 >() - { - (*this)[0] = static_cast< Value >( 198721 ) / static_cast< Value >( 60480 ); - (*this)[1] = -static_cast< Value >( 18637 ) / static_cast< Value >( 2520 ); - (*this)[2] = static_cast< Value >( 235183 ) / static_cast< Value >( 20160 ); - (*this)[3] = -static_cast< Value >( 10754 ) / static_cast< Value >( 945 ); - (*this)[4] = static_cast< Value >( 135713 ) / static_cast< Value >( 20160 ); - (*this)[5] = -static_cast< Value >( 5603 ) / static_cast< Value >( 2520 ); - (*this)[6] = static_cast< Value >( 19087 ) / static_cast< Value >( 60480 ); - } -}; - - -template< class Value > -class adams_bashforth_coefficients< Value , 8 > : public boost::array< Value , 8 > -{ -public: - adams_bashforth_coefficients( void ) - : boost::array< Value , 8 >() - { - (*this)[0] = static_cast< Value >( 16083 ) / static_cast< Value >( 4480 ); - (*this)[1] = -static_cast< Value >( 1152169 ) / static_cast< Value >( 120960 ); - (*this)[2] = static_cast< Value >( 242653 ) / static_cast< Value >( 13440 ); - (*this)[3] = -static_cast< Value >( 296053 ) / static_cast< Value >( 13440 ); - (*this)[4] = static_cast< Value >( 2102243 ) / static_cast< Value >( 120960 ); - (*this)[5] = -static_cast< Value >( 115747 ) / static_cast< Value >( 13440 ); - (*this)[6] = static_cast< Value >( 32863 ) / static_cast< Value >( 13440 ); - (*this)[7] = -static_cast< Value >( 5257 ) / static_cast< Value >( 17280 ); - } -}; - - - - - - - -} // detail -} // odeint -} // numeric -} // boost - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp deleted file mode 100644 index b6f5f2a40b..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp +++ /dev/null @@ -1,148 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp - - [begin_description] - Algebra caller for the Adams Moulton method. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED - -#include <boost/assert.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< size_t Step , class Algebra , class Operations > -struct adams_moulton_call_algebra; - -template< class Algebra , class Operations > -struct adams_moulton_call_algebra< 1 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage& /* steps */ , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each3( out , in , dxdt , typename Operations::template scale_sum2< value_type , Time >( 1.0 , dt * coef[0] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_moulton_call_algebra< 2 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each4( out , in , dxdt , steps[0].m_v , - typename Operations::template scale_sum3< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_moulton_call_algebra< 3 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each5( out , in , dxdt , steps[0].m_v , steps[1].m_v , - typename Operations::template scale_sum4< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_moulton_call_algebra< 4 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each6( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , - typename Operations::template scale_sum5< value_type , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_moulton_call_algebra< 5 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each7( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , - typename Operations::template scale_sum6< value_type , Time , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_moulton_call_algebra< 6 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each8( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , - typename Operations::template scale_sum7< value_type , Time , Time , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_moulton_call_algebra< 7 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each9( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v , - typename Operations::template scale_sum8< value_type , Time , Time , Time , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] , dt * coef[6] ) ); - } -}; - - -template< class Algebra , class Operations > -struct adams_moulton_call_algebra< 8 , Algebra , Operations > -{ - template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time > - void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const - { - typedef typename Coefficients::value_type value_type; - algebra.for_each10( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v , steps[6].m_v , - typename Operations::template scale_sum9< value_type , Time , Time , Time , Time , Time , Time , Time >( - 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] , dt * coef[6] , dt * coef[7] ) ); - } -}; - - - - -} // detail -} // odeint -} // numeric -} // boost - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp deleted file mode 100644 index 8047fa8ae1..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp +++ /dev/null @@ -1,168 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp - - [begin_description] - Coefficients for the Adams Moulton method. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED - - -#include <boost/array.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< class Value , size_t Steps > -class adams_moulton_coefficients ; - -template< class Value > -class adams_moulton_coefficients< Value , 1 > : public boost::array< Value , 1 > -{ -public: - adams_moulton_coefficients( void ) - : boost::array< Value , 1 >() - { - (*this)[0] = static_cast< Value >( 1 ); - } -}; - - -template< class Value > -class adams_moulton_coefficients< Value , 2 > : public boost::array< Value , 2 > -{ -public: - adams_moulton_coefficients( void ) - : boost::array< Value , 2 >() - { - (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ); - (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ); - } -}; - - -template< class Value > -class adams_moulton_coefficients< Value , 3 > : public boost::array< Value , 3 > -{ -public: - adams_moulton_coefficients( void ) - : boost::array< Value , 3 >() - { - (*this)[0] = static_cast< Value >( 5 ) / static_cast< Value >( 12 ); - (*this)[1] = static_cast< Value >( 2 ) / static_cast< Value >( 3 ); - (*this)[2] = -static_cast< Value >( 1 ) / static_cast< Value >( 12 ); - } -}; - - -template< class Value > -class adams_moulton_coefficients< Value , 4 > : public boost::array< Value , 4 > -{ -public: - adams_moulton_coefficients( void ) - : boost::array< Value , 4 >() - { - (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 8 ); - (*this)[1] = static_cast< Value >( 19 ) / static_cast< Value >( 24 ); - (*this)[2] = -static_cast< Value >( 5 ) / static_cast< Value >( 24 ); - (*this)[3] = static_cast< Value >( 1 ) / static_cast< Value >( 24 ); - } -}; - - -template< class Value > -class adams_moulton_coefficients< Value , 5 > : public boost::array< Value , 5 > -{ -public: - adams_moulton_coefficients( void ) - : boost::array< Value , 5 >() - { - (*this)[0] = static_cast< Value >( 251 ) / static_cast< Value >( 720 ); - (*this)[1] = static_cast< Value >( 323 ) / static_cast< Value >( 360 ); - (*this)[2] = -static_cast< Value >( 11 ) / static_cast< Value >( 30 ); - (*this)[3] = static_cast< Value >( 53 ) / static_cast< Value >( 360 ); - (*this)[4] = -static_cast< Value >( 19 ) / static_cast< Value >( 720 ); - } -}; - - -template< class Value > -class adams_moulton_coefficients< Value , 6 > : public boost::array< Value , 6 > -{ -public: - adams_moulton_coefficients( void ) - : boost::array< Value , 6 >() - { - (*this)[0] = static_cast< Value >( 95 ) / static_cast< Value >( 288 ); - (*this)[1] = static_cast< Value >( 1427 ) / static_cast< Value >( 1440 ); - (*this)[2] = -static_cast< Value >( 133 ) / static_cast< Value >( 240 ); - (*this)[3] = static_cast< Value >( 241 ) / static_cast< Value >( 720 ); - (*this)[4] = -static_cast< Value >( 173 ) / static_cast< Value >( 1440 ); - (*this)[5] = static_cast< Value >( 3 ) / static_cast< Value >( 160 ); - } -}; - -template< class Value > -class adams_moulton_coefficients< Value , 7 > : public boost::array< Value , 7 > -{ -public: - adams_moulton_coefficients( void ) - : boost::array< Value , 7 >() - { - (*this)[0] = static_cast< Value >( 19087 ) / static_cast< Value >( 60480 ); - (*this)[1] = static_cast< Value >( 2713 ) / static_cast< Value >( 2520 ); - (*this)[2] = -static_cast< Value >( 15487 ) / static_cast< Value >( 20160 ); - (*this)[3] = static_cast< Value >( 586 ) / static_cast< Value >( 945 ); - (*this)[4] = -static_cast< Value >( 6737 ) / static_cast< Value >( 20160 ); - (*this)[5] = static_cast< Value >( 263 ) / static_cast< Value >( 2520 ); - (*this)[6] = -static_cast< Value >( 863 ) / static_cast< Value >( 60480 ); - } -}; - - -template< class Value > -class adams_moulton_coefficients< Value , 8 > : public boost::array< Value , 8 > -{ -public: - adams_moulton_coefficients( void ) - : boost::array< Value , 8 >() - { - (*this)[0] = static_cast< Value >( 5257 ) / static_cast< Value >( 17280 ); - (*this)[1] = static_cast< Value >( 139849 ) / static_cast< Value >( 120960 ); - (*this)[2] = -static_cast< Value >( 4511 ) / static_cast< Value >( 4480 ); - (*this)[3] = static_cast< Value >( 123133 ) / static_cast< Value >( 120960 ); - (*this)[4] = -static_cast< Value >( 88547 ) / static_cast< Value >( 120960 ); - (*this)[5] = static_cast< Value >( 1537 ) / static_cast< Value >( 4480 ); - (*this)[6] = -static_cast< Value >( 11351 ) / static_cast< Value >( 120960 ); - (*this)[7] = static_cast< Value >( 275 ) / static_cast< Value >( 24192 ); - } -}; - - - - - - - -} // detail -} // odeint -} // numeric -} // boost - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp deleted file mode 100644 index ab74b24ee2..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp +++ /dev/null @@ -1,247 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp - - [begin_description] - Implementation of the generic Runge-Kutta method. - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2012 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_ALGORITHM_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_ALGORITHM_HPP_INCLUDED - -#include <boost/static_assert.hpp> - -#include <boost/mpl/vector.hpp> -#include <boost/mpl/push_back.hpp> -#include <boost/mpl/for_each.hpp> -#include <boost/mpl/range_c.hpp> -#include <boost/mpl/copy.hpp> -#include <boost/mpl/size_t.hpp> - -#include <boost/fusion/algorithm.hpp> -#include <boost/fusion/iterator.hpp> -#include <boost/fusion/mpl.hpp> -#include <boost/fusion/sequence.hpp> - -#include <boost/array.hpp> - -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp> -#include <boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp> -#include <boost/numeric/odeint/util/bind.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< class T , class Constant > -struct array_wrapper -{ - typedef const typename boost::array< T , Constant::value > type; -}; - -template< class T , size_t i > -struct stage -{ - T c; - boost::array< T , i > a; -}; - - -template< class T , class Constant > -struct stage_wrapper -{ - typedef stage< T , Constant::value > type; -}; - - -template< -size_t StageCount, -class Value , -class Algebra , -class Operations -> -class generic_rk_algorithm { - -public: - typedef mpl::range_c< size_t , 1 , StageCount > stage_indices; - - typedef typename boost::fusion::result_of::as_vector - < - typename boost::mpl::copy - < - stage_indices , - boost::mpl::inserter - < - boost::mpl::vector0< > , - boost::mpl::push_back< boost::mpl::_1 , array_wrapper< Value , boost::mpl::_2 > > - > - >::type - >::type coef_a_type; - - typedef boost::array< Value , StageCount > coef_b_type; - typedef boost::array< Value , StageCount > coef_c_type; - - typedef typename boost::fusion::result_of::as_vector - < - typename boost::mpl::push_back - < - typename boost::mpl::copy - < - stage_indices, - boost::mpl::inserter - < - boost::mpl::vector0<> , - boost::mpl::push_back< boost::mpl::_1 , stage_wrapper< Value , boost::mpl::_2 > > - > - >::type , - stage< Value , StageCount > - >::type - >::type stage_vector_base; - - - struct stage_vector : public stage_vector_base - { - struct do_insertion - { - stage_vector_base &m_base; - const coef_a_type &m_a; - const coef_c_type &m_c; - - do_insertion( stage_vector_base &base , const coef_a_type &a , const coef_c_type &c ) - : m_base( base ) , m_a( a ) , m_c( c ) { } - - template< class Index > - void operator()( Index ) const - { - //boost::fusion::at< Index >( m_base ) = stage< double , Index::value+1 , intermediate_stage >( m_c[ Index::value ] , boost::fusion::at< Index >( m_a ) ); - boost::fusion::at< Index >( m_base ).c = m_c[ Index::value ]; - boost::fusion::at< Index >( m_base ).a = boost::fusion::at< Index >( m_a ); - } - }; - - struct print_butcher - { - const stage_vector_base &m_base; - std::ostream &m_os; - - print_butcher( const stage_vector_base &base , std::ostream &os ) - : m_base( base ) , m_os( os ) - { } - - template<class Index> - void operator()(Index) const { - m_os << boost::fusion::at<Index>(m_base).c << " | "; - for( size_t i=0 ; i<Index::value ; ++i ) - m_os << boost::fusion::at<Index>(m_base).a[i] << " "; - m_os << std::endl; - } - }; - - - stage_vector( const coef_a_type &a , const coef_b_type &b , const coef_c_type &c ) - { - typedef boost::mpl::range_c< size_t , 0 , StageCount-1 > indices; - boost::mpl::for_each< indices >( do_insertion( *this , a , c ) ); - boost::fusion::at_c< StageCount - 1 >( *this ).c = c[ StageCount - 1 ]; - boost::fusion::at_c< StageCount - 1 >( *this ).a = b; - } - - void print( std::ostream &os ) const - { - typedef boost::mpl::range_c< size_t , 0 , StageCount > indices; - boost::mpl::for_each< indices >( print_butcher( *this , os ) ); - } - }; - - - - template< class System , class StateIn , class StateTemp , class DerivIn , class Deriv , - class StateOut , class Time > - struct calculate_stage - { - Algebra &algebra; - System &system; - const StateIn &x; - StateTemp &x_tmp; - StateOut &x_out; - const DerivIn &dxdt; - Deriv *F; - Time t; - Time dt; - - calculate_stage( Algebra &_algebra , System &_system , const StateIn &_x , const DerivIn &_dxdt , StateOut &_out , - StateTemp &_x_tmp , Deriv *_F , Time _t , Time _dt ) - : algebra( _algebra ) , system( _system ) , x( _x ) , x_tmp( _x_tmp ) , x_out( _out) , dxdt( _dxdt ) , F( _F ) , t( _t ) , dt( _dt ) - {} - - - template< typename T , size_t stage_number > - void inline operator()( stage< T , stage_number > const &stage ) const - //typename stage_fusion_wrapper< T , mpl::size_t< stage_number > , intermediate_stage >::type const &stage ) const - { - if( stage_number > 1 ) - { -#ifdef BOOST_MSVC -#pragma warning( disable : 4307 34 ) -#endif - system( x_tmp , F[stage_number-2].m_v , t + stage.c * dt ); -#ifdef BOOST_MSVC -#pragma warning( default : 4307 34 ) -#endif - } - //std::cout << stage_number-2 << ", t': " << t + stage.c * dt << std::endl; - - if( stage_number < StageCount ) - detail::template generic_rk_call_algebra< stage_number , Algebra >()( algebra , x_tmp , x , dxdt , F , - detail::generic_rk_scale_sum< stage_number , Operations , Value , Time >( stage.a , dt) ); - // algebra_type::template for_eachn<stage_number>( x_tmp , x , dxdt , F , - // typename operations_type::template scale_sumn< stage_number , time_type >( stage.a , dt ) ); - else - detail::template generic_rk_call_algebra< stage_number , Algebra >()( algebra , x_out , x , dxdt , F , - detail::generic_rk_scale_sum< stage_number , Operations , Value , Time >( stage.a , dt ) ); - // algebra_type::template for_eachn<stage_number>( x_out , x , dxdt , F , - // typename operations_type::template scale_sumn< stage_number , time_type >( stage.a , dt ) ); - } - - }; - - generic_rk_algorithm( const coef_a_type &a , const coef_b_type &b , const coef_c_type &c ) - : m_stages( a , b , c ) - { } - - template< class System , class StateIn , class DerivIn , class Time , class StateOut , class StateTemp , class Deriv > - void inline do_step( Algebra &algebra , System system , const StateIn &in , const DerivIn &dxdt , - Time t , StateOut &out , Time dt , - StateTemp &x_tmp , Deriv F[StageCount-1] ) const - { - typedef typename odeint::unwrap_reference< System >::type unwrapped_system_type; - unwrapped_system_type &sys = system; - boost::fusion::for_each( m_stages , calculate_stage< - unwrapped_system_type , StateIn , StateTemp , DerivIn , Deriv , StateOut , Time > - ( algebra , sys , in , dxdt , out , x_tmp , F , t , dt ) ); - } - -private: - stage_vector m_stages; -}; - - -} -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_ALGORITHM_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp deleted file mode 100644 index 0249d86405..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp +++ /dev/null @@ -1,263 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp - - [begin_description] - Algebra caller for the generic Runge-Kutta methods. - [end_description] - - Copyright 2011-2012 Mario Mulansky - Copyright 2011-2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_CALL_ALGEBRA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_CALL_ALGEBRA_HPP_INCLUDED - - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< size_t StageNumber , class Algebra > -struct generic_rk_call_algebra; - -template< class Algebra > -struct generic_rk_call_algebra< 1 , Algebra > -{ - typedef Algebra algebra_type; - - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( algebra_type &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 * /* s4_array */ , Op op ) const - { - algebra.for_each3( s1 , s2 , s3 , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( algebra_type &algebra , S1 &s1 , S2 &s2 , S4 * /* s4_array */ , Op op ) const - { - algebra.for_each2( s1 , s2 , op ); - } -}; - -template< class Algebra > -struct generic_rk_call_algebra< 2 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[1] , Op op ) const - { - algebra.for_each4( s1 , s2 , s3 , s4_array[0].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[1] , Op op ) const - { - algebra.for_each3( s1 , s2 , s4_array[0].m_v , op ); - } -}; - - -template< class Algebra > -struct generic_rk_call_algebra< 3 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[2] , Op op ) const - { - algebra.for_each5( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[2] , Op op ) const - { - algebra.for_each4( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , op ); - } -}; - - -template< class Algebra > -struct generic_rk_call_algebra< 4 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[3] , Op op ) const - { - algebra.for_each6( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[3] , Op op ) const - { - algebra.for_each5( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , op ); - } -}; - - -template< class Algebra > -struct generic_rk_call_algebra< 5 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[4] , Op op ) const - { - algebra.for_each7( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[4] , Op op ) const - { - algebra.for_each6( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , op ); - } -}; - -template< class Algebra > -struct generic_rk_call_algebra< 6 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[5] , Op op ) const - { - algebra.for_each8( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[5] , Op op ) const - { - algebra.for_each7( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , op ); - } -}; - -template< class Algebra > -struct generic_rk_call_algebra< 7 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[6] , Op op ) const - { - algebra.for_each9( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[6] , Op op ) const - { - algebra.for_each8( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , op ); - } -}; - -template< class Algebra > -struct generic_rk_call_algebra< 8 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[7] , Op op ) const - { - algebra.for_each10( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[7] , Op op ) const - { - algebra.for_each9( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , op ); - } -}; - -template< class Algebra > -struct generic_rk_call_algebra< 9 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[8] , Op op ) const - { - algebra.for_each11( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[8] , Op op ) const - { - algebra.for_each10( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , op ); - } -}; - -template< class Algebra > -struct generic_rk_call_algebra< 10 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[9] , Op op ) const - { - algebra.for_each12( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[9] , Op op ) const - { - algebra.for_each11( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , op ); - } -}; - - -template< class Algebra > -struct generic_rk_call_algebra< 11 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[10] , Op op ) const - { - algebra.for_each13( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[10] , Op op ) const - { - algebra.for_each12( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , op ); - } -}; - -template< class Algebra > -struct generic_rk_call_algebra< 12 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[11] , Op op ) const - { - algebra.for_each14( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , s4_array[10].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[11] , Op op ) const - { - algebra.for_each13( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , s4_array[10].m_v , op ); - } -}; - -template< class Algebra > -struct generic_rk_call_algebra< 13 , Algebra > -{ - template< class S1 , class S2 , class S3 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S3 &s3 , S4 s4_array[12] , Op op ) const - { - algebra.for_each15( s1 , s2 , s3 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , s4_array[10].m_v , s4_array[11].m_v , op ); - } - - template< class S1 , class S2 , class S4 , class Op> - void operator()( Algebra &algebra , S1 &s1 , S2 &s2 , S4 s4_array[12] , Op op ) const - { - algebra.for_each14( s1 , s2 , s4_array[0].m_v , s4_array[1].m_v , s4_array[2].m_v , s4_array[3].m_v , s4_array[4].m_v , - s4_array[5].m_v , s4_array[6].m_v , s4_array[7].m_v , s4_array[8].m_v , s4_array[9].m_v , s4_array[10].m_v , s4_array[11].m_v , op ); - } -}; - -} -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_CALL_ALGEBRA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp deleted file mode 100644 index 2cce3f4d0b..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp +++ /dev/null @@ -1,252 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp - - [begin_description] - Operations caller for the generic Runge Kutta method. - [end_description] - - Copyright 2011 Mario Mulansky - Copyright 2011-2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_OPERATIONS_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_OPERATIONS_HPP_INCLUDED - - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< size_t StageNumber , class Operations , class Fac , class Time > -struct generic_rk_scale_sum; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 1 , Operations , Fac , Time > : public Operations::template scale_sum2< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,1> &a , Time dt ) : Operations::template scale_sum2< Fac , Time >( 1.0 , a[0]*dt ) - { } - - typedef void result_type; -}; - - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 2 , Operations , Fac , Time > : public Operations::template scale_sum3< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,2> &a , Time dt ) - : Operations::template scale_sum3< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 3 , Operations , Fac , Time > : public Operations::template scale_sum4< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,3> &a , Time dt ) - : Operations::template scale_sum4< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 4 , Operations , Fac , Time > : public Operations::template scale_sum5< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,4> &a , Time dt ) - : Operations::template scale_sum5< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 5 , Operations , Fac , Time > : public Operations::template scale_sum6< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,5> &a , Time dt ) - : Operations::template scale_sum6< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 6 , Operations , Fac , Time > : public Operations::template scale_sum7< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,6> &a , Time dt ) - : Operations::template scale_sum7< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 7 , Operations , Fac , Time > : public Operations::template scale_sum8< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,7> &a , Time dt ) - : Operations::template scale_sum8< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , a[6]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 8 , Operations , Fac , Time > : public Operations::template scale_sum9< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,8> &a , Time dt ) - : Operations::template scale_sum9< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , - a[5]*dt , a[6]*dt , a[7]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 9 , Operations , Fac , Time > : public Operations::template scale_sum10< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,9> &a , Time dt ) - : Operations::template scale_sum10< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , - a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 10 , Operations , Fac , Time > : public Operations::template scale_sum11< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,10> &a , Time dt ) - : Operations::template scale_sum11< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , - a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 11 , Operations , Fac , Time > : public Operations::template scale_sum12< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,11> &a , Time dt ) - : Operations::template scale_sum12< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , - a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt , a[10]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 12 , Operations , Fac , Time > : public Operations::template scale_sum13< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,12> &a , Time dt ) - : Operations::template scale_sum13< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , - a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt , a[10]*dt , a[11]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum< 13 , Operations , Fac , Time > : public Operations::template scale_sum14< Fac , Time > -{ - generic_rk_scale_sum( const boost::array<Fac,13> &a , Time dt ) - : Operations::template scale_sum14< Fac , Time >( 1.0 , a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , - a[5]*dt , a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt , a[10]*dt , a[11]*dt , a[12]*dt ) - { } - - typedef void result_type; -}; - - -// for error estimates -template< size_t StageNumber , class Operations , class Fac , class Time > -struct generic_rk_scale_sum_err; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum_err< 1 , Operations , Fac , Time > : public Operations::template scale_sum1< Time > -{ - generic_rk_scale_sum_err( const boost::array<Fac,1> &a , Time dt ) : Operations::template scale_sum1< Time >( a[0]*dt ) - { } - - typedef void result_type; -}; - - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum_err< 2 , Operations , Fac , Time > : public Operations::template scale_sum2< Time > -{ - generic_rk_scale_sum_err( const boost::array<Fac,2> &a , Time dt ) - : Operations::template scale_sum2< Time >( a[0]*dt , a[1]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum_err< 3 , Operations , Fac , Time > : public Operations::template scale_sum3< Time > -{ - generic_rk_scale_sum_err( const boost::array<Fac,3> &a , Time dt ) - : Operations::template scale_sum3< Time >( a[0]*dt , a[1]*dt , a[2]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum_err< 4 , Operations , Fac , Time > : public Operations::template scale_sum4< Time > -{ - generic_rk_scale_sum_err( const boost::array<Fac,4> &a , Time dt ) - : Operations::template scale_sum4< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt ) - { } - - typedef void result_type; -}; - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum_err< 5 , Operations , Fac , Time > : public Operations::template scale_sum5< Fac > -{ - generic_rk_scale_sum_err( const boost::array<Fac,5> &a , Time dt ) - : Operations::template scale_sum5< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt ) - { } - - typedef void result_type; -}; - - -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum_err< 6 , Operations , Fac , Time > : public Operations::template scale_sum6< Time > -{ - generic_rk_scale_sum_err( const boost::array<Fac,6> &a , Time dt ) - : Operations::template scale_sum6< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt ) - { } - - typedef void result_type; -}; - - -// for rk87 -template< class Operations , class Fac , class Time > -struct generic_rk_scale_sum_err< 13 , Operations , Fac , Time > : public Operations::template scale_sum13< Time > -{ - generic_rk_scale_sum_err( const boost::array<Fac,13> &a , Time dt ) - : Operations::template scale_sum13< Time >( a[0]*dt , a[1]*dt , a[2]*dt , a[3]*dt , a[4]*dt , a[5]*dt , - a[6]*dt , a[7]*dt , a[8]*dt , a[9]*dt , a[10]*dt , a[11]*dt , a[12]*dt ) - { } - - typedef void result_type; -}; - - -} -} -} -} - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_GENERIC_RK_OPERATIONS_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp deleted file mode 100644 index 2338afd94a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/detail/rotating_buffer.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/detail/rotating_buffer.hpp - - [begin_description] - Implemetation of a rotating (cyclic) buffer for use in the Adam Bashforth stepper - [end_description] - - Copyright 2011 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ROTATING_BUFFER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ROTATING_BUFFER_HPP_INCLUDED - -#include <boost/array.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -template< class T , size_t N > -class rotating_buffer -{ -public: - - typedef T value_type; - const static size_t dim = N; - - rotating_buffer( void ) : m_first( 0 ) - { } - - size_t size( void ) const - { - return dim; - } - - value_type& operator[]( size_t i ) - { - return m_data[ get_index( i ) ]; - } - - const value_type& operator[]( size_t i ) const - { - return m_data[ get_index( i ) ]; - } - - void rotate( void ) - { - if( m_first == 0 ) - m_first = dim-1; - else - --m_first; - } - -protected: - - value_type m_data[N]; - -private: - - size_t get_index( size_t i ) const - { - return ( ( i + m_first ) % dim ); - } - - size_t m_first; - -}; - - -} // detail -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ROTATING_BUFFER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/euler.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/euler.hpp deleted file mode 100644 index 1c7c126b96..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/euler.hpp +++ /dev/null @@ -1,166 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/euler.hpp - - [begin_description] - Implementation of the classical explicit Euler stepper. This method is really simple and should only - be used for demonstration purposes. - [end_description] - - Copyright 2010-2013 Karsten Ahnert - Copyright 2010-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_EULER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_EULER_HPP_INCLUDED - - -#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -template< -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -#ifndef DOXYGEN_SKIP -class euler -: public explicit_stepper_base< - euler< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 1 , State , Value , Deriv , Time , Algebra , Operations , Resizer > -#else -class euler : public explicit_stepper_base -#endif -{ -public : - - #ifndef DOXYGEN_SKIP - typedef explicit_stepper_base< euler< State , Value , Deriv , Time , Algebra , Operations , Resizer > , 1 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type; - #else - typedef explicit_stepper_base< euler< ... > , ... > stepper_base_type; - #endif - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - - #ifndef DOXYGEN_SKIP - typedef typename stepper_base_type::stepper_type stepper_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - #endif - - - euler( const algebra_type &algebra = algebra_type() ) : stepper_base_type( algebra ) - { } - - template< class System , class StateIn , class DerivIn , class StateOut > - void do_step_impl( System /* system */ , const StateIn &in , const DerivIn &dxdt , time_type /* t */ , StateOut &out , time_type dt ) - { - stepper_base_type::m_algebra.for_each3( out , in , dxdt , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt ) ); - - } - - template< class StateOut , class StateIn1 , class StateIn2 > - void calc_state( StateOut &x , time_type t , const StateIn1 &old_state , time_type t_old , const StateIn2 & /*current_state*/ , time_type /* t_new */ ) const - { - const time_type delta = t - t_old; - stepper_base_type::m_algebra.for_each3( x , old_state , stepper_base_type::m_dxdt.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , delta ) ); - } - - template< class StateType > - void adjust_size( const StateType &x ) - { - stepper_base_type::adjust_size( x ); - } -}; - - - -/********** DOXYGEN ***********/ - -/** - * \class euler - * \brief An implementation of the Euler method. - * - * The Euler method is a very simply solver for ordinary differential equations. This method should not be used - * for real applications. It is only useful for demonstration purposes. Step size control is not provided but - * trivial continuous output is available. - * - * This class derives from explicit_stepper_base and inherits its interface via CRTP (current recurring template pattern), - * see explicit_stepper_base - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - /** - * \fn euler::euler( const algebra_type &algebra ) - * \brief Constructs the euler class. This constructor can be used as a default - * constructor of the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - /** - * \fn euler::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method. - * The result is updated out of place, hence the input is in `in` and the output in `out`. - * Access to this step functionality is provided by explicit_stepper_base and - * `do_step_impl` should not be called directly. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - - /** - * \fn euler::calc_state( StateOut &x , time_type t , const StateIn1 &old_state , time_type t_old , const StateIn2 ¤t_state , time_type t_new ) const - * \brief This method is used for continuous output and it calculates the state `x` at a time `t` from the - * knowledge of two states `old_state` and `current_state` at time points `t_old` and `t_new`. - */ - - /** - * \fn euler::adjust_size( const StateType &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_EULER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp deleted file mode 100644 index 3c59810b69..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp +++ /dev/null @@ -1,255 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp - - [begin_description] - Implementation of the generic Runge Kutta error stepper. Base class for many RK error steppers. - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_ERROR_GENERIC_RK_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_ERROR_GENERIC_RK_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp> - -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> -#include <boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp> -#include <boost/numeric/odeint/stepper/detail/generic_rk_call_algebra.hpp> -#include <boost/numeric/odeint/stepper/detail/generic_rk_operations.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - - - -namespace boost { -namespace numeric { -namespace odeint { - - -template< -size_t StageCount, -size_t Order, -size_t StepperOrder , -size_t ErrorOrder , -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -#ifndef DOXYGEN_SKIP -class explicit_error_generic_rk -: public explicit_error_stepper_base< - explicit_error_generic_rk< StageCount , Order , StepperOrder , ErrorOrder , State , - Value , Deriv , Time , Algebra , Operations , Resizer > , - Order , StepperOrder , ErrorOrder , State , Value , Deriv , Time , Algebra , - Operations , Resizer > -#else -class explicit_error_generic_rk : public explicit_error_stepper_base -#endif -{ - -public: -#ifndef DOXYGEN_SKIP - typedef explicit_error_stepper_base< - explicit_error_generic_rk< StageCount , Order , StepperOrder , ErrorOrder , State , - Value , Deriv , Time , Algebra , Operations , Resizer > , - Order , StepperOrder , ErrorOrder , State , Value , Deriv , Time , Algebra , - Operations , Resizer > stepper_base_type; -#else - typedef explicit_stepper_base< ... > stepper_base_type; -#endif - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; -#ifndef DOXYGEN_SKIP - typedef explicit_error_generic_rk< StageCount , Order , StepperOrder , ErrorOrder , State , - Value , Deriv , Time , Algebra , Operations , Resizer > stepper_type; -#endif - typedef detail::generic_rk_algorithm< StageCount , Value , Algebra , Operations > rk_algorithm_type; - - typedef typename rk_algorithm_type::coef_a_type coef_a_type; - typedef typename rk_algorithm_type::coef_b_type coef_b_type; - typedef typename rk_algorithm_type::coef_c_type coef_c_type; - - static const size_t stage_count = StageCount; - -private: - - -public: - - // we use an explicit_generic_rk to do the normal rk step - // and add a separate calculation of the error estimate afterwards - explicit_error_generic_rk( const coef_a_type &a , - const coef_b_type &b , - const coef_b_type &b2 , - const coef_c_type &c , - const algebra_type &algebra = algebra_type() ) - : stepper_base_type( algebra ) , m_rk_algorithm( a , b , c ) , m_b2( b2 ) - { } - - - template< class System , class StateIn , class DerivIn , class StateOut , class Err > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , - time_type t , StateOut &out , time_type dt , Err &xerr ) - { - // normal step - do_step_impl( system , in , dxdt , t , out , dt ); - - // additionally, perform the error calculation - detail::template generic_rk_call_algebra< StageCount , algebra_type >()( stepper_base_type::m_algebra , - xerr , dxdt , m_F , detail::generic_rk_scale_sum_err< StageCount , operations_type , value_type , time_type >( m_b2 , dt) ); - } - - - template< class System , class StateIn , class DerivIn , class StateOut > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , - time_type t , StateOut &out , time_type dt ) - { - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); - - // actual calculation done in generic_rk.hpp - m_rk_algorithm.do_step( stepper_base_type::m_algebra , system , in , dxdt , t , out , dt , m_x_tmp.m_v , m_F ); - } - - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_impl( x ); - stepper_base_type::adjust_size( x ); - } - - -private: - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized( false ); - resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() ); - for( size_t i = 0 ; i < StageCount-1 ; ++i ) - { - resized |= adjust_size_by_resizeability( m_F[i] , x , typename is_resizeable<deriv_type>::type() ); - } - return resized; - } - - - rk_algorithm_type m_rk_algorithm; - coef_b_type m_b2; - - resizer_type m_resizer; - - wrapped_state_type m_x_tmp; - wrapped_deriv_type m_F[StageCount-1]; - -}; - - -/********* DOXYGEN *********/ - -/** - * \class explicit_error_generic_rk - * \brief A generic implementation of explicit Runge-Kutta algorithms with error estimation. This class is as a - * base class for all explicit Runge-Kutta steppers with error estimation. - * - * This class implements the explicit Runge-Kutta algorithms with error estimation in a generic way. - * The Butcher tableau is passed to the stepper which constructs the stepper scheme with the help of a - * template-metaprogramming algorithm. ToDo : Add example! - * - * This class derives explicit_error_stepper_base which provides the stepper interface. - * - * \tparam StageCount The number of stages of the Runge-Kutta algorithm. - * \tparam Order The order of a stepper if the stepper is used without error estimation. - * \tparam StepperOrder The order of a step if the stepper is used with error estimation. Usually Order and StepperOrder have - * the same value. - * \tparam ErrorOrder The order of the error step if the stepper is used with error estimation. - * \tparam State The type representing the state of the ODE. - * \tparam Value The floating point type which is used in the computations. - * \tparam Time The type representing the independent variable - the time - of the ODE. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - - /** - * \fn explicit_error_generic_rk::explicit_error_generic_rk( const coef_a_type &a , const coef_b_type &b , const coef_b_type &b2 , const coef_c_type &c , const algebra_type &algebra ) - * \brief Constructs the explicit_error_generik_rk class with the given parameters a, b, b2 and c. See examples section for details on the coefficients. - * - * \param a Triangular matrix of parameters b in the Butcher tableau. - * \param b Last row of the butcher tableau. - * \param b2 Parameters for lower-order evaluation to estimate the error. - * \param c Parameters to calculate the time points in the Butcher tableau. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - - /** - * \fn explicit_error_generic_rk::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr ) - * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method. - * The result is updated out-of-place, hence the input is in `in` and the output in `out`. Futhermore, an - * estimation of the error is stored in `xerr`. `do_step_impl` is used by explicit_error_stepper_base. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - * \param xerr The result of the error estimation is written in xerr. - */ - - /** - * \fn explicit_error_generic_rk::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method. - * The result is updated out-of-place, hence the input is in `in` and the output in `out`. - * Access to this step functionality is provided by explicit_stepper_base and - * `do_step_impl` should not be called directly. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - /** - * \fn explicit_error_generic_rk::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} -} -} - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_ERROR_GENERIC_RK_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/explicit_generic_rk.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/explicit_generic_rk.hpp deleted file mode 100644 index f8edc201a5..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/explicit_generic_rk.hpp +++ /dev/null @@ -1,246 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/explicit_generic_rk.hpp - - [begin_description] - Implementation of the generic Runge-Kutta steppers. This is the base class for many Runge-Kutta steppers. - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_GENERIC_RK_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_GENERIC_RK_HPP_INCLUDED - - -#include <boost/array.hpp> - - -#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> -#include <boost/numeric/odeint/stepper/detail/generic_rk_algorithm.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -//forward declarations - -#ifndef DOXYGEN_SKIP -template< -size_t StageCount, -size_t Order, -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -class explicit_generic_rk; - - -struct stage_vector; - -template< class T , class Constant > -struct array_wrapper -{ - typedef const typename boost::array< T , Constant::value > type; -}; - -template< class T , size_t i > -struct stage -{ - T c; - boost::array< T , i > a; -}; - - -template< class T , class Constant > -struct stage_wrapper -{ - typedef stage< T , Constant::value > type; -}; -#endif - - -template< -size_t StageCount, -size_t Order, -class State , -class Value , -class Deriv , -class Time , -class Algebra , -class Operations , -class Resizer -> -#ifndef DOXYGEN_SKIP -class explicit_generic_rk : public explicit_stepper_base< -explicit_generic_rk< StageCount , Order , State , Value , Deriv , Time , Algebra , Operations , Resizer > , -Order , State , Value , Deriv , Time , Algebra , Operations , Resizer > -#else -class explicit_generic_rk : public explicit_stepper_base -#endif -{ - -public: - - #ifndef DOXYGEN_SKIP - typedef explicit_stepper_base< - explicit_generic_rk< StageCount , Order , State , Value , Deriv ,Time , Algebra , Operations , Resizer > , - Order , State , Value , Deriv , Time , Algebra , - Operations , Resizer > stepper_base_type; - #else - typedef explicit_stepper_base< ... > stepper_base_type; - #endif - - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - - #ifndef DOXYGEN_SKIP - typedef explicit_generic_rk< StageCount , Order , State , Value , Deriv ,Time , Algebra , Operations , Resizer > stepper_type; - #endif - - typedef detail::generic_rk_algorithm< StageCount , Value , Algebra , Operations > rk_algorithm_type; - - typedef typename rk_algorithm_type::coef_a_type coef_a_type; - typedef typename rk_algorithm_type::coef_b_type coef_b_type; - typedef typename rk_algorithm_type::coef_c_type coef_c_type; - - #ifndef DOXYGEN_SKIP - static const size_t stage_count = StageCount; - #endif - -public: - - explicit_generic_rk( const coef_a_type &a , const coef_b_type &b , const coef_c_type &c , - const algebra_type &algebra = algebra_type() ) - : stepper_base_type( algebra ) , m_rk_algorithm( a , b , c ) - { } - - - template< class System , class StateIn , class DerivIn , class StateOut > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , - time_type t , StateOut &out , time_type dt ) - { - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); - - // actual calculation done in generic_rk.hpp - m_rk_algorithm.do_step( stepper_base_type::m_algebra , system , in , dxdt , t , out , dt , m_x_tmp.m_v , m_F ); - } - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_impl( x ); - stepper_base_type::adjust_size( x ); - } - -private: - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized( false ); - resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() ); - for( size_t i = 0 ; i < StageCount-1 ; ++i ) - { - resized |= adjust_size_by_resizeability( m_F[i] , x , typename is_resizeable<deriv_type>::type() ); - } - return resized; - } - - - rk_algorithm_type m_rk_algorithm; - - resizer_type m_resizer; - - wrapped_state_type m_x_tmp; - wrapped_deriv_type m_F[StageCount-1]; - -}; - - - -/*********** DOXYGEN *************/ - -/** - * \class explicit_generic_rk - * \brief A generic implementation of explicit Runge-Kutta algorithms. This class is as a base class - * for all explicit Runge-Kutta steppers. - * - * This class implements the explicit Runge-Kutta algorithms without error estimation in a generic way. - * The Butcher tableau is passed to the stepper which constructs the stepper scheme with the help of a - * template-metaprogramming algorithm. ToDo : Add example! - * - * This class derives explicit_stepper_base which provides the stepper interface. - * - * \tparam StageCount The number of stages of the Runge-Kutta algorithm. - * \tparam Order The order of the stepper. - * \tparam State The type representing the state of the ODE. - * \tparam Value The floating point type which is used in the computations. - * \tparam Time The type representing the independent variable - the time - of the ODE. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - /** - * \fn explicit_generic_rk::explicit_generic_rk( const coef_a_type &a , const coef_b_type &b , const coef_c_type &c , const algebra_type &algebra ) - * \brief Constructs the explicit_generic_rk class. See examples section for details on the coefficients. - * \param a Triangular matrix of parameters b in the Butcher tableau. - * \param b Last row of the butcher tableau. - * \param c Parameters to calculate the time points in the Butcher tableau. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - /** - * \fn explicit_generic_rk::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method. - * The result is updated out of place, hence the input is in `in` and the output in `out`. - * Access to this step functionality is provided by explicit_stepper_base and - * `do_step_impl` should not be called directly. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - - /** - * \fn explicit_generic_rk::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} -} -} -#endif // BOOST_NUMERIC_ODEINT_STEPPER_EXPLICIT_GENERIC_RK_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/extrapolation_stepper.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/extrapolation_stepper.hpp deleted file mode 100644 index 3b688e958b..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/extrapolation_stepper.hpp +++ /dev/null @@ -1,293 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/extrapolation_stepper.hpp - - [begin_description] - extrapolation stepper - [end_description] - - Copyright 2009-2015 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_EXTRAPOLATION_STEPPER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_EXTRAPOLATION_STEPPER_HPP_INCLUDED - -#include <iostream> - -#include <algorithm> - -#include <boost/config.hpp> // for min/max guidelines -#include <boost/static_assert.hpp> - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> - -#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp> -#include <boost/numeric/odeint/stepper/modified_midpoint.hpp> -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/unit_helper.hpp> -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -namespace boost -{ -namespace numeric -{ -namespace odeint -{ - -template < unsigned short Order, class State, class Value = double, - class Deriv = State, class Time = Value, - class Algebra = typename algebra_dispatcher< State >::algebra_type, - class Operations = - typename operations_dispatcher< State >::operations_type, - class Resizer = initially_resizer > -#ifndef DOXYGEN_SKIP -class extrapolation_stepper - : public explicit_error_stepper_base< - extrapolation_stepper< Order, State, Value, Deriv, Time, Algebra, - Operations, Resizer >, - Order, Order, Order - 2, State, Value, Deriv, Time, Algebra, - Operations, Resizer > -#else -class extrapolation_stepper : public explicit_error_stepper_base -#endif -{ - - private: - // check for Order being odd - BOOST_STATIC_ASSERT_MSG( - ( ( Order % 2 ) == 0 ) && ( Order > 2 ), - "extrapolation_stepper requires even Order larger than 2" ); - - public: -#ifndef DOXYGEN_SKIP - typedef explicit_error_stepper_base< - extrapolation_stepper< Order, State, Value, Deriv, Time, Algebra, - Operations, Resizer >, - Order, Order, Order - 2, State, Value, Deriv, Time, Algebra, Operations, - Resizer > stepper_base_type; -#else - typedef explicit_error_stepper_base< extrapolation_stepper< ... >, ... > - stepper_base_type; -#endif - - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - -#ifndef DOXYGEN_SKIP - typedef typename stepper_base_type::stepper_type stepper_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - - typedef std::vector< value_type > value_vector; - typedef std::vector< value_vector > value_matrix; - typedef std::vector< size_t > int_vector; - typedef std::vector< wrapped_state_type > state_table_type; - typedef modified_midpoint< state_type, value_type, deriv_type, time_type, - algebra_type, operations_type, - resizer_type > midpoint_stepper_type; - -#endif // DOXYGEN_SKIP - - typedef unsigned short order_type; - static const order_type order_value = stepper_base_type::order_value; - static const order_type stepper_order_value = - stepper_base_type::stepper_order_value; - static const order_type error_order_value = - stepper_base_type::error_order_value; - - const static size_t m_k_max = ( order_value - 2 ) / 2; - - extrapolation_stepper( const algebra_type &algebra = algebra_type() ) - : stepper_base_type( algebra ), m_interval_sequence( m_k_max + 1 ), - m_coeff( m_k_max + 1 ), m_table( m_k_max ) - { - for ( unsigned short i = 0; i < m_k_max + 1; i++ ) - { - m_interval_sequence[i] = 2 * ( i + 1 ); - m_coeff[i].resize( i ); - for ( size_t k = 0; k < i; ++k ) - { - const value_type r = - static_cast< value_type >( m_interval_sequence[i] ) / - static_cast< value_type >( m_interval_sequence[k] ); - m_coeff[i][k] = - static_cast< value_type >( 1 ) / - ( r * r - static_cast< value_type >( - 1 ) ); // coefficients for extrapolation - } - } - } - - template < class System, class StateIn, class DerivIn, class StateOut, - class Err > - void do_step_impl( System system, const StateIn &in, const DerivIn &dxdt, - time_type t, StateOut &out, time_type dt, Err &xerr ) - { - // std::cout << "dt: " << dt << std::endl; - // normal step - do_step_impl( system, in, dxdt, t, out, dt ); - - static const value_type val1( 1.0 ); - // additionally, perform the error calculation - stepper_base_type::m_algebra.for_each3( - xerr, out, m_table[0].m_v, - typename operations_type::template scale_sum2< - value_type, value_type >( val1, -val1 ) ); - } - - template < class System, class StateInOut, class DerivIn, class Err > - void do_step_impl_io( System system, StateInOut &inout, const DerivIn &dxdt, - time_type t, time_type dt, Err &xerr ) - { - // normal step - do_step_impl_io( system, inout, dxdt, t, dt ); - - static const value_type val1( 1.0 ); - // additionally, perform the error calculation - stepper_base_type::m_algebra.for_each3( - xerr, inout, m_table[0].m_v, - typename operations_type::template scale_sum2< - value_type, value_type >( val1, -val1 ) ); - } - - template < class System, class StateIn, class DerivIn, class StateOut > - void do_step_impl( System system, const StateIn &in, const DerivIn &dxdt, - time_type t, StateOut &out, time_type dt ) - { - m_resizer.adjust_size( - in, detail::bind( &stepper_type::template resize_impl< StateIn >, - detail::ref( *this ), detail::_1 ) ); - size_t k = 0; - m_midpoint.set_steps( m_interval_sequence[k] ); - m_midpoint.do_step( system, in, dxdt, t, out, dt ); - for ( k = 1; k <= m_k_max; ++k ) - { - m_midpoint.set_steps( m_interval_sequence[k] ); - m_midpoint.do_step( system, in, dxdt, t, m_table[k - 1].m_v, dt ); - extrapolate( k, m_table, m_coeff, out ); - } - } - - template < class System, class StateInOut, class DerivIn > - void do_step_impl_io( System system, StateInOut &inout, const DerivIn &dxdt, - time_type t, time_type dt ) - { - // special care for inout - m_xout_resizer.adjust_size( - inout, - detail::bind( &stepper_type::template resize_m_xout< StateInOut >, - detail::ref( *this ), detail::_1 ) ); - do_step_impl( system, inout, dxdt, t, m_xout.m_v, dt ); - boost::numeric::odeint::copy( m_xout.m_v, inout ); - } - - template < class System, class StateInOut, class DerivIn > - void do_step_dxdt_impl( System system, StateInOut &x, const DerivIn &dxdt, - time_type t, time_type dt ) - { - do_step_impl_io( system , x , dxdt , t , dt ); - } - - template < class System, class StateIn, class DerivIn, class StateOut > - void do_step_dxdt_impl( System system, const StateIn &in, - const DerivIn &dxdt, time_type t, StateOut &out, - time_type dt ) - { - do_step_impl( system , in , dxdt , t , out , dt ); - } - - - template < class StateIn > void adjust_size( const StateIn &x ) - { - resize_impl( x ); - m_midpoint.adjust_size( x ); - } - - private: - template < class StateIn > bool resize_impl( const StateIn &x ) - { - bool resized( false ); - for ( size_t i = 0; i < m_k_max; ++i ) - resized |= adjust_size_by_resizeability( - m_table[i], x, typename is_resizeable< state_type >::type() ); - return resized; - } - - template < class StateIn > bool resize_m_xout( const StateIn &x ) - { - return adjust_size_by_resizeability( - m_xout, x, typename is_resizeable< state_type >::type() ); - } - - template < class StateInOut > - void extrapolate( size_t k, state_table_type &table, - const value_matrix &coeff, StateInOut &xest ) - /* polynomial extrapolation, see http://www.nr.com/webnotes/nr3web21.pdf - uses the obtained intermediate results to extrapolate to dt->0 - */ - { - static const value_type val1 = static_cast< value_type >( 1.0 ); - - for ( int j = k - 1; j > 0; --j ) - { - stepper_base_type::m_algebra.for_each3( - table[j - 1].m_v, table[j].m_v, table[j - 1].m_v, - typename operations_type::template scale_sum2< - value_type, value_type >( val1 + coeff[k][j], - -coeff[k][j] ) ); - } - stepper_base_type::m_algebra.for_each3( - xest, table[0].m_v, xest, - typename operations_type::template scale_sum2< - value_type, value_type >( val1 + coeff[k][0], -coeff[k][0] ) ); - } - - private: - midpoint_stepper_type m_midpoint; - - resizer_type m_resizer; - resizer_type m_xout_resizer; - - int_vector m_interval_sequence; // stores the successive interval counts - value_matrix m_coeff; - - wrapped_state_type m_xout; - state_table_type m_table; // sequence of states for extrapolation -}; - -/******** DOXYGEN *******/ - -/** - * \class extrapolation_stepper - * \brief Extrapolation stepper with configurable order, and error estimation. - * - * The extrapolation stepper is a stepper with error estimation and configurable - * order. The order is given as template parameter and needs to be an _odd_ - * number. The stepper is based on several executions of the modified midpoint - * method and a Richardson extrapolation. This is essentially the same technique - * as for bulirsch_stoer, but without the variable order. - * - * \note The Order parameter has to be an even number greater 2. - */ -} -} -} -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation.hpp deleted file mode 100644 index 90ad2b9a76..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation.hpp +++ /dev/null @@ -1,36 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation.hpp - - [begin_description] - Forward header for the factory functions. Includes all files from the generation directory. - [end_description] - - Copyright 2011 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp> -#include <boost/numeric/odeint/stepper/generation/make_dense_output.hpp> - -#include <boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp> - -#include <boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp> -#include <boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp> -#include <boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp> -#include <boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp> - - -#include <boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp> - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp deleted file mode 100644 index bad2bedfef..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/generation_controlled_runge_kutta.hpp - - [begin_description] - Specialization of the controller factory for the controlled_runge_kutta class. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - -// controller factory for controlled_runge_kutta -template< class Stepper > -struct controller_factory< Stepper , controlled_runge_kutta< Stepper > > -{ - typedef Stepper stepper_type; - typedef controlled_runge_kutta< stepper_type > controller_type; - typedef typename controller_type::error_checker_type error_checker_type; - typedef typename controller_type::step_adjuster_type step_adjuster_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::value_type time_type; - - controller_type operator()( value_type abs_error , value_type rel_error , const stepper_type &stepper ) - { - return controller_type( error_checker_type( abs_error , rel_error ) , - step_adjuster_type() , stepper ); - } - - controller_type operator()( value_type abs_error , value_type rel_error , - time_type max_dt, const stepper_type &stepper ) - { - return controller_type( error_checker_type( abs_error , rel_error ) , - step_adjuster_type(max_dt) , stepper ); - } -}; - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_CONTROLLED_RUNGE_KUTTA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp deleted file mode 100644 index 276358a12e..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp +++ /dev/null @@ -1,65 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/generation_dense_output_runge_kutta.hpp - - [begin_description] - Specialization of the controller factory for the dense_output_runge_kutta class. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/generation/make_dense_output.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -// controller factory for controlled_runge_kutta -template< class Stepper > -struct dense_output_factory< Stepper , dense_output_runge_kutta< controlled_runge_kutta< Stepper > > > -{ - typedef Stepper stepper_type; - typedef controlled_runge_kutta< stepper_type > controller_type; - typedef typename controller_type::error_checker_type error_checker_type; - typedef typename controller_type::step_adjuster_type step_adjuster_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::time_type time_type; - typedef dense_output_runge_kutta< controller_type > dense_output_type; - - dense_output_type operator()( value_type abs_error , value_type rel_error , const stepper_type &stepper ) - { - return dense_output_type( controller_type( error_checker_type( abs_error , rel_error ) , - step_adjuster_type() , stepper ) ); - } - - dense_output_type operator()( value_type abs_error , value_type rel_error , - time_type max_dt , const stepper_type &stepper ) - { - return dense_output_type( - controller_type( error_checker_type( abs_error , rel_error) , - step_adjuster_type( max_dt ) , stepper ) ); - } -}; - - - - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_DENSE_OUTPUT_RUNGE_KUTTA_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp deleted file mode 100644 index 366cb5e9c4..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/generation_rosenbrock4.hpp - - [begin_description] - Enable the factory functions for the controller and the dense output of the Rosenbrock4 method. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/rosenbrock4.hpp> -#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp> -#include <boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - -template< class Value , class Coefficients , class Resize > -struct get_controller< rosenbrock4< Value , Coefficients , Resize > > -{ - typedef rosenbrock4< Value , Coefficients , Resize > stepper_type; - typedef rosenbrock4_controller< stepper_type > type; -}; - - - -template< class Value , class Coefficients , class Resize > -struct get_dense_output< rosenbrock4< Value , Coefficients , Resize > > -{ - typedef rosenbrock4< Value , Coefficients , Resize > stepper_type; - typedef rosenbrock4_controller< stepper_type > controller_type; - typedef rosenbrock4_dense_output< controller_type > type; -}; - - - -// controller factory for controlled_runge_kutta -template< class Stepper > -struct dense_output_factory< Stepper , rosenbrock4_dense_output< rosenbrock4_controller< Stepper > > > -{ - typedef Stepper stepper_type; - typedef rosenbrock4_controller< stepper_type > controller_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::time_type time_type; - typedef rosenbrock4_dense_output< controller_type > dense_output_type; - - dense_output_type operator()( value_type abs_error , value_type rel_error , const stepper_type &stepper ) - { - return dense_output_type( controller_type( abs_error , rel_error , stepper ) ); - } - - dense_output_type operator()( value_type abs_error , value_type rel_error , - time_type max_dt, const stepper_type &stepper ) - { - return dense_output_type( controller_type( abs_error , rel_error , max_dt , stepper ) ); - } -}; - - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_ROSENBROCK4_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp deleted file mode 100644 index 24ae54799e..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54.hpp - - [begin_description] - Enable the factory functions for the controller and the dense output of the Runge-Kutta-Cash-Karp 54 method. - [end_description] - - Copyright 2011 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp> -#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -// Specializations for runge_kutta_cash_karp54 -template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > -struct get_controller< runge_kutta_cash_karp54< State , Value , Deriv , Time , Algebra , Operations , Resize > > -{ - typedef runge_kutta_cash_karp54< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; - typedef controlled_runge_kutta< stepper_type > type; -}; - - - - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp deleted file mode 100644 index 1cc0f91d7f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/generation_runge_kutta_cash_karp54_classic.hpp - - [begin_description] - Enable the factory functions for the controller and the dense output of the - Runge-Kutta-Cash-Karp 54 method with the classical implementation. - [end_description] - - Copyright 2011 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp> -#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - -// Specializations for runge_kutta_cash_karp54 -template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > -struct get_controller< runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resize > > -{ - typedef runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; - typedef controlled_runge_kutta< stepper_type > type; -}; - - - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp deleted file mode 100644 index 1a607f3927..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/generation_runge_kutta_dopri5.hpp - - [begin_description] - Enable the factory functions for the controller and the dense output of the Runge-Kutta-Dormand-Prince5 method. - [end_description] - - Copyright 2011 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/dense_output_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp> -#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp> -#include <boost/numeric/odeint/stepper/generation/make_dense_output.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > -struct get_controller< runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resize > > -{ - typedef runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; - typedef controlled_runge_kutta< stepper_type > type; -}; - - -template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > -struct get_dense_output< runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resize > > -{ - typedef runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; - typedef controlled_runge_kutta< stepper_type > controller_type; - typedef dense_output_runge_kutta< controller_type > type; -}; - - - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp deleted file mode 100644 index d89343bf44..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/generation_runge_kutta_fehlberg78.hpp - - [begin_description] - Enable the factory functions for the controller and the dense output of the Runge-Kutta-Fehlberg 78 method. - [end_description] - - Copyright 2011 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED - -#include <boost/numeric/odeint/stepper/controlled_runge_kutta.hpp> -#include <boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp> -#include <boost/numeric/odeint/stepper/generation/make_controlled.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -template< class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resize > -struct get_controller< runge_kutta_fehlberg78< State , Value , Deriv , Time , Algebra , Operations , Resize > > -{ - typedef runge_kutta_fehlberg78< State , Value , Deriv , Time , Algebra , Operations , Resize > stepper_type; - typedef controlled_runge_kutta< stepper_type > type; -}; - - - - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_GENERATION_RUNGE_KUTTA_FEHLBERG78_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/make_controlled.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/make_controlled.hpp deleted file mode 100644 index 61bc8f1920..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/make_controlled.hpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/make_controlled.hpp - - [begin_description] - Factory function to simplify the creation of controlled steppers from error steppers. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED - - - - -namespace boost { -namespace numeric { -namespace odeint { - - - -// default template for the controller -template< class Stepper > struct get_controller { }; - - - -// default controller factory -template< class Stepper , class Controller > -struct controller_factory -{ - Controller operator()( - typename Stepper::value_type abs_error , - typename Stepper::value_type rel_error , - const Stepper &stepper ) - { - return Controller( abs_error , rel_error , stepper ); - } - - Controller operator()( - typename Stepper::value_type abs_error , - typename Stepper::value_type rel_error , - typename Stepper::time_type max_dt , - const Stepper &stepper ) - { - return Controller( abs_error , rel_error , max_dt, stepper ); - } -}; - - - - -namespace result_of -{ - template< class Stepper > - struct make_controlled - { - typedef typename get_controller< Stepper >::type type; - }; -} - - -template< class Stepper > -typename result_of::make_controlled< Stepper >::type make_controlled( - typename Stepper::value_type abs_error , - typename Stepper::value_type rel_error , - const Stepper & stepper = Stepper() ) -{ - typedef Stepper stepper_type; - typedef typename result_of::make_controlled< stepper_type >::type controller_type; - typedef controller_factory< stepper_type , controller_type > factory_type; - factory_type factory; - return factory( abs_error , rel_error , stepper ); -} - - -template< class Stepper > -typename result_of::make_controlled< Stepper >::type make_controlled( - typename Stepper::value_type abs_error , - typename Stepper::value_type rel_error , - typename Stepper::time_type max_dt , - const Stepper & stepper = Stepper() ) -{ - typedef Stepper stepper_type; - typedef typename result_of::make_controlled< stepper_type >::type controller_type; - typedef controller_factory< stepper_type , controller_type > factory_type; - factory_type factory; - return factory( abs_error , rel_error , max_dt, stepper ); -} - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_CONTROLLED_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/make_dense_output.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/make_dense_output.hpp deleted file mode 100644 index fff3590525..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/generation/make_dense_output.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/generation/make_dense_output.hpp - - [begin_description] - Factory function to simplify the creation of dense output steppers from error steppers. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_DENSE_OUTPUT_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_DENSE_OUTPUT_HPP_INCLUDED - -namespace boost { -namespace numeric { -namespace odeint { - - -// default template for the dense output -template< class Stepper > struct get_dense_output { }; - - - -// default dense output factory -template< class Stepper , class DenseOutput > -struct dense_output_factory -{ - DenseOutput operator()( - typename Stepper::value_type abs_error , - typename Stepper::value_type rel_error , - const Stepper &stepper ) - { - return DenseOutput( abs_error , rel_error , stepper ); - } - - DenseOutput operator()( - typename Stepper::value_type abs_error , - typename Stepper::value_type rel_error , - typename Stepper::time_type max_dt , - const Stepper &stepper ) - { - return DenseOutput( abs_error , rel_error , max_dt , stepper ); - } -}; - - - -namespace result_of -{ - template< class Stepper > - struct make_dense_output - { - typedef typename get_dense_output< Stepper >::type type; - }; -} - - - -template< class Stepper > -typename result_of::make_dense_output< Stepper >::type make_dense_output( - typename Stepper::value_type abs_error , - typename Stepper::value_type rel_error , - const Stepper &stepper = Stepper() ) -{ - typedef Stepper stepper_type; - typedef typename result_of::make_dense_output< stepper_type >::type dense_output_type; - typedef dense_output_factory< stepper_type , dense_output_type > factory_type; - factory_type factory; - return factory( abs_error , rel_error , stepper ); -} - - -template< class Stepper > -typename result_of::make_dense_output< Stepper >::type make_dense_output( - typename Stepper::value_type abs_error , - typename Stepper::value_type rel_error , - typename Stepper::time_type max_dt , - const Stepper &stepper = Stepper() ) -{ - typedef Stepper stepper_type; - typedef typename result_of::make_dense_output< stepper_type >::type dense_output_type; - typedef dense_output_factory< stepper_type , dense_output_type > factory_type; - factory_type factory; - return factory( abs_error , rel_error , max_dt, stepper ); -} - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_GENERATION_MAKE_DENSE_OUTPUT_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/implicit_euler.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/implicit_euler.hpp deleted file mode 100644 index e1c64164bc..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/implicit_euler.hpp +++ /dev/null @@ -1,170 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/implicit_euler.hpp - - [begin_description] - Impementation of the implicit Euler method. Works with ublas::vector as state type. - [end_description] - - Copyright 2010-2012 Mario Mulansky - Copyright 2010-2012 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_IMPLICIT_EULER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_IMPLICIT_EULER_HPP_INCLUDED - - -#include <utility> - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/util/ublas_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/numeric/ublas/vector.hpp> -#include <boost/numeric/ublas/matrix.hpp> -#include <boost/numeric/ublas/lu.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - - - - - - - -template< class ValueType , class Resizer = initially_resizer > -class implicit_euler -{ - -public: - - typedef ValueType value_type; - typedef value_type time_type; - typedef boost::numeric::ublas::vector< value_type > state_type; - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_type deriv_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef boost::numeric::ublas::matrix< value_type > matrix_type; - typedef state_wrapper< matrix_type > wrapped_matrix_type; - typedef boost::numeric::ublas::permutation_matrix< size_t > pmatrix_type; - typedef state_wrapper< pmatrix_type > wrapped_pmatrix_type; - typedef Resizer resizer_type; - typedef stepper_tag stepper_category; - typedef implicit_euler< ValueType , Resizer > stepper_type; - - implicit_euler( value_type epsilon = 1E-6 ) - : m_epsilon( epsilon ) - { } - - - template< class System > - void do_step( System system , state_type &x , time_type t , time_type dt ) - { - typedef typename odeint::unwrap_reference< System >::type system_type; - typedef typename odeint::unwrap_reference< typename system_type::first_type >::type deriv_func_type; - typedef typename odeint::unwrap_reference< typename system_type::second_type >::type jacobi_func_type; - system_type &sys = system; - deriv_func_type &deriv_func = sys.first; - jacobi_func_type &jacobi_func = sys.second; - - m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl<state_type> , detail::ref( *this ) , detail::_1 ) ); - - for( size_t i=0 ; i<x.size() ; ++i ) - m_pm.m_v[i] = i; - - t += dt; - - // apply first Newton step - deriv_func( x , m_dxdt.m_v , t ); - - m_b.m_v = dt * m_dxdt.m_v; - - jacobi_func( x , m_jacobi.m_v , t ); - m_jacobi.m_v *= dt; - m_jacobi.m_v -= boost::numeric::ublas::identity_matrix< value_type >( x.size() ); - - solve( m_b.m_v , m_jacobi.m_v ); - - m_x.m_v = x - m_b.m_v; - - // iterate Newton until some precision is reached - // ToDo: maybe we should apply only one Newton step -> linear implicit one-step scheme - while( boost::numeric::ublas::norm_2( m_b.m_v ) > m_epsilon ) - { - deriv_func( m_x.m_v , m_dxdt.m_v , t ); - m_b.m_v = x - m_x.m_v + dt*m_dxdt.m_v; - - // simplified version, only the first Jacobian is used - // jacobi( m_x , m_jacobi , t ); - // m_jacobi *= dt; - // m_jacobi -= boost::numeric::ublas::identity_matrix< value_type >( x.size() ); - - solve( m_b.m_v , m_jacobi.m_v ); - - m_x.m_v -= m_b.m_v; - } - x = m_x.m_v; - } - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_impl( x ); - } - - -private: - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_x , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_b , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_jacobi , x , typename is_resizeable<matrix_type>::type() ); - resized |= adjust_size_by_resizeability( m_pm , x , typename is_resizeable<pmatrix_type>::type() ); - return resized; - } - - - void solve( state_type &x , matrix_type &m ) - { - int res = boost::numeric::ublas::lu_factorize( m , m_pm.m_v ); - if( res != 0 ) std::exit(0); - boost::numeric::ublas::lu_substitute( m , m_pm.m_v , x ); - } - -private: - - value_type m_epsilon; - resizer_type m_resizer; - wrapped_deriv_type m_dxdt; - wrapped_state_type m_x; - wrapped_deriv_type m_b; - wrapped_matrix_type m_jacobi; - wrapped_pmatrix_type m_pm; - - -}; - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_IMPLICIT_EULER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/modified_midpoint.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/modified_midpoint.hpp deleted file mode 100644 index 9e34c7da2e..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/modified_midpoint.hpp +++ /dev/null @@ -1,315 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/modified_midpoint.hpp - - [begin_description] - Modified midpoint method for the use in Burlish-Stoer stepper. - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_MODIFIED_MIDPOINT_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_MODIFIED_MIDPOINT_HPP_INCLUDED - -#include <vector> - -#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> -#include <boost/numeric/odeint/util/copy.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -#ifndef DOXYGEN_SKIP -class modified_midpoint -: public explicit_stepper_base< - modified_midpoint< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 2 , State , Value , Deriv , Time , Algebra , Operations , Resizer > -#else -class modified_midpoint : public explicit_stepper_base -#endif -{ - -public : - - typedef explicit_stepper_base< - modified_midpoint< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 2 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type; - - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - typedef typename stepper_base_type::stepper_type stepper_type; - - - modified_midpoint( unsigned short steps = 2 , const algebra_type &algebra = algebra_type() ) - : stepper_base_type( algebra ) , m_steps( steps ) - { } - - template< class System , class StateIn , class DerivIn , class StateOut > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - { - static const value_type val1 = static_cast< value_type >( 1 ); - static const value_type val05 = static_cast< value_type >( 1 ) / static_cast< value_type >( 2 ); - - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); - - const time_type h = dt / static_cast<value_type>( m_steps ); - const time_type h2 = static_cast<value_type>(2) * h; - - typename odeint::unwrap_reference< System >::type &sys = system; - - time_type th = t + h; - - // m_x1 = x + h*dxdt - stepper_base_type::m_algebra.for_each3( m_x1.m_v , in , dxdt , - typename operations_type::template scale_sum2< value_type , time_type >( val1 , h ) ); - - sys( m_x1.m_v , m_dxdt.m_v , th ); - - boost::numeric::odeint::copy( in , m_x0.m_v ); - - unsigned short i = 1; - while( i != m_steps ) - { - // general step - //tmp = m_x1; m_x1 = m_x0 + h2*m_dxdt; m_x0 = tmp - stepper_base_type::m_algebra.for_each3( m_x1.m_v , m_x0.m_v , m_dxdt.m_v , - typename operations_type::template scale_sum_swap2< value_type , time_type >( val1 , h2 ) ); - th += h; - sys( m_x1.m_v , m_dxdt.m_v , th); - i++; - } - - // last step - // x = 0.5*( m_x0 + m_x1 + h*m_dxdt ) - stepper_base_type::m_algebra.for_each4( out , m_x0.m_v , m_x1.m_v , m_dxdt.m_v , - typename operations_type::template scale_sum3< value_type , value_type , time_type >( val05 , val05 , val05*h ) ); - } - - - void set_steps( unsigned short steps ) - { m_steps = steps; } - - - unsigned short steps( void ) const - { return m_steps; } - - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_impl( x ); - stepper_base_type::adjust_size( x ); - } - -private: - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized( false ); - resized |= adjust_size_by_resizeability( m_x0 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - return resized; - } - - - unsigned short m_steps; - - resizer_type m_resizer; - - wrapped_state_type m_x0; - wrapped_state_type m_x1; - wrapped_deriv_type m_dxdt; - -}; - - -/* Modified midpoint which stores derivatives and state at dt/2 in some external storage for later usage in dense output calculation - * This Stepper is for use in Bulirsch Stoer only. It DOES NOT meet any stepper concept. - */ -template< -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -class modified_midpoint_dense_out -{ - -public : - - typedef State state_type; - typedef Value value_type; - typedef Deriv deriv_type; - typedef Time time_type; - typedef Algebra algebra_type; - typedef Operations operations_type; - typedef Resizer resizer_type; - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - - typedef modified_midpoint_dense_out< State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_type; - typedef std::vector< wrapped_deriv_type > deriv_table_type; - - modified_midpoint_dense_out( unsigned short steps = 2 , const algebra_type &algebra = algebra_type() ) - : m_algebra( algebra ) , m_steps( steps ) - { } - - /* - * performs a modified midpoint step with m_steps intermediate points - * stores approximation for x(t+dt/2) in x_mp and all evaluated function results in derivs - * - */ - - template< class System , class StateIn , class DerivIn , class StateOut > - void do_step( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , - state_type &x_mp , deriv_table_type &derivs ) - { - - static const value_type val1 = static_cast< value_type >( 1 ); - static const value_type val05 = static_cast< value_type >( 1 ) / static_cast< value_type >( 2 ); - - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize< StateIn > , detail::ref( *this ) , detail::_1 ) ); - - const time_type h = dt / static_cast<value_type>( m_steps ); - const time_type h2 = static_cast<value_type>( 2 ) * h; - - typename odeint::unwrap_reference< System >::type &sys = system; - - time_type th = t + h; - - // m_x1 = x + h*dxdt - m_algebra.for_each3( m_x1.m_v , in , dxdt , - typename operations_type::template scale_sum2< value_type , time_type >( val1 , h ) ); - - if( m_steps == 2 ) - // result of first step already gives approximation at the center of the interval - boost::numeric::odeint::copy( m_x1.m_v , x_mp ); - - sys( m_x1.m_v , derivs[0].m_v , th ); - - boost::numeric::odeint::copy( in , m_x0.m_v ); - - unsigned short i = 1; - while( i != m_steps ) - { - // general step - //tmp = m_x1; m_x1 = m_x0 + h2*m_dxdt; m_x0 = tmp - m_algebra.for_each3( m_x1.m_v , m_x0.m_v , derivs[i-1].m_v , - typename operations_type::template scale_sum_swap2< value_type , time_type >( val1 , h2 ) ); - if( i == m_steps/2-1 ) - // save approximation at the center of the interval - boost::numeric::odeint::copy( m_x1.m_v , x_mp ); - - th += h; - sys( m_x1.m_v , derivs[i].m_v , th); - i++; - } - - // last step - // x = 0.5*( m_x0 + m_x1 + h*m_dxdt ) - m_algebra.for_each4( out , m_x0.m_v , m_x1.m_v , derivs[m_steps-1].m_v , - typename operations_type::template scale_sum3< value_type , value_type , time_type >( val05 , val05 , val05*h ) ); - } - - - void set_steps( unsigned short steps ) - { m_steps = steps; } - - - unsigned short steps( void ) const - { return m_steps; } - - - template< class StateIn > - bool resize( const StateIn &x ) - { - bool resized( false ); - resized |= adjust_size_by_resizeability( m_x0 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() ); - return resized; - } - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize( x ); - } - -private: - - algebra_type m_algebra; - - unsigned short m_steps; - - resizer_type m_resizer; - - wrapped_state_type m_x0; - wrapped_state_type m_x1; - -}; - - - -/********** DOXYGEN ***********/ - -/** - * \class modified_midpoint - * - * Implementation of the modified midpoint method with a configurable - * number of intermediate steps. This class is used by the Bulirsch-Stoer - * algorithm and is not meant for direct usage. - */ - - -/** - * \class modified_midpoint_dense_out - * - * Implementation of the modified midpoint method with a configurable - * number of intermediate steps. This class is used by the dense output - * Bulirsch-Stoer algorithm and is not meant for direct usage. - * \note This stepper is for internal use only and does not meet - * any stepper concept. - */ - - -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_MODIFIED_MIDPOINT_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4.hpp deleted file mode 100644 index 86136989d8..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4.hpp +++ /dev/null @@ -1,346 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/rosenbrock4.hpp - - [begin_description] - Implementation of the Rosenbrock 4 method for solving stiff ODEs. Note, that a - controller and a dense-output stepper exist for this method, - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> -#include <boost/numeric/ublas/vector.hpp> -#include <boost/numeric/ublas/matrix.hpp> -#include <boost/numeric/ublas/lu.hpp> - -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/util/ublas_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/numeric/ublas/vector.hpp> -#include <boost/numeric/ublas/matrix.hpp> -#include <boost/numeric/ublas/lu.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * ToDo: - * - * 2. Interfacing for odeint, check if controlled_error_stepper can be used - * 3. dense output - */ - - - -template< class Value > -struct default_rosenbrock_coefficients -{ - typedef Value value_type; - typedef unsigned short order_type; - - default_rosenbrock_coefficients( void ) - : gamma ( static_cast< value_type >( 0.25 ) ) , - d1 ( static_cast< value_type >( 0.25 ) ) , - d2 ( static_cast< value_type >( -0.1043 ) ) , - d3 ( static_cast< value_type >( 0.1035 ) ) , - d4 ( static_cast< value_type >( 0.3620000000000023e-01 ) ) , - c2 ( static_cast< value_type >( 0.386 ) ) , - c3 ( static_cast< value_type >( 0.21 ) ) , - c4 ( static_cast< value_type >( 0.63 ) ) , - c21 ( static_cast< value_type >( -0.5668800000000000e+01 ) ) , - a21 ( static_cast< value_type >( 0.1544000000000000e+01 ) ) , - c31 ( static_cast< value_type >( -0.2430093356833875e+01 ) ) , - c32 ( static_cast< value_type >( -0.2063599157091915e+00 ) ) , - a31 ( static_cast< value_type >( 0.9466785280815826e+00 ) ) , - a32 ( static_cast< value_type >( 0.2557011698983284e+00 ) ) , - c41 ( static_cast< value_type >( -0.1073529058151375e+00 ) ) , - c42 ( static_cast< value_type >( -0.9594562251023355e+01 ) ) , - c43 ( static_cast< value_type >( -0.2047028614809616e+02 ) ) , - a41 ( static_cast< value_type >( 0.3314825187068521e+01 ) ) , - a42 ( static_cast< value_type >( 0.2896124015972201e+01 ) ) , - a43 ( static_cast< value_type >( 0.9986419139977817e+00 ) ) , - c51 ( static_cast< value_type >( 0.7496443313967647e+01 ) ) , - c52 ( static_cast< value_type >( -0.1024680431464352e+02 ) ) , - c53 ( static_cast< value_type >( -0.3399990352819905e+02 ) ) , - c54 ( static_cast< value_type >( 0.1170890893206160e+02 ) ) , - a51 ( static_cast< value_type >( 0.1221224509226641e+01 ) ) , - a52 ( static_cast< value_type >( 0.6019134481288629e+01 ) ) , - a53 ( static_cast< value_type >( 0.1253708332932087e+02 ) ) , - a54 ( static_cast< value_type >( -0.6878860361058950e+00 ) ) , - c61 ( static_cast< value_type >( 0.8083246795921522e+01 ) ) , - c62 ( static_cast< value_type >( -0.7981132988064893e+01 ) ) , - c63 ( static_cast< value_type >( -0.3152159432874371e+02 ) ) , - c64 ( static_cast< value_type >( 0.1631930543123136e+02 ) ) , - c65 ( static_cast< value_type >( -0.6058818238834054e+01 ) ) , - d21 ( static_cast< value_type >( 0.1012623508344586e+02 ) ) , - d22 ( static_cast< value_type >( -0.7487995877610167e+01 ) ) , - d23 ( static_cast< value_type >( -0.3480091861555747e+02 ) ) , - d24 ( static_cast< value_type >( -0.7992771707568823e+01 ) ) , - d25 ( static_cast< value_type >( 0.1025137723295662e+01 ) ) , - d31 ( static_cast< value_type >( -0.6762803392801253e+00 ) ) , - d32 ( static_cast< value_type >( 0.6087714651680015e+01 ) ) , - d33 ( static_cast< value_type >( 0.1643084320892478e+02 ) ) , - d34 ( static_cast< value_type >( 0.2476722511418386e+02 ) ) , - d35 ( static_cast< value_type >( -0.6594389125716872e+01 ) ) - {} - - const value_type gamma; - const value_type d1 , d2 , d3 , d4; - const value_type c2 , c3 , c4; - const value_type c21 ; - const value_type a21; - const value_type c31 , c32; - const value_type a31 , a32; - const value_type c41 , c42 , c43; - const value_type a41 , a42 , a43; - const value_type c51 , c52 , c53 , c54; - const value_type a51 , a52 , a53 , a54; - const value_type c61 , c62 , c63 , c64 , c65; - const value_type d21 , d22 , d23 , d24 , d25; - const value_type d31 , d32 , d33 , d34 , d35; - - static const order_type stepper_order = 4; - static const order_type error_order = 3; -}; - - - -template< class Value , class Coefficients = default_rosenbrock_coefficients< Value > , class Resizer = initially_resizer > -class rosenbrock4 -{ -private: - -public: - - typedef Value value_type; - typedef boost::numeric::ublas::vector< value_type > state_type; - typedef state_type deriv_type; - typedef value_type time_type; - typedef boost::numeric::ublas::matrix< value_type > matrix_type; - typedef boost::numeric::ublas::permutation_matrix< size_t > pmatrix_type; - typedef Resizer resizer_type; - typedef Coefficients rosenbrock_coefficients; - typedef stepper_tag stepper_category; - typedef unsigned short order_type; - - typedef state_wrapper< state_type > wrapped_state_type; - typedef state_wrapper< deriv_type > wrapped_deriv_type; - typedef state_wrapper< matrix_type > wrapped_matrix_type; - typedef state_wrapper< pmatrix_type > wrapped_pmatrix_type; - - typedef rosenbrock4< Value , Coefficients , Resizer > stepper_type; - - const static order_type stepper_order = rosenbrock_coefficients::stepper_order; - const static order_type error_order = rosenbrock_coefficients::error_order; - - rosenbrock4( void ) - : m_resizer() , m_x_err_resizer() , - m_jac() , m_pm() , - m_dfdt() , m_dxdt() , m_dxdtnew() , - m_g1() , m_g2() , m_g3() , m_g4() , m_g5() , - m_cont3() , m_cont4() , m_xtmp() , m_x_err() , - m_coef() - { } - - - order_type order() const { return stepper_order; } - - template< class System > - void do_step( System system , const state_type &x , time_type t , state_type &xout , time_type dt , state_type &xerr ) - { - // get the system and jacobi function - typedef typename odeint::unwrap_reference< System >::type system_type; - typedef typename odeint::unwrap_reference< typename system_type::first_type >::type deriv_func_type; - typedef typename odeint::unwrap_reference< typename system_type::second_type >::type jacobi_func_type; - system_type &sys = system; - deriv_func_type &deriv_func = sys.first; - jacobi_func_type &jacobi_func = sys.second; - - const size_t n = x.size(); - - m_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_impl<state_type> , detail::ref( *this ) , detail::_1 ) ); - - for( size_t i=0 ; i<n ; ++i ) - m_pm.m_v( i ) = i; - - deriv_func( x , m_dxdt.m_v , t ); - jacobi_func( x , m_jac.m_v , t , m_dfdt.m_v ); - - m_jac.m_v *= -1.0; - m_jac.m_v += 1.0 / m_coef.gamma / dt * boost::numeric::ublas::identity_matrix< value_type >( n ); - boost::numeric::ublas::lu_factorize( m_jac.m_v , m_pm.m_v ); - - for( size_t i=0 ; i<n ; ++i ) - m_g1.m_v[i] = m_dxdt.m_v[i] + dt * m_coef.d1 * m_dfdt.m_v[i]; - boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g1.m_v ); - - - for( size_t i=0 ; i<n ; ++i ) - m_xtmp.m_v[i] = x[i] + m_coef.a21 * m_g1.m_v[i]; - deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + m_coef.c2 * dt ); - for( size_t i=0 ; i<n ; ++i ) - m_g2.m_v[i] = m_dxdtnew.m_v[i] + dt * m_coef.d2 * m_dfdt.m_v[i] + m_coef.c21 * m_g1.m_v[i] / dt; - boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g2.m_v ); - - - for( size_t i=0 ; i<n ; ++i ) - m_xtmp.m_v[i] = x[i] + m_coef.a31 * m_g1.m_v[i] + m_coef.a32 * m_g2.m_v[i]; - deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + m_coef.c3 * dt ); - for( size_t i=0 ; i<n ; ++i ) - m_g3.m_v[i] = m_dxdtnew.m_v[i] + dt * m_coef.d3 * m_dfdt.m_v[i] + ( m_coef.c31 * m_g1.m_v[i] + m_coef.c32 * m_g2.m_v[i] ) / dt; - boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g3.m_v ); - - - for( size_t i=0 ; i<n ; ++i ) - m_xtmp.m_v[i] = x[i] + m_coef.a41 * m_g1.m_v[i] + m_coef.a42 * m_g2.m_v[i] + m_coef.a43 * m_g3.m_v[i]; - deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + m_coef.c4 * dt ); - for( size_t i=0 ; i<n ; ++i ) - m_g4.m_v[i] = m_dxdtnew.m_v[i] + dt * m_coef.d4 * m_dfdt.m_v[i] + ( m_coef.c41 * m_g1.m_v[i] + m_coef.c42 * m_g2.m_v[i] + m_coef.c43 * m_g3.m_v[i] ) / dt; - boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g4.m_v ); - - - for( size_t i=0 ; i<n ; ++i ) - m_xtmp.m_v[i] = x[i] + m_coef.a51 * m_g1.m_v[i] + m_coef.a52 * m_g2.m_v[i] + m_coef.a53 * m_g3.m_v[i] + m_coef.a54 * m_g4.m_v[i]; - deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + dt ); - for( size_t i=0 ; i<n ; ++i ) - m_g5.m_v[i] = m_dxdtnew.m_v[i] + ( m_coef.c51 * m_g1.m_v[i] + m_coef.c52 * m_g2.m_v[i] + m_coef.c53 * m_g3.m_v[i] + m_coef.c54 * m_g4.m_v[i] ) / dt; - boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , m_g5.m_v ); - - for( size_t i=0 ; i<n ; ++i ) - m_xtmp.m_v[i] += m_g5.m_v[i]; - deriv_func( m_xtmp.m_v , m_dxdtnew.m_v , t + dt ); - for( size_t i=0 ; i<n ; ++i ) - xerr[i] = m_dxdtnew.m_v[i] + ( m_coef.c61 * m_g1.m_v[i] + m_coef.c62 * m_g2.m_v[i] + m_coef.c63 * m_g3.m_v[i] + m_coef.c64 * m_g4.m_v[i] + m_coef.c65 * m_g5.m_v[i] ) / dt; - boost::numeric::ublas::lu_substitute( m_jac.m_v , m_pm.m_v , xerr ); - - for( size_t i=0 ; i<n ; ++i ) - xout[i] = m_xtmp.m_v[i] + xerr[i]; - } - - template< class System > - void do_step( System system , state_type &x , time_type t , time_type dt , state_type &xerr ) - { - do_step( system , x , t , x , dt , xerr ); - } - - /* - * do_step without error output - just calls above functions with and neglects the error estimate - */ - template< class System > - void do_step( System system , const state_type &x , time_type t , state_type &xout , time_type dt ) - { - m_x_err_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_x_err<state_type> , detail::ref( *this ) , detail::_1 ) ); - do_step( system , x , t , xout , dt , m_x_err.m_v ); - } - - template< class System > - void do_step( System system , state_type &x , time_type t , time_type dt ) - { - m_x_err_resizer.adjust_size( x , detail::bind( &stepper_type::template resize_x_err<state_type> , detail::ref( *this ) , detail::_1 ) ); - do_step( system , x , t , dt , m_x_err.m_v ); - } - - void prepare_dense_output() - { - const size_t n = m_g1.m_v.size(); - for( size_t i=0 ; i<n ; ++i ) - { - m_cont3.m_v[i] = m_coef.d21 * m_g1.m_v[i] + m_coef.d22 * m_g2.m_v[i] + m_coef.d23 * m_g3.m_v[i] + m_coef.d24 * m_g4.m_v[i] + m_coef.d25 * m_g5.m_v[i]; - m_cont4.m_v[i] = m_coef.d31 * m_g1.m_v[i] + m_coef.d32 * m_g2.m_v[i] + m_coef.d33 * m_g3.m_v[i] + m_coef.d34 * m_g4.m_v[i] + m_coef.d35 * m_g5.m_v[i]; - } - } - - - void calc_state( time_type t , state_type &x , - const state_type &x_old , time_type t_old , - const state_type &x_new , time_type t_new ) - { - const size_t n = m_g1.m_v.size(); - time_type dt = t_new - t_old; - time_type s = ( t - t_old ) / dt; - time_type s1 = 1.0 - s; - for( size_t i=0 ; i<n ; ++i ) - x[i] = x_old[i] * s1 + s * ( x_new[i] + s1 * ( m_cont3.m_v[i] + s * m_cont4.m_v[i] ) ); - } - - - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_impl( x ); - resize_x_err( x ); - } - - -protected: - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_dxdt , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_dfdt , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxdtnew , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_xtmp , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_g1 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_g2 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_g3 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_g4 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_g5 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_cont3 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_cont4 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_jac , x , typename is_resizeable<matrix_type>::type() ); - resized |= adjust_size_by_resizeability( m_pm , x , typename is_resizeable<pmatrix_type>::type() ); - return resized; - } - - template< class StateIn > - bool resize_x_err( const StateIn &x ) - { - return adjust_size_by_resizeability( m_x_err , x , typename is_resizeable<state_type>::type() ); - } - -private: - - - resizer_type m_resizer; - resizer_type m_x_err_resizer; - - wrapped_matrix_type m_jac; - wrapped_pmatrix_type m_pm; - wrapped_deriv_type m_dfdt , m_dxdt , m_dxdtnew; - wrapped_state_type m_g1 , m_g2 , m_g3 , m_g4 , m_g5; - wrapped_state_type m_cont3 , m_cont4; - wrapped_state_type m_xtmp; - wrapped_state_type m_x_err; - - const rosenbrock_coefficients m_coef; -}; - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp deleted file mode 100644 index 61d6e51191..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp +++ /dev/null @@ -1,240 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/rosenbrock4_controller.hpp - - [begin_description] - Controller for the Rosenbrock4 method. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_CONTROLLER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_CONTROLLER_HPP_INCLUDED - -#include <boost/config.hpp> -#include <boost/numeric/odeint/util/bind.hpp> - -#include <boost/numeric/odeint/stepper/controlled_step_result.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/util/copy.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/detail/less_with_sign.hpp> - -#include <boost/numeric/odeint/stepper/rosenbrock4.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< class Stepper > -class rosenbrock4_controller -{ -private: - - -public: - - typedef Stepper stepper_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_type::resizer_type resizer_type; - typedef controlled_stepper_tag stepper_category; - - typedef rosenbrock4_controller< Stepper > controller_type; - - - rosenbrock4_controller( value_type atol = 1.0e-6 , value_type rtol = 1.0e-6 , - const stepper_type &stepper = stepper_type() ) - : m_stepper( stepper ) , m_atol( atol ) , m_rtol( rtol ) , - m_max_dt( static_cast<time_type>(0) ) , - m_first_step( true ) , m_err_old( 0.0 ) , m_dt_old( 0.0 ) , - m_last_rejected( false ) - { } - - rosenbrock4_controller( value_type atol, value_type rtol, time_type max_dt, - const stepper_type &stepper = stepper_type() ) - : m_stepper( stepper ) , m_atol( atol ) , m_rtol( rtol ) , m_max_dt( max_dt ) , - m_first_step( true ) , m_err_old( 0.0 ) , m_dt_old( 0.0 ) , - m_last_rejected( false ) - { } - - value_type error( const state_type &x , const state_type &xold , const state_type &xerr ) - { - BOOST_USING_STD_MAX(); - using std::abs; - using std::sqrt; - - const size_t n = x.size(); - value_type err = 0.0 , sk = 0.0; - for( size_t i=0 ; i<n ; ++i ) - { - sk = m_atol + m_rtol * max BOOST_PREVENT_MACRO_SUBSTITUTION ( abs( xold[i] ) , abs( x[i] ) ); - err += xerr[i] * xerr[i] / sk / sk; - } - return sqrt( err / value_type( n ) ); - } - - value_type last_error( void ) const - { - return m_err_old; - } - - - - - template< class System > - boost::numeric::odeint::controlled_step_result - try_step( System sys , state_type &x , time_type &t , time_type &dt ) - { - m_xnew_resizer.adjust_size( x , detail::bind( &controller_type::template resize_m_xnew< state_type > , detail::ref( *this ) , detail::_1 ) ); - boost::numeric::odeint::controlled_step_result res = try_step( sys , x , t , m_xnew.m_v , dt ); - if( res == success ) - { - boost::numeric::odeint::copy( m_xnew.m_v , x ); - } - return res; - } - - - template< class System > - boost::numeric::odeint::controlled_step_result - try_step( System sys , const state_type &x , time_type &t , state_type &xout , time_type &dt ) - { - if( m_max_dt != static_cast<time_type>(0) && detail::less_with_sign(m_max_dt, dt, dt) ) - { - // given step size is bigger then max_dt - // set limit and return fail - dt = m_max_dt; - return fail; - } - - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - using std::pow; - - static const value_type safe = 0.9 , fac1 = 5.0 , fac2 = 1.0 / 6.0; - - m_xerr_resizer.adjust_size( x , detail::bind( &controller_type::template resize_m_xerr< state_type > , detail::ref( *this ) , detail::_1 ) ); - - m_stepper.do_step( sys , x , t , xout , dt , m_xerr.m_v ); - value_type err = error( xout , x , m_xerr.m_v ); - - value_type fac = max BOOST_PREVENT_MACRO_SUBSTITUTION ( - fac2 , min BOOST_PREVENT_MACRO_SUBSTITUTION ( - fac1 , - static_cast< value_type >( pow( err , 0.25 ) / safe ) ) ); - value_type dt_new = dt / fac; - if ( err <= 1.0 ) - { - if( m_first_step ) - { - m_first_step = false; - } - else - { - value_type fac_pred = ( m_dt_old / dt ) * pow( err * err / m_err_old , 0.25 ) / safe; - fac_pred = max BOOST_PREVENT_MACRO_SUBSTITUTION ( - fac2 , min BOOST_PREVENT_MACRO_SUBSTITUTION ( fac1 , fac_pred ) ); - fac = max BOOST_PREVENT_MACRO_SUBSTITUTION ( fac , fac_pred ); - dt_new = dt / fac; - } - - m_dt_old = dt; - m_err_old = max BOOST_PREVENT_MACRO_SUBSTITUTION ( static_cast< value_type >( 0.01 ) , err ); - if( m_last_rejected ) - dt_new = ( dt >= 0.0 ? - min BOOST_PREVENT_MACRO_SUBSTITUTION ( dt_new , dt ) : - max BOOST_PREVENT_MACRO_SUBSTITUTION ( dt_new , dt ) ); - t += dt; - // limit step size to max_dt - if( m_max_dt != static_cast<time_type>(0) ) - { - dt = detail::min_abs(m_max_dt, dt_new); - } else { - dt = dt_new; - } - m_last_rejected = false; - return success; - } - else - { - dt = dt_new; - m_last_rejected = true; - return fail; - } - } - - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_m_xerr( x ); - resize_m_xnew( x ); - } - - - - stepper_type& stepper( void ) - { - return m_stepper; - } - - const stepper_type& stepper( void ) const - { - return m_stepper; - } - - - - -private: - - template< class StateIn > - bool resize_m_xerr( const StateIn &x ) - { - return adjust_size_by_resizeability( m_xerr , x , typename is_resizeable<state_type>::type() ); - } - - template< class StateIn > - bool resize_m_xnew( const StateIn &x ) - { - return adjust_size_by_resizeability( m_xnew , x , typename is_resizeable<state_type>::type() ); - } - - - stepper_type m_stepper; - resizer_type m_xerr_resizer; - resizer_type m_xnew_resizer; - wrapped_state_type m_xerr; - wrapped_state_type m_xnew; - value_type m_atol , m_rtol; - time_type m_max_dt; - bool m_first_step; - value_type m_err_old , m_dt_old; - bool m_last_rejected; -}; - - - - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_CONTROLLER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp deleted file mode 100644 index 6695ba6a97..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp +++ /dev/null @@ -1,199 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp - - [begin_description] - Dense output for Rosenbrock 4. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2015 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_DENSE_OUTPUT_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_DENSE_OUTPUT_HPP_INCLUDED - - -#include <utility> - -#include <boost/numeric/odeint/util/bind.hpp> - -#include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> - -#include <boost/numeric/odeint/integrate/max_step_checker.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -template< class ControlledStepper > -class rosenbrock4_dense_output -{ - -public: - - typedef ControlledStepper controlled_stepper_type; - typedef typename controlled_stepper_type::stepper_type stepper_type; - typedef typename stepper_type::value_type value_type; - typedef typename stepper_type::state_type state_type; - typedef typename stepper_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_type::time_type time_type; - typedef typename stepper_type::deriv_type deriv_type; - typedef typename stepper_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_type::resizer_type resizer_type; - typedef dense_output_stepper_tag stepper_category; - - typedef rosenbrock4_dense_output< ControlledStepper > dense_output_stepper_type; - - rosenbrock4_dense_output( const controlled_stepper_type &stepper = controlled_stepper_type() ) - : m_stepper( stepper ) , - m_x1() , m_x2() , - m_current_state_x1( true ) , - m_t() , m_t_old() , m_dt() - { - } - - - - template< class StateType > - void initialize( const StateType &x0 , time_type t0 , time_type dt0 ) - { - m_resizer.adjust_size( x0 , detail::bind( &dense_output_stepper_type::template resize_impl< StateType > , detail::ref( *this ) , detail::_1 ) ); - get_current_state() = x0; - m_t = t0; - m_dt = dt0; - } - - template< class System > - std::pair< time_type , time_type > do_step( System system ) - { - failed_step_checker fail_checker; // to throw a runtime_error if step size adjustment fails - controlled_step_result res = fail; - m_t_old = m_t; - do - { - res = m_stepper.try_step( system , get_current_state() , m_t , get_old_state() , m_dt ); - fail_checker(); // check for overflow of failed steps - } - while( res == fail ); - m_stepper.stepper().prepare_dense_output(); - this->toggle_current_state(); - return std::make_pair( m_t_old , m_t ); - } - - - /* - * The two overloads are needed in order to solve the forwarding problem. - */ - template< class StateOut > - void calc_state( time_type t , StateOut &x ) - { - m_stepper.stepper().calc_state( t , x , get_old_state() , m_t_old , get_current_state() , m_t ); - } - - template< class StateOut > - void calc_state( time_type t , const StateOut &x ) - { - m_stepper.stepper().calc_state( t , x , get_old_state() , m_t_old , get_current_state() , m_t ); - } - - - template< class StateType > - void adjust_size( const StateType &x ) - { - m_stepper.adjust_size( x ); - resize_impl( x ); - } - - - - - const state_type& current_state( void ) const - { - return get_current_state(); - } - - time_type current_time( void ) const - { - return m_t; - } - - const state_type& previous_state( void ) const - { - return get_old_state(); - } - - time_type previous_time( void ) const - { - return m_t_old; - } - - time_type current_time_step( void ) const - { - return m_dt; - } - - - - -private: - - state_type& get_current_state( void ) - { - return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ; - } - - const state_type& get_current_state( void ) const - { - return m_current_state_x1 ? m_x1.m_v : m_x2.m_v ; - } - - state_type& get_old_state( void ) - { - return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ; - } - - const state_type& get_old_state( void ) const - { - return m_current_state_x1 ? m_x2.m_v : m_x1.m_v ; - } - - void toggle_current_state( void ) - { - m_current_state_x1 = ! m_current_state_x1; - } - - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_x1 , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_x2 , x , typename is_resizeable<state_type>::type() ); - return resized; - } - - - controlled_stepper_type m_stepper; - resizer_type m_resizer; - wrapped_state_type m_x1 , m_x2; - bool m_current_state_x1; - time_type m_t , m_t_old , m_dt; -}; - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_ROSENBROCK4_DENSE_OUTPUT_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta4.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta4.hpp deleted file mode 100644 index 2410774ee1..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta4.hpp +++ /dev/null @@ -1,181 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/runge_kutta4.hpp - - [begin_description] - Implementation of the classical Runge-Kutta stepper with the generic stepper. - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_HPP_INCLUDED - - - - -#include <boost/fusion/container/vector.hpp> -#include <boost/fusion/container/generation/make_vector.hpp> - -#include <boost/numeric/odeint/stepper/explicit_generic_rk.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/array.hpp> - -#include <boost/numeric/odeint/util/resizer.hpp> - - - -namespace boost { -namespace numeric { -namespace odeint { - -#ifndef DOXYGEN_SKIP -template< class Value = double > -struct rk4_coefficients_a1 : boost::array< Value , 1 > -{ - rk4_coefficients_a1( void ) - { - (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ); - } -}; - -template< class Value = double > -struct rk4_coefficients_a2 : boost::array< Value , 2 > -{ - rk4_coefficients_a2( void ) - { - (*this)[0] = static_cast<Value>(0); - (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ); - } -}; - - -template< class Value = double > -struct rk4_coefficients_a3 : boost::array< Value , 3 > -{ - rk4_coefficients_a3( void ) - { - (*this)[0] = static_cast<Value>(0); - (*this)[1] = static_cast<Value>(0); - (*this)[2] = static_cast<Value>(1); - } -}; - -template< class Value = double > -struct rk4_coefficients_b : boost::array< Value , 4 > -{ - rk4_coefficients_b( void ) - { - (*this)[0] = static_cast<Value>(1)/static_cast<Value>(6); - (*this)[1] = static_cast<Value>(1)/static_cast<Value>(3); - (*this)[2] = static_cast<Value>(1)/static_cast<Value>(3); - (*this)[3] = static_cast<Value>(1)/static_cast<Value>(6); - } -}; - -template< class Value = double > -struct rk4_coefficients_c : boost::array< Value , 4 > -{ - rk4_coefficients_c( void ) - { - (*this)[0] = static_cast<Value>(0); - (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ); - (*this)[2] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ); - (*this)[3] = static_cast<Value>(1); - } -}; -#endif - - - -template< -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -#ifndef DOXYGEN_SKIP -class runge_kutta4 : public explicit_generic_rk< 4 , 4 , State , Value , Deriv , Time , -Algebra , Operations , Resizer > -#else -class runge_kutta4 : public explicit_generic_rk -#endif -{ - -public: - -#ifndef DOXYGEN_SKIP - typedef explicit_generic_rk< 4 , 4 , State , Value , Deriv , Time , - Algebra , Operations , Resizer > stepper_base_type; -#endif - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - - #ifndef DOXYGEN_SKIP - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_base_type::stepper_type stepper_type; - #endif - - runge_kutta4( const algebra_type &algebra = algebra_type() ) : stepper_base_type( - boost::fusion::make_vector( rk4_coefficients_a1<Value>() , rk4_coefficients_a2<Value>() , rk4_coefficients_a3<Value>() ) , - rk4_coefficients_b<Value>() , rk4_coefficients_c<Value>() , algebra ) - { } - -}; - -/** - * \class runge_kutta4 - * \brief The classical Runge-Kutta stepper of fourth order. - * - * The Runge-Kutta method of fourth order is one standard method for - * solving ordinary differential equations and is widely used, see also - * <a href="http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods">en.wikipedia.org/wiki/Runge-Kutta_methods</a> - * The method is explicit and fulfills the Stepper concept. Step size control - * or continuous output are not provided. - * - * This class derives from explicit_stepper_base and inherits its interface via CRTP (current recurring template pattern). - * Furthermore, it derivs from explicit_generic_rk which is a generic Runge-Kutta algorithm. For more details see - * explicit_stepper_base and explicit_generic_rk. - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - -/** - * \fn runge_kutta4::runge_kutta4( const algebra_type &algebra = algebra_type() ) - * \brief Constructs the runge_kutta4 class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - -} -} -} - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp deleted file mode 100644 index 32bda0bd7f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta4_classic.hpp +++ /dev/null @@ -1,232 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/runge_kutta4_classic.hpp - - [begin_description] - Implementation for the classical Runge Kutta stepper. - [end_description] - - Copyright 2010-2013 Karsten Ahnert - Copyright 2010-2013 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_CLASSIC_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_CLASSIC_HPP_INCLUDED - - - -#include <boost/numeric/odeint/stepper/base/explicit_stepper_base.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -#ifndef DOXYGEN_SKIP -class runge_kutta4_classic -: public explicit_stepper_base< - runge_kutta4_classic< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > -#else -class runge_kutta4_classic : public explicit_stepper_base -#endif -{ - -public : - - #ifndef DOXYGEN_SKIP - typedef explicit_stepper_base< - runge_kutta4_classic< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type; - #else - typedef explicit_stepper_base< runge_kutta4_classic< ... > , ... > stepper_base_type; - #endif - - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - - #ifndef DOXYGEN_SKIP - typedef typename stepper_base_type::stepper_type stepper_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - #endif // DOXYGEN_SKIP - - - - runge_kutta4_classic( const algebra_type &algebra = algebra_type() ) : stepper_base_type( algebra ) - { } - - - template< class System , class StateIn , class DerivIn , class StateOut > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - { - // ToDo : check if size of in,dxdt,out are equal? - - static const value_type val1 = static_cast< value_type >( 1 ); - - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateIn > , detail::ref( *this ) , detail::_1 ) ); - - typename odeint::unwrap_reference< System >::type &sys = system; - - const time_type dh = dt / static_cast< value_type >( 2 ); - const time_type th = t + dh; - - // dt * dxdt = k1 - // m_x_tmp = x + dh*dxdt - stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt , - typename operations_type::template scale_sum2< value_type , time_type >( val1 , dh ) ); - - - // dt * m_dxt = k2 - sys( m_x_tmp.m_v , m_dxt.m_v , th ); - - // m_x_tmp = x + dh*m_dxt - stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , m_dxt.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( val1 , dh ) ); - - - // dt * m_dxm = k3 - sys( m_x_tmp.m_v , m_dxm.m_v , th ); - //m_x_tmp = x + dt*m_dxm - stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , m_dxm.m_v , - typename operations_type::template scale_sum2< value_type , time_type >( val1 , dt ) ); - - - // dt * m_dxh = k4 - sys( m_x_tmp.m_v , m_dxh.m_v , t + dt ); - - //x += dt/6 * ( m_dxdt + m_dxt + val2*m_dxm ) - time_type dt6 = dt / static_cast< value_type >( 6 ); - time_type dt3 = dt / static_cast< value_type >( 3 ); - stepper_base_type::m_algebra.for_each6( out , in , dxdt , m_dxt.m_v , m_dxm.m_v , m_dxh.m_v , - typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt6 , dt3 , dt3 , dt6 ) ); - - // x += dt/6 * m_dxdt + dt/3 * m_dxt ) - // stepper_base_type::m_algebra.for_each4( out , in , dxdt , m_dxt.m_v , - // typename operations_type::template scale_sum3< value_type , time_type , time_type >( 1.0 , dt6 , dt3 ) ); - // // x += dt/3 * m_dxm + dt/6 * m_dxh ) - // stepper_base_type::m_algebra.for_each4( out , out , m_dxm.m_v , m_dxh.m_v , - // typename operations_type::template scale_sum3< value_type , time_type , time_type >( 1.0 , dt3 , dt6 ) ); - - } - - template< class StateType > - void adjust_size( const StateType &x ) - { - resize_impl( x ); - stepper_base_type::adjust_size( x ); - } - -private: - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxm , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxt , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_dxh , x , typename is_resizeable<deriv_type>::type() ); - return resized; - } - - - resizer_type m_resizer; - - wrapped_deriv_type m_dxt; - wrapped_deriv_type m_dxm; - wrapped_deriv_type m_dxh; - wrapped_state_type m_x_tmp; - -}; - - -/********* DOXYGEN *********/ - -/** - * \class runge_kutta4_classic - * \brief The classical Runge-Kutta stepper of fourth order. - * - * The Runge-Kutta method of fourth order is one standard method for - * solving ordinary differential equations and is widely used, see also - * <a href="http://en.wikipedia.org/wiki/Runge%E2%80%93Kutta_methods">en.wikipedia.org/wiki/Runge-Kutta_methods</a> - * The method is explicit and fulfills the Stepper concept. Step size control - * or continuous output are not provided. This class implements the method directly, hence the - * generic Runge-Kutta algorithm is not used. - * - * This class derives from explicit_stepper_base and inherits its interface via - * CRTP (current recurring template pattern). For more details see - * explicit_stepper_base. - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - /** - * \fn runge_kutta4_classic::runge_kutta4_classic( const algebra_type &algebra ) - * \brief Constructs the runge_kutta4_classic class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - - /** - * \fn runge_kutta4_classic::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method. - * The result is updated out of place, hence the input is in `in` and the output in `out`. - * Access to this step functionality is provided by explicit_stepper_base and - * `do_step_impl` should not be called directly. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - - /** - * \fn runge_kutta4_classic::adjust_size( const StateType &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA4_CLASSIC_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp deleted file mode 100644 index beecb3f328..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp +++ /dev/null @@ -1,231 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/runge_kutta_cash_karp54.hpp - - [begin_description] - Implementation of the Runge Kutta Cash Karp 5(4) method. It uses the generic error stepper. - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED - -#include <boost/fusion/container/vector.hpp> -#include <boost/fusion/container/generation/make_vector.hpp> - -#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/array.hpp> - - - - -namespace boost { -namespace numeric { -namespace odeint { - - -#ifndef DOXYGEN_SKIP -template< class Value = double > -struct rk54_ck_coefficients_a1 : boost::array< Value , 1 > -{ - rk54_ck_coefficients_a1( void ) - { - (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 5 ); - } -}; - -template< class Value = double > -struct rk54_ck_coefficients_a2 : boost::array< Value , 2 > -{ - rk54_ck_coefficients_a2( void ) - { - (*this)[0] = static_cast<Value>( 3 )/static_cast<Value>( 40 ); - (*this)[1] = static_cast<Value>( 9 )/static_cast<Value>( 40 ); - } -}; - - -template< class Value = double > -struct rk54_ck_coefficients_a3 : boost::array< Value , 3 > -{ - rk54_ck_coefficients_a3( void ) - { - (*this)[0] = static_cast<Value>( 3 )/static_cast<Value>( 10 ); - (*this)[1] = static_cast<Value>( -9 )/static_cast<Value>( 10 ); - (*this)[2] = static_cast<Value>( 6 )/static_cast<Value>( 5 ); - } -}; - -template< class Value = double > -struct rk54_ck_coefficients_a4 : boost::array< Value , 4 > -{ - rk54_ck_coefficients_a4( void ) - { - (*this)[0] = static_cast<Value>( -11 )/static_cast<Value>( 54 ); - (*this)[1] = static_cast<Value>( 5 )/static_cast<Value>( 2 ); - (*this)[2] = static_cast<Value>( -70 )/static_cast<Value>( 27 ); - (*this)[3] = static_cast<Value>( 35 )/static_cast<Value>( 27 ); - } -}; - -template< class Value = double > -struct rk54_ck_coefficients_a5 : boost::array< Value , 5 > -{ - rk54_ck_coefficients_a5( void ) - { - (*this)[0] = static_cast<Value>( 1631 )/static_cast<Value>( 55296 ); - (*this)[1] = static_cast<Value>( 175 )/static_cast<Value>( 512 ); - (*this)[2] = static_cast<Value>( 575 )/static_cast<Value>( 13824 ); - (*this)[3] = static_cast<Value>( 44275 )/static_cast<Value>( 110592 ); - (*this)[4] = static_cast<Value>( 253 )/static_cast<Value>( 4096 ); - } -}; - -template< class Value = double > -struct rk54_ck_coefficients_b : boost::array< Value , 6 > -{ - rk54_ck_coefficients_b( void ) - { - (*this)[0] = static_cast<Value>( 37 )/static_cast<Value>( 378 ); - (*this)[1] = static_cast<Value>( 0 ); - (*this)[2] = static_cast<Value>( 250 )/static_cast<Value>( 621 ); - (*this)[3] = static_cast<Value>( 125 )/static_cast<Value>( 594 ); - (*this)[4] = static_cast<Value>( 0 ); - (*this)[5] = static_cast<Value>( 512 )/static_cast<Value>( 1771 ); - } -}; - -template< class Value = double > -struct rk54_ck_coefficients_db : boost::array< Value , 6 > -{ - rk54_ck_coefficients_db( void ) - { - (*this)[0] = static_cast<Value>( 37 )/static_cast<Value>( 378 ) - static_cast<Value>( 2825 )/static_cast<Value>( 27648 ); - (*this)[1] = static_cast<Value>( 0 ); - (*this)[2] = static_cast<Value>( 250 )/static_cast<Value>( 621 ) - static_cast<Value>( 18575 )/static_cast<Value>( 48384 ); - (*this)[3] = static_cast<Value>( 125 )/static_cast<Value>( 594 ) - static_cast<Value>( 13525 )/static_cast<Value>( 55296 ); - (*this)[4] = static_cast<Value>( -277 )/static_cast<Value>( 14336 ); - (*this)[5] = static_cast<Value>( 512 )/static_cast<Value>( 1771 ) - static_cast<Value>( 1 )/static_cast<Value>( 4 ); - } -}; - - -template< class Value = double > -struct rk54_ck_coefficients_c : boost::array< Value , 6 > -{ - rk54_ck_coefficients_c( void ) - { - (*this)[0] = static_cast<Value>(0); - (*this)[1] = static_cast<Value>( 1 )/static_cast<Value>( 5 ); - (*this)[2] = static_cast<Value>( 3 )/static_cast<Value>( 10 ); - (*this)[3] = static_cast<Value>( 3 )/static_cast<Value>( 5 ); - (*this)[4] = static_cast<Value>( 1 ); - (*this)[5] = static_cast<Value>( 7 )/static_cast<Value>( 8 ); - } -}; -#endif - - -template< - class State , - class Value = double , - class Deriv = State , - class Time = Value , - class Algebra = typename algebra_dispatcher< State >::algebra_type , - class Operations = typename operations_dispatcher< State >::operations_type , - class Resizer = initially_resizer - > -#ifndef DOXYGEN_SKIP -class runge_kutta_cash_karp54 : public explicit_error_generic_rk< 6 , 5 , 5 , 4 , - State , Value , Deriv , Time , Algebra , Operations , Resizer > -#else -class runge_kutta_cash_karp54 : public explicit_error_generic_rk -#endif -{ - -public: -#ifndef DOXYGEN_SKIP - typedef explicit_error_generic_rk< 6 , 5 , 5 , 4 , State , Value , Deriv , Time , - Algebra , Operations , Resizer > stepper_base_type; -#endif - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_typ; - - #ifndef DOXYGEN_SKIP - typedef typename stepper_base_type::stepper_type stepper_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - #endif - - - runge_kutta_cash_karp54( const algebra_type &algebra = algebra_type() ) : stepper_base_type( - boost::fusion::make_vector( rk54_ck_coefficients_a1<Value>() , - rk54_ck_coefficients_a2<Value>() , - rk54_ck_coefficients_a3<Value>() , - rk54_ck_coefficients_a4<Value>() , - rk54_ck_coefficients_a5<Value>() ) , - rk54_ck_coefficients_b<Value>() , rk54_ck_coefficients_db<Value>() , rk54_ck_coefficients_c<Value>() , - algebra ) - { } -}; - - -/********** DOXYGEN **********/ - -/** - * \class runge_kutta_cash_karp54 - * \brief The Runge-Kutta Cash-Karp method. - * - * The Runge-Kutta Cash-Karp method is one of the standard methods for - * solving ordinary differential equations, see - * <a href="http://en.wikipedia.org/wiki/Cash%E2%80%93Karp_methods">en.wikipedia.org/wiki/Cash-Karp_methods</a>. - * The method is explicit and fulfills the Error Stepper concept. Step size control - * is provided but continuous output is not available for this method. - * - * This class derives from explicit_error_stepper_base and inherits its interface via CRTP (current recurring template pattern). - * Furthermore, it derivs from explicit_error_generic_rk which is a generic Runge-Kutta algorithm with error estimation. - * For more details see explicit_error_stepper_base and explicit_error_generic_rk. - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - - /** - * \fn runge_kutta_cash_karp54::runge_kutta_cash_karp54( const algebra_type &algebra ) - * \brief Constructs the runge_kutta_cash_karp54 class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp deleted file mode 100644 index 80f1a3c030..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp +++ /dev/null @@ -1,289 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/runge_kutta_cash_karp54_classic.hpp - - [begin_description] - Classical implementation of the Runge-Kutta Cash-Karp 5(4) method. - [end_description] - - Copyright 2010-2013 Mario Mulansky - Copyright 2010-2013 Karsten Ahnert - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/bind.hpp> - -#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_base.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - - - -template< -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -#ifndef DOXYGEN_SKIP -class runge_kutta_cash_karp54_classic -: public explicit_error_stepper_base< - runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 5 , 5 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > -#else -class runge_kutta_cash_karp54_classic : public explicit_error_stepper_base -#endif -{ - - -public : - - #ifndef DOXYGEN_SKIP - typedef explicit_error_stepper_base< - runge_kutta_cash_karp54_classic< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 5 , 5 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type; - #else - typedef explicit_error_stepper_base< runge_kutta_cash_karp54_classic< ... > , ... > stepper_base_type; - #endif - - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - - #ifndef DOXYGEN_SKIP - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - typedef typename stepper_base_type::stepper_type stepper_type; - #endif - - - runge_kutta_cash_karp54_classic( const algebra_type &algebra = algebra_type() ) : stepper_base_type( algebra ) - { } - - - - template< class System , class StateIn , class DerivIn , class StateOut , class Err > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr ) - { - const value_type c1 = static_cast<value_type> ( 37 ) / static_cast<value_type>( 378 ); - const value_type c3 = static_cast<value_type> ( 250 ) / static_cast<value_type>( 621 ); - const value_type c4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 594 ); - const value_type c6 = static_cast<value_type> ( 512 ) / static_cast<value_type>( 1771 ); - - const value_type dc1 = c1 - static_cast<value_type> ( 2825 ) / static_cast<value_type>( 27648 ); - const value_type dc3 = c3 - static_cast<value_type> ( 18575 ) / static_cast<value_type>( 48384 ); - const value_type dc4 = c4 - static_cast<value_type> ( 13525 ) / static_cast<value_type>( 55296 ); - const value_type dc5 = static_cast<value_type> ( -277 ) / static_cast<value_type>( 14336 ); - const value_type dc6 = c6 - static_cast<value_type> ( 1 ) / static_cast<value_type> ( 4 ); - - do_step_impl( system , in , dxdt , t , out , dt ); - - //error estimate - stepper_base_type::m_algebra.for_each6( xerr , dxdt , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v , - typename operations_type::template scale_sum5< time_type , time_type , time_type , time_type , time_type >( dt*dc1 , dt*dc3 , dt*dc4 , dt*dc5 , dt*dc6 )); - - } - - - - template< class System , class StateIn , class DerivIn , class StateOut > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - { - const value_type a2 = static_cast<value_type> ( 1 ) / static_cast<value_type> ( 5 ); - const value_type a3 = static_cast<value_type> ( 3 ) / static_cast<value_type> ( 10 ); - const value_type a4 = static_cast<value_type> ( 3 ) / static_cast<value_type> ( 5 ); - const value_type a5 = static_cast<value_type> ( 1 ); - const value_type a6 = static_cast<value_type> ( 7 ) / static_cast<value_type> ( 8 ); - - const value_type b21 = static_cast<value_type> ( 1 ) / static_cast<value_type> ( 5 ); - const value_type b31 = static_cast<value_type> ( 3 ) / static_cast<value_type>( 40 ); - const value_type b32 = static_cast<value_type> ( 9 ) / static_cast<value_type>( 40 ); - const value_type b41 = static_cast<value_type> ( 3 ) / static_cast<value_type> ( 10 ); - const value_type b42 = static_cast<value_type> ( -9 ) / static_cast<value_type> ( 10 ); - const value_type b43 = static_cast<value_type> ( 6 ) / static_cast<value_type> ( 5 ); - const value_type b51 = static_cast<value_type> ( -11 ) / static_cast<value_type>( 54 ); - const value_type b52 = static_cast<value_type> ( 5 ) / static_cast<value_type> ( 2 ); - const value_type b53 = static_cast<value_type> ( -70 ) / static_cast<value_type>( 27 ); - const value_type b54 = static_cast<value_type> ( 35 ) / static_cast<value_type>( 27 ); - const value_type b61 = static_cast<value_type> ( 1631 ) / static_cast<value_type>( 55296 ); - const value_type b62 = static_cast<value_type> ( 175 ) / static_cast<value_type>( 512 ); - const value_type b63 = static_cast<value_type> ( 575 ) / static_cast<value_type>( 13824 ); - const value_type b64 = static_cast<value_type> ( 44275 ) / static_cast<value_type>( 110592 ); - const value_type b65 = static_cast<value_type> ( 253 ) / static_cast<value_type>( 4096 ); - - const value_type c1 = static_cast<value_type> ( 37 ) / static_cast<value_type>( 378 ); - const value_type c3 = static_cast<value_type> ( 250 ) / static_cast<value_type>( 621 ); - const value_type c4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 594 ); - const value_type c6 = static_cast<value_type> ( 512 ) / static_cast<value_type>( 1771 ); - - typename odeint::unwrap_reference< System >::type &sys = system; - - m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); - - //m_x1 = x + dt*b21*dxdt - stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt*b21 ) ); - - sys( m_x_tmp.m_v , m_k2.m_v , t + dt*a2 ); - // m_x_tmp = x + dt*b31*dxdt + dt*b32*m_x2 - stepper_base_type::m_algebra.for_each4( m_x_tmp.m_v , in , dxdt , m_k2.m_v , - typename operations_type::template scale_sum3< value_type , time_type , time_type >( 1.0 , dt*b31 , dt*b32 )); - - sys( m_x_tmp.m_v , m_k3.m_v , t + dt*a3 ); - // m_x_tmp = x + dt * (b41*dxdt + b42*m_x2 + b43*m_x3) - stepper_base_type::m_algebra.for_each5( m_x_tmp.m_v , in , dxdt , m_k2.m_v , m_k3.m_v , - typename operations_type::template scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt*b41 , dt*b42 , dt*b43 )); - - sys( m_x_tmp.m_v, m_k4.m_v , t + dt*a4 ); - stepper_base_type::m_algebra.for_each6( m_x_tmp.m_v , in , dxdt , m_k2.m_v , m_k3.m_v , m_k4.m_v , - typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b51 , dt*b52 , dt*b53 , dt*b54 )); - - sys( m_x_tmp.m_v , m_k5.m_v , t + dt*a5 ); - stepper_base_type::m_algebra.for_each7( m_x_tmp.m_v , in , dxdt , m_k2.m_v , m_k3.m_v , m_k4.m_v , m_k5.m_v , - typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b61 , dt*b62 , dt*b63 , dt*b64 , dt*b65 )); - - sys( m_x_tmp.m_v , m_k6.m_v , t + dt*a6 ); - stepper_base_type::m_algebra.for_each6( out , in , dxdt , m_k3.m_v , m_k4.m_v , m_k6.m_v , - typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*c1 , dt*c3 , dt*c4 , dt*c6 )); - - } - - /** - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_impl( x ); - stepper_base_type::adjust_size( x ); - } - -private: - - template< class StateIn > - bool resize_impl( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_k2 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_k3 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_k4 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_k5 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_k6 , x , typename is_resizeable<deriv_type>::type() ); - return resized; - } - - - wrapped_state_type m_x_tmp; - wrapped_deriv_type m_k2, m_k3, m_k4, m_k5, m_k6; - resizer_type m_resizer; - -}; - - - -/************ DOXYGEN *************/ - -/** - * \class runge_kutta_cash_karp54_classic - * \brief The Runge-Kutta Cash-Karp method implemented without the generic Runge-Kutta algorithm. - * - * The Runge-Kutta Cash-Karp method is one of the standard methods for - * solving ordinary differential equations, see - * <a href="http://en.wikipedia.org/wiki/Cash%E2%80%93Karp_method">en.wikipedia.org/wiki/Cash-Karp_method</a>. - * The method is explicit and fulfills the Error Stepper concept. Step size control - * is provided but continuous output is not available for this method. - * - * This class derives from explicit_error_stepper_base and inherits its interface via CRTP (current recurring - * template pattern). This class implements the method directly, hence the generic Runge-Kutta algorithm is not used. - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - - /** - * \fn runge_kutta_cash_karp54_classic::runge_kutta_cash_karp54_classic( const algebra_type &algebra ) - * \brief Constructs the runge_kutta_cash_karp54_classic class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - - /** - * \fn runge_kutta_cash_karp54_classic::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt , Err &xerr ) - * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method. - * - * The result is updated out-of-place, hence the input is in `in` and the output in `out`. Futhermore, an - * estimation of the error is stored in `xerr`. - * Access to this step functionality is provided by explicit_error_stepper_base and - * `do_step_impl` should not be called directly. - - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - * \param xerr The result of the error estimation is written in xerr. - */ - - /** - * \fn runge_kutta_cash_karp54_classic::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt , time_type t , StateOut &out , time_type dt ) - * \brief This method performs one step. The derivative `dxdt` of `in` at the time `t` is passed to the method. - * The result is updated out-of-place, hence the input is in `in` and the output in `out`. - * Access to this step functionality is provided by explicit_error_stepper_base and - * `do_step_impl` should not be called directly. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt The derivative of x at t. - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dt The step size. - */ - -} // odeint -} // numeric -} // boost - - - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_CASH_KARP54_CLASSIC_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp deleted file mode 100644 index 260cd74f40..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp +++ /dev/null @@ -1,403 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/runge_kutta_dopri5.hpp - - [begin_description] - Implementation of the Dormand-Prince 5(4) method. This stepper can also be used with the dense-output controlled stepper. - [end_description] - - Copyright 2010-2013 Karsten Ahnert - Copyright 2010-2013 Mario Mulansky - Copyright 2012 Christoph Koke - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/bind.hpp> - -#include <boost/numeric/odeint/stepper/base/explicit_error_stepper_fsal_base.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/same_instance.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - - -template< -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -class runge_kutta_dopri5 -#ifndef DOXYGEN_SKIP -: public explicit_error_stepper_fsal_base< - runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 5 , 5 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > -#else -: public explicit_error_stepper_fsal_base -#endif -{ - -public : - - #ifndef DOXYGEN_SKIP - typedef explicit_error_stepper_fsal_base< - runge_kutta_dopri5< State , Value , Deriv , Time , Algebra , Operations , Resizer > , - 5 , 5 , 4 , State , Value , Deriv , Time , Algebra , Operations , Resizer > stepper_base_type; - #else - typedef explicit_error_stepper_fsal_base< runge_kutta_dopri5< ... > , ... > stepper_base_type; - #endif - - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - - #ifndef DOXYGEN_SKIP - typedef typename stepper_base_type::stepper_type stepper_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - #endif // DOXYGEN_SKIP - - - runge_kutta_dopri5( const algebra_type &algebra = algebra_type() ) : stepper_base_type( algebra ) - { } - - - template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , - StateOut &out , DerivOut &dxdt_out , time_type dt ) - { - const value_type a2 = static_cast<value_type> ( 1 ) / static_cast<value_type>( 5 ); - const value_type a3 = static_cast<value_type> ( 3 ) / static_cast<value_type> ( 10 ); - const value_type a4 = static_cast<value_type> ( 4 ) / static_cast<value_type> ( 5 ); - const value_type a5 = static_cast<value_type> ( 8 )/static_cast<value_type> ( 9 ); - - const value_type b21 = static_cast<value_type> ( 1 ) / static_cast<value_type> ( 5 ); - - const value_type b31 = static_cast<value_type> ( 3 ) / static_cast<value_type>( 40 ); - const value_type b32 = static_cast<value_type> ( 9 ) / static_cast<value_type>( 40 ); - - const value_type b41 = static_cast<value_type> ( 44 ) / static_cast<value_type> ( 45 ); - const value_type b42 = static_cast<value_type> ( -56 ) / static_cast<value_type> ( 15 ); - const value_type b43 = static_cast<value_type> ( 32 ) / static_cast<value_type> ( 9 ); - - const value_type b51 = static_cast<value_type> ( 19372 ) / static_cast<value_type>( 6561 ); - const value_type b52 = static_cast<value_type> ( -25360 ) / static_cast<value_type> ( 2187 ); - const value_type b53 = static_cast<value_type> ( 64448 ) / static_cast<value_type>( 6561 ); - const value_type b54 = static_cast<value_type> ( -212 ) / static_cast<value_type>( 729 ); - - const value_type b61 = static_cast<value_type> ( 9017 ) / static_cast<value_type>( 3168 ); - const value_type b62 = static_cast<value_type> ( -355 ) / static_cast<value_type>( 33 ); - const value_type b63 = static_cast<value_type> ( 46732 ) / static_cast<value_type>( 5247 ); - const value_type b64 = static_cast<value_type> ( 49 ) / static_cast<value_type>( 176 ); - const value_type b65 = static_cast<value_type> ( -5103 ) / static_cast<value_type>( 18656 ); - - const value_type c1 = static_cast<value_type> ( 35 ) / static_cast<value_type>( 384 ); - const value_type c3 = static_cast<value_type> ( 500 ) / static_cast<value_type>( 1113 ); - const value_type c4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 192 ); - const value_type c5 = static_cast<value_type> ( -2187 ) / static_cast<value_type>( 6784 ); - const value_type c6 = static_cast<value_type> ( 11 ) / static_cast<value_type>( 84 ); - - typename odeint::unwrap_reference< System >::type &sys = system; - - m_k_x_tmp_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_k_x_tmp_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); - - //m_x_tmp = x + dt*b21*dxdt - stepper_base_type::m_algebra.for_each3( m_x_tmp.m_v , in , dxdt_in , - typename operations_type::template scale_sum2< value_type , time_type >( 1.0 , dt*b21 ) ); - - sys( m_x_tmp.m_v , m_k2.m_v , t + dt*a2 ); - // m_x_tmp = x + dt*b31*dxdt + dt*b32*m_k2 - stepper_base_type::m_algebra.for_each4( m_x_tmp.m_v , in , dxdt_in , m_k2.m_v , - typename operations_type::template scale_sum3< value_type , time_type , time_type >( 1.0 , dt*b31 , dt*b32 )); - - sys( m_x_tmp.m_v , m_k3.m_v , t + dt*a3 ); - // m_x_tmp = x + dt * (b41*dxdt + b42*m_k2 + b43*m_k3) - stepper_base_type::m_algebra.for_each5( m_x_tmp.m_v , in , dxdt_in , m_k2.m_v , m_k3.m_v , - typename operations_type::template scale_sum4< value_type , time_type , time_type , time_type >( 1.0 , dt*b41 , dt*b42 , dt*b43 )); - - sys( m_x_tmp.m_v, m_k4.m_v , t + dt*a4 ); - stepper_base_type::m_algebra.for_each6( m_x_tmp.m_v , in , dxdt_in , m_k2.m_v , m_k3.m_v , m_k4.m_v , - typename operations_type::template scale_sum5< value_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b51 , dt*b52 , dt*b53 , dt*b54 )); - - sys( m_x_tmp.m_v , m_k5.m_v , t + dt*a5 ); - stepper_base_type::m_algebra.for_each7( m_x_tmp.m_v , in , dxdt_in , m_k2.m_v , m_k3.m_v , m_k4.m_v , m_k5.m_v , - typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*b61 , dt*b62 , dt*b63 , dt*b64 , dt*b65 )); - - sys( m_x_tmp.m_v , m_k6.m_v , t + dt ); - stepper_base_type::m_algebra.for_each7( out , in , dxdt_in , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v , - typename operations_type::template scale_sum6< value_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt*c1 , dt*c3 , dt*c4 , dt*c5 , dt*c6 )); - - // the new derivative - sys( out , dxdt_out , t + dt ); - } - - - - template< class System , class StateIn , class DerivIn , class StateOut , class DerivOut , class Err > - void do_step_impl( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , - StateOut &out , DerivOut &dxdt_out , time_type dt , Err &xerr ) - { - const value_type c1 = static_cast<value_type> ( 35 ) / static_cast<value_type>( 384 ); - const value_type c3 = static_cast<value_type> ( 500 ) / static_cast<value_type>( 1113 ); - const value_type c4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 192 ); - const value_type c5 = static_cast<value_type> ( -2187 ) / static_cast<value_type>( 6784 ); - const value_type c6 = static_cast<value_type> ( 11 ) / static_cast<value_type>( 84 ); - - const value_type dc1 = c1 - static_cast<value_type> ( 5179 ) / static_cast<value_type>( 57600 ); - const value_type dc3 = c3 - static_cast<value_type> ( 7571 ) / static_cast<value_type>( 16695 ); - const value_type dc4 = c4 - static_cast<value_type> ( 393 ) / static_cast<value_type>( 640 ); - const value_type dc5 = c5 - static_cast<value_type> ( -92097 ) / static_cast<value_type>( 339200 ); - const value_type dc6 = c6 - static_cast<value_type> ( 187 ) / static_cast<value_type>( 2100 ); - const value_type dc7 = static_cast<value_type>( -1 ) / static_cast<value_type> ( 40 ); - - /* ToDo: copy only if &dxdt_in == &dxdt_out ? */ - if( same_instance( dxdt_in , dxdt_out ) ) - { - m_dxdt_tmp_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_dxdt_tmp_impl<StateIn> , detail::ref( *this ) , detail::_1 ) ); - boost::numeric::odeint::copy( dxdt_in , m_dxdt_tmp.m_v ); - do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt ); - //error estimate - stepper_base_type::m_algebra.for_each7( xerr , m_dxdt_tmp.m_v , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v , dxdt_out , - typename operations_type::template scale_sum6< time_type , time_type , time_type , time_type , time_type , time_type >( dt*dc1 , dt*dc3 , dt*dc4 , dt*dc5 , dt*dc6 , dt*dc7 ) ); - - } - else - { - do_step_impl( system , in , dxdt_in , t , out , dxdt_out , dt ); - //error estimate - stepper_base_type::m_algebra.for_each7( xerr , dxdt_in , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v , dxdt_out , - typename operations_type::template scale_sum6< time_type , time_type , time_type , time_type , time_type , time_type >( dt*dc1 , dt*dc3 , dt*dc4 , dt*dc5 , dt*dc6 , dt*dc7 ) ); - - } - - } - - - /* - * Calculates Dense-Output for Dopri5 - * - * See Hairer, Norsett, Wanner: Solving Ordinary Differential Equations, Nonstiff Problems. I, p.191/192 - * - * y(t+theta) = y(t) + h * sum_i^7 b_i(theta) * k_i - * - * A = theta^2 * ( 3 - 2 theta ) - * B = theta^2 * ( theta - 1 ) - * C = theta^2 * ( theta - 1 )^2 - * D = theta * ( theta - 1 )^2 - * - * b_1( theta ) = A * b_1 - C * X1( theta ) + D - * b_2( theta ) = 0 - * b_3( theta ) = A * b_3 + C * X3( theta ) - * b_4( theta ) = A * b_4 - C * X4( theta ) - * b_5( theta ) = A * b_5 + C * X5( theta ) - * b_6( theta ) = A * b_6 - C * X6( theta ) - * b_7( theta ) = B + C * X7( theta ) - * - * An alternative Method is described in: - * - * www-m2.ma.tum.de/homepages/simeon/numerik3/kap3.ps - */ - template< class StateOut , class StateIn1 , class DerivIn1 , class StateIn2 , class DerivIn2 > - void calc_state( time_type t , StateOut &x , - const StateIn1 &x_old , const DerivIn1 &deriv_old , time_type t_old , - const StateIn2 & /* x_new */ , const DerivIn2 &deriv_new , time_type t_new ) const - { - const value_type b1 = static_cast<value_type> ( 35 ) / static_cast<value_type>( 384 ); - const value_type b3 = static_cast<value_type> ( 500 ) / static_cast<value_type>( 1113 ); - const value_type b4 = static_cast<value_type> ( 125 ) / static_cast<value_type>( 192 ); - const value_type b5 = static_cast<value_type> ( -2187 ) / static_cast<value_type>( 6784 ); - const value_type b6 = static_cast<value_type> ( 11 ) / static_cast<value_type>( 84 ); - - const time_type dt = ( t_new - t_old ); - const value_type theta = ( t - t_old ) / dt; - const value_type X1 = static_cast< value_type >( 5 ) * ( static_cast< value_type >( 2558722523LL ) - static_cast< value_type >( 31403016 ) * theta ) / static_cast< value_type >( 11282082432LL ); - const value_type X3 = static_cast< value_type >( 100 ) * ( static_cast< value_type >( 882725551 ) - static_cast< value_type >( 15701508 ) * theta ) / static_cast< value_type >( 32700410799LL ); - const value_type X4 = static_cast< value_type >( 25 ) * ( static_cast< value_type >( 443332067 ) - static_cast< value_type >( 31403016 ) * theta ) / static_cast< value_type >( 1880347072LL ) ; - const value_type X5 = static_cast< value_type >( 32805 ) * ( static_cast< value_type >( 23143187 ) - static_cast< value_type >( 3489224 ) * theta ) / static_cast< value_type >( 199316789632LL ); - const value_type X6 = static_cast< value_type >( 55 ) * ( static_cast< value_type >( 29972135 ) - static_cast< value_type >( 7076736 ) * theta ) / static_cast< value_type >( 822651844 ); - const value_type X7 = static_cast< value_type >( 10 ) * ( static_cast< value_type >( 7414447 ) - static_cast< value_type >( 829305 ) * theta ) / static_cast< value_type >( 29380423 ); - - const value_type theta_m_1 = theta - static_cast< value_type >( 1 ); - const value_type theta_sq = theta * theta; - const value_type A = theta_sq * ( static_cast< value_type >( 3 ) - static_cast< value_type >( 2 ) * theta ); - const value_type B = theta_sq * theta_m_1; - const value_type C = theta_sq * theta_m_1 * theta_m_1; - const value_type D = theta * theta_m_1 * theta_m_1; - - const value_type b1_theta = A * b1 - C * X1 + D; - const value_type b3_theta = A * b3 + C * X3; - const value_type b4_theta = A * b4 - C * X4; - const value_type b5_theta = A * b5 + C * X5; - const value_type b6_theta = A * b6 - C * X6; - const value_type b7_theta = B + C * X7; - - // const state_type &k1 = *m_old_deriv; - // const state_type &k3 = dopri5().m_k3; - // const state_type &k4 = dopri5().m_k4; - // const state_type &k5 = dopri5().m_k5; - // const state_type &k6 = dopri5().m_k6; - // const state_type &k7 = *m_current_deriv; - - stepper_base_type::m_algebra.for_each8( x , x_old , deriv_old , m_k3.m_v , m_k4.m_v , m_k5.m_v , m_k6.m_v , deriv_new , - typename operations_type::template scale_sum7< value_type , time_type , time_type , time_type , time_type , time_type , time_type >( 1.0 , dt * b1_theta , dt * b3_theta , dt * b4_theta , dt * b5_theta , dt * b6_theta , dt * b7_theta ) ); - } - - - template< class StateIn > - void adjust_size( const StateIn &x ) - { - resize_k_x_tmp_impl( x ); - resize_dxdt_tmp_impl( x ); - stepper_base_type::adjust_size( x ); - } - - -private: - - template< class StateIn > - bool resize_k_x_tmp_impl( const StateIn &x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_x_tmp , x , typename is_resizeable<state_type>::type() ); - resized |= adjust_size_by_resizeability( m_k2 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_k3 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_k4 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_k5 , x , typename is_resizeable<deriv_type>::type() ); - resized |= adjust_size_by_resizeability( m_k6 , x , typename is_resizeable<deriv_type>::type() ); - return resized; - } - - template< class StateIn > - bool resize_dxdt_tmp_impl( const StateIn &x ) - { - return adjust_size_by_resizeability( m_dxdt_tmp , x , typename is_resizeable<deriv_type>::type() ); - } - - - - wrapped_state_type m_x_tmp; - wrapped_deriv_type m_k2 , m_k3 , m_k4 , m_k5 , m_k6 ; - wrapped_deriv_type m_dxdt_tmp; - resizer_type m_k_x_tmp_resizer; - resizer_type m_dxdt_tmp_resizer; -}; - - - -/************* DOXYGEN ************/ -/** - * \class runge_kutta_dopri5 - * \brief The Runge-Kutta Dormand-Prince 5 method. - * - * The Runge-Kutta Dormand-Prince 5 method is a very popular method for solving ODEs, see - * <a href=""></a>. - * The method is explicit and fulfills the Error Stepper concept. Step size control - * is provided but continuous output is available which make this method favourable for many applications. - * - * This class derives from explicit_error_stepper_fsal_base and inherits its interface via CRTP (current recurring - * template pattern). The method possesses the FSAL (first-same-as-last) property. See - * explicit_error_stepper_fsal_base for more details. - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - - /** - * \fn runge_kutta_dopri5::runge_kutta_dopri5( const algebra_type &algebra ) - * \brief Constructs the runge_kutta_dopri5 class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - - /** - * \fn runge_kutta_dopri5::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , StateOut &out , DerivOut &dxdt_out , time_type dt ) - * \brief This method performs one step. The derivative `dxdt_in` of `in` at the time `t` is passed to the - * method. The result is updated out-of-place, hence the input is in `in` and the output in `out`. Furthermore, - * the derivative is update out-of-place, hence the input is assumed to be in `dxdt_in` and the output in - * `dxdt_out`. - * Access to this step functionality is provided by explicit_error_stepper_fsal_base and - * `do_step_impl` should not be called directly. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt_in The derivative of x at t. dxdt_in is not modified by this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dxdt_out The result of the new derivative at time t+dt. - * \param dt The step size. - */ - - /** - * \fn runge_kutta_dopri5::do_step_impl( System system , const StateIn &in , const DerivIn &dxdt_in , time_type t , StateOut &out , DerivOut &dxdt_out , time_type dt , Err &xerr ) - * \brief This method performs one step. The derivative `dxdt_in` of `in` at the time `t` is passed to the - * method. The result is updated out-of-place, hence the input is in `in` and the output in `out`. Furthermore, - * the derivative is update out-of-place, hence the input is assumed to be in `dxdt_in` and the output in - * `dxdt_out`. - * Access to this step functionality is provided by explicit_error_stepper_fsal_base and - * `do_step_impl` should not be called directly. - * An estimation of the error is calculated. - * - * \param system The system function to solve, hence the r.h.s. of the ODE. It must fulfill the - * Simple System concept. - * \param in The state of the ODE which should be solved. in is not modified in this method - * \param dxdt_in The derivative of x at t. dxdt_in is not modified by this method - * \param t The value of the time, at which the step should be performed. - * \param out The result of the step is written in out. - * \param dxdt_out The result of the new derivative at time t+dt. - * \param dt The step size. - * \param xerr An estimation of the error. - */ - - /** - * \fn runge_kutta_dopri5::calc_state( time_type t , StateOut &x , const StateIn1 &x_old , const DerivIn1 &deriv_old , time_type t_old , const StateIn2 & , const DerivIn2 &deriv_new , time_type t_new ) const - * \brief This method is used for continuous output and it calculates the state `x` at a time `t` from the - * knowledge of two states `old_state` and `current_state` at time points `t_old` and `t_new`. It also uses - * internal variables to calculate the result. Hence this method must be called after two successful `do_step` - * calls. - */ - - /** - * \fn runge_kutta_dopri5::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_DOPRI5_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp deleted file mode 100644 index f2f8251f25..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/runge_kutta_fehlberg78.hpp +++ /dev/null @@ -1,374 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/runge_kutta_fehlberg87.hpp - - [begin_description] - Implementation of the Runge-Kutta-Fehlberg stepper with the generic stepper. - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2012-2013 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED - - -#include <boost/fusion/container/vector.hpp> -#include <boost/fusion/container/generation/make_vector.hpp> - -#include <boost/numeric/odeint/stepper/explicit_error_generic_rk.hpp> -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/array.hpp> - -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> - - - - -namespace boost { -namespace numeric { -namespace odeint { - - -#ifndef DOXYGEN_SKIP -template< class Value = double > -struct rk78_coefficients_a1 : boost::array< Value , 1 > -{ - rk78_coefficients_a1( void ) - { - (*this)[0] = static_cast< Value >( 2 )/static_cast< Value >( 27 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a2 : boost::array< Value , 2 > -{ - rk78_coefficients_a2( void ) - { - (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 36 ); - (*this)[1] = static_cast< Value >( 1 )/static_cast< Value >( 12 ); - } -}; - - -template< class Value = double > -struct rk78_coefficients_a3 : boost::array< Value , 3 > -{ - rk78_coefficients_a3( void ) - { - (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 24 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 1 )/static_cast< Value >( 8 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a4 : boost::array< Value , 4 > -{ - rk78_coefficients_a4( void ) - { - (*this)[0] = static_cast< Value >( 5 )/static_cast< Value >( 12 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( -25 )/static_cast< Value >( 16 ); - (*this)[3] = static_cast< Value >( 25 )/static_cast< Value >( 16 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a5 : boost::array< Value , 5 > -{ - rk78_coefficients_a5( void ) - { - (*this)[0] = static_cast< Value >( 1 )/static_cast< Value >( 20 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( 1 )/static_cast< Value >( 4 ); - (*this)[4] = static_cast< Value >( 1 )/static_cast< Value >( 5 ); - } -}; - - -template< class Value = double > -struct rk78_coefficients_a6 : boost::array< Value , 6 > -{ - rk78_coefficients_a6( void ) - { - (*this)[0] = static_cast< Value >( -25 )/static_cast< Value >( 108 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( 125 )/static_cast< Value >( 108 ); - (*this)[4] = static_cast< Value >( -65 )/static_cast< Value >( 27 ); - (*this)[5] = static_cast< Value >( 125 )/static_cast< Value >( 54 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a7 : boost::array< Value , 7 > -{ - rk78_coefficients_a7( void ) - { - (*this)[0] = static_cast< Value >( 31 )/static_cast< Value >( 300 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( 0 ); - (*this)[4] = static_cast< Value >( 61 )/static_cast< Value >( 225 ); - (*this)[5] = static_cast< Value >( -2 )/static_cast< Value >( 9 ); - (*this)[6] = static_cast< Value >( 13 )/static_cast< Value >( 900 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a8 : boost::array< Value , 8 > -{ - rk78_coefficients_a8( void ) - { - (*this)[0] = static_cast< Value >( 2 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( -53 )/static_cast< Value >( 6 ); - (*this)[4] = static_cast< Value >( 704 )/static_cast< Value >( 45 ); - (*this)[5] = static_cast< Value >( -107 )/static_cast< Value >( 9 ); - (*this)[6] = static_cast< Value >( 67 )/static_cast< Value >( 90 ); - (*this)[7] = static_cast< Value >( 3 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a9 : boost::array< Value , 9 > -{ - rk78_coefficients_a9( void ) - { - (*this)[0] = static_cast< Value >( -91 )/static_cast< Value >( 108 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( 23 )/static_cast< Value >( 108 ); - (*this)[4] = static_cast< Value >( -976 )/static_cast< Value >( 135 ); - (*this)[5] = static_cast< Value >( 311 )/static_cast< Value >( 54 ); - (*this)[6] = static_cast< Value >( -19 )/static_cast< Value >( 60 ); - (*this)[7] = static_cast< Value >( 17 )/static_cast< Value >( 6 ); - (*this)[8] = static_cast< Value >( -1 )/static_cast< Value >( 12 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a10 : boost::array< Value , 10 > -{ - rk78_coefficients_a10( void ) - { - (*this)[0] = static_cast< Value >( 2383 )/static_cast< Value >( 4100 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( -341 )/static_cast< Value >( 164 ); - (*this)[4] = static_cast< Value >( 4496 )/static_cast< Value >( 1025 ); - (*this)[5] = static_cast< Value >( -301 )/static_cast< Value >( 82 ); - (*this)[6] = static_cast< Value >( 2133 )/static_cast< Value >( 4100 ); - (*this)[7] = static_cast< Value >( 45 )/static_cast< Value >( 82 ); - (*this)[8] = static_cast< Value >( 45 )/static_cast< Value >( 164 ); - (*this)[9] = static_cast< Value >( 18 )/static_cast< Value >( 41 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a11 : boost::array< Value , 11 > -{ - rk78_coefficients_a11( void ) - { - (*this)[0] = static_cast< Value >( 3 )/static_cast< Value >( 205 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( 0 ); - (*this)[4] = static_cast< Value >( 0 ); - (*this)[5] = static_cast< Value >( -6 )/static_cast< Value >( 41 ); - (*this)[6] = static_cast< Value >( -3 )/static_cast< Value >( 205 ); - (*this)[7] = static_cast< Value >( -3 )/static_cast< Value >( 41 ); - (*this)[8] = static_cast< Value >( 3 )/static_cast< Value >( 41 ); - (*this)[9] = static_cast< Value >( 6 )/static_cast< Value >( 41 ); - (*this)[10] = static_cast< Value >( 0 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_a12 : boost::array< Value , 12 > -{ - rk78_coefficients_a12( void ) - { - (*this)[0] = static_cast< Value >( -1777 )/static_cast< Value >( 4100 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( -341 )/static_cast< Value >( 164 ); - (*this)[4] = static_cast< Value >( 4496 )/static_cast< Value >( 1025 ); - (*this)[5] = static_cast< Value >( -289 )/static_cast< Value >( 82 ); - (*this)[6] = static_cast< Value >( 2193 )/static_cast< Value >( 4100 ); - (*this)[7] = static_cast< Value >( 51 )/static_cast< Value >( 82 ); - (*this)[8] = static_cast< Value >( 33 )/static_cast< Value >( 164 ); - (*this)[9] = static_cast< Value >( 12 )/static_cast< Value >( 41 ); - (*this)[10] = static_cast< Value >( 0 ); - (*this)[11] = static_cast< Value >( 1 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_b : boost::array< Value , 13 > -{ - rk78_coefficients_b( void ) - { - (*this)[0] = static_cast< Value >( 0 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( 0 ); - (*this)[4] = static_cast< Value >( 0 ); - (*this)[5] = static_cast< Value >( 34 )/static_cast<Value>( 105 ); - (*this)[6] = static_cast< Value >( 9 )/static_cast<Value>( 35 ); - (*this)[7] = static_cast< Value >( 9 )/static_cast<Value>( 35 ); - (*this)[8] = static_cast< Value >( 9 )/static_cast<Value>( 280 ); - (*this)[9] = static_cast< Value >( 9 )/static_cast<Value>( 280 ); - (*this)[10] = static_cast< Value >( 0 ); - (*this)[11] = static_cast< Value >( 41 )/static_cast<Value>( 840 ); - (*this)[12] = static_cast< Value >( 41 )/static_cast<Value>( 840 ); - } -}; - -template< class Value = double > -struct rk78_coefficients_db : boost::array< Value , 13 > -{ - rk78_coefficients_db( void ) - { - (*this)[0] = static_cast< Value >( 0 ) - static_cast< Value >( 41 )/static_cast<Value>( 840 ); - (*this)[1] = static_cast< Value >( 0 ); - (*this)[2] = static_cast< Value >( 0 ); - (*this)[3] = static_cast< Value >( 0 ); - (*this)[4] = static_cast< Value >( 0 ); - (*this)[5] = static_cast< Value >( 0 ); - (*this)[6] = static_cast< Value >( 0 ); - (*this)[7] = static_cast< Value >( 0 ); - (*this)[8] = static_cast< Value >( 0 ); - (*this)[9] = static_cast< Value >( 0 ); - (*this)[10] = static_cast< Value >( 0 ) - static_cast< Value >( 41 )/static_cast<Value>( 840 ); - (*this)[11] = static_cast< Value >( 41 )/static_cast<Value>( 840 ); - (*this)[12] = static_cast< Value >( 41 )/static_cast<Value>( 840 ); - } -}; - - -template< class Value = double > -struct rk78_coefficients_c : boost::array< Value , 13 > -{ - rk78_coefficients_c( void ) - { - (*this)[0] = static_cast< Value >( 0 ); - (*this)[1] = static_cast< Value >( 2 )/static_cast< Value >( 27 ); - (*this)[2] = static_cast< Value >( 1 )/static_cast< Value >( 9 ); - (*this)[3] = static_cast< Value >( 1 )/static_cast<Value>( 6 ); - (*this)[4] = static_cast< Value >( 5 )/static_cast<Value>( 12 ); - (*this)[5] = static_cast< Value >( 1 )/static_cast<Value>( 2 ); - (*this)[6] = static_cast< Value >( 5 )/static_cast<Value>( 6 ); - (*this)[7] = static_cast< Value >( 1 )/static_cast<Value>( 6 ); - (*this)[8] = static_cast< Value >( 2 )/static_cast<Value>( 3 ); - (*this)[9] = static_cast< Value >( 1 )/static_cast<Value>( 3 ); - (*this)[10] = static_cast< Value >( 1 ); - (*this)[11] = static_cast< Value >( 0 ); - (*this)[12] = static_cast< Value >( 1 ); - } -}; -#endif // DOXYGEN_SKIP - - - - - -template< -class State , -class Value = double , -class Deriv = State , -class Time = Value , -class Algebra = typename algebra_dispatcher< State >::algebra_type , -class Operations = typename operations_dispatcher< State >::operations_type , -class Resizer = initially_resizer -> -#ifndef DOXYGEN_SKIP -class runge_kutta_fehlberg78 : public explicit_error_generic_rk< 13 , 8 , 8 , 7 , State , Value , Deriv , Time , -Algebra , Operations , Resizer > -#else -class runge_kutta_fehlberg78 : public explicit_error_generic_rk -#endif -{ - -public: -#ifndef DOXYGEN_SKIP - typedef explicit_error_generic_rk< 13 , 8 , 8 , 7 , State , Value , Deriv , Time , - Algebra , Operations , Resizer > stepper_base_type; -#endif - typedef typename stepper_base_type::state_type state_type; - typedef typename stepper_base_type::value_type value_type; - typedef typename stepper_base_type::deriv_type deriv_type; - typedef typename stepper_base_type::time_type time_type; - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::operations_type operations_type; - typedef typename stepper_base_type::resizer_type resizer_type; - - #ifndef DOXYGEN_SKIP - typedef typename stepper_base_type::stepper_type stepper_type; - typedef typename stepper_base_type::wrapped_state_type wrapped_state_type; - typedef typename stepper_base_type::wrapped_deriv_type wrapped_deriv_type; - #endif // DOXYGEN_SKIP - - - runge_kutta_fehlberg78( const algebra_type &algebra = algebra_type() ) : stepper_base_type( - boost::fusion::make_vector( rk78_coefficients_a1<Value>() , rk78_coefficients_a2<Value>() , rk78_coefficients_a3<Value>() , - rk78_coefficients_a4<Value>() , rk78_coefficients_a5<Value>() , rk78_coefficients_a6<Value>() , - rk78_coefficients_a7<Value>() , rk78_coefficients_a8<Value>() , rk78_coefficients_a9<Value>() , - rk78_coefficients_a10<Value>() , rk78_coefficients_a11<Value>() , rk78_coefficients_a12<Value>() ) , - rk78_coefficients_b<Value>() , rk78_coefficients_db<Value>() , rk78_coefficients_c<Value>() , algebra ) - { } -}; - - - -/************* DOXYGEN *************/ - -/** - * \class runge_kutta_fehlberg78 - * \brief The Runge-Kutta Fehlberg 78 method. - * - * The Runge-Kutta Fehlberg 78 method is a standard method for high-precision applications. - * The method is explicit and fulfills the Error Stepper concept. Step size control - * is provided but continuous output is not available for this method. - * - * This class derives from explicit_error_stepper_base and inherits its interface via CRTP (current recurring template pattern). - * Furthermore, it derivs from explicit_error_generic_rk which is a generic Runge-Kutta algorithm with error estimation. - * For more details see explicit_error_stepper_base and explicit_error_generic_rk. - * - * \tparam State The state type. - * \tparam Value The value type. - * \tparam Deriv The type representing the time derivative of the state. - * \tparam Time The time representing the independent variable - the time. - * \tparam Algebra The algebra type. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - - /** - * \fn runge_kutta_fehlberg78::runge_kutta_fehlberg78( const algebra_type &algebra ) - * \brief Constructs the runge_kutta_cash_fehlberg78 class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - -} -} -} - -#endif //BOOST_NUMERIC_ODEINT_STEPPER_RUNGE_KUTTA_FEHLBERG87_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/stepper_categories.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/stepper_categories.hpp deleted file mode 100644 index 9bc5372344..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/stepper_categories.hpp +++ /dev/null @@ -1,68 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/stepper_categories.hpp - - [begin_description] - Definition of all stepper categories. - [end_description] - - Copyright 2010-2011 Mario Mulansky - Copyright 2010-2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_STEPPER_CATEGORIES_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_STEPPER_CATEGORIES_HPP_INCLUDED - -#include <boost/type_traits/integral_constant.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -/* - * Tags to specify stepper types - * - * These tags are used by integrate() to choose which integration method is used - */ - -struct stepper_tag {}; -// struct explicit_stepper_tag : stepper_tag {}; -// struct implicit_stepper_tag : stepper_tag {}; - - -struct error_stepper_tag : stepper_tag {}; -struct explicit_error_stepper_tag : error_stepper_tag {}; -struct explicit_error_stepper_fsal_tag : error_stepper_tag {}; - -struct controlled_stepper_tag {}; -struct explicit_controlled_stepper_tag : controlled_stepper_tag {}; -struct explicit_controlled_stepper_fsal_tag : controlled_stepper_tag {}; - -struct dense_output_stepper_tag {}; - - -template< class tag > struct base_tag ; -template< > struct base_tag< stepper_tag > { typedef stepper_tag type; }; -template< > struct base_tag< error_stepper_tag > { typedef stepper_tag type; }; -template< > struct base_tag< explicit_error_stepper_tag > { typedef stepper_tag type; }; -template< > struct base_tag< explicit_error_stepper_fsal_tag > { typedef stepper_tag type; }; - -template< > struct base_tag< controlled_stepper_tag > { typedef controlled_stepper_tag type; }; -template< > struct base_tag< explicit_controlled_stepper_tag > { typedef controlled_stepper_tag type; }; -template< > struct base_tag< explicit_controlled_stepper_fsal_tag > { typedef controlled_stepper_tag type; }; - -template< > struct base_tag< dense_output_stepper_tag > { typedef dense_output_stepper_tag type; }; - - -} // odeint -} // numeric -} // boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_STEPPER_CATEGORIES_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_euler.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_euler.hpp deleted file mode 100644 index bd40860b0b..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_euler.hpp +++ /dev/null @@ -1,136 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/symplectic_euler.hpp - - [begin_description] - Implementation of the symplectic Euler for separable Hamiltonian systems. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED - - -#include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp> - -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/array.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -#ifndef DOXYGEN_SKIP -namespace detail { -namespace symplectic_euler_coef { - -template< class Value > -struct coef_a_type : public boost::array< Value , 1 > -{ - coef_a_type( void ) - { - (*this)[0] = static_cast< Value >( 1 ); - } -}; - -template< class Value > -struct coef_b_type : public boost::array< Value , 1 > -{ - coef_b_type( void ) - { - (*this)[0] = static_cast< Value >( 1 ); - } -}; - -} // namespace symplectic_euler_coef -} // namespace detail -#endif - - - -template< -class Coor , -class Momentum = Coor , -class Value = double , -class CoorDeriv = Coor , -class MomentumDeriv = Coor , -class Time = Value , -class Algebra = typename algebra_dispatcher< Coor >::algebra_type , -class Operations = typename operations_dispatcher< Coor >::operations_type , -class Resizer = initially_resizer -> -#ifndef DOXYGEN_SKIP -class symplectic_euler : -public symplectic_nystroem_stepper_base -< -1 , 1 , -Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer -> -#else -class symplectic_euler : public symplectic_nystroem_stepper_base -#endif -{ -public: - -#ifndef DOXYGEN_SKIP - typedef symplectic_nystroem_stepper_base< - 1 , 1 , Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > stepper_base_type; -#endif - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::value_type value_type; - - - symplectic_euler( const algebra_type &algebra = algebra_type() ) - : stepper_base_type( detail::symplectic_euler_coef::coef_a_type< value_type >() , - detail::symplectic_euler_coef::coef_b_type< value_type >() , - algebra ) - { } -}; - - -/*************** DOXYGEN ***************/ - -/** - * \class symplectic_euler - * \brief Implementation of the symplectic Euler method. - * - * The method is of first order and has one stage. It is described HERE. - * - * \tparam Order The order of the stepper. - * \tparam Coor The type representing the coordinates q. - * \tparam Momentum The type representing the coordinates p. - * \tparam Value The basic value type. Should be something like float, double or a high-precision type. - * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt. - * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt. - * \tparam Time The type representing the time t. - * \tparam Algebra The algebra. - * \tparam Operations The operations. - * \tparam Resizer The resizer policy. - */ - - /** - * \fn symplectic_euler::symplectic_euler( const algebra_type &algebra ) - * \brief Constructs the symplectic_euler. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp deleted file mode 100644 index b33773e2f7..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp +++ /dev/null @@ -1,160 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/symplectic_rkn_sb3a_m4_mclachlan.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2012-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_M4_MCLACHLAN_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_M4_MCLACHLAN_HPP_DEFINED - -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/resizer.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -#ifndef DOXYGEN_SKIP -namespace detail { -namespace symplectic_rkn_sb3a_m4_mclachlan { - - /* - exp( a1 t A ) exp( b1 t B ) - exp( a2 t A ) exp( b2 t B ) - exp( a3 t A ) - exp( b2 t B ) exp( a2 t A ) - exp( b1 t B ) exp( a1 t A ) - */ - - - - template< class Value > - struct coef_a_type : public boost::array< Value , 5 > - { - coef_a_type( void ) - { - using std::sqrt; - - Value z = sqrt( static_cast< Value >( 7 ) / static_cast< Value >( 8 ) ) / static_cast< Value >( 3 ); - (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ) - z ; - (*this)[1] = static_cast< Value >( -1 ) / static_cast< Value >( 3 ) + z ; - (*this)[2] = static_cast< Value >( 2 ) / static_cast< Value >( 3 ); - (*this)[3] = (*this)[1]; - (*this)[4] = (*this)[0]; - } - }; - - template< class Value > - struct coef_b_type : public boost::array< Value , 5 > - { - coef_b_type( void ) - { - (*this)[0] = static_cast< Value >( 1 ); - (*this)[1] = static_cast< Value >( -1 ) / static_cast< Value >( 2 ); - (*this)[2] = (*this)[1]; - (*this)[3] = (*this)[0]; - (*this)[4] = static_cast< Value >( 0 ); - } - }; - -} // namespace symplectic_rkn_sb3a_m4_mclachlan -} // namespace detail -#endif // DOXYGEN_SKIP - - - - -template< - class Coor , - class Momentum = Coor , - class Value = double , - class CoorDeriv = Coor , - class MomentumDeriv = Coor , - class Time = Value , - class Algebra = typename algebra_dispatcher< Coor >::algebra_type , - class Operations = typename operations_dispatcher< Coor >::operations_type , - class Resizer = initially_resizer - > -#ifndef DOXYGEN_SKIP -class symplectic_rkn_sb3a_m4_mclachlan : - public symplectic_nystroem_stepper_base -< - 5 , 4 , - Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer - > -#else -class symplectic_rkn_sb3a_m4_mclachlan : public symplectic_nystroem_stepper_base -#endif -{ -public: -#ifndef DOXYGEN_SKIP - typedef symplectic_nystroem_stepper_base - < - 5 , 4 , - Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer - > stepper_base_type; -#endif - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::value_type value_type; - - - symplectic_rkn_sb3a_m4_mclachlan( const algebra_type &algebra = algebra_type() ) - : stepper_base_type( - detail::symplectic_rkn_sb3a_m4_mclachlan::coef_a_type< value_type >() , - detail::symplectic_rkn_sb3a_m4_mclachlan::coef_b_type< value_type >() , - algebra ) - { } -}; - - -/***************** DOXYGEN ***************/ - -/** - * \class symplectic_rkn_sb3a_m4_mclachlan - * \brief Implementation of the symmetric B3A Runge-Kutta Nystroem method of fifth order. - * - * The method is of fourth order and has five stages. It is described HERE. This method can be used - * with multiprecision types since the coefficients are defined analytically. - * - * ToDo: add reference to paper. - * - * \tparam Order The order of the stepper. - * \tparam Coor The type representing the coordinates q. - * \tparam Momentum The type representing the coordinates p. - * \tparam Value The basic value type. Should be something like float, double or a high-precision type. - * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt. - * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt. - * \tparam Time The type representing the time t. - * \tparam Algebra The algebra. - * \tparam Operations The operations. - * \tparam Resizer The resizer policy. - */ - - /** - * \fn symplectic_rkn_sb3a_m4_mclachlan::symplectic_rkn_sb3a_m4_mclachlan( const algebra_type &algebra ) - * \brief Constructs the symplectic_rkn_sb3a_m4_mclachlan. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_M4_MCLACHLAN_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp deleted file mode 100644 index d75c53534a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/symplectic_rkn_sb3a_mclachlan.hpp - - [begin_description] - Implementation of the symplectic MacLachlan stepper for separable Hamiltonian system. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED - - -#include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp> - -#include <boost/numeric/odeint/algebra/range_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> - -#include <boost/numeric/odeint/util/resizer.hpp> - -#include <boost/array.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -#ifndef DOXYGEN_SKIP -namespace detail { -namespace symplectic_rkn_sb3a_mclachlan { - - /* - exp( a1 t A ) exp( b1 t B ) - exp( a2 t A ) exp( b2 t B ) - exp( a3 t A ) exp( b3 t B ) exp( a3 t A ) - exp( b2 t B ) exp( a2 t A ) - exp( b1 t B ) exp( a1 t A ) - */ - - template< class Value > - struct coef_a_type : public boost::array< Value , 6 > - { - coef_a_type( void ) - { - (*this)[0] = static_cast< Value >( 0.40518861839525227722 ); - (*this)[1] = static_cast< Value >( -0.28714404081652408900 ); - (*this)[2] = static_cast< Value >( 1 ) / static_cast< Value >( 2 ) - ( (*this)[0] + (*this)[1] ); - (*this)[3] = (*this)[2]; - (*this)[4] = (*this)[1]; - (*this)[5] = (*this)[0]; - - } - }; - - template< class Value > - struct coef_b_type : public boost::array< Value , 6 > - { - coef_b_type( void ) - { - (*this)[0] = static_cast< Value >( -3 ) / static_cast< Value >( 73 ); - (*this)[1] = static_cast< Value >( 17 ) / static_cast< Value >( 59 ); - (*this)[2] = static_cast< Value >( 1 ) - static_cast< Value >( 2 ) * ( (*this)[0] + (*this)[1] ); - (*this)[3] = (*this)[1]; - (*this)[4] = (*this)[0]; - (*this)[5] = static_cast< Value >( 0 ); - } - }; - -} // namespace symplectic_rkn_sb3a_mclachlan -} // namespace detail -#endif // DOXYGEN_SKIP - - - -template< - class Coor , - class Momentum = Coor , - class Value = double , - class CoorDeriv = Coor , - class MomentumDeriv = Coor , - class Time = Value , - class Algebra = typename algebra_dispatcher< Coor >::algebra_type , - class Operations = typename operations_dispatcher< Coor >::operations_type , - class Resizer = initially_resizer - > -#ifndef DOXYGEN_SKIP -class symplectic_rkn_sb3a_mclachlan : - public symplectic_nystroem_stepper_base -< - 6 , 4 , - Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer - > -#else -class symplectic_rkn_sb3a_mclachlan : public symplectic_nystroem_stepper_base -#endif -{ -public: -#ifndef DOXYGEN_SKIP - typedef symplectic_nystroem_stepper_base - < - 6 , 4 , - Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer - > stepper_base_type; -#endif - typedef typename stepper_base_type::algebra_type algebra_type; - typedef typename stepper_base_type::value_type value_type; - - - symplectic_rkn_sb3a_mclachlan( const algebra_type &algebra = algebra_type() ) - : stepper_base_type( - detail::symplectic_rkn_sb3a_mclachlan::coef_a_type< value_type >() , - detail::symplectic_rkn_sb3a_mclachlan::coef_b_type< value_type >() , - algebra ) - { } -}; - - -/************* DOXYGEN ***********/ - -/** - * \class symplectic_rkn_sb3a_mclachlan - * \brief Implement of the symmetric B3A method of Runge-Kutta-Nystroem method of sixth order. - * - * The method is of fourth order and has six stages. It is described HERE. This method cannot be used - * with multiprecision types since the coefficients are not defined analytically. - * - * ToDo Add reference to the paper. - * - * \tparam Order The order of the stepper. - * \tparam Coor The type representing the coordinates q. - * \tparam Momentum The type representing the coordinates p. - * \tparam Value The basic value type. Should be something like float, double or a high-precision type. - * \tparam CoorDeriv The type representing the time derivative of the coordinate dq/dt. - * \tparam MomemtnumDeriv The type representing the time derivative of the momentum dp/dt. - * \tparam Time The type representing the time t. - * \tparam Algebra The algebra. - * \tparam Operations The operations. - * \tparam Resizer The resizer policy. - */ - - /** - * \fn symplectic_rkn_sb3a_mclachlan::symplectic_rkn_sb3a_mclachlan( const algebra_type &algebra ) - * \brief Constructs the symplectic_rkn_sb3a_mclachlan. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored inside explicit_stepper_base. - */ - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_RKN_SB3A_MCLACHLAN_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/stepper/velocity_verlet.hpp b/contrib/restricted/boost/boost/numeric/odeint/stepper/velocity_verlet.hpp deleted file mode 100644 index 3a20fc25c9..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/stepper/velocity_verlet.hpp +++ /dev/null @@ -1,381 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/stepper/velocity_verlet.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_STEPPER_VELOCITY_VERLET_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_STEPPER_VELOCITY_VERLET_HPP_DEFINED - -#include <boost/numeric/odeint/stepper/base/algebra_stepper_base.hpp> -#include <boost/numeric/odeint/stepper/stepper_categories.hpp> - -#include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp> -#include <boost/numeric/odeint/algebra/operations_dispatcher.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -#include <boost/numeric/odeint/util/state_wrapper.hpp> -#include <boost/numeric/odeint/util/unwrap_reference.hpp> - -#include <boost/numeric/odeint/util/bind.hpp> -#include <boost/numeric/odeint/util/copy.hpp> -#include <boost/numeric/odeint/util/resizer.hpp> -// #include <boost/numeric/odeint/util/is_pair.hpp> -// #include <boost/array.hpp> - - - -namespace boost { -namespace numeric { -namespace odeint { - - - -template < - class Coor , - class Velocity = Coor , - class Value = double , - class Acceleration = Coor , - class Time = Value , - class TimeSq = Time , - class Algebra = typename algebra_dispatcher< Coor >::algebra_type , - class Operations = typename operations_dispatcher< Coor >::operations_type , - class Resizer = initially_resizer - > -class velocity_verlet : public algebra_stepper_base< Algebra , Operations > -{ -public: - - typedef algebra_stepper_base< Algebra , Operations > algebra_stepper_base_type; - typedef typename algebra_stepper_base_type::algebra_type algebra_type; - typedef typename algebra_stepper_base_type::operations_type operations_type; - - typedef Coor coor_type; - typedef Velocity velocity_type; - typedef Acceleration acceleration_type; - typedef std::pair< coor_type , velocity_type > state_type; - typedef std::pair< velocity_type , acceleration_type > deriv_type; - typedef state_wrapper< acceleration_type > wrapped_acceleration_type; - typedef Value value_type; - typedef Time time_type; - typedef TimeSq time_square_type; - typedef Resizer resizer_type; - typedef stepper_tag stepper_category; - - typedef unsigned short order_type; - - static const order_type order_value = 1; - - /** - * \return Returns the order of the stepper. - */ - order_type order( void ) const - { - return order_value; - } - - - velocity_verlet( const algebra_type & algebra = algebra_type() ) - : algebra_stepper_base_type( algebra ) , m_first_call( true ) - , m_a1() , m_a2() , m_current_a1( true ) { } - - - template< class System , class StateInOut > - void do_step( System system , StateInOut & x , time_type t , time_type dt ) - { - do_step_v1( system , x , t , dt ); - } - - - template< class System , class StateInOut > - void do_step( System system , const StateInOut & x , time_type t , time_type dt ) - { - do_step_v1( system , x , t , dt ); - } - - - template< class System , class CoorIn , class VelocityIn , class AccelerationIn , - class CoorOut , class VelocityOut , class AccelerationOut > - void do_step( System system , CoorIn const & qin , VelocityIn const & pin , AccelerationIn const & ain , - CoorOut & qout , VelocityOut & pout , AccelerationOut & aout , time_type t , time_type dt ) - { - const value_type one = static_cast< value_type >( 1.0 ); - const value_type one_half = static_cast< value_type >( 0.5 ); - - algebra_stepper_base_type::m_algebra.for_each4( - qout , qin , pin , ain , - typename operations_type::template scale_sum3< value_type , time_type , time_square_type >( one , one * dt , one_half * dt * dt ) ); - - typename odeint::unwrap_reference< System >::type & sys = system; - - sys( qout , pin , aout , t + dt ); - - algebra_stepper_base_type::m_algebra.for_each4( - pout , pin , ain , aout , - typename operations_type::template scale_sum3< value_type , time_type , time_type >( one , one_half * dt , one_half * dt ) ); - } - - - template< class StateIn > - void adjust_size( const StateIn & x ) - { - if( resize_impl( x ) ) - m_first_call = true; - } - - void reset( void ) - { - m_first_call = true; - } - - - /** - * \fn velocity_verlet::initialize( const AccelerationIn &qin ) - * \brief Initializes the internal state of the stepper. - * \param deriv The acceleration of x. The next call of `do_step` expects that the acceleration of `x` passed to `do_step` - * has the value of `qin`. - */ - template< class AccelerationIn > - void initialize( const AccelerationIn & ain ) - { - // alloc a - m_resizer.adjust_size( ain , - detail::bind( &velocity_verlet::template resize_impl< AccelerationIn > , - detail::ref( *this ) , detail::_1 ) ); - boost::numeric::odeint::copy( ain , get_current_acc() ); - m_first_call = false; - } - - - template< class System , class CoorIn , class VelocityIn > - void initialize( System system , const CoorIn & qin , const VelocityIn & pin , time_type t ) - { - m_resizer.adjust_size( qin , - detail::bind( &velocity_verlet::template resize_impl< CoorIn > , - detail::ref( *this ) , detail::_1 ) ); - initialize_acc( system , qin , pin , t ); - } - - bool is_initialized( void ) const - { - return ! m_first_call; - } - - -private: - - template< class System , class CoorIn , class VelocityIn > - void initialize_acc( System system , const CoorIn & qin , const VelocityIn & pin , time_type t ) - { - typename odeint::unwrap_reference< System >::type & sys = system; - sys( qin , pin , get_current_acc() , t ); - m_first_call = false; - } - - template< class System , class StateInOut > - void do_step_v1( System system , StateInOut & x , time_type t , time_type dt ) - { - typedef typename odeint::unwrap_reference< StateInOut >::type state_in_type; - typedef typename odeint::unwrap_reference< typename state_in_type::first_type >::type coor_in_type; - typedef typename odeint::unwrap_reference< typename state_in_type::second_type >::type momentum_in_type; - - typedef typename boost::remove_reference< coor_in_type >::type xyz_type; - state_in_type & statein = x; - coor_in_type & qinout = statein.first; - momentum_in_type & pinout = statein.second; - - // alloc a - if( m_resizer.adjust_size( qinout , - detail::bind( &velocity_verlet::template resize_impl< xyz_type > , - detail::ref( *this ) , detail::_1 ) ) - || m_first_call ) - { - initialize_acc( system , qinout , pinout , t ); - } - - // check first - do_step( system , qinout , pinout , get_current_acc() , qinout , pinout , get_old_acc() , t , dt ); - toggle_current_acc(); - } - - template< class StateIn > - bool resize_impl( const StateIn & x ) - { - bool resized = false; - resized |= adjust_size_by_resizeability( m_a1 , x , typename is_resizeable< acceleration_type >::type() ); - resized |= adjust_size_by_resizeability( m_a2 , x , typename is_resizeable< acceleration_type >::type() ); - return resized; - } - - acceleration_type & get_current_acc( void ) - { - return m_current_a1 ? m_a1.m_v : m_a2.m_v ; - } - - const acceleration_type & get_current_acc( void ) const - { - return m_current_a1 ? m_a1.m_v : m_a2.m_v ; - } - - acceleration_type & get_old_acc( void ) - { - return m_current_a1 ? m_a2.m_v : m_a1.m_v ; - } - - const acceleration_type & get_old_acc( void ) const - { - return m_current_a1 ? m_a2.m_v : m_a1.m_v ; - } - - void toggle_current_acc( void ) - { - m_current_a1 = ! m_current_a1; - } - - resizer_type m_resizer; - bool m_first_call; - wrapped_acceleration_type m_a1 , m_a2; - bool m_current_a1; -}; - -/** - * \class velocity_verlet - * \brief The Velocity-Verlet algorithm. - * - * <a href="http://en.wikipedia.org/wiki/Verlet_integration" >The Velocity-Verlet algorithm</a> is a method for simulation of molecular dynamics systems. It solves the ODE - * a=f(r,v',t) where r are the coordinates, v are the velocities and a are the accelerations, hence v = dr/dt, a=dv/dt. - * - * \tparam Coor The type representing the coordinates. - * \tparam Velocity The type representing the velocities. - * \tparam Value The type value type. - * \tparam Acceleration The type representing the acceleration. - * \tparam Time The time representing the independent variable - the time. - * \tparam TimeSq The time representing the square of the time. - * \tparam Algebra The algebra. - * \tparam Operations The operations type. - * \tparam Resizer The resizer policy type. - */ - - - /** - * \fn velocity_verlet::velocity_verlet( const algebra_type &algebra ) - * \brief Constructs the velocity_verlet class. This constructor can be used as a default - * constructor if the algebra has a default constructor. - * \param algebra A copy of algebra is made and stored. - */ - - - /** - * \fn velocity_verlet::do_step( System system , StateInOut &x , time_type t , time_type dt ) - * \brief This method performs one step. It transforms the result in-place. - * - * It can be used like - * \code - * pair< coordinates , velocities > state; - * stepper.do_step( sys , x , t , dt ); - * \endcode - * - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Second Order System concept. - * \param x The state of the ODE which should be solved. The state is pair of Coor and Velocity. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - /** - * \fn velocity_verlet::do_step( System system , const StateInOut &x , time_type t , time_type dt ) - * \brief This method performs one step. It transforms the result in-place. - * - * It can be used like - * \code - * pair< coordinates , velocities > state; - * stepper.do_step( sys , x , t , dt ); - * \endcode - * - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Second Order System concept. - * \param x The state of the ODE which should be solved. The state is pair of Coor and Velocity. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - - - /** - * \fn velocity_verlet::do_step( System system , CoorIn const & qin , VelocityIn const & pin , AccelerationIn const & ain , CoorOut & qout , VelocityOut & pout , AccelerationOut & aout , time_type t , time_type dt ) - * \brief This method performs one step. It transforms the result in-place. Additionally to the other methods - * the coordinates, velocities and accelerations are passed directly to do_step and they are transformed out-of-place. - * - * It can be used like - * \code - * coordinates qin , qout; - * velocities pin , pout; - * accelerations ain, aout; - * stepper.do_step( sys , qin , pin , ain , qout , pout , aout , t , dt ); - * \endcode - * - * \param system The system function to solve, hence the r.h.s. of the ordinary differential equation. It must fulfill the - * Second Order System concept. - * \param x The state of the ODE which should be solved. The state is pair of Coor and Velocity. - * \param t The value of the time, at which the step should be performed. - * \param dt The step size. - */ - - - /** - * \fn void velocity_verlet::adjust_size( const StateIn &x ) - * \brief Adjust the size of all temporaries in the stepper manually. - * \param x A state from which the size of the temporaries to be resized is deduced. - */ - - - /** - * \fn velocity_verlet::reset( void ) - * \brief Resets the internal state of this stepper. After calling this method it is safe to use all - * `do_step` method without explicitly initializing the stepper. - */ - - - - /** - * \fn velocity_verlet::initialize( System system , const CoorIn &qin , const VelocityIn &pin , time_type t ) - * \brief Initializes the internal state of the stepper. - * - * This method is equivalent to - * \code - * Acceleration a; - * system( qin , pin , a , t ); - * stepper.initialize( a ); - * \endcode - * - * \param system The system function for the next calls of `do_step`. - * \param qin The current coordinates of the ODE. - * \param pin The current velocities of the ODE. - * \param t The current time of the ODE. - */ - - - /** - * \fn velocity_verlet::is_initialized() - * \returns Returns if the stepper is initialized. - */ - - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_STEPPER_VELOCITY_VERLET_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/bind.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/bind.hpp deleted file mode 100644 index 1201afab84..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/bind.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * [begin_description] - * Boost bind pull the placeholders, _1, _2, ... into global - * namespace. This can conflict with the C++03 TR1 and C++11 - * std::placeholders. This header provides a workaround for - * this problem. - * [end_description] - * - * Copyright 2012 Christoph Koke - * Copyright 2012 Karsten Ahnert - * - * Distributed under the Boost Software License, Version 1.0. - * (See accompanying file LICENSE_1_0.txt or - * copy at http://www.boost.org/LICENSE_1_0.txt) - * */ - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED - - -#include <boost/numeric/odeint/config.hpp> - - -#if BOOST_NUMERIC_ODEINT_CXX11 - #include <functional> -#else -#define BOOST_BIND_NO_PLACEHOLDERS -#include <boost/bind.hpp> -#endif - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -#if BOOST_NUMERIC_ODEINT_CXX11 - -using ::std::bind; -using namespace ::std::placeholders; - - -#else - -// unnamed namespace to avoid multiple declarations (#138) -namespace { -using ::boost::bind; -boost::arg<1> _1; -boost::arg<2> _2; -} -// using ::boost::bind; -// using ::_1; -// using ::_2; - -#endif - -} -} -} -} - - - - - -/* - -// the following is the suggested way. Unfortunately it does not work with all compilers. - -#ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL -#include <boost/bind.hpp> -#else -#include <functional> -#endif - - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - - -#ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL - -using ::boost::bind; -using ::_1; -using ::_2; - -#else - -using ::std::bind; -using namespace ::std::placeholders; - -#endif - - -} -} -} -}*/ - -#endif // BOOST_NUMERIC_ODEINT_UTIL_BIND_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/copy.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/copy.hpp deleted file mode 100644 index 161f135534..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/copy.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/copy.hpp - - [begin_description] - Copy abstraction for the usage in the steppers. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED - - -#include <boost/range/algorithm/copy.hpp> - -#include <boost/utility/enable_if.hpp> - -#include <boost/numeric/odeint/util/detail/is_range.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -namespace detail { - - template< class Container1 , class Container2 > - void do_copying( const Container1 &from , Container2 &to , boost::mpl::true_ ) - { - boost::range::copy( from , boost::begin( to ) ); - } - - template< class Container1 , class Container2 > - void do_copying( const Container1 &from , Container2 &to , boost::mpl::false_ ) - { - to = from; - } - -} // namespace detail - - - -/* - * Default implementation of the copy operation used the assign operator - * gsl_vector must copied differently - */ -template< class Container1 , class Container2 , class Enabler = void > -struct copy_impl_sfinae -{ - static void copy( const Container1 &from , Container2 &to ) - { - typedef typename boost::numeric::odeint::detail::is_range< Container1 >::type is_range_type; - detail::do_copying( from , to , is_range_type() ); - } - -}; - -template< class Container1, class Container2 > -struct copy_impl -{ - static void copy( const Container1 &from , Container2 &to ) - { - copy_impl_sfinae< Container1 , Container2 >::copy( from , to ); - } -}; - -// ToDo: allow also to copy INTO a range, not only from a range! Needs "const Container2 &to" -template< class Container1 , class Container2 > -void copy( const Container1 &from , Container2 &to ) -{ - copy_impl< Container1 , Container2 >::copy( from , to ); -} - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/detail/is_range.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/detail/is_range.hpp deleted file mode 100644 index a176855411..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/detail/is_range.hpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/detail/is_range.hpp - - [begin_description] - is_range implementation. Taken from the boost::range library. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011-2013 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) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED - - -#if defined(_MSC_VER) && (_MSC_VER >= 1200) -# pragma once -#endif - -#include <cstddef> -#include <boost/range/config.hpp> -#include <boost/mpl/has_xxx.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/and.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - - -namespace range_detail -{ -BOOST_MPL_HAS_XXX_TRAIT_DEF(iterator) - BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator) -} - -namespace detail -{ - -template< typename Range > -struct is_range : boost::mpl::and_<range_detail::has_iterator<Range>, range_detail::has_const_iterator<Range> > -{ -}; - -////////////////////////////////////////////////////////////////////////// -// pair -////////////////////////////////////////////////////////////////////////// - -template< typename iteratorT > -struct is_range< std::pair<iteratorT,iteratorT> > : boost::mpl::true_ -{ -}; - -template< typename iteratorT > -struct is_range< const std::pair<iteratorT,iteratorT> > : boost::mpl::true_ -{ -}; - -////////////////////////////////////////////////////////////////////////// -// array -////////////////////////////////////////////////////////////////////////// - -template< typename elementT, std::size_t sz > -struct is_range< elementT[sz] > : boost::mpl::true_ -{ -}; - -template< typename elementT, std::size_t sz > -struct is_range< const elementT[sz] > : boost::mpl::true_ -{ -}; - -////////////////////////////////////////////////////////////////////////// -// string -////////////////////////////////////////////////////////////////////////// - -template<> -struct is_range< char* > : boost::mpl::true_ -{ -}; - -template<> -struct is_range< wchar_t* > : boost::mpl::true_ -{ -}; - -template<> -struct is_range< const char* > : boost::mpl::true_ -{ -}; - -template<> -struct is_range< const wchar_t* > : boost::mpl::true_ -{ -}; - -template<> -struct is_range< char* const > : boost::mpl::true_ -{ -}; - -template<> -struct is_range< wchar_t* const > : boost::mpl::true_ -{ -}; - -template<> -struct is_range< const char* const > : boost::mpl::true_ -{ -}; - -template<> -struct is_range< const wchar_t* const > : boost::mpl::true_ -{ -}; - -} // namespace detail - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_DETAIL_IS_RANGE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/detail/less_with_sign.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/detail/less_with_sign.hpp deleted file mode 100644 index 3ffa7ca179..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/detail/less_with_sign.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/detail/less_with_sign.hpp - - [begin_description] - Helper function to compare times taking into account the sign of dt - [end_description] - - Copyright 2012-2015 Mario Mulansky - Copyright 2012 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_LESS_WITH_SIGN_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_LESS_WITH_SIGN_HPP_INCLUDED - -#include <limits> - -#include <boost/numeric/odeint/util/unit_helper.hpp> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -/** - * return t1 < t2 if dt > 0 and t1 > t2 if dt < 0 with epsilon accuracy - */ -template< typename T > -bool less_with_sign( T t1 , T t2 , T dt ) -{ - if( get_unit_value(dt) > 0 ) - //return t1 < t2; - return t2-t1 > std::numeric_limits<T>::epsilon(); - else - //return t1 > t2; - return t1-t2 > std::numeric_limits<T>::epsilon(); -} - -/** - * return t1 <= t2 if dt > 0 and t1 => t2 if dt < 0 with epsilon accuracy - */ -template< typename T > -bool less_eq_with_sign( T t1 , T t2 , T dt ) -{ - if( get_unit_value(dt) > 0 ) - return t1-t2 <= std::numeric_limits<T>::epsilon(); - else - return t2-t1 <= std::numeric_limits<T>::epsilon(); -} - -template< typename T > -T min_abs( T t1 , T t2 ) -{ - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - if( get_unit_value(t1)>0 ) - return min BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); - else - return max BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); -} - -template< typename T > -T max_abs( T t1 , T t2 ) -{ - BOOST_USING_STD_MIN(); - BOOST_USING_STD_MAX(); - if( get_unit_value(t1)>0 ) - return max BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); - else - return min BOOST_PREVENT_MACRO_SUBSTITUTION ( t1 , t2 ); -} -} } } } - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/is_pair.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/is_pair.hpp deleted file mode 100644 index 1827840fe2..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/is_pair.hpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/is_pair.hpp - - [begin_description] - Metafunction to determine if a type is a std::pair<>. - [end_description] - - Copyright 2011 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED - - -#include <boost/mpl/bool.hpp> -#include <utility> - - -namespace boost { -namespace numeric { -namespace odeint { - -template< class T > -struct is_pair : public boost::mpl::false_ -{ -}; - -template< class T1 , class T2 > -struct is_pair< std::pair< T1 , T2 > > : public boost::mpl::true_ -{ -}; - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_IS_PAIR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/is_resizeable.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/is_resizeable.hpp deleted file mode 100644 index ad7332dcad..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/is_resizeable.hpp +++ /dev/null @@ -1,83 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/is_resizeable.hpp - - [begin_description] - Metafunction to determine if a state type can resized. For usage in the steppers. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED - - -#include <vector> - -#include <boost/type_traits/integral_constant.hpp> -#include <boost/type_traits/remove_reference.hpp> -#include <boost/fusion/include/front.hpp> -#include <boost/fusion/include/is_sequence.hpp> - -#include <boost/mpl/find_if.hpp> -#include <boost/mpl/end.hpp> -#include <boost/mpl/placeholders.hpp> -#include <boost/mpl/if.hpp> -#include <boost/type_traits/is_same.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -/* - * by default any type is not resizable - */ -template< typename Container , typename Enabler = void > -struct is_resizeable_sfinae : boost::false_type {}; - -template< typename Container > -struct is_resizeable : is_resizeable_sfinae< Container > {}; - - - -/* - * specialization for std::vector - */ -template< class V, class A > -struct is_resizeable< std::vector< V , A > > : boost::true_type {}; - - -/* - * sfinae specialization for fusion sequences - */ -template< typename FusionSequence > -struct is_resizeable_sfinae< - FusionSequence , - typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSequence >::type >::type > -{ - typedef typename boost::mpl::find_if< FusionSequence , is_resizeable< boost::mpl::_1 > >::type iter; - typedef typename boost::mpl::end< FusionSequence >::type last; - - typedef typename boost::mpl::if_< boost::is_same< iter , last > , boost::false_type , boost::true_type >::type type; - const static bool value = type::value; -}; - - - - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_IS_RESIZEABLE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/multi_array_adaption.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/multi_array_adaption.hpp deleted file mode 100644 index e2c0a4836d..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/multi_array_adaption.hpp +++ /dev/null @@ -1,130 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/multi_array_adaption.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2009-2012 Karsten Ahnert - Copyright 2009-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_MULTI_ARRAY_ADAPTION_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_UTIL_MULTI_ARRAY_ADAPTION_HPP_DEFINED - - - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> - -#include <boost/mpl/and.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/multi_array.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -template< typename T > -struct is_multi_array -{ - typedef boost::false_type type; - const static bool value = type::value; -}; - -template< typename T > -struct is_resizeable_multi_array -{ - typedef boost::false_type type; - const static bool value = type::value; -}; - - - -template< typename V , size_t Dim , typename A > -struct is_multi_array< boost::multi_array< V , Dim , A > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - -template< typename V , size_t Dim , typename A > -struct is_resizeable_multi_array< boost::multi_array< V , Dim , A > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - - - - -template< typename T > -struct is_resizeable_sfinae< T , typename boost::enable_if< typename is_resizeable_multi_array< T >::type >::type > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - - - - - -template< typename T1 , typename T2 > -struct same_size_impl_sfinae< T1 , T2 , - typename boost::enable_if< - typename boost::mpl::and_< - is_multi_array< T1 > , - is_multi_array< T2 > , - boost::mpl::bool_< T1::dimensionality == T2::dimensionality > - >::type - >::type > -{ - static bool same_size( T1 const &x1 , T2 const &x2 ) - { - for( size_t i=0 ; i<T1::dimensionality ; ++i ) - { - if( x1.shape()[i] != x2.shape()[i] ) return false; - if( x1.index_bases()[i] != x2.index_bases()[i] ) return false; - } - return true; - } -}; - - -template< typename T1 , typename T2 > -struct resize_impl_sfinae< T1 , T2 , - typename boost::enable_if< - typename boost::mpl::and_< - is_resizeable_multi_array< T1 > , - is_multi_array< T2 > , - boost::mpl::bool_< T1::dimensionality == T2::dimensionality > - >::type - >::type > -{ - static void resize( T1 &x1 , const T2 &x2 ) - { - boost::array< int , T1::dimensionality > extents; - for( size_t i=0 ; i<T1::dimensionality ; ++i ) extents[i] = x2.shape()[i]; - x1.resize( extents ); - boost::array< int , T1::dimensionality > origins; - for( size_t i=0 ; i<T1::dimensionality ; ++i ) origins[i] = x2.index_bases()[i]; - x1.reindex( origins ); - } -}; - - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_MULTI_ARRAY_ADAPTION_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/n_ary_helper.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/n_ary_helper.hpp deleted file mode 100644 index 6138074207..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/n_ary_helper.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/n_ary_helper.hpp - - Macros to generate scale_sumN and for_eachN functors. - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_N_ARY_HELPER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_N_ARY_HELPER_HPP_INCLUDED - -#include <boost/preprocessor/repetition.hpp> - -// like BOOST_PP_ENUM_SHIFTED but with a comma in front like _TRAILING -#define BOOST_ODEINT_ENUM_TRAILING_SHIFTED_PARAMS(count, param) \ - BOOST_PP_COMMA_IF(BOOST_PP_DEC(count)) \ - BOOST_PP_ENUM_SHIFTED_PARAMS(count, param) - -#define BOOST_ODEINT_ENUM_TRAILING_SHIFTED_BINARY_PARAMS(count, p1, p2) \ - BOOST_PP_COMMA_IF(BOOST_PP_DEC(count)) \ - BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(count, p1, p2) - -// like BOOST_PP_ENUM_SHIFTED_BINARY_PARAMS(n, p1, p2) but p2 is shifted left. -// generate "p1 ## 0 = p2, p1 ## 1 = p3 ## 0, p1 ## 2 = p3 ## 1" -#define BOOST_ODEINT_ENUM_LSHIFTED_BINARY_PARAMS(count, p1, p2, p3) \ - BOOST_PP_ENUM(count, BOOST_ODEINT_ENUM_LSHIFTED_BINARY_PARAMS_, (p1, p2, p3)) -#define BOOST_ODEINT_ENUM_LSHIFTED_BINARY_PARAMS_(z, n, data) \ - BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, data), n) \ - BOOST_PP_IF(n, \ - BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 2, data), BOOST_PP_DEC(n)), \ - BOOST_PP_TUPLE_ELEM(3, 1, data)) - -// like BOOST_PP_ENUM_BINARY_PARAMS(n, p1, p2) but with statements. -// "p1 ## 0 p2 ## 0 ; p1 ## 1 p2 ## 1 ; ..." -#define BOOST_ODEINT_ENUM_BINARY_STATEMENTS(count, p1, p2) \ - BOOST_PP_REPEAT(count, BOOST_ODEINT_ENUM_BINARY_STATEMENTS_, (p1, p2)) -#define BOOST_ODEINT_ENUM_BINARY_STATEMENTS_(z, n, data) \ - BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, data), n) \ - BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, data), n) ; - -// like BOOST_PP_ENUM_BINARY_PARAMS(n, p1, p2) but p2 is in parens. -// "p1 ## 0 (p2 ## 0) , p1 ## 1 (p2 ## 1) , ..." -#define BOOST_ODEINT_ENUM_UNARY_CALLS(count, p1, p2) \ - BOOST_PP_ENUM(count, BOOST_ODEINT_ENUM_UNARY_CALLS_, (p1, p2)) -#define BOOST_ODEINT_ENUM_SHIFTED_UNARY_CALLS(count, p1, p2) \ - BOOST_PP_ENUM_SHIFTED(count, BOOST_ODEINT_ENUM_UNARY_CALLS_, (p1, p2)) -#define BOOST_ODEINT_ENUM_TRAILING_SHIFTED_UNARY_CALLS(count, p1, p2) \ - BOOST_PP_COMMA_IF(BOOST_PP_DEC(count)) \ - BOOST_PP_ENUM_SHIFTED(count, BOOST_ODEINT_ENUM_UNARY_CALLS_, (p1, p2)) -#define BOOST_ODEINT_ENUM_UNARY_CALLS_(z, n, data) \ - BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, data), n) \ - ( BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, data), n) ) - - -// maximum arity + 1 for scale_sum and for_each -#define BOOST_ODEINT_N_ARY_MAX 16 - - -// generate scale_sum1 to scale_sumN, operator body generated by macro(N) -#define BOOST_ODEINT_GEN_SCALE_SUM(macro) \ - BOOST_PP_REPEAT_FROM_TO(1, BOOST_ODEINT_N_ARY_MAX, BOOST_ODEINT_GEN_SCALE_SUM_, macro) -#define BOOST_ODEINT_GEN_SCALE_SUM_(z, n, macro) \ - template< BOOST_ODEINT_ENUM_LSHIFTED_BINARY_PARAMS(n, class Fac, = double, = Fac) > \ - struct BOOST_PP_CAT(scale_sum, n) \ - { \ - BOOST_ODEINT_ENUM_BINARY_STATEMENTS(n, const Fac, m_alpha) \ - \ - BOOST_PP_CAT(scale_sum, n) \ - ( BOOST_PP_ENUM_BINARY_PARAMS(n, Fac, alpha) ) \ - : BOOST_ODEINT_ENUM_UNARY_CALLS(n, m_alpha, alpha) {} \ - \ - template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), class T) > \ - void operator()( T0 &t0 \ - BOOST_ODEINT_ENUM_TRAILING_SHIFTED_BINARY_PARAMS(BOOST_PP_INC(n), const T, &t) \ - ) const \ - { macro(n) } \ - typedef void result_type; \ - }; - -// generate for_each1 to for_eachN, body generated by macro(N) -#define BOOST_ODEINT_GEN_FOR_EACH(macro) \ - BOOST_PP_REPEAT_FROM_TO(1, BOOST_ODEINT_N_ARY_MAX, BOOST_ODEINT_GEN_FOR_EACH_, macro) -#define BOOST_ODEINT_GEN_FOR_EACH_(z, n, macro) \ - template< BOOST_PP_ENUM_PARAMS(n, class S) , class Op > \ - static void for_each##n ( BOOST_PP_ENUM_BINARY_PARAMS(n, S, &s) , Op op ) \ - { macro(n) } - - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/odeint_error.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/odeint_error.hpp deleted file mode 100644 index 312e5b1afa..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/odeint_error.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/odeint_error.hpp - - [begin_description] - Runtime Exceptions thrown by odeint - [end_description] - - Copyright 2015 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED - -#include <stdexcept> -#include <string> - - -namespace boost { -namespace numeric { -namespace odeint { - - -/** - * \brief Runtime error thrown by odeint - */ -class odeint_error : public std::runtime_error -{ -public: - odeint_error(const std::string &s) - : std::runtime_error(s) - { } -}; - - -/** - * \brief Runtime error thrown from integrate routines - * - * This Error occures when too many iterations are performed in between two - * observer calls in the integrate routines. - */ -class no_progress_error : public odeint_error -{ -public: - no_progress_error(const std::string &s) - : odeint_error(s) - { } -}; - - -/** - * \brief Runtime error thrown during stepsize adjustment - * - * This Error occures when too many iterations are performed without finding - * an appropriate new step size. This usually indicates non-continuous points - * in the ODE. - */ -class step_adjustment_error : public odeint_error -{ -public: - step_adjustment_error(const std::string &s) - : odeint_error(s) - { } -}; - -} -} -} - - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_ODEINT_ERROR_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/resize.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/resize.hpp deleted file mode 100644 index 3645782aee..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/resize.hpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/state_wrapper.hpp - - [begin_description] - State wrapper for the state type in all stepper. The state wrappers are responsible for construction, - destruction, copying construction, assignment and resizing. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_RESIZE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_RESIZE_HPP_INCLUDED - -#include <boost/range.hpp> - -#include <boost/utility/enable_if.hpp> -#include <boost/fusion/include/is_sequence.hpp> -#include <boost/fusion/include/zip_view.hpp> -#include <boost/fusion/include/vector.hpp> -#include <boost/fusion/include/make_fused.hpp> -#include <boost/fusion/include/for_each.hpp> - -#include <boost/numeric/odeint/util/is_resizeable.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - - -template< class StateOut , class StateIn , class Enabler = void > -struct resize_impl_sfinae -{ - static void resize( StateOut &x1 , const StateIn &x2 ) - { - x1.resize( boost::size( x2 ) ); - } -}; - -// resize function -// standard implementation relies on boost.range and resize member function -template< class StateOut , class StateIn > -struct resize_impl -{ - static void resize( StateOut &x1 , const StateIn &x2 ) - { - resize_impl_sfinae< StateOut , StateIn >::resize( x1 , x2 ); - } -}; - - -// do not overload or specialize this function, specialize resize_impl<> instead -template< class StateOut , class StateIn > -void resize( StateOut &x1 , const StateIn &x2 ) -{ - resize_impl< StateOut , StateIn >::resize( x1 , x2 ); -} - - -namespace detail { - - struct resizer - { - typedef void result_type; - - template< class StateOut , class StateIn > - void operator()( StateOut &x1 , const StateIn &x2 ) const - { - resize_op( x1 , x2 , typename is_resizeable< StateOut >::type() ); - } - - template< class StateOut , class StateIn > - void resize_op( StateOut &x1 , const StateIn &x2 , boost::true_type ) const - { - resize( x1 , x2 ); - } - - template< class StateOut , class StateIn > - void resize_op( StateOut &/*x1*/ , const StateIn &/*x2*/ , boost::false_type ) const - { - } - - }; -} // namespace detail - - -/* - * specialization for fusion sequences - */ -template< class FusionSeq > -struct resize_impl_sfinae< FusionSeq , FusionSeq , - typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSeq >::type >::type > -{ - static void resize( FusionSeq &x1 , const FusionSeq &x2 ) - { - typedef boost::fusion::vector< FusionSeq& , const FusionSeq& > Sequences; - Sequences sequences( x1 , x2 ); - boost::fusion::for_each( boost::fusion::zip_view< Sequences >( sequences ) , boost::fusion::make_fused( detail::resizer() ) ); - } -}; - - - - -} -} -} - - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_RESIZE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/resizer.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/resizer.hpp deleted file mode 100644 index cd27990bda..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/resizer.hpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/resizer.hpp - - [begin_description] - Implementation of the resizers. - [end_description] - - Copyright 2011-2012 Mario Mulansky - Copyright 2011 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_RESIZER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_RESIZER_HPP_INCLUDED - - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> -#include <boost/numeric/odeint/util/resize.hpp> - -namespace boost { -namespace numeric { -namespace odeint { - -template< class ResizeWrappedState , class State > -bool adjust_size_by_resizeability( ResizeWrappedState &x , const State &y , boost::true_type ) -{ - if ( !same_size( x.m_v , y ) ) - { - resize( x.m_v , y ); - return true; - } - else - return false; -} - -template< class ResizeWrappedState , class State > -bool adjust_size_by_resizeability( ResizeWrappedState & /* x */ , const State & /* y */ , boost::false_type ) -{ - return false; -} - -struct always_resizer -{ - template< class State , class ResizeFunction > - bool adjust_size( const State &x , ResizeFunction f ) - { - return f( x ); - } -}; - - -struct initially_resizer -{ - - bool m_initialized; - - initially_resizer() : m_initialized( false ) - { } - - template< class State , class ResizeFunction > - bool adjust_size( const State &x , ResizeFunction f ) - { - if( !m_initialized ) - { - m_initialized = true; - return f( x ); - } else - return false; - } -}; - - -struct never_resizer -{ - template< class State , class ResizeFunction > - bool adjust_size( const State &/*x*/ , ResizeFunction /*f*/ ) - { - return false; - } -}; - - -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_UTIL_RESIZER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/same_instance.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/same_instance.hpp deleted file mode 100644 index a889ee1925..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/same_instance.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/same_instance.hpp - - [begin_description] - Basic check if two variables are the same instance - [end_description] - - Copyright 2012 Karsten Ahnert - Copyright 2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_SAME_INSTANCE_HPP_INCLUDED - -namespace boost { -namespace numeric { -namespace odeint { - -template< class T1 , class T2 , class Enabler=void > -struct same_instance_impl -{ - static bool same_instance( const T1& /* x1 */ , const T2& /* x2 */ ) - { - return false; - } -}; - -template< class T > -struct same_instance_impl< T , T > -{ - static bool same_instance( const T &x1 , const T &x2 ) - { - // check pointers - return (&x1 == &x2); - } -}; - - -template< class T1 , class T2 > -bool same_instance( const T1 &x1 , const T2 &x2 ) -{ - return same_instance_impl< T1 , T2 >::same_instance( x1 , x2 ); -} - - -} // namespace odeint -} // namespace numeric -} // namespace boost - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/same_size.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/same_size.hpp deleted file mode 100644 index 81ae249d1f..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/same_size.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/state_wrapper.hpp - - [begin_description] - State wrapper for the state type in all stepper. The state wrappers are responsible for construction, - destruction, copying construction, assignment and resizing. - [end_description] - - Copyright 2011-2013 Karsten Ahnert - Copyright 2011 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_SAME_SIZE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_SAME_SIZE_HPP_INCLUDED - -#include <boost/numeric/odeint/util/is_resizeable.hpp> - -#include <boost/utility/enable_if.hpp> -#include <boost/fusion/include/is_sequence.hpp> -#include <boost/fusion/include/zip_view.hpp> -#include <boost/fusion/include/vector.hpp> -#include <boost/fusion/include/make_fused.hpp> -#include <boost/fusion/include/all.hpp> - -#include <boost/range.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - -template< typename State1 , typename State2 , class Enabler = void > -struct same_size_impl_sfinae -{ - static bool same_size( const State1 &x1 , const State2 &x2 ) - { - return ( boost::size( x1 ) == boost::size( x2 ) ); - } - -}; - -// same_size function -// standard implementation relies on boost.range -template< class State1 , class State2 > -struct same_size_impl -{ - static bool same_size( const State1 &x1 , const State2 &x2 ) - { - return same_size_impl_sfinae< State1 , State2 >::same_size( x1 , x2 ); - } -}; - - -// do not overload or specialize this function, specialize resize_impl<> instead -template< class State1 , class State2 > -bool same_size( const State1 &x1 , const State2 &x2 ) -{ - return same_size_impl< State1 , State2 >::same_size( x1 , x2 ); -} - -namespace detail { - -struct same_size_fusion -{ - typedef bool result_type; - - template< class S1 , class S2 > - bool operator()( const S1 &x1 , const S2 &x2 ) const - { - return same_size_op( x1 , x2 , typename is_resizeable< S1 >::type() ); - } - - template< class S1 , class S2 > - bool same_size_op( const S1 &x1 , const S2 &x2 , boost::true_type ) const - { - return same_size( x1 , x2 ); - } - - template< class S1 , class S2 > - bool same_size_op( const S1 &/*x1*/ , const S2 &/*x2*/ , boost::false_type ) const - { - return true; - } -}; - -} // namespace detail - - - -template< class FusionSeq > -struct same_size_impl_sfinae< FusionSeq , FusionSeq , typename boost::enable_if< typename boost::fusion::traits::is_sequence< FusionSeq >::type >::type > -{ - static bool same_size( const FusionSeq &x1 , const FusionSeq &x2 ) - { - typedef boost::fusion::vector< const FusionSeq& , const FusionSeq& > Sequences; - Sequences sequences( x1 , x2 ); - return boost::fusion::all( boost::fusion::zip_view< Sequences >( sequences ) , - boost::fusion::make_fused( detail::same_size_fusion() ) ); - } -}; - - -} -} -} - - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_SAME_SIZE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/split.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/split.hpp deleted file mode 100644 index ba9875a49a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/split.hpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/split.hpp - - [begin_description] - Split abstraction for parallel backends. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_SPLIT_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_SPLIT_HPP_INCLUDED - -namespace boost { -namespace numeric { -namespace odeint { - -/* - * No default implementation of the split operation - */ -template< class Container1, class Container2 , class Enabler = void > -struct split_impl -{ - static void split( const Container1 &from , Container2 &to ); -}; - -template< class Container1 , class Container2 > -void split( const Container1 &from , Container2 &to ) -{ - split_impl< Container1 , Container2 >::split( from , to ); -} - - -/* - * No default implementation of the unsplit operation - */ -template< class Container1, class Container2 , class Enabler = void > -struct unsplit_impl -{ - static void unsplit( const Container1 &from , Container2 &to ); -}; - -template< class Container1 , class Container2 > -void unsplit( const Container1 &from , Container2 &to ) -{ - unsplit_impl< Container1 , Container2 >::unsplit( from , to ); -} - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_COPY_HPP_INCLUDED - diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/split_adaptor.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/split_adaptor.hpp deleted file mode 100644 index cf0d623814..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/split_adaptor.hpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/split_adaptor.hpp - - [begin_description] - A range adaptor which returns even-sized slices. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - Copyright 2013 Pascal Germroth - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_SPLIT_ADAPTOR_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_SPLIT_ADAPTOR_INCLUDED - -#include <boost/range/adaptor/argument_fwd.hpp> -#include <boost/range/size_type.hpp> -#include <boost/range/iterator_range.hpp> -#include <algorithm> - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - -/** \brief Returns the begin and end offset for a sub-range */ -inline std::pair<std::size_t, std::size_t> -split_offsets( std::size_t total_length, std::size_t index, std::size_t parts ) -{ - BOOST_ASSERT( parts > 0 ); - BOOST_ASSERT( index < parts ); - const std::size_t - slice = total_length / parts, - partial = total_length % parts, - lo = (std::min)(index, partial), - hi = (std::max<std::ptrdiff_t>)(0, index - partial), - begin_offset = lo * (slice + 1) + hi * slice, - length = slice + (index < partial ? 1 : 0), - end_offset = begin_offset + length; - return std::make_pair( begin_offset, end_offset ); -} - -/** \brief Return the sub-range `index` from a range which is split into `parts`. - * - * For example, splitting a range into three about equal-sized sub-ranges: - * \code - * sub0 = make_split_range(rng, 0, 3); - * sub1 = rng | split(1, 3); - * sub2 = rng | split(2, 3); - * \endcode - */ -template< class RandomAccessRange > -inline iterator_range< typename range_iterator<RandomAccessRange>::type > -make_split_range( RandomAccessRange& rng, std::size_t index, std::size_t parts ) -{ - const std::pair<std::size_t, std::size_t> off = split_offsets(boost::size(rng), index, parts); - return make_iterator_range( boost::begin(rng) + off.first, boost::begin(rng) + off.second ); -} - -template< class RandomAccessRange > -inline iterator_range< typename range_iterator<const RandomAccessRange>::type > -make_split_range( const RandomAccessRange& rng, std::size_t index, std::size_t parts ) -{ - const std::pair<std::size_t, std::size_t> off = split_offsets(boost::size(rng), index, parts); - return make_iterator_range( boost::begin(rng) + off.first, boost::begin(rng) + off.second ); -} - - -struct split -{ - split(std::size_t index, std::size_t parts) - : index(index), parts(parts) {} - std::size_t index, parts; -}; - -template< class RandomAccessRange > -inline iterator_range< typename range_iterator<RandomAccessRange>::type > -operator|( RandomAccessRange& rng, const split& f ) -{ - return make_split_range( rng, f.index, f.parts ); -} - -template< class RandomAccessRange > -inline iterator_range< typename range_iterator<const RandomAccessRange>::type > -operator|( const RandomAccessRange& rng, const split& f ) -{ - return make_split_range( rng, f.index, f.parts ); -} - - -} -} -} -} - -#endif diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/state_wrapper.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/state_wrapper.hpp deleted file mode 100644 index 10f8ecde31..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/state_wrapper.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/state_wrapper.hpp - - [begin_description] - State wrapper for the state type in all stepper. The state wrappers are responsible for construction, - destruction, copying construction, assignment and resizing. - [end_description] - - Copyright 2011-2012 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED - - -#include <boost/type_traits/integral_constant.hpp> - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/resize.hpp> -#include <boost/numeric/odeint/util/same_size.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { - - -template< class V , class Enabler = void > -struct state_wrapper -{ - typedef state_wrapper< V > state_wrapper_type; - - V m_v; -}; - - -} -} -} - - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_STATE_WRAPPER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/stepper_traits.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/stepper_traits.hpp deleted file mode 100644 index 5d1d31ae6a..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/stepper_traits.hpp +++ /dev/null @@ -1,63 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/stepper_traits.hpp - - [begin_description] - tba. - [end_description] - - Copyright 2013 Karsten Ahnert - Copyright 2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED -#define BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED - -#include <boost/numeric/odeint/util/unwrap_reference.hpp> - - -namespace boost { -namespace numeric { -namespace odeint { -namespace traits { - -template< class Stepper > -struct state_type -{ - typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename stepper_type::state_type type; -}; - -template< class Stepper > -struct time_type -{ - typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename stepper_type::time_type type; -}; - -template< class Stepper > -struct stepper_category -{ - typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename stepper_type::stepper_category type; -}; - -template< class Stepper > -struct value_type -{ - typedef typename boost::numeric::odeint::unwrap_reference< Stepper >::type stepper_type; - typedef typename stepper_type::value_type type; -}; - -} // namespace traits -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_STEPPER_TRAITS_HPP_DEFINED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/ublas_wrapper.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/ublas_wrapper.hpp deleted file mode 100644 index c8facfc46b..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/ublas_wrapper.hpp +++ /dev/null @@ -1,297 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/ublas_wrapper.hpp - - [begin_description] - Resizing for ublas::vector and ublas::matrix - [end_description] - - Copyright 2011-2013 Mario Mulansky - Copyright 2011-2013 Karsten Ahnert - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED - - -#include <boost/type_traits/integral_constant.hpp> -#include <boost/numeric/ublas/vector.hpp> -#include <boost/numeric/ublas/matrix.hpp> -#include <boost/numeric/ublas/lu.hpp> -#include <boost/numeric/ublas/vector_expression.hpp> -#include <boost/numeric/ublas/matrix_expression.hpp> - -#include <boost/numeric/odeint/algebra/vector_space_algebra.hpp> -#include <boost/numeric/odeint/algebra/default_operations.hpp> - -#include <boost/numeric/odeint/util/is_resizeable.hpp> -#include <boost/numeric/odeint/util/state_wrapper.hpp> - - -/* extend ublas by a few operations */ - -/* map norm_inf onto reduce( v , default_operations::maximum ) */ -namespace boost { namespace numeric { namespace odeint { - - template< typename T , typename A > - struct vector_space_norm_inf< boost::numeric::ublas::vector<T,A> > - { - typedef T result_type; - - result_type operator()( const boost::numeric::ublas::vector<T,A> &x ) const - { - return boost::numeric::ublas::norm_inf( x ); - } - }; - - - template< class T , class L , class A > - struct vector_space_norm_inf< boost::numeric::ublas::matrix<T,L,A> > - { - typedef T result_type; - - result_type operator()( const boost::numeric::ublas::matrix<T,L,A> &x ) const - { - return boost::numeric::ublas::norm_inf( x ); - } - }; -} } } - -/* additional operations: - * abs( v ) - * v / w - * a + v - */ -namespace boost { namespace numeric { namespace ublas { - - - // elementwise abs - calculates absolute values of the elements - template<class T> - struct scalar_abs: public scalar_unary_functor<T> { - typedef typename scalar_unary_functor<T>::value_type value_type; - typedef typename scalar_unary_functor<T>::argument_type argument_type; - typedef typename scalar_unary_functor<T>::result_type result_type; - - static BOOST_UBLAS_INLINE - result_type apply (argument_type t) { - using std::abs; - return abs (t); - } - }; - - - // (abs v) [i] = abs (v [i]) - template<class E> - BOOST_UBLAS_INLINE - typename vector_unary_traits<E, scalar_abs<typename E::value_type> >::result_type - abs (const vector_expression<E> &e) { - typedef typename vector_unary_traits<E, scalar_abs<typename E::value_type> >::expression_type expression_type; - return expression_type (e ()); - } - - // (abs m) [i] = abs (m [i]) - template<class E> - BOOST_UBLAS_INLINE - typename matrix_unary1_traits<E, scalar_abs<typename E::value_type> >::result_type - abs (const matrix_expression<E> &e) { - typedef typename matrix_unary1_traits<E, scalar_abs<typename E::value_type> >::expression_type expression_type; - return expression_type (e ()); - } - - - // elementwise division (v1 / v2) [i] = v1 [i] / v2 [i] - template<class E1, class E2> - BOOST_UBLAS_INLINE - typename vector_binary_traits<E1, E2, scalar_divides<typename E1::value_type, - typename E2::value_type> >::result_type - operator / (const vector_expression<E1> &e1, - const vector_expression<E2> &e2) { - typedef typename vector_binary_traits<E1, E2, scalar_divides<typename E1::value_type, - typename E2::value_type> >::expression_type expression_type; - return expression_type (e1 (), e2 ()); - } - - - // elementwise division (m1 / m2) [i] = m1 [i] / m2 [i] - template<class E1, class E2> - BOOST_UBLAS_INLINE - typename matrix_binary_traits<E1, E2, scalar_divides<typename E1::value_type, - typename E2::value_type> >::result_type - operator / (const matrix_expression<E1> &e1, - const matrix_expression<E2> &e2) { - typedef typename matrix_binary_traits<E1, E2, scalar_divides<typename E1::value_type, - typename E2::value_type> >::expression_type expression_type; - return expression_type (e1 (), e2 ()); - } - - // addition with scalar - // (t + v) [i] = t + v [i] - template<class T1, class E2> - BOOST_UBLAS_INLINE - typename enable_if< is_convertible<T1, typename E2::value_type >, - typename vector_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::result_type - >::type - operator + (const T1 &e1, - const vector_expression<E2> &e2) { - typedef typename vector_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::expression_type expression_type; - return expression_type (e1, e2 ()); - } - - // addition with scalar - // (t + m) [i] = t + m [i] - template<class T1, class E2> - BOOST_UBLAS_INLINE - typename enable_if< is_convertible<T1, typename E2::value_type >, - typename matrix_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::result_type - >::type - operator + (const T1 &e1, - const matrix_expression<E2> &e2) { - typedef typename matrix_binary_scalar1_traits<const T1, E2, scalar_plus<T1, typename E2::value_type> >::expression_type expression_type; - return expression_type (e1, e2 ()); - } - -} } } - - - - -/* add resize functionality */ -namespace boost { -namespace numeric { -namespace odeint { - -/* - * resizeable specialization for boost::numeric::ublas::vector - */ -template< class T , class A > -struct is_resizeable< boost::numeric::ublas::vector< T , A > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - - -/* - * resizeable specialization for boost::numeric::ublas::matrix - */ -template< class T , class L , class A > -struct is_resizeable< boost::numeric::ublas::matrix< T , L , A > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - - -/* - * resizeable specialization for boost::numeric::ublas::permutation_matrix - */ -template< class T , class A > -struct is_resizeable< boost::numeric::ublas::permutation_matrix< T , A > > -{ - typedef boost::true_type type; - const static bool value = type::value; -}; - - -// specialization for ublas::matrix -// same size and resize specialization for matrix-matrix resizing -template< class T , class L , class A , class T2 , class L2 , class A2 > -struct same_size_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::matrix< T2 , L2 , A2 > > -{ - static bool same_size( const boost::numeric::ublas::matrix< T , L , A > &m1 , - const boost::numeric::ublas::matrix< T2 , L2 , A2 > &m2 ) - { - return ( ( m1.size1() == m2.size1() ) && ( m1.size2() == m2.size2() ) ); - } -}; - -template< class T , class L , class A , class T2 , class L2 , class A2 > -struct resize_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::matrix< T2 , L2 , A2 > > -{ - static void resize( boost::numeric::ublas::matrix< T , L , A > &m1 , - const boost::numeric::ublas::matrix< T2 , L2 , A2 > &m2 ) - { - m1.resize( m2.size1() , m2.size2() ); - } -}; - - - -// same size and resize specialization for matrix-vector resizing -template< class T , class L , class A , class T_V , class A_V > -struct same_size_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::vector< T_V , A_V > > -{ - static bool same_size( const boost::numeric::ublas::matrix< T , L , A > &m , - const boost::numeric::ublas::vector< T_V , A_V > &v ) - { - return ( ( m.size1() == v.size() ) && ( m.size2() == v.size() ) ); - } -}; - -template< class T , class L , class A , class T_V , class A_V > -struct resize_impl< boost::numeric::ublas::matrix< T , L , A > , boost::numeric::ublas::vector< T_V , A_V > > -{ - static void resize( boost::numeric::ublas::matrix< T , L , A > &m , - const boost::numeric::ublas::vector< T_V , A_V > &v ) - { - m.resize( v.size() , v.size() ); - } -}; - - - -// specialization for ublas::permutation_matrix -// same size and resize specialization for matrix-vector resizing -template< class T , class A , class T_V , class A_V > -struct same_size_impl< boost::numeric::ublas::permutation_matrix< T , A > , - boost::numeric::ublas::vector< T_V , A_V > > -{ - static bool same_size( const boost::numeric::ublas::permutation_matrix< T , A > &m , - const boost::numeric::ublas::vector< T_V , A_V > &v ) - { - return ( m.size() == v.size() ); // && ( m.size2() == v.size() ) ); - } -}; - -template< class T , class A , class T_V , class A_V > -struct resize_impl< boost::numeric::ublas::vector< T_V , A_V > , - boost::numeric::ublas::permutation_matrix< T , A > > -{ - static void resize( const boost::numeric::ublas::vector< T_V , A_V > &v, - boost::numeric::ublas::permutation_matrix< T , A > &m ) - { - m.resize( v.size() , v.size() ); - } -}; - - - - - - - -template< class T , class A > -struct state_wrapper< boost::numeric::ublas::permutation_matrix< T , A > > // with resizing -{ - typedef boost::numeric::ublas::permutation_matrix< T , A > state_type; - typedef state_wrapper< state_type > state_wrapper_type; - - state_type m_v; - - state_wrapper() : m_v( 1 ) // permutation matrix constructor requires a size, choose 1 as default - { } - -}; - - - - -} } } - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_UBLAS_WRAPPER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/unit_helper.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/unit_helper.hpp deleted file mode 100644 index 736b3e5722..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/unit_helper.hpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/unit_helper.hpp - - [begin_description] - Get and set the value of a unit. - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2012-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) -*/ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_UNIT_HELPER_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_UNIT_HELPER_HPP_INCLUDED - - -#ifndef __CUDACC__ -#include <boost/units/quantity.hpp> -#include <boost/units/get_dimension.hpp> -#include <boost/units/get_system.hpp> -#endif - - - -namespace boost { -namespace numeric { -namespace odeint { - - -namespace detail { - - template<class T , class Enabler = void > - struct get_unit_value_impl - { - static T value(const T &t) - { - return t; - } - typedef T result_type; - }; - -#ifndef __CUDACC__ - template<class Unit , class T> - struct get_unit_value_impl< boost::units::quantity< Unit , T> > - { - static T value( const boost::units::quantity< Unit , T> &t ) - { - return t.value(); - } - typedef T result_type; - }; -#endif - - - - - - template<class T , class V , class Enabler = void > - struct set_unit_value_impl - { - static void set_value(T &t , const V &v) - { - t = v; - } - }; - -#ifndef __CUDACC__ - template<class Unit , class T , class V> - struct set_unit_value_impl<boost::units::quantity<Unit , T> , V> - { - static void set_value(boost::units::quantity<Unit , T> &t , const V &v) - { - t = boost::units::quantity<Unit , T>::from_value(v); - } - }; -#endif - - - -} // namespace detail - - - template<class T> - typename detail::get_unit_value_impl<T>::result_type get_unit_value(const T &t) - { - return detail::get_unit_value_impl<T>::value(t); - } - - - template<class T , class V> - void set_unit_value(T &t , const V &v) - { - return detail::set_unit_value_impl<T , V>::set_value(t , v); - } - - - - template< class T > - struct unit_value_type - { - typedef T type; - }; - -#ifndef __CUDACC__ - template< class Unit , class Y > - struct unit_value_type< boost::units::quantity< Unit , Y > > - { - typedef Y type; - }; -#endif - - - - - - - - - - - template< typename Time > - struct inverse_time - { - typedef Time type; - }; - -#ifndef __CUDACC__ - template< typename Unit , typename Value > - struct inverse_time< boost::units::quantity< Unit , Value > > - { - typedef boost::units::quantity< Unit , Value > time_type; - typedef typename boost::units::get_dimension< time_type >::type dimension; - typedef typename boost::units::get_system< time_type >::type system; - typedef typename boost::mpl::divides< boost::units::dimensionless_type , dimension >::type inv_dimension; - typedef boost::units::unit< inv_dimension , system > inv_unit; - typedef boost::units::quantity< inv_unit , Value > type; - }; -#endif - - -} // namespace odeint -} // namespace numeric -} // namespace boost - - -#endif // BOOST_NUMERIC_ODEINT_UTIL_UNIT_HELPER_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/util/unwrap_reference.hpp b/contrib/restricted/boost/boost/numeric/odeint/util/unwrap_reference.hpp deleted file mode 100644 index e160878391..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/util/unwrap_reference.hpp +++ /dev/null @@ -1,166 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/util/unwrap_reference.hpp - - [begin_description] - unwrap_reference - [end_description] - - Copyright 2012-2013 Karsten Ahnert - Copyright 2012-2013 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - - -#ifndef BOOST_NUMERIC_ODEINT_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED - - -#include <boost/numeric/odeint/config.hpp> - - -#if BOOST_NUMERIC_ODEINT_CXX11 -#include <functional> -#else -#include <boost/ref.hpp> -#endif - -namespace boost { - -#if BOOST_NUMERIC_ODEINT_CXX11 -template<typename T> class reference_wrapper; - -template<typename T> struct unwrap_reference; -#endif - -namespace numeric { -namespace odeint { - - -#if BOOST_NUMERIC_ODEINT_CXX11 - -template<typename T> -struct unwrap_reference -{ - typedef typename std::remove_reference<T>::type type; -}; - -template<typename T> -struct unwrap_reference< std::reference_wrapper<T> > -{ - typedef typename std::remove_reference<T>::type type; -}; - -template<typename T> -struct unwrap_reference< boost::reference_wrapper<T> > -{ - typedef typename boost::unwrap_reference<T>::type type; -}; - -#else - -using ::boost::unwrap_reference; - -#endif - -namespace detail -{ - -#if BOOST_NUMERIC_ODEINT_CXX11 - -using ::std::ref; - -#else - -using ::boost::ref; - -#endif -} - -} -} -} - - - -/* - * - * the following is the suggested way, but unfortunately it does not work with all compilers. - */ - -/* - -#include <boost/config.hpp> - - -#ifdef BOOST_NO_CXX11_HDR_FUNCTIONAL -#include <boost/ref.hpp> -#else -#include <functional> -#endif - - - -namespace boost { -namespace numeric { -namespace odeint { - - -#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL - -template<typename T> -struct unwrap_reference -{ - typedef typename std::remove_reference<T>::type type; -}; - -template<typename T> -struct unwrap_reference< std::reference_wrapper<T> > -{ - typedef typename std::remove_reference<T>::type type; -}; - -template<typename T> -struct unwrap_reference< boost::reference_wrapper<T> > -{ - typedef typename boost::unwrap_reference<T>::type type; -}; - -#else - -using ::boost::unwrap_reference; - -#endif - -} -} -} - -namespace boost { -namespace numeric { -namespace odeint { -namespace detail { - - -#ifndef BOOST_NO_CXX11_HDR_FUNCTIONAL - -using ::std::ref; - -#else - -using ::boost::ref; - -#endif - - -} -} -} -} - -*/ - -#endif // BOOST_NUMERIC_ODEINT_UTIL_UNWRAP_REFERENCE_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/numeric/odeint/version.hpp b/contrib/restricted/boost/boost/numeric/odeint/version.hpp deleted file mode 100644 index 379c906599..0000000000 --- a/contrib/restricted/boost/boost/numeric/odeint/version.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - [auto_generated] - boost/numeric/odeint/version.hpp - - [begin_description] - Defines the current version of odeint. - [end_description] - - Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky - - Distributed under the Boost Software License, Version 1.0. - (See accompanying file LICENSE_1_0.txt or - copy at http://www.boost.org/LICENSE_1_0.txt) - */ - -#ifndef BOOST_NUMERIC_ODEINT_VERSION_HPP_INCLUDED -#define BOOST_NUMERIC_ODEINT_VERSION_HPP_INCLUDED - -#include <string> -#include <sstream> - - -#define ODEINT_MAJOR_VERSION 2 -#define ODEINT_MINOR_VERSION 2 -#define ODEINT_PATCH_LEVEL 0 -#define ODEINT_VERSION ( ODEINT_MAJOR_VERSION * 100000 + ODEINT_MINOR_VERSION * 100 + ODEINT_PATCH_LEVEL ) - - -namespace boost { -namespace numeric { -namespace odeint { - -namespace version { - -const int major = ODEINT_MAJOR_VERSION ; -const int minor = ODEINT_MINOR_VERSION ; -const int patch_level = ODEINT_PATCH_LEVEL ; - -} - -inline std::string get_version_string( void ) -{ - std::ostringstream str; - str << "v" << version::major << "." << version::minor; - if( version::patch_level != 0 ) str << "_" << version::patch_level; - return str.str(); -} - - -} -} -} - -#endif // BOOST_NUMERIC_ODEINT_VERSION_HPP_INCLUDED diff --git a/contrib/restricted/boost/boost/property_map/property_map.hpp b/contrib/restricted/boost/boost/property_map/property_map.hpp index cd6dd5579c..22bdeaff15 100644 --- a/contrib/restricted/boost/boost/property_map/property_map.hpp +++ b/contrib/restricted/boost/boost/property_map/property_map.hpp @@ -595,7 +595,7 @@ namespace boost { } // namespace boost #ifdef BOOST_GRAPH_USE_MPI -#include <boost/property_map/parallel/parallel_property_maps.hpp> +#error #include <boost/property_map/parallel/parallel_property_maps.hpp> #endif #include <boost/property_map/vector_property_map.hpp> diff --git a/contrib/restricted/boost/boost/property_map/vector_property_map.hpp b/contrib/restricted/boost/boost/property_map/vector_property_map.hpp index ceb975a3d4..8eac06d255 100644 --- a/contrib/restricted/boost/boost/property_map/vector_property_map.hpp +++ b/contrib/restricted/boost/boost/property_map/vector_property_map.hpp @@ -93,7 +93,7 @@ namespace boost { } #ifdef BOOST_GRAPH_USE_MPI -#include <boost/property_map/parallel/vector_property_map.hpp> +#error #include <boost/property_map/parallel/vector_property_map.hpp> #endif #endif diff --git a/contrib/restricted/boost/detail/include/boost/detail/is_sorted.hpp b/contrib/restricted/boost/detail/include/boost/detail/is_sorted.hpp deleted file mode 100644 index 84357f9b49..0000000000 --- a/contrib/restricted/boost/detail/include/boost/detail/is_sorted.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/*============================================================================== - Copyright (c) 2010-2011 Bryce Lelbach - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ - -#ifndef BOOST_DETAIL_SORTED_HPP -#define BOOST_DETAIL_SORTED_HPP - -#include <iterator> -#include <functional> - -namespace boost { -namespace detail { - -template<class Iterator, class Comp> -inline Iterator is_sorted_until (Iterator first, Iterator last, Comp c) { - if (first == last) - return last; - - Iterator it = first; ++it; - - for (; it != last; first = it, ++it) - if (c(*it, *first)) - return it; - - return it; -} - -template<class Iterator> -inline Iterator is_sorted_until (Iterator first, Iterator last) { - typedef typename std::iterator_traits<Iterator>::value_type - value_type; - - typedef std::less<value_type> c; - - return ::boost::detail::is_sorted_until(first, last, c()); -} - -template<class Iterator, class Comp> -inline bool is_sorted (Iterator first, Iterator last, Comp c) { - return ::boost::detail::is_sorted_until(first, last, c) == last; -} - -template<class Iterator> -inline bool is_sorted (Iterator first, Iterator last) { - return ::boost::detail::is_sorted_until(first, last) == last; -} - -} // detail -} // boost - -#endif // BOOST_DETAIL_SORTED_HPP - diff --git a/contrib/restricted/boost/foreach/include/boost/foreach.hpp b/contrib/restricted/boost/foreach/include/boost/foreach.hpp deleted file mode 100644 index 33b6921d28..0000000000 --- a/contrib/restricted/boost/foreach/include/boost/foreach.hpp +++ /dev/null @@ -1,1134 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// foreach.hpp header file -// -// 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) -// See http://www.boost.org/libs/foreach for documentation -// -// Credits: -// Anson Tsao - for the initial inspiration and several good suggestions. -// Thorsten Ottosen - for Boost.Range, and for suggesting a way to detect -// const-qualified rvalues at compile time on VC7.1+ -// Russell Hind - For help porting to Borland -// Alisdair Meredith - For help porting to Borland -// Stefan Slapeta - For help porting to Intel -// David Jenkins - For help finding a Microsoft Code Analysis bug -// mimomorin@... - For a patch to use rvalue refs on supporting compilers - -#ifndef BOOST_FOREACH - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -#include <cstddef> -#include <utility> // for std::pair - -#include <boost/config.hpp> -#include <boost/detail/workaround.hpp> - -// Define a compiler generic null pointer value -#if defined(BOOST_NO_NULLPTR) -#define BOOST_FOREACH_NULL 0 -#else -#define BOOST_FOREACH_NULL nullptr -#endif - -// Some compilers let us detect even const-qualified rvalues at compile-time -#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) \ - || defined(BOOST_MSVC) && !defined(_PREFAST_) \ - || (BOOST_WORKAROUND(__GNUC__, == 4) && (__GNUC_MINOR__ <= 5) && !defined(BOOST_INTEL) && \ - !defined(BOOST_CLANG)) \ - || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL) && \ - !defined(BOOST_CLANG)) -# define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION -#else -// Some compilers allow temporaries to be bound to non-const references. -// These compilers make it impossible to for BOOST_FOREACH to detect -// temporaries and avoid reevaluation of the collection expression. -# if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x593) \ - || (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \ - || BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100) \ - || BOOST_WORKAROUND(__DECCXX_VER, <= 60590042) -# define BOOST_FOREACH_NO_RVALUE_DETECTION -# endif -// Some compilers do not correctly implement the lvalue/rvalue conversion -// rules of the ternary conditional operator. -# if defined(BOOST_FOREACH_NO_RVALUE_DETECTION) \ - || defined(BOOST_NO_SFINAE) \ - || BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1400)) \ - || BOOST_WORKAROUND(BOOST_INTEL_WIN, BOOST_TESTED_AT(1400)) \ - || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ <= 3) && defined(__APPLE_CC__)) \ - || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) \ - || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) \ - || BOOST_WORKAROUND(__SUNPRO_CC, >= 0x5100) \ - || BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x590)) -# define BOOST_FOREACH_NO_CONST_RVALUE_DETECTION -# else -# define BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION -# endif -#endif - -#include <boost/mpl/if.hpp> -#include <boost/mpl/assert.hpp> -#include <boost/mpl/logical.hpp> -#include <boost/mpl/eval_if.hpp> -#include <boost/noncopyable.hpp> -#include <boost/range/end.hpp> -#include <boost/range/begin.hpp> -#include <boost/range/rend.hpp> -#include <boost/range/rbegin.hpp> -#include <boost/range/iterator.hpp> -#include <boost/range/reverse_iterator.hpp> -#include <boost/type_traits/is_array.hpp> -#include <boost/type_traits/is_const.hpp> -#include <boost/type_traits/is_abstract.hpp> -#include <boost/type_traits/is_base_and_derived.hpp> -#include <boost/type_traits/is_rvalue_reference.hpp> -#include <boost/iterator/iterator_traits.hpp> -#include <boost/utility/addressof.hpp> -#include <boost/foreach_fwd.hpp> - -#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION -# include <new> -# include <boost/aligned_storage.hpp> -# include <boost/utility/enable_if.hpp> -# include <boost/type_traits/remove_const.hpp> -#endif - -namespace boost -{ - -// forward declarations for iterator_range -template<typename T> -class iterator_range; - -// forward declarations for sub_range -template<typename T> -class sub_range; - -namespace foreach -{ - /////////////////////////////////////////////////////////////////////////////// - // in_range - // - template<typename T> - inline std::pair<T, T> in_range(T begin, T end) - { - return std::make_pair(begin, end); - } - - /////////////////////////////////////////////////////////////////////////////// - // boost::foreach::is_lightweight_proxy - // Specialize this for user-defined collection types if they are inexpensive to copy. - // This tells BOOST_FOREACH it can avoid the rvalue/lvalue detection stuff. - template<typename T> - struct is_lightweight_proxy - : boost::mpl::false_ - { - }; - - /////////////////////////////////////////////////////////////////////////////// - // boost::foreach::is_noncopyable - // Specialize this for user-defined collection types if they cannot be copied. - // This also tells BOOST_FOREACH to avoid the rvalue/lvalue detection stuff. - template<typename T> - struct is_noncopyable - #if !defined(BOOST_BROKEN_IS_BASE_AND_DERIVED) && !defined(BOOST_NO_IS_ABSTRACT) - : boost::mpl::or_< - boost::is_abstract<T> - , boost::is_base_and_derived<boost::noncopyable, T> - > - #elif !defined(BOOST_BROKEN_IS_BASE_AND_DERIVED) - : boost::is_base_and_derived<boost::noncopyable, T> - #elif !defined(BOOST_NO_IS_ABSTRACT) - : boost::is_abstract<T> - #else - : boost::mpl::false_ - #endif - { - }; - -} // namespace foreach - -} // namespace boost - -// vc6/7 needs help ordering the following overloads -#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -# define BOOST_FOREACH_TAG_DEFAULT ... -#else -# define BOOST_FOREACH_TAG_DEFAULT boost::foreach::tag -#endif - -/////////////////////////////////////////////////////////////////////////////// -// boost_foreach_is_lightweight_proxy -// Another customization point for the is_lightweight_proxy optimization, -// this one works on legacy compilers. Overload boost_foreach_is_lightweight_proxy -// at the global namespace for your type. -template<typename T> -inline boost::foreach::is_lightweight_proxy<T> * -boost_foreach_is_lightweight_proxy(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; } - -template<typename T> -inline boost::mpl::true_ * -boost_foreach_is_lightweight_proxy(std::pair<T, T> *&, boost::foreach::tag) { return 0; } - -template<typename T> -inline boost::mpl::true_ * -boost_foreach_is_lightweight_proxy(boost::iterator_range<T> *&, boost::foreach::tag) { return 0; } - -template<typename T> -inline boost::mpl::true_ * -boost_foreach_is_lightweight_proxy(boost::sub_range<T> *&, boost::foreach::tag) { return 0; } - -template<typename T> -inline boost::mpl::true_ * -boost_foreach_is_lightweight_proxy(T **&, boost::foreach::tag) { return 0; } - -/////////////////////////////////////////////////////////////////////////////// -// boost_foreach_is_noncopyable -// Another customization point for the is_noncopyable trait, -// this one works on legacy compilers. Overload boost_foreach_is_noncopyable -// at the global namespace for your type. -template<typename T> -inline boost::foreach::is_noncopyable<T> * -boost_foreach_is_noncopyable(T *&, BOOST_FOREACH_TAG_DEFAULT) { return 0; } - -namespace boost -{ - -namespace foreach_detail_ -{ - -/////////////////////////////////////////////////////////////////////////////// -// Define some utilities for assessing the properties of expressions -// -template<typename Bool1, typename Bool2> -inline boost::mpl::and_<Bool1, Bool2> *and_(Bool1 *, Bool2 *) { return 0; } - -template<typename Bool1, typename Bool2, typename Bool3> -inline boost::mpl::and_<Bool1, Bool2, Bool3> *and_(Bool1 *, Bool2 *, Bool3 *) { return 0; } - -template<typename Bool1, typename Bool2> -inline boost::mpl::or_<Bool1, Bool2> *or_(Bool1 *, Bool2 *) { return 0; } - -template<typename Bool1, typename Bool2, typename Bool3> -inline boost::mpl::or_<Bool1, Bool2, Bool3> *or_(Bool1 *, Bool2 *, Bool3 *) { return 0; } - -template<typename Bool1> -inline boost::mpl::not_<Bool1> *not_(Bool1 *) { return 0; } - -template<typename T> -inline boost::is_array<T> *is_array_(T const &) { return 0; } - -template<typename T> -inline boost::is_const<T> *is_const_(T &) { return 0; } - -#ifndef BOOST_FOREACH_NO_RVALUE_DETECTION -template<typename T> -inline boost::mpl::true_ *is_const_(T const &) { return 0; } -#endif - -#ifdef BOOST_NO_CXX11_RVALUE_REFERENCES -template<typename T> -inline boost::mpl::false_ *is_rvalue_(T &, int) { return 0; } - -template<typename T> -inline boost::mpl::true_ *is_rvalue_(T const &, ...) { return 0; } -#else -template<typename T> -inline boost::is_rvalue_reference<T &&> *is_rvalue_(T &&, int) { return 0; } -#endif - -/////////////////////////////////////////////////////////////////////////////// -// auto_any_t/auto_any -// General utility for putting an object of any type into automatic storage -struct auto_any_base -{ - // auto_any_base must evaluate to false in boolean context so that - // they can be declared in if() statements. - operator bool() const - { - return false; - } -}; - -template<typename T> -struct auto_any : auto_any_base -{ - explicit auto_any(T const &t) - : item(t) - { - } - - // temporaries of type auto_any will be bound to const auto_any_base - // references, but we still want to be able to mutate the stored - // data, so declare it as mutable. - mutable T item; -}; - -typedef auto_any_base const &auto_any_t; - -template<typename T, typename C> -inline BOOST_DEDUCED_TYPENAME boost::mpl::if_<C, T const, T>::type &auto_any_cast(auto_any_t a) -{ - return static_cast<auto_any<T> const &>(a).item; -} - -typedef boost::mpl::true_ const_; - -/////////////////////////////////////////////////////////////////////////////// -// type2type -// -template<typename T, typename C = boost::mpl::false_> -struct type2type - : boost::mpl::if_<C, T const, T> -{ -}; - -template<typename T> -struct wrap_cstr -{ - typedef T type; -}; - -template<> -struct wrap_cstr<char *> -{ - typedef wrap_cstr<char *> type; - typedef char *iterator; - typedef char *const_iterator; -}; - -template<> -struct wrap_cstr<char const *> -{ - typedef wrap_cstr<char const *> type; - typedef char const *iterator; - typedef char const *const_iterator; -}; - -template<> -struct wrap_cstr<wchar_t *> -{ - typedef wrap_cstr<wchar_t *> type; - typedef wchar_t *iterator; - typedef wchar_t *const_iterator; -}; - -template<> -struct wrap_cstr<wchar_t const *> -{ - typedef wrap_cstr<wchar_t const *> type; - typedef wchar_t const *iterator; - typedef wchar_t const *const_iterator; -}; - -template<typename T> -struct is_char_array - : mpl::and_< - is_array<T> - , mpl::or_< - is_convertible<T, char const *> - , is_convertible<T, wchar_t const *> - > - > -{}; - -template<typename T, typename C = boost::mpl::false_> -struct foreach_iterator -{ - // **** READ THIS IF YOUR COMPILE BREAKS HERE **** - // - // There is an ambiguity about how to iterate over arrays of char and wchar_t. - // Should the last array element be treated as a null terminator to be skipped, or - // is it just like any other element in the array? To fix the problem, you must - // say which behavior you want. - // - // To treat the container as a null-terminated string, merely cast it to a - // char const *, as in BOOST_FOREACH( char ch, (char const *)"hello" ) ... - // - // To treat the container as an array, use boost::as_array() in <boost/range/as_array.hpp>, - // as in BOOST_FOREACH( char ch, boost::as_array("hello") ) ... - BOOST_MPL_ASSERT_MSG( (!is_char_array<T>::value), IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING, (T&) ); - - // If the type is a pointer to a null terminated string (as opposed - // to an array type), there is no ambiguity. - typedef BOOST_DEDUCED_TYPENAME wrap_cstr<T>::type container; - - typedef BOOST_DEDUCED_TYPENAME boost::mpl::eval_if< - C - , range_const_iterator<container> - , range_mutable_iterator<container> - >::type type; -}; - - -template<typename T, typename C = boost::mpl::false_> -struct foreach_reverse_iterator -{ - // **** READ THIS IF YOUR COMPILE BREAKS HERE **** - // - // There is an ambiguity about how to iterate over arrays of char and wchar_t. - // Should the last array element be treated as a null terminator to be skipped, or - // is it just like any other element in the array? To fix the problem, you must - // say which behavior you want. - // - // To treat the container as a null-terminated string, merely cast it to a - // char const *, as in BOOST_FOREACH( char ch, (char const *)"hello" ) ... - // - // To treat the container as an array, use boost::as_array() in <boost/range/as_array.hpp>, - // as in BOOST_FOREACH( char ch, boost::as_array("hello") ) ... - BOOST_MPL_ASSERT_MSG( (!is_char_array<T>::value), IS_THIS_AN_ARRAY_OR_A_NULL_TERMINATED_STRING, (T&) ); - - // If the type is a pointer to a null terminated string (as opposed - // to an array type), there is no ambiguity. - typedef BOOST_DEDUCED_TYPENAME wrap_cstr<T>::type container; - - typedef BOOST_DEDUCED_TYPENAME boost::mpl::eval_if< - C - , range_reverse_iterator<container const> - , range_reverse_iterator<container> - >::type type; -}; - -template<typename T, typename C = boost::mpl::false_> -struct foreach_reference - : iterator_reference<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type> -{ -}; - -/////////////////////////////////////////////////////////////////////////////// -// encode_type -// -template<typename T> -inline type2type<T> *encode_type(T &, boost::false_type*) { return 0; } - -template<typename T> -inline type2type<T, const_> *encode_type(T const &, boost::true_type*) { return 0; } - -template<typename T> -inline type2type<T> *encode_type(T &, boost::mpl::false_*) { return 0; } - -template<typename T> -inline type2type<T, const_> *encode_type(T const &, boost::mpl::true_*) { return 0; } - -/////////////////////////////////////////////////////////////////////////////// -// set_false -// -inline bool set_false(bool &b) -{ - b = false; - return false; -} - -/////////////////////////////////////////////////////////////////////////////// -// to_ptr -// -template<typename T> -inline T *&to_ptr(T const &) -{ - static T *t = 0; - return t; -} - -// Borland needs a little extra help with arrays -#if BOOST_WORKAROUND(BOOST_BORLANDC, BOOST_TESTED_AT(0x564)) -template<typename T,std::size_t N> -inline T (*&to_ptr(T (&)[N]))[N] -{ - static T (*t)[N] = 0; - return t; -} - -/////////////////////////////////////////////////////////////////////////////// -// derefof -// -template<typename T> -inline T &derefof(T *t) -{ - // This is a work-around for a compiler bug in Borland. If T* is a pointer to array type U(*)[N], - // then dereferencing it results in a U* instead of U(&)[N]. The cast forces the issue. - return reinterpret_cast<T &>( - *const_cast<char *>( - reinterpret_cast<char const volatile *>(t) - ) - ); -} - -# define BOOST_FOREACH_DEREFOF(T) boost::foreach_detail_::derefof(*T) -#else -# define BOOST_FOREACH_DEREFOF(T) (*T) -#endif - -#if defined(BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION) \ - && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -/////////////////////////////////////////////////////////////////////////////// -// Rvalue references makes it drop-dead simple to detect at compile time -// whether an expression is an rvalue. -/////////////////////////////////////////////////////////////////////////////// - -# define BOOST_FOREACH_IS_RVALUE(COL) \ - boost::foreach_detail_::is_rvalue_((COL), 0) - -#elif defined(BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION) \ - && defined(BOOST_NO_CXX11_RVALUE_REFERENCES) -/////////////////////////////////////////////////////////////////////////////// -// Detect at compile-time whether an expression yields an rvalue or -// an lvalue. This is rather non-standard, but some popular compilers -// accept it. -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// rvalue_probe -// -template<typename T> -struct rvalue_probe -{ - struct private_type_ {}; - // can't ever return an array by value - typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< - boost::mpl::or_<boost::is_abstract<T>, boost::is_array<T> >, private_type_, T - >::type value_type; - operator value_type() { return *reinterpret_cast<value_type *>(this); } // never called - operator T &() const { return *reinterpret_cast<T *>(const_cast<rvalue_probe *>(this)); } // never called -}; - -template<typename T> -rvalue_probe<T> const make_probe(T const &) -{ - return rvalue_probe<T>(); -} - -# define BOOST_FOREACH_IS_RVALUE(COL) \ - boost::foreach_detail_::and_( \ - boost::foreach_detail_::not_(boost::foreach_detail_::is_array_(COL)) \ - , (true ? 0 : boost::foreach_detail_::is_rvalue_( \ - (true ? boost::foreach_detail_::make_probe(COL) : (COL)), 0))) - -#elif defined(BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION) -/////////////////////////////////////////////////////////////////////////////// -// Detect at run-time whether an expression yields an rvalue -// or an lvalue. This is 100% standard C++, but not all compilers -// accept it. Also, it causes FOREACH to break when used with non- -// copyable collection types. -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// rvalue_probe -// -template<typename T> -struct rvalue_probe -{ - rvalue_probe(T &t, bool &b) - : value(t) - , is_rvalue(b) - { - } - - struct private_type_ {}; - // can't ever return an array or an abstract type by value - #ifdef BOOST_NO_IS_ABSTRACT - typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< - boost::is_array<T>, private_type_, T - >::type value_type; - #else - typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_< - boost::mpl::or_<boost::is_abstract<T>, boost::is_array<T> >, private_type_, T - >::type value_type; - #endif - - operator value_type() - { - this->is_rvalue = true; - return this->value; - } - - operator T &() const - { - return this->value; - } - -private: - T &value; - bool &is_rvalue; -}; - -template<typename T> -rvalue_probe<T> make_probe(T &t, bool &b) { return rvalue_probe<T>(t, b); } - -template<typename T> -rvalue_probe<T const> make_probe(T const &t, bool &b) { return rvalue_probe<T const>(t, b); } - -/////////////////////////////////////////////////////////////////////////////// -// simple_variant -// holds either a T or a T const* -template<typename T> -struct simple_variant -{ - simple_variant(T const *t) - : is_rvalue(false) - { - *static_cast<T const **>(this->data.address()) = t; - } - - simple_variant(T const &t) - : is_rvalue(true) - { - ::new(this->data.address()) T(t); - } - - simple_variant(simple_variant const &that) - : is_rvalue(that.is_rvalue) - { - if(this->is_rvalue) - ::new(this->data.address()) T(*that.get()); - else - *static_cast<T const **>(this->data.address()) = that.get(); - } - - ~simple_variant() - { - if(this->is_rvalue) - this->get()->~T(); - } - - T const *get() const - { - if(this->is_rvalue) - return static_cast<T const *>(this->data.address()); - else - return *static_cast<T const * const *>(this->data.address()); - } - -private: - enum size_type { size = sizeof(T) > sizeof(T*) ? sizeof(T) : sizeof(T*) }; - simple_variant &operator =(simple_variant const &); - bool const is_rvalue; - aligned_storage<size> data; -}; - -// If the collection is an array or is noncopyable, it must be an lvalue. -// If the collection is a lightweight proxy, treat it as an rvalue -// BUGBUG what about a noncopyable proxy? -template<typename LValue, typename IsProxy> -inline BOOST_DEDUCED_TYPENAME boost::enable_if<boost::mpl::or_<LValue, IsProxy>, IsProxy>::type * -should_copy_impl(LValue *, IsProxy *, bool *) -{ - return 0; -} - -// Otherwise, we must determine at runtime whether it's an lvalue or rvalue -inline bool * -should_copy_impl(boost::mpl::false_ *, boost::mpl::false_ *, bool *is_rvalue) -{ - return is_rvalue; -} - -#endif - -/////////////////////////////////////////////////////////////////////////////// -// contain -// -template<typename T> -inline auto_any<T> contain(T const &t, boost::mpl::true_ *) // rvalue -{ - return auto_any<T>(t); -} - -template<typename T> -inline auto_any<T *> contain(T &t, boost::mpl::false_ *) // lvalue -{ - // Cannot seem to get sunpro to handle addressof() with array types. - #if BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x570)) - return auto_any<T *>(&t); - #else - return auto_any<T *>(boost::addressof(t)); - #endif -} - -#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION -template<typename T> -inline auto_any<simple_variant<T> > -contain(T const &t, bool *rvalue) -{ - return auto_any<simple_variant<T> >(*rvalue ? simple_variant<T>(t) : simple_variant<T>(&t)); -} -#endif - -///////////////////////////////////////////////////////////////////////////// -// begin -// -template<typename T, typename C> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type> -begin(auto_any_t col, type2type<T, C> *, boost::mpl::true_ *) // rvalue -{ - return auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type>( - boost::begin(auto_any_cast<T, C>(col))); -} - -template<typename T, typename C> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type> -begin(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *) // lvalue -{ - typedef BOOST_DEDUCED_TYPENAME type2type<T, C>::type type; - typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iterator; - return auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type>( - iterator(boost::begin(BOOST_FOREACH_DEREFOF((auto_any_cast<type *, boost::mpl::false_>(col)))))); -} - -#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION -template<typename T> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, const_>::type> -begin(auto_any_t col, type2type<T, const_> *, bool *) -{ - return auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, const_>::type>( - boost::begin(*auto_any_cast<simple_variant<T>, boost::mpl::false_>(col).get())); -} -#endif - -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -template<typename T, typename C> -inline auto_any<T *> -begin(auto_any_t col, type2type<T *, C> *, boost::mpl::true_ *) // null-terminated C-style strings -{ - return auto_any<T *>(auto_any_cast<T *, boost::mpl::false_>(col)); -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// end -// -template<typename T, typename C> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type> -end(auto_any_t col, type2type<T, C> *, boost::mpl::true_ *) // rvalue -{ - return auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type>( - boost::end(auto_any_cast<T, C>(col))); -} - -template<typename T, typename C> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type> -end(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *) // lvalue -{ - typedef BOOST_DEDUCED_TYPENAME type2type<T, C>::type type; - typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iterator; - return auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type>( - iterator(boost::end(BOOST_FOREACH_DEREFOF((auto_any_cast<type *, boost::mpl::false_>(col)))))); -} - -#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION -template<typename T> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, const_>::type> -end(auto_any_t col, type2type<T, const_> *, bool *) -{ - return auto_any<BOOST_DEDUCED_TYPENAME foreach_iterator<T, const_>::type>( - boost::end(*auto_any_cast<simple_variant<T>, boost::mpl::false_>(col).get())); -} -#endif - -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -template<typename T, typename C> -inline auto_any<int> -end(auto_any_t, type2type<T *, C> *, boost::mpl::true_ *) // null-terminated C-style strings -{ - return auto_any<int>(0); // not used -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// done -// -template<typename T, typename C> -inline bool done(auto_any_t cur, auto_any_t end, type2type<T, C> *) -{ - typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iter_t; - return auto_any_cast<iter_t, boost::mpl::false_>(cur) == auto_any_cast<iter_t, boost::mpl::false_>(end); -} - -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -template<typename T, typename C> -inline bool done(auto_any_t cur, auto_any_t, type2type<T *, C> *) // null-terminated C-style strings -{ - return ! *auto_any_cast<T *, boost::mpl::false_>(cur); -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// next -// -template<typename T, typename C> -inline void next(auto_any_t cur, type2type<T, C> *) -{ - typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iter_t; - ++auto_any_cast<iter_t, boost::mpl::false_>(cur); -} - -/////////////////////////////////////////////////////////////////////////////// -// deref -// -template<typename T, typename C> -inline BOOST_DEDUCED_TYPENAME foreach_reference<T, C>::type -deref(auto_any_t cur, type2type<T, C> *) -{ - typedef BOOST_DEDUCED_TYPENAME foreach_iterator<T, C>::type iter_t; - return *auto_any_cast<iter_t, boost::mpl::false_>(cur); -} - -///////////////////////////////////////////////////////////////////////////// -// rbegin -// -template<typename T, typename C> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type> -rbegin(auto_any_t col, type2type<T, C> *, boost::mpl::true_ *) // rvalue -{ - return auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type>( - boost::rbegin(auto_any_cast<T, C>(col))); -} - -template<typename T, typename C> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type> -rbegin(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *) // lvalue -{ - typedef BOOST_DEDUCED_TYPENAME type2type<T, C>::type type; - typedef BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type iterator; - return auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type>( - iterator(boost::rbegin(BOOST_FOREACH_DEREFOF((auto_any_cast<type *, boost::mpl::false_>(col)))))); -} - -#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION -template<typename T> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, const_>::type> -rbegin(auto_any_t col, type2type<T, const_> *, bool *) -{ - return auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, const_>::type>( - boost::rbegin(*auto_any_cast<simple_variant<T>, boost::mpl::false_>(col).get())); -} -#endif - -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -template<typename T, typename C> -inline auto_any<reverse_iterator<T *> > -rbegin(auto_any_t col, type2type<T *, C> *, boost::mpl::true_ *) // null-terminated C-style strings -{ - T *p = auto_any_cast<T *, boost::mpl::false_>(col); - while(0 != *p) - ++p; - return auto_any<reverse_iterator<T *> >(reverse_iterator<T *>(p)); -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// rend -// -template<typename T, typename C> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type> -rend(auto_any_t col, type2type<T, C> *, boost::mpl::true_ *) // rvalue -{ - return auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type>( - boost::rend(auto_any_cast<T, C>(col))); -} - -template<typename T, typename C> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type> -rend(auto_any_t col, type2type<T, C> *, boost::mpl::false_ *) // lvalue -{ - typedef BOOST_DEDUCED_TYPENAME type2type<T, C>::type type; - typedef BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type iterator; - return auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type>( - iterator(boost::rend(BOOST_FOREACH_DEREFOF((auto_any_cast<type *, boost::mpl::false_>(col)))))); -} - -#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION -template<typename T> -inline auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, const_>::type> -rend(auto_any_t col, type2type<T, const_> *, bool *) -{ - return auto_any<BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, const_>::type>( - boost::rend(*auto_any_cast<simple_variant<T>, boost::mpl::false_>(col).get())); -} -#endif - -#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING -template<typename T, typename C> -inline auto_any<reverse_iterator<T *> > -rend(auto_any_t col, type2type<T *, C> *, boost::mpl::true_ *) // null-terminated C-style strings -{ - return auto_any<reverse_iterator<T *> >( - reverse_iterator<T *>(auto_any_cast<T *, boost::mpl::false_>(col))); -} -#endif - -/////////////////////////////////////////////////////////////////////////////// -// rdone -// -template<typename T, typename C> -inline bool rdone(auto_any_t cur, auto_any_t end, type2type<T, C> *) -{ - typedef BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type iter_t; - return auto_any_cast<iter_t, boost::mpl::false_>(cur) == auto_any_cast<iter_t, boost::mpl::false_>(end); -} - -/////////////////////////////////////////////////////////////////////////////// -// rnext -// -template<typename T, typename C> -inline void rnext(auto_any_t cur, type2type<T, C> *) -{ - typedef BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type iter_t; - ++auto_any_cast<iter_t, boost::mpl::false_>(cur); -} - -/////////////////////////////////////////////////////////////////////////////// -// rderef -// -template<typename T, typename C> -inline BOOST_DEDUCED_TYPENAME foreach_reference<T, C>::type -rderef(auto_any_t cur, type2type<T, C> *) -{ - typedef BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type iter_t; - return *auto_any_cast<iter_t, boost::mpl::false_>(cur); -} - -} // namespace foreach_detail_ -} // namespace boost - -// Suppress a bogus code analysis warning on vc8+ -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -# define BOOST_FOREACH_SUPPRESS_WARNINGS() __pragma(warning(suppress:6001)) -#else -# define BOOST_FOREACH_SUPPRESS_WARNINGS() -#endif - -/////////////////////////////////////////////////////////////////////////////// -// Define a macro for giving hidden variables a unique name. Not strictly -// needed, but eliminates some warnings on some compilers. -#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500)) -// With some versions of MSVC, use of __LINE__ to create unique identifiers -// can fail when the Edit-and-Continue debug flag is used. -# define BOOST_FOREACH_ID(x) x -#else -# define BOOST_FOREACH_ID(x) BOOST_PP_CAT(x, __LINE__) -#endif - -// A sneaky way to get the type of the collection without evaluating the expression -#define BOOST_FOREACH_TYPEOF(COL) \ - (true ? BOOST_FOREACH_NULL : boost::foreach_detail_::encode_type(COL, boost::foreach_detail_::is_const_(COL))) - -// returns true_* if the type is noncopyable -#define BOOST_FOREACH_IS_NONCOPYABLE(COL) \ - boost_foreach_is_noncopyable( \ - boost::foreach_detail_::to_ptr(COL) \ - , boost_foreach_argument_dependent_lookup_hack_value) - -// returns true_* if the type is a lightweight proxy (and is not noncopyable) -#define BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \ - boost::foreach_detail_::and_( \ - boost::foreach_detail_::not_(BOOST_FOREACH_IS_NONCOPYABLE(COL)) \ - , boost_foreach_is_lightweight_proxy( \ - boost::foreach_detail_::to_ptr(COL) \ - , boost_foreach_argument_dependent_lookup_hack_value)) - -#if defined(BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION) -/////////////////////////////////////////////////////////////////////////////// -// R-values and const R-values supported here with zero runtime overhead -/////////////////////////////////////////////////////////////////////////////// - -// No variable is needed to track the rvalue-ness of the collection expression -# define BOOST_FOREACH_PREAMBLE() \ - BOOST_FOREACH_SUPPRESS_WARNINGS() - -// Evaluate the collection expression -# define BOOST_FOREACH_EVALUATE(COL) \ - (COL) - -# define BOOST_FOREACH_SHOULD_COPY(COL) \ - (true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \ - BOOST_FOREACH_IS_RVALUE(COL) \ - , BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL))) - -#elif defined(BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION) -/////////////////////////////////////////////////////////////////////////////// -// R-values and const R-values supported here -/////////////////////////////////////////////////////////////////////////////// - -// Declare a variable to track the rvalue-ness of the collection expression -# define BOOST_FOREACH_PREAMBLE() \ - BOOST_FOREACH_SUPPRESS_WARNINGS() \ - if (bool BOOST_FOREACH_ID(_foreach_is_rvalue) = false) {} else - -// Evaluate the collection expression, and detect if it is an lvalue or and rvalue -# define BOOST_FOREACH_EVALUATE(COL) \ - (true ? boost::foreach_detail_::make_probe((COL), BOOST_FOREACH_ID(_foreach_is_rvalue)) : (COL)) - -// The rvalue/lvalue-ness of the collection expression is determined dynamically, unless -// the type is an array or is noncopyable or is non-const, in which case we know it's an lvalue. -// If the type happens to be a lightweight proxy, always make a copy. -# define BOOST_FOREACH_SHOULD_COPY(COL) \ - (boost::foreach_detail_::should_copy_impl( \ - true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \ - boost::foreach_detail_::is_array_(COL) \ - , BOOST_FOREACH_IS_NONCOPYABLE(COL) \ - , boost::foreach_detail_::not_(boost::foreach_detail_::is_const_(COL))) \ - , true ? BOOST_FOREACH_NULL : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL) \ - , &BOOST_FOREACH_ID(_foreach_is_rvalue))) - -#elif !defined(BOOST_FOREACH_NO_RVALUE_DETECTION) -/////////////////////////////////////////////////////////////////////////////// -// R-values supported here, const R-values NOT supported here -/////////////////////////////////////////////////////////////////////////////// - -// No variable is needed to track the rvalue-ness of the collection expression -# define BOOST_FOREACH_PREAMBLE() \ - BOOST_FOREACH_SUPPRESS_WARNINGS() - -// Evaluate the collection expression -# define BOOST_FOREACH_EVALUATE(COL) \ - (COL) - -// Determine whether the collection expression is an lvalue or an rvalue. -// NOTE: this gets the answer wrong for const rvalues. -# define BOOST_FOREACH_SHOULD_COPY(COL) \ - (true ? BOOST_FOREACH_NULL : boost::foreach_detail_::or_( \ - boost::foreach_detail_::is_rvalue_((COL), 0) \ - , BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL))) - -#else -/////////////////////////////////////////////////////////////////////////////// -// R-values NOT supported here -/////////////////////////////////////////////////////////////////////////////// - -// No variable is needed to track the rvalue-ness of the collection expression -# define BOOST_FOREACH_PREAMBLE() \ - BOOST_FOREACH_SUPPRESS_WARNINGS() - -// Evaluate the collection expression -# define BOOST_FOREACH_EVALUATE(COL) \ - (COL) - -// Can't use rvalues with BOOST_FOREACH (unless they are lightweight proxies) -# define BOOST_FOREACH_SHOULD_COPY(COL) \ - (true ? BOOST_FOREACH_NULL : BOOST_FOREACH_IS_LIGHTWEIGHT_PROXY(COL)) - -#endif - -#define BOOST_FOREACH_CONTAIN(COL) \ - boost::foreach_detail_::contain( \ - BOOST_FOREACH_EVALUATE(COL) \ - , BOOST_FOREACH_SHOULD_COPY(COL)) - -#define BOOST_FOREACH_BEGIN(COL) \ - boost::foreach_detail_::begin( \ - BOOST_FOREACH_ID(_foreach_col) \ - , BOOST_FOREACH_TYPEOF(COL) \ - , BOOST_FOREACH_SHOULD_COPY(COL)) - -#define BOOST_FOREACH_END(COL) \ - boost::foreach_detail_::end( \ - BOOST_FOREACH_ID(_foreach_col) \ - , BOOST_FOREACH_TYPEOF(COL) \ - , BOOST_FOREACH_SHOULD_COPY(COL)) - -#define BOOST_FOREACH_DONE(COL) \ - boost::foreach_detail_::done( \ - BOOST_FOREACH_ID(_foreach_cur) \ - , BOOST_FOREACH_ID(_foreach_end) \ - , BOOST_FOREACH_TYPEOF(COL)) - -#define BOOST_FOREACH_NEXT(COL) \ - boost::foreach_detail_::next( \ - BOOST_FOREACH_ID(_foreach_cur) \ - , BOOST_FOREACH_TYPEOF(COL)) - -#define BOOST_FOREACH_DEREF(COL) \ - boost::foreach_detail_::deref( \ - BOOST_FOREACH_ID(_foreach_cur) \ - , BOOST_FOREACH_TYPEOF(COL)) - -#define BOOST_FOREACH_RBEGIN(COL) \ - boost::foreach_detail_::rbegin( \ - BOOST_FOREACH_ID(_foreach_col) \ - , BOOST_FOREACH_TYPEOF(COL) \ - , BOOST_FOREACH_SHOULD_COPY(COL)) - -#define BOOST_FOREACH_REND(COL) \ - boost::foreach_detail_::rend( \ - BOOST_FOREACH_ID(_foreach_col) \ - , BOOST_FOREACH_TYPEOF(COL) \ - , BOOST_FOREACH_SHOULD_COPY(COL)) - -#define BOOST_FOREACH_RDONE(COL) \ - boost::foreach_detail_::rdone( \ - BOOST_FOREACH_ID(_foreach_cur) \ - , BOOST_FOREACH_ID(_foreach_end) \ - , BOOST_FOREACH_TYPEOF(COL)) - -#define BOOST_FOREACH_RNEXT(COL) \ - boost::foreach_detail_::rnext( \ - BOOST_FOREACH_ID(_foreach_cur) \ - , BOOST_FOREACH_TYPEOF(COL)) - -#define BOOST_FOREACH_RDEREF(COL) \ - boost::foreach_detail_::rderef( \ - BOOST_FOREACH_ID(_foreach_cur) \ - , BOOST_FOREACH_TYPEOF(COL)) - -/////////////////////////////////////////////////////////////////////////////// -// BOOST_FOREACH -// -// For iterating over collections. Collections can be -// arrays, null-terminated strings, or STL containers. -// The loop variable can be a value or reference. For -// example: -// -// std::list<int> int_list(/*stuff*/); -// BOOST_FOREACH(int &i, int_list) -// { -// /* -// * loop body goes here. -// * i is a reference to the int in int_list. -// */ -// } -// -// Alternately, you can declare the loop variable first, -// so you can access it after the loop finishes. Obviously, -// if you do it this way, then the loop variable cannot be -// a reference. -// -// int i; -// BOOST_FOREACH(i, int_list) -// { ... } -// -#define BOOST_FOREACH(VAR, COL) \ - BOOST_FOREACH_PREAMBLE() \ - if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL)) {} else \ - if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_cur) = BOOST_FOREACH_BEGIN(COL)) {} else \ - if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end) = BOOST_FOREACH_END(COL)) {} else \ - for (bool BOOST_FOREACH_ID(_foreach_continue) = true; \ - BOOST_FOREACH_ID(_foreach_continue) && !BOOST_FOREACH_DONE(COL); \ - BOOST_FOREACH_ID(_foreach_continue) ? BOOST_FOREACH_NEXT(COL) : (void)0) \ - if (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_continue))) {} else \ - for (VAR = BOOST_FOREACH_DEREF(COL); !BOOST_FOREACH_ID(_foreach_continue); BOOST_FOREACH_ID(_foreach_continue) = true) - -/////////////////////////////////////////////////////////////////////////////// -// BOOST_REVERSE_FOREACH -// -// For iterating over collections in reverse order. In -// all other respects, BOOST_REVERSE_FOREACH is like -// BOOST_FOREACH. -// -#define BOOST_REVERSE_FOREACH(VAR, COL) \ - BOOST_FOREACH_PREAMBLE() \ - if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_col) = BOOST_FOREACH_CONTAIN(COL)) {} else \ - if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_cur) = BOOST_FOREACH_RBEGIN(COL)) {} else \ - if (boost::foreach_detail_::auto_any_t BOOST_FOREACH_ID(_foreach_end) = BOOST_FOREACH_REND(COL)) {} else \ - for (bool BOOST_FOREACH_ID(_foreach_continue) = true; \ - BOOST_FOREACH_ID(_foreach_continue) && !BOOST_FOREACH_RDONE(COL); \ - BOOST_FOREACH_ID(_foreach_continue) ? BOOST_FOREACH_RNEXT(COL) : (void)0) \ - if (boost::foreach_detail_::set_false(BOOST_FOREACH_ID(_foreach_continue))) {} else \ - for (VAR = BOOST_FOREACH_RDEREF(COL); !BOOST_FOREACH_ID(_foreach_continue); BOOST_FOREACH_ID(_foreach_continue) = true) - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple.hpp deleted file mode 100644 index 7ef65686b6..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_BOOST_TUPLE_09272006_0732) -#define BOOST_FUSION_BOOST_TUPLE_09272006_0732 - -#include <boost/fusion/support/config.hpp> -#include <boost/fusion/adapted/boost_tuple/tag_of.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/end_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/size_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/at_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp> -#include <boost/fusion/adapted/boost_tuple/mpl/clear.hpp> - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp deleted file mode 100644 index e68cd7cedd..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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_BOOST_TUPLE_ITERATOR_09262006_1851) -#define FUSION_BOOST_TUPLE_ITERATOR_09262006_1851 - -#include <boost/fusion/support/config.hpp> -#include <boost/fusion/iterator/iterator_facade.hpp> -#include <boost/type_traits/is_const.hpp> -#include <boost/type_traits/add_const.hpp> -#include <boost/mpl/identity.hpp> -#include <boost/mpl/if.hpp> -#include <boost/mpl/eval_if.hpp> -#include <boost/mpl/or.hpp> -#include <boost/mpl/plus.hpp> -#include <boost/mpl/int.hpp> -#include <boost/mpl/apply.hpp> -#include <boost/tuple/tuple.hpp> - -namespace boost { namespace fusion -{ - struct forward_traversal_tag; - - namespace detail - { - template <typename T> - struct boost_tuple_is_empty : mpl::false_ {}; - - template <> - struct boost_tuple_is_empty<tuples::null_type> : mpl::true_ {}; - - template <> - struct boost_tuple_is_empty<tuples::null_type const> : mpl::true_ {}; - - template <> - struct boost_tuple_is_empty<tuples::tuple<> > : mpl::true_ {}; - - template <> - struct boost_tuple_is_empty<tuples::tuple<> const> : mpl::true_ {}; - } - - template <typename Cons> - struct boost_tuple_iterator_identity; - - template <typename Cons = tuples::null_type> - struct boost_tuple_iterator - : iterator_facade<boost_tuple_iterator<Cons>, forward_traversal_tag> - { - typedef Cons cons_type; - - typedef boost_tuple_iterator_identity< - typename add_const<Cons>::type> identity; - - BOOST_FUSION_GPU_ENABLED - explicit boost_tuple_iterator(Cons& in_cons) - : cons(in_cons) {} - Cons& cons; - - boost_tuple_iterator(const boost_tuple_iterator& other) = default; - - template <typename Iterator> - struct value_of : mpl::identity<typename Iterator::cons_type::head_type> {}; - - template <typename Iterator> - struct deref - { - typedef typename value_of<Iterator>::type element; - - typedef typename - mpl::if_< - is_const<typename Iterator::cons_type> - , typename tuples::access_traits<element>::const_type - , typename tuples::access_traits<element>::non_const_type - >::type - type; - - BOOST_FUSION_GPU_ENABLED - static type - call(Iterator const& iter) - { - return iter.cons.get_head(); - } - }; - - template <typename Iterator> - struct next - { - typedef typename Iterator::cons_type cons_type; - typedef typename cons_type::tail_type tail_type; - - typedef boost_tuple_iterator< - typename mpl::eval_if< - is_const<cons_type> - , add_const<tail_type> - , mpl::identity<tail_type> - >::type> - type; - - BOOST_FUSION_GPU_ENABLED - static type - call(Iterator const& iter) - { - return type(iter.cons.get_tail()); - } - }; - - template <typename I1, typename I2> - struct distance; - - // detail - template <typename I1, typename I2> - struct lazy_next_distance - { - typedef - typename mpl::plus< - mpl::int_<1>, - typename distance< - typename next<I1>::type, - I2 - >::type - >::type type; - }; - - template <typename I1, typename I2> - struct distance - { - typedef typename mpl::eval_if< - boost::is_same<I1, I2>, - mpl::int_<0>, - lazy_next_distance<I1, I2> - >::type type; - - BOOST_FUSION_GPU_ENABLED - static type - call(I1 const&, I2 const&) - { - return type(); - } - }; - - template <typename I1, typename I2> - struct equal_to - : is_same<typename I1::identity, typename I2::identity> - {}; - - // silence MSVC warning C4512: assignment operator could not be generated - BOOST_DELETED_FUNCTION(boost_tuple_iterator& operator= (boost_tuple_iterator const&)) - }; - - template <typename Null> - struct boost_tuple_null_iterator - : iterator_facade<boost_tuple_iterator<Null>, forward_traversal_tag> - { - typedef Null cons_type; - - typedef boost_tuple_iterator_identity< - typename add_const<Null>::type> identity; - - template <typename I1, typename I2> - struct equal_to - : mpl::or_< - is_same<I1, I2> - , mpl::and_< - detail::boost_tuple_is_empty<typename I1::cons_type> - , detail::boost_tuple_is_empty<typename I2::cons_type> - > - > - {}; - }; - - template <> - struct boost_tuple_iterator<tuples::null_type> - : boost_tuple_null_iterator<tuples::null_type> - { - template <typename Cons> - BOOST_FUSION_GPU_ENABLED - explicit boost_tuple_iterator(Cons const&) {} - }; - - template <> - struct boost_tuple_iterator<tuples::null_type const> - : boost_tuple_null_iterator<tuples::null_type const> - { - template <typename Cons> - BOOST_FUSION_GPU_ENABLED - explicit boost_tuple_iterator(Cons const&) {} - }; - - template <> - struct boost_tuple_iterator<tuples::tuple<> > - : boost_tuple_null_iterator<tuples::tuple<> > - { - template <typename Cons> - BOOST_FUSION_GPU_ENABLED - explicit boost_tuple_iterator(Cons const&) {} - }; - - template <> - struct boost_tuple_iterator<tuples::tuple<> const> - : boost_tuple_null_iterator<tuples::tuple<> const> - { - template <typename Cons> - BOOST_FUSION_GPU_ENABLED - explicit boost_tuple_iterator(Cons const&) {} - }; -}} - -#ifdef BOOST_FUSION_WORKAROUND_FOR_LWG_2408 -namespace std -{ - template <typename Cons> - struct iterator_traits< ::boost::fusion::boost_tuple_iterator<Cons> > - { }; -} -#endif - -#endif - - diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp deleted file mode 100644 index 32ca5bec55..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/at_impl.hpp +++ /dev/null @@ -1,52 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_AT_IMPL_09262006_1920) -#define BOOST_FUSION_AT_IMPL_09262006_1920 - -#include <boost/fusion/support/config.hpp> -#include <boost/tuple/tuple.hpp> -#include <boost/mpl/if.hpp> - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - - namespace extension - { - template<typename T> - struct at_impl; - - template <> - struct at_impl<boost_tuple_tag> - { - template <typename Sequence, typename N> - struct apply - { - typedef typename - tuples::element<N::value, Sequence>::type - element; - - typedef typename - mpl::if_< - is_const<Sequence> - , typename tuples::access_traits<element>::const_type - , typename tuples::access_traits<element>::non_const_type - >::type - type; - - BOOST_FUSION_GPU_ENABLED - static type - call(Sequence& seq) - { - return tuples::get<N::value>(seq); - } - }; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp deleted file mode 100644 index 1fbbb19c14..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/begin_impl.hpp +++ /dev/null @@ -1,41 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_BEGIN_IMPL_09272006_0719) -#define BOOST_FUSION_BEGIN_IMPL_09272006_0719 - -#include <boost/fusion/support/config.hpp> -#include <boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp> - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - - namespace extension - { - template<typename T> - struct begin_impl; - - template <> - struct begin_impl<boost_tuple_tag> - { - template <typename Sequence> - struct apply - { - typedef boost_tuple_iterator<Sequence> type; - - BOOST_FUSION_GPU_ENABLED - static type - call(Sequence& v) - { - return type(v); - } - }; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/build_cons.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/build_cons.hpp deleted file mode 100644 index 216fb0a614..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/build_cons.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/*============================================================================= - Copyright (c) 2012-2014 Kohei Takahashi - - Distributed under the 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_BUILD_CONS_10172012_0130) -#define BOOST_FUSION_BUILD_CONS_10172012_0130 - -#include <boost/tuple/tuple.hpp> -#include <boost/fusion/iterator/equal_to.hpp> -#include <boost/fusion/iterator/next.hpp> -#include <boost/fusion/iterator/value_of.hpp> -#include <boost/fusion/iterator/deref.hpp> - -namespace boost { namespace fusion { namespace detail -{ - template < - typename First - , typename Last - , bool is_empty = result_of::equal_to<First, Last>::value> - struct build_tuple_cons; - - template <typename First, typename Last> - struct build_tuple_cons<First, Last, true> - { - typedef boost::tuples::null_type type; - - BOOST_FUSION_GPU_ENABLED - static type - call(First const&, Last const&) - { - return type(); - } - }; - - template <typename First, typename Last> - struct build_tuple_cons<First, Last, false> - { - typedef - build_tuple_cons<typename result_of::next<First>::type, Last> - next_build_tuple_cons; - - typedef boost::tuples::cons< - typename result_of::value_of<First>::type - , typename next_build_tuple_cons::type> - type; - - BOOST_FUSION_GPU_ENABLED - static type - call(First const& f, Last const& l) - { - typename result_of::value_of<First>::type v = *f; - return type(v, next_build_tuple_cons::call(fusion::next(f), l)); - } - }; -}}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp deleted file mode 100644 index 9b52c98a88..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/category_of_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726) -#define BOOST_FUSION_CATEGORY_OF_IMPL_09272006_0726 - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - struct forward_traversal_tag; - - namespace extension - { - template<typename T> - struct category_of_impl; - - template<> - struct category_of_impl<boost_tuple_tag> - { - template<typename T> - struct apply - { - typedef forward_traversal_tag type; - }; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp deleted file mode 100644 index 8f2fbeec8f..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/convert_impl.hpp +++ /dev/null @@ -1,50 +0,0 @@ -/*============================================================================= - Copyright (c) 2012-2014 Kohei Takahashi - - Distributed under the 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_CONVERT_IMPL_10172012_0120) -#define BOOST_FUSION_CONVERT_IMPL_10172012_0120 - -#include <boost/tuple/tuple.hpp> -#include <boost/fusion/adapted/boost_tuple/detail/build_cons.hpp> -#include <boost/fusion/sequence/intrinsic/begin.hpp> -#include <boost/fusion/sequence/intrinsic/end.hpp> - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - - namespace extension - { - template <typename T> - struct convert_impl; - - template <> - struct convert_impl<boost_tuple_tag> - { - template <typename Sequence> - struct apply - { - typedef typename - detail::build_tuple_cons< - typename result_of::begin<Sequence>::type - , typename result_of::end<Sequence>::type - > - build_tuple_cons; - - typedef typename build_tuple_cons::type type; - - BOOST_FUSION_GPU_ENABLED - static type - call(Sequence& seq) - { - return build_tuple_cons::call(fusion::begin(seq), fusion::end(seq)); - } - }; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp deleted file mode 100644 index 9f7f07c3a1..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/end_impl.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_END_IMPL_09272006_0721) -#define BOOST_FUSION_END_IMPL_09272006_0721 - -#include <boost/fusion/support/config.hpp> -#include <boost/fusion/adapted/boost_tuple/boost_tuple_iterator.hpp> -#include <boost/mpl/if.hpp> -#include <boost/type_traits/is_const.hpp> - -namespace boost { namespace tuples -{ - struct null_type; -}} - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - - namespace extension - { - template <typename Tag> - struct end_impl; - - template <> - struct end_impl<boost_tuple_tag> - { - template <typename Sequence> - struct apply - { - typedef - boost_tuple_iterator< - typename mpl::if_< - is_const<Sequence> - , tuples::null_type const - , tuples::null_type - >::type - > - type; - - BOOST_FUSION_GPU_ENABLED - static type - call(Sequence& seq) - { - return type(seq); - } - }; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp deleted file mode 100644 index eb4a1185e0..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/is_sequence_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_IS_SEQUENCE_IMPL_09272006_0726) -#define BOOST_FUSION_IS_SEQUENCE_IMPL_09272006_0726 - -#include <boost/fusion/support/config.hpp> -#include <boost/mpl/bool.hpp> - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - - namespace extension - { - template<typename Tag> - struct is_sequence_impl; - - template<> - struct is_sequence_impl<boost_tuple_tag> - { - template<typename Sequence> - struct apply : mpl::true_ {}; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp deleted file mode 100644 index 6384411034..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/is_view_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_IS_VIEW_IMPL_09272006_0725) -#define BOOST_FUSION_IS_VIEW_IMPL_09272006_0725 - -#include <boost/fusion/support/config.hpp> -#include <boost/mpl/bool.hpp> - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - - namespace extension - { - template<typename Tag> - struct is_view_impl; - - template<> - struct is_view_impl<boost_tuple_tag> - { - template<typename T> - struct apply : mpl::false_ {}; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp deleted file mode 100644 index 371627867b..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/size_impl.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_SIZE_IMPL_09272006_0724) -#define BOOST_FUSION_SIZE_IMPL_09272006_0724 - -#include <boost/fusion/support/config.hpp> -#include <boost/tuple/tuple.hpp> -#include <boost/mpl/int.hpp> - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - - namespace extension - { - template<typename T> - struct size_impl; - - template <> - struct size_impl<boost_tuple_tag> - { - template <typename Sequence> - struct apply : mpl::int_<tuples::length<Sequence>::value> {}; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp deleted file mode 100644 index 3999271368..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/detail/value_at_impl.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_VALUE_AT_IMPL_09262006_1926) -#define BOOST_FUSION_VALUE_AT_IMPL_09262006_1926 - -#include <boost/fusion/support/config.hpp> -#include <boost/tuple/tuple.hpp> - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - - namespace extension - { - template<typename T> - struct value_at_impl; - - template <> - struct value_at_impl<boost_tuple_tag> - { - template <typename Sequence, typename N> - struct apply : tuples::element<N::value, Sequence> {}; - }; - } -}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/mpl/clear.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/mpl/clear.hpp deleted file mode 100644 index 1cca019c6d..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/mpl/clear.hpp +++ /dev/null @@ -1,23 +0,0 @@ -/*============================================================================= - Copyright (c) 2012 Kohei Takahashi - - Distributed under the 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_CLEAR_10172012_0100) -#define BOOST_FUSION_CLEAR_10172012_0100 - -#include <boost/mpl/identity.hpp> -#include <boost/fusion/adapted/boost_tuple/tag_of.hpp> - -namespace boost { namespace fusion { namespace detail { - - template <typename Tag> - struct clear; - - template <> - struct clear<boost_tuple_tag> : mpl::identity<boost::tuple<> > {}; - -}}} - -#endif diff --git a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/tag_of.hpp b/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/tag_of.hpp deleted file mode 100644 index cf24ffbf80..0000000000 --- a/contrib/restricted/boost/fusion/include/boost/fusion/adapted/boost_tuple/tag_of.hpp +++ /dev/null @@ -1,115 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2011 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(BOOST_FUSION_TAG_OF_09262006_1900) -#define BOOST_FUSION_TAG_OF_09262006_1900 - -#include <boost/fusion/support/config.hpp> -#include <boost/fusion/support/tag_of_fwd.hpp> - -namespace boost { namespace tuples -{ - struct null_type; - - template < - class T0, class T1, class T2, class T3, class T4, - class T5, class T6, class T7, class T8, class T9 - > - class tuple; - - template <class Head, class Tail> - struct cons; -}} - -namespace boost { namespace fusion -{ - struct boost_tuple_tag; - struct fusion_sequence_tag; - - namespace traits - { - template < - class T0, class T1, class T2, class T3, class T4, - class T5, class T6, class T7, class T8, class T9 - > -#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) - struct tag_of<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>, void > -#else - struct tag_of<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> > -#endif - { - typedef boost_tuple_tag type; - }; - - template <class Head, class Tail> -#if defined(BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS) - struct tag_of<tuples::cons<Head, Tail>, void > -#else - struct tag_of<tuples::cons<Head, Tail> > -#endif - { - typedef boost_tuple_tag type; - }; - - template <> - struct tag_of<tuples::null_type> - { - typedef boost_tuple_tag type; - }; - } -}} - -namespace boost { namespace mpl -{ - template<typename> - 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<tuples::tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> > - { - 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<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> const - > - { - typedef fusion::fusion_sequence_tag type; - }; - - template <class Head, class Tail> - struct sequence_tag<tuples::cons<Head, Tail> > - { - typedef fusion::fusion_sequence_tag type; - }; - - template <class Head, class Tail> - struct sequence_tag<tuples::cons<Head, Tail> const> - { - typedef fusion::fusion_sequence_tag type; - }; - - template <> - struct sequence_tag<tuples::null_type> - { - typedef fusion::fusion_sequence_tag type; - }; - - template <> - struct sequence_tag<tuples::null_type const> - { - typedef fusion::fusion_sequence_tag type; - }; -}} - -#endif diff --git a/contrib/restricted/boost/iterator/include/boost/indirect_reference.hpp b/contrib/restricted/boost/iterator/include/boost/indirect_reference.hpp deleted file mode 100644 index 3279cd052c..0000000000 --- a/contrib/restricted/boost/iterator/include/boost/indirect_reference.hpp +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef INDIRECT_REFERENCE_DWA200415_HPP -# define INDIRECT_REFERENCE_DWA200415_HPP - -// -// Copyright David Abrahams 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) -// -// typename indirect_reference<P>::type provides the type of *p. -// -// http://www.boost.org/libs/iterator/doc/pointee.html -// - -# include <boost/detail/is_incrementable.hpp> -# include <boost/iterator/iterator_traits.hpp> -# include <boost/type_traits/remove_cv.hpp> -# include <boost/mpl/eval_if.hpp> -# include <boost/pointee.hpp> - -namespace boost { - -namespace detail -{ - template <class P> - struct smart_ptr_reference - { - typedef typename boost::pointee<P>::type& type; - }; -} - -template <class P> -struct indirect_reference - : mpl::eval_if< - detail::is_incrementable<P> - , iterator_reference<P> - , detail::smart_ptr_reference<P> - > -{ -}; - -} // namespace boost - -#endif // INDIRECT_REFERENCE_DWA200415_HPP diff --git a/contrib/restricted/boost/iterator/include/boost/iterator/indirect_iterator.hpp b/contrib/restricted/boost/iterator/include/boost/iterator/indirect_iterator.hpp deleted file mode 100644 index e15ac87e44..0000000000 --- a/contrib/restricted/boost/iterator/include/boost/iterator/indirect_iterator.hpp +++ /dev/null @@ -1,145 +0,0 @@ -// (C) Copyright David Abrahams 2002. -// (C) Copyright Jeremy Siek 2002. -// (C) Copyright Thomas Witt 2002. -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -#ifndef BOOST_INDIRECT_ITERATOR_23022003THW_HPP -#define BOOST_INDIRECT_ITERATOR_23022003THW_HPP - -#include <boost/iterator/iterator_adaptor.hpp> - -#include <boost/pointee.hpp> -#include <boost/indirect_reference.hpp> - -#include <boost/detail/indirect_traits.hpp> - -#include <boost/type_traits/is_same.hpp> -#include <boost/type_traits/add_reference.hpp> - -#include <boost/mpl/bool.hpp> -#include <boost/mpl/identity.hpp> -#include <boost/mpl/eval_if.hpp> -#include <boost/mpl/not.hpp> -#include <boost/mpl/has_xxx.hpp> - -#include <iterator> - -#ifdef BOOST_MPL_CFG_NO_HAS_XXX -# include <boost/shared_ptr.hpp> -# include <boost/scoped_ptr.hpp> -# include <boost/mpl/bool.hpp> -# include <memory> -#endif - -#include <boost/iterator/detail/config_def.hpp> // must be last #include - -namespace boost { -namespace iterators { - - template <class Iter, class Value, class Category, class Reference, class Difference> - class indirect_iterator; - - namespace detail - { - template <class Iter, class Value, class Category, class Reference, class Difference> - struct indirect_base - { - typedef typename std::iterator_traits<Iter>::value_type dereferenceable; - - typedef iterator_adaptor< - indirect_iterator<Iter, Value, Category, Reference, Difference> - , Iter - , typename ia_dflt_help< - Value, pointee<dereferenceable> - >::type - , Category - , typename ia_dflt_help< - Reference - , mpl::eval_if< - is_same<Value,use_default> - , indirect_reference<dereferenceable> - , add_reference<Value> - > - >::type - , Difference - > type; - }; - - template <> - struct indirect_base<int, int, int, int, int> {}; - } // namespace detail - - - template < - class Iterator - , class Value = use_default - , class Category = use_default - , class Reference = use_default - , class Difference = use_default - > - class indirect_iterator - : public detail::indirect_base< - Iterator, Value, Category, Reference, Difference - >::type - { - typedef typename detail::indirect_base< - Iterator, Value, Category, Reference, Difference - >::type super_t; - - friend class iterator_core_access; - - public: - indirect_iterator() {} - - indirect_iterator(Iterator iter) - : super_t(iter) {} - - template < - class Iterator2, class Value2, class Category2 - , class Reference2, class Difference2 - > - indirect_iterator( - indirect_iterator< - Iterator2, Value2, Category2, Reference2, Difference2 - > const& y - , typename enable_if_convertible<Iterator2, Iterator>::type* = 0 - ) - : super_t(y.base()) - {} - - private: - typename super_t::reference dereference() const - { -# if BOOST_WORKAROUND(BOOST_BORLANDC, < 0x5A0 ) - return const_cast<super_t::reference>(**this->base()); -# else - return **this->base(); -# endif - } - }; - - template <class Iter> - inline - indirect_iterator<Iter> make_indirect_iterator(Iter x) - { - return indirect_iterator<Iter>(x); - } - - template <class Traits, class Iter> - inline - indirect_iterator<Iter,Traits> make_indirect_iterator(Iter x, Traits* = 0) - { - return indirect_iterator<Iter, Traits>(x); - } - -} // namespace iterators - -using iterators::indirect_iterator; -using iterators::make_indirect_iterator; - -} // namespace boost - -#include <boost/iterator/detail/config_undef.hpp> - -#endif // BOOST_INDIRECT_ITERATOR_23022003THW_HPP diff --git a/contrib/restricted/boost/iterator/include/boost/iterator/zip_iterator.hpp b/contrib/restricted/boost/iterator/include/boost/iterator/zip_iterator.hpp deleted file mode 100644 index f5780aeb8e..0000000000 --- a/contrib/restricted/boost/iterator/include/boost/iterator/zip_iterator.hpp +++ /dev/null @@ -1,367 +0,0 @@ -// Copyright David Abrahams and Thomas Becker 2000-2006. -// Copyright Kohei Takahashi 2012-2014. -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#ifndef BOOST_ZIP_ITERATOR_TMB_07_13_2003_HPP_ -# define BOOST_ZIP_ITERATOR_TMB_07_13_2003_HPP_ - -#include <stddef.h> -#include <boost/iterator/iterator_traits.hpp> -#include <boost/iterator/iterator_facade.hpp> -#include <boost/iterator/iterator_adaptor.hpp> // for enable_if_convertible -#include <boost/iterator/iterator_categories.hpp> - -#include <boost/iterator/minimum_category.hpp> - -#include <utility> // for std::pair -#include <boost/fusion/adapted/boost_tuple.hpp> // for backward compatibility - -#include <boost/type_traits/remove_reference.hpp> -#include <boost/type_traits/remove_cv.hpp> - -#include <boost/mpl/at.hpp> -#include <boost/mpl/fold.hpp> -#include <boost/mpl/transform.hpp> -#include <boost/mpl/placeholders.hpp> - -#include <boost/fusion/algorithm/iteration/for_each.hpp> -#include <boost/fusion/algorithm/transformation/transform.hpp> -#include <boost/fusion/sequence/convert.hpp> -#include <boost/fusion/sequence/intrinsic/at_c.hpp> -#include <boost/fusion/sequence/comparison/equal_to.hpp> -#include <boost/fusion/support/tag_of_fwd.hpp> - -namespace boost { -namespace iterators { - - // Zip iterator forward declaration for zip_iterator_base - template<typename IteratorTuple> - class zip_iterator; - - namespace detail - { - - // Functors to be used with tuple algorithms - // - template<typename DiffType> - class advance_iterator - { - public: - advance_iterator(DiffType step) : m_step(step) {} - - template<typename Iterator> - void operator()(Iterator& it) const - { it += m_step; } - - private: - DiffType m_step; - }; - // - struct increment_iterator - { - template<typename Iterator> - void operator()(Iterator& it) const - { ++it; } - }; - // - struct decrement_iterator - { - template<typename Iterator> - void operator()(Iterator& it) const - { --it; } - }; - // - struct dereference_iterator - { - template<typename> - struct result; - - template<typename This, typename Iterator> - struct result<This(Iterator)> - { - typedef typename - remove_cv<typename remove_reference<Iterator>::type>::type - iterator; - - typedef typename iterator_reference<iterator>::type type; - }; - - template<typename Iterator> - typename result<dereference_iterator(Iterator)>::type - operator()(Iterator const& it) const - { return *it; } - }; - - // Metafunction to obtain the type of the tuple whose element types - // are the reference types of an iterator tuple. - // - template<typename IteratorTuple> - struct tuple_of_references - : mpl::transform< - IteratorTuple, - iterator_reference<mpl::_1> - > - { - }; - - // Specialization for std::pair - template<typename Iterator1, typename Iterator2> - struct tuple_of_references<std::pair<Iterator1, Iterator2> > - { - typedef std::pair< - typename iterator_reference<Iterator1>::type - , typename iterator_reference<Iterator2>::type - > type; - }; - - // Metafunction to obtain the minimal traversal tag in a tuple - // of iterators. - // - template<typename IteratorTuple> - struct minimum_traversal_category_in_iterator_tuple - { - typedef typename mpl::transform< - IteratorTuple - , pure_traversal_tag<iterator_traversal<> > - >::type tuple_of_traversal_tags; - - typedef typename mpl::fold< - tuple_of_traversal_tags - , random_access_traversal_tag - , minimum_category<> - >::type type; - }; - - template<typename Iterator1, typename Iterator2> - struct minimum_traversal_category_in_iterator_tuple<std::pair<Iterator1, Iterator2> > - { - typedef typename pure_traversal_tag< - typename iterator_traversal<Iterator1>::type - >::type iterator1_traversal; - typedef typename pure_traversal_tag< - typename iterator_traversal<Iterator2>::type - >::type iterator2_traversal; - - typedef typename minimum_category< - iterator1_traversal - , typename minimum_category< - iterator2_traversal - , random_access_traversal_tag - >::type - >::type type; - }; - - /////////////////////////////////////////////////////////////////// - // - // Class zip_iterator_base - // - // Builds and exposes the iterator facade type from which the zip - // iterator will be derived. - // - template<typename IteratorTuple> - struct zip_iterator_base - { - private: - // Reference type is the type of the tuple obtained from the - // iterators' reference types. - typedef typename - detail::tuple_of_references<IteratorTuple>::type reference; - - // Value type is the same as reference type. - typedef reference value_type; - - // Difference type is the first iterator's difference type - typedef typename iterator_difference< - typename mpl::at_c<IteratorTuple, 0>::type - >::type difference_type; - - // Traversal catetgory is the minimum traversal category in the - // iterator tuple. - typedef typename - detail::minimum_traversal_category_in_iterator_tuple< - IteratorTuple - >::type traversal_category; - public: - - // The iterator facade type from which the zip iterator will - // be derived. - typedef iterator_facade< - zip_iterator<IteratorTuple>, - value_type, - traversal_category, - reference, - difference_type - > type; - }; - - template <> - struct zip_iterator_base<int> - { - typedef int type; - }; - - template <typename reference> - struct converter - { - template <typename Seq> - static reference call(Seq seq) - { - typedef typename fusion::traits::tag_of<reference>::type tag; - return fusion::convert<tag>(seq); - } - }; - - template <typename Reference1, typename Reference2> - struct converter<std::pair<Reference1, Reference2> > - { - typedef std::pair<Reference1, Reference2> reference; - template <typename Seq> - static reference call(Seq seq) - { - return reference( - fusion::at_c<0>(seq) - , fusion::at_c<1>(seq)); - } - }; - } - - ///////////////////////////////////////////////////////////////////// - // - // zip_iterator class definition - // - template<typename IteratorTuple> - class zip_iterator : - public detail::zip_iterator_base<IteratorTuple>::type - { - - // Typedef super_t as our base class. - typedef typename - detail::zip_iterator_base<IteratorTuple>::type super_t; - - // iterator_core_access is the iterator's best friend. - friend class iterator_core_access; - - public: - - // Construction - // ============ - - // Default constructor - zip_iterator() { } - - // Constructor from iterator tuple - zip_iterator(IteratorTuple iterator_tuple) - : m_iterator_tuple(iterator_tuple) - { } - - // Copy constructor - template<typename OtherIteratorTuple> - zip_iterator( - const zip_iterator<OtherIteratorTuple>& other, - typename enable_if_convertible< - OtherIteratorTuple, - IteratorTuple - >::type* = 0 - ) : m_iterator_tuple(other.get_iterator_tuple()) - {} - - // Get method for the iterator tuple. - const IteratorTuple& get_iterator_tuple() const - { return m_iterator_tuple; } - - private: - - // Implementation of Iterator Operations - // ===================================== - - // Dereferencing returns a tuple built from the dereferenced - // iterators in the iterator tuple. - typename super_t::reference dereference() const - { - typedef typename super_t::reference reference; - typedef detail::converter<reference> gen; - return gen::call(fusion::transform( - get_iterator_tuple(), - detail::dereference_iterator())); - } - - // Two zip iterators are equal if all iterators in the iterator - // tuple are equal. NOTE: It should be possible to implement this - // as - // - // return get_iterator_tuple() == other.get_iterator_tuple(); - // - // but equality of tuples currently (7/2003) does not compile - // under several compilers. No point in bringing in a bunch - // of #ifdefs here. - // - template<typename OtherIteratorTuple> - bool equal(const zip_iterator<OtherIteratorTuple>& other) const - { - return fusion::equal_to( - get_iterator_tuple(), - other.get_iterator_tuple()); - } - - // Advancing a zip iterator means to advance all iterators in the - // iterator tuple. - void advance(typename super_t::difference_type n) - { - fusion::for_each( - m_iterator_tuple, - detail::advance_iterator<BOOST_DEDUCED_TYPENAME super_t::difference_type>(n)); - } - // Incrementing a zip iterator means to increment all iterators in - // the iterator tuple. - void increment() - { - fusion::for_each( - m_iterator_tuple, - detail::increment_iterator()); - } - - // Decrementing a zip iterator means to decrement all iterators in - // the iterator tuple. - void decrement() - { - fusion::for_each( - m_iterator_tuple, - detail::decrement_iterator()); - } - - // Distance is calculated using the first iterator in the tuple. - template<typename OtherIteratorTuple> - typename super_t::difference_type distance_to( - const zip_iterator<OtherIteratorTuple>& other - ) const - { - return fusion::at_c<0>(other.get_iterator_tuple()) - - fusion::at_c<0>(this->get_iterator_tuple()); - } - - // Data Members - // ============ - - // The iterator tuple. - IteratorTuple m_iterator_tuple; - - }; - - // Make function for zip iterator - // - template<typename IteratorTuple> - inline zip_iterator<IteratorTuple> - make_zip_iterator(IteratorTuple t) - { return zip_iterator<IteratorTuple>(t); } - -} // namespace iterators - -using iterators::zip_iterator; -using iterators::make_zip_iterator; - -} // namespace boost - -#endif diff --git a/contrib/restricted/boost/odeint/CHANGELOG b/contrib/restricted/boost/odeint/CHANGELOG new file mode 100644 index 0000000000..b1537eb1ac --- /dev/null +++ b/contrib/restricted/boost/odeint/CHANGELOG @@ -0,0 +1,9 @@ +odeint 2.1 + +* versioning system +* generation functions +* bugfixing + +odeint 2.2 (still running) + +* removing same_size and resize from state_wrapper into separate functions diff --git a/contrib/restricted/boost/odeint/README.md b/contrib/restricted/boost/odeint/README.md new file mode 100644 index 0000000000..23e4f88b5d --- /dev/null +++ b/contrib/restricted/boost/odeint/README.md @@ -0,0 +1,3 @@ +[![Build Status](https://travis-ci.org/headmyshoulder/odeint-v2.svg?branch=master)](https://travis-ci.org/headmyshoulder/odeint-v2) + +odeint is a highly flexible library for solving ordinary differential equations. diff --git a/contrib/restricted/boost/random/include/boost/random/detail/uniform_int_float.hpp b/contrib/restricted/boost/random/include/boost/random/detail/uniform_int_float.hpp deleted file mode 100644 index 393c455bcd..0000000000 --- a/contrib/restricted/boost/random/include/boost/random/detail/uniform_int_float.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/* boost random/detail/uniform_int_float.hpp header file - * - * Copyright Jens Maurer 2000-2001 - * Copyright Steven Watanabe 2011 - * Distributed under the 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$ - * - */ - -#ifndef BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP -#define BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP - -#include <boost/limits.hpp> -#include <boost/config.hpp> -#include <boost/integer.hpp> -#include <boost/random/detail/config.hpp> -#include <boost/random/detail/generator_bits.hpp> - -#include <boost/random/detail/disable_warnings.hpp> - -namespace boost { -namespace random { -namespace detail { - -template<class URNG> -class uniform_int_float -{ -public: - typedef URNG base_type; - typedef typename base_type::result_type base_result; - - typedef typename boost::uint_t< - (std::numeric_limits<boost::uintmax_t>::digits < - std::numeric_limits<base_result>::digits)? - std::numeric_limits<boost::uintmax_t>::digits : - std::numeric_limits<base_result>::digits - >::fast result_type; - - uniform_int_float(base_type& rng) - : _rng(rng) {} - - static result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () - { return 0; } - static result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () - { - std::size_t digits = std::numeric_limits<result_type>::digits; - if(detail::generator_bits<URNG>::value() < digits) { - digits = detail::generator_bits<URNG>::value(); - } - return (result_type(2) << (digits - 1)) - 1; - } - base_type& base() { return _rng; } - const base_type& base() const { return _rng; } - - result_type operator()() - { - base_result range = static_cast<base_result>((max)())+1; - return static_cast<result_type>(_rng() * range); - } - -private: - base_type& _rng; -}; - -} // namespace detail -} // namespace random -} // namespace boost - -#include <boost/random/detail/enable_warnings.hpp> - -#endif // BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP diff --git a/contrib/restricted/boost/random/include/boost/random/uniform_int.hpp b/contrib/restricted/boost/random/include/boost/random/uniform_int.hpp deleted file mode 100644 index 4362652593..0000000000 --- a/contrib/restricted/boost/random/include/boost/random/uniform_int.hpp +++ /dev/null @@ -1,99 +0,0 @@ -/* boost random/uniform_int.hpp header file - * - * Copyright Jens Maurer 2000-2001 - * Distributed under the 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$ - * - * Revision history - * 2001-04-08 added min<max assertion (N. Becker) - * 2001-02-18 moved to individual header files - */ - -#ifndef BOOST_RANDOM_UNIFORM_INT_HPP -#define BOOST_RANDOM_UNIFORM_INT_HPP - -#include <boost/assert.hpp> -#include <boost/random/uniform_int_distribution.hpp> - -namespace boost { - -/** - * The distribution function uniform_int models a \random_distribution. - * On each invocation, it returns a random integer value uniformly - * distributed in the set of integer numbers {min, min+1, min+2, ..., max}. - * - * The template parameter IntType shall denote an integer-like value type. - * - * This class is deprecated. Please use @c uniform_int_distribution in - * new code. - */ -template<class IntType = int> -class uniform_int : public random::uniform_int_distribution<IntType> -{ - typedef random::uniform_int_distribution<IntType> base_type; -public: - - class param_type : public base_type::param_type - { - public: - typedef uniform_int distribution_type; - /** - * Constructs the parameters of a uniform_int distribution. - * - * Requires: min <= max - */ - explicit param_type(IntType min_arg = 0, IntType max_arg = 9) - : base_type::param_type(min_arg, max_arg) - {} - }; - - /** - * 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) - : base_type(min_arg, max_arg) - {} - - /** Constructs a uniform_int distribution from its parameters. */ - explicit uniform_int(const param_type& parm) - : base_type(parm) - {} - - /** Returns the parameters of the distribution */ - param_type param() const { return param_type(this->a(), this->b()); } - /** Sets the parameters of the distribution. */ - void param(const param_type& parm) { this->base_type::param(parm); } - - // Codergear seems to have trouble with a using declaration here - - template<class Engine> - IntType operator()(Engine& eng) const - { - return static_cast<const base_type&>(*this)(eng); - } - - template<class Engine> - IntType operator()(Engine& eng, const param_type& parm) const - { - return static_cast<const base_type&>(*this)(eng, parm); - } - - template<class Engine> - IntType operator()(Engine& eng, IntType n) const - { - BOOST_ASSERT(n > 0); - return static_cast<const base_type&>(*this)(eng, param_type(0, n - 1)); - } -}; - -} // namespace boost - -#endif // BOOST_RANDOM_UNIFORM_INT_HPP diff --git a/contrib/restricted/boost/random/include/boost/random/uniform_int_distribution.hpp b/contrib/restricted/boost/random/include/boost/random/uniform_int_distribution.hpp deleted file mode 100644 index 8a3ea7b89f..0000000000 --- a/contrib/restricted/boost/random/include/boost/random/uniform_int_distribution.hpp +++ /dev/null @@ -1,419 +0,0 @@ -/* boost random/uniform_int_distribution.hpp header file - * - * Copyright Jens Maurer 2000-2001 - * Copyright Steven Watanabe 2011 - * Distributed under the 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$ - * - * Revision history - * 2001-04-08 added min<max assertion (N. Becker) - * 2001-02-18 moved to individual header files - */ - -#ifndef BOOST_RANDOM_UNIFORM_INT_DISTRIBUTION_HPP -#define BOOST_RANDOM_UNIFORM_INT_DISTRIBUTION_HPP - -#include <iosfwd> -#include <ios> -#include <istream> -#include <boost/config.hpp> -#include <boost/limits.hpp> -#include <boost/assert.hpp> -#include <boost/random/detail/config.hpp> -#include <boost/random/detail/operators.hpp> -#include <boost/random/detail/uniform_int_float.hpp> -#include <boost/random/detail/signed_unsigned_tools.hpp> -#include <boost/random/traits.hpp> -#include <boost/type_traits/integral_constant.hpp> -#ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS -#include <boost/type_traits/conditional.hpp> -#endif - -namespace boost { -namespace random { -namespace detail { - - -#ifdef BOOST_MSVC -#pragma warning(push) -// disable division by zero warning, since we can't -// actually divide by zero. -#pragma warning(disable:4723) -#endif - -template<class Engine, class T> -T generate_uniform_int( - Engine& eng, T min_value, T max_value, - boost::true_type /** is_integral<Engine::result_type> */) -{ - typedef T result_type; - typedef typename boost::random::traits::make_unsigned_or_unbounded<T>::type range_type; - typedef typename Engine::result_type base_result; - // ranges are always unsigned or unbounded - typedef typename boost::random::traits::make_unsigned_or_unbounded<base_result>::type base_unsigned; - const range_type range = random::detail::subtract<result_type>()(max_value, min_value); - const base_result bmin = (eng.min)(); - const base_unsigned brange = - random::detail::subtract<base_result>()((eng.max)(), (eng.min)()); - - if(range == 0) { - return min_value; - } else if(brange == range) { - // this will probably never happen in real life - // basically nothing to do; just take care we don't overflow / underflow - base_unsigned v = random::detail::subtract<base_result>()(eng(), bmin); - return random::detail::add<base_unsigned, result_type>()(v, min_value); - } else if(brange < range) { - // use rejection method to handle things like 0..3 --> 0..4 - for(;;) { - // concatenate several invocations of the base RNG - // take extra care to avoid overflows - - // limit == floor((range+1)/(brange+1)) - // Therefore limit*(brange+1) <= range+1 - range_type limit; - if(range == (std::numeric_limits<range_type>::max)()) { - limit = range/(range_type(brange)+1); - if(range % (range_type(brange)+1) == range_type(brange)) - ++limit; - } else { - limit = (range+1)/(range_type(brange)+1); - } - - // We consider "result" as expressed to base (brange+1): - // For every power of (brange+1), we determine a random factor - range_type result = range_type(0); - range_type mult = range_type(1); - - // loop invariants: - // result < mult - // mult <= range - while(mult <= limit) { - // Postcondition: result <= range, thus no overflow - // - // limit*(brange+1)<=range+1 def. of limit (1) - // eng()-bmin<=brange eng() post. (2) - // and mult<=limit. loop condition (3) - // Therefore mult*(eng()-bmin+1)<=range+1 by (1),(2),(3) (4) - // Therefore mult*(eng()-bmin)+mult<=range+1 rearranging (4) (5) - // result<mult loop invariant (6) - // Therefore result+mult*(eng()-bmin)<range+1 by (5), (6) (7) - // - // Postcondition: result < mult*(brange+1) - // - // result<mult loop invariant (1) - // eng()-bmin<=brange eng() post. (2) - // Therefore result+mult*(eng()-bmin) < - // mult+mult*(eng()-bmin) by (1) (3) - // Therefore result+(eng()-bmin)*mult < - // mult+mult*brange by (2), (3) (4) - // Therefore result+(eng()-bmin)*mult < - // mult*(brange+1) by (4) - result += static_cast<range_type>(static_cast<range_type>(random::detail::subtract<base_result>()(eng(), bmin)) * mult); - - // equivalent to (mult * (brange+1)) == range+1, but avoids overflow. - if(mult * range_type(brange) == range - mult + 1) { - // The destination range is an integer power of - // the generator's range. - return(result); - } - - // Postcondition: mult <= range - // - // limit*(brange+1)<=range+1 def. of limit (1) - // mult<=limit loop condition (2) - // Therefore mult*(brange+1)<=range+1 by (1), (2) (3) - // mult*(brange+1)!=range+1 preceding if (4) - // Therefore mult*(brange+1)<range+1 by (3), (4) (5) - // - // Postcondition: result < mult - // - // See the second postcondition on the change to result. - mult *= range_type(brange)+range_type(1); - } - // loop postcondition: range/mult < brange+1 - // - // mult > limit loop condition (1) - // Suppose range/mult >= brange+1 Assumption (2) - // range >= mult*(brange+1) by (2) (3) - // range+1 > mult*(brange+1) by (3) (4) - // range+1 > (limit+1)*(brange+1) by (1), (4) (5) - // (range+1)/(brange+1) > limit+1 by (5) (6) - // limit < floor((range+1)/(brange+1)) by (6) (7) - // limit==floor((range+1)/(brange+1)) def. of limit (8) - // not (2) reductio (9) - // - // loop postcondition: (range/mult)*mult+(mult-1) >= range - // - // (range/mult)*mult + range%mult == range identity (1) - // range%mult < mult def. of % (2) - // (range/mult)*mult+mult > range by (1), (2) (3) - // (range/mult)*mult+(mult-1) >= range by (3) (4) - // - // Note that the maximum value of result at this point is (mult-1), - // so after this final step, we generate numbers that can be - // at least as large as range. We have to really careful to avoid - // overflow in this final addition and in the rejection. Anything - // that overflows is larger than range and can thus be rejected. - - // range/mult < brange+1 -> no endless loop - range_type result_increment = - generate_uniform_int( - eng, - static_cast<range_type>(0), - static_cast<range_type>(range/mult), - boost::true_type()); - if(std::numeric_limits<range_type>::is_bounded && ((std::numeric_limits<range_type>::max)() / mult < result_increment)) { - // The multiplcation would overflow. Reject immediately. - continue; - } - result_increment *= mult; - // unsigned integers are guaranteed to wrap on overflow. - result += result_increment; - if(result < result_increment) { - // The addition overflowed. Reject. - continue; - } - if(result > range) { - // Too big. Reject. - continue; - } - return random::detail::add<range_type, result_type>()(result, min_value); - } - } else { // brange > range -#ifdef BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS - typedef typename conditional< - std::numeric_limits<range_type>::is_specialized && std::numeric_limits<base_unsigned>::is_specialized - && (std::numeric_limits<range_type>::digits >= std::numeric_limits<base_unsigned>::digits), - range_type, base_unsigned>::type mixed_range_type; -#else - typedef base_unsigned mixed_range_type; -#endif - - mixed_range_type bucket_size; - // it's safe to add 1 to range, as long as we cast it first, - // because we know that it is less than brange. However, - // we do need to be careful not to cause overflow by adding 1 - // to brange. We use mixed_range_type throughout for mixed - // arithmetic between base_unsigned and range_type - in the case - // that range_type has more bits than base_unsigned it is always - // safe to use range_type for this albeit it may be more effient - // to use base_unsigned. The latter is a narrowing conversion though - // which may be disallowed if range_type is a multiprecision type - // and there are no explicit converison operators. - - if(brange == (std::numeric_limits<base_unsigned>::max)()) { - bucket_size = static_cast<mixed_range_type>(brange) / (static_cast<mixed_range_type>(range)+1); - if(static_cast<mixed_range_type>(brange) % (static_cast<mixed_range_type>(range)+1) == static_cast<mixed_range_type>(range)) { - ++bucket_size; - } - } else { - bucket_size = static_cast<mixed_range_type>(brange + 1) / (static_cast<mixed_range_type>(range)+1); - } - for(;;) { - mixed_range_type result = - random::detail::subtract<base_result>()(eng(), bmin); - result /= bucket_size; - // result and range are non-negative, and result is possibly larger - // than range, so the cast is safe - if(result <= static_cast<mixed_range_type>(range)) - return random::detail::add<mixed_range_type, result_type>()(result, min_value); - } - } -} - -#ifdef BOOST_MSVC -#pragma warning(pop) -#endif - -template<class Engine, class T> -inline T generate_uniform_int( - Engine& eng, T min_value, T max_value, - boost::false_type /** is_integral<Engine::result_type> */) -{ - uniform_int_float<Engine> wrapper(eng); - return generate_uniform_int(wrapper, min_value, max_value, boost::true_type()); -} - -template<class Engine, class T> -inline T generate_uniform_int(Engine& eng, T min_value, T max_value) -{ - typedef typename Engine::result_type base_result; - return generate_uniform_int(eng, min_value, max_value, - boost::random::traits::is_integral<base_result>()); -} - -} - -/** - * The class template uniform_int_distribution models a \random_distribution. - * On each invocation, it returns a random integer value uniformly - * distributed in the set of integers {min, min+1, min+2, ..., max}. - * - * The template parameter IntType shall denote an integer-like value type. - */ -template<class IntType = int> -class uniform_int_distribution -{ -public: - typedef IntType input_type; - typedef IntType result_type; - - class param_type - { - public: - - typedef uniform_int_distribution distribution_type; - - /** - * Constructs the parameters of a uniform_int_distribution. - * - * Requires min <= max - */ - explicit param_type( - IntType min_arg = 0, - IntType max_arg = (std::numeric_limits<IntType>::max)()) - : _min(min_arg), _max(max_arg) - { - BOOST_ASSERT(_min <= _max); - } - - /** Returns the minimum value of the distribution. */ - IntType a() const { return _min; } - /** Returns the maximum value of the distribution. */ - IntType b() const { return _max; } - - /** Writes the parameters to a @c std::ostream. */ - BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, param_type, parm) - { - os << parm._min << " " << parm._max; - return os; - } - - /** Reads the parameters from a @c std::istream. */ - BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm) - { - IntType min_in, max_in; - if(is >> min_in >> std::ws >> max_in) { - if(min_in <= max_in) { - parm._min = min_in; - parm._max = max_in; - } else { - is.setstate(std::ios_base::failbit); - } - } - return is; - } - - /** Returns true if the two sets of parameters are equal. */ - BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(param_type, lhs, rhs) - { return lhs._min == rhs._min && lhs._max == rhs._max; } - - /** Returns true if the two sets of parameters are different. */ - BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(param_type) - - private: - - IntType _min; - IntType _max; - }; - - /** - * Constructs a uniform_int_distribution. @c min and @c max are - * the parameters of the distribution. - * - * Requires: min <= max - */ - explicit uniform_int_distribution( - IntType min_arg = 0, - IntType max_arg = (std::numeric_limits<IntType>::max)()) - : _min(min_arg), _max(max_arg) - { - BOOST_ASSERT(min_arg <= max_arg); - } - /** Constructs a uniform_int_distribution from its parameters. */ - explicit uniform_int_distribution(const param_type& parm) - : _min(parm.a()), _max(parm.b()) {} - - /** Returns the minimum value of the distribution */ - IntType min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; } - /** Returns the maximum value of the distribution */ - IntType max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; } - - /** Returns the minimum value of the distribution */ - IntType a() const { return _min; } - /** Returns the maximum value of the distribution */ - IntType b() const { return _max; } - - /** Returns the parameters of the distribution. */ - param_type param() const { return param_type(_min, _max); } - /** Sets the parameters of the distribution. */ - void param(const param_type& parm) - { - _min = parm.a(); - _max = parm.b(); - } - - /** - * Effects: Subsequent uses of the distribution do not depend - * on values produced by any engine prior to invoking reset. - */ - void reset() { } - - /** Returns an integer uniformly distributed in the range [min, max]. */ - template<class Engine> - result_type operator()(Engine& eng) const - { return detail::generate_uniform_int(eng, _min, _max); } - - /** - * Returns an integer uniformly distributed in the range - * [param.a(), param.b()]. - */ - template<class Engine> - result_type operator()(Engine& eng, const param_type& parm) const - { return detail::generate_uniform_int(eng, parm.a(), parm.b()); } - - /** Writes the distribution to a @c std::ostream. */ - BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, uniform_int_distribution, ud) - { - os << ud.param(); - return os; - } - - /** Reads the distribution from a @c std::istream. */ - BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, uniform_int_distribution, ud) - { - param_type parm; - if(is >> parm) { - ud.param(parm); - } - return is; - } - - /** - * Returns true if the two distributions will produce identical sequences - * of values given equal generators. - */ - BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(uniform_int_distribution, lhs, rhs) - { return lhs._min == rhs._min && lhs._max == rhs._max; } - - /** - * Returns true if the two distributions may produce different sequences - * of values given equal generators. - */ - BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(uniform_int_distribution) - -private: - IntType _min; - IntType _max; -}; - -} // namespace random -} // namespace boost - -#endif // BOOST_RANDOM_UNIFORM_INT_HPP diff --git a/contrib/restricted/boost/random/include/boost/random/uniform_real.hpp b/contrib/restricted/boost/random/include/boost/random/uniform_real.hpp deleted file mode 100644 index c98626e779..0000000000 --- a/contrib/restricted/boost/random/include/boost/random/uniform_real.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/* boost random/uniform_real.hpp header file - * - * Copyright Jens Maurer 2000-2001 - * Distributed under the 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$ - * - * Revision history - * 2001-04-08 added min<max assertion (N. Becker) - * 2001-02-18 moved to individual header files - */ - -#ifndef BOOST_RANDOM_UNIFORM_REAL_HPP -#define BOOST_RANDOM_UNIFORM_REAL_HPP - -#include <boost/assert.hpp> -#include <boost/config.hpp> -#include <boost/limits.hpp> -#include <boost/random/uniform_real_distribution.hpp> - -namespace boost { - -/** - * The distribution function uniform_real models a random distribution. - * On each invocation, it returns a random floating-point value uniformly - * distributed in the range [min..max). - * - * This class is deprecated. Please use @c uniform_real_distribution in - * new code. - */ -template<class RealType = double> -class uniform_real : public random::uniform_real_distribution<RealType> -{ - typedef random::uniform_real_distribution<RealType> base_type; -public: - - class param_type : public base_type::param_type - { - public: - typedef uniform_real distribution_type; - /** - * Constructs the parameters of a uniform_real distribution. - * - * Requires: min <= max - */ - explicit param_type(RealType min_arg = RealType(0.0), - RealType max_arg = RealType(1.0)) - : base_type::param_type(min_arg, max_arg) - {} - }; - - /** - * 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.0), - RealType max_arg = RealType(1.0)) - : base_type(min_arg, max_arg) - { - BOOST_ASSERT(min_arg < max_arg); - } - - /** Constructs a uniform_real distribution from its parameters. */ - explicit uniform_real(const param_type& parm) - : base_type(parm) - {} - - /** Returns the parameters of the distribution */ - param_type param() const { return param_type(this->a(), this->b()); } - /** Sets the parameters of the distribution. */ - void param(const param_type& parm) { this->base_type::param(parm); } -}; - -} // namespace boost - -#endif // BOOST_RANDOM_UNIFORM_REAL_HPP diff --git a/contrib/restricted/boost/random/include/boost/random/uniform_real_distribution.hpp b/contrib/restricted/boost/random/include/boost/random/uniform_real_distribution.hpp deleted file mode 100644 index ebbc351a60..0000000000 --- a/contrib/restricted/boost/random/include/boost/random/uniform_real_distribution.hpp +++ /dev/null @@ -1,240 +0,0 @@ -/* boost random/uniform_real_distribution.hpp header file - * - * Copyright Jens Maurer 2000-2001 - * Copyright Steven Watanabe 2011 - * Distributed under the 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$ - * - */ - -#ifndef BOOST_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP -#define BOOST_RANDOM_UNIFORM_REAL_DISTRIBUTION_HPP - -#include <iosfwd> -#include <ios> -#include <istream> -#include <boost/assert.hpp> -#include <boost/config.hpp> -#include <boost/random/detail/config.hpp> -#include <boost/random/detail/operators.hpp> -#include <boost/random/detail/signed_unsigned_tools.hpp> -#include <boost/type_traits/is_integral.hpp> - -namespace boost { -namespace random { -namespace detail { - -template<class Engine, class T> -T generate_uniform_real( - Engine& eng, T min_value, T max_value, - boost::false_type /** is_integral<Engine::result_type> */) -{ - for(;;) { - typedef T result_type; - result_type numerator = static_cast<T>(eng() - (eng.min)()); - result_type divisor = static_cast<T>((eng.max)() - (eng.min)()); - BOOST_ASSERT(divisor > 0); - BOOST_ASSERT(numerator >= 0 && numerator <= divisor); - T result = numerator / divisor * (max_value - min_value) + min_value; - if(result < max_value) return result; - } -} - -template<class Engine, class T> -T generate_uniform_real( - Engine& eng, T min_value, T max_value, - boost::true_type /** is_integral<Engine::result_type> */) -{ - for(;;) { - typedef T result_type; - typedef typename Engine::result_type base_result; - result_type numerator = static_cast<T>(subtract<base_result>()(eng(), (eng.min)())); - result_type divisor = static_cast<T>(subtract<base_result>()((eng.max)(), (eng.min)())) + 1; - BOOST_ASSERT(divisor > 0); - BOOST_ASSERT(numerator >= 0 && numerator <= divisor); - T result = numerator / divisor * (max_value - min_value) + min_value; - if(result < max_value) return result; - } -} - -template<class Engine, class T> -inline T generate_uniform_real(Engine& eng, T min_value, T max_value) -{ - if(max_value / 2 - min_value / 2 > (std::numeric_limits<T>::max)() / 2) - return 2 * generate_uniform_real(eng, T(min_value / 2), T(max_value / 2)); - typedef typename Engine::result_type base_result; - return generate_uniform_real(eng, min_value, max_value, - boost::is_integral<base_result>()); -} - -} - -/** - * The class template uniform_real_distribution models a \random_distribution. - * On each invocation, it returns a random floating-point value uniformly - * distributed in the range [min..max). - */ -template<class RealType = double> -class uniform_real_distribution -{ -public: - typedef RealType input_type; - typedef RealType result_type; - - class param_type - { - public: - - typedef uniform_real_distribution distribution_type; - - /** - * Constructs the parameters of a uniform_real_distribution. - * - * Requires min <= max - */ - explicit param_type(RealType min_arg = RealType(0.0), - RealType max_arg = RealType(1.0)) - : _min(min_arg), _max(max_arg) - { - BOOST_ASSERT(_min < _max); - } - - /** Returns the minimum value of the distribution. */ - RealType a() const { return _min; } - /** Returns the maximum value of the distribution. */ - RealType b() const { return _max; } - - /** Writes the parameters to a @c std::ostream. */ - BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, param_type, parm) - { - os << parm._min << " " << parm._max; - return os; - } - - /** Reads the parameters from a @c std::istream. */ - BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, param_type, parm) - { - RealType min_in, max_in; - if(is >> min_in >> std::ws >> max_in) { - if(min_in <= max_in) { - parm._min = min_in; - parm._max = max_in; - } else { - is.setstate(std::ios_base::failbit); - } - } - return is; - } - - /** Returns true if the two sets of parameters are equal. */ - BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(param_type, lhs, rhs) - { return lhs._min == rhs._min && lhs._max == rhs._max; } - - /** Returns true if the two sets of parameters are different. */ - BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(param_type) - - private: - - RealType _min; - RealType _max; - }; - - /** - * Constructs a uniform_real_distribution. @c min and @c max are - * the parameters of the distribution. - * - * Requires: min <= max - */ - explicit uniform_real_distribution( - RealType min_arg = RealType(0.0), - RealType max_arg = RealType(1.0)) - : _min(min_arg), _max(max_arg) - { - BOOST_ASSERT(min_arg < max_arg); - } - /** Constructs a uniform_real_distribution from its parameters. */ - explicit uniform_real_distribution(const param_type& parm) - : _min(parm.a()), _max(parm.b()) {} - - /** Returns the minimum value of the distribution */ - RealType min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; } - /** Returns the maximum value of the distribution */ - RealType max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; } - - /** Returns the minimum value of the distribution */ - RealType a() const { return _min; } - /** Returns the maximum value of the distribution */ - RealType b() const { return _max; } - - /** Returns the parameters of the distribution. */ - param_type param() const { return param_type(_min, _max); } - /** Sets the parameters of the distribution. */ - void param(const param_type& parm) - { - _min = parm.a(); - _max = parm.b(); - } - - /** - * Effects: Subsequent uses of the distribution do not depend - * on values produced by any engine prior to invoking reset. - */ - void reset() { } - - /** Returns a value uniformly distributed in the range [min, max). */ - template<class Engine> - result_type operator()(Engine& eng) const - { return detail::generate_uniform_real(eng, _min, _max); } - - /** - * Returns a value uniformly distributed in the range - * [param.a(), param.b()). - */ - template<class Engine> - result_type operator()(Engine& eng, const param_type& parm) const - { return detail::generate_uniform_real(eng, parm.a(), parm.b()); } - - /** Writes the distribution to a @c std::ostream. */ - BOOST_RANDOM_DETAIL_OSTREAM_OPERATOR(os, uniform_real_distribution, ud) - { - os << ud.param(); - return os; - } - - /** Reads the distribution from a @c std::istream. */ - BOOST_RANDOM_DETAIL_ISTREAM_OPERATOR(is, uniform_real_distribution, ud) - { - param_type parm; - if(is >> parm) { - ud.param(parm); - } - return is; - } - - /** - * Returns true if the two distributions will produce identical sequences - * of values given equal generators. - */ - BOOST_RANDOM_DETAIL_EQUALITY_OPERATOR(uniform_real_distribution, lhs, rhs) - { return lhs._min == rhs._min && lhs._max == rhs._max; } - - /** - * Returns true if the two distributions may produce different sequences - * of values given equal generators. - */ - BOOST_RANDOM_DETAIL_INEQUALITY_OPERATOR(uniform_real_distribution) - -private: - RealType _min; - RealType _max; -}; - -} // namespace random -} // namespace boost - -#endif // BOOST_RANDOM_UNIFORM_INT_HPP diff --git a/contrib/restricted/boost/random/include/boost/random/variate_generator.hpp b/contrib/restricted/boost/random/include/boost/random/variate_generator.hpp deleted file mode 100644 index 6d5aac4e47..0000000000 --- a/contrib/restricted/boost/random/include/boost/random/variate_generator.hpp +++ /dev/null @@ -1,122 +0,0 @@ -/* boost random/variate_generator.hpp header file - * - * Copyright Jens Maurer 2002 - * Copyright Steven Watanabe 2011 - * Distributed under the 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$ - * - */ - -#ifndef BOOST_RANDOM_RANDOM_GENERATOR_HPP -#define BOOST_RANDOM_RANDOM_GENERATOR_HPP - -#include <boost/random/detail/ptr_helper.hpp> - -#include <boost/random/detail/disable_warnings.hpp> - -namespace boost { - -/// \cond hide_private_members - -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. - * - * 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 Engine, class Distribution> -class variate_generator -{ -private: - typedef boost::random::detail::ptr_helper<Engine> helper_type; -public: - typedef typename helper_type::value_type engine_value_type; - typedef Engine engine_type; - 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(e), _dist(d) { } - - /** Returns: distribution()(engine()) */ - result_type operator()() { return _dist(engine()); } - /** - * Returns: distribution()(engine(), value). - */ - template<class T> - result_type operator()(const T& value) { return _dist(engine(), value); } - - /** - * Returns: A reference to the associated uniform random number generator. - */ - engine_value_type& engine() { return helper_type::ref(_eng); } - /** - * Returns: A reference to the associated uniform random number generator. - */ - const engine_value_type& engine() const { return helper_type::ref(_eng); } - - /** 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: - Engine _eng; - distribution_type _dist; -}; - -} // namespace random - -using random::variate_generator; - -} // namespace boost - -#include <boost/random/detail/enable_warnings.hpp> - -#endif // BOOST_RANDOM_RANDOM_GENERATOR_HPP diff --git a/contrib/restricted/boost/serialization/include/boost/serialization/array.hpp b/contrib/restricted/boost/serialization/include/boost/serialization/array.hpp deleted file mode 100644 index c038cf04de..0000000000 --- a/contrib/restricted/boost/serialization/include/boost/serialization/array.hpp +++ /dev/null @@ -1,48 +0,0 @@ -#ifndef BOOST_SERIALIZATION_ARRAY_HPP -#define BOOST_SERIALIZATION_ARRAY_HPP - -// (C) Copyright 2005 Matthias Troyer and Dave Abrahams -// 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 serialization of <array>. If <array> not supported by the standard -// library - this file becomes empty. This is to avoid breaking backward -// compatibiliy for applications which used this header to support -// serialization of native arrays. Code to serialize native arrays is -// now always include by default. RR - -#include <boost/config.hpp> // msvc 6.0 needs this for warning suppression - -#if defined(BOOST_NO_STDC_NAMESPACE) - -#include <iostream> -#include <cstddef> // std::size_t -namespace std{ - using ::size_t; -} // namespace std -#endif - -#include <boost/serialization/array_wrapper.hpp> - -#ifndef BOOST_NO_CXX11_HDR_ARRAY - -#include <array> -#include <boost/serialization/nvp.hpp> - -namespace boost { namespace serialization { - -template <class Archive, class T, std::size_t N> -void serialize(Archive& ar, std::array<T,N>& a, const unsigned int /* version */) -{ - ar & boost::serialization::make_nvp( - "elems", - *static_cast<T (*)[N]>(static_cast<void *>(a.data())) - ); - -} -} } // end namespace boost::serialization - -#endif // BOOST_NO_CXX11_HDR_ARRAY - -#endif //BOOST_SERIALIZATION_ARRAY_HPP diff --git a/contrib/restricted/boost/serialization/include/boost/serialization/utility.hpp b/contrib/restricted/boost/serialization/include/boost/serialization/utility.hpp deleted file mode 100644 index 474baa4593..0000000000 --- a/contrib/restricted/boost/serialization/include/boost/serialization/utility.hpp +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef BOOST_SERIALIZATION_UTILITY_HPP -#define BOOST_SERIALIZATION_UTILITY_HPP - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 -// serialization/utility.hpp: -// serialization for stl utility templates - -// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . -// 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) - -// See http://www.boost.org for updates, documentation, and revision history. - -#include <utility> -#include <boost/config.hpp> - -#include <boost/type_traits/remove_const.hpp> -#include <boost/serialization/nvp.hpp> -#include <boost/serialization/is_bitwise_serializable.hpp> -#include <boost/mpl/and.hpp> - -namespace boost { -namespace serialization { - -// pair -template<class Archive, class F, class S> -inline void serialize( - Archive & ar, - std::pair<F, S> & p, - const unsigned int /* file_version */ -){ - // note: we remove any const-ness on the first argument. The reason is that - // for stl maps, the type saved is pair<const key, T). We remove - // the const-ness in order to be able to load it. - typedef typename boost::remove_const<F>::type typef; - ar & boost::serialization::make_nvp("first", const_cast<typef &>(p.first)); - ar & boost::serialization::make_nvp("second", p.second); -} - -/// specialization of is_bitwise_serializable for pairs -template <class T, class U> -struct is_bitwise_serializable<std::pair<T,U> > - : public mpl::and_<is_bitwise_serializable< T >,is_bitwise_serializable<U> > -{ -}; - -} // serialization -} // namespace boost - -#endif // BOOST_SERIALIZATION_UTILITY_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor.hpp deleted file mode 100644 index b6edad46ba..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor.hpp +++ /dev/null @@ -1,113 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_HPP - -#include <boost/spirit/home/classic/version.hpp> - -/////////////////////////////////////////////////////////////////////////////// -// -// Actors documentation and convention -// -// Actors -// -// Actors are predefined semantic action functors. They are used to do an -// action on the parse result if the parser has had a successful match. An -// example of actor is the append_actor described in the Spirit -// documentation. -// -// The action takes place through a call to the () operator: single argument -// () operator call for character parsers and two argument (first,last) call -// for phrase parsers. Actors should implement at least one of the two () -// operator. -// -// Actor instances are not created directly since they usually involve a -// number of template parameters. Instead generator functions ("helper -// functions") are provided to generate actors according to their arguments. -// All helper functions have the "_a" suffix. For example, append_actor is -// created using the append_a function. -// -// Policy holder actors and policy actions -// -// A lot of actors need to store reference to one or more objects. For -// example, actions on container need to store a reference to the container. -// Therefore, this kind of actor have been broken down into -// -// - a action policy that does the action (act method), -// - a policy holder actor that stores the references and feeds the act -// method. -// -// Policy holder actors -// -// Policy holder have the following naming convention: -// <member>_ >> *<member> >> !value >> actor -// where member are the policy stored member, they can be of type: -// -// - ref, a reference, -// - const_ref, a const reference, -// - value, by value, -// - empty, no stored members -// - !value states if the policy uses the parse result or not. -// -// The available policy holder are enumerated below: -// -// - empty_actor, nothing stored, feeds parse result -// - value_actor, 1 object stored by value, feeds value -// - ref_actor, 1 reference stored, feeds ref -// - ref_value_actor, 1 reference stored, feeds ref and parse result -// -// Doc. convention -// -// - ref is a reference to an object stored in a policy holder actor, -// - value_ref,value1_ref, value2_ref are a const reference stored in a -// policy holder actor, -// - value is the parse result in the single argument () operator, -// - first,last are the parse result in the two argument () operator -// -// Actors (generator functions) and quick description -// -// - assign_a(ref) assign parse result to ref -// - assign_a(ref, value_ref) assign value_ref to ref -// - increment_a(ref) increment ref -// - decrement_a(ref) decrement ref -// - push_back_a(ref) push back the parse result in ref -// - push_back_a(ref, value_ref) push back value_ref in ref -// - push_front_a(ref) push front the parse result in ref -// - push_front_a(ref, value_ref) push front value_ref in ref -// - insert_key_a(ref,value_ref) insert value_ref in ref using the -// parse result as key -// - insert_at_a(ref, key_ref) insert the parse result in ref at key_ref -// - insert_at_a(ref, key_ref insert value_ref in ref at key_ref -// , value_ref) -// - assign_key_a(ref, value_ref) assign value_ref in ref using the -// parse result as key -// - erase_a(ref, key) erase data at key from ref -// - clear_a(ref) clears ref -// - swap_a(aref, bref) swaps aref and bref -// -/////////////////////////////////////////////////////////////////////////////// - -#include <boost/spirit/home/classic/actor/ref_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_value_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp> - -#include <boost/spirit/home/classic/actor/assign_actor.hpp> -#include <boost/spirit/home/classic/actor/clear_actor.hpp> -#include <boost/spirit/home/classic/actor/increment_actor.hpp> -#include <boost/spirit/home/classic/actor/decrement_actor.hpp> -#include <boost/spirit/home/classic/actor/push_back_actor.hpp> -#include <boost/spirit/home/classic/actor/push_front_actor.hpp> -#include <boost/spirit/home/classic/actor/erase_actor.hpp> -#include <boost/spirit/home/classic/actor/insert_key_actor.hpp> -#include <boost/spirit/home/classic/actor/insert_at_actor.hpp> -#include <boost/spirit/home/classic/actor/assign_key_actor.hpp> -#include <boost/spirit/home/classic/actor/swap_actor.hpp> - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/assign_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/assign_actor.hpp deleted file mode 100644 index 975bf7de5f..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/assign_actor.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_ASSIGN_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_ASSIGN_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_value_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy that applies the assignment operator. - // (This doc uses convention available in actors.hpp) - // - // Actions (what it does): - // ref = value; - // ref = T(first,last); - // ref = value_ref; - // - // Policy name: - // assign_action - // - // Policy holder, corresponding helper method: - // ref_value_actor, assign_a( ref ); - // ref_const_ref_actor, assign_a( ref, value_ref ); - // - // () operators: both - // - // See also ref_value_actor and ref_const_ref_actor for more details. - /////////////////////////////////////////////////////////////////////////// - struct assign_action - { - template< - typename T, - typename ValueT - > - void act(T& ref_, ValueT const& value_) const - { - ref_ = value_; - } - template< - typename T, - typename IteratorT - > - void act( - T& ref_, - IteratorT const& first_, - IteratorT const& last_ - ) const - { - typedef T value_type; -#ifndef BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS - value_type value(first_,last_); -#else - value_type value; - std::copy(first_, last_, std::inserter(value, value.end())); -#endif - ref_ = value; - } - }; - - // Deprecated. Please use assign_a - template<typename T> - inline ref_value_actor<T,assign_action> assign(T& ref_) - { - return ref_value_actor<T,assign_action>(ref_); - } - - template<typename T> - inline ref_value_actor<T,assign_action> assign_a(T& ref_) - { - return ref_value_actor<T,assign_action>(ref_); - } - - template< - typename T, - typename ValueT - > - inline ref_const_ref_actor<T,ValueT,assign_action> assign_a( - T& ref_, - ValueT const& value_ - ) - { - return ref_const_ref_actor<T,ValueT,assign_action>(ref_,value_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/assign_key_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/assign_key_actor.hpp deleted file mode 100644 index f6711d30fb..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/assign_key_actor.hpp +++ /dev/null @@ -1,96 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_ASSIGN_KEY_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_ASSIGN_KEY_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - struct assign_key_action - { - template< - typename T, - typename ValueT, - typename KeyT - > - void act(T& ref_, ValueT const& value_, KeyT const& key_) const - { - ref_[ key_ ] = value_; - } - - template< - typename T, - typename ValueT, - typename IteratorT - > - void act( - T& ref_, - ValueT const& value_, - IteratorT const& first_, - IteratorT const& last_ - ) const - { - typedef typename T::key_type key_type; - key_type key(first_,last_); - - ref_[key] = value_; - } - }; - - template< - typename T, - typename ValueT - > - inline ref_const_ref_value_actor<T,ValueT,assign_key_action> - assign_key_a(T& ref_, ValueT const& value_) - { - return ref_const_ref_value_actor<T,ValueT,assign_key_action>( - ref_, - value_ - ); - } - - template< - typename T, - typename ValueT, - typename KeyT - > - inline ref_const_ref_const_ref_actor< - T, - ValueT, - KeyT, - assign_key_action - > - assign_key_a( - T& ref_, - ValueT const& value_, - KeyT const& key_ - ) - { - return ref_const_ref_const_ref_actor< - T, - ValueT, - KeyT, - assign_key_action - >( - ref_, - value_, - key_ - ); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/clear_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/clear_actor.hpp deleted file mode 100644 index 9af670dcc6..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/clear_actor.hpp +++ /dev/null @@ -1,61 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_CLEAR_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_CLEAR_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy that calls clear method. - // (This doc uses convention available in actors.hpp) - // - // Actions (what it does): - // ref.clear(); - // - // Policy name: - // clear_action - // - // Policy holder, corresponding helper method: - // ref_actor, clear_a( ref ); - // - // () operators: both. - // - // See also ref_actor for more details. - /////////////////////////////////////////////////////////////////////////// - struct clear_action - { - template< - typename T - > - void act(T& ref_) const - { - ref_.clear(); - } - }; - - /////////////////////////////////////////////////////////////////////////// - // helper method that creates a and_assign_actor. - /////////////////////////////////////////////////////////////////////////// - template<typename T> - inline ref_actor<T,clear_action> clear_a(T& ref_) - { - return ref_actor<T,clear_action>(ref_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/decrement_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/decrement_actor.hpp deleted file mode 100644 index 99cdf35d7f..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/decrement_actor.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_DECREMENT_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_DECREMENT_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy that calls the -- operator on a reference. - // (This doc uses convention available in actors.hpp) - // - // Actions: - // --ref; - // - // Policy name: - // decrement_action - // - // Policy holder, corresponding helper method: - // ref_actor, decrement_a( ref ); - // - // () operators: both. - // - // See also ref_actor for more details. - /////////////////////////////////////////////////////////////////////////// - struct decrement_action - { - template< - typename T - > - void act(T& ref_) const - { - --ref_; - } - }; - - /////////////////////////////////////////////////////////////////////////// - // helper method that creates a and_assign_actor. - /////////////////////////////////////////////////////////////////////////// - template<typename T> - inline ref_actor<T,decrement_action> decrement_a(T& ref_) - { - return ref_actor<T,decrement_action>(ref_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/erase_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/erase_actor.hpp deleted file mode 100644 index dca1b40435..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/erase_actor.hpp +++ /dev/null @@ -1,89 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_ERASE_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_ERASE_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_value_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy that calss the erase method. - // (This doc uses convention available in actors.hpp) - // - // Actions (what it does): - // ref.erase( value ); - // ref.erase( T::key_type(first,last) ); - // ref.erase( key_ref ); - // - // Policy name: - // erase_action - // - // Policy holder, corresponding helper method: - // ref_value_actor, erase_a( ref ); - // ref_const_ref_actor, erase_a( ref, key_ref ); - // - // () operators: both - // - // See also ref_value_actor and ref_const_ref_actor for more details. - /////////////////////////////////////////////////////////////////////////// - struct erase_action - { - template< - typename T, - typename KeyT - > - void act(T& ref_, KeyT const& key_) const - { - ref_.erase(key_); - } - template< - typename T, - typename IteratorT - > - void act( - T& ref_, - IteratorT const& first_, - IteratorT const& last_ - ) const - { - typedef typename T::key_type key_type; - key_type key(first_,last_); - - ref_.erase(key); - } - }; - - template<typename T> - inline ref_value_actor<T,erase_action> erase_a(T& ref_) - { - return ref_value_actor<T,erase_action>(ref_); - } - - template< - typename T, - typename KeyT - > - inline ref_const_ref_actor<T,KeyT,erase_action> erase_a( - T& ref_, - KeyT const& key_ - ) - { - return ref_const_ref_actor<T,KeyT,erase_action>(ref_,key_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/increment_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/increment_actor.hpp deleted file mode 100644 index 776568887e..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/increment_actor.hpp +++ /dev/null @@ -1,60 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_INCREMENT_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_INCREMENT_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy that calls the ++ operator on a reference. - // (This doc uses convention available in actors.hpp) - // - // Actions: - // ++ref; - // - // Policy name: - // increment_action - // - // Policy holder, corresponding helper method: - // ref_actor, increment_a( ref ); - // - // () operators: both. - // - // See also ref_actor for more details. - /////////////////////////////////////////////////////////////////////////// - struct increment_action - { - template< - typename T - > - void act(T& ref_) const - { - ++ref_; - } - }; - - /////////////////////////////////////////////////////////////////////////// - // helper method that creates a increment_actor. - /////////////////////////////////////////////////////////////////////////// - template<typename T> - inline ref_actor<T,increment_action> increment_a(T& ref_) - { - return ref_actor<T,increment_action>(ref_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/insert_at_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/insert_at_actor.hpp deleted file mode 100644 index 5dd7497232..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/insert_at_actor.hpp +++ /dev/null @@ -1,121 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_INSERT_AT_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_INSERT_AT_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy that insert data into an associative - // container using a const reference to a key. - // (This doc uses convention available in actors.hpp) - // - // Actions (what it does): - // ref.insert( T::value_type(key_ref,value) ); - // ref.insert( T::value_type(key_ref, T::mapped_type(first,last)));; - // ref.insert( T::value_type(key_ref,value_ref) ); - // - // Policy name: - // insert_at_action - // - // Policy holder, corresponding helper method: - // ref_const_ref_value_actor, insert_at_a( ref, key_ref ); - // ref_const_ref_const_ref_actor, insert_a( ref, key_ref, value_ref ); - // - // () operators: both - // - // See also ref_const_ref_value_actor and ref_const_ref_const_ref_actor - // for more details. - /////////////////////////////////////////////////////////////////////////// - struct insert_at_action - { - template< - typename T, - typename ReferentT, - typename ValueT - > - void act( - T& ref_, - ReferentT const& key_, - ValueT const& value_ - ) const - { - typedef typename T::value_type value_type; - ref_.insert( value_type(key_, value_) ); - } - - template< - typename T, - typename ReferentT, - typename IteratorT - > - void act( - T& ref_, - ReferentT const& key_, - IteratorT const& first_, - IteratorT const& last_ - ) const - { - typedef typename T::mapped_type mapped_type; - typedef typename T::value_type value_type; - - mapped_type value(first_,last_); - value_type key_value(key_, value); - ref_.insert( key_value ); - } - }; - - template< - typename T, - typename ReferentT - > - inline ref_const_ref_value_actor<T,ReferentT,insert_at_action> - insert_at_a( - T& ref_, - ReferentT const& key_ - ) - { - return ref_const_ref_value_actor< - T, - ReferentT, - insert_at_action - >(ref_,key_); - } - - template< - typename T, - typename ReferentT, - typename ValueT - > - inline ref_const_ref_const_ref_actor<T,ReferentT,ValueT,insert_at_action> - insert_at_a( - T& ref_, - ReferentT const& key_, - ValueT const& value_ - ) - { - return ref_const_ref_const_ref_actor< - T, - ReferentT, - ValueT, - insert_at_action - >(ref_,key_,value_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/insert_key_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/insert_key_actor.hpp deleted file mode 100644 index 859a8d8363..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/insert_key_actor.hpp +++ /dev/null @@ -1,97 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_INSERT_KEY_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_INSERT_KEY_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy that insert data into an associative - // container using a const reference to data. - // (This doc uses convention available in actors.hpp) - // - // Actions (what it does): - // ref.insert( T::value_type(value,value_ref) ); - // ref.insert( T::value_type(T::key_type(first,last), value_ref));; - // - // Policy name: - // insert_key_action - // - // Policy holder, corresponding helper method: - // ref_const_ref_value_actor, insert_key_a( ref, value_ref ); - // - // () operators: both - // - // See also ref_const_ref_value_actor for more details. - /////////////////////////////////////////////////////////////////////////// - struct insert_key_action - { - template< - typename T, - typename ValueT, - typename ReferentT - > - void act( - T& ref_, - ValueT const& value_, - ReferentT const& key_ - ) const - { - typedef typename T::value_type value_type; - value_type key_value(key_, value_); - ref_.insert( key_value ); - } - - template< - typename T, - typename ValueT, - typename IteratorT - > - void act( - T& ref_, - ValueT const& value_, - IteratorT const& first_, - IteratorT const& last_ - ) const - { - typedef typename T::key_type key_type; - typedef typename T::value_type value_type; - - key_type key(first_,last_); - value_type key_value(key, value_); - ref_.insert( key_value ); - } - }; - - template< - typename T, - typename ValueT - > - inline ref_const_ref_value_actor<T,ValueT,insert_key_action> insert_key_a( - T& ref_, - ValueT const& value_ - ) - { - return ref_const_ref_value_actor< - T, - ValueT, - insert_key_action - >(ref_,value_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/push_back_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/push_back_actor.hpp deleted file mode 100644 index cbdd790709..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/push_back_actor.hpp +++ /dev/null @@ -1,101 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_PUSH_BACK_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_PUSH_BACK_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_value_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // - // A semantic action policy that appends a value to the back of a - // container. - // (This doc uses convention available in actors.hpp) - // - // Actions (what it does and what ref, value_ref must support): - // ref.push_back( value ); - // ref.push_back( T::value_type(first,last) ); - // ref.push_back( value_ref ); - // - // Policy name: - // push_back_action - // - // Policy holder, corresponding helper method: - // ref_value_actor, push_back_a( ref ); - // ref_const_ref_actor, push_back_a( ref, value_ref ); - // - // () operators: both - // - // See also ref_value_actor and ref_const_ref_actor for more details. - /////////////////////////////////////////////////////////////////////////// - struct push_back_action - { - template< - typename T, - typename ValueT - > - void act(T& ref_, ValueT const& value_) const - { - ref_.push_back( value_ ); - } - template< - typename T, - typename IteratorT - > - void act( - T& ref_, - IteratorT const& first_, - IteratorT const& last_ - ) const - { - typedef typename T::value_type value_type; - value_type value(first_,last_); - - ref_.push_back( value ); - } - }; - -// Deprecated interface. Use push_back_a - template<typename T> - inline ref_value_actor<T,push_back_action> - append(T& ref_) - { - return ref_value_actor<T,push_back_action>(ref_); - } - - template<typename T> - inline ref_value_actor<T,push_back_action> - push_back_a(T& ref_) - { - return ref_value_actor<T,push_back_action>(ref_); - } - - template< - typename T, - typename ValueT - > - inline ref_const_ref_actor<T,ValueT,push_back_action> - push_back_a( - T& ref_, - ValueT const& value_ - ) - { - return ref_const_ref_actor<T,ValueT,push_back_action>(ref_,value_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/push_front_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/push_front_actor.hpp deleted file mode 100644 index 43cb183513..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/push_front_actor.hpp +++ /dev/null @@ -1,91 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_PUSH_FRONT_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_PUSH_FRONT_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_value_actor.hpp> -#include <boost/spirit/home/classic/actor/ref_const_ref_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // - // A semantic action policy that appends a value to the front of a - // container. - // (This doc uses convention available in actors.hpp) - // - // Actions (what it does and what ref, value_ref must support): - // ref.push_front( value ); - // ref.push_front( T::value_type(first,last) ); - // ref.push_front( value_ref ); - // - // Policy name: - // push_front_action - // - // Policy holder, corresponding helper method: - // ref_value_actor, push_front_a( ref ); - // ref_const_ref_actor, push_front_a( ref, value_ref ); - // - // () operators: both - // - // See also ref_value_actor and ref_const_ref_actor for more details. - /////////////////////////////////////////////////////////////////////////// - struct push_front_action - { - template< - typename T, - typename ValueT - > - void act(T& ref_, ValueT const& value_) const - { - ref_.push_front( value_ ); - } - template< - typename T, - typename IteratorT - > - void act( - T& ref_, - IteratorT const& first_, - IteratorT const& last_ - ) const - { - typedef typename T::value_type value_type; - value_type value(first_,last_); - - ref_.push_front( value ); - } - }; - - template<typename T> - inline ref_value_actor<T,push_front_action> push_front_a(T& ref_) - { - return ref_value_actor<T,push_front_action>(ref_); - } - - template< - typename T, - typename ValueT - > - inline ref_const_ref_actor<T,ValueT,push_front_action> push_front_a( - T& ref_, - ValueT const& value_ - ) - { - return ref_const_ref_actor<T,ValueT,push_front_action>(ref_,value_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_actor.hpp deleted file mode 100644 index 4cf7a47c07..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_actor.hpp +++ /dev/null @@ -1,70 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_REF_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_REF_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy holder. This holder stores a reference to ref, - // act methods are fead with this reference. The parse result is not used - // by this holder. - // - // (This doc uses convention available in actors.hpp) - // - // Constructor: - // ...(T& ref_); - // where ref_ is stored. - // - // Action calls: - // act(ref); - // - // () operators: both - // - /////////////////////////////////////////////////////////////////////////// - template< - typename T, - typename ActionT - > - class ref_actor : public ActionT - { - private: - T& ref; - public: - explicit - ref_actor(T& ref_) - : ref(ref_){} - - - template<typename T2> - void operator()(T2 const& /*val*/) const - { - this->act(ref); // defined in ActionT - } - - - template<typename IteratorT> - void operator()( - IteratorT const& /*first*/, - IteratorT const& /*last*/ - ) const - { - this->act(ref); // defined in ActionT - } - }; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_actor.hpp deleted file mode 100644 index 80ee6eb3ad..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_actor.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_REF_CONST_REF_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_REF_CONST_REF_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy holder. This holder stores a reference to ref - // and a const reference to value_ref. - // act methods are feed with ref and value_ref. The parse result is - // not used by this holder. - // - // (This doc uses convention available in actors.hpp) - // - // Constructor: - // ...(T& ref_, ValueT const& value_ref_); - // where ref_ and value_ref_ are stored in the holder. - // - // Action calls: - // act(ref, value_ref); - // - // () operators: both - // - /////////////////////////////////////////////////////////////////////////// - template< - typename T, - typename ValueT, - typename ActionT - > - class ref_const_ref_actor : public ActionT - { - private: - T& ref; - ValueT const& value_ref; - public: - ref_const_ref_actor( - T& ref_, - ValueT const& value_ref_ - ) - : - ref(ref_), - value_ref(value_ref_) - {} - - - template<typename T2> - void operator()(T2 const& /*val*/) const - { - this->act(ref,value_ref); // defined in ActionT - } - - - template<typename IteratorT> - void operator()( - IteratorT const& /*first*/, - IteratorT const& /*last*/ - ) const - { - this->act(ref,value_ref); // defined in ActionT - } - }; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp deleted file mode 100644 index 2072334d67..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_const_ref_a.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_REF_CONST_REF_CONST_REF_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_REF_CONST_REF_CONST_REF_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy holder. This holder stores a reference to ref - // , a const reference to value1_ref and a const reference to value2_ref. - // Typically, value1_ref is a key and value2_ref is value for associative - // container operations. - // act methods are feed with ref, value1_ref, value2_ref. The parse result - // is not used by this holder. - // - // (This doc uses convention available in actors.hpp) - // - // Constructor: - // ...( - // T& ref_, - // Value1T const& value1_ref_, - // Value2T const& value2_ref_ ); - // where ref_, value1_ref and value2_ref_ are stored in the holder. - // - // Action calls: - // act(ref, value1_ref, value2_ref); - // - // () operators: both - // - /////////////////////////////////////////////////////////////////////////// - template< - typename T, - typename Value1T, - typename Value2T, - typename ActionT - > - class ref_const_ref_const_ref_actor : public ActionT - { - private: - T& ref; - Value1T const& value1_ref; - Value2T const& value2_ref; - public: - ref_const_ref_const_ref_actor( - T& ref_, - Value1T const& value1_ref_, - Value2T const& value2_ref_ - ) - : - ref(ref_), - value1_ref(value1_ref_), - value2_ref(value2_ref_) - {} - - - template<typename T2> - void operator()(T2 const& /*val*/) const - { - this->act(ref,value1_ref,value2_ref); // defined in ActionT - } - - - template<typename IteratorT> - void operator()( - IteratorT const& /*first*/, - IteratorT const& /*last*/ - ) const - { - this->act(ref,value1_ref,value2_ref); // defined in ActionT - } - }; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp deleted file mode 100644 index 56e5fc98e9..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_const_ref_value_actor.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_REF_CONST_REF_VALUE_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_REF_CONST_REF_VALUE_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy holder. This holder stores a reference to ref - // and a const reference to value_ref. - // act methods are feed with ref, value_ref and the parse result. - // - // (This doc uses convention available in actors.hpp) - // - // Constructor: - // ...(T& ref_, ValueT const& value_ref_); - // where ref_ and value_ref_ are stored in the holder. - // - // Action calls: - // act(ref, value_ref, value); - // act(ref, value_ref, first, last); - // - // () operators: both - // - /////////////////////////////////////////////////////////////////////////// - template< - typename T, - typename ValueT, - typename ActionT - > - class ref_const_ref_value_actor : public ActionT - { - private: - T& ref; - ValueT const& value_ref; - public: - ref_const_ref_value_actor( - T& ref_, - ValueT const& value_ref_ - ) - : - ref(ref_), - value_ref(value_ref_) - {} - - - template<typename T2> - void operator()(T2 const& val_) const - { - this->act(ref,value_ref,val_); // defined in ActionT - } - - - template<typename IteratorT> - void operator()( - IteratorT const& first_, - IteratorT const& last_ - ) const - { - this->act(ref,value_ref,first_,last_); // defined in ActionT - } - }; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_value_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_value_actor.hpp deleted file mode 100644 index 596e219b1e..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/ref_value_actor.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - Copyright (c) 2011 Bryce Lelbach - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_REF_VALUE_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_REF_VALUE_ACTOR_HPP - -#include <boost/detail/workaround.hpp> - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#endif - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy holder. This holder stores a reference to ref. - // act methods are feed with ref and the parse result. - // - // (This doc uses convention available in actors.hpp) - // - // Constructor: - // ...(T& ref_); - // where ref_ is stored. - // - // Action calls: - // act(ref, value); - // act(ref, first,last); - // - // () operators: both - // - /////////////////////////////////////////////////////////////////////////// - template< - typename T, - typename ActionT - > - class ref_value_actor : public ActionT - { - private: - T& ref; - public: - explicit - ref_value_actor(T& ref_) - : ref(ref_){} - - - template<typename T2> - void operator()(T2 const& val_) const - { - this->act(ref,val_); // defined in ActionT - } - - - template<typename IteratorT> - void operator()( - IteratorT const& first_, - IteratorT const& last_ - ) const - { - this->act(ref,first_,last_); // defined in ActionT - } - }; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/swap_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/swap_actor.hpp deleted file mode 100644 index f3fc5e4b1f..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/actor/swap_actor.hpp +++ /dev/null @@ -1,85 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Jonathan de Halleux (dehalleux@pelikhan.com) - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ACTOR_SWAP_ACTOR_HPP -#define BOOST_SPIRIT_ACTOR_SWAP_ACTOR_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/actor/ref_value_actor.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // Summary: - // A semantic action policy that swaps values. - // (This doc uses convention available in actors.hpp) - // - // Actions (what it does): - // ref.swap( value_ref ); - // - // Policy name: - // swap_action - // - // Policy holder, corresponding helper method: - // ref_value_actor, swap_a( ref ); - // ref_const_ref_actor, swap_a( ref, value_ref ); - // - // () operators: both - // - // See also ref_value_actor and ref_const_ref_actor for more details. - /////////////////////////////////////////////////////////////////////////// - template< - typename T - > - class swap_actor - { - private: - T& ref; - T& swap_ref; - - public: - swap_actor( - T& ref_, - T& swap_ref_) - : ref(ref_), swap_ref(swap_ref_) - {}; - - template<typename T2> - void operator()(T2 const& /*val*/) const - { - ref.swap(swap_ref); - } - - - template<typename IteratorT> - void operator()( - IteratorT const& /*first*/, - IteratorT const& /*last*/ - ) const - { - ref.swap(swap_ref); - } - }; - - template< - typename T - > - inline swap_actor<T> swap_a( - T& ref_, - T& swap_ref_ - ) - { - return swap_actor<T>(ref_,swap_ref_); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute.hpp deleted file mode 100644 index 35b306b6a4..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_ATTRIBUTE_MAIN_HPP) -#define BOOST_SPIRIT_ATTRIBUTE_MAIN_HPP - -#include <boost/spirit/home/classic/version.hpp> - -/////////////////////////////////////////////////////////////////////////////// -// -// Master header for Spirit.Attributes -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// -// Phoenix predefined maximum limit. This limit defines the maximum -// number of elements a tuple can hold. This number defaults to 3. The -// actual maximum is rounded up in multiples of 3. Thus, if this value -// is 4, the actual limit is 6. The ultimate maximum limit in this -// implementation is 15. -// -/////////////////////////////////////////////////////////////////////////////// -#if !defined(PHOENIX_LIMIT) -#define PHOENIX_LIMIT 6 -#endif // !defined(PHOENIX_LIMIT) - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/attribute/parametric.hpp> -#include <boost/spirit/home/classic/attribute/closure.hpp> - -#endif // !defined(BOOST_SPIRIT_ATTRIBUTE_MAIN_HPP) diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure.hpp deleted file mode 100644 index 836958a392..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure.hpp +++ /dev/null @@ -1,1083 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_CLOSURE_HPP -#define BOOST_SPIRIT_CLOSURE_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/core/non_terminal/parser_context.hpp> -#include <boost/spirit/home/classic/attribute/parametric.hpp> -#include <boost/spirit/home/classic/attribute/closure_context.hpp> -#include <boost/spirit/home/classic/attribute/closure_fwd.hpp> - -#include <boost/spirit/home/classic/phoenix/closures.hpp> -#include <boost/spirit/home/classic/phoenix/primitives.hpp> -#include <boost/spirit/home/classic/phoenix/casts.hpp> -#include <boost/spirit/home/classic/phoenix/operators.hpp> -#include <boost/spirit/home/classic/phoenix/tuple_helpers.hpp> - -#include <boost/static_assert.hpp> - -/////////////////////////////////////////////////////////////////////////////// -// -// Spirit predefined maximum closure limit. This limit defines the maximum -// number of elements a closure can hold. This number defaults to 3. The -// actual maximum is rounded up in multiples of 3. Thus, if this value -// is 4, the actual limit is 6. The ultimate maximum limit in this -// implementation is 15. -// -// It should NOT be greater than PHOENIX_LIMIT! -// -/////////////////////////////////////////////////////////////////////////////// - -#if !defined(BOOST_SPIRIT_CLOSURE_LIMIT) -#define BOOST_SPIRIT_CLOSURE_LIMIT PHOENIX_LIMIT -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// ensure BOOST_SPIRIT_CLOSURE_LIMIT <= PHOENIX_LIMIT and SPIRIT_CLOSURE_LIMIT <= 15 -// -/////////////////////////////////////////////////////////////////////////////// -BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLOSURE_LIMIT <= PHOENIX_LIMIT); -BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLOSURE_LIMIT <= 15); - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // - // closure_context class - // - /////////////////////////////////////////////////////////////////////////// - template <typename ClosureT> - class closure_context : public parser_context_base - { - public: - - typedef typename ::phoenix::tuple_element<0, - typename ClosureT::tuple_t>::type attr_t; - typedef ClosureT base_t; - typedef closure_context_linker<closure_context<ClosureT> > - context_linker_t; - - closure_context(ClosureT const& clos) - : frame(clos) {} - - ~closure_context() {} - - template <typename ParserT, typename ScannerT> - void pre_parse(ParserT const&, ScannerT const&) {} - - template <typename ResultT, typename ParserT, typename ScannerT> - ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&) - { hit.value(frame[::phoenix::tuple_index_names::_1]); return hit; } - - private: - - ::phoenix::closure_frame<typename ClosureT::phoenix_closure_t> frame; - }; - - /////////////////////////////////////////////////////////////////////////// - // - // init_closure_context class - // - // The init_closure_context class is a special parser context type - // which additionally initializes a closure contained in the derived - // parser with values from a given tuple. Please note, that this - // given tuple does not contain the required values directly, it - // contains phoenix::actor objects. These actors have to be - // dereferenced to gain the values to be used for initialization - // (this is done by the help of the phoenix::convert_actors<> - // template). - // - /////////////////////////////////////////////////////////////////////////// - - template <typename ClosureT> - class init_closure_context : public parser_context_base - { - typedef typename ClosureT::tuple_t tuple_t; - typedef typename ClosureT::closure_t closure_t; - - public: - - init_closure_context(ClosureT const& clos) - : frame(clos.subject(), ::phoenix::convert_actors<tuple_t>(clos.init)) {} - - ~init_closure_context() {} - - template <typename ParserT, typename ScannerT> - void pre_parse(ParserT const& /*p*/, ScannerT const&) {} - - template <typename ResultT, typename ParserT, typename ScannerT> - ResultT& post_parse(ResultT& hit, ParserT const&, ScannerT const&) - { hit.value(frame[::phoenix::tuple_index_names::_1]); return hit; } - - private: - - ::phoenix::closure_frame<closure_t> frame; - }; - - /////////////////////////////////////////////////////////////////////////// - // - // init_closure_parser class - // - /////////////////////////////////////////////////////////////////////////// - template <typename ParserT, typename ActorTupleT> - struct init_closure_parser - : public unary<ParserT, parser<init_closure_parser<ParserT, ActorTupleT> > > - { - typedef init_closure_parser<ParserT, ActorTupleT> self_t; - typedef unary<ParserT, parser<self_t> > base_t; - typedef typename ParserT::phoenix_closure_t closure_t; - typedef typename ParserT::tuple_t tuple_t; - typedef typename ::phoenix::tuple_element<0, tuple_t>::type attr_t; - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, attr_t>::type type; - }; - - init_closure_parser(ParserT const& p, ActorTupleT const& init_) - : base_t(p), init(init_) {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse_main(ScannerT const& scan) const - { - return this->subject().parse_main(scan); - } - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef init_closure_context<self_t> init_context_t; - typedef parser_scanner_linker<ScannerT> scanner_t; - typedef closure_context_linker<init_context_t> context_t; - typedef typename parser_result<self_t, ScannerT>::type result_t; - BOOST_SPIRIT_CONTEXT_PARSE( - scan, *this, scanner_t, context_t, result_t); - } - - ActorTupleT init; - }; - - /////////////////////////////////////////////////////////////////////////// - // - // closure class - // - /////////////////////////////////////////////////////////////////////////// - template < - typename DerivedT - , typename T0 - , typename T1 - , typename T2 - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 - , typename T3 - , typename T4 - , typename T5 - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 - , typename T6 - , typename T7 - , typename T8 - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 - , typename T9 - , typename T10 - , typename T11 - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 - , typename T12 - , typename T13 - , typename T14 - #endif - #endif - #endif - #endif - > - struct closure : - public ::phoenix::closure< - T0, T1, T2 - #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 - , T3, T4, T5 - #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 - , T6, T7, T8 - #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 - , T9, T10, T11 - #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 - , T12, T13, T14 - #endif - #endif - #endif - #endif - > - { - typedef ::phoenix::closure< - T0, T1, T2 - #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 - , T3, T4, T5 - #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 - , T6, T7, T8 - #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 - , T9, T10, T11 - #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 - , T12, T13, T14 - #endif - #endif - #endif - #endif - > phoenix_closure_t; - - typedef closure_context<DerivedT> context_t; - - template <typename DerivedT2> - struct aux - { - DerivedT2& aux_derived() - { return *static_cast<DerivedT2*>(this); } - - DerivedT2 const& aux_derived() const - { return *static_cast<DerivedT2 const*>(this); } - - // initialization functions - template <typename A> - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type - > - > - operator()(A const &a) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef ::phoenix::tuple<a_t> actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a) - ) - ); - } - - template <typename A, typename B> - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type - > - > - operator()(A const &a, B const &b) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef ::phoenix::tuple<a_t, b_t> actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b) - ) - ); - } - - template <typename A, typename B, typename C> - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type - > - > - operator()(A const &a, B const &b, C const &c) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef ::phoenix::tuple<a_t, b_t, c_t> actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c) - ) - ); - } - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 - - template < - typename A, typename B, typename C, typename D - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d) - ) - ); - } - - template < - typename A, typename B, typename C, typename D, typename E - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e) - ) - ); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f) - ) - ); - } - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g) - ) - ); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type, - typename ::phoenix::as_actor<H>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g, H const &h - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef typename ::phoenix::as_actor<H>::type h_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g), - ::phoenix::as_actor<H>::convert(h) - ) - ); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type, - typename ::phoenix::as_actor<H>::type, - typename ::phoenix::as_actor<I>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g, H const &h, I const &i - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef typename ::phoenix::as_actor<H>::type h_t; - typedef typename ::phoenix::as_actor<I>::type i_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g), - ::phoenix::as_actor<H>::convert(h), - ::phoenix::as_actor<I>::convert(i) - ) - ); - } - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type, - typename ::phoenix::as_actor<H>::type, - typename ::phoenix::as_actor<I>::type, - typename ::phoenix::as_actor<J>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g, H const &h, I const &i, J const &j - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef typename ::phoenix::as_actor<H>::type h_t; - typedef typename ::phoenix::as_actor<I>::type i_t; - typedef typename ::phoenix::as_actor<J>::type j_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g), - ::phoenix::as_actor<H>::convert(h), - ::phoenix::as_actor<I>::convert(i), - ::phoenix::as_actor<J>::convert(j) - ) - ); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type, - typename ::phoenix::as_actor<H>::type, - typename ::phoenix::as_actor<I>::type, - typename ::phoenix::as_actor<J>::type, - typename ::phoenix::as_actor<K>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g, H const &h, I const &i, J const &j, - K const &k - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef typename ::phoenix::as_actor<H>::type h_t; - typedef typename ::phoenix::as_actor<I>::type i_t; - typedef typename ::phoenix::as_actor<J>::type j_t; - typedef typename ::phoenix::as_actor<K>::type k_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, - k_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g), - ::phoenix::as_actor<H>::convert(h), - ::phoenix::as_actor<I>::convert(i), - ::phoenix::as_actor<J>::convert(j), - ::phoenix::as_actor<K>::convert(k) - ) - ); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type, - typename ::phoenix::as_actor<H>::type, - typename ::phoenix::as_actor<I>::type, - typename ::phoenix::as_actor<J>::type, - typename ::phoenix::as_actor<K>::type, - typename ::phoenix::as_actor<L>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g, H const &h, I const &i, J const &j, - K const &k, L const &l - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef typename ::phoenix::as_actor<H>::type h_t; - typedef typename ::phoenix::as_actor<I>::type i_t; - typedef typename ::phoenix::as_actor<J>::type j_t; - typedef typename ::phoenix::as_actor<K>::type k_t; - typedef typename ::phoenix::as_actor<L>::type l_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, - k_t, l_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g), - ::phoenix::as_actor<H>::convert(h), - ::phoenix::as_actor<I>::convert(i), - ::phoenix::as_actor<J>::convert(j), - ::phoenix::as_actor<K>::convert(k), - ::phoenix::as_actor<L>::convert(l) - ) - ); - } - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type, - typename ::phoenix::as_actor<H>::type, - typename ::phoenix::as_actor<I>::type, - typename ::phoenix::as_actor<J>::type, - typename ::phoenix::as_actor<K>::type, - typename ::phoenix::as_actor<L>::type, - typename ::phoenix::as_actor<M>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g, H const &h, I const &i, J const &j, - K const &k, L const &l, M const &m - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef typename ::phoenix::as_actor<H>::type h_t; - typedef typename ::phoenix::as_actor<I>::type i_t; - typedef typename ::phoenix::as_actor<J>::type j_t; - typedef typename ::phoenix::as_actor<K>::type k_t; - typedef typename ::phoenix::as_actor<L>::type l_t; - typedef typename ::phoenix::as_actor<M>::type m_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, - k_t, l_t, m_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g), - ::phoenix::as_actor<H>::convert(h), - ::phoenix::as_actor<I>::convert(i), - ::phoenix::as_actor<J>::convert(j), - ::phoenix::as_actor<K>::convert(k), - ::phoenix::as_actor<L>::convert(l), - ::phoenix::as_actor<M>::convert(m) - ) - ); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type, - typename ::phoenix::as_actor<H>::type, - typename ::phoenix::as_actor<I>::type, - typename ::phoenix::as_actor<J>::type, - typename ::phoenix::as_actor<K>::type, - typename ::phoenix::as_actor<L>::type, - typename ::phoenix::as_actor<M>::type, - typename ::phoenix::as_actor<N>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g, H const &h, I const &i, J const &j, - K const &k, L const &l, M const &m, N const &n - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef typename ::phoenix::as_actor<H>::type h_t; - typedef typename ::phoenix::as_actor<I>::type i_t; - typedef typename ::phoenix::as_actor<J>::type j_t; - typedef typename ::phoenix::as_actor<K>::type k_t; - typedef typename ::phoenix::as_actor<L>::type l_t; - typedef typename ::phoenix::as_actor<M>::type m_t; - typedef typename ::phoenix::as_actor<N>::type n_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, - k_t, l_t, m_t, n_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g), - ::phoenix::as_actor<H>::convert(h), - ::phoenix::as_actor<I>::convert(i), - ::phoenix::as_actor<J>::convert(j), - ::phoenix::as_actor<K>::convert(k), - ::phoenix::as_actor<L>::convert(l), - ::phoenix::as_actor<M>::convert(m), - ::phoenix::as_actor<N>::convert(n) - ) - ); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O - > - init_closure_parser< - DerivedT2, - ::phoenix::tuple< - typename ::phoenix::as_actor<A>::type, - typename ::phoenix::as_actor<B>::type, - typename ::phoenix::as_actor<C>::type, - typename ::phoenix::as_actor<D>::type, - typename ::phoenix::as_actor<E>::type, - typename ::phoenix::as_actor<F>::type, - typename ::phoenix::as_actor<G>::type, - typename ::phoenix::as_actor<H>::type, - typename ::phoenix::as_actor<I>::type, - typename ::phoenix::as_actor<J>::type, - typename ::phoenix::as_actor<K>::type, - typename ::phoenix::as_actor<L>::type, - typename ::phoenix::as_actor<M>::type, - typename ::phoenix::as_actor<N>::type, - typename ::phoenix::as_actor<O>::type - > - > - operator()( - A const &a, B const &b, C const &c, D const &d, E const &e, - F const &f, G const &g, H const &h, I const &i, J const &j, - K const &k, L const &l, M const &m, N const &n, O const &o - ) const - { - typedef typename ::phoenix::as_actor<A>::type a_t; - typedef typename ::phoenix::as_actor<B>::type b_t; - typedef typename ::phoenix::as_actor<C>::type c_t; - typedef typename ::phoenix::as_actor<D>::type d_t; - typedef typename ::phoenix::as_actor<E>::type e_t; - typedef typename ::phoenix::as_actor<F>::type f_t; - typedef typename ::phoenix::as_actor<G>::type g_t; - typedef typename ::phoenix::as_actor<H>::type h_t; - typedef typename ::phoenix::as_actor<I>::type i_t; - typedef typename ::phoenix::as_actor<J>::type j_t; - typedef typename ::phoenix::as_actor<K>::type k_t; - typedef typename ::phoenix::as_actor<L>::type l_t; - typedef typename ::phoenix::as_actor<M>::type m_t; - typedef typename ::phoenix::as_actor<N>::type n_t; - typedef typename ::phoenix::as_actor<O>::type o_t; - typedef ::phoenix::tuple< - a_t, b_t, c_t, d_t, e_t, f_t, g_t, h_t, i_t, j_t, - k_t, l_t, m_t, n_t, o_t - > actor_tuple_t; - - return init_closure_parser<DerivedT2, actor_tuple_t>( - aux_derived(), - actor_tuple_t( - ::phoenix::as_actor<A>::convert(a), - ::phoenix::as_actor<B>::convert(b), - ::phoenix::as_actor<C>::convert(c), - ::phoenix::as_actor<D>::convert(d), - ::phoenix::as_actor<E>::convert(e), - ::phoenix::as_actor<F>::convert(f), - ::phoenix::as_actor<G>::convert(g), - ::phoenix::as_actor<H>::convert(h), - ::phoenix::as_actor<I>::convert(i), - ::phoenix::as_actor<J>::convert(j), - ::phoenix::as_actor<K>::convert(k), - ::phoenix::as_actor<L>::convert(l), - ::phoenix::as_actor<M>::convert(m), - ::phoenix::as_actor<N>::convert(n), - ::phoenix::as_actor<O>::convert(o) - ) - ); - } - - #endif - #endif - #endif - #endif - }; - - ~closure() {} - }; - - /////////////////////////////////////////////////////////////////////////// - // - // overloads for chseq_p and str_p taking in phoenix actors - // - /////////////////////////////////////////////////////////////////////////// - template <typename ActorT> - struct container_begin - { - typedef container_begin<ActorT> self_t; - - template <typename TupleT> - struct result - { - typedef typename ::phoenix::actor_result<ActorT, TupleT> - ::plain_type::iterator type; - }; - - container_begin(ActorT actor_) - : actor(actor_) {} - - template <typename TupleT> - typename ::phoenix::actor_result<self_t, TupleT>::type - eval(TupleT const& /*args*/) const - { return actor().begin(); } - - ActorT actor; - }; - - template <typename ActorT> - struct container_end - { - typedef container_begin<ActorT> self_t; - - template <typename TupleT> - struct result - { - typedef typename ::phoenix::actor_result<ActorT, TupleT> - ::plain_type::iterator type; - }; - - container_end(ActorT actor_) - : actor(actor_) {} - - template <typename TupleT> - typename ::phoenix::actor_result<self_t, TupleT>::type - eval(TupleT const& /*args*/) const - { return actor().end(); } - - ActorT actor; - }; - - template <typename BaseT> - inline f_chseq< - ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >, - ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > > - > - f_chseq_p(::phoenix::actor<BaseT> const& a) - { - typedef ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > > - container_begin_t; - typedef ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > > - container_end_t; - typedef f_chseq<container_begin_t, container_end_t> result_t; - - return result_t(container_begin_t(a), container_end_t(a)); - } - - template <typename BaseT> - inline f_strlit< - ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > >, - ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > > - > - f_str_p(::phoenix::actor<BaseT> const& a) - { - typedef ::phoenix::actor<container_begin< ::phoenix::actor<BaseT> > > - container_begin_t; - typedef ::phoenix::actor<container_end< ::phoenix::actor<BaseT> > > - container_end_t; - typedef f_strlit<container_begin_t, container_end_t> result_t; - - return result_t(container_begin_t(a), container_end_t(a)); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure_context.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure_context.hpp deleted file mode 100644 index e366854964..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure_context.hpp +++ /dev/null @@ -1,56 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_CLOSURE_CONTEXT_HPP) -#define BOOST_SPIRIT_CLOSURE_CONTEXT_HPP - -#include <boost/spirit/home/classic/namespace.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -#if !defined(BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED) -#define BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED - -/////////////////////////////////////////////////////////////////////////////// -// -// closure_context_linker -// { helper template for the closure extendability } -// -// This classes can be 'overloaded' (defined elsewhere), to plug -// in additional functionality into the closure parsing process. -// -/////////////////////////////////////////////////////////////////////////////// - -template<typename ContextT> -struct closure_context_linker : public ContextT -{ - template <typename ParserT> - closure_context_linker(ParserT const& p) - : ContextT(p) {} - - template <typename ParserT, typename ScannerT> - void pre_parse(ParserT const& p, ScannerT const& scan) - { ContextT::pre_parse(p, scan); } - - template <typename ResultT, typename ParserT, typename ScannerT> - ResultT& - post_parse(ResultT& hit, ParserT const& p, ScannerT const& scan) - { return ContextT::post_parse(hit, p, scan); } -}; - -#endif // !defined(BOOST_SPIRIT_CLOSURE_CONTEXT_LINKER_DEFINED) - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_CLOSURE_CONTEXT_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure_fwd.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure_fwd.hpp deleted file mode 100644 index 033d619c2f..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/closure_fwd.hpp +++ /dev/null @@ -1,69 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Tobias Schwinger - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_CLOSURE_FWD_HPP) -#define BOOST_SPIRIT_CLOSURE_FWD_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/phoenix/tuples.hpp> - -#if !defined(BOOST_SPIRIT_CLOSURE_LIMIT) -# define BOOST_SPIRIT_CLOSURE_LIMIT PHOENIX_LIMIT -#endif - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - template<typename ClosureT> - class closure_context; - - template <typename ClosureT> - class init_closure_context; - - template <typename ParserT, typename ActorTupleT> - struct init_closure_parser; - - template < - typename DerivedT - , typename T0 = ::phoenix::nil_t - , typename T1 = ::phoenix::nil_t - , typename T2 = ::phoenix::nil_t - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 3 - , typename T3 = ::phoenix::nil_t - , typename T4 = ::phoenix::nil_t - , typename T5 = ::phoenix::nil_t - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 6 - , typename T6 = ::phoenix::nil_t - , typename T7 = ::phoenix::nil_t - , typename T8 = ::phoenix::nil_t - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 9 - , typename T9 = ::phoenix::nil_t - , typename T10 = ::phoenix::nil_t - , typename T11 = ::phoenix::nil_t - - #if BOOST_SPIRIT_CLOSURE_LIMIT > 12 - , typename T12 = ::phoenix::nil_t - , typename T13 = ::phoenix::nil_t - , typename T14 = ::phoenix::nil_t - - #endif - #endif - #endif - #endif - > - struct closure; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/parametric.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/parametric.hpp deleted file mode 100644 index 0c0b11ab09..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/attribute/parametric.hpp +++ /dev/null @@ -1,144 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_PARAMETRIC_HPP -#define BOOST_SPIRIT_PARAMETRIC_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/core/primitives/primitives.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // - // f_chlit class [ functional version of chlit ] - // - /////////////////////////////////////////////////////////////////////////// - template <typename ChGenT> - struct f_chlit : public char_parser<f_chlit<ChGenT> > - { - f_chlit(ChGenT chgen_) - : chgen(chgen_) {} - - template <typename T> - bool test(T ch) const - { return ch == chgen(); } - - ChGenT chgen; - }; - - template <typename ChGenT> - inline f_chlit<ChGenT> - f_ch_p(ChGenT chgen) - { return f_chlit<ChGenT>(chgen); } - - /////////////////////////////////////////////////////////////////////////// - // - // f_range class [ functional version of range ] - // - /////////////////////////////////////////////////////////////////////////// - template <typename ChGenAT, typename ChGenBT> - struct f_range : public char_parser<f_range<ChGenAT, ChGenBT> > - { - f_range(ChGenAT first_, ChGenBT last_) - : first(first_), last(last_) - {} - - template <typename T> - bool test(T ch) const - { - BOOST_SPIRIT_ASSERT(first() <= last()); - return (ch >= first()) && (ch <= last()); - } - - ChGenAT first; - ChGenBT last; - }; - - template <typename ChGenAT, typename ChGenBT> - inline f_range<ChGenAT, ChGenBT> - f_range_p(ChGenAT first, ChGenBT last) - { return f_range<ChGenAT, ChGenBT>(first, last); } - - /////////////////////////////////////////////////////////////////////////// - // - // f_chseq class [ functional version of chseq ] - // - /////////////////////////////////////////////////////////////////////////// - template <typename IterGenAT, typename IterGenBT> - class f_chseq : public parser<f_chseq<IterGenAT, IterGenBT> > - { - public: - - typedef f_chseq<IterGenAT, IterGenBT> self_t; - - f_chseq(IterGenAT first_, IterGenBT last_) - : first(first_), last(last_) {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result<self_t, ScannerT>::type result_t; - return impl::string_parser_parse<result_t>(first(), last(), scan); - } - - private: - - IterGenAT first; - IterGenBT last; - }; - - template <typename IterGenAT, typename IterGenBT> - inline f_chseq<IterGenAT, IterGenBT> - f_chseq_p(IterGenAT first, IterGenBT last) - { return f_chseq<IterGenAT, IterGenBT>(first, last); } - - /////////////////////////////////////////////////////////////////////////// - // - // f_strlit class [ functional version of strlit ] - // - /////////////////////////////////////////////////////////////////////////// - template <typename IterGenAT, typename IterGenBT> - class f_strlit : public parser<f_strlit<IterGenAT, IterGenBT> > - { - public: - - typedef f_strlit<IterGenAT, IterGenBT> self_t; - - f_strlit(IterGenAT first, IterGenBT last) - : seq(first, last) {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result<self_t, ScannerT>::type result_t; - return impl::contiguous_parser_parse<result_t> - (seq, scan, scan); - } - - private: - - f_chseq<IterGenAT, IterGenBT> seq; - }; - - template <typename IterGenAT, typename IterGenBT> - inline f_strlit<IterGenAT, IterGenBT> - f_str_p(IterGenAT first, IterGenBT last) - { return f_strlit<IterGenAT, IterGenBT>(first, last); } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core.hpp deleted file mode 100644 index 4f9d806f17..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core.hpp +++ /dev/null @@ -1,73 +0,0 @@ -/*============================================================================= - Copyright (c) 1998-2003 Joel de Guzman - Copyright (c) 2001-2003 Daniel Nuffer - Copyright (c) 2001-2003 Hartmut Kaiser - Copyright (c) 2002-2003 Martin Wille - Copyright (c) 2002 Raghavendra Satish - Copyright (c) 2001 Bruce Florman - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_CORE_MAIN_HPP) -#define BOOST_SPIRIT_CORE_MAIN_HPP - -#include <boost/spirit/home/classic/version.hpp> -#include <boost/spirit/home/classic/debug.hpp> - -/////////////////////////////////////////////////////////////////////////////// -// -// Spirit.Core includes -// -/////////////////////////////////////////////////////////////////////////////// - -// Spirit.Core.Kernel -#include <boost/spirit/home/classic/core/config.hpp> -#include <boost/spirit/home/classic/core/nil.hpp> -#include <boost/spirit/home/classic/core/match.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> - -// Spirit.Core.Primitives -#include <boost/spirit/home/classic/core/primitives/primitives.hpp> -#include <boost/spirit/home/classic/core/primitives/numerics.hpp> - -// Spirit.Core.Scanner -#include <boost/spirit/home/classic/core/scanner/scanner.hpp> -#include <boost/spirit/home/classic/core/scanner/skipper.hpp> - -// Spirit.Core.NonTerminal -#include <boost/spirit/home/classic/core/non_terminal/subrule.hpp> -#include <boost/spirit/home/classic/core/non_terminal/rule.hpp> -#include <boost/spirit/home/classic/core/non_terminal/grammar.hpp> - -// Spirit.Core.Composite -#include <boost/spirit/home/classic/core/composite/actions.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/core/composite/directives.hpp> -#include <boost/spirit/home/classic/core/composite/epsilon.hpp> -#include <boost/spirit/home/classic/core/composite/sequence.hpp> -#include <boost/spirit/home/classic/core/composite/sequential_and.hpp> -#include <boost/spirit/home/classic/core/composite/sequential_or.hpp> -#include <boost/spirit/home/classic/core/composite/alternative.hpp> -#include <boost/spirit/home/classic/core/composite/difference.hpp> -#include <boost/spirit/home/classic/core/composite/intersection.hpp> -#include <boost/spirit/home/classic/core/composite/exclusive_or.hpp> -#include <boost/spirit/home/classic/core/composite/kleene_star.hpp> -#include <boost/spirit/home/classic/core/composite/positive.hpp> -#include <boost/spirit/home/classic/core/composite/optional.hpp> -#include <boost/spirit/home/classic/core/composite/list.hpp> -#include <boost/spirit/home/classic/core/composite/no_actions.hpp> - -// Deprecated interface includes -#include <boost/spirit/home/classic/actor/assign_actor.hpp> -#include <boost/spirit/home/classic/actor/push_back_actor.hpp> - -#if defined(BOOST_SPIRIT_DEBUG) - ////////////////////////////////// - #include <boost/spirit/home/classic/debug/parser_names.hpp> - -#endif // BOOST_SPIRIT_DEBUG - -#endif // BOOST_SPIRIT_CORE_MAIN_HPP - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/composite/epsilon.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/composite/epsilon.hpp deleted file mode 100644 index 71f20a0c08..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/composite/epsilon.hpp +++ /dev/null @@ -1,285 +0,0 @@ -/*============================================================================= - Copyright (c) 1998-2003 Joel de Guzman - Copyright (c) 2002-2003 Martin Wille - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_EPSILON_HPP -#define BOOST_SPIRIT_EPSILON_HPP - -//////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/meta/parser_traits.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/core/composite/no_actions.hpp> - -#if defined(BOOST_MSVC) -# pragma warning(push) -# pragma warning(disable: 4800) // forcing value to bool 'true' or 'false' -#endif - -//////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// condition_parser class -// -// handles expressions of the form -// -// epsilon_p(cond) -// -// where cond is a function or a functor that returns a value suitable -// to be used in boolean context. The expression returns a parser that -// returns an empty match when the condition evaluates to true. -// -/////////////////////////////////////////////////////////////////////////////// - template <typename CondT, bool positive_ = true> - struct condition_parser : parser<condition_parser<CondT, positive_> > - { - typedef condition_parser<CondT, positive_> self_t; - - // not explicit! (needed for implementation of if_p et al.) - condition_parser(CondT const& cond_) : cond(cond_) {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - if (positive_ == bool(cond())) // allow cond to return int - return scan.empty_match(); - else - return scan.no_match(); - } - - condition_parser<CondT, !positive_> - negate() const - { return condition_parser<CondT, !positive_>(cond); } - - private: - - CondT cond; - }; - -#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) || \ - BOOST_WORKAROUND(BOOST_MSVC, == 1400) || \ - BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) -// VC 7.1, VC8 and Sun CC <= 5.8 do not support general -// expressions of non-type template parameters in instantiations - template <typename CondT> - inline condition_parser<CondT, false> - operator~(condition_parser<CondT, true> const& p) - { return p.negate(); } - - template <typename CondT> - inline condition_parser<CondT, true> - operator~(condition_parser<CondT, false> const& p) - { return p.negate(); } -#else // BOOST_WORKAROUND(BOOST_MSVC, == 1310) || == 1400 - template <typename CondT, bool positive> - inline condition_parser<CondT, !positive> - operator~(condition_parser<CondT, positive> const& p) - { return p.negate(); } -#endif // BOOST_WORKAROUND(BOOST_MSVC, == 1310) || == 1400 - -/////////////////////////////////////////////////////////////////////////////// -// -// empty_match_parser class -// -// handles expressions of the form -// epsilon_p(subject) -// where subject is a parser. The expression returns a composite -// parser that returns an empty match if the subject parser matches. -// -/////////////////////////////////////////////////////////////////////////////// - struct empty_match_parser_gen; - struct negated_empty_match_parser_gen; - - template <typename SubjectT> - struct negated_empty_match_parser; // Forward declaration - - template<typename SubjectT> - struct empty_match_parser - : unary<SubjectT, parser<empty_match_parser<SubjectT> > > - { - typedef empty_match_parser<SubjectT> self_t; - typedef unary<SubjectT, parser<self_t> > base_t; - typedef unary_parser_category parser_category_t; - typedef empty_match_parser_gen parser_genererator_t; - typedef self_t embed_t; - - explicit empty_match_parser(SubjectT const& p) : base_t(p) {} - - template <typename ScannerT> - struct result - { typedef typename match_result<ScannerT, nil_t>::type type; }; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typename ScannerT::iterator_t save(scan.first); - - typedef typename no_actions_scanner<ScannerT>::policies_t - policies_t; - - bool matches = this->subject().parse( - scan.change_policies(policies_t(scan))); - if (matches) - { - scan.first = save; // reset the position - return scan.empty_match(); - } - else - { - return scan.no_match(); - } - } - - negated_empty_match_parser<SubjectT> - negate() const - { return negated_empty_match_parser<SubjectT>(this->subject()); } - }; - - template<typename SubjectT> - struct negated_empty_match_parser - : public unary<SubjectT, parser<negated_empty_match_parser<SubjectT> > > - { - typedef negated_empty_match_parser<SubjectT> self_t; - typedef unary<SubjectT, parser<self_t> > base_t; - typedef unary_parser_category parser_category_t; - typedef negated_empty_match_parser_gen parser_genererator_t; - - explicit negated_empty_match_parser(SubjectT const& p) : base_t(p) {} - - template <typename ScannerT> - struct result - { typedef typename match_result<ScannerT, nil_t>::type type; }; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typename ScannerT::iterator_t save(scan.first); - - typedef typename no_actions_scanner<ScannerT>::policies_t - policies_t; - - bool matches = this->subject().parse( - scan.change_policies(policies_t(scan))); - if (!matches) - { - scan.first = save; // reset the position - return scan.empty_match(); - } - else - { - return scan.no_match(); - } - } - - empty_match_parser<SubjectT> - negate() const - { return empty_match_parser<SubjectT>(this->subject()); } - }; - - struct empty_match_parser_gen - { - template <typename SubjectT> - struct result - { typedef empty_match_parser<SubjectT> type; }; - - template <typename SubjectT> - static empty_match_parser<SubjectT> - generate(parser<SubjectT> const& subject) - { return empty_match_parser<SubjectT>(subject.derived()); } - }; - - struct negated_empty_match_parser_gen - { - template <typename SubjectT> - struct result - { typedef negated_empty_match_parser<SubjectT> type; }; - - template <typename SubjectT> - static negated_empty_match_parser<SubjectT> - generate(parser<SubjectT> const& subject) - { return negated_empty_match_parser<SubjectT>(subject.derived()); } - }; - - ////////////////////////////// - template <typename SubjectT> - inline negated_empty_match_parser<SubjectT> - operator~(empty_match_parser<SubjectT> const& p) - { return p.negate(); } - - template <typename SubjectT> - inline empty_match_parser<SubjectT> - operator~(negated_empty_match_parser<SubjectT> const& p) - { return p.negate(); } - -/////////////////////////////////////////////////////////////////////////////// -// -// epsilon_ parser and parser generator class -// -// Operates as primitive parser that always matches an empty sequence. -// -// Also operates as a parser generator. According to the type of the -// argument an instance of empty_match_parser<> (when the argument is -// a parser) or condition_parser<> (when the argument is not a parser) -// is returned by operator(). -// -/////////////////////////////////////////////////////////////////////////////// - namespace impl - { - template <typename SubjectT> - struct epsilon_selector - { - typedef typename as_parser<SubjectT>::type subject_t; - typedef typename - mpl::if_< - is_parser<subject_t> - ,empty_match_parser<subject_t> - ,condition_parser<subject_t> - >::type type; - }; - } - - struct epsilon_parser : public parser<epsilon_parser> - { - typedef epsilon_parser self_t; - - epsilon_parser() {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { return scan.empty_match(); } - - template <typename SubjectT> - typename impl::epsilon_selector<SubjectT>::type - operator()(SubjectT const& subject) const - { - typedef typename impl::epsilon_selector<SubjectT>::type result_t; - return result_t(subject); - } - }; - - epsilon_parser const epsilon_p = epsilon_parser(); - epsilon_parser const eps_p = epsilon_parser(); - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#ifdef BOOST_MSVC -# pragma warning (pop) -#endif - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/composite/no_actions.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/composite/no_actions.hpp deleted file mode 100644 index 472b0e83f8..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/composite/no_actions.hpp +++ /dev/null @@ -1,165 +0,0 @@ -/*============================================================================= - Copyright (c) 1998-2003 Joel de Guzman - Copyright (c) 2003 Vaclav Vesely - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_NO_ACTIONS_HPP) -#define BOOST_SPIRIT_NO_ACTIONS_HPP - -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/core/non_terminal/rule.hpp> - -namespace boost { -namespace spirit { -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -//----------------------------------------------------------------------------- -// no_actions_action_policy - -template<typename BaseT = action_policy> -struct no_actions_action_policy: - public BaseT -{ - typedef BaseT base_t; - - no_actions_action_policy(): - BaseT() - {} - - template<typename PolicyT> - no_actions_action_policy(PolicyT const& other): - BaseT(other) - {} - - template<typename ActorT, typename AttrT, typename IteratorT> - void - do_action( - ActorT const& /*actor*/, - AttrT& /*val*/, - IteratorT const& /*first*/, - IteratorT const& /*last*/) const - {} -}; - -//----------------------------------------------------------------------------- -// no_actions_scanner - - -namespace detail -{ - template <typename ActionPolicy> - struct compute_no_actions_action_policy - { - typedef no_actions_action_policy<ActionPolicy> type; - }; - - template <typename ActionPolicy> - struct compute_no_actions_action_policy<no_actions_action_policy<ActionPolicy> > - { - typedef no_actions_action_policy<ActionPolicy> type; - }; -} - -template<typename ScannerT = scanner<> > -struct no_actions_scanner -{ - typedef scanner_policies< - typename ScannerT::iteration_policy_t, - typename ScannerT::match_policy_t, - typename detail::compute_no_actions_action_policy<typename ScannerT::action_policy_t>::type - > policies_t; - - typedef typename - rebind_scanner_policies<ScannerT, policies_t>::type type; -}; - -#if BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 - -template<typename ScannerT = scanner<> > -struct no_actions_scanner_list -{ - typedef - scanner_list< - ScannerT, - typename no_actions_scanner<ScannerT>::type - > - type; -}; - -#endif // BOOST_SPIRIT_RULE_SCANNERTYPE_LIMIT > 1 - -//----------------------------------------------------------------------------- -// no_actions_parser - -struct no_actions_parser_gen; - -template<typename ParserT> -struct no_actions_parser: - public unary<ParserT, parser<no_actions_parser<ParserT> > > -{ - typedef no_actions_parser<ParserT> self_t; - typedef unary_parser_category parser_category_t; - typedef no_actions_parser_gen parser_generator_t; - typedef unary<ParserT, parser<self_t> > base_t; - - template<typename ScannerT> - struct result - { - typedef typename parser_result<ParserT, ScannerT>::type type; - }; - - no_actions_parser(ParserT const& p) - : base_t(p) - {} - - template<typename ScannerT> - typename result<ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename no_actions_scanner<ScannerT>::policies_t policies_t; - - return this->subject().parse(scan.change_policies(policies_t(scan))); - } -}; - -//----------------------------------------------------------------------------- -// no_actions_parser_gen - -struct no_actions_parser_gen -{ - template<typename ParserT> - struct result - { - typedef no_actions_parser<ParserT> type; - }; - - template<typename ParserT> - static no_actions_parser<ParserT> - generate(parser<ParserT> const& subject) - { - return no_actions_parser<ParserT>(subject.derived()); - } - - template<typename ParserT> - no_actions_parser<ParserT> - operator[](parser<ParserT> const& subject) const - { - return no_actions_parser<ParserT>(subject.derived()); - } -}; - -//----------------------------------------------------------------------------- -// no_actions_d - -const no_actions_parser_gen no_actions_d = no_actions_parser_gen(); - -//----------------------------------------------------------------------------- -BOOST_SPIRIT_CLASSIC_NAMESPACE_END -} // namespace spirit -} // namespace boost - -#endif // !defined(BOOST_SPIRIT_NO_ACTIONS_HPP) diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/grammar.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/grammar.hpp deleted file mode 100644 index 153bc40c3e..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/grammar.hpp +++ /dev/null @@ -1,84 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2002-2003 Martin Wille - Copyright (c) 2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_GRAMMAR_HPP) -#define BOOST_SPIRIT_GRAMMAR_HPP - -/////////////////////////////////////////////////////////////////////////////// -#if defined(BOOST_SPIRIT_THREADSAFE) && defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) -#undef BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE -#endif - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/non_terminal/parser_context.hpp> -#include <boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// grammar class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename DerivedT, typename ContextT = parser_context<> > -struct grammar - : public parser<DerivedT> - , public ContextT::base_t - , public context_aux<ContextT, DerivedT> - BOOST_SPIRIT_GRAMMAR_ID -{ - typedef grammar<DerivedT, ContextT> self_t; - typedef DerivedT const& embed_t; - typedef typename ContextT::context_linker_t context_t; - typedef typename context_t::attr_t attr_t; - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, attr_t>::type type; - }; - - grammar() {} - ~grammar() { impl::grammar_destruct(this); } - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse_main(ScannerT const& scan) const - { return impl::grammar_parser_parse<0>(this, scan); } - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result<self_t, ScannerT>::type result_t; - typedef parser_scanner_linker<ScannerT> scanner_t; - BOOST_SPIRIT_CONTEXT_PARSE(scan, *this, scanner_t, context_t, result_t) - } - - template <int N> - impl::entry_grammar<DerivedT, N, ContextT> - use_parser() const - { return impl::entry_grammar<DerivedT, N, ContextT>( this->derived()); } - - BOOST_SPIRIT_GRAMMAR_STATE -}; - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#undef BOOST_SPIRIT_GRAMMAR_ID -#undef BOOST_SPIRIT_GRAMMAR_STATE -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp deleted file mode 100644 index 371ea32ea0..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp +++ /dev/null @@ -1,365 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2002-2003 Martin Wille - Copyright (c) 2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#if !defined BOOST_SPIRIT_GRAMMAR_IPP -#define BOOST_SPIRIT_GRAMMAR_IPP - -#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) -#include <boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp> -#include <algorithm> -#include <functional> -#include <boost/move/unique_ptr.hpp> -#include <boost/weak_ptr.hpp> -#endif - -#ifdef BOOST_SPIRIT_THREADSAFE -#include <boost/spirit/home/classic/core/non_terminal/impl/static.hpp> -#include <boost/thread/tss.hpp> -#include <boost/thread/mutex.hpp> -#include <boost/thread/lock_types.hpp> -#endif - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -template <typename DerivedT, typename ContextT> -struct grammar; - - -////////////////////////////////// -template <typename GrammarT, typename ScannerT> -struct grammar_definition -{ - typedef typename GrammarT::template definition<ScannerT> type; -}; - - - namespace impl - { - -#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) - struct grammar_tag {}; - - ////////////////////////////////// - template <typename GrammarT> - struct grammar_helper_base - { - virtual int undefine(GrammarT *) = 0; - virtual ~grammar_helper_base() {} - }; - - ////////////////////////////////// - template <typename GrammarT> - struct grammar_helper_list - { - typedef GrammarT grammar_t; - typedef grammar_helper_base<GrammarT> helper_t; - typedef std::vector<helper_t*> vector_t; - - grammar_helper_list() {} - grammar_helper_list(grammar_helper_list const& /*x*/) - { // Does _not_ copy the helpers member ! - } - - grammar_helper_list& operator=(grammar_helper_list const& /*x*/) - { // Does _not_ copy the helpers member ! - return *this; - } - - void push_back(helper_t *helper) - { helpers.push_back(helper); } - - void pop_back() - { helpers.pop_back(); } - - typename vector_t::size_type - size() const - { return helpers.size(); } - - typename vector_t::reverse_iterator - rbegin() - { return helpers.rbegin(); } - - typename vector_t::reverse_iterator - rend() - { return helpers.rend(); } - -#ifdef BOOST_SPIRIT_THREADSAFE - boost::mutex & mutex() - { return m; } -#endif - - private: - - vector_t helpers; -#ifdef BOOST_SPIRIT_THREADSAFE - boost::mutex m; -#endif - }; - - ////////////////////////////////// - struct grammartract_helper_list; - -#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) - - struct grammartract_helper_list - { - template<typename GrammarT> - static grammar_helper_list<GrammarT>& - do_(GrammarT const* g) - { - return g->helpers; - } - }; - -#endif - - ////////////////////////////////// - template <typename GrammarT, typename DerivedT, typename ScannerT> - struct grammar_helper : private grammar_helper_base<GrammarT> - { - typedef GrammarT grammar_t; - typedef ScannerT scanner_t; - typedef DerivedT derived_t; - typedef typename grammar_definition<DerivedT, ScannerT>::type definition_t; - - typedef grammar_helper<grammar_t, derived_t, scanner_t> helper_t; - typedef boost::shared_ptr<helper_t> helper_ptr_t; - typedef boost::weak_ptr<helper_t> helper_weak_ptr_t; - - grammar_helper* - this_() { return this; } - - grammar_helper(helper_weak_ptr_t& p) - : definitions_cnt(0) - , self(this_()) - { p = self; } - - definition_t& - define(grammar_t const* target_grammar) - { - grammar_helper_list<GrammarT> &helpers = - grammartract_helper_list::do_(target_grammar); - typename grammar_t::object_id id = target_grammar->get_object_id(); - - if (definitions.size()<=id) - definitions.resize(id*3/2+1); - if (definitions[id]!=0) - return *definitions[id]; - - boost::movelib::unique_ptr<definition_t> - result(new definition_t(target_grammar->derived())); - -#ifdef BOOST_SPIRIT_THREADSAFE - boost::unique_lock<boost::mutex> lock(helpers.mutex()); -#endif - helpers.push_back(this); - - ++definitions_cnt; - definitions[id] = result.get(); - return *(result.release()); - } - - int - undefine(grammar_t* target_grammar) BOOST_OVERRIDE - { - typename grammar_t::object_id id = target_grammar->get_object_id(); - - if (definitions.size()<=id) - return 0; - delete definitions[id]; - definitions[id] = 0; - if (--definitions_cnt==0) - self.reset(); - return 0; - } - - private: - - std::vector<definition_t*> definitions; - unsigned long definitions_cnt; - helper_ptr_t self; - }; - -#endif /* defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) */ - -#ifdef BOOST_SPIRIT_THREADSAFE - class get_definition_static_data_tag - { - template<typename DerivedT, typename ContextT, typename ScannerT> - friend typename DerivedT::template definition<ScannerT> & - get_definition(grammar<DerivedT, ContextT> const* self); - - get_definition_static_data_tag() {} - }; -#endif - - template<typename DerivedT, typename ContextT, typename ScannerT> - inline typename DerivedT::template definition<ScannerT> & - get_definition(grammar<DerivedT, ContextT> const* self) - { -#if defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) - - typedef typename DerivedT::template definition<ScannerT> definition_t; - static definition_t def(self->derived()); - return def; -#else - typedef grammar<DerivedT, ContextT> self_t; - typedef impl::grammar_helper<self_t, DerivedT, ScannerT> helper_t; - typedef typename helper_t::helper_weak_ptr_t ptr_t; - -# ifdef BOOST_SPIRIT_THREADSAFE - boost::thread_specific_ptr<ptr_t> & tld_helper - = static_<boost::thread_specific_ptr<ptr_t>, - get_definition_static_data_tag>(get_definition_static_data_tag()); - - if (!tld_helper.get()) - tld_helper.reset(new ptr_t); - ptr_t &helper = *tld_helper; -# else - static ptr_t helper; -# endif - if (helper.expired()) - new helper_t(helper); - return helper.lock()->define(self); -#endif - } - - template <int N> - struct call_helper { - - template <typename RT, typename DefinitionT, typename ScannerT> - static void - do_ (RT &result, DefinitionT &def, ScannerT const &scan) - { - result = def.template get_start_parser<N>()->parse(scan); - } - }; - - template <> - struct call_helper<0> { - - template <typename RT, typename DefinitionT, typename ScannerT> - static void - do_ (RT &result, DefinitionT &def, ScannerT const &scan) - { - result = def.start().parse(scan); - } - }; - - ////////////////////////////////// - template<int N, typename DerivedT, typename ContextT, typename ScannerT> - inline typename parser_result<grammar<DerivedT, ContextT>, ScannerT>::type - grammar_parser_parse( - grammar<DerivedT, ContextT> const* self, - ScannerT const &scan) - { - typedef - typename parser_result<grammar<DerivedT, ContextT>, ScannerT>::type - result_t; - typedef typename DerivedT::template definition<ScannerT> definition_t; - - result_t result; - definition_t &def = get_definition<DerivedT, ContextT, ScannerT>(self); - - call_helper<N>::do_(result, def, scan); - return result; - } - - ////////////////////////////////// - template<typename GrammarT> - inline void - grammar_destruct(GrammarT* self) - { -#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) - typedef grammar_helper_list<GrammarT> helper_list_t; - - helper_list_t& helpers = - grammartract_helper_list::do_(self); - - typedef typename helper_list_t::vector_t::reverse_iterator iterator_t; - - for (iterator_t i = helpers.rbegin(); i != helpers.rend(); ++i) - (*i)->undefine(self); -#else - (void)self; -#endif - } - - /////////////////////////////////////////////////////////////////////////// - // - // entry_grammar class - // - /////////////////////////////////////////////////////////////////////////// - template <typename DerivedT, int N, typename ContextT> - class entry_grammar - : public parser<entry_grammar<DerivedT, N, ContextT> > - { - - public: - typedef entry_grammar<DerivedT, N, ContextT> self_t; - typedef self_t embed_t; - typedef typename ContextT::context_linker_t context_t; - typedef typename context_t::attr_t attr_t; - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, attr_t>::type type; - }; - - entry_grammar(DerivedT const &p) : target_grammar(p) {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse_main(ScannerT const& scan) const - { return impl::grammar_parser_parse<N>(&target_grammar, scan); } - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result<self_t, ScannerT>::type result_t; - typedef parser_scanner_linker<ScannerT> scanner_t; - BOOST_SPIRIT_CONTEXT_PARSE(scan, target_grammar, scanner_t, - context_t, result_t) - } - - private: - DerivedT const &target_grammar; - }; - - } // namespace impl - -/////////////////////////////////////// -#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) -#define BOOST_SPIRIT_GRAMMAR_ID , public impl::object_with_id<impl::grammar_tag> -#else -#define BOOST_SPIRIT_GRAMMAR_ID -#endif - -/////////////////////////////////////// -#if !defined(BOOST_SPIRIT_SINGLE_GRAMMAR_INSTANCE) -#define BOOST_SPIRIT_GRAMMAR_STATE \ - private: \ - friend struct impl::grammartract_helper_list; \ - mutable impl::grammar_helper_list<self_t> helpers; -#else -#define BOOST_SPIRIT_GRAMMAR_STATE -#endif - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp deleted file mode 100644 index fc56566377..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/object_with_id.ipp +++ /dev/null @@ -1,196 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002-2003 Martin Wille - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#if !defined BOOST_SPIRIT_OBJECT_WITH_ID_IPP -#define BOOST_SPIRIT_OBJECT_WITH_ID_IPP - -#include <vector> -#include <boost/shared_ptr.hpp> - -#ifdef BOOST_SPIRIT_THREADSAFE -#include <boost/thread/mutex.hpp> -#include <boost/thread/lock_types.hpp> -#include <boost/thread/once.hpp> -#endif - -#include <boost/spirit/home/classic/namespace.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - namespace impl { - - ////////////////////////////////// - template <typename IdT = std::size_t> - struct object_with_id_base_supply - { - typedef IdT object_id; - typedef std::vector<object_id> id_vector; - - object_with_id_base_supply() : max_id(object_id()) {} - -#ifdef BOOST_SPIRIT_THREADSAFE - boost::mutex mutex; -#endif - object_id max_id; - id_vector free_ids; - - object_id acquire(); - void release(object_id); - }; - - ////////////////////////////////// - template <typename TagT, typename IdT = std::size_t> - struct object_with_id_base - { - typedef TagT tag_t; - typedef IdT object_id; - - protected: - - object_id acquire_object_id(); - void release_object_id(object_id); - - private: -#ifdef BOOST_SPIRIT_THREADSAFE - static boost::mutex &mutex_instance(); - static void mutex_init(); -#endif - - boost::shared_ptr<object_with_id_base_supply<IdT> > id_supply; - }; - - ////////////////////////////////// - template<class TagT, typename IdT = std::size_t> - struct object_with_id : private object_with_id_base<TagT, IdT> - { - typedef object_with_id<TagT, IdT> self_t; - typedef object_with_id_base<TagT, IdT> base_t; - typedef IdT object_id; - - object_with_id() : id(base_t::acquire_object_id()) {} - object_with_id(self_t const &other) - : base_t(other) - , id(base_t::acquire_object_id()) - {} // don't copy id - self_t &operator = (self_t const &other) - { // don't assign id - base_t::operator=(other); - return *this; - } - ~object_with_id() { base_t::release_object_id(id); } - object_id get_object_id() const { return id; } - - private: - - object_id const id; - }; - - ////////////////////////////////// - template <typename IdT> - inline IdT - object_with_id_base_supply<IdT>::acquire() - { -#ifdef BOOST_SPIRIT_THREADSAFE - boost::unique_lock<boost::mutex> lock(mutex); -#endif - if (!free_ids.empty()) - { - object_id id = *free_ids.rbegin(); - free_ids.pop_back(); - return id; - } - else - { - if (free_ids.capacity()<=max_id) - free_ids.reserve(max_id*3/2+1); - return ++max_id; - } - } - - ////////////////////////////////// - template <typename IdT> - inline void - object_with_id_base_supply<IdT>::release(IdT id) - { -#ifdef BOOST_SPIRIT_THREADSAFE - boost::unique_lock<boost::mutex> lock(mutex); -#endif - if (max_id == id) - max_id--; - else - free_ids.push_back(id); // doesn't throw - } - - ////////////////////////////////// - template <typename TagT, typename IdT> - inline IdT - object_with_id_base<TagT, IdT>::acquire_object_id() - { - { -#ifdef BOOST_SPIRIT_THREADSAFE -#ifndef BOOST_THREAD_PROVIDES_ONCE_CXX11 - static boost::once_flag been_here = BOOST_ONCE_INIT; -#else - static boost::once_flag been_here; -#endif - boost::call_once(been_here, mutex_init); - boost::mutex &mutex = mutex_instance(); - boost::unique_lock<boost::mutex> lock(mutex); -#endif - static boost::shared_ptr<object_with_id_base_supply<IdT> > - static_supply; - - if (!static_supply.get()) - static_supply.reset(new object_with_id_base_supply<IdT>()); - id_supply = static_supply; - } - - return id_supply->acquire(); - } - - ////////////////////////////////// - template <typename TagT, typename IdT> - inline void - object_with_id_base<TagT, IdT>::release_object_id(IdT id) - { - id_supply->release(id); - } - - ////////////////////////////////// -#ifdef BOOST_SPIRIT_THREADSAFE - template <typename TagT, typename IdT> - inline boost::mutex & - object_with_id_base<TagT, IdT>::mutex_instance() - { - static boost::mutex mutex; - return mutex; - } -#endif - - ////////////////////////////////// -#ifdef BOOST_SPIRIT_THREADSAFE - template <typename TagT, typename IdT> - inline void - object_with_id_base<TagT, IdT>::mutex_init() - { - mutex_instance(); - } -#endif - - } // namespace impl - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/static.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/static.hpp deleted file mode 100644 index ae2a66c506..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/static.hpp +++ /dev/null @@ -1,124 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Joao Abecasis - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_STATIC_HPP) -#define BOOST_SPIRIT_STATIC_HPP - -#include <boost/noncopyable.hpp> -#include <boost/call_traits.hpp> -#include <boost/aligned_storage.hpp> - -#include <boost/type_traits/add_pointer.hpp> -#include <boost/type_traits/alignment_of.hpp> - -#include <boost/thread/once.hpp> - -#include <memory> // for placement new - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - // - // Provides thread-safe initialization of a single static instance of T. - // - // This instance is guaranteed to be constructed on static storage in a - // thread-safe manner, on the first call to the constructor of static_. - // - // Requirements: - // T is default constructible - // (There's an alternate implementation that relaxes this - // requirement -- Joao Abecasis) - // T::T() MUST not throw! - // this is a requirement of boost::call_once. - // - template <class T, class Tag> - struct static_ - : boost::noncopyable - { - private: - - struct destructor - { - ~destructor() - { - static_::get_address()->~value_type(); - } - }; - - struct default_ctor - { - static void construct() - { - ::new (static_::get_address()) value_type(); - static destructor d; - } - }; - - public: - - typedef T value_type; - typedef typename boost::call_traits<T>::reference reference; - typedef typename boost::call_traits<T>::const_reference const_reference; - - static_(Tag = Tag()) - { - boost::call_once(&default_ctor::construct, constructed_); - } - - operator reference() - { - return this->get(); - } - - operator const_reference() const - { - return this->get(); - } - - reference get() - { - return *this->get_address(); - } - - const_reference get() const - { - return *this->get_address(); - } - - private: - typedef typename boost::add_pointer<value_type>::type pointer; - - static pointer get_address() - { - return static_cast<pointer>(data_.address()); - } - - typedef boost::aligned_storage<sizeof(value_type), - boost::alignment_of<value_type>::value> storage_type; - - static storage_type data_; - static once_flag constructed_; - }; - - template <class T, class Tag> - typename static_<T, Tag>::storage_type static_<T, Tag>::data_; - - template <class T, class Tag> -#ifndef BOOST_THREAD_PROVIDES_ONCE_CXX11 - once_flag static_<T, Tag>::constructed_ = BOOST_ONCE_INIT; -#else - once_flag static_<T, Tag>::constructed_; -#endif - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // include guard diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/subrule.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/subrule.ipp deleted file mode 100644 index fc952fedea..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/impl/subrule.ipp +++ /dev/null @@ -1,142 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#if !defined(BOOST_SPIRIT_SUBRULE_IPP) -#define BOOST_SPIRIT_SUBRULE_IPP - -#include <boost/mpl/if.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - template <typename FirstT, typename RestT> - struct subrule_list; - - template <int ID, typename DefT, typename ContextT> - struct subrule_parser; - - namespace impl { - - - template <int N, typename ListT> - struct get_subrule - { - // First case. ListT is non-empty but the list's - // first item does not have the ID we are looking for. - - typedef typename get_subrule<N, typename ListT::rest_t>::type type; - }; - - template <int ID, typename DefT, typename ContextT, typename RestT> - struct get_subrule< - ID, - subrule_list< - subrule_parser<ID, DefT, ContextT>, - RestT> > - { - // Second case. ListT is non-empty and the list's - // first item has the ID we are looking for. - - typedef DefT type; - }; - - template <int ID> - struct get_subrule<ID, nil_t> - { - // Third case. ListT is empty - typedef nil_t type; - }; - - - template <typename T1, typename T2> - struct get_result_t { - - // If the result type dictated by the context is nil_t (no closures - // present), then the whole subrule_parser return type is equal to - // the return type of the right hand side of this subrule_parser, - // otherwise it is equal to the dictated return value. - - typedef typename mpl::if_< - boost::is_same<T1, nil_t>, T2, T1 - >::type type; - }; - - template <int ID, typename ScannerT, typename ContextResultT> - struct get_subrule_result - { - typedef typename - impl::get_subrule<ID, typename ScannerT::list_t>::type - parser_t; - - typedef typename parser_result<parser_t, ScannerT>::type - def_result_t; - - typedef typename match_result<ScannerT, ContextResultT>::type - context_result_t; - - typedef typename get_result_t<context_result_t, def_result_t>::type - type; - }; - - template <typename DefT, typename ScannerT, typename ContextResultT> - struct get_subrule_parser_result - { - typedef typename parser_result<DefT, ScannerT>::type - def_result_t; - - typedef typename match_result<ScannerT, ContextResultT>::type - context_result_t; - - typedef typename get_result_t<context_result_t, def_result_t>::type - type; - }; - - template <typename SubruleT, int ID> - struct same_subrule_id - { - BOOST_STATIC_CONSTANT(bool, value = (SubruleT::id == ID)); - }; - - template <typename RT, typename ScannerT, int ID> - struct parse_subrule - { - template <typename ListT> - static void - do_parse(RT& r, ScannerT const& scan, ListT const& list, mpl::true_) - { - r = list.first.rhs.parse(scan); - } - - template <typename ListT> - static void - do_parse(RT& r, ScannerT const& scan, ListT const& list, mpl::false_) - { - typedef typename ListT::rest_t::first_t subrule_t; - mpl::bool_<same_subrule_id<subrule_t, ID>::value> same_id; - do_parse(r, scan, list.rest, same_id); - } - - static void - do_(RT& r, ScannerT const& scan) - { - typedef typename ScannerT::list_t::first_t subrule_t; - mpl::bool_<same_subrule_id<subrule_t, ID>::value> same_id; - do_parse(r, scan, scan.list, same_id); - } - }; - -} - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit::impl - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/subrule.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/subrule.hpp deleted file mode 100644 index 1d16d70aea..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/subrule.hpp +++ /dev/null @@ -1,303 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_SUBRULE_HPP) -#define BOOST_SPIRIT_SUBRULE_HPP - -#include <boost/config.hpp> -#include <boost/static_assert.hpp> -#include <boost/mpl/if.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/type_traits/is_same.hpp> - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/non_terminal/parser_context.hpp> - -#include <boost/spirit/home/classic/core/non_terminal/subrule_fwd.hpp> -#include <boost/spirit/home/classic/core/non_terminal/impl/subrule.ipp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // - // subrules_scanner class - // - /////////////////////////////////////////////////////////////////////////// - template <typename ScannerT, typename ListT> - struct subrules_scanner : public ScannerT - { - typedef ScannerT scanner_t; - typedef ListT list_t; - typedef subrules_scanner<ScannerT, ListT> self_t; - - subrules_scanner(ScannerT const& scan, ListT const& list_) - : ScannerT(scan), list(list_) {} - - template <typename PoliciesT> - struct rebind_policies - { - typedef typename rebind_scanner_policies<ScannerT, PoliciesT>::type - rebind_scanner; - typedef subrules_scanner<rebind_scanner, ListT> type; - }; - - template <typename PoliciesT> - subrules_scanner< - typename rebind_scanner_policies<ScannerT, PoliciesT>::type, - ListT> - change_policies(PoliciesT const& policies) const - { - typedef subrules_scanner< - BOOST_DEDUCED_TYPENAME - rebind_scanner_policies<ScannerT, PoliciesT>::type, - ListT> - subrules_scanner_t; - - return subrules_scanner_t( - ScannerT::change_policies(policies), - list); - } - - template <typename IteratorT> - struct rebind_iterator - { - typedef typename rebind_scanner_iterator<ScannerT, IteratorT>::type - rebind_scanner; - typedef subrules_scanner<rebind_scanner, ListT> type; - }; - - template <typename IteratorT> - subrules_scanner< - typename rebind_scanner_iterator<ScannerT, IteratorT>::type, - ListT> - change_iterator(IteratorT const& first, IteratorT const &last) const - { - typedef subrules_scanner< - BOOST_DEDUCED_TYPENAME - rebind_scanner_iterator<ScannerT, IteratorT>::type, - ListT> - subrules_scanner_t; - - return subrules_scanner_t( - ScannerT::change_iterator(first, last), - list); - } - - ListT const& list; - }; - - /////////////////////////////////////////////////////////////////////////// - // - // subrule_scanner type computer class - // - // This computer ensures that the scanner will not be recursively - // instantiated if it's not needed. - // - /////////////////////////////////////////////////////////////////////////// - template <typename ScannerT, typename ListT> - struct subrules_scanner_finder - { - typedef subrules_scanner<ScannerT, ListT> type; - }; - - template <typename ScannerT, typename ListT> - struct subrules_scanner_finder<subrules_scanner<ScannerT, ListT>, ListT> - { - typedef subrules_scanner<ScannerT, ListT> type; - }; - - /////////////////////////////////////////////////////////////////////////// - // - // subrule_list class - // - /////////////////////////////////////////////////////////////////////////// - template <typename FirstT, typename RestT> - struct subrule_list : public parser<subrule_list<FirstT, RestT> > - { - typedef subrule_list<FirstT, RestT> self_t; - typedef FirstT first_t; - typedef RestT rest_t; - - subrule_list(FirstT const& first_, RestT const& rest_) - : first(first_), rest(rest_) {} - - template <typename ScannerT> - struct result - { - typedef typename parser_result<FirstT, ScannerT>::type type; - }; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename subrules_scanner_finder<ScannerT, self_t>::type - subrules_scanner_t; - subrules_scanner_t g_arg(scan, *this); - return first.start.parse(g_arg); - } - - template <int ID, typename DefT, typename ContextT> - subrule_list< - FirstT, - subrule_list< - subrule_parser<ID, DefT, ContextT>, - RestT> > - operator,(subrule_parser<ID, DefT, ContextT> const& rhs_) - { - return subrule_list< - FirstT, - subrule_list< - subrule_parser<ID, DefT, ContextT>, - RestT> >( - first, - subrule_list< - subrule_parser<ID, DefT, ContextT>, - RestT>(rhs_, rest)); - } - - FirstT first; - RestT rest; - }; - - /////////////////////////////////////////////////////////////////////////// - // - // subrule_parser class - // - /////////////////////////////////////////////////////////////////////////// - template <int ID, typename DefT, typename ContextT> - struct subrule_parser - : public parser<subrule_parser<ID, DefT, ContextT> > - { - typedef subrule_parser<ID, DefT, ContextT> self_t; - typedef subrule<ID, ContextT> subrule_t; - typedef DefT def_t; - - BOOST_STATIC_CONSTANT(int, id = ID); - - template <typename ScannerT> - struct result - { - typedef typename - impl::get_subrule_parser_result< - DefT, ScannerT, typename subrule_t::attr_t>::type type; - }; - - subrule_parser(subrule_t const& start_, DefT const& rhs_) - : rhs(rhs_), start(start_) {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - // This will only be called when parsing single subrules. - typedef subrule_list<self_t, nil_t> list_t; - typedef subrules_scanner<ScannerT, list_t> scanner_t; - - list_t list(*this, nil_t()); - scanner_t g_arg(scan, list); - return start.parse(g_arg); - } - - template <int ID2, typename DefT2, typename ContextT2> - inline subrule_list< - self_t, - subrule_list< - subrule_parser<ID2, DefT2, ContextT2>, - nil_t> > - operator,(subrule_parser<ID2, DefT2, ContextT2> const& rhs) const - { - return subrule_list< - self_t, - subrule_list< - subrule_parser<ID2, DefT2, ContextT2>, - nil_t> >( - *this, - subrule_list< - subrule_parser<ID2, DefT2, ContextT2>, nil_t>( - rhs, nil_t())); - } - - typename DefT::embed_t rhs; - subrule_t const& start; - }; - - /////////////////////////////////////////////////////////////////////////// - // - // subrule class - // - /////////////////////////////////////////////////////////////////////////// - template <int ID, typename ContextT> - struct subrule - : public parser<subrule<ID, ContextT> > - , public ContextT::base_t - , public context_aux<ContextT, subrule<ID, ContextT> > - { - typedef subrule<ID, ContextT> self_t; - typedef subrule<ID, ContextT> const& embed_t; - - typedef typename ContextT::context_linker_t context_t; - typedef typename context_t::attr_t attr_t; - - BOOST_STATIC_CONSTANT(int, id = ID); - - template <typename ScannerT> - struct result - { - typedef typename - impl::get_subrule_result<ID, ScannerT, attr_t>::type type; - }; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse_main(ScannerT const& scan) const - { - typedef typename parser_result<self_t, ScannerT>::type result_t; - result_t result_; - impl::parse_subrule<result_t, ScannerT, ID>:: - do_(result_, scan); - return result_; - } - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result<self_t, ScannerT>::type result_t; - typedef parser_scanner_linker<ScannerT> scanner_t; - BOOST_SPIRIT_CONTEXT_PARSE( - scan, *this, scanner_t, context_t, result_t); - } - - template <typename DefT> - subrule_parser<ID, DefT, ContextT> - operator=(parser<DefT> const& rhs) const - { - return subrule_parser<ID, DefT, ContextT>(*this, rhs.derived()); - } - - private: - - // assignment of subrules is not allowed. Use subrules - // with identical IDs if you want to have aliases. - - subrule& operator=(subrule const&); - - template <int ID2, typename ContextT2> - subrule& operator=(subrule<ID2, ContextT2> const&); - }; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/subrule_fwd.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/subrule_fwd.hpp deleted file mode 100644 index bb6ce87858..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/core/non_terminal/subrule_fwd.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Tobias Schwinger - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_SUBRULE_FWD_HPP) -#define BOOST_SPIRIT_SUBRULE_FWD_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/non_terminal/parser_context.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - template <int ID, typename ContextT = parser_context<> > - struct subrule; - - template <int ID, typename DefT, typename ContextT = parser_context<> > - struct subrule_parser; - - template <typename ScannerT, typename ListT> - struct subrules_scanner; - - template <typename FirstT, typename RestT> - struct subrule_list; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/debug/impl/parser_names.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/debug/impl/parser_names.ipp deleted file mode 100644 index 85cecae5b1..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/debug/impl/parser_names.ipp +++ /dev/null @@ -1,555 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#if !defined(BOOST_SPIRIT_PARSER_NAMES_IPP) -#define BOOST_SPIRIT_PARSER_NAMES_IPP - -#if defined(BOOST_SPIRIT_DEBUG) - -#include <string> -#include <iostream> -#include <map> - -#include <boost/config.hpp> -#ifdef BOOST_NO_STRINGSTREAM -#include <strstream> -#define BOOST_SPIRIT_SSTREAM std::strstream -std::string BOOST_SPIRIT_GETSTRING(std::strstream& ss) -{ - ss << ends; - std::string rval = ss.str(); - ss.freeze(false); - return rval; -} -#else -#include <sstream> -#define BOOST_SPIRIT_GETSTRING(ss) ss.str() -#define BOOST_SPIRIT_SSTREAM std::stringstream -#endif - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// from actions.hpp - template <typename ParserT, typename ActionT> - inline std::string - parser_name(action<ParserT, ActionT> const& p) - { - return std::string("action") - + std::string("[") - + parser_name(p.subject()) - + std::string("]"); - } - -/////////////////////////////////////////////////////////////////////////////// -// from directives.hpp - template <typename ParserT> - inline std::string - parser_name(contiguous<ParserT> const& p) - { - return std::string("contiguous") - + std::string("[") - + parser_name(p.subject()) - + std::string("]"); - } - - template <typename ParserT> - inline std::string - parser_name(inhibit_case<ParserT> const& p) - { - return std::string("inhibit_case") - + std::string("[") - + parser_name(p.subject()) - + std::string("]"); - } - - template <typename A, typename B> - inline std::string - parser_name(longest_alternative<A, B> const& p) - { - return std::string("longest_alternative") - + std::string("[") - + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) - + std::string("]"); - } - - template <typename A, typename B> - inline std::string - parser_name(shortest_alternative<A, B> const& p) - { - return std::string("shortest_alternative") - + std::string("[") - + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) - + std::string("]"); - } - -/////////////////////////////////////////////////////////////////////////////// -// from numerics.hpp - template <typename T, int Radix, unsigned MinDigits, int MaxDigits> - inline std::string - parser_name(uint_parser<T, Radix, MinDigits, MaxDigits> const& /*p*/) - { - BOOST_SPIRIT_SSTREAM stream; - stream << Radix << ", " << MinDigits << ", " << MaxDigits; - return std::string("uint_parser<") - + BOOST_SPIRIT_GETSTRING(stream) - + std::string(">"); - } - - template <typename T, int Radix, unsigned MinDigits, int MaxDigits> - inline std::string - parser_name(int_parser<T, Radix, MinDigits, MaxDigits> const& /*p*/) - { - BOOST_SPIRIT_SSTREAM stream; - stream << Radix << ", " << MinDigits << ", " << MaxDigits; - return std::string("int_parser<") - + BOOST_SPIRIT_GETSTRING(stream) - + std::string(">"); - } - - template <typename T, typename RealPoliciesT> - inline std::string - parser_name(real_parser<T, RealPoliciesT> const& /*p*/) - { - return std::string("real_parser"); - } - -/////////////////////////////////////////////////////////////////////////////// -// from operators.hpp - template <typename A, typename B> - inline std::string - parser_name(sequence<A, B> const& p) - { - return std::string("sequence") - + std::string("[") - + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) - + std::string("]"); - } - - template <typename A, typename B> - inline std::string - parser_name(sequential_or<A, B> const& p) - { - return std::string("sequential_or") - + std::string("[") - + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) - + std::string("]"); - } - - template <typename A, typename B> - inline std::string - parser_name(alternative<A, B> const& p) - { - return std::string("alternative") - + std::string("[") - + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) - + std::string("]"); - } - - template <typename A, typename B> - inline std::string - parser_name(intersection<A, B> const& p) - { - return std::string("intersection") - + std::string("[") - + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) - + std::string("]"); - } - - template <typename A, typename B> - inline std::string - parser_name(difference<A, B> const& p) - { - return std::string("difference") - + std::string("[") - + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) - + std::string("]"); - } - - template <typename A, typename B> - inline std::string - parser_name(exclusive_or<A, B> const& p) - { - return std::string("exclusive_or") - + std::string("[") - + parser_name(p.left()) + std::string(", ") + parser_name(p.right()) - + std::string("]"); - } - - template <typename S> - inline std::string - parser_name(optional<S> const& p) - { - return std::string("optional") - + std::string("[") - + parser_name(p.subject()) - + std::string("]"); - } - - template <typename S> - inline std::string - parser_name(kleene_star<S> const& p) - { - return std::string("kleene_star") - + std::string("[") - + parser_name(p.subject()) - + std::string("]"); - } - - template <typename S> - inline std::string - parser_name(positive<S> const& p) - { - return std::string("positive") - + std::string("[") - + parser_name(p.subject()) - + std::string("]"); - } - -/////////////////////////////////////////////////////////////////////////////// -// from parser.hpp - template <typename DerivedT> - inline std::string - parser_name(parser<DerivedT> const& /*p*/) - { - return std::string("parser"); - } - -/////////////////////////////////////////////////////////////////////////////// -// from primitives.hpp - template <typename DerivedT> - inline std::string - parser_name(char_parser<DerivedT> const &/*p*/) - { - return std::string("char_parser"); - } - - template <typename CharT> - inline std::string - parser_name(chlit<CharT> const &p) - { - return std::string("chlit(\'") - + std::string(1, p.ch) - + std::string("\')"); - } - - template <typename CharT> - inline std::string - parser_name(range<CharT> const &p) - { - return std::string("range(") - + std::string(1, p.first) + std::string(", ") + std::string(1, p.last) - + std::string(")"); - } - - template <typename IteratorT> - inline std::string - parser_name(chseq<IteratorT> const &p) - { - return std::string("chseq(\"") - + std::string(p.first, p.last) - + std::string("\")"); - } - - template <typename IteratorT> - inline std::string - parser_name(strlit<IteratorT> const &p) - { - return std::string("strlit(\"") - + std::string(p.seq.first, p.seq.last) - + std::string("\")"); - } - - inline std::string - parser_name(nothing_parser const&) - { - return std::string("nothing"); - } - - inline std::string - parser_name(epsilon_parser const&) - { - return std::string("epsilon"); - } - - inline std::string - parser_name(anychar_parser const&) - { - return std::string("anychar"); - } - - inline std::string - parser_name(alnum_parser const&) - { - return std::string("alnum"); - } - - inline std::string - parser_name(alpha_parser const&) - { - return std::string("alpha"); - } - - inline std::string - parser_name(cntrl_parser const&) - { - return std::string("cntrl"); - } - - inline std::string - parser_name(digit_parser const&) - { - return std::string("digit"); - } - - inline std::string - parser_name(graph_parser const&) - { - return std::string("graph"); - } - - inline std::string - parser_name(lower_parser const&) - { - return std::string("lower"); - } - - inline std::string - parser_name(print_parser const&) - { - return std::string("print"); - } - - inline std::string - parser_name(punct_parser const&) - { - return std::string("punct"); - } - - inline std::string - parser_name(blank_parser const&) - { - return std::string("blank"); - } - - inline std::string - parser_name(space_parser const&) - { - return std::string("space"); - } - - inline std::string - parser_name(upper_parser const&) - { - return std::string("upper"); - } - - inline std::string - parser_name(xdigit_parser const&) - { - return std::string("xdigit"); - } - - inline std::string - parser_name(eol_parser const&) - { - return std::string("eol"); - } - - inline std::string - parser_name(end_parser const&) - { - return std::string("end"); - } - -/////////////////////////////////////////////////////////////////////////////// -// from rule.hpp - namespace impl { - struct node_registry - { - typedef std::pair<std::string, bool> rule_info; - typedef std::map<void const *, rule_info> rule_infos; - - std::string find_node(void const *r) - { - rule_infos::const_iterator cit = infos.find(r); - if (cit != infos.end()) - return (*cit).second.first; - return std::string("<unknown>"); - } - - bool trace_node(void const *r) - { - rule_infos::const_iterator cit = infos.find(r); - if (cit != infos.end()) - return (*cit).second.second; - return BOOST_SPIRIT_DEBUG_TRACENODE; - } - - bool register_node(void const *r, char const *name_to_register, - bool trace_node) - { - if (infos.find(r) != infos.end()) - return false; - - return infos.insert(rule_infos::value_type(r, - rule_info(std::string(name_to_register), trace_node)) - ).second; - } - - bool unregister_node(void const *r) - { - if (infos.find(r) == infos.end()) - return false; - return (1 == infos.erase(r)); - } - - private: - rule_infos infos; - }; - - inline node_registry & - get_node_registry() - { - static node_registry node_infos; - return node_infos; - } - } // namespace impl - - template< - typename DerivedT, typename EmbedT, - typename T0, typename T1, typename T2 - > - inline std::string - parser_name(impl::rule_base<DerivedT, EmbedT, T0, T1, T2> const& p) - { - return std::string("rule_base") - + std::string("(") - + impl::get_node_registry().find_node(&p) - + std::string(")"); - } - - template<typename T0, typename T1, typename T2> - inline std::string - parser_name(rule<T0, T1, T2> const& p) - { - return std::string("rule") - + std::string("(") - + impl::get_node_registry().find_node(&p) - + std::string(")"); - } - -/////////////////////////////////////////////////////////////////////////////// -// from subrule.hpp - template <typename FirstT, typename RestT> - inline std::string - parser_name(subrule_list<FirstT, RestT> const &p) - { - return std::string("subrule_list") - + std::string("(") - + impl::get_node_registry().find_node(&p) - + std::string(")"); - } - - template <int ID, typename DefT, typename ContextT> - inline std::string - parser_name(subrule_parser<ID, DefT, ContextT> const &p) - { - return std::string("subrule_parser") - + std::string("(") - + impl::get_node_registry().find_node(&p) - + std::string(")"); - } - - template <int ID, typename ContextT> - inline std::string - parser_name(subrule<ID, ContextT> const &p) - { - BOOST_SPIRIT_SSTREAM stream; - stream << ID; - return std::string("subrule<") - + BOOST_SPIRIT_GETSTRING(stream) - + std::string(">(") - + impl::get_node_registry().find_node(&p) - + std::string(")"); - } - -/////////////////////////////////////////////////////////////////////////////// -// from grammar.hpp - template <typename DerivedT, typename ContextT> - inline std::string - parser_name(grammar<DerivedT, ContextT> const& p) - { - return std::string("grammar") - + std::string("(") - + impl::get_node_registry().find_node(&p) - + std::string(")"); - } - -/////////////////////////////////////////////////////////////////////////////// -// decide, if a node is to be traced or not - template< - typename DerivedT, typename EmbedT, - typename T0, typename T1, typename T2 - > - inline bool - trace_parser(impl::rule_base<DerivedT, EmbedT, T0, T1, T2> - const& p) - { - return impl::get_node_registry().trace_node(&p); - } - - template<typename T0, typename T1, typename T2> - inline bool - trace_parser(rule<T0, T1, T2> const& p) - { - return impl::get_node_registry().trace_node(&p); - } - - template <typename DerivedT, typename ContextT> - inline bool - trace_parser(grammar<DerivedT, ContextT> const& p) - { - return impl::get_node_registry().trace_node(&p); - } - - template <typename DerivedT, int N, typename ContextT> - inline bool - trace_parser(impl::entry_grammar<DerivedT, N, ContextT> const& p) - { - return impl::get_node_registry().trace_node(&p); - } - - template <int ID, typename ContextT> - bool - trace_parser(subrule<ID, ContextT> const& p) - { - return impl::get_node_registry().trace_node(&p); - } - - template <typename ParserT, typename ActorTupleT> - bool - trace_parser(init_closure_parser<ParserT, ActorTupleT> const& p) - { - return impl::get_node_registry().trace_node(&p); - } - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#undef BOOST_SPIRIT_SSTREAM -#undef BOOST_SPIRIT_GETSTRING - -#endif // defined(BOOST_SPIRIT_DEBUG) - -#endif // !defined(BOOST_SPIRIT_PARSER_NAMES_IPP) diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/debug/parser_names.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/debug/parser_names.hpp deleted file mode 100644 index edd17cc004..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/debug/parser_names.hpp +++ /dev/null @@ -1,254 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_PARSER_NAMES_HPP) -#define BOOST_SPIRIT_PARSER_NAMES_HPP - -#if defined(BOOST_SPIRIT_DEBUG) - -////////////////////////////////// -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// Declaration of helper functions, which return the name of a concrete -// parser instance. The functions are specialized on the parser types. The -// functions declared in this file are for the predefined parser types from -// the Spirit core library only, so additional functions might be provided as -// needed. -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// from actions.hpp - template <typename ParserT, typename ActionT> - std::string - parser_name(action<ParserT, ActionT> const& p); - -/////////////////////////////////////////////////////////////////////////////// -// from directives.hpp - template <typename ParserT> - std::string - parser_name(contiguous<ParserT> const& p); - - template <typename ParserT> - std::string - parser_name(inhibit_case<ParserT> const& p); - - template <typename A, typename B> - std::string - parser_name(longest_alternative<A, B> const& p); - - template <typename A, typename B> - std::string - parser_name(shortest_alternative<A, B> const& p); - -/////////////////////////////////////////////////////////////////////////////// -// from grammar.hpp - template <typename DerivedT, typename ContextT> - std::string - parser_name(grammar<DerivedT, ContextT> const& p); - -/////////////////////////////////////////////////////////////////////////////// -// from numerics.hpp - template <typename T, int Radix, unsigned MinDigits, int MaxDigits> - std::string - parser_name(uint_parser<T, Radix, MinDigits, MaxDigits> const& p); - - template <typename T, int Radix, unsigned MinDigits, int MaxDigits> - std::string - parser_name(int_parser<T, Radix, MinDigits, MaxDigits> const& p); - - template <typename T, typename RealPoliciesT> - std::string - parser_name(real_parser<T, RealPoliciesT> const& p); - -/////////////////////////////////////////////////////////////////////////////// -// from operators.hpp - template <typename A, typename B> - std::string - parser_name(sequence<A, B> const& p); - - template <typename A, typename B> - std::string - parser_name(sequential_or<A, B> const& p); - - template <typename A, typename B> - std::string - parser_name(alternative<A, B> const& p); - - template <typename A, typename B> - std::string - parser_name(intersection<A, B> const& p); - - template <typename A, typename B> - std::string - parser_name(difference<A, B> const& p); - - template <typename A, typename B> - std::string - parser_name(exclusive_or<A, B> const& p); - - template <typename S> - std::string - parser_name(optional<S> const& p); - - template <typename S> - std::string - parser_name(kleene_star<S> const& p); - - template <typename S> - std::string - parser_name(positive<S> const& p); - -/////////////////////////////////////////////////////////////////////////////// -// from parser.hpp - template <typename DerivedT> - std::string - parser_name(parser<DerivedT> const& p); - -/////////////////////////////////////////////////////////////////////////////// -// from primitives.hpp - template <typename DerivedT> - std::string - parser_name(char_parser<DerivedT> const &p); - - template <typename CharT> - std::string - parser_name(chlit<CharT> const &p); - - template <typename CharT> - std::string - parser_name(range<CharT> const &p); - - template <typename IteratorT> - std::string - parser_name(chseq<IteratorT> const &p); - - template <typename IteratorT> - std::string - parser_name(strlit<IteratorT> const &p); - - std::string - parser_name(nothing_parser const &p); - - std::string - parser_name(epsilon_parser const &p); - - std::string - parser_name(anychar_parser const &p); - - std::string - parser_name(alnum_parser const &p); - - std::string - parser_name(alpha_parser const &p); - - std::string - parser_name(cntrl_parser const &p); - - std::string - parser_name(digit_parser const &p); - - std::string - parser_name(graph_parser const &p); - - std::string - parser_name(lower_parser const &p); - - std::string - parser_name(print_parser const &p); - - std::string - parser_name(punct_parser const &p); - - std::string - parser_name(blank_parser const &p); - - std::string - parser_name(space_parser const &p); - - std::string - parser_name(upper_parser const &p); - - std::string - parser_name(xdigit_parser const &p); - - std::string - parser_name(eol_parser const &p); - - std::string - parser_name(end_parser const &p); - -/////////////////////////////////////////////////////////////////////////////// -// from rule.hpp - template<typename T0, typename T1, typename T2> - std::string - parser_name(rule<T0, T1, T2> const& p); - -/////////////////////////////////////////////////////////////////////////////// -// from subrule.hpp - template <typename FirstT, typename RestT> - std::string - parser_name(subrule_list<FirstT, RestT> const &p); - - template <int ID, typename DefT, typename ContextT> - std::string - parser_name(subrule_parser<ID, DefT, ContextT> const &p); - - template <int ID, typename ContextT> - std::string - parser_name(subrule<ID, ContextT> const &p); - -/////////////////////////////////////////////////////////////////////////////// -// from chset.hpp - -/////////////////////////////////////////////////////////////////////////////// -// -// Decide, if a node is to be traced or not -// -/////////////////////////////////////////////////////////////////////////////// - template< - typename DerivedT, typename EmbedT, - typename T0, typename T1, typename T2 - > - bool - trace_parser(impl::rule_base<DerivedT, EmbedT, T0, T1, T2> - const& p); - - template <typename DerivedT, typename ContextT> - bool - trace_parser(grammar<DerivedT, ContextT> const& p); - - template <int ID, typename ContextT> - bool - trace_parser(subrule<ID, ContextT> const& p); - - template <typename ParserT, typename ActorTupleT> - struct init_closure_parser; - - template <typename ParserT, typename ActorTupleT> - bool - trace_parser(init_closure_parser<ParserT, ActorTupleT> const& p); - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -////////////////////////////////// -#include <boost/spirit/home/classic/debug/impl/parser_names.ipp> - -#endif // defined(BOOST_SPIRIT_DEBUG) - -#endif // !defined(BOOST_SPIRIT_PARSER_NAMES_HPP) diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic.hpp deleted file mode 100644 index 41ed74f788..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002 Juan Carlos Arevalo-Baeza - Copyright (c) 2002-2003 Martin Wille - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_DYNAMIC_HPP -#define BOOST_SPIRIT_DYNAMIC_HPP - -#include <boost/spirit/home/classic/version.hpp> - -/////////////////////////////////////////////////////////////////////////////// -// -// Master header for Spirit.Dynamic -// -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/dynamic/if.hpp> -#include <boost/spirit/home/classic/dynamic/for.hpp> -#include <boost/spirit/home/classic/dynamic/while.hpp> -#include <boost/spirit/home/classic/dynamic/lazy.hpp> -#include <boost/spirit/home/classic/dynamic/stored_rule.hpp> -#include <boost/spirit/home/classic/dynamic/rule_alias.hpp> -#include <boost/spirit/home/classic/dynamic/select.hpp> -#include <boost/spirit/home/classic/dynamic/switch.hpp> - -//////////////////////////////////////////////////////////////////////////////// -#endif // BOOST_SPIRIT_DYNAMIC_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/for.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/for.hpp deleted file mode 100644 index 21c4b78969..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/for.hpp +++ /dev/null @@ -1,185 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002-2003 Martin Wille - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_FOR_HPP -#define BOOST_SPIRIT_FOR_HPP -//////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/dynamic/impl/conditions.ipp> - -//////////////////////////////////////////////////////////////////////////////// - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - namespace impl - { - - template <typename FuncT> - struct for_functor - { - typedef typename boost::call_traits<FuncT>::param_type param_t; - - for_functor(param_t f) : func(f) {} - for_functor() {} - FuncT func; - }; - - template <typename InitF> - struct for_init_functor : for_functor<InitF> - { - typedef for_functor<InitF> base_t; - typedef typename base_t::param_t param_t; - - for_init_functor(param_t f) : base_t(f) {} - for_init_functor() : base_t() {} - void init() const { /*return*/ this->func(); } - }; - - template <typename StepF> - struct for_step_functor : for_functor<StepF> - { - typedef for_functor<StepF> base_t; - typedef typename base_t::param_t param_t; - - for_step_functor(param_t f) : base_t(f) {} - for_step_functor() : base_t() {} - void step() const { /*return*/ this->func(); } - }; - - ////////////////////////////////// - // for_parser - template - < - typename InitF, typename CondT, typename StepF, - typename ParsableT - > - struct for_parser - : private for_init_functor<InitF> - , private for_step_functor<StepF> - , private condition_evaluator<typename as_parser<CondT>::type> - , public unary - < - typename as_parser<ParsableT>::type, - parser< for_parser<InitF, CondT, StepF, ParsableT> > - > - { - typedef for_parser<InitF, CondT, StepF, ParsableT> self_t; - typedef as_parser<CondT> cond_as_parser_t; - typedef typename cond_as_parser_t::type condition_t; - typedef condition_evaluator<condition_t> eval_t; - typedef as_parser<ParsableT> as_parser_t; - typedef typename as_parser_t::type parser_t; - typedef unary< parser_t, parser< self_t > > base_t; - - - ////////////////////////////// - // constructor, saves init, condition and step functors - // for later use the parse member function - for_parser - ( - InitF const &i, CondT const &c, StepF const &s, - ParsableT const &p - ) - : for_init_functor<InitF>(i) - , for_step_functor<StepF>(s) - , eval_t(cond_as_parser_t::convert(c)) - , base_t(as_parser_t::convert(p)) - { } - - for_parser() - : for_init_functor<InitF>() - , for_step_functor<StepF>() - , eval_t() - , base_t() - {} - - ////////////////////////////// - // parse member function - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const &scan) const - { - typedef typename parser_result<parser_t, ScannerT>::type - body_result_t; - - typename ScannerT::iterator_t save(scan.first); - - std::size_t length = 0; - std::ptrdiff_t eval_length = 0; - - this->init(); - while ((eval_length = this->evaluate(scan))>=0) - { - length += eval_length; - body_result_t tmp(this->subject().parse(scan)); - if (tmp) - { - length+=tmp.length(); - } - else - { - return scan.no_match(); - } - this->step(); - } - - BOOST_SPIRIT_CLASSIC_NS::nil_t attr; - return scan.create_match - (length, attr, save, scan.first); - } - }; - - ////////////////////////////////// - // for_parser_gen generates takes the body parser in brackets - // and returns the for_parser - template <typename InitF, typename CondT, typename StepF> - struct for_parser_gen - { - for_parser_gen(InitF const &i, CondT const &c, StepF const &s) - : init(i) - , condition(c) - , step(s) - {} - - template <typename ParsableT> - for_parser<InitF, CondT, StepF, ParsableT> - operator[](ParsableT const &p) const - { - return for_parser<InitF, CondT, StepF, ParsableT> - (init, condition, step, p); - } - - InitF const &init; - CondT const &condition; - StepF const &step; - }; - } // namespace impl - - ////////////////////////////// - // for_p, returns for-parser generator - // Usage: spirit::for_p(init-ftor, condition, step-ftor)[body] - template - < - typename InitF, typename ConditionT, typename StepF - > - impl::for_parser_gen<InitF, ConditionT, StepF> - for_p(InitF const &init_f, ConditionT const &condition, StepF const &step_f) - { - return impl::for_parser_gen<InitF, ConditionT, StepF> - (init_f, condition, step_f); - } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_FOR_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/if.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/if.hpp deleted file mode 100644 index 9427a3714d..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/if.hpp +++ /dev/null @@ -1,229 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002 Juan Carlos Arevalo-Baeza - Copyright (c) 2002-2003 Martin Wille - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_IF_HPP -#define BOOST_SPIRIT_IF_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/dynamic/impl/conditions.ipp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - namespace impl { - - ////////////////////////////////// - // if-else-parser, holds two alternative parsers and a conditional functor - // that selects between them. - template <typename ParsableTrueT, typename ParsableFalseT, typename CondT> - struct if_else_parser - : public condition_evaluator<typename as_parser<CondT>::type> - , public binary - < - typename as_parser<ParsableTrueT>::type, - typename as_parser<ParsableFalseT>::type, - parser< if_else_parser<ParsableTrueT, ParsableFalseT, CondT> > - > - { - typedef if_else_parser<ParsableTrueT, ParsableFalseT, CondT> self_t; - - typedef as_parser<ParsableTrueT> as_parser_true_t; - typedef as_parser<ParsableFalseT> as_parser_false_t; - typedef typename as_parser_true_t::type parser_true_t; - typedef typename as_parser_false_t::type parser_false_t; - typedef as_parser<CondT> cond_as_parser_t; - typedef typename cond_as_parser_t::type condition_t; - - typedef binary<parser_true_t, parser_false_t, parser<self_t> > base_t; - typedef condition_evaluator<condition_t> eval_t; - - if_else_parser - ( - ParsableTrueT const& p_true, - ParsableFalseT const& p_false, - CondT const& cond_ - ) - : eval_t(cond_as_parser_t::convert(cond_)) - , base_t - ( - as_parser_true_t::convert(p_true), - as_parser_false_t::convert(p_false) - ) - { } - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, nil_t>::type type; - }; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result - <parser_true_t, ScannerT>::type then_result_t; - typedef typename parser_result - <parser_false_t, ScannerT>::type else_result_t; - - typename ScannerT::iterator_t const save(scan.first); - - std::ptrdiff_t length = this->evaluate(scan); - if (length >= 0) - { - then_result_t then_result(this->left().parse(scan)); - if (then_result) - { - length += then_result.length(); - return scan.create_match(std::size_t(length), nil_t(), save, scan.first); - } - } - else - { - else_result_t else_result(this->right().parse(scan)); - if (else_result) - { - length = else_result.length(); - return scan.create_match(std::size_t(length), nil_t(), save, scan.first); - } - } - return scan.no_match(); - } - }; - - ////////////////////////////////// - // if-else-parser generator, takes the false-parser in brackets - // and returns the if-else-parser. - template <typename ParsableTrueT, typename CondT> - struct if_else_parser_gen - { - if_else_parser_gen(ParsableTrueT const& p_true_, CondT const& cond_) - : p_true(p_true_) - , cond(cond_) {} - - template <typename ParsableFalseT> - if_else_parser - < - ParsableTrueT, - ParsableFalseT, - CondT - > - operator[](ParsableFalseT const& p_false) const - { - return if_else_parser<ParsableTrueT, ParsableFalseT, CondT> - ( - p_true, - p_false, - cond - ); - } - - ParsableTrueT const &p_true; - CondT const &cond; - }; - - ////////////////////////////////// - // if-parser, conditionally runs a parser is a functor condition is true. - // If the condition is false, it fails the parse. - // It can optionally become an if-else-parser through the member else_p. - template <typename ParsableT, typename CondT> - struct if_parser - : public condition_evaluator<typename as_parser<CondT>::type> - , public unary - < - typename as_parser<ParsableT>::type, - parser<if_parser<ParsableT, CondT> > > - { - typedef if_parser<ParsableT, CondT> self_t; - typedef as_parser<ParsableT> as_parser_t; - typedef typename as_parser_t::type parser_t; - - typedef as_parser<CondT> cond_as_parser_t; - typedef typename cond_as_parser_t::type condition_t; - typedef condition_evaluator<condition_t> eval_t; - typedef unary<parser_t, parser<self_t> > base_t; - - if_parser(ParsableT const& p, CondT const& cond_) - : eval_t(cond_as_parser_t::convert(cond_)) - , base_t(as_parser_t::convert(p)) - , else_p(p, cond_) - {} - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, nil_t>::type type; - }; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result<parser_t, ScannerT>::type t_result_t; - typename ScannerT::iterator_t const save(scan.first); - - std::ptrdiff_t length = this->evaluate(scan); - if (length >= 0) - { - t_result_t then_result(this->subject().parse(scan)); - if (then_result) - { - length += then_result.length(); - return scan.create_match(std::size_t(length), nil_t(), save, scan.first); - } - return scan.no_match(); - } - return scan.empty_match(); - } - - if_else_parser_gen<ParsableT, CondT> else_p; - }; - - ////////////////////////////////// - // if-parser generator, takes the true-parser in brackets and returns the - // if-parser. - template <typename CondT> - struct if_parser_gen - { - if_parser_gen(CondT const& cond_) : cond(cond_) {} - - template <typename ParsableT> - if_parser - < - ParsableT, - CondT - > - operator[](ParsableT const& subject) const - { - return if_parser<ParsableT, CondT>(subject, cond); - } - - CondT const &cond; - }; - -} // namespace impl - -////////////////////////////////// -// if_p function, returns "if" parser generator - -template <typename CondT> -impl::if_parser_gen<CondT> -if_p(CondT const& cond) -{ - return impl::if_parser_gen<CondT>(cond); -} - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_IF_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/conditions.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/conditions.ipp deleted file mode 100644 index 3a7b530eb2..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/conditions.ipp +++ /dev/null @@ -1,97 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Martin Wille - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#ifndef BOOST_SPIRIT_CONDITIONS_IPP -#define BOOST_SPIRIT_CONDITIONS_IPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/meta/parser_traits.hpp> -#include <boost/spirit/home/classic/core/composite/epsilon.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - namespace impl { - -/////////////////////////////////////////////////////////////////////////////// -// -// condition evaluation -// -/////////////////////////////////////////////////////////////////////////////// - ////////////////////////////////// - // condition_parser_selector, decides which parser to use for a condition - // If the template argument is a parser then that parser is used. - // If the template argument is a functor then a condition parser using - // the functor is chosen - - template <typename T> struct embed_t_accessor - { - typedef typename T::embed_t type; - }; - - template <typename ConditionT> - struct condition_parser_selector - { - typedef - typename mpl::if_< - is_parser<ConditionT>, - ConditionT, - condition_parser<ConditionT> - >::type - type; - - typedef typename embed_t_accessor<type>::type embed_t; - }; - - ////////////////////////////////// - // condition_evaluator, uses a parser to check wether a condition is met - // takes a parser or a functor that can be evaluated in boolean context - // as template parameter. - - // JDG 4-15-03 refactored - template <typename ConditionT> - struct condition_evaluator - { - typedef condition_parser_selector<ConditionT> selector_t; - typedef typename selector_t::type selected_t; - typedef typename selector_t::embed_t cond_embed_t; - - typedef typename boost::call_traits<cond_embed_t>::param_type - param_t; - - condition_evaluator(param_t s) : cond(s) {} - - ///////////////////////////// - // evaluate, checks wether condition is met - // returns length of a match or a negative number for no-match - template <typename ScannerT> - std::ptrdiff_t - evaluate(ScannerT const &scan) const - { - typedef typename ScannerT::iterator_t iterator_t; - typedef typename parser_result<selected_t, ScannerT>::type cres_t; - iterator_t save(scan.first); - cres_t result = cond.parse(scan); - if (!result) // reset the position if evaluation - scan.first = save; // fails. - return result.length(); - } - - cond_embed_t cond; - }; - -/////////////////////////////////////////////////////////////////////////////// - } // namespace impl - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/select.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/select.ipp deleted file mode 100644 index 724f6fad6e..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/select.ipp +++ /dev/null @@ -1,122 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#ifndef BOOST_SPIRIT_SELECT_IPP -#define BOOST_SPIRIT_SELECT_IPP - -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/meta/as_parser.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -namespace impl { - -/////////////////////////////////////////////////////////////////////////////// -template <typename ParserT> -struct as_embedded_parser : public as_parser<ParserT> -{ - typedef typename as_parser<ParserT>::type::derived_t::embed_t type; -}; - -/////////////////////////////////////////////////////////////////////////////// - -// no implementation here to catch unknown BehaviourT template arguments -template <typename ResultT, typename BehaviourT> -struct select_match_gen; - -// implementation for the select_default_no_fail behaviour -template <typename ResultT> -struct select_match_gen<ResultT, select_default_no_fail> { - - template <typename ScannerT> - static ResultT - do_ (ScannerT const &scan) - { - return scan.create_match(0, -1, scan.first, scan.first); - } -}; - -// implementation for the select_default_fail behaviour -template <typename ResultT> -struct select_match_gen<ResultT, select_default_fail> { - - template <typename ScannerT> - static ResultT - do_ (ScannerT const &scan) - { - return scan.no_match(); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -template <int N, typename ResultT, typename TupleT, typename BehaviourT> -struct parse_tuple_element { - - BOOST_STATIC_CONSTANT(int, index = (TupleT::length - N)); - - template <typename ScannerT> - static ResultT - do_(TupleT const &t, ScannerT const &scan) - { - typedef typename ::phoenix::tuple_element<index, TupleT>::type parser_t; - typedef typename ScannerT::iterator_t iterator_t; - typedef typename parser_result<parser_t, ScannerT>::type result_t; - - iterator_t save(scan.first); - ::phoenix::tuple_index<index> const idx; - result_t result(t[idx].parse(scan)); - - if (result) { - return scan.create_match(result.length(), TupleT::length - N, - save, scan.first); - } - scan.first = save; // reset the input stream - return parse_tuple_element<N-1, ResultT, TupleT, BehaviourT>:: - do_(t, scan); - } -}; - -template <typename ResultT, typename TupleT, typename BehaviourT> -struct parse_tuple_element<1, ResultT, TupleT, BehaviourT> { - - BOOST_STATIC_CONSTANT(int, index = (TupleT::length - 1)); - - template <typename ScannerT> - static ResultT - do_(TupleT const &t, ScannerT const &scan) - { - typedef typename ::phoenix::tuple_element<index, TupleT>::type parser_t; - typedef typename ScannerT::iterator_t iterator_t; - typedef typename parser_result<parser_t, ScannerT>::type result_t; - - iterator_t save(scan.first); - ::phoenix::tuple_index<index> const idx; - result_t result(t[idx].parse(scan)); - - if (result) { - return scan.create_match(result.length(), TupleT::length - 1, - save, scan.first); - } - scan.first = save; // reset the input stream - return select_match_gen<ResultT, BehaviourT>::do_(scan); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -} // namespace impl - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif // BOOST_SPIRIT_SELECT_IPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/switch.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/switch.ipp deleted file mode 100644 index bf5507ad58..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/impl/switch.ipp +++ /dev/null @@ -1,575 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#ifndef BOOST_SPIRIT_SWITCH_IPP -#define BOOST_SPIRIT_SWITCH_IPP - -#include <boost/mpl/if.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/static_assert.hpp> -#include <boost/core/ignore_unused.hpp> - -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/inc.hpp> -#include <boost/preprocessor/repeat.hpp> -#include <boost/preprocessor/repeat_from_to.hpp> - -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/primitives/primitives.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/meta/as_parser.hpp> - -#include <boost/spirit/home/classic/phoenix/actor.hpp> -#include <boost/spirit/home/classic/phoenix/tuples.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -// forward declaration -template <int N, typename ParserT, bool IsDefault> struct case_parser; - -/////////////////////////////////////////////////////////////////////////////// -namespace impl { - -/////////////////////////////////////////////////////////////////////////////// -// parse helper functions -template <typename ParserT, typename ScannerT> -inline typename parser_result<ParserT, ScannerT>::type -delegate_parse(ParserT const &p, ScannerT const &scan, - typename ScannerT::iterator_t const save) -{ - typedef typename parser_result<ParserT, ScannerT>::type result_t; - - result_t result (p.subject().parse(scan)); - if (!result) - scan.first = save; - return result; -} - -/////////////////////////////////////////////////////////////////////////////// -// General default case handling (no default_p case branch given). -// First try to match the current parser node (if the condition value is -// matched) and, if that fails, return a no_match -template <int N, bool IsDefault, bool HasDefault> -struct default_delegate_parse { - - template < - typename ParserT, typename DefaultT, - typename ValueT, typename ScannerT - > - static typename parser_result<ParserT, ScannerT>::type - parse (ValueT const &value, ParserT const &p, DefaultT const &, - ScannerT const &scan, typename ScannerT::iterator_t const save) - { - if (value == N) - return delegate_parse(p, scan, save); - return scan.no_match(); - } -}; - -// The current case parser node is the default parser. -// Ignore the given case value and try to match the given default parser. -template <int N, bool HasDefault> -struct default_delegate_parse<N, true, HasDefault> { - - template < - typename ParserT, typename DefaultT, - typename ValueT, typename ScannerT - > - static typename parser_result<ParserT, ScannerT>::type - parse (ValueT const& /*value*/, ParserT const &, DefaultT const &d, - ScannerT const &scan, typename ScannerT::iterator_t const save) - { - // Since there is a default_p case branch defined, the corresponding - // parser shouldn't be the nothing_parser - BOOST_STATIC_ASSERT((!boost::is_same<DefaultT, nothing_parser>::value)); - return delegate_parse(d, scan, save); - } -}; - -// The current case parser node is not the default parser, but there is a -// default_p branch given inside the switch_p parser. -// First try to match the current parser node (if the condition value is -// matched) and, if that fails, match the given default_p parser. -template <int N> -struct default_delegate_parse<N, false, true> { - - template < - typename ParserT, typename DefaultT, - typename ValueT, typename ScannerT - > - static typename parser_result<ParserT, ScannerT>::type - parse (ValueT const &value, ParserT const &p, DefaultT const &d, - ScannerT const &scan, typename ScannerT::iterator_t const save) - { - // Since there is a default_p case branch defined, the corresponding - // parser shouldn't be the nothing_parser - BOOST_STATIC_ASSERT((!boost::is_same<DefaultT, nothing_parser>::value)); - if (value == N) - return delegate_parse(p, scan, save); - - return delegate_parse(d, scan, save); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// Look through the case parser chain to test, if there is a default case -// branch defined (returned by 'value'). -template <typename CaseT, bool IsSimple = CaseT::is_simple> -struct default_case; - -//////////////////////////////////////// -template <typename ResultT, bool IsDefault> -struct get_default_parser { - - template <typename ParserT> - static ResultT - get(parser<ParserT> const &p) - { - return default_case<typename ParserT::derived_t::left_t>:: - get(p.derived().left()); - } -}; - -template <typename ResultT> -struct get_default_parser<ResultT, true> { - - template <typename ParserT> - static ResultT - get(parser<ParserT> const &p) { return p.derived().right(); } -}; - -//////////////////////////////////////// -template <typename CaseT, bool IsSimple> -struct default_case { - - // The 'value' constant is true, if the current case_parser or one of its - // left siblings is a default_p generated case_parser. - BOOST_STATIC_CONSTANT(bool, value = - (CaseT::is_default || default_case<typename CaseT::left_t>::value)); - - // The 'is_epsilon' constant is true, if the current case_parser or one of - // its left siblings is a default_p generated parser with an attached - // epsilon_p (this is generated by the plain default_p). - BOOST_STATIC_CONSTANT(bool, is_epsilon = ( - (CaseT::is_default && CaseT::is_epsilon) || - default_case<typename CaseT::left_t>::is_epsilon - )); - - // The computed 'type' represents the type of the default case branch - // parser (if there is one) or nothing_parser (if there isn't any default - // case branch). - typedef typename boost::mpl::if_c< - CaseT::is_default, typename CaseT::right_embed_t, - typename default_case<typename CaseT::left_t>::type - >::type type; - - // The get function returns the parser attached to the default case branch - // (if there is one) or an instance of a nothing_parser (if there isn't - // any default case branch). - template <typename ParserT> - static type - get(parser<ParserT> const &p) - { return get_default_parser<type, CaseT::is_default>::get(p); } -}; - -//////////////////////////////////////// -template <typename ResultT, bool IsDefault> -struct get_default_parser_simple { - - template <typename ParserT> - static ResultT - get(parser<ParserT> const &p) { return p.derived(); } -}; - -template <typename ResultT> -struct get_default_parser_simple<ResultT, false> { - - template <typename ParserT> - static nothing_parser - get(parser<ParserT> const &) { return nothing_p; } -}; - -//////////////////////////////////////// -// Specialization of the default_case template for the last (leftmost) element -// of the case parser chain. -template <typename CaseT> -struct default_case<CaseT, true> { - - // The 'value' and 'is_epsilon' constant, the 'type' type and the function - // 'get' are described above. - - BOOST_STATIC_CONSTANT(bool, value = CaseT::is_default); - BOOST_STATIC_CONSTANT(bool, is_epsilon = ( - CaseT::is_default && CaseT::is_epsilon - )); - - typedef typename boost::mpl::if_c< - CaseT::is_default, CaseT, nothing_parser - >::type type; - - template <typename ParserT> - static type - get(parser<ParserT> const &p) - { return get_default_parser_simple<type, value>::get(p); } -}; - -/////////////////////////////////////////////////////////////////////////////// -// The case_chain template calculates recursively the depth of the left -// subchain of the given case branch node. -template <typename CaseT, bool IsSimple = CaseT::is_simple> -struct case_chain { - - BOOST_STATIC_CONSTANT(int, depth = ( - case_chain<typename CaseT::left_t>::depth + 1 - )); -}; - -template <typename CaseT> -struct case_chain<CaseT, true> { - - BOOST_STATIC_CONSTANT(int, depth = 0); -}; - -/////////////////////////////////////////////////////////////////////////////// -// The chain_parser template is used to extract the type and the instance of -// a left or a right parser, buried arbitrary deep inside the case parser -// chain. -template <int Depth, typename CaseT> -struct chain_parser { - - typedef typename CaseT::left_t our_left_t; - - typedef typename chain_parser<Depth-1, our_left_t>::left_t left_t; - typedef typename chain_parser<Depth-1, our_left_t>::right_t right_t; - - static left_t - left(CaseT const &p) - { return chain_parser<Depth-1, our_left_t>::left(p.left()); } - - static right_t - right(CaseT const &p) - { return chain_parser<Depth-1, our_left_t>::right(p.left()); } -}; - -template <typename CaseT> -struct chain_parser<1, CaseT> { - - typedef typename CaseT::left_t left_t; - typedef typename CaseT::right_t right_t; - - static left_t left(CaseT const &p) { return p.left(); } - static right_t right(CaseT const &p) { return p.right(); } -}; - -template <typename CaseT> -struct chain_parser<0, CaseT>; // shouldn't be instantiated - -/////////////////////////////////////////////////////////////////////////////// -// Type computing meta function for calculating the type of the return value -// of the used conditional switch expression -template <typename TargetT, typename ScannerT> -struct condition_result { - - typedef typename TargetT::template result<ScannerT>::type type; -}; - -/////////////////////////////////////////////////////////////////////////////// -template <typename LeftT, typename RightT, bool IsDefault> -struct compound_case_parser -: public binary<LeftT, RightT, - parser<compound_case_parser<LeftT, RightT, IsDefault> > > -{ - typedef compound_case_parser<LeftT, RightT, IsDefault> self_t; - typedef binary_parser_category parser_category_t; - typedef binary<LeftT, RightT, parser<self_t> > base_t; - - BOOST_STATIC_CONSTANT(int, value = RightT::value); - BOOST_STATIC_CONSTANT(bool, is_default = IsDefault); - BOOST_STATIC_CONSTANT(bool, is_simple = false); - BOOST_STATIC_CONSTANT(bool, is_epsilon = ( - is_default && - boost::is_same<typename RightT::subject_t, epsilon_parser>::value - )); - - compound_case_parser(parser<LeftT> const &lhs, parser<RightT> const &rhs) - : base_t(lhs.derived(), rhs.derived()) - {} - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, nil_t>::type type; - }; - - template <typename ScannerT, typename CondT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan, CondT const &cond) const; - - template <int N1, typename ParserT1, bool IsDefault1> - compound_case_parser< - self_t, case_parser<N1, ParserT1, IsDefault1>, IsDefault1 - > - operator, (case_parser<N1, ParserT1, IsDefault1> const &p) const - { - // If the following compile time assertion fires, you've probably used - // more than one default_p case inside the switch_p parser construct. - BOOST_STATIC_ASSERT(!default_case<self_t>::value || !IsDefault1); - - // If this compile time assertion fires, you've probably want to use - // more case_p/default_p case branches, than possible. - BOOST_STATIC_ASSERT( - case_chain<self_t>::depth < BOOST_SPIRIT_SWITCH_CASE_LIMIT - ); - - typedef case_parser<N1, ParserT1, IsDefault1> rhs_t; - return compound_case_parser<self_t, rhs_t, IsDefault1>(*this, p); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// The parse_switch::do_ functions dispatch to the correct parser, which is -// selected through the given conditional switch value. -template <int Value, int Depth, bool IsDefault> -struct parse_switch; - -/////////////////////////////////////////////////////////////////////////////// -// -// The following generates a couple of parse_switch template specializations -// with an increasing number of handled case branches (for 1..N). -// -// template <int Value, bool IsDefault> -// struct parse_switch<Value, N, IsDefault> { -// -// template <typename ParserT, typename ScannerT> -// static typename parser_result<ParserT, ScannerT>::type -// do_(ParserT const &p, ScannerT const &scan, long cond_value, -// typename ScannerT::iterator_t const &save) -// { -// typedef ParserT left_t0; -// typedef typename left_t0::left left_t1; -// ... -// -// switch (cond_value) { -// case left_tN::value: -// return delegate_parse(chain_parser< -// case_chain<ParserT>::depth, ParserT -// >::left(p), scan, save); -// ... -// case left_t1::value: -// return delegate_parse(chain_parser< -// 1, left_t1 -// >::right(p.left()), scan, save); -// -// case left_t0::value: -// default: -// typedef default_case<ParserT> default_t; -// typedef default_delegate_parse< -// Value, IsDefault, default_t::value> -// default_parse_t; -// -// return default_parse_t::parse(cond_value, p.right(), -// default_t::get(p), scan, save); -// } -// } -// }; -// -/////////////////////////////////////////////////////////////////////////////// -#define BOOST_SPIRIT_PARSE_SWITCH_TYPEDEFS(z, N, _) \ - typedef typename BOOST_PP_CAT(left_t, N)::left_t \ - BOOST_PP_CAT(left_t, BOOST_PP_INC(N)); \ - /**/ - -#define BOOST_SPIRIT_PARSE_SWITCH_CASES(z, N, _) \ - case (long)(BOOST_PP_CAT(left_t, N)::value): \ - return delegate_parse(chain_parser<N, left_t1>::right(p.left()), \ - scan, save); \ - /**/ - -#define BOOST_SPIRIT_PARSE_SWITCHES(z, N, _) \ - template <int Value, bool IsDefault> \ - struct parse_switch<Value, BOOST_PP_INC(N), IsDefault> { \ - \ - template <typename ParserT, typename ScannerT> \ - static typename parser_result<ParserT, ScannerT>::type \ - do_(ParserT const &p, ScannerT const &scan, long cond_value, \ - typename ScannerT::iterator_t const &save) \ - { \ - typedef ParserT left_t0; \ - BOOST_PP_REPEAT_FROM_TO_ ## z(0, BOOST_PP_INC(N), \ - BOOST_SPIRIT_PARSE_SWITCH_TYPEDEFS, _) \ - \ - switch (cond_value) { \ - case (long)(BOOST_PP_CAT(left_t, BOOST_PP_INC(N))::value): \ - return delegate_parse( \ - chain_parser< \ - case_chain<ParserT>::depth, ParserT \ - >::left(p), scan, save); \ - \ - BOOST_PP_REPEAT_FROM_TO_ ## z(1, BOOST_PP_INC(N), \ - BOOST_SPIRIT_PARSE_SWITCH_CASES, _) \ - \ - case (long)(left_t0::value): \ - default: \ - typedef default_case<ParserT> default_t; \ - typedef \ - default_delegate_parse<Value, IsDefault, default_t::value> \ - default_parse_t; \ - \ - return default_parse_t::parse(cond_value, p.right(), \ - default_t::get(p), scan, save); \ - } \ - } \ - }; \ - /**/ - -BOOST_PP_REPEAT(BOOST_PP_DEC(BOOST_SPIRIT_SWITCH_CASE_LIMIT), - BOOST_SPIRIT_PARSE_SWITCHES, _) - -#undef BOOST_SPIRIT_PARSE_SWITCH_TYPEDEFS -#undef BOOST_SPIRIT_PARSE_SWITCH_CASES -#undef BOOST_SPIRIT_PARSE_SWITCHES -/////////////////////////////////////////////////////////////////////////////// - -template <typename LeftT, typename RightT, bool IsDefault> -template <typename ScannerT, typename CondT> -inline typename parser_result< - compound_case_parser<LeftT, RightT, IsDefault>, ScannerT ->::type -compound_case_parser<LeftT, RightT, IsDefault>:: - parse(ScannerT const& scan, CondT const &cond) const -{ - ignore_unused(scan.at_end()); // allow skipper to take effect - return parse_switch<value, case_chain<self_t>::depth, is_default>:: - do_(*this, scan, cond(scan), scan.first); -} - -/////////////////////////////////////////////////////////////////////////////// -// The switch condition is to be evaluated from a parser result value. -template <typename ParserT> -struct cond_functor { - - typedef cond_functor<ParserT> self_t; - - cond_functor(ParserT const &p_) - : p(p_) - {} - - template <typename ScannerT> - struct result - { - typedef typename parser_result<ParserT, ScannerT>::type::attr_t type; - }; - - template <typename ScannerT> - typename condition_result<self_t, ScannerT>::type - operator()(ScannerT const &scan) const - { - typedef typename parser_result<ParserT, ScannerT>::type result_t; - typedef typename result_t::attr_t attr_t; - - result_t result(p.parse(scan)); - return !result ? attr_t() : result.value(); - } - - typename ParserT::embed_t p; -}; - -template <typename ParserT> -struct make_cond_functor { - - typedef as_parser<ParserT> as_parser_t; - - static cond_functor<typename as_parser_t::type> - do_(ParserT const &cond) - { - return cond_functor<typename as_parser_t::type>( - as_parser_t::convert(cond)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// The switch condition is to be evaluated from a phoenix actor -template <typename ActorT> -struct cond_actor { - - typedef cond_actor<ActorT> self_t; - - cond_actor(ActorT const &actor_) - : actor(actor_) - {} - - template <typename ScannerT> - struct result - { - typedef typename ::phoenix::actor_result<ActorT, ::phoenix::tuple<> >::type - type; - }; - - template <typename ScannerT> - typename condition_result<self_t, ScannerT>::type - operator()(ScannerT const& /*scan*/) const - { - return actor(); - } - - ActorT const &actor; -}; - -template <typename ActorT> -struct make_cond_functor< ::phoenix::actor<ActorT> > { - - static cond_actor< ::phoenix::actor<ActorT> > - do_(::phoenix::actor<ActorT> const &actor) - { - return cond_actor< ::phoenix::actor<ActorT> >(actor); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// The switch condition is to be taken directly from the input stream -struct get_next_token_cond { - - typedef get_next_token_cond self_t; - - template <typename ScannerT> - struct result - { - typedef typename ScannerT::value_t type; - }; - - template <typename ScannerT> - typename condition_result<self_t, ScannerT>::type - operator()(ScannerT const &scan) const - { - typename ScannerT::value_t val(*scan); - ++scan.first; - return val; - } -}; - -template <> -struct make_cond_functor<get_next_token_cond> { - - static get_next_token_cond - do_(get_next_token_cond const &cond) - { - return cond; - } -}; - -/////////////////////////////////////////////////////////////////////////////// -} // namespace impl - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif // BOOST_SPIRIT_SWITCH_IPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/lazy.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/lazy.hpp deleted file mode 100644 index 5bc9df3af9..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/lazy.hpp +++ /dev/null @@ -1,66 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Joel de Guzman - Copyright (c) 2003 Vaclav Vesely - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_LAZY_HPP -#define BOOST_SPIRIT_LAZY_HPP - -//////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/phoenix/actor.hpp> - -//////////////////////////////////////////////////////////////////////////////// - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - //////////////////////////////////////////////////////////////////////////// - // - // lazy_parser, holds phoenix actor which returns a spirit parser. - // - //////////////////////////////////////////////////////////////////////////// - - template<class ActorT> - struct lazy_parser : parser<lazy_parser<ActorT> > - { - typedef lazy_parser<ActorT> self_t; - typedef typename ::phoenix::actor_result< - ActorT, ::phoenix::tuple<> >::plain_type actor_result_t; - - template<typename ScannerT> - struct result - { - typedef typename - parser_result<actor_result_t, ScannerT>::type - type; - }; - - lazy_parser(ActorT const& actor_) - : actor(actor_) {} - - template<typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { return actor().parse(scan); } - - ActorT actor; - }; - - ////////////////////////////// - // lazy_p, returns lazy_parser - // Usage: lazy_p(actor) - template<class ActorT> - lazy_parser<ActorT> lazy_p(ActorT const& actor) - { return lazy_parser<ActorT>(actor); } - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_LAZY_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/rule_alias.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/rule_alias.hpp deleted file mode 100644 index de291c916d..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/rule_alias.hpp +++ /dev/null @@ -1,76 +0,0 @@ -/*============================================================================= - Copyright (c) 1998-2003 Joel de Guzman - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_RULE_ALIAS_HPP) -#define BOOST_SPIRIT_RULE_ALIAS_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // - // rule_alias class - // - /////////////////////////////////////////////////////////////////////////// - template <typename ParserT> - class rule_alias : - public parser<rule_alias<ParserT> > - { - public: - - typedef rule_alias<ParserT> self_t; - - template <typename ScannerT> - struct result - { - typedef typename parser_result<ParserT, ScannerT>::type type; - }; - - rule_alias() - : ptr(0) {} - - rule_alias(ParserT const& p) - : ptr(&p) {} - - rule_alias& - operator=(ParserT const& p) - { - ptr = &p; - return *this; - } - - template <typename ScannerT> - typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const& scan) const - { - if (ptr) - return ptr->parse(scan); - else - return scan.no_match(); - } - - ParserT const& - get() const - { - BOOST_ASSERT(ptr != 0); - return *ptr; - } - - private: - - ParserT const* ptr; // hold it by pointer - }; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/select.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/select.hpp deleted file mode 100644 index 865b27c5e9..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/select.hpp +++ /dev/null @@ -1,245 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_SELECT_HPP -#define BOOST_SPIRIT_SELECT_HPP - -#include <boost/preprocessor/repeat.hpp> -#include <boost/preprocessor/enum.hpp> -#include <boost/preprocessor/enum_params.hpp> -#include <boost/preprocessor/enum_params_with_defaults.hpp> -#include <boost/preprocessor/inc.hpp> -#include <boost/preprocessor/cat.hpp> -#include <boost/preprocessor/facilities/intercept.hpp> - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> - -#include <boost/spirit/home/classic/phoenix/tuples.hpp> - -/////////////////////////////////////////////////////////////////////////////// -// -// Spirit predefined maximum number of possible embedded select_p parsers. -// It should NOT be greater than PHOENIX_LIMIT! -// -/////////////////////////////////////////////////////////////////////////////// -#if !defined(BOOST_SPIRIT_SELECT_LIMIT) -#define BOOST_SPIRIT_SELECT_LIMIT PHOENIX_LIMIT -#endif // !defined(BOOST_SPIRIT_SELECT_LIMIT) - -/////////////////////////////////////////////////////////////////////////////// -// -// ensure BOOST_SPIRIT_SELECT_LIMIT <= PHOENIX_LIMIT and -// BOOST_SPIRIT_SELECT_LIMIT > 0 -// BOOST_SPIRIT_SELECT_LIMIT <= 15 -// -// [Pushed this down a little to make CW happy with BOOST_STATIC_ASSERT] -// [Otherwise, it complains: 'boost_static_assert_test_42' redefined] -// -/////////////////////////////////////////////////////////////////////////////// -BOOST_STATIC_ASSERT(BOOST_SPIRIT_SELECT_LIMIT <= PHOENIX_LIMIT); -BOOST_STATIC_ASSERT(BOOST_SPIRIT_SELECT_LIMIT > 0); -BOOST_STATIC_ASSERT(BOOST_SPIRIT_SELECT_LIMIT <= 15); - -/////////////////////////////////////////////////////////////////////////////// -// -// Calculate the required amount of tuple members rounded up to the nearest -// integer dividable by 3 -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_SPIRIT_SELECT_LIMIT > 12 -#define BOOST_SPIRIT_SELECT_LIMIT_A 15 -#elif BOOST_SPIRIT_SELECT_LIMIT > 9 -#define BOOST_SPIRIT_SELECT_LIMIT_A 12 -#elif BOOST_SPIRIT_SELECT_LIMIT > 6 -#define BOOST_SPIRIT_SELECT_LIMIT_A 9 -#elif BOOST_SPIRIT_SELECT_LIMIT > 3 -#define BOOST_SPIRIT_SELECT_LIMIT_A 6 -#else -#define BOOST_SPIRIT_SELECT_LIMIT_A 3 -#endif - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// The select_default_no_fail and select_default_fail structs are used to -// distinguish two different behaviours for the select_parser in case that not -// any of the given sub-parsers match. -// -// If the select_parser is used with the select_default_no_fail behaviour, -// then in case of no matching sub-parser the whole select_parser returns an -// empty match and the value -1. -// -// If the select_parser is used with the select_default_fail behaviour, then -// in case of no matching sub-parser the whole select_parser fails to match at -// all. -// -/////////////////////////////////////////////////////////////////////////////// -struct select_default_no_fail {}; -struct select_default_fail {}; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/dynamic/impl/select.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -template <typename TupleT, typename BehaviourT, typename T> -struct select_parser -: public parser<select_parser<TupleT, BehaviourT, T> > -{ - typedef select_parser<TupleT, BehaviourT, T> self_t; - - select_parser(TupleT const &t_) - : t(t_) - {} - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, T>::type type; - }; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result<self_t, ScannerT>::type result_t; - - if (!scan.at_end()) { - return impl::parse_tuple_element< - TupleT::length, result_t, TupleT, BehaviourT>::do_(t, scan); - } - return impl::select_match_gen<result_t, BehaviourT>::do_(scan); - } - - TupleT const t; -}; - -/////////////////////////////////////////////////////////////////////////////// -template <typename BehaviourT, typename T = int> -struct select_parser_gen { - - /////////////////////////////////////////////////////////////////////////// - // - // This generates different select_parser_gen::operator()() functions with - // an increasing number of parser parameters: - // - // template <typename ParserT0, ...> - // select_parser< - // ::phoenix::tuple< - // typename impl::as_embedded_parser<ParserT0>::type, - // ... - // >, - // BehaviourT, - // T - // > - // operator()(ParserT0 const &p0, ...) const - // { - // typedef impl::as_embedded_parser<ParserT0> parser_t0; - // ... - // - // typedef ::phoenix::tuple< - // parser_t0::type, - // ... - // > tuple_t; - // typedef select_parser<tuple_t, BehaviourT, T> result_t; - // - // return result_t(tuple_t( - // parser_t0::convert(p0), - // ... - // )); - // } - // - // The number of generated functions depends on the maximum tuple member - // limit defined by the PHOENIX_LIMIT pp constant. - // - /////////////////////////////////////////////////////////////////////////// - #define BOOST_SPIRIT_SELECT_EMBEDDED(z, N, _) \ - typename impl::as_embedded_parser<BOOST_PP_CAT(ParserT, N)>::type \ - /**/ - #define BOOST_SPIRIT_SELECT_EMBEDDED_TYPEDEF(z, N, _) \ - typedef impl::as_embedded_parser<BOOST_PP_CAT(ParserT, N)> \ - BOOST_PP_CAT(parser_t, N); \ - /**/ - #define BOOST_SPIRIT_SELECT_CONVERT(z, N, _) \ - BOOST_PP_CAT(parser_t, N)::convert(BOOST_PP_CAT(p, N)) \ - /**/ - - #define BOOST_SPIRIT_SELECT_PARSER(z, N, _) \ - template < \ - BOOST_PP_ENUM_PARAMS_Z(z, BOOST_PP_INC(N), typename ParserT) \ - > \ - select_parser< \ - ::phoenix::tuple< \ - BOOST_PP_ENUM_ ## z(BOOST_PP_INC(N), \ - BOOST_SPIRIT_SELECT_EMBEDDED, _) \ - >, \ - BehaviourT, \ - T \ - > \ - operator()( \ - BOOST_PP_ENUM_BINARY_PARAMS_Z(z, BOOST_PP_INC(N), \ - ParserT, const &p) \ - ) const \ - { \ - BOOST_PP_REPEAT_ ## z(BOOST_PP_INC(N), \ - BOOST_SPIRIT_SELECT_EMBEDDED_TYPEDEF, _) \ - \ - typedef ::phoenix::tuple< \ - BOOST_PP_ENUM_BINARY_PARAMS_Z(z, BOOST_PP_INC(N), \ - typename parser_t, ::type BOOST_PP_INTERCEPT) \ - > tuple_t; \ - typedef select_parser<tuple_t, BehaviourT, T> result_t; \ - \ - return result_t(tuple_t( \ - BOOST_PP_ENUM_ ## z(BOOST_PP_INC(N), \ - BOOST_SPIRIT_SELECT_CONVERT, _) \ - )); \ - } \ - /**/ - - BOOST_PP_REPEAT(BOOST_SPIRIT_SELECT_LIMIT_A, - BOOST_SPIRIT_SELECT_PARSER, _) - - #undef BOOST_SPIRIT_SELECT_PARSER - #undef BOOST_SPIRIT_SELECT_CONVERT - #undef BOOST_SPIRIT_SELECT_EMBEDDED_TYPEDEF - #undef BOOST_SPIRIT_SELECT_EMBEDDED - /////////////////////////////////////////////////////////////////////////// -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Predefined parser generator helper objects -// -/////////////////////////////////////////////////////////////////////////////// -select_parser_gen<select_default_no_fail> const select_p = - select_parser_gen<select_default_no_fail>(); - -select_parser_gen<select_default_fail> const select_fail_p = - select_parser_gen<select_default_fail>(); - -#undef BOOST_SPIRIT_SELECT_LIMIT_A - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_SELECT_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/stored_rule.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/stored_rule.hpp deleted file mode 100644 index 5248ba18fa..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/stored_rule.hpp +++ /dev/null @@ -1,121 +0,0 @@ -/*============================================================================= - Copyright (c) 1998-2003 Joel de Guzman - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_STORED_RULE_HPP) -#define BOOST_SPIRIT_STORED_RULE_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/non_terminal/impl/rule.ipp> -#include <boost/spirit/home/classic/dynamic/rule_alias.hpp> -#include <boost/shared_ptr.hpp> - -#include <boost/spirit/home/classic/dynamic/stored_rule_fwd.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - /////////////////////////////////////////////////////////////////////////// - // - // stored_rule class - // - /////////////////////////////////////////////////////////////////////////// - template < - typename T0 - , typename T1 - , typename T2 - , bool EmbedByValue - > - class stored_rule - : public impl::rule_base< - stored_rule<T0, T1, T2, EmbedByValue> - , typename mpl::if_c< - EmbedByValue - , stored_rule<T0, T1, T2, true> - , stored_rule<T0, T1, T2> const&>::type - , T0, T1, T2> - { - public: - - typedef stored_rule<T0, T1, T2, EmbedByValue> self_t; - typedef impl::rule_base< - self_t - , typename mpl::if_c< - EmbedByValue - , stored_rule<T0, T1, T2, true> - , self_t const&>::type - , T0, T1, T2> - base_t; - - typedef typename base_t::scanner_t scanner_t; - typedef typename base_t::attr_t attr_t; - typedef impl::abstract_parser<scanner_t, attr_t> abstract_parser_t; - typedef rule_alias<self_t> alias_t; - - stored_rule() : ptr() {} - ~stored_rule() {} - - stored_rule(stored_rule const& r) - : ptr(r.ptr) {} - - template <typename ParserT> - stored_rule(ParserT const& p) - : ptr(new impl::concrete_parser<ParserT, scanner_t, attr_t>(p)) {} - - template <typename ParserT> - stored_rule& operator=(ParserT const& p) - { - ptr.reset(new impl::concrete_parser<ParserT, scanner_t, attr_t>(p)); - return *this; - } - - stored_rule& operator=(stored_rule const& r) - { - // If this is placed above the templatized assignment - // operator, VC6 incorrectly complains ambiguity with - // r1 = r2, where r1 and r2 are both rules. - ptr = r.ptr; - return *this; - } - - stored_rule<T0, T1, T2, true> - copy() const - { - return stored_rule<T0, T1, T2, true>(ptr); - } - - alias_t - alias() const - { - return alias_t(*this); - } - - private: - - friend class impl::rule_base_access; - friend class stored_rule<T0, T1, T2, !EmbedByValue>; - - abstract_parser_t* - get() const - { - return ptr.get(); - } - - stored_rule(shared_ptr<abstract_parser_t> const& ptr) - : ptr(ptr) {} - - shared_ptr<abstract_parser_t> ptr; - }; - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/stored_rule_fwd.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/stored_rule_fwd.hpp deleted file mode 100644 index 655bd838a9..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/stored_rule_fwd.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Tobias Schwinger - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_STORED_RULE_FWD_HPP) -#define BOOST_SPIRIT_STORED_RULE_FWD_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/nil.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - template < - typename T0 = nil_t - , typename T1 = nil_t - , typename T2 = nil_t - , bool EmbedByValue = false - > - class stored_rule; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/switch.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/switch.hpp deleted file mode 100644 index 44b9a72ff0..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/switch.hpp +++ /dev/null @@ -1,259 +0,0 @@ -/*============================================================================= - Copyright (c) 2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_SWITCH_HPP -#define BOOST_SPIRIT_SWITCH_HPP - -/////////////////////////////////////////////////////////////////////////////// -// -// The default_p parser generator template uses the following magic number -// as the corresponding case label value inside the generated switch() -// statements. If this number conflicts with your code, please pick a -// different one. -// -/////////////////////////////////////////////////////////////////////////////// -#if !defined(BOOST_SPIRIT_DEFAULTCASE_MAGIC) -#define BOOST_SPIRIT_DEFAULTCASE_MAGIC 0x15F97A7 -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Spirit predefined maximum number of possible case_p/default_p case branch -// parsers. -// -/////////////////////////////////////////////////////////////////////////////// -#if !defined(BOOST_SPIRIT_SWITCH_CASE_LIMIT) -#define BOOST_SPIRIT_SWITCH_CASE_LIMIT 3 -#endif // !defined(BOOST_SPIRIT_SWITCH_CASE_LIMIT) - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/static_assert.hpp> - -/////////////////////////////////////////////////////////////////////////////// -// -// Ensure BOOST_SPIRIT_SELECT_LIMIT > 0 -// -/////////////////////////////////////////////////////////////////////////////// -BOOST_STATIC_ASSERT(BOOST_SPIRIT_SWITCH_CASE_LIMIT > 0); - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/config.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/epsilon.hpp> -#include <boost/spirit/home/classic/dynamic/impl/switch.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// The switch_parser allows to build switch like parsing constructs, which -// will have much better performance as comparable straight solutions. -// -// Input stream driven syntax: -// -// switch_p -// [ -// case_p<'a'> -// (...parser to use, if the next character is 'a'...), -// case_p<'b'> -// (...parser to use, if the next character is 'b'...), -// default_p -// (...parser to use, if nothing was matched before...) -// ] -// -// General syntax: -// -// switch_p(...lazy expression returning the switch condition value...) -// [ -// case_p<1> -// (...parser to use, if the switch condition value is 1...), -// case_p<2> -// (...parser to use, if the switch condition value is 2...), -// default_p -// (...parser to use, if nothing was matched before...) -// ] -// -// The maximum number of possible case_p branches is defined by the p constant -// BOOST_SPIRIT_SWITCH_CASE_LIMIT (this value defaults to 3 if not otherwise -// defined). -// -/////////////////////////////////////////////////////////////////////////////// -template <typename CaseT, typename CondT = impl::get_next_token_cond> -struct switch_parser -: public unary<CaseT, parser<switch_parser<CaseT, CondT> > > -{ - typedef switch_parser<CaseT, CondT> self_t; - typedef unary_parser_category parser_category_t; - typedef unary<CaseT, parser<self_t> > base_t; - - switch_parser(CaseT const &case_) - : base_t(case_), cond(CondT()) - {} - - switch_parser(CaseT const &case_, CondT const &cond_) - : base_t(case_), cond(cond_) - {} - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, nil_t>::type type; - }; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - return this->subject().parse(scan, - impl::make_cond_functor<CondT>::do_(cond)); - } - - CondT cond; -}; - -/////////////////////////////////////////////////////////////////////////////// -template <typename CondT> -struct switch_cond_parser -{ - switch_cond_parser(CondT const &cond_) - : cond(cond_) - {} - - template <typename ParserT> - switch_parser<ParserT, CondT> - operator[](parser<ParserT> const &p) const - { - return switch_parser<ParserT, CondT>(p.derived(), cond); - } - - CondT const &cond; -}; - -/////////////////////////////////////////////////////////////////////////////// -template <int N, typename ParserT, bool IsDefault> -struct case_parser -: public unary<ParserT, parser<case_parser<N, ParserT, IsDefault> > > -{ - typedef case_parser<N, ParserT, IsDefault> self_t; - typedef unary_parser_category parser_category_t; - typedef unary<ParserT, parser<self_t> > base_t; - - typedef typename base_t::subject_t self_subject_t; - - BOOST_STATIC_CONSTANT(int, value = N); - BOOST_STATIC_CONSTANT(bool, is_default = IsDefault); - BOOST_STATIC_CONSTANT(bool, is_simple = true); - BOOST_STATIC_CONSTANT(bool, is_epsilon = ( - is_default && boost::is_same<self_subject_t, epsilon_parser>::value - )); - - case_parser(parser<ParserT> const &p) - : base_t(p.derived()) - {} - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, nil_t>::type type; - }; - - template <typename ScannerT, typename CondT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan, CondT const &cond) const - { - typedef impl::default_case<self_t> default_t; - - if (!scan.at_end()) { - typedef impl::default_delegate_parse< - value, is_default, default_t::value> default_parse_t; - - typename ScannerT::iterator_t const save(scan.first); - return default_parse_t::parse(cond(scan), *this, - *this, scan, save); - } - - return default_t::is_epsilon ? scan.empty_match() : scan.no_match(); - } - - template <int N1, typename ParserT1, bool IsDefault1> - impl::compound_case_parser< - self_t, case_parser<N1, ParserT1, IsDefault1>, IsDefault1 - > - operator, (case_parser<N1, ParserT1, IsDefault1> const &p) const - { - // If the following compile time assertion fires, you've probably used - // more than one default_p case inside the switch_p parser construct. - BOOST_STATIC_ASSERT(!is_default || !IsDefault1); - - typedef case_parser<N1, ParserT1, IsDefault1> right_t; - return impl::compound_case_parser<self_t, right_t, IsDefault1>(*this, p); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -struct switch_parser_gen { - -// This generates a switch parser, which is driven by the condition value -// returned by the lazy parameter expression 'cond'. This may be a parser, -// which result is used or a phoenix actor, which will be dereferenced to -// obtain the switch condition value. - template <typename CondT> - switch_cond_parser<CondT> - operator()(CondT const &cond) const - { - return switch_cond_parser<CondT>(cond); - } - -// This generates a switch parser, which is driven by the next character/token -// found in the input stream. - template <typename CaseT> - switch_parser<CaseT> - operator[](parser<CaseT> const &p) const - { - return switch_parser<CaseT>(p.derived()); - } -}; - -switch_parser_gen const switch_p = switch_parser_gen(); - -/////////////////////////////////////////////////////////////////////////////// -template <int N, typename ParserT> -inline case_parser<N, ParserT, false> -case_p(parser<ParserT> const &p) -{ - return case_parser<N, ParserT, false>(p); -} - -/////////////////////////////////////////////////////////////////////////////// -struct default_parser_gen -: public case_parser<BOOST_SPIRIT_DEFAULTCASE_MAGIC, epsilon_parser, true> -{ - default_parser_gen() - : case_parser<BOOST_SPIRIT_DEFAULTCASE_MAGIC, epsilon_parser, true> - (epsilon_p) - {} - - template <typename ParserT> - case_parser<BOOST_SPIRIT_DEFAULTCASE_MAGIC, ParserT, true> - operator()(parser<ParserT> const &p) const - { - return case_parser<BOOST_SPIRIT_DEFAULTCASE_MAGIC, ParserT, true>(p); - } -}; - -default_parser_gen const default_p = default_parser_gen(); - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_SWITCH_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/while.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/while.hpp deleted file mode 100644 index d0eae118ae..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/dynamic/while.hpp +++ /dev/null @@ -1,189 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002-2003 Martin Wille - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_WHILE_HPP -#define BOOST_SPIRIT_WHILE_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/dynamic/impl/conditions.ipp> - -//////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - namespace impl { - - ////////////////////////////////// - // while parser - // object are created by while_parser_gen and do_parser_gen - template <typename ParsableT, typename CondT, bool is_do_parser> - struct while_parser - : public condition_evaluator< typename as_parser<CondT>::type > - , public unary // the parent stores a copy of the body parser - < - typename as_parser<ParsableT>::type, - parser<while_parser<ParsableT, CondT, is_do_parser> > - > - { - typedef while_parser<ParsableT, CondT, is_do_parser> self_t; - - typedef as_parser<ParsableT> as_parser_t; - typedef typename as_parser_t::type parser_t; - typedef as_parser<CondT> cond_as_parser_t; - typedef typename cond_as_parser_t::type condition_t; - - typedef unary<parser_t, parser<self_t> > base_t; - typedef condition_evaluator<condition_t> eval_t; - - - ////////////////////////////// - // constructor, saves condition and body parser - while_parser(ParsableT const &body, CondT const &cond) - : eval_t(cond_as_parser_t::convert(cond)) - , base_t(as_parser_t::convert(body)) - {} - - ////////////////////////////// - // result type computer. - template <typename ScannerT> - struct result - { - typedef typename match_result - <ScannerT, nil_t>::type type; - }; - - ////////////////////////////// - // parse member function - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - typedef typename parser_result<parser_t, ScannerT>::type sresult_t; - typedef typename ScannerT::iterator_t iterator_t; - - iterator_t save(scan.first); - std::size_t length = 0; - std::ptrdiff_t eval_length = 0; - - bool dont_check_condition = is_do_parser; - - while (dont_check_condition || (eval_length=this->evaluate(scan))>=0) - { - dont_check_condition = false; - length += eval_length; - sresult_t tmp(this->subject().parse(scan)); - if (tmp) - { - length+=tmp.length(); - } - else - { - return scan.no_match(); - } - } - return scan.create_match(length, nil_t(), save, scan.first); - } - }; - - ////////////////////////////////// - // while-parser generator, takes the body-parser in brackets - // and returns the actual while-parser. - template <typename CondT> - struct while_parser_gen - { - ////////////////////////////// - // constructor, saves the condition for use by operator[] - while_parser_gen(CondT const& cond_) : cond(cond_) {} - - ////////////////////////////// - // operator[] returns the actual while-parser object - template <typename ParsableT> - while_parser<ParsableT, CondT, false> - operator[](ParsableT const &subject) const - { - return while_parser<ParsableT, CondT, false>(subject, cond); - } - private: - - ////////////////////////////// - // the condition is stored by reference here. - // this should not cause any harm since object of type - // while_parser_gen<> are only used as temporaries - // the while-parser object constructed by the operator[] - // stores a copy of the condition. - CondT const &cond; - }; - - ////////////////////////////////// - // do-while-parser generator, takes the condition as - // parameter to while_p member function and returns the - // actual do-while-parser. - template <typename ParsableT> - struct do_while_parser_gen - { - ////////////////////////////// - // constructor. saves the body parser for use by while_p. - explicit do_while_parser_gen(ParsableT const &body_parser) - : body(body_parser) - {} - - ////////////////////////////// - // while_p returns the actual while-parser object - template <typename CondT> - while_parser<ParsableT, CondT, true> - while_p(CondT cond) const - { - return while_parser<ParsableT, CondT, true>(body, cond); - } - private: - - ////////////////////////////// - // the body is stored by reference here - // this should not cause any harm since object of type - // do_while_parser_gen<> are only used as temporaries - // the while-parser object constructed by the while_p - // member function stores a copy of the body parser. - ParsableT const &body; - }; - - struct do_parser_gen - { - inline do_parser_gen() {} - - template <typename ParsableT> - impl::do_while_parser_gen<ParsableT> - operator[](ParsableT const& body) const - { - return impl::do_while_parser_gen<ParsableT>(body); - } - }; -} // namespace impl - -////////////////////////////////// -// while_p function, while-parser generator -// Usage: spirit::while_p(Condition)[Body] -template <typename CondT> -impl::while_parser_gen<CondT> -while_p(CondT const& cond) -{ - return impl::while_parser_gen<CondT>(cond); -} - -////////////////////////////////// -// do_p functor, do-while-parser generator -// Usage: spirit::do_p[Body].while_p(Condition) -impl::do_parser_gen const do_p = impl::do_parser_gen(); - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_WHILE_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/fixed_size_queue.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/fixed_size_queue.hpp deleted file mode 100644 index 98de03889a..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/fixed_size_queue.hpp +++ /dev/null @@ -1,402 +0,0 @@ -/*============================================================================= - Copyright (c) 2001, Daniel C. Nuffer - Copyright (c) 2003, Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_CLASSIC_ITERATOR_FIXED_SIZE_QUEUE_HPP -#define BOOST_SPIRIT_CLASSIC_ITERATOR_FIXED_SIZE_QUEUE_HPP - -#include <cstddef> -#include <cstdlib> -#include <iterator> - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/assert.hpp> // for BOOST_SPIRIT_ASSERT - -// FIXES for broken compilers -#include <boost/config.hpp> -#include <boost/iterator_adaptors.hpp> - -#define BOOST_SPIRIT_ASSERT_FSQ_SIZE \ - BOOST_SPIRIT_ASSERT(((m_tail + N + 1) - m_head) % (N+1) == m_size % (N+1)) \ - /**/ - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -namespace impl { - -#if !defined(BOOST_ITERATOR_ADAPTORS_VERSION) || \ - BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 -#error "Please use at least Boost V1.31.0 while compiling the fixed_size_queue class!" -#else // BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - -template <typename QueueT, typename T, typename PointerT> -class fsq_iterator -: public boost::iterator_adaptor< - fsq_iterator<QueueT, T, PointerT>, - PointerT, - T, - std::random_access_iterator_tag - > -{ -public: - typedef typename QueueT::position_t position; - typedef boost::iterator_adaptor< - fsq_iterator<QueueT, T, PointerT>, PointerT, T, - std::random_access_iterator_tag - > base_t; - - fsq_iterator() {} - fsq_iterator(position const &p_) : p(p_) {} - - position const &get_position() const { return p; } - -private: - friend class boost::iterator_core_access; - - typename base_t::reference dereference() const - { - return p.self->m_queue[p.pos]; - } - - void increment() - { - ++p.pos; - if (p.pos == QueueT::MAX_SIZE+1) - p.pos = 0; - } - - void decrement() - { - if (p.pos == 0) - p.pos = QueueT::MAX_SIZE; - else - --p.pos; - } - - template < - typename OtherDerivedT, typename OtherIteratorT, - typename V, typename C, typename R, typename D - > - bool equal(iterator_adaptor<OtherDerivedT, OtherIteratorT, V, C, R, D> - const &x) const - { - position const &rhs_pos = - static_cast<OtherDerivedT const &>(x).get_position(); - return (p.self == rhs_pos.self) && (p.pos == rhs_pos.pos); - } - - template < - typename OtherDerivedT, typename OtherIteratorT, - typename V, typename C, typename R, typename D - > - typename base_t::difference_type distance_to( - iterator_adaptor<OtherDerivedT, OtherIteratorT, V, C, R, D> - const &x) const - { - typedef typename base_t::difference_type diff_t; - - position const &p2 = - static_cast<OtherDerivedT const &>(x).get_position(); - std::size_t pos1 = p.pos; - std::size_t pos2 = p2.pos; - - // Undefined behaviour if the iterators come from different - // containers - BOOST_SPIRIT_ASSERT(p.self == p2.self); - - if (pos1 < p.self->m_head) - pos1 += QueueT::MAX_SIZE; - if (pos2 < p2.self->m_head) - pos2 += QueueT::MAX_SIZE; - - if (pos2 > pos1) - return diff_t(pos2 - pos1); - else - return -diff_t(pos1 - pos2); - } - - void advance(typename base_t::difference_type n) - { - // Notice that we don't care values of n that can - // wrap around more than one time, since it would - // be undefined behaviour anyway (going outside - // the begin/end range). Negative wrapping is a bit - // cumbersome because we don't want to case p.pos - // to signed. - if (n < 0) - { - n = -n; - if (p.pos < (std::size_t)n) - p.pos = QueueT::MAX_SIZE+1 - (n - p.pos); - else - p.pos -= n; - } - else - { - p.pos += n; - if (p.pos >= QueueT::MAX_SIZE+1) - p.pos -= QueueT::MAX_SIZE+1; - } - } - -private: - position p; -}; - -#endif // BOOST_ITERATOR_ADAPTORS_VERSION < 0x0200 - -/////////////////////////////////////////////////////////////////////////////// -} /* namespace impl */ - -template <typename T, std::size_t N> -class fixed_size_queue -{ -private: - struct position - { - fixed_size_queue* self; - std::size_t pos; - - position() : self(0), pos(0) {} - - // The const_cast here is just to avoid to have two different - // position structures for the const and non-const case. - // The const semantic is guaranteed by the iterator itself - position(const fixed_size_queue* s, std::size_t p) - : self(const_cast<fixed_size_queue*>(s)), pos(p) - {} - }; - -public: - // Declare the iterators - typedef impl::fsq_iterator<fixed_size_queue<T, N>, T, T*> iterator; - typedef impl::fsq_iterator<fixed_size_queue<T, N>, T const, T const*> - const_iterator; - typedef position position_t; - - friend class impl::fsq_iterator<fixed_size_queue<T, N>, T, T*>; - friend class impl::fsq_iterator<fixed_size_queue<T, N>, T const, T const*>; - - fixed_size_queue(); - fixed_size_queue(const fixed_size_queue& x); - fixed_size_queue& operator=(const fixed_size_queue& x); - ~fixed_size_queue(); - - void push_back(const T& e); - void push_front(const T& e); - void serve(T& e); - void pop_front(); - - bool empty() const - { - return m_size == 0; - } - - bool full() const - { - return m_size == N; - } - - iterator begin() - { - return iterator(position(this, m_head)); - } - - const_iterator begin() const - { - return const_iterator(position(this, m_head)); - } - - iterator end() - { - return iterator(position(this, m_tail)); - } - - const_iterator end() const - { - return const_iterator(position(this, m_tail)); - } - - std::size_t size() const - { - return m_size; - } - - T& front() - { - return m_queue[m_head]; - } - - const T& front() const - { - return m_queue[m_head]; - } - -private: - // Redefine the template parameters to avoid using partial template - // specialization on the iterator policy to extract N. - BOOST_STATIC_CONSTANT(std::size_t, MAX_SIZE = N); - - std::size_t m_head; - std::size_t m_tail; - std::size_t m_size; - T m_queue[N+1]; -}; - -template <typename T, std::size_t N> -inline -fixed_size_queue<T, N>::fixed_size_queue() - : m_head(0) - , m_tail(0) - , m_size(0) -{ - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); -} - -template <typename T, std::size_t N> -inline -fixed_size_queue<T, N>::fixed_size_queue(const fixed_size_queue& x) - : m_head(x.m_head) - , m_tail(x.m_tail) - , m_size(x.m_size) -{ - copy(x.begin(), x.end(), begin()); - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); -} - -template <typename T, std::size_t N> -inline fixed_size_queue<T, N>& -fixed_size_queue<T, N>::operator=(const fixed_size_queue& x) -{ - if (this != &x) - { - m_head = x.m_head; - m_tail = x.m_tail; - m_size = x.m_size; - copy(x.begin(), x.end(), begin()); - } - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); - - return *this; -} - -template <typename T, std::size_t N> -inline -fixed_size_queue<T, N>::~fixed_size_queue() -{ - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); -} - -template <typename T, std::size_t N> -inline void -fixed_size_queue<T, N>::push_back(const T& e) -{ - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); - - BOOST_SPIRIT_ASSERT(!full()); - - m_queue[m_tail] = e; - ++m_size; - ++m_tail; - if (m_tail == N+1) - m_tail = 0; - - - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); -} - -template <typename T, std::size_t N> -inline void -fixed_size_queue<T, N>::push_front(const T& e) -{ - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); - - BOOST_SPIRIT_ASSERT(!full()); - - if (m_head == 0) - m_head = N; - else - --m_head; - - m_queue[m_head] = e; - ++m_size; - - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); -} - - -template <typename T, std::size_t N> -inline void -fixed_size_queue<T, N>::serve(T& e) -{ - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); - - e = m_queue[m_head]; - pop_front(); -} - - - -template <typename T, std::size_t N> -inline void -fixed_size_queue<T, N>::pop_front() -{ - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); - - ++m_head; - if (m_head == N+1) - m_head = 0; - --m_size; - - BOOST_SPIRIT_ASSERT(m_size <= N+1); - BOOST_SPIRIT_ASSERT_FSQ_SIZE; - BOOST_SPIRIT_ASSERT(m_head <= N+1); - BOOST_SPIRIT_ASSERT(m_tail <= N+1); -} - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#undef BOOST_SPIRIT_ASSERT_FSQ_SIZE - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/multi_pass.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/multi_pass.hpp deleted file mode 100644 index ff27d4e2c6..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/multi_pass.hpp +++ /dev/null @@ -1,1298 +0,0 @@ -/*============================================================================= - Copyright (c) 2001, Daniel C. Nuffer - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ITERATOR_MULTI_PASS_HPP -#define BOOST_SPIRIT_ITERATOR_MULTI_PASS_HPP - -#include <boost/config.hpp> -#include <boost/throw_exception.hpp> -#include <deque> -#include <iterator> -#include <iostream> -#include <algorithm> // for std::swap -#include <exception> // for std::exception -#include <boost/limits.hpp> - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/assert.hpp> // for BOOST_SPIRIT_ASSERT -#include <boost/spirit/home/classic/iterator/fixed_size_queue.hpp> - -#include <boost/spirit/home/classic/iterator/multi_pass_fwd.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -namespace impl { - template <typename T> - inline void mp_swap(T& t1, T& t2); -} - -namespace multi_pass_policies -{ - -/////////////////////////////////////////////////////////////////////////////// -// class ref_counted -// Implementation of an OwnershipPolicy used by multi_pass. -// -// Implementation modified from RefCounted class from the Loki library by -// Andrei Alexandrescu -/////////////////////////////////////////////////////////////////////////////// -class ref_counted -{ - protected: - ref_counted() - : count(new std::size_t(1)) - {} - - ref_counted(ref_counted const& x) - : count(x.count) - {} - - // clone is called when a copy of the iterator is made, so increment - // the ref-count. - void clone() - { - ++*count; - } - - // called when a copy is deleted. Decrement the ref-count. Return - // value of true indicates that the last copy has been released. - bool release() - { - if (!--*count) - { - delete count; - count = 0; - return true; - } - return false; - } - - void swap(ref_counted& x) - { - impl::mp_swap(count, x.count); - } - - public: - // returns true if there is only one iterator in existence. - // std_deque StoragePolicy will free it's buffered data if this - // returns true. - bool unique() const - { - return *count == 1; - } - - private: - std::size_t* count; -}; - -/////////////////////////////////////////////////////////////////////////////// -// class first_owner -// Implementation of an OwnershipPolicy used by multi_pass -// This ownership policy dictates that the first iterator created will -// determine the lifespan of the shared components. This works well for -// spirit, since no dynamic allocation of iterators is done, and all copies -// are make on the stack. -// -// There is a caveat about using this policy together with the std_deque -// StoragePolicy. Since first_owner always returns false from unique(), -// std_deque will only release the queued data if clear_queue() is called. -/////////////////////////////////////////////////////////////////////////////// -class first_owner -{ - protected: - first_owner() - : first(true) - {} - - first_owner(first_owner const&) - : first(false) - {} - - void clone() - { - } - - // return true to indicate deletion of resources - bool release() - { - return first; - } - - void swap(first_owner&) - { - // if we're the first, we still remain the first, even if assigned - // to, so don't swap first_. swap is only called from operator= - } - - public: - bool unique() const - { - return false; // no way to know, so always return false - } - - private: - bool first; -}; - -/////////////////////////////////////////////////////////////////////////////// -// class illegal_backtracking -// thrown by buf_id_check CheckingPolicy if an instance of an iterator is -// used after another one has invalidated the queue -/////////////////////////////////////////////////////////////////////////////// -class BOOST_SYMBOL_VISIBLE illegal_backtracking : public std::exception -{ -public: - - illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW {} - ~illegal_backtracking() BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE {} - - const char* - what() const BOOST_NOEXCEPT_OR_NOTHROW BOOST_OVERRIDE - { return "BOOST_SPIRIT_CLASSIC_NS::illegal_backtracking"; } -}; - -/////////////////////////////////////////////////////////////////////////////// -// class buf_id_check -// Implementation of the CheckingPolicy used by multi_pass -// This policy is most effective when used together with the std_deque -// StoragePolicy. -// If used with the fixed_size_queue StoragePolicy, it will not detect -// iterator dereferences that are out of the range of the queue. -/////////////////////////////////////////////////////////////////////////////// -class buf_id_check -{ - protected: - buf_id_check() - : shared_buf_id(new unsigned long(0)) - , buf_id(0) - {} - - buf_id_check(buf_id_check const& x) - : shared_buf_id(x.shared_buf_id) - , buf_id(x.buf_id) - {} - - // will be called from the destructor of the last iterator. - void destroy() - { - delete shared_buf_id; - shared_buf_id = 0; - } - - void swap(buf_id_check& x) - { - impl::mp_swap(shared_buf_id, x.shared_buf_id); - impl::mp_swap(buf_id, x.buf_id); - } - - // called to verify that everything is okay. - void check_if_valid() const - { - if (buf_id != *shared_buf_id) - { - boost::throw_exception(illegal_backtracking()); - } - } - - // called from multi_pass::clear_queue, so we can increment the count - void clear_queue() - { - ++*shared_buf_id; - ++buf_id; - } - - private: - unsigned long* shared_buf_id; - unsigned long buf_id; -}; - -/////////////////////////////////////////////////////////////////////////////// -// class no_check -// Implementation of the CheckingPolicy used by multi_pass -// It does not do anything :-) -/////////////////////////////////////////////////////////////////////////////// -class no_check -{ - protected: - no_check() {} - no_check(no_check const&) {} - void destroy() {} - void swap(no_check&) {} - void check_if_valid() const {} - void clear_queue() {} -}; - -/////////////////////////////////////////////////////////////////////////////// -// class std_deque -// Implementation of the StoragePolicy used by multi_pass -// This stores all data in a std::deque, and keeps an offset to the current -// position. It stores all the data unless there is only one -// iterator using the queue. -// Note: a position is used instead of an iterator, because a push_back on -// a deque can invalidate any iterators. -/////////////////////////////////////////////////////////////////////////////// -class std_deque -{ - public: - -template <typename ValueT> -class inner -{ - private: - - typedef std::deque<ValueT> queue_type; - queue_type* queuedElements; - mutable typename queue_type::size_type queuePosition; - - protected: - inner() - : queuedElements(new queue_type) - , queuePosition(0) - {} - - inner(inner const& x) - : queuedElements(x.queuedElements) - , queuePosition(x.queuePosition) - {} - - // will be called from the destructor of the last iterator. - void destroy() - { - BOOST_SPIRIT_ASSERT(NULL != queuedElements); - delete queuedElements; - queuedElements = 0; - } - - void swap(inner& x) - { - impl::mp_swap(queuedElements, x.queuedElements); - impl::mp_swap(queuePosition, x.queuePosition); - } - - // This is called when the iterator is dereferenced. It's a template - // method so we can recover the type of the multi_pass iterator - // and call unique and access the m_input data member. - template <typename MultiPassT> - static typename MultiPassT::reference dereference(MultiPassT const& mp) - { - if (mp.queuePosition == mp.queuedElements->size()) - { - // check if this is the only iterator - if (mp.unique()) - { - // free up the memory used by the queue. - if (mp.queuedElements->size() > 0) - { - mp.queuedElements->clear(); - mp.queuePosition = 0; - } - } - return mp.get_input(); - } - else - { - return (*mp.queuedElements)[mp.queuePosition]; - } - } - - // This is called when the iterator is incremented. It's a template - // method so we can recover the type of the multi_pass iterator - // and call unique and access the m_input data member. - template <typename MultiPassT> - static void increment(MultiPassT& mp) - { - if (mp.queuePosition == mp.queuedElements->size()) - { - // check if this is the only iterator - if (mp.unique()) - { - // free up the memory used by the queue. - if (mp.queuedElements->size() > 0) - { - mp.queuedElements->clear(); - mp.queuePosition = 0; - } - } - else - { - mp.queuedElements->push_back(mp.get_input()); - ++mp.queuePosition; - } - mp.advance_input(); - } - else - { - ++mp.queuePosition; - } - - } - - // called to forcibly clear the queue - void clear_queue() - { - queuedElements->clear(); - queuePosition = 0; - } - - // called to determine whether the iterator is an eof iterator - template <typename MultiPassT> - static bool is_eof(MultiPassT const& mp) - { - return mp.queuePosition == mp.queuedElements->size() && - mp.input_at_eof(); - } - - // called by operator== - bool equal_to(inner const& x) const - { - return queuePosition == x.queuePosition; - } - - // called by operator< - bool less_than(inner const& x) const - { - return queuePosition < x.queuePosition; - } -}; // class inner - -}; // class std_deque - - -/////////////////////////////////////////////////////////////////////////////// -// class fixed_size_queue -// Implementation of the StoragePolicy used by multi_pass -// fixed_size_queue keeps a circular buffer (implemented by -// BOOST_SPIRIT_CLASSIC_NS::fixed_size_queue class) that is size N+1 and stores N elements. -// It is up to the user to ensure that there is enough look ahead for their -// grammar. Currently there is no way to tell if an iterator is pointing -// to forgotten data. The leading iterator will put an item in the queue -// and remove one when it is incremented. No dynamic allocation is done, -// except on creation of the queue (fixed_size_queue constructor). -/////////////////////////////////////////////////////////////////////////////// -template < std::size_t N> -class fixed_size_queue -{ - public: - -template <typename ValueT> -class inner -{ - private: - - typedef BOOST_SPIRIT_CLASSIC_NS::fixed_size_queue<ValueT, N> queue_type; - queue_type * queuedElements; - mutable typename queue_type::iterator queuePosition; - - protected: - inner() - : queuedElements(new queue_type) - , queuePosition(queuedElements->begin()) - {} - - inner(inner const& x) - : queuedElements(x.queuedElements) - , queuePosition(x.queuePosition) - {} - - // will be called from the destructor of the last iterator. - void destroy() - { - BOOST_SPIRIT_ASSERT(NULL != queuedElements); - delete queuedElements; - queuedElements = 0; - } - - void swap(inner& x) - { - impl::mp_swap(queuedElements, x.queuedElements); - impl::mp_swap(queuePosition, x.queuePosition); - } - - // This is called when the iterator is dereferenced. It's a template - // method so we can recover the type of the multi_pass iterator - // and access the m_input data member. - template <typename MultiPassT> - static typename MultiPassT::reference dereference(MultiPassT const& mp) - { - if (mp.queuePosition == mp.queuedElements->end()) - { - return mp.get_input(); - } - else - { - return *mp.queuePosition; - } - } - - // This is called when the iterator is incremented. It's a template - // method so we can recover the type of the multi_pass iterator - // and access the m_input data member. - template <typename MultiPassT> - static void increment(MultiPassT& mp) - { - if (mp.queuePosition == mp.queuedElements->end()) - { - // don't let the queue get larger than N - if (mp.queuedElements->size() >= N) - mp.queuedElements->pop_front(); - - mp.queuedElements->push_back(mp.get_input()); - mp.advance_input(); - } - ++mp.queuePosition; - } - - // no-op - void clear_queue() - {} - - // called to determine whether the iterator is an eof iterator - template <typename MultiPassT> - static bool is_eof(MultiPassT const& mp) - { - return mp.queuePosition == mp.queuedElements->end() && - mp.input_at_eof(); - } - - // called by operator== - bool equal_to(inner const& x) const - { - return queuePosition == x.queuePosition; - } - - // called by operator< - bool less_than(inner const& x) const - { - return queuePosition < x.queuePosition; - } -}; // class inner - -}; // class fixed_size_queue - - -/////////////////////////////////////////////////////////////////////////////// -// class input_iterator -// Implementation of the InputPolicy used by multi_pass -// input_iterator encapsulates an input iterator of type InputT -/////////////////////////////////////////////////////////////////////////////// -class input_iterator -{ - public: - -template <typename InputT> -class inner -{ - private: - typedef - typename std::iterator_traits<InputT>::value_type - result_type; - - public: - typedef result_type value_type; - - private: - struct Data { - Data(InputT const &input_) - : input(input_), was_initialized(false) - {} - - InputT input; - value_type curtok; - bool was_initialized; - }; - - // Needed by compilers not implementing the resolution to DR45. For - // reference, see - // http://www.open-std.org/JTC1/SC22/WG21/docs/cwg_defects.html#45. - - friend struct Data; - - public: - typedef - typename std::iterator_traits<InputT>::difference_type - difference_type; - typedef - typename std::iterator_traits<InputT>::pointer - pointer; - typedef - typename std::iterator_traits<InputT>::reference - reference; - - protected: - inner() - : data(0) - {} - - inner(InputT x) - : data(new Data(x)) - {} - - inner(inner const& x) - : data(x.data) - {} - - void destroy() - { - delete data; - data = 0; - } - - bool same_input(inner const& x) const - { - return data == x.data; - } - - typedef - typename std::iterator_traits<InputT>::value_type - value_t; - void swap(inner& x) - { - impl::mp_swap(data, x.data); - } - - void ensure_initialized() const - { - if (data && !data->was_initialized) { - data->curtok = *data->input; // get the first token - data->was_initialized = true; - } - } - - public: - reference get_input() const - { - BOOST_SPIRIT_ASSERT(NULL != data); - ensure_initialized(); - return data->curtok; - } - - void advance_input() - { - BOOST_SPIRIT_ASSERT(NULL != data); - data->was_initialized = false; // should get the next token - ++data->input; - } - - bool input_at_eof() const - { - return !data || data->input == InputT(); - } - - private: - Data *data; -}; - -}; - -/////////////////////////////////////////////////////////////////////////////// -// class lex_input -// Implementation of the InputPolicy used by multi_pass -// lex_input gets tokens (ints) from yylex() -/////////////////////////////////////////////////////////////////////////////// -class lex_input -{ - public: - -template <typename InputT> -class inner -{ - public: - typedef int value_type; - typedef std::ptrdiff_t difference_type; - typedef int* pointer; - typedef int& reference; - - protected: - inner() - : curtok(new int(0)) - {} - - inner(InputT x) - : curtok(new int(x)) - {} - - inner(inner const& x) - : curtok(x.curtok) - {} - - void destroy() - { - delete curtok; - curtok = 0; - } - - bool same_input(inner const& x) const - { - return curtok == x.curtok; - } - - void swap(inner& x) - { - impl::mp_swap(curtok, x.curtok); - } - - public: - reference get_input() const - { - return *curtok; - } - - void advance_input() - { - extern int yylex(); - *curtok = yylex(); - } - - bool input_at_eof() const - { - return *curtok == 0; - } - - private: - int* curtok; - -}; - -}; - -/////////////////////////////////////////////////////////////////////////////// -// class functor_input -// Implementation of the InputPolicy used by multi_pass -// functor_input gets tokens from a functor -// Note: the functor must have a typedef for result_type -// It also must have a static variable of type result_type defined to -// represent eof that is called eof. -/////////////////////////////////////////////////////////////////////////////// -class functor_input -{ - public: - -template <typename FunctorT> -class inner -{ - typedef typename FunctorT::result_type result_type; - public: - typedef result_type value_type; - typedef std::ptrdiff_t difference_type; - typedef result_type* pointer; - typedef result_type& reference; - - protected: - inner() - : ftor(0) - , curtok(0) - {} - - inner(FunctorT const& x) - : ftor(new FunctorT(x)) - , curtok(new result_type((*ftor)())) - {} - - inner(inner const& x) - : ftor(x.ftor) - , curtok(x.curtok) - {} - - void destroy() - { - delete ftor; - ftor = 0; - delete curtok; - curtok = 0; - } - - bool same_input(inner const& x) const - { - return ftor == x.ftor; - } - - void swap(inner& x) - { - impl::mp_swap(curtok, x.curtok); - impl::mp_swap(ftor, x.ftor); - } - - public: - reference get_input() const - { - return *curtok; - } - - void advance_input() - { - if (curtok) { - *curtok = (*ftor)(); - } - } - - bool input_at_eof() const - { - return !curtok || *curtok == ftor->eof; - } - - FunctorT& get_functor() const - { - return *ftor; - } - - - private: - FunctorT* ftor; - result_type* curtok; - -}; - -}; - -} // namespace multi_pass_policies - -/////////////////////////////////////////////////////////////////////////////// -// iterator_base_creator -/////////////////////////////////////////////////////////////////////////////// - -namespace iterator_ { namespace impl { - -// Meta-function to generate a std::iterator<>-like base class for multi_pass. -template <typename InputPolicyT, typename InputT> -struct iterator_base_creator -{ - typedef typename InputPolicyT::BOOST_NESTED_TEMPLATE inner<InputT> input_t; - - struct type { - typedef std::forward_iterator_tag iterator_category; - typedef typename input_t::value_type value_type; - typedef typename input_t::difference_type difference_type; - typedef typename input_t::pointer pointer; - typedef typename input_t::reference reference; - }; -}; - -}} - -/////////////////////////////////////////////////////////////////////////////// -// class template multi_pass -/////////////////////////////////////////////////////////////////////////////// - -// The default multi_pass instantiation uses a ref-counted std_deque scheme. -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -class multi_pass - : public OwnershipPolicy - , public CheckingPolicy - , public StoragePolicy::template inner< - typename InputPolicy::template inner<InputT>::value_type> - , public InputPolicy::template inner<InputT> - , public iterator_::impl::iterator_base_creator<InputPolicy, InputT>::type -{ - typedef OwnershipPolicy OP; - typedef CheckingPolicy CHP; - typedef typename StoragePolicy::template inner< - typename InputPolicy::template inner<InputT>::value_type> SP; - typedef typename InputPolicy::template inner<InputT> IP; - typedef typename - iterator_::impl::iterator_base_creator<InputPolicy, InputT>::type - IB; - - public: - typedef typename IB::value_type value_type; - typedef typename IB::difference_type difference_type; - typedef typename IB::reference reference; - typedef typename IB::pointer pointer; - typedef InputT iterator_type; - - multi_pass(); - explicit multi_pass(InputT input); - -#if BOOST_WORKAROUND(__GLIBCPP__, == 20020514) - multi_pass(int); -#endif // BOOST_WORKAROUND(__GLIBCPP__, == 20020514) - - ~multi_pass(); - - multi_pass(multi_pass const&); - multi_pass& operator=(multi_pass const&); - - void swap(multi_pass& x); - - reference operator*() const; - pointer operator->() const; - multi_pass& operator++(); - multi_pass operator++(int); - - void clear_queue(); - - bool operator==(const multi_pass& y) const; - bool operator<(const multi_pass& y) const; - - private: // helper functions - bool is_eof() const; -}; - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -multi_pass() - : OP() - , CHP() - , SP() - , IP() -{ -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -multi_pass(InputT input) - : OP() - , CHP() - , SP() - , IP(input) -{ -} - -#if BOOST_WORKAROUND(__GLIBCPP__, == 20020514) - // The standard library shipped with gcc-3.1 has a bug in - // bits/basic_string.tcc. It tries to use iter::iter(0) to - // construct an iterator. Ironically, this happens in sanity - // checking code that isn't required by the standard. - // The workaround is to provide an additional constructor that - // ignores its int argument and behaves like the default constructor. -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -multi_pass(int) - : OP() - , CHP() - , SP() - , IP() -{ -} -#endif // BOOST_WORKAROUND(__GLIBCPP__, == 20020514) - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -~multi_pass() -{ - if (OP::release()) - { - CHP::destroy(); - SP::destroy(); - IP::destroy(); - } -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -multi_pass( - multi_pass const& x) - : OP(x) - , CHP(x) - , SP(x) - , IP(x) -{ - OP::clone(); -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>& -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -operator=( - multi_pass const& x) -{ - multi_pass temp(x); - temp.swap(*this); - return *this; -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline void -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -swap(multi_pass& x) -{ - OP::swap(x); - CHP::swap(x); - SP::swap(x); - IP::swap(x); -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -typename multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -reference -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -operator*() const -{ - CHP::check_if_valid(); - return SP::dereference(*this); -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -typename multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -pointer -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -operator->() const -{ - return &(operator*()); -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>& -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -operator++() -{ - CHP::check_if_valid(); - SP::increment(*this); - return *this; -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy> -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -operator++(int) -{ - multi_pass - < - InputT, - InputPolicy, - OwnershipPolicy, - CheckingPolicy, - StoragePolicy - > tmp(*this); - - ++*this; - - return tmp; -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline void -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -clear_queue() -{ - SP::clear_queue(); - CHP::clear_queue(); -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline bool -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -is_eof() const -{ - return SP::is_eof(*this); -} - -///// Comparisons -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline bool -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -operator==(const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& y) const -{ - bool is_eof_ = SP::is_eof(*this); - bool y_is_eof_ = SP::is_eof(y); - - if (is_eof_ && y_is_eof_) - { - return true; // both are EOF - } - else if (is_eof_ ^ y_is_eof_) - { - return false; // one is EOF, one isn't - } - else if (!IP::same_input(y)) - { - return false; - } - else - { - return SP::equal_to(y); - } -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline bool -multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy>:: -operator<(const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& y) const -{ - return SP::less_than(y); -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -bool operator!=( - const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& x, - const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& y) -{ - return !(x == y); -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -bool operator>( - const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& x, - const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& y) -{ - return y < x; -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -bool operator>=( - const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& x, - const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& y) -{ - return !(x < y); -} - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -inline -bool operator<=( - const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& x, - const multi_pass<InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, - StoragePolicy>& y) -{ - return !(y < x); -} - -///// Generator function -template <typename InputT> -inline multi_pass<InputT, - multi_pass_policies::input_iterator, multi_pass_policies::ref_counted, - multi_pass_policies::buf_id_check, multi_pass_policies::std_deque> -make_multi_pass(InputT i) -{ - return multi_pass<InputT, - multi_pass_policies::input_iterator, multi_pass_policies::ref_counted, - multi_pass_policies::buf_id_check, multi_pass_policies::std_deque>(i); -} - -// this could be a template typedef, since such a thing doesn't -// exist in C++, we'll use inheritance to accomplish the same thing. - -template <typename InputT, std::size_t N> -class look_ahead : - public multi_pass< - InputT, - multi_pass_policies::input_iterator, - multi_pass_policies::first_owner, - multi_pass_policies::no_check, - multi_pass_policies::fixed_size_queue<N> > -{ - typedef multi_pass< - InputT, - multi_pass_policies::input_iterator, - multi_pass_policies::first_owner, - multi_pass_policies::no_check, - multi_pass_policies::fixed_size_queue<N> > base_t; - public: - look_ahead() - : base_t() {} - - explicit look_ahead(InputT x) - : base_t(x) {} - - look_ahead(look_ahead const& x) - : base_t(x) {} - -#if BOOST_WORKAROUND(__GLIBCPP__, == 20020514) - look_ahead(int) // workaround for a bug in the library - : base_t() {} // shipped with gcc 3.1 -#endif // BOOST_WORKAROUND(__GLIBCPP__, == 20020514) - - // default generated operators destructor and assignment operator are okay. -}; - -template -< - typename InputT, - typename InputPolicy, - typename OwnershipPolicy, - typename CheckingPolicy, - typename StoragePolicy -> -void swap( - multi_pass< - InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy - > &x, - multi_pass< - InputT, InputPolicy, OwnershipPolicy, CheckingPolicy, StoragePolicy - > &y) -{ - x.swap(y); -} - -namespace impl { - - template <typename T> - inline void mp_swap(T& t1, T& t2) - { - using std::swap; - using BOOST_SPIRIT_CLASSIC_NS::swap; - swap(t1, t2); - } -} - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_ITERATOR_MULTI_PASS_HPP diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/multi_pass_fwd.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/multi_pass_fwd.hpp deleted file mode 100644 index a212305ac2..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/iterator/multi_pass_fwd.hpp +++ /dev/null @@ -1,47 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Tobias Schwinger - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_ITERATOR_MULTI_PASS_FWD_HPP) -#define BOOST_SPIRIT_ITERATOR_MULTI_PASS_FWD_HPP - -#include <cstddef> - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - namespace multi_pass_policies - { - class ref_counted; - class first_owner; - class buf_id_check; - class no_check; - class std_deque; - template<std::size_t N> class fixed_size_queue; - class input_iterator; - class lex_input; - class functor_input; - } - - template - < - typename InputT, - typename InputPolicy = multi_pass_policies::input_iterator, - typename OwnershipPolicy = multi_pass_policies::ref_counted, - typename CheckingPolicy = multi_pass_policies::buf_id_check, - typename StoragePolicy = multi_pass_policies::std_deque - > - class multi_pass; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/impl/parser_traits.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/impl/parser_traits.ipp deleted file mode 100644 index 846a58b75f..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/impl/parser_traits.ipp +++ /dev/null @@ -1,116 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - Copyright (c) 2003 Martin Wille - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#if !defined(BOOST_SPIRIT_PARSER_TRAITS_IPP) -#define BOOST_SPIRIT_PARSER_TRAITS_IPP - -#include <boost/spirit/home/classic/core/composite/operators.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -namespace impl -{ - - - /////////////////////////////////////////////////////////////////////////// - struct parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_alternative = false); - BOOST_STATIC_CONSTANT(bool, is_sequence = false); - BOOST_STATIC_CONSTANT(bool, is_sequential_or = false); - BOOST_STATIC_CONSTANT(bool, is_intersection = false); - BOOST_STATIC_CONSTANT(bool, is_difference = false); - BOOST_STATIC_CONSTANT(bool, is_exclusive_or = false); - BOOST_STATIC_CONSTANT(bool, is_optional = false); - BOOST_STATIC_CONSTANT(bool, is_kleene_star = false); - BOOST_STATIC_CONSTANT(bool, is_positive = false); - }; - - template <typename ParserT> - struct parser_type_traits : public parser_type_traits_base { - - // no definition here, fallback for all not explicitly mentioned parser - // types - }; - - template <typename A, typename B> - struct parser_type_traits<alternative<A, B> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_alternative = true); - }; - - template <typename A, typename B> - struct parser_type_traits<sequence<A, B> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_sequence = true); - }; - - template <typename A, typename B> - struct parser_type_traits<sequential_or<A, B> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_sequential_or = true); - }; - - template <typename A, typename B> - struct parser_type_traits<intersection<A, B> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_intersection = true); - }; - - template <typename A, typename B> - struct parser_type_traits<difference<A, B> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_difference = true); - }; - - template <typename A, typename B> - struct parser_type_traits<exclusive_or<A, B> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_exclusive_or = true); - }; - - template <typename S> - struct parser_type_traits<optional<S> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_optional = true); - }; - - template <typename S> - struct parser_type_traits<kleene_star<S> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_kleene_star = true); - }; - - template <typename S> - struct parser_type_traits<positive<S> > - : public parser_type_traits_base { - - BOOST_STATIC_CONSTANT(bool, is_positive = true); - }; - -} // namespace impl - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif // !defined(BOOST_SPIRIT_PARSER_TRAITS_IPP) diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/impl/refactoring.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/impl/refactoring.ipp deleted file mode 100644 index cebad09370..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/impl/refactoring.ipp +++ /dev/null @@ -1,451 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#ifndef BOOST_SPIRIT_REFACTORING_IPP -#define BOOST_SPIRIT_REFACTORING_IPP - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// The struct 'self_nested_refactoring' is used to indicate, that the -// refactoring algorithm should be 'self-nested'. -// -// The struct 'non_nested_refactoring' is used to indicate, that no nesting -// of refactoring algorithms is reqired. -// -/////////////////////////////////////////////////////////////////////////////// - -struct non_nested_refactoring { typedef non_nested_refactoring embed_t; }; -struct self_nested_refactoring { typedef self_nested_refactoring embed_t; }; - -/////////////////////////////////////////////////////////////////////////////// -namespace impl { - -/////////////////////////////////////////////////////////////////////////////// -// -// Helper templates for refactoring parsers -// -/////////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - // - // refactor the left unary operand of a binary parser - // - // The refactoring should be done only if the left operand is an - // unary_parser_category parser. - // - /////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - template <typename CategoryT> - struct refactor_unary_nested { - - template < - typename ParserT, typename NestedT, - typename ScannerT, typename BinaryT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, BinaryT const& binary, - NestedT const& /*nested_d*/) - { - return binary.parse(scan); - } - }; - - template <> - struct refactor_unary_nested<unary_parser_category> { - - template < - typename ParserT, typename ScannerT, typename BinaryT, - typename NestedT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, BinaryT const& binary, - NestedT const& nested_d) - { - typedef typename BinaryT::parser_generator_t op_t; - typedef - typename BinaryT::left_t::parser_generator_t - unary_t; - - return - unary_t::generate( - nested_d[ - op_t::generate(binary.left().subject(), binary.right()) - ] - ).parse(scan); - } - }; - - /////////////////////////////////////////////////////////////////////////// - template <typename CategoryT> - struct refactor_unary_non_nested { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, BinaryT const& binary) - { - return binary.parse(scan); - } - }; - - template <> - struct refactor_unary_non_nested<unary_parser_category> { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, BinaryT const& binary) - { - typedef typename BinaryT::parser_generator_t op_t; - typedef - typename BinaryT::left_t::parser_generator_t - unary_t; - - return unary_t::generate( - op_t::generate(binary.left().subject(), binary.right()) - ).parse(scan); - } - }; - - /////////////////////////////////////////////////////////////////////////// - template <typename NestedT> - struct refactor_unary_type { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, BinaryT const& binary, - NestedT const& nested_d) - { - typedef - typename BinaryT::left_t::parser_category_t - parser_category_t; - - return refactor_unary_nested<parser_category_t>:: - parse(p, scan, binary, nested_d); - } - }; - - template <> - struct refactor_unary_type<non_nested_refactoring> { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, BinaryT const& binary, - non_nested_refactoring const&) - { - typedef - typename BinaryT::left_t::parser_category_t - parser_category_t; - - return refactor_unary_non_nested<parser_category_t>:: - parse(p, scan, binary); - } - - }; - - template <> - struct refactor_unary_type<self_nested_refactoring> { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, BinaryT const& binary, - self_nested_refactoring const &nested_tag) - { - typedef - typename BinaryT::left_t::parser_category_t - parser_category_t; - typedef typename ParserT::parser_generator_t parser_generator_t; - - parser_generator_t nested_d(nested_tag); - return refactor_unary_nested<parser_category_t>:: - parse(p, scan, binary, nested_d); - } - - }; - - /////////////////////////////////////////////////////////////////////////// - // - // refactor the action on the left operand of a binary parser - // - // The refactoring should be done only if the left operand is an - // action_parser_category parser. - // - /////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - template <typename CategoryT> - struct refactor_action_nested { - - template < - typename ParserT, typename ScannerT, typename BinaryT, - typename NestedT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, BinaryT const& binary, - NestedT const& nested_d) - { - return nested_d[binary].parse(scan); - } - }; - - template <> - struct refactor_action_nested<action_parser_category> { - - template < - typename ParserT, typename ScannerT, typename BinaryT, - typename NestedT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, BinaryT const& binary, - NestedT const& nested_d) - { - typedef typename BinaryT::parser_generator_t binary_gen_t; - - return ( - nested_d[ - binary_gen_t::generate( - binary.left().subject(), - binary.right() - ) - ][binary.left().predicate()] - ).parse(scan); - } - }; - - /////////////////////////////////////////////////////////////////////////// - template <typename CategoryT> - struct refactor_action_non_nested { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, BinaryT const& binary) - { - return binary.parse(scan); - } - }; - - template <> - struct refactor_action_non_nested<action_parser_category> { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, BinaryT const& binary) - { - typedef typename BinaryT::parser_generator_t binary_gen_t; - - return ( - binary_gen_t::generate( - binary.left().subject(), - binary.right() - )[binary.left().predicate()] - ).parse(scan); - } - }; - - /////////////////////////////////////////////////////////////////////////// - template <typename NestedT> - struct refactor_action_type { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, BinaryT const& binary, - NestedT const& nested_d) - { - typedef - typename BinaryT::left_t::parser_category_t - parser_category_t; - - return refactor_action_nested<parser_category_t>:: - parse(p, scan, binary, nested_d); - } - }; - - template <> - struct refactor_action_type<non_nested_refactoring> { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, BinaryT const& binary, - non_nested_refactoring const&) - { - typedef - typename BinaryT::left_t::parser_category_t - parser_category_t; - - return refactor_action_non_nested<parser_category_t>:: - parse(p, scan, binary); - } - }; - - template <> - struct refactor_action_type<self_nested_refactoring> { - - template <typename ParserT, typename ScannerT, typename BinaryT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, BinaryT const& binary, - self_nested_refactoring const &nested_tag) - { - typedef typename ParserT::parser_generator_t parser_generator_t; - typedef - typename BinaryT::left_t::parser_category_t - parser_category_t; - - parser_generator_t nested_d(nested_tag); - return refactor_action_nested<parser_category_t>:: - parse(p, scan, binary, nested_d); - } - }; - - /////////////////////////////////////////////////////////////////////////// - // - // refactor the action attached to a binary parser - // - // The refactoring should be done only if the given parser is an - // binary_parser_category parser. - // - /////////////////////////////////////////////////////////////////////////// - - /////////////////////////////////////////////////////////////////////////// - template <typename CategoryT> - struct attach_action_nested { - - template < - typename ParserT, typename ScannerT, typename ActionT, - typename NestedT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, ActionT const &action, - NestedT const& /*nested_d*/) - { - return action.parse(scan); - } - }; - - template <> - struct attach_action_nested<binary_parser_category> { - - template < - typename ParserT, typename ScannerT, typename ActionT, - typename NestedT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, ActionT const &action, - NestedT const& nested_d) - { - typedef - typename ActionT::subject_t::parser_generator_t - binary_gen_t; - - return ( - binary_gen_t::generate( - nested_d[action.subject().left()[action.predicate()]], - nested_d[action.subject().right()[action.predicate()]] - ) - ).parse(scan); - } - }; - - /////////////////////////////////////////////////////////////////////////// - template <typename CategoryT> - struct attach_action_non_nested { - - template <typename ParserT, typename ScannerT, typename ActionT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, ActionT const &action) - { - return action.parse(scan); - } - }; - - template <> - struct attach_action_non_nested<binary_parser_category> { - - template <typename ParserT, typename ScannerT, typename ActionT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &, ScannerT const& scan, ActionT const &action) - { - typedef - typename ActionT::subject_t::parser_generator_t - binary_gen_t; - - return ( - binary_gen_t::generate( - action.subject().left()[action.predicate()], - action.subject().right()[action.predicate()] - ) - ).parse(scan); - } - }; - - /////////////////////////////////////////////////////////////////////////// - template <typename NestedT> - struct attach_action_type { - - template <typename ParserT, typename ScannerT, typename ActionT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, ActionT const& action, - NestedT const& nested_d) - { - typedef - typename ActionT::subject_t::parser_category_t - parser_category_t; - - return attach_action_nested<parser_category_t>:: - parse(p, scan, action, nested_d); - } - }; - - template <> - struct attach_action_type<non_nested_refactoring> { - - template <typename ParserT, typename ScannerT, typename ActionT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, ActionT const &action, - non_nested_refactoring const&) - { - typedef - typename ActionT::subject_t::parser_category_t - parser_category_t; - - return attach_action_non_nested<parser_category_t>:: - parse(p, scan, action); - } - }; - - template <> - struct attach_action_type<self_nested_refactoring> { - - template <typename ParserT, typename ScannerT, typename ActionT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const &p, ScannerT const& scan, ActionT const &action, - self_nested_refactoring const& nested_tag) - { - typedef typename ParserT::parser_generator_t parser_generator_t; - typedef - typename ActionT::subject_t::parser_category_t - parser_category_t; - - parser_generator_t nested_d(nested_tag); - return attach_action_nested<parser_category_t>:: - parse(p, scan, action, nested_d); - } - }; - -} // namespace impl - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/parser_traits.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/parser_traits.hpp deleted file mode 100644 index d603d5ba43..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/parser_traits.hpp +++ /dev/null @@ -1,320 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - Copyright (c) 2003 Martin Wille - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_PARSER_TRAITS_HPP) -#define BOOST_SPIRIT_PARSER_TRAITS_HPP - -#include <boost/type_traits/is_base_and_derived.hpp> -#include <boost/static_assert.hpp> - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/meta/impl/parser_traits.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// Parser traits templates -// -// Used to determine the type and several other characteristics of a given -// parser type. -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// -// The is_parser traits template can be used to tell wether a given -// class is a parser. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T> -struct is_parser -{ - BOOST_STATIC_CONSTANT(bool, value = - (::boost::is_base_and_derived<parser<T>, T>::value)); - -// [JDG 2/3/03] simplified implementation by -// using boost::is_base_and_derived -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// The is_unary_composite traits template can be used to tell if a given -// parser is a unary parser as for instance kleene_star or optional. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename UnaryT> -struct is_unary_composite { - - BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible< - typename UnaryT::parser_category_t, unary_parser_category>::value)); -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// The is_acction_parser traits template can be used to tell if a given -// parser is a action parser, i.e. it is a composite consisting of a -// auxiliary parser and an attached semantic action. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename ActionT> -struct is_action_parser { - - BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible< - typename ActionT::parser_category_t, action_parser_category>::value)); -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// The is_binary_composite traits template can be used to tell if a given -// parser is a binary parser as for instance sequence or difference. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename BinaryT> -struct is_binary_composite { - - BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible< - typename BinaryT::parser_category_t, binary_parser_category>::value)); -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// The is_composite_parser traits template can be used to tell if a given -// parser is a unary or a binary parser composite type. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename CompositeT> -struct is_composite_parser { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::is_unary_composite<CompositeT>::value || - ::BOOST_SPIRIT_CLASSIC_NS::is_binary_composite<CompositeT>::value)); -}; - -/////////////////////////////////////////////////////////////////////////////// -template <typename ParserT> -struct is_alternative { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_alternative)); -}; - -template <typename ParserT> -struct is_sequence { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_sequence)); -}; - -template <typename ParserT> -struct is_sequential_or { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_sequential_or)); -}; - -template <typename ParserT> -struct is_intersection { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_intersection)); -}; - -template <typename ParserT> -struct is_difference { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_difference)); -}; - -template <typename ParserT> -struct is_exclusive_or { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_exclusive_or)); -}; - -template <typename ParserT> -struct is_optional { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_optional)); -}; - -template <typename ParserT> -struct is_kleene_star { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_kleene_star)); -}; - -template <typename ParserT> -struct is_positive { - - BOOST_STATIC_CONSTANT(bool, value = ( - ::BOOST_SPIRIT_CLASSIC_NS::impl::parser_type_traits<ParserT>::is_positive)); -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Parser extraction templates -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// -// The unary_subject template can be used to return the type of the -// parser used as the subject of an unary parser. -// If the parser under inspection is not an unary type parser the compilation -// will fail. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename UnaryT> -struct unary_subject { - - BOOST_STATIC_ASSERT(BOOST_SPIRIT_CLASSIC_NS::is_unary_composite<UnaryT>::value); - typedef typename UnaryT::subject_t type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// The get_unary_subject template function returns the parser object, which -// is used as the subject of an unary parser. -// If the parser under inspection is not an unary type parser the compilation -// will fail. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename UnaryT> -inline typename unary_subject<UnaryT>::type const & -get_unary_subject(UnaryT const &unary_) -{ - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_unary_composite<UnaryT>::value); - return unary_.subject(); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// The binary_left_subject and binary_right_subject templates can be used to -// return the types of the parsers used as the left and right subject of an -// binary parser. -// If the parser under inspection is not a binary type parser the compilation -// will fail. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename BinaryT> -struct binary_left_subject { - - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_binary_composite<BinaryT>::value); - typedef typename BinaryT::left_t type; -}; - -template <typename BinaryT> -struct binary_right_subject { - - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_binary_composite<BinaryT>::value); - typedef typename BinaryT::right_t type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// The get_binary_left_subject and get_binary_right_subject template functions -// return the parser object, which is used as the left or right subject of a -// binary parser. -// If the parser under inspection is not a binary type parser the compilation -// will fail. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename BinaryT> -inline typename binary_left_subject<BinaryT>::type const & -get_binary_left_subject(BinaryT const &binary_) -{ - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_binary_composite<BinaryT>::value); - return binary_.left(); -} - -template <typename BinaryT> -inline typename binary_right_subject<BinaryT>::type const & -get_binary_right_subject(BinaryT const &binary_) -{ - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_binary_composite<BinaryT>::value); - return binary_.right(); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// The action_subject template can be used to return the type of the -// parser used as the subject of an action parser. -// If the parser under inspection is not an action type parser the compilation -// will fail. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename ActionT> -struct action_subject { - - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_action_parser<ActionT>::value); - typedef typename ActionT::subject_t type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// The get_action_subject template function returns the parser object, which -// is used as the subject of an action parser. -// If the parser under inspection is not an action type parser the compilation -// will fail. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename ActionT> -inline typename action_subject<ActionT>::type const & -get_action_subject(ActionT const &action_) -{ - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_action_parser<ActionT>::value); - return action_.subject(); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// The semantic_action template can be used to return the type of the -// attached semantic action of an action parser. -// If the parser under inspection is not an action type parser the compilation -// will fail. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename ActionT> -struct semantic_action { - - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_action_parser<ActionT>::value); - typedef typename ActionT::predicate_t type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// The get_semantic_action template function returns the attached semantic -// action of an action parser. -// If the parser under inspection is not an action type parser the compilation -// will fail. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename ActionT> -inline typename semantic_action<ActionT>::type const & -get_semantic_action(ActionT const &action_) -{ - BOOST_STATIC_ASSERT(::BOOST_SPIRIT_CLASSIC_NS::is_action_parser<ActionT>::value); - return action_.predicate(); -} - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // !defined(BOOST_SPIRIT_PARSER_TRAITS_HPP) diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/refactoring.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/refactoring.hpp deleted file mode 100644 index fa45b01548..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/meta/refactoring.hpp +++ /dev/null @@ -1,287 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_REFACTORING_HPP -#define BOOST_SPIRIT_REFACTORING_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/static_assert.hpp> -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/meta/as_parser.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> -#include <boost/spirit/home/classic/meta/impl/refactoring.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// refactor_unary_parser class -// -// This helper template allows to attach an unary operation to a newly -// constructed parser, which combines the subject of the left operand of -// the original given parser (BinaryT) with the right operand of the -// original binary parser through the original binary operation and -// rewraps the resulting parser with the original unary operator. -// -// For instance given the parser: -// *some_parser - another_parser -// -// will be refactored to: -// *(some_parser - another_parser) -// -// If the parser to refactor is not a unary parser, no refactoring is done -// at all. -// -// The original parser should be a binary_parser_category parser, -// else the compilation will fail -// -/////////////////////////////////////////////////////////////////////////////// - -template <typename NestedT = non_nested_refactoring> -class refactor_unary_gen; - -template <typename BinaryT, typename NestedT = non_nested_refactoring> -class refactor_unary_parser : - public parser<refactor_unary_parser<BinaryT, NestedT> > { - -public: - // the parser to refactor has to be at least a binary_parser_category - // parser - BOOST_STATIC_ASSERT(( - boost::is_convertible<typename BinaryT::parser_category_t, - binary_parser_category>::value - )); - - refactor_unary_parser(BinaryT const& binary_, NestedT const& nested_) - : binary(binary_), nested(nested_) {} - - typedef refactor_unary_parser<BinaryT, NestedT> self_t; - typedef refactor_unary_gen<NestedT> parser_generator_t; - typedef typename BinaryT::left_t::parser_category_t parser_category_t; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - return impl::refactor_unary_type<NestedT>:: - parse(*this, scan, binary, nested); - } - -private: - typename as_parser<BinaryT>::type::embed_t binary; - typename NestedT::embed_t nested; -}; - -////////////////////////////////// -template <typename NestedT> -class refactor_unary_gen { - -public: - typedef refactor_unary_gen<NestedT> embed_t; - - refactor_unary_gen(NestedT const& nested_ = non_nested_refactoring()) - : nested(nested_) {} - - template <typename ParserT> - refactor_unary_parser<ParserT, NestedT> - operator[](parser<ParserT> const& subject) const - { - return refactor_unary_parser<ParserT, NestedT> - (subject.derived(), nested); - } - -private: - typename NestedT::embed_t nested; -}; - -const refactor_unary_gen<> refactor_unary_d = refactor_unary_gen<>(); - -/////////////////////////////////////////////////////////////////////////////// -// -// refactor_action_parser class -// -// This helper template allows to attach an action taken from the left -// operand of the given binary parser to a newly constructed parser, -// which combines the subject of the left operand of the original binary -// parser with the right operand of the original binary parser by means of -// the original binary operator parser. -// -// For instance the parser: -// some_parser[some_attached_functor] - another_parser -// -// will be refactored to: -// (some_parser - another_parser)[some_attached_functor] -// -// If the left operand to refactor is not an action parser, no refactoring -// is done at all. -// -// The original parser should be a binary_parser_category parser, -// else the compilation will fail -// -/////////////////////////////////////////////////////////////////////////////// - -template <typename NestedT = non_nested_refactoring> -class refactor_action_gen; - -template <typename BinaryT, typename NestedT = non_nested_refactoring> -class refactor_action_parser : - public parser<refactor_action_parser<BinaryT, NestedT> > { - -public: - // the parser to refactor has to be at least a binary_parser_category - // parser - BOOST_STATIC_ASSERT(( - boost::is_convertible<typename BinaryT::parser_category_t, - binary_parser_category>::value - )); - - refactor_action_parser(BinaryT const& binary_, NestedT const& nested_) - : binary(binary_), nested(nested_) {} - - typedef refactor_action_parser<BinaryT, NestedT> self_t; - typedef refactor_action_gen<NestedT> parser_generator_t; - typedef typename BinaryT::left_t::parser_category_t parser_category_t; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - return impl::refactor_action_type<NestedT>:: - parse(*this, scan, binary, nested); - } - -private: - typename as_parser<BinaryT>::type::embed_t binary; - typename NestedT::embed_t nested; -}; - -////////////////////////////////// -template <typename NestedT> -class refactor_action_gen { - -public: - typedef refactor_action_gen<NestedT> embed_t; - - refactor_action_gen(NestedT const& nested_ = non_nested_refactoring()) - : nested(nested_) {} - - template <typename ParserT> - refactor_action_parser<ParserT, NestedT> - operator[](parser<ParserT> const& subject) const - { - return refactor_action_parser<ParserT, NestedT> - (subject.derived(), nested); - } - -private: - typename NestedT::embed_t nested; -}; - -const refactor_action_gen<> refactor_action_d = refactor_action_gen<>(); - -/////////////////////////////////////////////////////////////////////////////// -// -// attach_action_parser class -// -// This helper template allows to attach an action given separately -// to all parsers, out of which the given parser is constructed and -// reconstructs a new parser having the same structure. -// -// For instance the parser: -// (some_parser >> another_parser)[some_attached_functor] -// -// will be refactored to: -// some_parser[some_attached_functor] -// >> another_parser[some_attached_functor] -// -// The original parser should be a action_parser_category parser, -// else the compilation will fail. -// -// If the parser, to which the action is attached is not an binary parser, -// no refactoring is done at all. -// -/////////////////////////////////////////////////////////////////////////////// - -template <typename NestedT = non_nested_refactoring> -class attach_action_gen; - -template <typename ActionT, typename NestedT = non_nested_refactoring> -class attach_action_parser : - public parser<attach_action_parser<ActionT, NestedT> > { - -public: - // the parser to refactor has to be at least a action_parser_category - // parser - BOOST_STATIC_ASSERT(( - boost::is_convertible<typename ActionT::parser_category_t, - action_parser_category>::value - )); - - attach_action_parser(ActionT const& actor_, NestedT const& nested_) - : actor(actor_), nested(nested_) {} - - typedef attach_action_parser<ActionT, NestedT> self_t; - typedef attach_action_gen<NestedT> parser_generator_t; - typedef typename ActionT::parser_category_t parser_category_t; - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - return impl::attach_action_type<NestedT>:: - parse(*this, scan, actor, nested); - } - -private: - typename as_parser<ActionT>::type::embed_t actor; - typename NestedT::embed_t nested; -}; - -////////////////////////////////// -template <typename NestedT> -class attach_action_gen { - -public: - typedef attach_action_gen<NestedT> embed_t; - - attach_action_gen(NestedT const& nested_ = non_nested_refactoring()) - : nested(nested_) {} - - template <typename ParserT, typename ActionT> - attach_action_parser<action<ParserT, ActionT>, NestedT> - operator[](action<ParserT, ActionT> const& actor) const - { - return attach_action_parser<action<ParserT, ActionT>, NestedT> - (actor, nested); - } - -private: - typename NestedT::embed_t nested; -}; - -const attach_action_gen<> attach_action_d = attach_action_gen<>(); - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif // BOOST_SPIRIT_REFACTORING_HPP - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix.hpp deleted file mode 100644 index c0aadd1743..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 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(BOOST_SPIRIT_PHOENIX_HPP) -#define BOOST_SPIRIT_PHOENIX_HPP - -#include <boost/spirit/home/classic/phoenix/tuples.hpp> -#include <boost/spirit/home/classic/phoenix/tuple_helpers.hpp> -#include <boost/spirit/home/classic/phoenix/actor.hpp> -#include <boost/spirit/home/classic/phoenix/primitives.hpp> -#include <boost/spirit/home/classic/phoenix/composite.hpp> -#include <boost/spirit/home/classic/phoenix/functions.hpp> -#include <boost/spirit/home/classic/phoenix/operators.hpp> -#include <boost/spirit/home/classic/phoenix/special_ops.hpp> -#include <boost/spirit/home/classic/phoenix/statements.hpp> -#include <boost/spirit/home/classic/phoenix/binders.hpp> -#include <boost/spirit/home/classic/phoenix/closures.hpp> -#include <boost/spirit/home/classic/phoenix/casts.hpp> -#include <boost/spirit/home/classic/phoenix/new.hpp> - -#endif // !defined(BOOST_SPIRIT_PHOENIX_HPP) diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/actor.hpp deleted file mode 100644 index 340159b187..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/actor.hpp +++ /dev/null @@ -1,605 +0,0 @@ -/*============================================================================= - Phoenix v1.2 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_ACTOR_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_ACTOR_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/tuples.hpp> -#include <boost/type_traits/remove_reference.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -// These are forward declared here because we cannot include impl.hpp -// or operators.hpp yet but the actor's assignment operator and index -// operator are required to be members. - -////////////////////////////////// -struct assign_op; -struct index_op; - -////////////////////////////////// -namespace impl { - - template <typename OperationT, typename BaseT, typename B> - struct make_binary1; -} - -/////////////////////////////////////////////////////////////////////////////// -// -// unpack_tuple class -// -// This class is used to unpack a supplied tuple such, that the members of -// this tuple will be handled as if they would be supplied separately. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename TupleT> -struct unpack_tuple : public TupleT { - - typedef TupleT tuple_t; - - unpack_tuple() {} - unpack_tuple(tuple_t const &tuple_) : TupleT(tuple_) {} -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// actor class -// -// This class is a protocol class for all actors. This class is -// essentially an interface contract. The actor class does not -// really know how how to act on anything but instead relies on the -// template parameter BaseT (from which the actor will derive from) -// to do the actual action. -// -// An actor is a functor that is capable of accepting arguments up -// to a predefined maximum. It is up to the base class to do the -// actual processing or possibly to limit the arity (no. of -// arguments) passed in. Upon invocation of the functor through a -// supplied operator(), the actor funnels the arguments passed in -// by the client into a tuple and calls the base eval member -// function. -// -// Schematically: -// -// arg0 ---------| -// arg1 ---------| -// arg2 ---------|---> tupled_args ---> base.eval -// ... | -// argN ---------| -// -// actor::operator()(arg0, arg1... argN) -// ---> BaseT::eval(tupled_args); -// -// Actor base classes from which this class inherits from are -// expected to have a corresponding member function eval compatible -// with the conceptual Interface: -// -// template <typename TupleT> -// actor_return_type -// eval(TupleT const& args) const; -// -// where args are the actual arguments passed in by the client -// funneled into a tuple (see tuple.hpp for details). -// -// The actor_return_type can be anything. Base classes are free to -// return any type, even argument dependent types (types that are -// deduced from the types of the arguments). After evaluating the -// parameters and doing some computations or actions, the eval -// member function concludes by returning something back to the -// client. To do this, the forwarding function (the actor's -// operator()) needs to know the return type of the eval member -// function that it is calling. For this purpose, actor base -// classes are required to provide a nested template class: -// -// template <typename TupleT> -// struct result; -// -// This auxiliary class provides the result type information -// returned by the eval member function of a base actor class. The -// nested template class result should have a typedef 'type' that -// reflects the return type of its member function eval. It is -// basically a type computer that answers the question "given -// arguments packed into a TupleT type, what will be the result -// type of the eval member function of ActorT?". The template class -// actor_result queries this to extract the return type of an -// actor. Example: -// -// typedef typename actor_result<ActorT, TupleT>::type -// actor_return_type; -// -// where actor_return_type is the actual type returned by ActorT's -// eval member function given some arguments in a TupleT. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename ActorT, typename TupleT> -struct actor_result { - - typedef typename ActorT::template result<TupleT>::type type; - typedef typename boost::remove_reference<type>::type plain_type; -}; - -////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#endif - -template <typename BaseT> -struct actor : public BaseT { - - actor(); - actor(BaseT const& base); - - typename actor_result<BaseT, tuple<> >::type - operator()() const; - - template <typename A> - typename actor_result<BaseT, tuple<A&> >::type - operator()(A& a) const; - - template <typename A, typename B> - typename actor_result<BaseT, tuple<A&, B&> >::type - operator()(A& a, B& b) const; - - template <typename A, typename B, typename C> - typename actor_result<BaseT, tuple<A&, B&, C&> >::type - operator()(A& a, B& b, C& c) const; - -#if PHOENIX_LIMIT > 3 - template <typename A, typename B, typename C, typename D> - typename actor_result<BaseT, tuple<A&, B&, C&, D&> >::type - operator()(A& a, B& b, C& c, D& d) const; - - template <typename A, typename B, typename C, typename D, typename E> - typename actor_result<BaseT, tuple<A&, B&, C&, D&, E&> >::type - operator()(A& a, B& b, C& c, D& d, E& e) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F> - typename actor_result<BaseT, tuple<A&, B&, C&, D&, E&, F&> >::type - operator()(A& a, B& b, C& c, D& d, E& e, F& f) const; - -#if PHOENIX_LIMIT > 6 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G> - typename actor_result<BaseT, tuple<A&, B&, C&, D&, E&, F&, G&> >::type - operator()(A& a, B& b, C& c, D& d, E& e, F& f, G& g) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H> - typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&> - >::type - operator()(A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I> - typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&> - >::type - operator()(A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h, I& i) const; - -#if PHOENIX_LIMIT > 9 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J> - typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&> - >::type - operator()( - A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h, I& i, J& j) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K> - typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&> - >::type - operator()( - A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h, I& i, J& j, - K& k) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L> - typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&> - >::type - operator()( - A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h, I& i, J& j, - K& k, L& l) const; - -#if PHOENIX_LIMIT > 12 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M> - typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&> - >::type - operator()( - A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h, I& i, J& j, - K& k, L& l, M& m) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N> - typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&, N&> - >::type - operator()( - A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h, I& i, J& j, - K& k, L& l, M& m, N& n) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O> - typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&, N&, O&> - >::type - operator()( - A& a, B& b, C& c, D& d, E& e, F& f, G& g, H& h, I& i, J& j, - K& k, L& l, M& m, N& n, O& o) const; - -#endif -#endif -#endif -#endif - - template <typename TupleT> - typename actor_result<BaseT, unpack_tuple<TupleT> >::type - operator()(unpack_tuple<TupleT> const &t) const; - - template <typename B> - typename impl::make_binary1<assign_op, BaseT, B>::type - operator=(B const& b) const; - - template <typename B> - typename impl::make_binary1<index_op, BaseT, B>::type - operator[](B const& b) const; -}; - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif - -/////////////////////////////////////////////////////////////////////////// -// -// as_actor -// -// as_actor is a meta-program that converts an arbitrary type into -// an actor. All participants in the framework must be first-class -// actors. This meta-program is used all throughout the framework -// whenever an unknown type needs to be converted to an actor. -// as_actor specializations are expected to have a typedef 'type'. -// This is the destination actor type. A static member function -// 'convert' converts an object to this target type. -// -// The meta-program does no conversion if the object to be -// converted is already an actor. -// -/////////////////////////////////////////////////////////////////////////// -template <typename T> -struct as_actor; - -////////////////////////////////// -template <typename BaseT> -struct as_actor<actor<BaseT> > { - - typedef actor<BaseT> type; - static type convert(actor<BaseT> const& x) { return x; } -}; - -////////////////////////////////// -template <> -struct as_actor<nil_t> { - - typedef nil_t type; - static nil_t convert(nil_t /*x*/) - { return nil_t(); } -}; - -////////////////////////////////// -template <> -struct as_actor<void> { - - typedef void type; - // ERROR!!! -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// actor class implementation -// -/////////////////////////////////////////////////////////////////////////////// -template <typename BaseT> -actor<BaseT>::actor() -: BaseT() {} - -////////////////////////////////// -template <typename BaseT> -actor<BaseT>::actor(BaseT const& base) -: BaseT(base) {} - -////////////////////////////////// -template <typename BaseT> -inline typename actor_result<BaseT, tuple<> >::type -actor<BaseT>::operator()() const -{ - return BaseT::eval(tuple<>()); -} - -////////////////////////////////// -template <typename BaseT> -template <typename A> -inline typename actor_result<BaseT, tuple<A&> >::type -actor<BaseT>::operator()(A& a_) const -{ - return BaseT::eval(tuple<A&>(a_)); -} - -////////////////////////////////// -template <typename BaseT> -template <typename A, typename B> -inline typename actor_result<BaseT, tuple<A&, B&> >::type -actor<BaseT>::operator()(A& a_, B& b_) const -{ - return BaseT::eval(tuple<A&, B&>(a_, b_)); -} - -////////////////////////////////// -template <typename BaseT> -template <typename A, typename B, typename C> -inline typename actor_result<BaseT, tuple<A&, B&, C&> >::type -actor<BaseT>::operator()(A& a_, B& b_, C& c_) const -{ - return BaseT::eval(tuple<A&, B&, C&>(a_, b_, c_)); -} - -#if PHOENIX_LIMIT > 3 -////////////////////////////////// -template <typename BaseT> -template <typename A, typename B, typename C, typename D> -inline typename actor_result<BaseT, tuple<A&, B&, C&, D&> >::type -actor<BaseT>::operator()(A& a_, B& b_, C& c_, D& d_) const -{ - return BaseT::eval(tuple<A&, B&, C&, D&>(a_, b_, c_, d_)); -} - -////////////////////////////////// -template <typename BaseT> -template <typename A, typename B, typename C, typename D, typename E> -inline typename actor_result<BaseT, tuple<A&, B&, C&, D&, E&> >::type -actor<BaseT>::operator()(A& a_, B& b_, C& c_, D& d_, E& e_) const -{ - return BaseT::eval(tuple<A&, B&, C&, D&, E&>(a_, b_, c_, d_, e_)); -} - -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&> - (a_, b_, c_, d_, e_, f_) - ); -} - -#if PHOENIX_LIMIT > 6 -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&> - (a_, b_, c_, d_, e_, f_, g_) - ); -} - -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_, H& h_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&, H&> - (a_, b_, c_, d_, e_, f_, g_, h_) - ); -} - -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_, H& h_, I& i_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&> - (a_, b_, c_, d_, e_, f_, g_, h_, i_) - ); -} - -#if PHOENIX_LIMIT > 9 -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_, H& h_, I& i_, J& j_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&> - (a_, b_, c_, d_, e_, f_, g_, h_, i_, j_) - ); -} - -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_, H& h_, I& i_, J& j_, - K& k_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&> - (a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_) - ); -} - -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_, H& h_, I& i_, J& j_, - K& k_, L& l_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&> - (a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_) - ); -} - -#if PHOENIX_LIMIT > 12 -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_, H& h_, I& i_, J& j_, - K& k_, L& l_, M& m_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&> - (a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_) - ); -} - -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&, N&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_, H& h_, I& i_, J& j_, - K& k_, L& l_, M& m_, N& n_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&, N&> - (a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_) - ); -} - -////////////////////////////////// -template <typename BaseT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O> -inline typename actor_result<BaseT, - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&, N&, O&> ->::type -actor<BaseT>::operator()( - A& a_, B& b_, C& c_, D& d_, E& e_, F& f_, G& g_, H& h_, I& i_, J& j_, - K& k_, L& l_, M& m_, N& n_, O& o_ -) const -{ - return BaseT::eval( - tuple<A&, B&, C&, D&, E&, F&, G&, H&, I&, J&, K&, L&, M&, N&, O&> - (a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_, o_) - ); -} - -#endif -#endif -#endif -#endif - -////////////////////////////////// -template <typename BaseT> -template <typename TupleT> -typename actor_result<BaseT, unpack_tuple<TupleT> >::type -actor<BaseT>::operator()(unpack_tuple<TupleT> const &t) const -{ - return BaseT::eval(t); -} - -/////////////////////////////////////////////////////////////////////////////// -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/binders.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/binders.hpp deleted file mode 100644 index e75dafb969..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/binders.hpp +++ /dev/null @@ -1,4066 +0,0 @@ -/*============================================================================= - Phoenix v1.2 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_BINDERS_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_BINDERS_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/functions.hpp> -#include <boost/type_traits/is_const.hpp> -#include <boost/mpl/if.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -/////////////////////////////////////////////////////////////////////////////// -// -// Binders -// -// There are times when it is desirable to bind a simple functor, -// function, member function or member variable for deferred -// evaluation. This can be done through the binding facilities -// provided below. There are template classes: -// -// 1) function_ptr ( function pointer binder ) -// 2) functor ( functor pointer binder ) -// 3) member_function_ptr ( member function pointer binder ) -// 4) member_var_ptr ( member variable pointer binder ) -// -// These template classes are specialized lazy function classes for -// functors, function pointers, member function pointers and member -// variable pointers, respectively. These are subclasses of the -// lazy-function class (see functions.hpp). Each of these has a -// corresponding overloaded bind(x) function. Each bind(x) function -// generates a suitable binder object. -// -// Example, given a function foo: -// -// void foo_(int n) { std::cout << n << std::endl; } -// -// Here's how the function foo is bound: -// -// bind(&foo_) -// -// This bind expression results to a lazy-function (see -// functions.hpp) that is lazily evaluated. This bind expression is -// also equivalent to: -// -// function_ptr<void, int> foo = &foo_; -// -// The template parameter of the function_ptr is the return and -// argument types of actual signature of the function to be bound -// read from left to right: -// -// void foo_(int); ---> function_ptr<void, int> -// -// Either bind(&foo_) and its equivalent foo can now be used in the -// same way a lazy function (see functions.hpp) is used: -// -// bind(&foo_)(arg1) -// -// or -// -// foo(arg1) -// -// The latter, of course, being much easier to understand. This is -// now a full-fledged lazy function that can finally be evaluated -// by another function call invocation. A second function call will -// invoke the actual foo function: -// -// int i = 4; -// foo(arg1)(i); -// -// will print out "4". -// -// Binding functors and member functions can be done similarly. -// Here's how to bind a functor (e.g. std::plus<int>): -// -// bind(std::plus<int>()) -// -// or -// -// functor<std::plus<int> > plus; -// -// Again, these are full-fledged lazy functions. In this case, -// unlike the first example, expect 2 arguments (std::plus<int> -// needs two arguments lhs and rhs). Either or both of which can be -// lazily bound: -// -// plus(arg1, arg2) // arg1 + arg2 -// plus(100, arg1) // 100 + arg1 -// plus(100, 200) // 300 -// -// A bound member function takes in a pointer or reference to an -// object as the first argument. For instance, given: -// -// struct xyz { void foo(int) const; }; -// -// xyz's foo member function can be bound as: -// -// bind(&xyz::foo) -// -// or -// -// member_function_ptr<void, xyz, int> xyz_foo = &xyz::foo; -// -// The template parameter of the member_function_ptr is the return, -// class and argument types of actual signature of the function to -// be bound read from left to right: -// -// void xyz::foo_(int); ---> member_function_ptr<void, xyz, int> -// -// Take note that a member_function_ptr lazy-function expects the -// first argument to be a pointer or reference to an object. Both -// the object (reference or pointer) and the arguments can be -// lazily bound. Examples: -// -// xyz obj; -// xyz_foo(arg1, arg2) // arg1.foo(arg2) -// xyz_foo(obj, arg1) // obj.foo(arg1) -// xyz_foo(obj, 100) // obj.foo(100) -// -// Be reminded that var(obj) must be used to call non-const member -// functions. For example, if xyz was declared as: -// -// struct xyz { void foo(int); }; -// -// the pointer or reference to the object must also be non-const. -// Lazily bound arguments are stored as const value by default (see -// variable class in primitives.hpp). -// -// xyz_foo(var(obj), 100) // obj.foo(100) -// -// Finally, member variables can be bound much like member -// functions. For instance, given: -// -// struct xyz { int v; }; -// -// xyz::v can be bound as: -// -// bind(&xyz::v) -// or -// -// member_var_ptr<int, xyz> xyz_v = &xyz::v; -// -// The template parameter of the member_var_ptr is the type of the -// variable followed by the class: -// -// int xyz::v; ---> member_var_ptr<int, xyz> -// -// Just like the member_function_ptr, member_var_ptr also expects -// the first argument to be a pointer or reference to an object. -// Both the object (reference or pointer) and the arguments can be -// lazily bound. Examples: -// -// xyz obj; -// xyz_v(arg1) // arg1.v -// xyz_v(obj) // obj.v -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// -// Functor binder -// -/////////////////////////////////////////////////////////////////////////////// -template <typename FuncT> -struct functor_action : public FuncT { - -#if !defined(BOOST_BORLANDC) && (!defined(__MWERKS__) || (__MWERKS__ > 0x3002)) - - template < - typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif - > - struct result { typedef typename FuncT::result_type type; }; -#endif - - functor_action(FuncT fptr_ = FuncT()) - : FuncT(fptr_) {} -}; - -#if defined(BOOST_BORLANDC) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002)) - -/////////////////////////////////////////////////////////////////////////////// -// -// The following specializations are needed because Borland and CodeWarrior -// does not accept default template arguments in nested template classes in -// classes (i.e functor_action::result) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename FuncT, typename TupleT> -struct composite0_result<functor_action<FuncT>, TupleT> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A> -struct composite1_result<functor_action<FuncT>, TupleT, A> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B> -struct composite2_result<functor_action<FuncT>, TupleT, A, B> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C> -struct composite3_result<functor_action<FuncT>, TupleT, A, B, C> { - - typedef typename FuncT::result_type type; -}; - -#if PHOENIX_LIMIT > 3 -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D> -struct composite4_result<functor_action<FuncT>, TupleT, - A, B, C, D> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E> -struct composite5_result<functor_action<FuncT>, TupleT, - A, B, C, D, E> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F> -struct composite6_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F> { - - typedef typename FuncT::result_type type; -}; - -#if PHOENIX_LIMIT > 6 -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G> -struct composite7_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H> -struct composite8_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G, H> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I> -struct composite9_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G, H, I> { - - typedef typename FuncT::result_type type; -}; - -#if PHOENIX_LIMIT > 9 -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J> -struct composite10_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G, H, I, J> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K> -struct composite11_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G, H, I, J, K> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L> -struct composite12_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L> { - - typedef typename FuncT::result_type type; -}; - -#if PHOENIX_LIMIT > 12 -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M> -struct composite13_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N> -struct composite14_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N> { - - typedef typename FuncT::result_type type; -}; - -////////////////////////////////// -template <typename FuncT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O> -struct composite15_result<functor_action<FuncT>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> { - - typedef typename FuncT::result_type type; -}; - -#endif -#endif -#endif -#endif -#endif - -////////////////////////////////// -template <typename FuncT> -struct functor : public function<functor_action<FuncT> > { - - functor(FuncT func) - : function<functor_action<FuncT> >(functor_action<FuncT>(func)) {}; -}; - -////////////////////////////////// -template <typename FuncT> -inline functor<FuncT> -bind(FuncT func) -{ - return functor<FuncT>(func); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member variable pointer binder -// -/////////////////////////////////////////////////////////////////////////////// -namespace impl { - - ////////////////////////////////// - template <typename T> - struct as_ptr { - - typedef T* pointer_type; - - static T* get(T& ref) - { return &ref; } - }; - - ////////////////////////////////// - template <typename T> - struct as_ptr<T*> { - - typedef T* pointer_type; - - static T* get(T* ptr) - { return ptr; } - }; -} - -////////////////////////////////// -template <typename ActionT, typename ClassT> -struct member_var_ptr_action_result { - - typedef typename ActionT::template result<ClassT>::type type; -}; - -////////////////////////////////// -template <typename T, typename ClassT> -struct member_var_ptr_action { - - typedef member_var_ptr_action<T, ClassT> self_t; - - template <typename CT> - struct result { - typedef typename boost::mpl::if_<boost::is_const<CT>, T const&, T& - >::type type; - }; - - typedef T ClassT::*mem_var_ptr_t; - - member_var_ptr_action(mem_var_ptr_t ptr_) - : ptr(ptr_) {} - - template <typename CT> - typename member_var_ptr_action_result<self_t, CT>::type - operator()(CT& obj) const - { return impl::as_ptr<CT>::get(obj)->*ptr; } - - mem_var_ptr_t ptr; -}; - -////////////////////////////////// -template <typename T, typename ClassT> -struct member_var_ptr -: public function<member_var_ptr_action<T, ClassT> > { - - member_var_ptr(T ClassT::*mp) - : function<member_var_ptr_action<T, ClassT> > - (member_var_ptr_action<T, ClassT>(mp)) {} -}; - -////////////////////////////////// -template <typename T, typename ClassT> -inline member_var_ptr<T, ClassT> -bind(T ClassT::*mp) -{ - return member_var_ptr<T, ClassT>(mp); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (main class) -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename RT - , typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif - - , typename NU = nil_t // Not used -> -struct function_ptr_action; - -////////////////////////////////// -template < - typename RT - , typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif -> -struct function_ptr -: public function<function_ptr_action<RT - , A, B, C -#if PHOENIX_LIMIT > 3 - , D, E, F -#if PHOENIX_LIMIT > 6 - , G, H, I -#if PHOENIX_LIMIT > 9 - , J, K, L -#if PHOENIX_LIMIT > 12 - , M, N, O -#endif -#endif -#endif -#endif - > > { - - typedef function_ptr_action<RT - , A, B, C -#if PHOENIX_LIMIT > 3 - , D, E, F -#if PHOENIX_LIMIT > 6 - , G, H, I -#if PHOENIX_LIMIT > 9 - , J, K, L -#if PHOENIX_LIMIT > 12 - , M, N, O -#endif -#endif -#endif -#endif - > action_t; - - template <typename FPT> - function_ptr(FPT fp) - : function<action_t>(action_t(fp)) {} -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 0 arg) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT> -struct function_ptr_action<RT, - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(); - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()() const - { return fptr(); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT> -inline function_ptr<RT> -bind(RT(*fptr)()) -{ - return function_ptr<RT>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 1 arg) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename A> -struct function_ptr_action<RT, - A, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A); - - template <typename A_> - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()(A a) const - { return fptr(a); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename A> -inline function_ptr<RT, A> -bind(RT(*fptr)(A)) -{ - return function_ptr<RT, A>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 2 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename A, typename B> -struct function_ptr_action<RT, - A, B, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B); - - template <typename A_, typename B_> - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()(A a, B b) const - { return fptr(a, b); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename A, typename B> -inline function_ptr<RT, A, B> -bind(RT(*fptr)(A, B)) -{ - return function_ptr<RT, A, B>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 3 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename A, typename B, typename C> -struct function_ptr_action<RT, - A, B, C, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C); - - template <typename A_, typename B_, typename C_> - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()(A a, B b, C c) const - { return fptr(a, b, c); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename A, typename B, typename C> -inline function_ptr<RT, A, B, C> -bind(RT(*fptr)(A, B, C)) -{ - return function_ptr<RT, A, B, C>(fptr); -} - -#if PHOENIX_LIMIT > 3 -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 4 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename A, typename B, typename C, typename D> -struct function_ptr_action<RT, - A, B, C, D, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D); - - template <typename A_, typename B_, typename C_, typename D_> - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()(A a, B b, C c, D d) const - { return fptr(a, b, c, d); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename A, typename B, typename C, typename D> -inline function_ptr<RT, A, B, C, D> -bind(RT(*fptr)(A, B, C, D)) -{ - return function_ptr<RT, A, B, C, D>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 5 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E -> -struct function_ptr_action<RT, - A, B, C, D, E, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e - ) const - { return fptr(a, b, c, d, e); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E -> -inline function_ptr<RT, A, B, C, D, E> -bind(RT(*fptr)(A, B, C, D, E)) -{ - return function_ptr<RT, A, B, C, D, E>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 6 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F -> -struct function_ptr_action<RT, - A, B, C, D, E, F, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f - ) const - { return fptr(a, b, c, d, e, f); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F -> -inline function_ptr<RT, A, B, C, D, E, F> -bind(RT(*fptr)(A, B, C, D, E, F)) -{ - return function_ptr<RT, A, B, C, D, E, F>(fptr); -} - -#if PHOENIX_LIMIT > 6 -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 7 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g - ) const - { return fptr(a, b, c, d, e, f, g); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G -> -inline function_ptr<RT, A, B, C, D, E, F, G> -bind(RT(*fptr)(A, B, C, D, E, F, G)) -{ - return function_ptr<RT, A, B, C, D, E, F, G>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 8 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, H, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_, typename H_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g, H h - ) const - { return fptr(a, b, c, d, e, f, g, h); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H -> -inline function_ptr<RT, A, B, C, D, E, F, G, H> -bind(RT(*fptr)(A, B, C, D, E, F, G, H)) -{ - return function_ptr<RT, A, B, C, D, E, F, G, H>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 9 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, H, I, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_, typename H_, typename I_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g, H h, I i - ) const - { return fptr(a, b, c, d, e, f, g, h, i); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I -> -inline function_ptr<RT, A, B, C, D, E, F, G, H, I> -bind(RT(*fptr)(A, B, C, D, E, F, G, H, I)) -{ - return function_ptr<RT, A, B, C, D, E, F, G, H, I>(fptr); -} - -#if PHOENIX_LIMIT > 9 -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 10 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_, typename H_, typename I_, typename J_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g, H h, I i, J j - ) const - { return fptr(a, b, c, d, e, f, g, h, i, j); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J -> -inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J> -bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J)) -{ - return function_ptr<RT, A, B, C, D, E, F, G, H, I, J>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 11 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, H, I, J, K, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_, typename H_, typename I_, typename J_, - typename K_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g, H h, I i, J j, - K k - ) const - { return fptr(a, b, c, d, e, f, g, h, i, j, k); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K -> -inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K> -bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K)) -{ - return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 12 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, H, I, J, K, L, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K, L); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_, typename H_, typename I_, typename J_, - typename K_, typename L_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g, H h, I i, J j, - K k, L l - ) const - { return fptr(a, b, c, d, e, f, g, h, i, j, k, l); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L -> -inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L> -bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K, L)) -{ - return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L>(fptr); -} - -#if PHOENIX_LIMIT > 12 -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 13 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K, L, M); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_, typename H_, typename I_, typename J_, - typename K_, typename L_, typename M_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g, H h, I i, J j, - K k, L l, M m - ) const - { return fptr(a, b, c, d, e, f, g, h, i, j, k, l, m); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M -> -inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M> -bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M)) -{ - return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 14 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K, L, M, N); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_, typename H_, typename I_, typename J_, - typename K_, typename L_, typename M_, typename N_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g, H h, I i, J j, - K k, L l, M m, N n - ) const - { return fptr(a, b, c, d, e, f, g, h, i, j, k, l, m, n); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N -> -inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M, N> -bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -{ - return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Function pointer binder (specialization for 15 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O -> -struct function_ptr_action<RT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t> { - - typedef RT result_type; - typedef RT(*func_ptr_t)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); - - template < - typename A_, typename B_, typename C_, typename D_, typename E_, - typename F_, typename G_, typename H_, typename I_, typename J_, - typename K_, typename L_, typename M_, typename N_, typename O_ - > - struct result { typedef result_type type; }; - - function_ptr_action(func_ptr_t fptr_) - : fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, - F f, G g, H h, I i, J j, - K k, L l, M m, N n, O o - ) const - { return fptr(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); } - - func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O -> -inline function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> -bind(RT(*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -{ - return function_ptr<RT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(fptr); -} - -#endif -#endif -#endif -#endif -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (main class) -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename RT, - typename ClassT - , typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif - - , typename NU = nil_t // Not used -> -struct member_function_ptr_action; - -////////////////////////////////// -template < - typename RT, - typename ClassT - , typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif -> -struct member_function_ptr -: public function<member_function_ptr_action<RT, ClassT - , A, B, C -#if PHOENIX_LIMIT > 3 - , D, E, F -#if PHOENIX_LIMIT > 6 - , G, H, I -#if PHOENIX_LIMIT > 9 - , J, K, L -#if PHOENIX_LIMIT > 12 - , M, N, O -#endif -#endif -#endif -#endif - > > { - - typedef member_function_ptr_action<RT, ClassT - , A, B, C -#if PHOENIX_LIMIT > 3 - , D, E, F -#if PHOENIX_LIMIT > 6 - , G, H, I -#if PHOENIX_LIMIT > 9 - , J, K, L -#if PHOENIX_LIMIT > 12 - , M, N, O -#endif -#endif -#endif -#endif - > action_t; - - template <typename FPT> - member_function_ptr(FPT fp) - : function<action_t>(action_t(fp)) {} -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 0 arg) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT> -struct member_function_ptr_action<RT, ClassT, - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(); - typedef RT(ClassT::*cmf)() const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT> - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT> -inline member_function_ptr<RT, ClassT> -bind(RT(ClassT::*fptr)()) -{ - return member_function_ptr<RT, ClassT>(fptr); -} - -template <typename RT, typename ClassT> -inline member_function_ptr<RT, ClassT const> -bind(RT(ClassT::*fptr)() const) -{ - return member_function_ptr<RT, ClassT const>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 1 arg) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, typename A> -struct member_function_ptr_action<RT, ClassT, - A, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A); - typedef RT(ClassT::*cmf)(A) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, typename A_> - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, A a) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, typename A> -inline member_function_ptr<RT, ClassT, A> -bind(RT(ClassT::*fptr)(A)) -{ - return member_function_ptr<RT, ClassT, A>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, typename A> -inline member_function_ptr<RT, ClassT const, A> -bind(RT(ClassT::*fptr)(A) const) -{ - return member_function_ptr<RT, ClassT const, A>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 2 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B> -struct member_function_ptr_action<RT, ClassT, - A, B, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B); - typedef RT(ClassT::*cmf)(A, B) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, typename A_, typename B_> - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, A a, B b) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B> -inline member_function_ptr<RT, ClassT, A, B> -bind(RT(ClassT::*fptr)(A, B)) -{ - return member_function_ptr<RT, ClassT, A, B>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B> -inline member_function_ptr<RT, ClassT const, A, B> -bind(RT(ClassT::*fptr)(A, B) const) -{ - return member_function_ptr<RT, ClassT const, A, B>(fptr); -} - -#if PHOENIX_LIMIT > 3 -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 3 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B, typename C> -struct member_function_ptr_action<RT, ClassT, - A, B, C, nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C); - typedef RT(ClassT::*cmf)(A, B, C) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, typename A_, typename B_, typename C_> - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, A a, B b, C c) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B, typename C> -inline member_function_ptr<RT, ClassT, A, B, C> -bind(RT(ClassT::*fptr)(A, B, C)) -{ - return member_function_ptr<RT, ClassT, A, B, C>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B, typename C> -inline member_function_ptr<RT, ClassT const, A, B, C> -bind(RT(ClassT::*fptr)(A, B, C) const) -{ - return member_function_ptr<RT, ClassT const, A, B, C>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 4 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D); - typedef RT(ClassT::*cmf)(A, B, C, D) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d - ) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D -> -inline member_function_ptr<RT, ClassT, A, B, C, D> -bind(RT(ClassT::*fptr)(A, B, C, D)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D -> -inline member_function_ptr<RT, ClassT const, A, B, C, D> -bind(RT(ClassT::*fptr)(A, B, C, D) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 5 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E); - typedef RT(ClassT::*cmf)(A, B, C, D, E) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e - ) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E> -bind(RT(ClassT::*fptr)(A, B, C, D, E)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E> -bind(RT(ClassT::*fptr)(A, B, C, D, E) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E>(fptr); -} - -#if PHOENIX_LIMIT > 6 -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 6 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f - ) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e, f); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 7 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g - ) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e, f, g); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 8 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, H, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g, H h - ) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e, f, g, h); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G, H>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G, H>(fptr); -} - -#if PHOENIX_LIMIT > 9 -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 9 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g, H h, I i - ) const - { return (impl::as_ptr<CT>::get(obj)->*fptr)(a, b, c, d, e, f, g, h, i); } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G, H, I>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G, H, I>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 10 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j - ) const - { - return (impl::as_ptr<CT>::get(obj)->*fptr) - (a, b, c, d, e, f, g, h, i, j); - } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G, H, I, J>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 11 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k - ) const - { - return (impl::as_ptr<CT>::get(obj)->*fptr) - (a, b, c, d, e, f, g, h, i, j, k); - } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K>(fptr); -} - -#if PHOENIX_LIMIT > 12 -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 12 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, L, nil_t, nil_t, nil_t, nil_t> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_, typename L_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l - ) const - { - return (impl::as_ptr<CT>::get(obj)->*fptr) - (a, b, c, d, e, f, g, h, i, j, k, l); - } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 13 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_, typename L_, typename M_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m - ) const - { - return (impl::as_ptr<CT>::get(obj)->*fptr) - (a, b, c, d, e, f, g, h, i, j, k, l, m); - } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 14 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_, typename L_, typename M_, typename N_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n - ) const - { - return (impl::as_ptr<CT>::get(obj)->*fptr) - (a, b, c, d, e, f, g, h, i, j, k, l, m, n); - } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Member function pointer binder (specialization for 15 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N, - typename O -> -struct member_function_ptr_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT, - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_, typename L_, typename M_, typename N_, - typename O_ - > - struct result { typedef result_type type; }; - - member_function_ptr_action(mem_func_ptr_t fptr_) - : fptr(fptr_) {} - - template <typename CT> - result_type operator()(CT& obj, - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n, O o - ) const - { - return (impl::as_ptr<CT>::get(obj)->*fptr) - (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); - } - - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N, - typename O -> -inline member_function_ptr<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -{ - return member_function_ptr< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N, - typename O -> -inline member_function_ptr<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> -bind(RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const) -{ - return member_function_ptr< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(fptr); -} - -#endif -#endif -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (main class) -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename RT, - typename ClassT - , typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif - - , typename NU = nil_t // Not used -> -struct bound_member_action; - -////////////////////////////////// -template < - typename RT, - typename ClassT - , typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif -> -struct bound_member -: public function<bound_member_action<RT, ClassT - , A, B, C -#if PHOENIX_LIMIT > 3 - , D, E, F -#if PHOENIX_LIMIT > 6 - , G, H, I -#if PHOENIX_LIMIT > 9 - , J, K, L -#if PHOENIX_LIMIT > 12 - , M, N, O -#endif -#endif -#endif -#endif - > > { - - typedef bound_member_action<RT, ClassT - , A, B, C -#if PHOENIX_LIMIT > 3 - , D, E, F -#if PHOENIX_LIMIT > 6 - , G, H, I -#if PHOENIX_LIMIT > 9 - , J, K, L -#if PHOENIX_LIMIT > 12 - , M, N, O -#endif -#endif -#endif -#endif - > action_t; - - template <typename CT, typename FPT> - bound_member(CT & c, FPT fp) - : function<action_t>(action_t(c,fp)) {} - -#if !defined(BOOST_BORLANDC) - template <typename CT, typename FPT> - bound_member(CT * c, FPT fp) - : function<action_t>(action_t(c,fp)) {} -#endif -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 0 arg) -// -/////////////////////////////////////////////////////////////////////////////// - -template <typename RT, typename ClassT> -struct bound_member_action<RT, ClassT, - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(); - typedef RT(ClassT::*cmf)() const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename CT> - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()() const - { return (obj->*fptr)(); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// - -template <typename RT, typename ClassT> -inline bound_member<RT,ClassT> -bind(ClassT & obj, RT(ClassT::*fptr)()) -{ - return bound_member<RT,ClassT>(obj, fptr); -} - -template <typename RT, typename ClassT> -inline bound_member<RT,ClassT> -bind(ClassT * obj, RT(ClassT::*fptr)()) -{ -#if defined(__MWERKS__) && (__MWERKS__ < 0x3003) - return bound_member<RT,ClassT>(*obj, fptr); -#else - return bound_member<RT,ClassT>(obj, fptr); -#endif -} - -template <typename RT, typename ClassT> -inline bound_member<RT,ClassT const> -bind(ClassT const& obj, RT(ClassT::*fptr)()) -{ - return bound_member<RT,ClassT const>(obj, fptr); -} - -template <typename RT, typename ClassT> -inline bound_member<RT,ClassT const> -bind(ClassT const* obj, RT(ClassT::*fptr)() const) -{ -#if defined(__MWERKS__) && (__MWERKS__ < 0x3003) - return bound_member<RT,ClassT const>(*obj, fptr); -#else - return bound_member<RT,ClassT const>(obj, fptr); -#endif -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 1 arg) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, typename A> -struct bound_member_action<RT, ClassT, - A, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A); - typedef RT(ClassT::*cmf)(A) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename A_> - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()(A a) const - { return (obj->*fptr)(a); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, typename A> -inline bound_member<RT, ClassT, A> -bind(ClassT & obj, RT(ClassT::*fptr)(A)) -{ - return bound_member<RT, ClassT, A>(obj,fptr); -} - -template <typename RT, typename ClassT, typename A> -inline bound_member<RT, ClassT, A> -bind(ClassT * obj, RT(ClassT::*fptr)(A)) -{ - return bound_member<RT, ClassT, A>(obj,fptr); -} - -////////////////////////////////// -template <typename RT, typename ClassT, typename A> -inline bound_member<RT, ClassT const, A> -bind(ClassT const& obj, RT(ClassT::*fptr)(A) const) -{ - return bound_member<RT, ClassT const, A>(obj,fptr); -} - -template <typename RT, typename ClassT, typename A> -inline bound_member<RT, ClassT const, A> -bind(ClassT const* obj, RT(ClassT::*fptr)(A) const) -{ - return bound_member<RT, ClassT const, A>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 2 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B> -struct bound_member_action<RT, ClassT, - A, B, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B); - typedef RT(ClassT::*cmf)(A, B) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename A_, typename B_> - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()(A a, B b) const - { return (obj->*fptr)(a, b); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B> -inline bound_member<RT, ClassT, A, B> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B)) -{ - return bound_member<RT, ClassT, A, B>(obj,fptr); -} - -template <typename RT, typename ClassT, typename A, typename B> -inline bound_member<RT, ClassT, A, B> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B)) -{ - return bound_member<RT, ClassT, A, B>(obj,fptr); -} - -template <typename RT, typename ClassT, typename A, typename B> -inline bound_member<RT, ClassT const, A, B> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B) const) -{ - return bound_member<RT, ClassT const, A, B>(obj,fptr); -} - -template <typename RT, typename ClassT, typename A, typename B> -inline bound_member<RT, ClassT const, A, B> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B) const) -{ - return bound_member<RT, ClassT const, A, B>(obj,fptr); -} - -#if PHOENIX_LIMIT > 3 -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 3 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B, typename C> -struct bound_member_action<RT, ClassT, - A, B, C, nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C); - typedef RT(ClassT::*cmf)(A, B, C) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename A_, typename B_, typename C_> - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()(A a, B b, C c) const - { return (obj->*fptr)(a, b, c); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, typename A, typename B, typename C> -inline bound_member<RT, ClassT, A, B, C> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C)) -{ - return bound_member<RT, ClassT, A, B, C>(obj,fptr); -} - -template <typename RT, typename ClassT, typename A, typename B, typename C> -inline bound_member<RT, ClassT, A, B, C> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C)) -{ - return bound_member<RT, ClassT, A, B, C>(obj,fptr); -} - -template <typename RT, typename ClassT, typename A, typename B, typename C> -inline bound_member<RT, ClassT const, A, B, C> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C) const) -{ - return bound_member<RT, ClassT const, A, B, C>(obj,fptr); -} - -template <typename RT, typename ClassT, typename A, typename B, typename C> -inline bound_member<RT, ClassT const, A, B, C> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C) const) -{ - return bound_member<RT, ClassT const, A, B, C>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 4 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D -> -struct bound_member_action<RT, ClassT, - A, B, C, D, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D); - typedef RT(ClassT::*cmf)(A, B, C, D) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename A_, typename B_, typename C_, typename D_> - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()(A a, B b, C c, D d) const - { return (obj->*fptr)(a, b, c, d); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D -> -inline bound_member<RT, ClassT, A, B, C, D> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D)) -{ - return bound_member< - RT, ClassT, A, B, C, D>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D -> -inline bound_member<RT, ClassT, A, B, C, D> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D)) -{ - return bound_member< - RT, ClassT, A, B, C, D>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D -> -inline bound_member<RT, ClassT const, A, B, C, D> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D -> -inline bound_member<RT, ClassT const, A, B, C, D> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 5 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E); - typedef RT(ClassT::*cmf)(A, B, C, D, E) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template <typename A_, typename B_, typename C_, typename D_, - typename E_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e - ) const - { return (obj->*fptr)(a, b, c, d, e); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E -> -inline bound_member<RT, ClassT, A, B, C, D, E> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E -> -inline bound_member<RT, ClassT, A, B, C, D, E> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E -> -inline bound_member<RT, ClassT const, A, B, C, D, E> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E -> -inline bound_member<RT, ClassT const, A, B, C, D, E> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E>(obj,fptr); -} - -#if PHOENIX_LIMIT > 6 -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 6 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f - ) const - { return (obj->*fptr)(a, b, c, d, e, f); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F -> -inline bound_member<RT, ClassT, A, B, C, D, E, F> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F -> -inline bound_member<RT, ClassT, A, B, C, D, E, F> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 7 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g - ) const - { return (obj->*fptr)(a, b, c, d, e, f, g); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 8 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, H, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g, H h - ) const - { return (obj->*fptr)(a, b, c, d, e, f, g, h); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H>(obj,fptr); -} - -#if PHOENIX_LIMIT > 9 -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 9 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g, H h, I i - ) const - { return (obj->*fptr)(a, b, c, d, e, f, g, h, i); } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 10 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j - ) const - { - return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j); - } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 11 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k - ) const - { - return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k); - } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K>(obj,fptr); -} - -#if PHOENIX_LIMIT > 12 -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 12 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, L, nil_t, nil_t, nil_t, nil_t> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_, typename L_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l - ) const - { - return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k, l); - } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 13 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_, typename L_, typename M_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m - ) const - { - return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k, l, m); - } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 14 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_, typename L_, typename M_, typename N_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n - ) const - { - return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k, l, m, n); - } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N>(obj,fptr); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// Bound member function binder (specialization for 15 args) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N, - typename O -> -struct bound_member_action<RT, ClassT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t> { - - typedef RT result_type; - typedef RT(ClassT::*mf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O); - typedef RT(ClassT::*cmf)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const; - typedef typename boost::mpl::if_<boost::is_const<ClassT>, cmf, mf>::type - mem_func_ptr_t; - - template < - typename A_, typename B_, typename C_, typename D_, - typename E_, typename F_, typename G_, typename H_, typename I_, - typename J_, typename K_, typename L_, typename M_, typename N_, - typename O_ - > - struct result { typedef result_type type; }; - - template <typename CT> - bound_member_action(CT & obj_, mem_func_ptr_t fptr_) - : obj(impl::as_ptr<CT>::get(obj_)), fptr(fptr_) {} - - result_type operator()( - A a, B b, C c, D d, E e, F f, G g, H h, I i, J j, K k, L l, M m, N n, O o - ) const - { - return (obj->*fptr)(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); - } - - typename impl::as_ptr<ClassT>::pointer_type obj; - mem_func_ptr_t fptr; -}; - -////////////////////////////////// -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N, - typename O -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> -bind(ClassT & obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N, - typename O -> -inline bound_member<RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> -bind(ClassT * obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)) -{ - return bound_member< - RT, ClassT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N, - typename O -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> -bind(ClassT const& obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(obj,fptr); -} - -template <typename RT, typename ClassT, - typename A, typename B, typename C, typename D, - typename E, typename F, typename G, typename H, typename I, - typename J, typename K, typename L, typename M, typename N, - typename O -> -inline bound_member<RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> -bind(ClassT const* obj,RT(ClassT::*fptr)(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) const) -{ - return bound_member< - RT, ClassT const, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(obj,fptr); -} - -#endif -#endif -#endif -#endif - -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/casts.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/casts.hpp deleted file mode 100644 index 7344180117..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/casts.hpp +++ /dev/null @@ -1,1470 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2001-2003 Hartmut Kaiser - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ - -#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_CASTS_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_CASTS_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/actor.hpp> -#include <boost/spirit/home/classic/phoenix/composite.hpp> -#include <boost/static_assert.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -/////////////////////////////////////////////////////////////////////////////// -// -// Phoenix predefined maximum construct_ limit. This limit defines the maximum -// number of parameters supported for calles to the set of construct_ template -// functions (lazy object construction, see below). This number defaults to 3. -// The actual maximum is rounded up in multiples of 3. Thus, if this value -// is 4, the actual limit is 6. The ultimate maximum limit in this -// implementation is 15. -// PHOENIX_CONSTRUCT_LIMIT should NOT be greater than PHOENIX_LIMIT! - -#if !defined(PHOENIX_CONSTRUCT_LIMIT) -#define PHOENIX_CONSTRUCT_LIMIT PHOENIX_LIMIT -#endif - -// ensure PHOENIX_CONSTRUCT_LIMIT <= PHOENIX_LIMIT -BOOST_STATIC_ASSERT(PHOENIX_CONSTRUCT_LIMIT <= PHOENIX_LIMIT); - -// ensure PHOENIX_CONSTRUCT_LIMIT <= 15 -BOOST_STATIC_ASSERT(PHOENIX_CONSTRUCT_LIMIT <= 15); - -/////////////////////////////////////////////////////////////////////////////// -// -// Lazy C++ casts -// -// The set of lazy C++ cast template classes and functions provide a way -// of lazily casting certain type to another during parsing. -// The lazy C++ templates are (syntactically) used very much like -// the well known C++ casts: -// -// A *a = static_cast_<A *>(...actor returning a convertible type...); -// -// where the given parameter should be an actor, which eval() function -// returns a convertible type. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T, typename A> -struct static_cast_l { - - template <typename TupleT> - struct result { typedef T type; }; - - static_cast_l(A const& a_) - : a(a_) {} - - template <typename TupleT> - T - eval(TupleT const& args) const - { - return static_cast<T>(a.eval(args)); - } - - A a; -}; - -////////////////////////////////// -template <typename T, typename BaseAT> -inline actor<static_cast_l<T, BaseAT> > -static_cast_(actor<BaseAT> const& a) -{ - typedef static_cast_l<T, BaseAT> cast_t; - return actor<cast_t>(cast_t(a)); -} - -////////////////////////////////// -template <typename T, typename A> -struct dynamic_cast_l { - - template <typename TupleT> - struct result { typedef T type; }; - - dynamic_cast_l(A const& a_) - : a(a_) {} - - template <typename TupleT> - T - eval(TupleT const& args) const - { - return dynamic_cast<T>(a.eval(args)); - } - - A a; -}; - -////////////////////////////////// -template <typename T, typename BaseAT> -inline actor<dynamic_cast_l<T, BaseAT> > -dynamic_cast_(actor<BaseAT> const& a) -{ - typedef dynamic_cast_l<T, BaseAT> cast_t; - return actor<cast_t>(cast_t(a)); -} - -////////////////////////////////// -template <typename T, typename A> -struct reinterpret_cast_l { - - template <typename TupleT> - struct result { typedef T type; }; - - reinterpret_cast_l(A const& a_) - : a(a_) {} - - template <typename TupleT> - T - eval(TupleT const& args) const - { - return reinterpret_cast<T>(a.eval(args)); - } - - A a; -}; - -////////////////////////////////// -template <typename T, typename BaseAT> -inline actor<reinterpret_cast_l<T, BaseAT> > -reinterpret_cast_(actor<BaseAT> const& a) -{ - typedef reinterpret_cast_l<T, BaseAT> cast_t; - return actor<cast_t>(cast_t(a)); -} - -////////////////////////////////// -template <typename T, typename A> -struct const_cast_l { - - template <typename TupleT> - struct result { typedef T type; }; - - const_cast_l(A const& a_) - : a(a_) {} - - template <typename TupleT> - T - eval(TupleT const& args) const - { - return const_cast<T>(a.eval(args)); - } - - A a; -}; - -////////////////////////////////// -template <typename T, typename BaseAT> -inline actor<const_cast_l<T, BaseAT> > -const_cast_(actor<BaseAT> const& a) -{ - typedef const_cast_l<T, BaseAT> cast_t; - return actor<cast_t>(cast_t(a)); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// construct_ -// -// Lazy object construction -// -// The set of construct_<> template classes and functions provide a way -// of lazily constructing certain object from a arbitrary set of -// actors during parsing. -// The construct_ templates are (syntactically) used very much like -// the well known C++ casts: -// -// A a = construct_<A>(...arbitrary list of actors...); -// -// where the given parameters are submitted as parameters to the -// constructor of the object of type A. (This certainly implies, that -// type A has a constructor with a fitting set of parameter types -// defined.) -// -// The maximum number of needed parameters is controlled through the -// preprocessor constant PHOENIX_CONSTRUCT_LIMIT. Note though, that this -// limit should not be greater than PHOENIX_LIMIT. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T> -struct construct_l_0 { - typedef T result_type; - - T operator()() const { - return T(); - } -}; - - -template <typename T> -struct construct_l { - - template < - typename A - , typename B - , typename C - -#if PHOENIX_CONSTRUCT_LIMIT > 3 - , typename D - , typename E - , typename F - -#if PHOENIX_CONSTRUCT_LIMIT > 6 - , typename G - , typename H - , typename I - -#if PHOENIX_CONSTRUCT_LIMIT > 9 - , typename J - , typename K - , typename L - -#if PHOENIX_CONSTRUCT_LIMIT > 12 - , typename M - , typename N - , typename O -#endif -#endif -#endif -#endif - > - struct result { typedef T type; }; - - T operator()() const - { - return T(); - } - - template <typename A> - T operator()(A const& a) const - { - T t(a); - return t; - } - - template <typename A, typename B> - T operator()(A const& a, B const& b) const - { - T t(a, b); - return t; - } - - template <typename A, typename B, typename C> - T operator()(A const& a, B const& b, C const& c) const - { - T t(a, b, c); - return t; - } - -#if PHOENIX_CONSTRUCT_LIMIT > 3 - template < - typename A, typename B, typename C, typename D - > - T operator()( - A const& a, B const& b, C const& c, D const& d) const - { - T t(a, b, c, d); - return t; - } - - template < - typename A, typename B, typename C, typename D, typename E - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e) const - { - T t(a, b, c, d, e); - return t; - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f) const - { - T t(a, b, c, d, e, f); - return t; - } - -#if PHOENIX_CONSTRUCT_LIMIT > 6 - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g) const - { - T t(a, b, c, d, e, f, g); - return t; - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h) const - { - T t(a, b, c, d, e, f, g, h); - return t; - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i) const - { - T t(a, b, c, d, e, f, g, h, i); - return t; - } - -#if PHOENIX_CONSTRUCT_LIMIT > 9 - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j) const - { - T t(a, b, c, d, e, f, g, h, i, j); - return t; - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k) const - { - T t(a, b, c, d, e, f, g, h, i, j, k); - return t; - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l) const - { - T t(a, b, c, d, e, f, g, h, i, j, k, l); - return t; - } - -#if PHOENIX_CONSTRUCT_LIMIT > 12 - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m) const - { - T t(a, b, c, d, e, f, g, h, i, j, k, l, m); - return t; - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n) const - { - T t(a, b, c, d, e, f, g, h, i, j, k, l, m, n); - return t; - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n, O const& o) const - { - T t(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); - return t; - } - -#endif -#endif -#endif -#endif -}; - - -template <typename T> -struct construct_1 { - - template < - typename A - > - struct result { typedef T type; }; - - template <typename A> - T operator()(A const& a) const - { - T t(a); - return t; - } - -}; - -template <typename T> -struct construct_2 { - - template < - typename A - , typename B - > - struct result { typedef T type; }; - - template <typename A, typename B> - T operator()(A const& a, B const& b) const - { - T t(a, b); - return t; - } - -}; - -template <typename T> -struct construct_3 { - - template < - typename A - , typename B - , typename C - > - struct result { typedef T type; }; - - template <typename A, typename B, typename C> - T operator()(A const& a, B const& b, C const& c) const - { - T t(a, b, c); - return t; - } -}; - -#if PHOENIX_CONSTRUCT_LIMIT > 3 -template <typename T> -struct construct_4 { - - template < - typename A - , typename B - , typename C - , typename D - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D - > - T operator()( - A const& a, B const& b, C const& c, D const& d) const - { - T t(a, b, c, d); - return t; - } -}; - - -template <typename T> -struct construct_5 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e) const - { - T t(a, b, c, d, e); - return t; - } -}; - - -template <typename T> -struct construct_6 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f) const - { - T t(a, b, c, d, e, f); - return t; - } -}; -#endif - - -#if PHOENIX_CONSTRUCT_LIMIT > 6 -template <typename T> -struct construct_7 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g) const - { - T t(a, b, c, d, e, f, g); - return t; - } -}; - -template <typename T> -struct construct_8 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h) const - { - T t(a, b, c, d, e, f, g, h); - return t; - } -}; - -template <typename T> -struct construct_9 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i) const - { - T t(a, b, c, d, e, f, g, h, i); - return t; - } -}; -#endif - - -#if PHOENIX_CONSTRUCT_LIMIT > 9 -template <typename T> -struct construct_10 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j) const - { - T t(a, b, c, d, e, f, g, h, i, j); - return t; - } -}; - -template <typename T> -struct construct_11 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k) const - { - T t(a, b, c, d, e, f, g, h, i, j, k); - return t; - } -}; - -template <typename T> -struct construct_12 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - , typename L - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l) const - { - T t(a, b, c, d, f, e, g, h, i, j, k, l); - return t; - } -}; -#endif - -#if PHOENIX_CONSTRUCT_LIMIT > 12 -template <typename T> -struct construct_13 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - , typename L - , typename M - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m) const - { - T t(a, b, c, d, e, f, g, h, i, j, k, l, m); - return t; - } -}; - -template <typename T> -struct construct_14 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - , typename L - , typename M - , typename N - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n) const - { - T t(a, b, c, d, e, f, g, h, i, j, k, l, m, n); - return t; - } -}; - -template <typename T> -struct construct_15 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - , typename L - , typename M - , typename N - , typename O - > - struct result { typedef T type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O - > - T operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n, O const& o) const - { - T t(a, b, c, d, f, e, g, h, i, j, k, l, m, n, o); - return t; - } -}; -#endif - - -#if defined(BOOST_BORLANDC) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002)) - -/////////////////////////////////////////////////////////////////////////////// -// -// The following specializations are needed because Borland and CodeWarrior -// does not accept default template arguments in nested template classes in -// classes (i.e construct_l::result) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T, typename TupleT> -struct composite0_result<construct_l_0<T>, TupleT> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A> -struct composite1_result<construct_l<T>, TupleT, A> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B> -struct composite2_result<construct_l<T>, TupleT, A, B> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C> -struct composite3_result<construct_l<T>, TupleT, A, B, C> { - - typedef T type; -}; - -#if PHOENIX_LIMIT > 3 -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D> -struct composite4_result<construct_l<T>, TupleT, - A, B, C, D> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E> -struct composite5_result<construct_l<T>, TupleT, - A, B, C, D, E> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F> -struct composite6_result<construct_l<T>, TupleT, - A, B, C, D, E, F> { - - typedef T type; -}; - -#if PHOENIX_LIMIT > 6 -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G> -struct composite7_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H> -struct composite8_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G, H> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I> -struct composite9_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G, H, I> { - - typedef T type; -}; - -#if PHOENIX_LIMIT > 9 -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J> -struct composite10_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K> -struct composite11_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L> -struct composite12_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L> { - - typedef T type; -}; - -#if PHOENIX_LIMIT > 12 -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M> -struct composite13_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N> -struct composite14_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N> { - - typedef T type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O> -struct composite15_result<construct_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> { - - typedef T type; -}; - -#endif -#endif -#endif -#endif -#endif - -////////////////////////////////// -template <typename T> -inline typename impl::make_composite<construct_l_0<T> >::type -construct_() -{ - typedef impl::make_composite<construct_l_0<T> > make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_l_0<T>())); -} - -////////////////////////////////// -template <typename T, typename A> -inline typename impl::make_composite<construct_1<T>, A>::type -construct_(A const& a) -{ - typedef impl::make_composite<construct_1<T>, A> make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_1<T>(), - as_actor<A>::convert(a) - )); -} - -////////////////////////////////// -template <typename T, typename A, typename B> -inline typename impl::make_composite<construct_2<T>, A, B>::type -construct_(A const& a, B const& b) -{ - typedef impl::make_composite<construct_2<T>, A, B> make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_2<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b) - )); -} - -////////////////////////////////// -template <typename T, typename A, typename B, typename C> -inline typename impl::make_composite<construct_3<T>, A, B, C>::type -construct_(A const& a, B const& b, C const& c) -{ - typedef impl::make_composite<construct_3<T>, A, B, C> make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_3<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c) - )); -} - -#if PHOENIX_CONSTRUCT_LIMIT > 3 -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D -> -inline typename impl::make_composite<construct_4<T>, A, B, C, D>::type -construct_( - A const& a, B const& b, C const& c, D const& d) -{ - typedef - impl::make_composite<construct_4<T>, A, B, C, D> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_4<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E -> -inline typename impl::make_composite<construct_5<T>, A, B, C, D, E>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e) -{ - typedef - impl::make_composite<construct_5<T>, A, B, C, D, E> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_5<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F -> -inline typename impl::make_composite<construct_6<T>, A, B, C, D, E, F>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f) -{ - typedef - impl::make_composite<construct_6<T>, A, B, C, D, E, F> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_6<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f) - )); -} - -#if PHOENIX_CONSTRUCT_LIMIT > 6 -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G -> -inline typename impl::make_composite<construct_7<T>, A, B, C, D, E, F, G>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g) -{ - typedef - impl::make_composite<construct_7<T>, A, B, C, D, E, F, G> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_7<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H -> -inline typename impl::make_composite<construct_8<T>, A, B, C, D, E, F, G, H>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h) -{ - typedef - impl::make_composite<construct_8<T>, A, B, C, D, E, F, G, H> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_8<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I -> -inline typename impl::make_composite<construct_9<T>, A, B, C, D, E, F, G, H, I>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i) -{ - typedef - impl::make_composite<construct_9<T>, A, B, C, D, E, F, G, H, I> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_9<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i) - )); -} - -#if PHOENIX_CONSTRUCT_LIMIT > 9 -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J -> -inline typename impl::make_composite< - construct_10<T>, A, B, C, D, E, F, G, H, I, J>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j) -{ - typedef - impl::make_composite< - construct_10<T>, A, B, C, D, E, F, G, H, I, J - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_10<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K -> -inline typename impl::make_composite< - construct_11<T>, A, B, C, D, E, F, G, H, I, J, K>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k) -{ - typedef - impl::make_composite< - construct_11<T>, A, B, C, D, E, F, G, H, I, J, K - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_11<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K, - typename L -> -inline typename impl::make_composite< - construct_12<T>, A, B, C, D, E, F, G, H, I, J, K, L>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l) -{ - typedef - impl::make_composite< - construct_12<T>, A, B, C, D, E, F, G, H, I, J, K, L - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_12<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l) - )); -} - -#if PHOENIX_CONSTRUCT_LIMIT > 12 -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K, - typename L, typename M -> -inline typename impl::make_composite< - construct_13<T>, A, B, C, D, E, F, G, H, I, J, K, L, M>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m) -{ - typedef - impl::make_composite< - construct_13<T>, A, B, C, D, E, F, G, H, I, J, K, L, M - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_13<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K, - typename L, typename M, typename N -> -inline typename impl::make_composite< - construct_14<T>, A, B, C, D, E, F, G, H, I, J, K, L, M>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n) -{ - typedef - impl::make_composite< - construct_14<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, N - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_14<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m), - as_actor<N>::convert(n) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K, - typename L, typename M, typename N, typename O -> -inline typename impl::make_composite< - construct_15<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, O>::type -construct_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n, O const& o) -{ - typedef - impl::make_composite< - construct_15<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(construct_15<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m), - as_actor<N>::convert(n), - as_actor<O>::convert(o) - )); -} - -#endif -#endif -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/closures.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/closures.hpp deleted file mode 100644 index 9499e52e81..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/closures.hpp +++ /dev/null @@ -1,451 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 Joel de Guzman - MT code Copyright (c) 2002-2003 Martin Wille - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ -#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_CLOSURES_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_CLOSURES_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/actor.hpp> -#include <boost/assert.hpp> - -#ifdef PHOENIX_THREADSAFE -#include <boost/thread/tss.hpp> -#include <boost/thread/once.hpp> -#endif - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Adaptable closures -// -// The framework will not be complete without some form of closures -// support. Closures encapsulate a stack frame where local -// variables are created upon entering a function and destructed -// upon exiting. Closures provide an environment for local -// variables to reside. Closures can hold heterogeneous types. -// -// Phoenix closures are true hardware stack based closures. At the -// very least, closures enable true reentrancy in lambda functions. -// A closure provides access to a function stack frame where local -// variables reside. Modeled after Pascal nested stack frames, -// closures can be nested just like nested functions where code in -// inner closures may access local variables from in-scope outer -// closures (accessing inner scopes from outer scopes is an error -// and will cause a run-time assertion failure). -// -// There are three (3) interacting classes: -// -// 1) closure: -// -// At the point of declaration, a closure does not yet create a -// stack frame nor instantiate any variables. A closure declaration -// declares the types and names[note] of the local variables. The -// closure class is meant to be subclassed. It is the -// responsibility of a closure subclass to supply the names for -// each of the local variable in the closure. Example: -// -// struct my_closure : closure<int, string, double> { -// -// member1 num; // names the 1st (int) local variable -// member2 message; // names the 2nd (string) local variable -// member3 real; // names the 3rd (double) local variable -// }; -// -// my_closure clos; -// -// Now that we have a closure 'clos', its local variables can be -// accessed lazily using the dot notation. Each qualified local -// variable can be used just like any primitive actor (see -// primitives.hpp). Examples: -// -// clos.num = 30 -// clos.message = arg1 -// clos.real = clos.num * 1e6 -// -// The examples above are lazily evaluated. As usual, these -// expressions return composite actors that will be evaluated -// through a second function call invocation (see operators.hpp). -// Each of the members (clos.xxx) is an actor. As such, applying -// the operator() will reveal its identity: -// -// clos.num() // will return the current value of clos.num -// -// *** [note] Acknowledgement: Juan Carlos Arevalo-Baeza (JCAB) -// introduced and initilally implemented the closure member names -// that uses the dot notation. -// -// 2) closure_member -// -// The named local variables of closure 'clos' above are actually -// closure members. The closure_member class is an actor and -// conforms to its conceptual interface. member1..memberN are -// predefined typedefs that correspond to each of the listed types -// in the closure template parameters. -// -// 3) closure_frame -// -// When a closure member is finally evaluated, it should refer to -// an actual instance of the variable in the hardware stack. -// Without doing so, the process is not complete and the evaluated -// member will result to an assertion failure. Remember that the -// closure is just a declaration. The local variables that a -// closure refers to must still be instantiated. -// -// The closure_frame class does the actual instantiation of the -// local variables and links these variables with the closure and -// all its members. There can be multiple instances of -// closure_frames typically situated in the stack inside a -// function. Each closure_frame instance initiates a stack frame -// with a new set of closure local variables. Example: -// -// void foo() -// { -// closure_frame<my_closure> frame(clos); -// /* do something */ -// } -// -// where 'clos' is an instance of our closure 'my_closure' above. -// Take note that the usage above precludes locally declared -// classes. If my_closure is a locally declared type, we can still -// use its self_type as a parameter to closure_frame: -// -// closure_frame<my_closure::self_type> frame(clos); -// -// Upon instantiation, the closure_frame links the local variables -// to the closure. The previous link to another closure_frame -// instance created before is saved. Upon destruction, the -// closure_frame unlinks itself from the closure and relinks the -// preceding closure_frame prior to this instance. -// -// The local variables in the closure 'clos' above is default -// constructed in the stack inside function 'foo'. Once 'foo' is -// exited, all of these local variables are destructed. In some -// cases, default construction is not desirable and we need to -// initialize the local closure variables with some values. This -// can be done by passing in the initializers in a compatible -// tuple. A compatible tuple is one with the same number of -// elements as the destination and where each element from the -// destination can be constructed from each corresponding element -// in the source. Example: -// -// tuple<int, char const*, int> init(123, "Hello", 1000); -// closure_frame<my_closure> frame(clos, init); -// -// Here now, our closure_frame's variables are initialized with -// int: 123, char const*: "Hello" and int: 1000. -// -/////////////////////////////////////////////////////////////////////////////// - -namespace impl -{ - /////////////////////////////////////////////////////////////////////// - // closure_frame_holder is a simple class that encapsulates the - // storage for a frame pointer. It uses thread specific data in - // case when multithreading is enabled, an ordinary pointer otherwise - // - // it has get() and set() member functions. set() has to be used - // _after_ get(). get() contains intialisation code in the multi - // threading case - // - // closure_frame_holder is used by the closure<> class to store - // the pointer to the current frame. - // -#ifndef PHOENIX_THREADSAFE - template <typename FrameT> - struct closure_frame_holder - { - typedef FrameT frame_t; - typedef frame_t *frame_ptr; - - closure_frame_holder() : frame(0) {} - - frame_ptr &get() { return frame; } - void set(frame_t *f) { frame = f; } - - private: - frame_ptr frame; - - // no copies, no assignments - closure_frame_holder(closure_frame_holder const &); - closure_frame_holder &operator=(closure_frame_holder const &); - }; -#else - template <typename FrameT> - struct closure_frame_holder - { - typedef FrameT frame_t; - typedef frame_t *frame_ptr; - - closure_frame_holder() : tsp_frame() {} - - frame_ptr &get() - { - if (!tsp_frame.get()) - tsp_frame.reset(new frame_ptr(0)); - return *tsp_frame; - } - void set(frame_ptr f) - { - *tsp_frame = f; - } - - private: - boost::thread_specific_ptr<frame_ptr> tsp_frame; - - // no copies, no assignments - closure_frame_holder(closure_frame_holder const &); - closure_frame_holder &operator=(closure_frame_holder const &); - }; -#endif -} // namespace phoenix::impl - -/////////////////////////////////////////////////////////////////////////////// -// -// closure_frame class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename ClosureT> -class closure_frame : public ClosureT::tuple_t { - -public: - - closure_frame(ClosureT const& clos) - : ClosureT::tuple_t(), save(clos.frame.get()), frame(clos.frame) - { clos.frame.set(this); } - - template <typename TupleT> - closure_frame(ClosureT const& clos, TupleT const& init) - : ClosureT::tuple_t(init), save(clos.frame.get()), frame(clos.frame) - { clos.frame.set(this); } - - ~closure_frame() - { frame.set(save); } - -private: - - closure_frame(closure_frame const&); // no copy - closure_frame& operator=(closure_frame const&); // no assign - - closure_frame* save; - impl::closure_frame_holder<closure_frame>& frame; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// closure_member class -// -/////////////////////////////////////////////////////////////////////////////// -template <int N, typename ClosureT> -class closure_member { - -public: - - typedef typename ClosureT::tuple_t tuple_t; - - closure_member() - : frame(ClosureT::closure_frame_holder_ref()) {} - - template <typename TupleT> - struct result { - - typedef typename tuple_element< - N, typename ClosureT::tuple_t - >::rtype type; - }; - - template <typename TupleT> - typename tuple_element<N, typename ClosureT::tuple_t>::rtype - eval(TupleT const& /*args*/) const - { - using namespace std; - BOOST_ASSERT(frame.get() != 0); - tuple_index<N> const idx; - return (*frame.get())[idx]; - } - -private: - impl::closure_frame_holder<typename ClosureT::closure_frame_t> &frame; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// closure class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename T0 = nil_t - , typename T1 = nil_t - , typename T2 = nil_t - -#if PHOENIX_LIMIT > 3 - , typename T3 = nil_t - , typename T4 = nil_t - , typename T5 = nil_t - -#if PHOENIX_LIMIT > 6 - , typename T6 = nil_t - , typename T7 = nil_t - , typename T8 = nil_t - -#if PHOENIX_LIMIT > 9 - , typename T9 = nil_t - , typename T10 = nil_t - , typename T11 = nil_t - -#if PHOENIX_LIMIT > 12 - , typename T12 = nil_t - , typename T13 = nil_t - , typename T14 = nil_t - -#endif -#endif -#endif -#endif -> -class closure { - -public: - - typedef tuple< - T0, T1, T2 -#if PHOENIX_LIMIT > 3 - , T3, T4, T5 -#if PHOENIX_LIMIT > 6 - , T6, T7, T8 -#if PHOENIX_LIMIT > 9 - , T9, T10, T11 -#if PHOENIX_LIMIT > 12 - , T12, T13, T14 -#endif -#endif -#endif -#endif - > tuple_t; - - typedef closure< - T0, T1, T2 -#if PHOENIX_LIMIT > 3 - , T3, T4, T5 -#if PHOENIX_LIMIT > 6 - , T6, T7, T8 -#if PHOENIX_LIMIT > 9 - , T9, T10, T11 -#if PHOENIX_LIMIT > 12 - , T12, T13, T14 -#endif -#endif -#endif -#endif - > self_t; - - typedef closure_frame<self_t> closure_frame_t; - - closure() - : frame() { closure_frame_holder_ref(&frame); } - - typedef actor<closure_member<0, self_t> > member1; - typedef actor<closure_member<1, self_t> > member2; - typedef actor<closure_member<2, self_t> > member3; - -#if PHOENIX_LIMIT > 3 - typedef actor<closure_member<3, self_t> > member4; - typedef actor<closure_member<4, self_t> > member5; - typedef actor<closure_member<5, self_t> > member6; - -#if PHOENIX_LIMIT > 6 - typedef actor<closure_member<6, self_t> > member7; - typedef actor<closure_member<7, self_t> > member8; - typedef actor<closure_member<8, self_t> > member9; - -#if PHOENIX_LIMIT > 9 - typedef actor<closure_member<9, self_t> > member10; - typedef actor<closure_member<10, self_t> > member11; - typedef actor<closure_member<11, self_t> > member12; - -#if PHOENIX_LIMIT > 12 - typedef actor<closure_member<12, self_t> > member13; - typedef actor<closure_member<13, self_t> > member14; - typedef actor<closure_member<14, self_t> > member15; - -#endif -#endif -#endif -#endif - -#if !defined(__MWERKS__) || (__MWERKS__ > 0x3002) -private: -#endif - - closure(closure const&); // no copy - closure& operator=(closure const&); // no assign - -#if !defined(__MWERKS__) || (__MWERKS__ > 0x3002) - template <int N, typename ClosureT> - friend class closure_member; - - template <typename ClosureT> - friend class closure_frame; -#endif - - typedef impl::closure_frame_holder<closure_frame_t> holder_t; - -#ifdef PHOENIX_THREADSAFE - static boost::thread_specific_ptr<holder_t*> & - tsp_frame_instance() - { - static boost::thread_specific_ptr<holder_t*> the_instance; - return the_instance; - } - - static void - tsp_frame_instance_init() - { - tsp_frame_instance(); - } -#endif - - static holder_t & - closure_frame_holder_ref(holder_t* holder_ = 0) - { -#ifdef PHOENIX_THREADSAFE -#ifndef BOOST_THREAD_PROVIDES_ONCE_CXX11 - static boost::once_flag been_here = BOOST_ONCE_INIT; -#else - static boost::once_flag been_here; -#endif - boost::call_once(been_here, tsp_frame_instance_init); - boost::thread_specific_ptr<holder_t*> &tsp_frame = tsp_frame_instance(); - if (!tsp_frame.get()) - tsp_frame.reset(new holder_t *(0)); - holder_t *& holder = *tsp_frame; -#else - static holder_t* holder = 0; -#endif - if (holder_ != 0) - holder = holder_; - return *holder; - } - - mutable holder_t frame; -}; - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif - -} - // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/composite.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/composite.hpp deleted file mode 100644 index ed9c3d0c40..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/composite.hpp +++ /dev/null @@ -1,1431 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_COMPOSITE_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_COMPOSITE_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/actor.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// composite class -// -// A composite is an actor base class composed of zero or more -// actors (see actor.hpp) and an operation. A composite is itself -// an actor superclass and conforms to its conceptual interface. -// Its eval member function un-funnels the tupled actual arguments -// from the tuple by invoking each of the actors' eval member -// function. The results of each are then passed on as arguments to -// the operation. Specializations are provided to handle different -// numbers of actors. -// -// Schematically: -// -// actor0.eval(tupled_args) --> arg0 --> | -// actor1.eval(tupled_args) --> arg1 --> | -// actor2.eval(tupled_args) --> arg3 --> | --> operation(arg0...argN) -// ... | -// actorN.eval(tupled_args) --> argN --> | -// -// The operation can be any suitable functor that can accept the -// arguments passed in by the composite. The operation is expected -// to have a member operator() that carries out the actual -// operation. There should be a one to one correspondence between -// actors of the composite and the arguments of the operation's -// member operator(). -// -// The operation is also expected to have a nested template class -// result<T0...TN>. The nested template class result should have a -// typedef 'type' that reflects the return type of its member -// operator(). This is essentially a type computer that answers the -// metaprogramming question "Given arguments of type T0...TN, what -// will be its operator()'s return type?". -// -// There is a special case for operations that accept no arguments. -// Such nullary operations are only required to define a typedef -// result_type that reflects the return type of its operator(). -// -// Here's an example of a simple operation that squares a number: -// -// struct square { -// -// template <typename ArgT> -// struct result { typedef ArgT type; }; -// -// template <typename ArgT> -// ArgT operator()(ArgT n) const { return n * n; } -// }; -// -// As can be seen, operations can be polymorphic. Its arguments and -// return type are not fixed to a particular type. The example -// above for example, can handle any ArgT type as long as it has a -// multiplication operator. -// -// Composites are not created directly. Instead, there are meta- -// programs provided that indirectly create composites. See -// operators.hpp, binders.hpp and functions.hpp for examples. -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename OperationT - , typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif - - , typename NU = nil_t // Not used -> -struct composite; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <0 actor> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT> -struct composite0_result { - - typedef typename OperationT::result_type type; -}; - -////////////////////////////////// -template <typename OperationT> -struct composite<OperationT, - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite0_result< - OperationT, TupleT - >::type type; - }; - - composite(OperationT const& op_) - : op(op_) {} - - template <typename TupleT> - typename OperationT::result_type - eval(TupleT const& /*args*/) const - { - return op(); - } - - mutable OperationT op; // operation -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <1 actor> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A> -struct composite1_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A> -struct composite<OperationT, - A, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite1_result< - OperationT, TupleT, A - >::type type; - }; - - composite(OperationT const& op_, - A const& a_) - : op(op_), a(a_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - return op(ra); - } - - mutable OperationT op; // operation - A a; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <2 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B> -struct composite2_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B> -struct composite<OperationT, - A, B, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite2_result< - OperationT, TupleT, A, B - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_) - : op(op_), a(a_), b(b_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - return op(ra, rb); - } - - mutable OperationT op; // operation - A a; B b; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <3 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C> -struct composite3_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C> -struct composite<OperationT, - A, B, C, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B, C> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite3_result< - OperationT, TupleT, A, B, C - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_) - : op(op_), a(a_), b(b_), c(c_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - return op(ra, rb, rc); - } - - mutable OperationT op; // operation - A a; B b; C c; // actors -}; - -#if PHOENIX_LIMIT > 3 -/////////////////////////////////////////////////////////////////////////////// -// -// composite <4 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D> -struct composite4_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D> -struct composite<OperationT, - A, B, C, D, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B, C, D> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite4_result< - OperationT, TupleT, A, B, C, D - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_) - : op(op_), a(a_), b(b_), c(c_), d(d_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - return op(ra, rb, rc, rd); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <5 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E> -struct composite5_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E> -struct composite<OperationT, - A, B, C, D, E, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B, C, D, E> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite5_result< - OperationT, TupleT, A, B, C, D, E - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - return op(ra, rb, rc, rd, re); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <6 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F> -struct composite6_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F> -struct composite<OperationT, - A, B, C, D, E, F, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B, C, D, E, F> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite6_result< - OperationT, TupleT, A, B, C, D, E, F - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - return op(ra, rb, rc, rd, re, rf); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; // actors -}; - -#if PHOENIX_LIMIT > 6 -/////////////////////////////////////////////////////////////////////////////// -// -// composite <7 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G> -struct composite7_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G> -struct composite<OperationT, - A, B, C, D, E, F, G, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B, C, D, E, F, G> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite7_result< - OperationT, TupleT, A, B, C, D, E, F, G - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - return op(ra, rb, rc, rd, re, rf, rg); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <8 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H> -struct composite8_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type, - typename actor_result<H, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H> -struct composite<OperationT, - A, B, C, D, E, F, G, H, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B, C, D, E, F, G, H> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite8_result< - OperationT, TupleT, A, B, C, D, E, F, G, H - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_, H const& h_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - typename actor_result<H, TupleT>::type rh = h.eval(args); - return op(ra, rb, rc, rd, re, rf, rg, rh); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; H h; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <9 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I> -struct composite9_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type, - typename actor_result<H, TupleT>::plain_type, - typename actor_result<I, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I> -struct composite<OperationT, - A, B, C, D, E, F, G, H, I, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B, C, D, E, F, G, H, I> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite9_result< - OperationT, TupleT, A, B, C, D, E, F, G, H, I - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_, H const& h_, I const& i_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - typename actor_result<H, TupleT>::type rh = h.eval(args); - typename actor_result<I, TupleT>::type ri = i.eval(args); - return op(ra, rb, rc, rd, re, rf, rg, rh, ri); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; H h; I i; // actors -}; - -#if PHOENIX_LIMIT > 9 -/////////////////////////////////////////////////////////////////////////////// -// -// composite <10 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J> -struct composite10_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type, - typename actor_result<H, TupleT>::plain_type, - typename actor_result<I, TupleT>::plain_type, - typename actor_result<J, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J> -struct composite<OperationT, - A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef composite<OperationT, A, B, C, D, E, F, G, H, I, J> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite10_result< - OperationT, TupleT, A, B, C, D, E, F, G, H, I, J - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_, H const& h_, I const& i_, J const& j_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - typename actor_result<H, TupleT>::type rh = h.eval(args); - typename actor_result<I, TupleT>::type ri = i.eval(args); - typename actor_result<J, TupleT>::type rj = j.eval(args); - return op(ra, rb, rc, rd, re, rf, rg, rh, ri, rj); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; H h; I i; J j; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <11 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K> -struct composite11_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type, - typename actor_result<H, TupleT>::plain_type, - typename actor_result<I, TupleT>::plain_type, - typename actor_result<J, TupleT>::plain_type, - typename actor_result<K, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K> -struct composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite11_result< - OperationT, TupleT, A, B, C, D, E, F, G, H, I, J, K - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_, H const& h_, I const& i_, J const& j_, - K const& k_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - typename actor_result<H, TupleT>::type rh = h.eval(args); - typename actor_result<I, TupleT>::type ri = i.eval(args); - typename actor_result<J, TupleT>::type rj = j.eval(args); - typename actor_result<K, TupleT>::type rk = k.eval(args); - return op(ra, rb, rc, rd, re, rf, rg, rh, ri, rj, rk); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; H h; I i; J j; - K k;// actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <12 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L> -struct composite12_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type, - typename actor_result<H, TupleT>::plain_type, - typename actor_result<I, TupleT>::plain_type, - typename actor_result<J, TupleT>::plain_type, - typename actor_result<K, TupleT>::plain_type, - typename actor_result<L, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L> -struct composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, L, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> { - - typedef composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, L> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite12_result< - OperationT, TupleT, A, B, C, D, E, F, G, H, I, J, K, L - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_, H const& h_, I const& i_, J const& j_, - K const& k_, L const& l_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_), l(l_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - typename actor_result<H, TupleT>::type rh = h.eval(args); - typename actor_result<I, TupleT>::type ri = i.eval(args); - typename actor_result<J, TupleT>::type rj = j.eval(args); - typename actor_result<K, TupleT>::type rk = k.eval(args); - typename actor_result<L, TupleT>::type rl = l.eval(args); - return op(ra, rb, rc, rd, re, rf, rg, rh, ri, rj, rk, rl); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; H h; I i; J j; - K k; L l;// actors -}; - -#if PHOENIX_LIMIT > 12 -/////////////////////////////////////////////////////////////////////////////// -// -// composite <13 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M> -struct composite13_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type, - typename actor_result<H, TupleT>::plain_type, - typename actor_result<I, TupleT>::plain_type, - typename actor_result<J, TupleT>::plain_type, - typename actor_result<K, TupleT>::plain_type, - typename actor_result<L, TupleT>::plain_type, - typename actor_result<M, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M> -struct composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t -> { - - typedef composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, L, M> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite13_result< - OperationT, TupleT, A, B, C, D, E, F, G, H, I, J, K, L, M - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_, H const& h_, I const& i_, J const& j_, - K const& k_, L const& l_, M const& m_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_), l(l_), m(m_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - typename actor_result<H, TupleT>::type rh = h.eval(args); - typename actor_result<I, TupleT>::type ri = i.eval(args); - typename actor_result<J, TupleT>::type rj = j.eval(args); - typename actor_result<K, TupleT>::type rk = k.eval(args); - typename actor_result<L, TupleT>::type rl = l.eval(args); - typename actor_result<M, TupleT>::type rm = m.eval(args); - return op(ra, rb, rc, rd, re, rf, rg, rh, ri, rj, rk, rl, rm); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; H h; I i; J j; - K k; L l; M m; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <14 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N> -struct composite14_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type, - typename actor_result<H, TupleT>::plain_type, - typename actor_result<I, TupleT>::plain_type, - typename actor_result<J, TupleT>::plain_type, - typename actor_result<K, TupleT>::plain_type, - typename actor_result<L, TupleT>::plain_type, - typename actor_result<M, TupleT>::plain_type, - typename actor_result<N, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N> -struct composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t -> { - - typedef composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite14_result< - OperationT, TupleT, A, B, C, D, E, F, G, H, I, J, K, L, M, N - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_, H const& h_, I const& i_, J const& j_, - K const& k_, L const& l_, M const& m_, N const& n_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_), l(l_), m(m_), n(n_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - typename actor_result<H, TupleT>::type rh = h.eval(args); - typename actor_result<I, TupleT>::type ri = i.eval(args); - typename actor_result<J, TupleT>::type rj = j.eval(args); - typename actor_result<K, TupleT>::type rk = k.eval(args); - typename actor_result<L, TupleT>::type rl = l.eval(args); - typename actor_result<M, TupleT>::type rm = m.eval(args); - typename actor_result<N, TupleT>::type rn = n.eval(args); - return op(ra, rb, rc, rd, re, rf, rg, rh, ri, rj, rk, rl, rm, rn); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; H h; I i; J j; - K k; L l; M m; N n; // actors -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// composite <15 actors> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O> -struct composite15_result { - - typedef typename OperationT::template result< - typename actor_result<A, TupleT>::plain_type, - typename actor_result<B, TupleT>::plain_type, - typename actor_result<C, TupleT>::plain_type, - typename actor_result<D, TupleT>::plain_type, - typename actor_result<E, TupleT>::plain_type, - typename actor_result<F, TupleT>::plain_type, - typename actor_result<G, TupleT>::plain_type, - typename actor_result<H, TupleT>::plain_type, - typename actor_result<I, TupleT>::plain_type, - typename actor_result<J, TupleT>::plain_type, - typename actor_result<K, TupleT>::plain_type, - typename actor_result<L, TupleT>::plain_type, - typename actor_result<M, TupleT>::plain_type, - typename actor_result<N, TupleT>::plain_type, - typename actor_result<O, TupleT>::plain_type - >::type type; -}; - -////////////////////////////////// -template <typename OperationT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O> -struct composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t -> { - - typedef composite<OperationT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> self_t; - - template <typename TupleT> - struct result { - - typedef typename composite15_result< - OperationT, TupleT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O - >::type type; - }; - - composite(OperationT const& op_, - A const& a_, B const& b_, C const& c_, D const& d_, E const& e_, - F const& f_, G const& g_, H const& h_, I const& i_, J const& j_, - K const& k_, L const& l_, M const& m_, N const& n_, O const& o_) - : op(op_), a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_), l(l_), m(m_), n(n_), o(o_) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - typename actor_result<A, TupleT>::type ra = a.eval(args); - typename actor_result<B, TupleT>::type rb = b.eval(args); - typename actor_result<C, TupleT>::type rc = c.eval(args); - typename actor_result<D, TupleT>::type rd = d.eval(args); - typename actor_result<E, TupleT>::type re = e.eval(args); - typename actor_result<F, TupleT>::type rf = f.eval(args); - typename actor_result<G, TupleT>::type rg = g.eval(args); - typename actor_result<H, TupleT>::type rh = h.eval(args); - typename actor_result<I, TupleT>::type ri = i.eval(args); - typename actor_result<J, TupleT>::type rj = j.eval(args); - typename actor_result<K, TupleT>::type rk = k.eval(args); - typename actor_result<L, TupleT>::type rl = l.eval(args); - typename actor_result<M, TupleT>::type rm = m.eval(args); - typename actor_result<N, TupleT>::type rn = n.eval(args); - typename actor_result<O, TupleT>::type ro = o.eval(args); - return op(ra, rb, rc, rd, re, rf, rg, rh, ri, rj, rk, rl, rm, rn, ro); - } - - mutable OperationT op; // operation - A a; B b; C c; D d; E e; F f; G g; H h; I i; J j; - K k; L l; M m; N n; O o; // actors -}; - -#endif -#endif -#endif -#endif - -namespace impl { - - /////////////////////////////////////////////////////////////////////////// - // - // make_composite is basically a type computer that answers the - // question "Given types T0..TN, what composite type should I - // create <composite_type> and if I were to generate an actual - // composite, what type <type> should I return?" - // - /////////////////////////////////////////////////////////////////////////// - template < - typename OperationT - , typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif - > - struct make_composite { - - typedef composite<OperationT - , typename as_actor<A>::type - , typename as_actor<B>::type - , typename as_actor<C>::type - -#if PHOENIX_LIMIT > 3 - , typename as_actor<D>::type - , typename as_actor<E>::type - , typename as_actor<F>::type - -#if PHOENIX_LIMIT > 6 - , typename as_actor<G>::type - , typename as_actor<H>::type - , typename as_actor<I>::type - -#if PHOENIX_LIMIT > 9 - , typename as_actor<J>::type - , typename as_actor<K>::type - , typename as_actor<L>::type - -#if PHOENIX_LIMIT > 12 - , typename as_actor<M>::type - , typename as_actor<N>::type - , typename as_actor<O>::type - -#endif -#endif -#endif -#endif - > composite_type; - - typedef actor<composite_type> type; - }; - - /////////////////////////////////////////////////////////////////////////// - // - // make_unary, make_binary, make_binary1, make_binary2 and - // make_binary3 utilities are provided here for easy creation of - // unary and binary composites. - // - /////////////////////////////////////////////////////////////////////////// - - ////////////////////////////////// input is an actor - template <typename OperationT, typename BaseT> - struct make_unary { - - typedef typename make_composite - <OperationT, actor<BaseT> >::type type; - - static type - construct(actor<BaseT> const& _0) - { - typedef typename make_composite - <OperationT, actor<BaseT> >::composite_type - ret_t; - - return ret_t(OperationT(), _0); - } - }; - - ////////////////////////////////// LHS is an actor, RHS is unknown - template <typename OperationT, typename BaseT, typename B> - struct make_binary1 { - - typedef typename make_composite - <OperationT, actor<BaseT>, B>::type type; - - static type - construct(actor<BaseT> const& _0_, B const& _1_) - { - typedef typename make_composite - <OperationT, actor<BaseT>, B>::composite_type - ret_t; - - return ret_t(OperationT(), _0_, as_actor<B>::convert(_1_)); - } - }; - - ////////////////////////////////// LHS is unknown, RHS is an actor - template <typename OperationT, typename A, typename BaseT> - struct make_binary2 { - - typedef typename make_composite - <OperationT, A, actor<BaseT> >::type type; - - static type - construct(A const& _0_, actor<BaseT> const& _1_) - { - typedef typename make_composite - <OperationT, A, actor<BaseT> >::composite_type - ret_t; - - return ret_t(OperationT(), as_actor<A>::convert(_0_), _1_); - } - }; - - ////////////////////////////////// Both LHS and RHS are actors - template <typename OperationT, typename BaseA, typename BaseB> - struct make_binary3 { - - typedef typename make_composite - <OperationT, actor<BaseA>, actor<BaseB> >::type type; - - static type - construct(actor<BaseA> const& _0_, actor<BaseB> const& _1_) - { - typedef typename make_composite - <OperationT, actor<BaseA>, actor<BaseB> >::composite_type - ret_t; - - return ret_t(OperationT(), _0_, _1_); - } - }; - -} // namespace impl - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif - -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/functions.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/functions.hpp deleted file mode 100644 index 607a77bd5f..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/functions.hpp +++ /dev/null @@ -1,760 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_FUNCTIONS_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_FUNCTIONS_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/actor.hpp> -#include <boost/spirit/home/classic/phoenix/composite.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -/////////////////////////////////////////////////////////////////////////////// -// -// function class -// -// Lazy functions -// -// This class provides a mechanism for lazily evaluating functions. -// Syntactically, a lazy function looks like an ordinary C/C++ -// function. The function call looks the same. However, unlike -// ordinary functions, the actual function execution is deferred. -// (see actor.hpp, primitives.hpp and composite.hpp for an -// overview). For example here are sample factorial function calls: -// -// factorial(4) -// factorial(arg1) -// factorial(arg1 * 6) -// -// These functions are automatically lazily bound unlike ordinary -// function pointers or functor objects that need to be explicitly -// bound through the bind function (see binders.hpp). -// -// A lazy function works in conjunction with a user defined functor -// (as usual with a member operator()). Only special forms of -// functor objects are allowed. This is required to enable true -// polymorphism (STL style monomorphic functors and function -// pointers can still be used through the bind facility in -// binders.hpp). -// -// This special functor is expected to have a nested template class -// result<A...TN> (where N is the number of arguments of its -// member operator()). The nested template class result should have -// a typedef 'type' that reflects the return type of its member -// operator(). This is essentially a type computer that answers the -// metaprogramming question "Given arguments of type A...TN, what -// will be the operator()'s return type?". -// -// There is a special case for functors that accept no arguments. -// Such nullary functors are only required to define a typedef -// result_type that reflects the return type of its operator(). -// -// Here's an example of a simple functor that computes the -// factorial of a number: -// -// struct factorial_impl { -// -// template <typename Arg> -// struct result { typedef Arg type; }; -// -// template <typename Arg> -// Arg operator()(Arg n) const -// { return (n <= 0) ? 1 : n * this->operator()(n-1); } -// }; -// -// As can be seen, the functor can be polymorphic. Its arguments -// and return type are not fixed to a particular type. The example -// above for example, can handle any type as long as it can carry -// out the required operations (i.e. <=, * and -). -// -// We can now declare and instantiate a lazy 'factorial' function: -// -// function<factorial_impl> factorial; -// -// Invoking a lazy function 'factorial' does not immediately -// execute the functor factorial_impl. Instead, a composite (see -// composite.hpp) object is created and returned to the caller. -// Example: -// -// factorial(arg1) -// -// does nothing more than return a composite. A second function -// call will invoke the actual factorial function. Example: -// -// int i = 4; -// cout << factorial(arg1)(i); -// -// will print out "24". -// -// Take note that in certain cases (e.g. for functors with state), -// an instance may be passed on to the constructor. Example: -// -// function<factorial_impl> factorial(ftor); -// -// where ftor is an instance of factorial_impl (this is not -// necessary in this case since factorial is a simple stateless -// functor). Take care though when using functors with state -// because the functors are taken in by value. It is best to keep -// the data manipulated by a functor outside the functor itself and -// keep a reference to this data inside the functor. Also, it is -// best to keep functors as small as possible. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT> -struct function { - - function() : op() {} - function(OperationT const& op_) : op(op_) {} - - actor<composite<OperationT> > - operator()() const; - - template <typename A> - typename impl::make_composite<OperationT, A>::type - operator()(A const& a) const; - - template <typename A, typename B> - typename impl::make_composite<OperationT, A, B>::type - operator()(A const& a, B const& b) const; - - template <typename A, typename B, typename C> - typename impl::make_composite<OperationT, A, B, C>::type - operator()(A const& a, B const& b, C const& c) const; - -#if PHOENIX_LIMIT > 3 - - template <typename A, typename B, typename C, typename D> - typename impl::make_composite<OperationT, A, B, C, D>::type - operator()(A const& a, B const& b, C const& c, D const& d) const; - - template <typename A, typename B, typename C, typename D, typename E> - typename impl::make_composite< - OperationT, A, B, C, D, E - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e - ) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f - ) const; - -#if PHOENIX_LIMIT > 6 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g - ) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h - ) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i - ) const; - -#if PHOENIX_LIMIT > 9 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j - ) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k - ) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l - ) const; - -#if PHOENIX_LIMIT > 12 - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m - ) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n - ) const; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O - > - typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O - >::type - operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n, O const& o - ) const; - -#endif -#endif -#endif -#endif - - OperationT op; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// function class implementation -// -/////////////////////////////////////////////////////////////////////////////// -template <typename OperationT> -inline actor<composite<OperationT> > -function<OperationT>::operator()() const -{ - return actor<composite<OperationT> >(op); -} - -////////////////////////////////// -template <typename OperationT> -template <typename A> -inline typename impl::make_composite<OperationT, A>::type -function<OperationT>::operator()(A const& a) const -{ - typedef typename impl::make_composite<OperationT, A>::composite_type ret_t; - return ret_t - ( - op, - as_actor<A>::convert(a) - ); -} - -////////////////////////////////// -template <typename OperationT> -template <typename A, typename B> -inline typename impl::make_composite<OperationT, A, B>::type -function<OperationT>::operator()(A const& a, B const& b) const -{ - typedef - typename impl::make_composite<OperationT, A, B>::composite_type - ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b) - ); -} - -////////////////////////////////// -template <typename OperationT> -template <typename A, typename B, typename C> -inline typename impl::make_composite<OperationT, A, B, C>::type -function<OperationT>::operator()(A const& a, B const& b, C const& c) const -{ - typedef - typename impl::make_composite<OperationT, A, B, C>::composite_type - ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c) - ); -} - -#if PHOENIX_LIMIT > 3 -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D -> -inline typename impl::make_composite< - OperationT, A, B, C, D ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d) - ); -} - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e) - ); -} - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f) - ); -} - -#if PHOENIX_LIMIT > 6 - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g) - ); -} - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h) - ); -} - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i) - ); -} - -#if PHOENIX_LIMIT > 9 - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j) - ); -} - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k) - ); -} - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l) - ); -} - -#if PHOENIX_LIMIT > 12 - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m) - ); -} - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m), - as_actor<N>::convert(n) - ); -} - -////////////////////////////////// -template <typename OperationT> -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O -> -inline typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O ->::type -function<OperationT>::operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n, O const& o -) const -{ - typedef typename impl::make_composite< - OperationT, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O - >::composite_type ret_t; - - return ret_t( - op, - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m), - as_actor<N>::convert(n), - as_actor<O>::convert(o) - ); -} - -#endif -#endif -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/new.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/new.hpp deleted file mode 100644 index 0b015611b8..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/new.hpp +++ /dev/null @@ -1,1315 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2003 Joel de Guzman - Copyright (c) 2001-2003 Hartmut Kaiser - Copyright (c) 2003 Vaclav Vesely - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ - -#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_NEW_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_NEW_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/actor.hpp> -#include <boost/spirit/home/classic/phoenix/composite.hpp> -#include <boost/static_assert.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -/////////////////////////////////////////////////////////////////////////////// -// -// Phoenix predefined maximum new_ limit. This limit defines the maximum -// number of parameters supported for calles to the set of new_ template -// functions (lazy object construction, see below). This number defaults to 3. -// The actual maximum is rounded up in multiples of 3. Thus, if this value -// is 4, the actual limit is 6. The ultimate maximum limit in this -// implementation is 15. -// PHOENIX_CONSTRUCT_LIMIT should NOT be greater than PHOENIX_LIMIT! - -#if !defined(PHOENIX_CONSTRUCT_LIMIT) -#define PHOENIX_CONSTRUCT_LIMIT PHOENIX_LIMIT -#endif - -// ensure PHOENIX_CONSTRUCT_LIMIT <= PHOENIX_LIMIT -BOOST_STATIC_ASSERT(PHOENIX_CONSTRUCT_LIMIT <= PHOENIX_LIMIT); - -// ensure PHOENIX_CONSTRUCT_LIMIT <= 15 -BOOST_STATIC_ASSERT(PHOENIX_CONSTRUCT_LIMIT <= 15); - -/////////////////////////////////////////////////////////////////////////////// -// -// new_ -// -// Lazy object construction -// -// The set of new_<> template classes and functions provide a way -// of lazily constructing certain object from a arbitrary set of -// actors during parsing. -// The new_ templates are (syntactically) used very much like -// the well known C++ casts: -// -// A *a = new_<A>(...arbitrary list of actors...); -// -// where the given parameters are submitted as parameters to the -// constructor of the object of type A. (This certainly implies, that -// type A has a constructor with a fitting set of parameter types -// defined.) -// -// The maximum number of needed parameters is controlled through the -// preprocessor constant PHOENIX_CONSTRUCT_LIMIT. Note though, that this -// limit should not be greater than PHOENIX_LIMIT. -// -/////////////////////////////////////////////////////////////////////////////// - -template <typename T> -struct new_l_0 -{ - typedef T* result_type; - - T* operator()() const - { - return new T(); - } -}; - -template <typename T> -struct new_l { - - template < - typename A - , typename B - , typename C - -#if PHOENIX_CONSTRUCT_LIMIT > 3 - , typename D - , typename E - , typename F - -#if PHOENIX_CONSTRUCT_LIMIT > 6 - , typename G - , typename H - , typename I - -#if PHOENIX_CONSTRUCT_LIMIT > 9 - , typename J - , typename K - , typename L - -#if PHOENIX_CONSTRUCT_LIMIT > 12 - , typename M - , typename N - , typename O -#endif -#endif -#endif -#endif - > - struct result { typedef T* type; }; - - T* operator()() const { - return new T(); - } - - template <typename A> - T* operator()(A const& a) const { - return new T(a); - } - - template <typename A, typename B> - T* operator()(A const& a, B const& b) const { - return new T(a, b); - } - - template <typename A, typename B, typename C> - T* operator()(A const& a, B const& b, C const& c) const { - return new T(a, b, c); - } - -#if PHOENIX_CONSTRUCT_LIMIT > 3 - template < - typename A, typename B, typename C, typename D - > - T* operator()( - A const& a, B const& b, C const& c, D const& d) const - { - return new T(a, b, c, d); - } - - template < - typename A, typename B, typename C, typename D, typename E - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e) const - { - return new T(a, b, c, d, e); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f) const - { - return new T(a, b, c, d, e, f); - } - -#if PHOENIX_CONSTRUCT_LIMIT > 6 - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g) const - { - return new T(a, b, c, d, e, f, g); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h) const - { - return new T(a, b, c, d, e, f, g, h); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i) const - { - return new T(a, b, c, d, e, f, g, h, i); - } - -#if PHOENIX_CONSTRUCT_LIMIT > 9 - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j) const - { - return new T(a, b, c, d, e, f, g, h, i, j); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k) const - { - return new T(a, b, c, d, e, f, g, h, i, j, k); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l) const - { - return new T(a, b, c, d, e, f, g, h, i, j, k, l); - } - -#if PHOENIX_CONSTRUCT_LIMIT > 12 - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m) const - { - return new T(a, b, c, d, e, f, g, h, i, j, k, l, m); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n) const - { - return new T(a, b, c, d, e, f, g, h, i, j, k, l, m, n); - } - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n, O const& o) const - { - return new T(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o); - } - -#endif -#endif -#endif -#endif -}; - -template <typename T> -struct new_1 { - - template < - typename A - > - struct result { typedef T* type; }; - - template <typename A> - T* operator()(A const& a) const { - return new T(a); - } - -}; - -template <typename T> -struct new_2 { - - template < - typename A - , typename B - > - struct result { typedef T* type; }; - - template <typename A, typename B> - T* operator()(A const& a, B const& b) const { - return new T(a, b); - } - -}; - -template <typename T> -struct new_3 { - - template < - typename A - , typename B - , typename C - > - struct result { typedef T* type; }; - - template <typename A, typename B, typename C> - T* operator()(A const& a, B const& b, C const& c) const { - return new T(a, b, c); - } -}; - -#if PHOENIX_CONSTRUCT_LIMIT > 3 -template <typename T> -struct new_4 { - - template < - typename A - , typename B - , typename C - , typename D - > - struct result { typedef T* type; }; - - - template < - typename A, typename B, typename C, typename D - > - T* operator()( - A const& a, B const& b, C const& c, D const& d) const - { - return new T(a, b, c, d); - } -}; - - -template <typename T> -struct new_5 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - > - struct result { typedef T* type; }; - - template < - typename A, typename B, typename C, typename D, typename E - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e) const - { - return new T(a, b, c, d, e); - } -}; - - -template <typename T> -struct new_6 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - > - struct result { typedef T* type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f) const - { - return new T(a, b, c, d, e, f); - } -}; -#endif - - -#if PHOENIX_CONSTRUCT_LIMIT > 6 -template <typename T> -struct new_7 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - > - struct result { typedef T* type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g) const - { - return new T(a, b, c, d, e, f, g); - } -}; - -template <typename T> -struct new_8 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - > - struct result { typedef T* type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h) const - { - return new T(a, b, c, d, e, f, g, h); - } -}; - -template <typename T> -struct new_9 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - > - struct result { typedef T* type; }; - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i) const - { - return new T(a, b, c, d, e, f, g, h, i); - } -}; -#endif - - -#if PHOENIX_CONSTRUCT_LIMIT > 9 -template <typename T> -struct new_10 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - > - struct result { typedef T* type; }; - - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j) const - { - return new T(a, b, c, d, e, f, g, h, i, j); - } -}; - -template <typename T> -struct new_11 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - > - struct result { typedef T* type; }; - - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k) const - { - return new T(a, b, c, d, e, f, g, h, i, j, k); - } - -}; - -template <typename T> -struct new_12 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - , typename L - > - struct result { typedef T* type; }; - - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l) const - { - return new T(a, b, c, d, f, e, g, h, i, j, k, l); - } -}; -#endif - -#if PHOENIX_CONSTRUCT_LIMIT > 12 -template <typename T> -struct new_13 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - , typename L - , typename M - > - struct result { typedef T* type; }; - - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m) const - { - return new T(a, b, c, d, e, f, g, h, i, j, k, l, m); - } -}; - -template <typename T> -struct new_14 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - , typename L - , typename M - , typename N - > - struct result { typedef T* type; }; - - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n) const - { - return new T(a, b, c, d, e, f, g, h, i, j, k, l, m, n); - } - -}; - -template <typename T> -struct new_15 { - - template < - typename A - , typename B - , typename C - , typename D - , typename E - , typename F - , typename G - , typename H - , typename I - , typename J - , typename K - , typename L - , typename M - , typename N - , typename O - > - struct result { typedef T* type; }; - - - template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O - > - T* operator()( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n, O const& o) const - { - return new T(a, b, c, d, f, e, g, h, i, j, k, l, m, n, o); - } - -}; -#endif - - -#if defined(BOOST_BORLANDC) || (defined(__MWERKS__) && (__MWERKS__ <= 0x3002)) - -/////////////////////////////////////////////////////////////////////////////// -// -// The following specializations are needed because Borland and CodeWarrior -// does not accept default template arguments in nested template classes in -// classes (i.e new_l::result) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T, typename TupleT> -struct composite0_result<new_l_0<T>, TupleT> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A> -struct composite1_result<new_l<T>, TupleT, A> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B> -struct composite2_result<new_l<T>, TupleT, A, B> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C> -struct composite3_result<new_l<T>, TupleT, A, B, C> { - - typedef T* type; -}; - -#if PHOENIX_LIMIT > 3 -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D> -struct composite4_result<new_l<T>, TupleT, - A, B, C, D> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E> -struct composite5_result<new_l<T>, TupleT, - A, B, C, D, E> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F> -struct composite6_result<new_l<T>, TupleT, - A, B, C, D, E, F> { - - typedef T* type; -}; - -#if PHOENIX_LIMIT > 6 -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G> -struct composite7_result<new_l<T>, TupleT, - A, B, C, D, E, F, G> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H> -struct composite8_result<new_l<T>, TupleT, - A, B, C, D, E, F, G, H> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I> -struct composite9_result<new_l<T>, TupleT, - A, B, C, D, E, F, G, H, I> { - - typedef T* type; -}; - -#if PHOENIX_LIMIT > 9 -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J> -struct composite10_result<new_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K> -struct composite11_result<new_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L> -struct composite12_result<new_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L> { - - typedef T* type; -}; - -#if PHOENIX_LIMIT > 12 -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M> -struct composite13_result<new_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N> -struct composite14_result<new_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N> { - - typedef T* type; -}; - -////////////////////////////////// -template <typename T, typename TupleT, - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O> -struct composite15_result<new_l<T>, TupleT, - A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> { - - typedef T* type; -}; - -#endif -#endif -#endif -#endif -#endif - -////////////////////////////////// -template <typename T> -inline typename impl::make_composite<new_l_0<T> >::type -new_() -{ - typedef impl::make_composite<new_l_0<T> > make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_l_0<T>())); -} - -////////////////////////////////// -template <typename T, typename A> -inline typename impl::make_composite<new_1<T>, A>::type -new_(A const& a) -{ - typedef impl::make_composite<new_1<T>, A> make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_1<T>(), - as_actor<A>::convert(a) - )); -} - -////////////////////////////////// -template <typename T, typename A, typename B> -inline typename impl::make_composite<new_2<T>, A, B>::type -new_(A const& a, B const& b) -{ - typedef impl::make_composite<new_2<T>, A, B> make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_2<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b) - )); -} - -////////////////////////////////// -template <typename T, typename A, typename B, typename C> -inline typename impl::make_composite<new_3<T>, A, B, C>::type -new_(A const& a, B const& b, C const& c) -{ - typedef impl::make_composite<new_3<T>, A, B, C> make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_3<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c) - )); -} - -#if PHOENIX_CONSTRUCT_LIMIT > 3 -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D -> -inline typename impl::make_composite<new_4<T>, A, B, C, D>::type -new_( - A const& a, B const& b, C const& c, D const& d) -{ - typedef - impl::make_composite<new_4<T>, A, B, C, D> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_4<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E -> -inline typename impl::make_composite<new_5<T>, A, B, C, D, E>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e) -{ - typedef - impl::make_composite<new_5<T>, A, B, C, D, E> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_5<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F -> -inline typename impl::make_composite<new_6<T>, A, B, C, D, E, F>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f) -{ - typedef - impl::make_composite<new_6<T>, A, B, C, D, E, F> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_6<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f) - )); -} - -#if PHOENIX_CONSTRUCT_LIMIT > 6 -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G -> -inline typename impl::make_composite<new_7<T>, A, B, C, D, E, F, G>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g) -{ - typedef - impl::make_composite<new_7<T>, A, B, C, D, E, F, G> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_7<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H -> -inline typename impl::make_composite<new_8<T>, A, B, C, D, E, F, G, H>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h) -{ - typedef - impl::make_composite<new_8<T>, A, B, C, D, E, F, G, H> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_8<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I -> -inline typename impl::make_composite<new_9<T>, A, B, C, D, E, F, G, H, I>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i) -{ - typedef - impl::make_composite<new_9<T>, A, B, C, D, E, F, G, H, I> - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_9<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i) - )); -} - -#if PHOENIX_CONSTRUCT_LIMIT > 9 -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J -> -inline typename impl::make_composite< - new_10<T>, A, B, C, D, E, F, G, H, I, J>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j) -{ - typedef - impl::make_composite< - new_10<T>, A, B, C, D, E, F, G, H, I, J - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_10<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K -> -inline typename impl::make_composite< - new_11<T>, A, B, C, D, E, F, G, H, I, J, K>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k) -{ - typedef - impl::make_composite< - new_11<T>, A, B, C, D, E, F, G, H, I, J, K - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_11<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K, - typename L -> -inline typename impl::make_composite< - new_12<T>, A, B, C, D, E, F, G, H, I, J, K, L>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l) -{ - typedef - impl::make_composite< - new_12<T>, A, B, C, D, E, F, G, H, I, J, K, L - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_12<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l) - )); -} - -#if PHOENIX_CONSTRUCT_LIMIT > 12 -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K, - typename L, typename M -> -inline typename impl::make_composite< - new_13<T>, A, B, C, D, E, F, G, H, I, J, K, L, M>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m) -{ - typedef - impl::make_composite< - new_13<T>, A, B, C, D, E, F, G, H, I, J, K, L, M - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_13<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K, - typename L, typename M, typename N -> -inline typename impl::make_composite< - new_14<T>, A, B, C, D, E, F, G, H, I, J, K, L, M>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n) -{ - typedef - impl::make_composite< - new_14<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, N - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_14<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m), - as_actor<N>::convert(n) - )); -} - -////////////////////////////////// -template < - typename T, typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, typename K, - typename L, typename M, typename N, typename O -> -inline typename impl::make_composite< - new_15<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, O>::type -new_( - A const& a, B const& b, C const& c, D const& d, E const& e, - F const& f, G const& g, H const& h, I const& i, J const& j, - K const& k, L const& l, M const& m, N const& n, O const& o) -{ - typedef - impl::make_composite< - new_15<T>, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O - > - make_composite_t; - typedef typename make_composite_t::type type_t; - typedef typename make_composite_t::composite_type composite_type_t; - - return type_t(composite_type_t(new_15<T>(), - as_actor<A>::convert(a), - as_actor<B>::convert(b), - as_actor<C>::convert(c), - as_actor<D>::convert(d), - as_actor<E>::convert(e), - as_actor<F>::convert(f), - as_actor<G>::convert(g), - as_actor<H>::convert(h), - as_actor<I>::convert(i), - as_actor<J>::convert(j), - as_actor<K>::convert(k), - as_actor<L>::convert(l), - as_actor<M>::convert(m), - as_actor<N>::convert(n), - as_actor<O>::convert(o) - )); -} - -#endif -#endif -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/operators.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/operators.hpp deleted file mode 100644 index 646169d428..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/operators.hpp +++ /dev/null @@ -1,2203 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_OPERATORS_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_OPERATORS_HPP - -/////////////////////////////////////////////////////////////////////////////// -#if !defined(BOOST_NO_CWCTYPE) - #include <cwctype> -#endif - -#if (defined(__BORLANDC__) && !defined(__clang__)) || (defined(__ICL) && __ICL >= 700) -#define CREF const& -#else -#define CREF -#endif - -#include <climits> -#include <boost/spirit/home/classic/phoenix/actor.hpp> -#include <boost/spirit/home/classic/phoenix/composite.hpp> -#include <boost/config.hpp> -#include <boost/mpl/if.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -/////////////////////////////////////////////////////////////////////////////// -// -// Operators -// -// Lazy operators -// -// This class provides a mechanism for lazily evaluating operators. -// Syntactically, a lazy operator looks like an ordinary C/C++ -// infix, prefix or postfix operator. The operator application -// looks the same. However, unlike ordinary operators, the actual -// operator execution is deferred. (see actor.hpp, primitives.hpp -// and composite.hpp for an overview). Samples: -// -// arg1 + arg2 -// 1 + arg1 * arg2 -// 1 / -arg1 -// arg1 < 150 -// -// T1 set of classes implement all the C++ free operators. Like -// lazy functions (see functions.hpp), lazy operators are not -// immediately executed when invoked. Instead, a composite (see -// composite.hpp) object is created and returned to the caller. -// Example: -// -// (arg1 + arg2) * arg3 -// -// does nothing more than return a composite. T1 second function -// call will evaluate the actual operators. Example: -// -// int i = 4, j = 5, k = 6; -// cout << ((arg1 + arg2) * arg3)(i, j, k); -// -// will print out "54". -// -// Arbitrarily complex expressions can be lazily evaluated -// following three simple rules: -// -// 1) Lazy evaluated binary operators apply when at least one -// of the operands is an actor object (see actor.hpp and -// primitives.hpp). Consequently, if an operand is not an actor -// object, it is implicitly converted to an object of type -// actor<value<T> > (where T is the original type of the -// operand). -// -// 2) Lazy evaluated unary operators apply only to operands -// which are actor objects. -// -// 3) The result of a lazy operator is a composite actor object -// that can in turn apply to rule 1. -// -// Example: -// -// arg1 + 3 -// -// is a lazy expression involving the operator+. Following rule 1, -// lazy evaluation is triggered since arg1 is an instance of an -// actor<argument<N> > class (see primitives.hpp). The right -// operand <3> is implicitly converted to an actor<value<int> >. -// The result of this binary + expression is a composite object, -// following rule 3. -// -// Take note that although at least one of the operands must be a -// valid actor class in order for lazy evaluation to take effect, -// if this is not the case and we still want to lazily evaluate an -// expression, we can use var(x), val(x) or cref(x) to transform -// the operand into a valid action object (see primitives.hpp). -// Example: -// -// val(1) << 3; -// -// Supported operators: -// -// Unary operators: -// -// prefix: ~, !, -, +, ++, --, & (reference), * (dereference) -// postfix: ++, -- -// -// Binary operators: -// -// =, [], +=, -=, *=, /=, %=, &=, |=, ^=, <<=, >>= -// +, -, *, /, %, &, |, ^, <<, >> -// ==, !=, <, >, <=, >= -// &&, || -// -// Each operator has a special tag type associated with it. For -// example the binary + operator has a plus_op tag type associated -// with it. This is used to specialize either the unary_operator or -// binary_operator template classes (see unary_operator and -// binary_operator below). Specializations of these unary_operator -// and binary_operator are the actual workhorses that implement the -// operations. The behavior of each lazy operator depends on these -// unary_operator and binary_operator specializations. 'preset' -// specializations conform to the canonical operator rules modeled -// by the behavior of integers and pointers: -// -// Prefix -, + and ~ accept constant arguments and return an -// object by value. -// -// The ! accept constant arguments and returns a boolean -// result. -// -// The & (address-of), * (dereference) both return a reference -// to an object. -// -// Prefix ++ returns a reference to its mutable argument after -// it is incremented. -// -// Postfix ++ returns the mutable argument by value before it -// is incremented. -// -// The += and its family accept mutable right hand side (rhs) -// operand and return a reference to the rhs operand. -// -// Infix + and its family accept constant arguments and return -// an object by value. -// -// The == and its family accept constant arguments and return a -// boolean result. -// -// Operators && and || accept constant arguments and return a -// boolean result and are short circuit evaluated as expected. -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// -// Operator tags -// -// Each C++ operator has a corresponding tag type. This is -// used as a means for specializing the unary_operator and -// binary_operator (see below). The tag also serves as the -// lazy operator type compatible as a composite operation -// see (composite.hpp). -// -/////////////////////////////////////////////////////////////////////////////// - -// Unary operator tags - -struct negative_op; struct positive_op; -struct logical_not_op; struct invert_op; -struct reference_op; struct dereference_op; -struct pre_incr_op; struct pre_decr_op; -struct post_incr_op; struct post_decr_op; - -// Binary operator tags - -struct assign_op; struct index_op; -struct plus_assign_op; struct minus_assign_op; -struct times_assign_op; struct divide_assign_op; struct mod_assign_op; -struct and_assign_op; struct or_assign_op; struct xor_assign_op; -struct shift_l_assign_op; struct shift_r_assign_op; - -struct plus_op; struct minus_op; -struct times_op; struct divide_op; struct mod_op; -struct and_op; struct or_op; struct xor_op; -struct shift_l_op; struct shift_r_op; - -struct eq_op; struct not_eq_op; -struct lt_op; struct lt_eq_op; -struct gt_op; struct gt_eq_op; -struct logical_and_op; struct logical_or_op; - -/////////////////////////////////////////////////////////////////////////////// -// -// unary_operator<TagT, T> -// -// The unary_operator class implements most of the C++ unary -// operators. Each specialization is basically a simple static eval -// function plus a result_type typedef that determines the return -// type of the eval function. -// -// TagT is one of the unary operator tags above and T is the data -// type (argument) involved in the operation. -// -// Only the behavior of C/C++ built-in types are taken into account -// in the specializations provided below. For user-defined types, -// these specializations may still be used provided that the -// operator overloads of such types adhere to the standard behavior -// of built-in types. -// -// T1 separate special_ops.hpp file implements more stl savvy -// specializations. Other more specialized unary_operator -// implementations may be defined by the client for specific -// unary operator tags/data types. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename TagT, typename T> -struct unary_operator; - -////////////////////////////////// -template <typename T> -struct unary_operator<negative_op, T> { - - typedef T const result_type; - static result_type eval(T const& v) - { return -v; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<positive_op, T> { - - typedef T const result_type; - static result_type eval(T const& v) - { return +v; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<logical_not_op, T> { - - typedef T const result_type; - static result_type eval(T const& v) - { return !v; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<invert_op, T> { - - typedef T const result_type; - static result_type eval(T const& v) - { return ~v; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<reference_op, T> { - - typedef T* result_type; - static result_type eval(T& v) - { return &v; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<dereference_op, T*> { - - typedef T& result_type; - static result_type eval(T* v) - { return *v; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<dereference_op, T* const> { - - typedef T& result_type; - static result_type eval(T* const v) - { return *v; } -}; - -////////////////////////////////// -template <> -struct unary_operator<dereference_op, nil_t> { - - // G++ eager template instantiation - // somehow requires this. - typedef nil_t result_type; -}; - -////////////////////////////////// -#ifndef BOOST_BORLANDC -template <> -struct unary_operator<dereference_op, nil_t const> { - - // G++ eager template instantiation - // somehow requires this. - typedef nil_t result_type; -}; -#endif - -////////////////////////////////// -template <typename T> -struct unary_operator<pre_incr_op, T> { - - typedef T& result_type; - static result_type eval(T& v) - { return ++v; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<pre_decr_op, T> { - - typedef T& result_type; - static result_type eval(T& v) - { return --v; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<post_incr_op, T> { - - typedef T const result_type; - static result_type eval(T& v) - { T t(v); ++v; return t; } -}; - -////////////////////////////////// -template <typename T> -struct unary_operator<post_decr_op, T> { - - typedef T const result_type; - static result_type eval(T& v) - { T t(v); --v; return t; } -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// rank<T> -// -// rank<T> class has a static int constant 'value' that defines the -// absolute rank of a type. rank<T> is used to choose the result -// type of binary operators such as +. The type with the higher -// rank wins and is used as the operator's return type. T1 generic -// user defined type has a very high rank and always wins when -// compared against a user defined type. If this is not desirable, -// one can write a rank specialization for the type. -// -// Take note that ranks 0..9999 are reserved for the framework. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T> -struct rank { static int const value = INT_MAX; }; - -template <> struct rank<void> { static int const value = 0; }; -template <> struct rank<bool> { static int const value = 10; }; - -template <> struct rank<char> { static int const value = 20; }; -template <> struct rank<signed char> { static int const value = 20; }; -template <> struct rank<unsigned char> { static int const value = 30; }; -#if !defined(BOOST_NO_INTRINSIC_WCHAR_T) -template <> struct rank<wchar_t> { static int const value = 40; }; -#endif // !defined(BOOST_NO_INTRINSIC_WCHAR_T) - -template <> struct rank<short> { static int const value = 50; }; -template <> struct rank<unsigned short> { static int const value = 60; }; - -template <> struct rank<int> { static int const value = 70; }; -template <> struct rank<unsigned int> { static int const value = 80; }; - -template <> struct rank<long> { static int const value = 90; }; -template <> struct rank<unsigned long> { static int const value = 100; }; - -#ifdef BOOST_HAS_LONG_LONG -template <> struct rank< ::boost::long_long_type> { static int const value = 110; }; -template <> struct rank< ::boost::ulong_long_type> { static int const value = 120; }; -#endif - -template <> struct rank<float> { static int const value = 130; }; -template <> struct rank<double> { static int const value = 140; }; -template <> struct rank<long double> { static int const value = 150; }; - -template <typename T> struct rank<T*> -{ static int const value = 160; }; - -template <typename T> struct rank<T* const> -{ static int const value = 160; }; - -template <typename T, int N> struct rank<T[N]> -{ static int const value = 160; }; - -/////////////////////////////////////////////////////////////////////////////// -// -// higher_rank<T0, T1> -// -// Chooses the type (T0 or T1) with the higher rank. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T0, typename T1> -struct higher_rank { - typedef typename boost::mpl::if_c< - rank<T0>::value < rank<T1>::value, - T1, T0>::type type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// binary_operator<TagT, T0, T1> -// -// The binary_operator class implements most of the C++ binary -// operators. Each specialization is basically a simple static eval -// function plus a result_type typedef that determines the return -// type of the eval function. -// -// TagT is one of the binary operator tags above T0 and T1 are the -// (arguments') data types involved in the operation. -// -// Only the behavior of C/C++ built-in types are taken into account -// in the specializations provided below. For user-defined types, -// these specializations may still be used provided that the -// operator overloads of such types adhere to the standard behavior -// of built-in types. -// -// T1 separate special_ops.hpp file implements more stl savvy -// specializations. Other more specialized unary_operator -// implementations may be defined by the client for specific -// unary operator tags/data types. -// -// All binary_operator except the logical_and_op and logical_or_op -// have an eval static function that carries out the actual operation. -// The logical_and_op and logical_or_op d are special because these -// two operators are short-circuit evaluated. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename TagT, typename T0, typename T1> -struct binary_operator; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs = rhs; } -}; - -////////////////////////////////// -template <typename T1> -struct binary_operator<index_op, nil_t, T1> { - - // G++ eager template instantiation - // somehow requires this. - typedef nil_t result_type; -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<index_op, T0*, T1> { - - typedef T0& result_type; - static result_type eval(T0* ptr, T1 const& index) - { return ptr[index]; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<index_op, T0* const, T1> { - - typedef T0& result_type; - static result_type eval(T0* const ptr, T1 const& index) - { return ptr[index]; } -}; - -////////////////////////////////// -template <typename T0, int N, typename T1> -struct binary_operator<index_op, T0[N], T1> { - - typedef T0& result_type; - static result_type eval(T0* ptr, T1 const& index) - { return ptr[index]; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<plus_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs += rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<minus_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs -= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<times_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs *= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<divide_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs /= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<mod_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs %= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<and_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs &= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<or_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs |= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<xor_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs ^= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<shift_l_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs <<= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<shift_r_assign_op, T0, T1> { - - typedef T0& result_type; - static result_type eval(T0& lhs, T1 const& rhs) - { return lhs >>= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<plus_op, T0, T1> { - - typedef typename higher_rank<T0, T1>::type const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs + rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<minus_op, T0, T1> { - - typedef typename higher_rank<T0, T1>::type const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs - rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<times_op, T0, T1> { - - typedef typename higher_rank<T0, T1>::type const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs * rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<divide_op, T0, T1> { - - typedef typename higher_rank<T0, T1>::type const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs / rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<mod_op, T0, T1> { - - typedef typename higher_rank<T0, T1>::type const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs % rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<and_op, T0, T1> { - - typedef typename higher_rank<T0, T1>::type const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs & rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<or_op, T0, T1> { - - typedef typename higher_rank<T0, T1>::type const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs | rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<xor_op, T0, T1> { - - typedef typename higher_rank<T0, T1>::type const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs ^ rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<shift_l_op, T0, T1> { - - typedef T0 const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs << rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<shift_r_op, T0, T1> { - - typedef T0 const result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs >> rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<eq_op, T0, T1> { - - typedef bool result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs == rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<not_eq_op, T0, T1> { - - typedef bool result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs != rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<lt_op, T0, T1> { - - typedef bool result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs < rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<lt_eq_op, T0, T1> { - - typedef bool result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs <= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<gt_op, T0, T1> { - - typedef bool result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs > rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<gt_eq_op, T0, T1> { - - typedef bool result_type; - static result_type eval(T0 const& lhs, T1 const& rhs) - { return lhs >= rhs; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<logical_and_op, T0, T1> { - - typedef bool result_type; - // no eval function, see comment above. -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<logical_or_op, T0, T1> { - - typedef bool result_type; - // no eval function, see comment above. -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// negative lazy operator (prefix -) -// -/////////////////////////////////////////////////////////////////////////////// -struct negative_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<negative_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<negative_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<negative_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<negative_op, BaseT>::type -operator-(actor<BaseT> const& _0) -{ - return impl::make_unary<negative_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// positive lazy operator (prefix +) -// -/////////////////////////////////////////////////////////////////////////////// -struct positive_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<positive_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<positive_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<positive_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<positive_op, BaseT>::type -operator+(actor<BaseT> const& _0) -{ - return impl::make_unary<positive_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// logical not lazy operator (prefix !) -// -/////////////////////////////////////////////////////////////////////////////// -struct logical_not_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<logical_not_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<logical_not_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<logical_not_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<logical_not_op, BaseT>::type -operator!(actor<BaseT> const& _0) -{ - return impl::make_unary<logical_not_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// invert lazy operator (prefix ~) -// -/////////////////////////////////////////////////////////////////////////////// -struct invert_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<invert_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<invert_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<invert_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<invert_op, BaseT>::type -operator~(actor<BaseT> const& _0) -{ - return impl::make_unary<invert_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// reference lazy operator (prefix &) -// -/////////////////////////////////////////////////////////////////////////////// -struct reference_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<reference_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<reference_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<reference_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<reference_op, BaseT>::type -operator&(actor<BaseT> const& _0) -{ - return impl::make_unary<reference_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// dereference lazy operator (prefix *) -// -/////////////////////////////////////////////////////////////////////////////// -struct dereference_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<dereference_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<dereference_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<dereference_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<dereference_op, BaseT>::type -operator*(actor<BaseT> const& _0) -{ - return impl::make_unary<dereference_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// pre increment lazy operator (prefix ++) -// -/////////////////////////////////////////////////////////////////////////////// -struct pre_incr_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<pre_incr_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<pre_incr_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<pre_incr_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<pre_incr_op, BaseT>::type -operator++(actor<BaseT> const& _0) -{ - return impl::make_unary<pre_incr_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// pre decrement lazy operator (prefix --) -// -/////////////////////////////////////////////////////////////////////////////// -struct pre_decr_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<pre_decr_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<pre_decr_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<pre_decr_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<pre_decr_op, BaseT>::type -operator--(actor<BaseT> const& _0) -{ - return impl::make_unary<pre_decr_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// post increment lazy operator (postfix ++) -// -/////////////////////////////////////////////////////////////////////////////// -struct post_incr_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<post_incr_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<post_incr_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<post_incr_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<post_incr_op, BaseT>::type -operator++(actor<BaseT> const& _0, int) -{ - return impl::make_unary<post_incr_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// post decrement lazy operator (postfix --) -// -/////////////////////////////////////////////////////////////////////////////// -struct post_decr_op { - - template <typename T0> - struct result { - - typedef typename unary_operator<post_decr_op, T0>::result_type type; - }; - - template <typename T0> - typename unary_operator<post_decr_op, T0>::result_type - operator()(T0& _0) const - { return unary_operator<post_decr_op, T0>::eval(_0); } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_unary<post_decr_op, BaseT>::type -operator--(actor<BaseT> const& _0, int) -{ - return impl::make_unary<post_decr_op, BaseT>::construct(_0); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// assignment lazy operator (infix =) -// The acual lazy operator is a member of the actor class. -// -/////////////////////////////////////////////////////////////////////////////// -struct assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT> -template <typename B> -inline typename impl::make_binary1<assign_op, BaseT, B>::type -actor<BaseT>::operator=(B const& _1) const -{ - return impl::make_binary1<assign_op, BaseT, B>::construct(*this, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// index lazy operator (array index []) -// The acual lazy operator is a member of the actor class. -// -/////////////////////////////////////////////////////////////////////////////// -struct index_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<index_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<index_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<index_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT> -template <typename B> -inline typename impl::make_binary1<index_op, BaseT, B>::type -actor<BaseT>::operator[](B const& _1) const -{ - return impl::make_binary1<index_op, BaseT, B>::construct(*this, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// plus assign lazy operator (infix +=) -// -/////////////////////////////////////////////////////////////////////////////// -struct plus_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<plus_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<plus_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<plus_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<plus_assign_op, BaseT, T1>::type -operator+=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<plus_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// minus assign lazy operator (infix -=) -// -/////////////////////////////////////////////////////////////////////////////// -struct minus_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<minus_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<minus_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<minus_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<minus_assign_op, BaseT, T1>::type -operator-=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<minus_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// times assign lazy operator (infix *=) -// -/////////////////////////////////////////////////////////////////////////////// -struct times_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<times_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<times_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<times_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<times_assign_op, BaseT, T1>::type -operator*=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<times_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// divide assign lazy operator (infix /=) -// -/////////////////////////////////////////////////////////////////////////////// -struct divide_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<divide_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<divide_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<divide_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<divide_assign_op, BaseT, T1>::type -operator/=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<divide_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// mod assign lazy operator (infix %=) -// -/////////////////////////////////////////////////////////////////////////////// -struct mod_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<mod_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<mod_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<mod_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<mod_assign_op, BaseT, T1>::type -operator%=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<mod_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// and assign lazy operator (infix &=) -// -/////////////////////////////////////////////////////////////////////////////// -struct and_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<and_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<and_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<and_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<and_assign_op, BaseT, T1>::type -operator&=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<and_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// or assign lazy operator (infix |=) -// -/////////////////////////////////////////////////////////////////////////////// -struct or_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<or_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<or_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<or_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<or_assign_op, BaseT, T1>::type -operator|=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<or_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// xor assign lazy operator (infix ^=) -// -/////////////////////////////////////////////////////////////////////////////// -struct xor_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<xor_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<xor_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<xor_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<xor_assign_op, BaseT, T1>::type -operator^=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<xor_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// shift left assign lazy operator (infix <<=) -// -/////////////////////////////////////////////////////////////////////////////// -struct shift_l_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<shift_l_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<shift_l_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<shift_l_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<shift_l_assign_op, BaseT, T1>::type -operator<<=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<shift_l_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// shift right assign lazy operator (infix >>=) -// -/////////////////////////////////////////////////////////////////////////////// -struct shift_r_assign_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<shift_r_assign_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<shift_r_assign_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<shift_r_assign_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<shift_r_assign_op, BaseT, T1>::type -operator>>=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<shift_r_assign_op, BaseT, T1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// plus lazy operator (infix +) -// -/////////////////////////////////////////////////////////////////////////////// -struct plus_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<plus_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<plus_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<plus_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<plus_op, BaseT, T1>::type -operator+(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<plus_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<plus_op, T0, BaseT>::type -operator+(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<plus_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<plus_op, BaseT0, BaseT1>::type -operator+(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<plus_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// minus lazy operator (infix -) -// -/////////////////////////////////////////////////////////////////////////////// -struct minus_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<minus_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<minus_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<minus_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<minus_op, BaseT, T1>::type -operator-(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<minus_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<minus_op, T0, BaseT>::type -operator-(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<minus_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<minus_op, BaseT0, BaseT1>::type -operator-(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<minus_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// times lazy operator (infix *) -// -/////////////////////////////////////////////////////////////////////////////// -struct times_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<times_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<times_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<times_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<times_op, BaseT, T1>::type -operator*(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<times_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<times_op, T0, BaseT>::type -operator*(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<times_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<times_op, BaseT0, BaseT1>::type -operator*(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<times_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// divide lazy operator (infix /) -// -/////////////////////////////////////////////////////////////////////////////// -struct divide_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<divide_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<divide_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<divide_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<divide_op, BaseT, T1>::type -operator/(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<divide_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<divide_op, T0, BaseT>::type -operator/(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<divide_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<divide_op, BaseT0, BaseT1>::type -operator/(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<divide_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// mod lazy operator (infix %) -// -/////////////////////////////////////////////////////////////////////////////// -struct mod_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<mod_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<mod_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<mod_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<mod_op, BaseT, T1>::type -operator%(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<mod_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<mod_op, T0, BaseT>::type -operator%(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<mod_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<mod_op, BaseT0, BaseT1>::type -operator%(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<mod_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// and lazy operator (infix &) -// -/////////////////////////////////////////////////////////////////////////////// -struct and_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<and_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<and_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<and_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<and_op, BaseT, T1>::type -operator&(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<and_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<and_op, T0, BaseT>::type -operator&(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<and_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<and_op, BaseT0, BaseT1>::type -operator&(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<and_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// or lazy operator (infix |) -// -/////////////////////////////////////////////////////////////////////////////// -struct or_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<or_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<or_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<or_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<or_op, BaseT, T1>::type -operator|(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<or_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<or_op, T0, BaseT>::type -operator|(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<or_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<or_op, BaseT0, BaseT1>::type -operator|(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<or_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// xor lazy operator (infix ^) -// -/////////////////////////////////////////////////////////////////////////////// -struct xor_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<xor_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<xor_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<xor_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<xor_op, BaseT, T1>::type -operator^(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<xor_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<xor_op, T0, BaseT>::type -operator^(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<xor_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<xor_op, BaseT0, BaseT1>::type -operator^(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<xor_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// shift left lazy operator (infix <<) -// -/////////////////////////////////////////////////////////////////////////////// -struct shift_l_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<shift_l_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<shift_l_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<shift_l_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<shift_l_op, BaseT, T1>::type -operator<<(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<shift_l_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<shift_l_op, T0, BaseT>::type -operator<<(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<shift_l_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<shift_l_op, BaseT0, BaseT1>::type -operator<<(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<shift_l_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// shift right lazy operator (infix >>) -// -/////////////////////////////////////////////////////////////////////////////// -struct shift_r_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<shift_r_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<shift_r_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<shift_r_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<shift_r_op, BaseT, T1>::type -operator>>(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<shift_r_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<shift_r_op, T0, BaseT>::type -operator>>(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<shift_r_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<shift_r_op, BaseT0, BaseT1>::type -operator>>(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<shift_r_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// equal lazy operator (infix ==) -// -/////////////////////////////////////////////////////////////////////////////// -struct eq_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<eq_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<eq_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<eq_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<eq_op, BaseT, T1>::type -operator==(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<eq_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<eq_op, T0, BaseT>::type -operator==(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<eq_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<eq_op, BaseT0, BaseT1>::type -operator==(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<eq_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// not equal lazy operator (infix !=) -// -/////////////////////////////////////////////////////////////////////////////// -struct not_eq_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<not_eq_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<not_eq_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<not_eq_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<not_eq_op, BaseT, T1>::type -operator!=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<not_eq_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<not_eq_op, T0, BaseT>::type -operator!=(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<not_eq_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<not_eq_op, BaseT0, BaseT1>::type -operator!=(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<not_eq_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// less than lazy operator (infix <) -// -/////////////////////////////////////////////////////////////////////////////// -struct lt_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<lt_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<lt_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<lt_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<lt_op, BaseT, T1>::type -operator<(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<lt_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<lt_op, T0, BaseT>::type -operator<(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<lt_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<lt_op, BaseT0, BaseT1>::type -operator<(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<lt_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// less than equal lazy operator (infix <=) -// -/////////////////////////////////////////////////////////////////////////////// -struct lt_eq_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<lt_eq_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<lt_eq_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<lt_eq_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<lt_eq_op, BaseT, T1>::type -operator<=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<lt_eq_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<lt_eq_op, T0, BaseT>::type -operator<=(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<lt_eq_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<lt_eq_op, BaseT0, BaseT1>::type -operator<=(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<lt_eq_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// greater than lazy operator (infix >) -// -/////////////////////////////////////////////////////////////////////////////// -struct gt_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<gt_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<gt_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<gt_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<gt_op, BaseT, T1>::type -operator>(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<gt_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<gt_op, T0, BaseT>::type -operator>(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<gt_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<gt_op, BaseT0, BaseT1>::type -operator>(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<gt_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// greater than equal lazy operator (infix >=) -// -/////////////////////////////////////////////////////////////////////////////// -struct gt_eq_op { - - template <typename T0, typename T1> - struct result { - - typedef typename binary_operator<gt_eq_op, T0, T1> - ::result_type type; - }; - - template <typename T0, typename T1> - typename binary_operator<gt_eq_op, T0, T1>::result_type - operator()(T0& _0, T1& _1) const - { return binary_operator<gt_eq_op, T0, T1>::eval(_0, _1); } -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline typename impl::make_binary1<gt_eq_op, BaseT, T1>::type -operator>=(actor<BaseT> const& _0, T1 CREF _1) -{ - return impl::make_binary1<gt_eq_op, BaseT, T1>::construct(_0, _1); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline typename impl::make_binary2<gt_eq_op, T0, BaseT>::type -operator>=(T0 CREF _0, actor<BaseT> const& _1) -{ - return impl::make_binary2<gt_eq_op, T0, BaseT>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline typename impl::make_binary3<gt_eq_op, BaseT0, BaseT1>::type -operator>=(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return impl::make_binary3<gt_eq_op, BaseT0, BaseT1>::construct(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// logical and lazy operator (infix &&) -// -// The logical_and_composite class and its corresponding generators are -// provided to allow short-circuit evaluation of the operator's -// operands. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A0, typename A1> -struct logical_and_composite { - - typedef logical_and_composite<A0, A1> self_t; - - template <typename TupleT> - struct result { - - typedef typename binary_operator<logical_and_op, - typename actor_result<A0, TupleT>::plain_type, - typename actor_result<A1, TupleT>::plain_type - >::result_type type; - }; - - logical_and_composite(A0 const& _0, A1 const& _1) - : a0(_0), a1(_1) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - return a0.eval(args) && a1.eval(args); - } - - A0 a0; A1 a1; // actors -}; - -#if !(defined(__ICL) && __ICL <= 500) -////////////////////////////////// -template <typename BaseT, typename T1> -inline actor<logical_and_composite -<actor<BaseT>, typename as_actor<T1>::type> > -operator&&(actor<BaseT> const& _0, T1 CREF _1) -{ - return logical_and_composite - <actor<BaseT>, typename as_actor<T1>::type> - (_0, as_actor<T1>::convert(_1)); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline actor<logical_and_composite -<typename as_actor<T0>::type, actor<BaseT> > > -operator&&(T0 CREF _0, actor<BaseT> const& _1) -{ - return logical_and_composite - <typename as_actor<T0>::type, actor<BaseT> > - (as_actor<T0>::convert(_0), _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline actor<logical_and_composite -<actor<BaseT0>, actor<BaseT1> > > -operator&&(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return logical_and_composite - <actor<BaseT0>, actor<BaseT1> > - (_0, _1); -} -#else -////////////////////////////////// -template <typename T0, typename T1> -inline actor<logical_and_composite -<typename as_actor<T0>::type, typename as_actor<T1>::type> > -operator&&(T0 CREF _0, T1 CREF _1) -{ - return logical_and_composite - <typename as_actor<T0>::type, typename as_actor<T1>::type> - (as_actor<T0>::convert(_0), as_actor<T1>::convert(_1)); -} -#endif // !(__ICL && __ICL <= 500) - -/////////////////////////////////////////////////////////////////////////////// -// -// logical or lazy operator (infix ||) -// -// The logical_or_composite class and its corresponding generators are -// provided to allow short-circuit evaluation of the operator's -// operands. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A0, typename A1> -struct logical_or_composite { - - typedef logical_or_composite<A0, A1> self_t; - - template <typename TupleT> - struct result { - - typedef typename binary_operator<logical_or_op, - typename actor_result<A0, TupleT>::plain_type, - typename actor_result<A1, TupleT>::plain_type - >::result_type type; - }; - - logical_or_composite(A0 const& _0, A1 const& _1) - : a0(_0), a1(_1) {} - - template <typename TupleT> - typename actor_result<self_t, TupleT>::type - eval(TupleT const& args) const - { - return a0.eval(args) || a1.eval(args); - } - - A0 a0; A1 a1; // actors -}; - -////////////////////////////////// -template <typename BaseT, typename T1> -inline actor<logical_or_composite -<actor<BaseT>, typename as_actor<T1>::type> > -operator||(actor<BaseT> const& _0, T1 CREF _1) -{ - return logical_or_composite - <actor<BaseT>, typename as_actor<T1>::type> - (_0, as_actor<T1>::convert(_1)); -} - -////////////////////////////////// -template <typename T0, typename BaseT> -inline actor<logical_or_composite -<typename as_actor<T0>::type, actor<BaseT> > > -operator||(T0 CREF _0, actor<BaseT> const& _1) -{ - return logical_or_composite - <typename as_actor<T0>::type, actor<BaseT> > - (as_actor<T0>::convert(_0), _1); -} - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline actor<logical_or_composite -<actor<BaseT0>, actor<BaseT1> > > -operator||(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return logical_or_composite - <actor<BaseT0>, actor<BaseT1> > - (_0, _1); -} - -} // namespace phoenix - -#undef CREF -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/primitives.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/primitives.hpp deleted file mode 100644 index 312e8bfd83..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/primitives.hpp +++ /dev/null @@ -1,257 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_PRIMITIVES_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_PRIMITIVES_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/actor.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -/////////////////////////////////////////////////////////////////////////////// -// -// argument class -// -// Lazy arguments -// -// An actor base class that extracts and returns the Nth argument -// from the argument list passed in the 'args' tuple in the eval -// member function (see actor.hpp). There are some predefined -// argument constants that can be used as actors (arg1..argN). -// -// The argument actor is a place-holder for the actual arguments -// passed by the client. For example, wherever arg1 is seen placed -// in a lazy function (see functions.hpp) or lazy operator (see -// operators.hpp), this will be replaced by the actual first -// argument in the actual function evaluation. Argument actors are -// essentially lazy arguments. A lazy argument is a full actor in -// its own right and can be evaluated through the actor's operator(). -// -// Example: -// -// char c = 'A'; -// int i = 123; -// const char* s = "Hello World"; -// -// cout << arg1(c) << ' '; -// cout << arg1(i, s) << ' '; -// cout << arg2(i, s) << ' '; -// -// will print out "A 123 Hello World" -// -/////////////////////////////////////////////////////////////////////////////// -template <int N> -struct argument { - - template <typename TupleT> - struct result { typedef typename tuple_element<N, TupleT>::type type; }; - - template <typename TupleT> - typename tuple_element<N, TupleT>::type - eval(TupleT const& args) const - { - tuple_index<N> const idx; - return args[idx]; - } -}; - -////////////////////////////////// -actor<argument<0> > const arg1 = argument<0>(); -actor<argument<1> > const arg2 = argument<1>(); -actor<argument<2> > const arg3 = argument<2>(); - -#if PHOENIX_LIMIT > 3 -actor<argument<3> > const arg4 = argument<3>(); -actor<argument<4> > const arg5 = argument<4>(); -actor<argument<5> > const arg6 = argument<5>(); - -#if PHOENIX_LIMIT > 6 -actor<argument<6> > const arg7 = argument<6>(); -actor<argument<7> > const arg8 = argument<7>(); -actor<argument<8> > const arg9 = argument<8>(); - -#if PHOENIX_LIMIT > 9 -actor<argument<9> > const arg10 = argument<9>(); -actor<argument<10> > const arg11 = argument<10>(); -actor<argument<11> > const arg12 = argument<11>(); - -#if PHOENIX_LIMIT > 12 -actor<argument<12> > const arg13 = argument<12>(); -actor<argument<13> > const arg14 = argument<13>(); -actor<argument<14> > const arg15 = argument<14>(); - -#endif -#endif -#endif -#endif -/////////////////////////////////////////////////////////////////////////////// -// -// value class -// -// Lazy values -// -// A bound actual parameter is kept in a value class for deferred -// access later when needed. A value object is immutable. Value -// objects are typically created through the val(x) free function -// which returns a value<T> with T deduced from the type of x. x is -// held in the value<T> object by value. -// -// Lazy values are actors. As such, lazy values can be evaluated -// through the actor's operator(). Such invocation gives the value's -// identity. Example: -// -// cout << val(3)() << val("Hello World")(); -// -// prints out "3 Hello World" -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T> -struct value { - - typedef typename boost::remove_reference<T>::type plain_t; - - template <typename TupleT> - struct result { typedef plain_t const type; }; - - value(plain_t val_) - : val(val_) {} - - template <typename TupleT> - plain_t const - eval(TupleT const& /*args*/) const - { - return val; - } - - plain_t val; -}; - -////////////////////////////////// -template <typename T> -inline actor<value<T> > const -val(T v) -{ - return value<T>(v); -} - -////////////////////////////////// -template <typename BaseT> -void -val(actor<BaseT> const& v); // This is undefined and not allowed. - -/////////////////////////////////////////////////////////////////////////// -// -// Arbitrary types T are typically converted to a actor<value<T> > -// (see as_actor<T> in actor.hpp). A specialization is also provided -// for arrays. T[N] arrays are converted to actor<value<T const*> >. -// -/////////////////////////////////////////////////////////////////////////// -template <typename T> -struct as_actor { - - typedef actor<value<T> > type; - static type convert(T const& x) - { return value<T>(x); } -}; - -////////////////////////////////// -template <typename T, int N> -struct as_actor<T[N]> { - - typedef actor<value<T const*> > type; - static type convert(T const x[N]) - { return value<T const*>(x); } -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// variable class -// -// Lazy variables -// -// A bound actual parameter may also be held by non-const reference -// in a variable class for deferred access later when needed. A -// variable object is mutable, i.e. its referenced variable can be -// modified. Variable objects are typically created through the -// var(x) free function which returns a variable<T> with T deduced -// from the type of x. x is held in the value<T> object by -// reference. -// -// Lazy variables are actors. As such, lazy variables can be -// evaluated through the actor's operator(). Such invocation gives -// the variables's identity. Example: -// -// int i = 3; -// char const* s = "Hello World"; -// cout << var(i)() << var(s)(); -// -// prints out "3 Hello World" -// -// Another free function const_(x) may also be used. const_(x) creates -// a variable<T const&> object using a constant reference. -// -/////////////////////////////////////////////////////////////////////////////// -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#endif - -template <typename T> -struct variable { - - template <typename TupleT> - struct result { typedef T& type; }; - - variable(T& var_) - : var(var_) {} - - template <typename TupleT> - T& - eval(TupleT const& /*args*/) const - { - return var; - } - - T& var; -}; - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif - -////////////////////////////////// -template <typename T> -inline actor<variable<T> > const -var(T& v) -{ - return variable<T>(v); -} - -////////////////////////////////// -template <typename T> -inline actor<variable<T const> > const -const_(T const& v) -{ - return variable<T const>(v); -} - -////////////////////////////////// -template <typename BaseT> -void -var(actor<BaseT> const& v); // This is undefined and not allowed. - -////////////////////////////////// -template <typename BaseT> -void -const_(actor<BaseT> const& v); // This is undefined and not allowed. - -/////////////////////////////////////////////////////////////////////////////// -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/special_ops.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/special_ops.hpp deleted file mode 100644 index e5974fd709..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/special_ops.hpp +++ /dev/null @@ -1,274 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_SPECIAL_OPS_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_SPECIAL_OPS_HPP - -#include <boost/config.hpp> -#ifdef BOOST_NO_STRINGSTREAM -#include <strstream> -#define PHOENIX_SSTREAM strstream -#else -#include <sstream> -#define PHOENIX_SSTREAM stringstream -#endif - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/operators.hpp> -#include <iosfwd> -#include <complex> - -/////////////////////////////////////////////////////////////////////////////// -#if defined(_STLPORT_VERSION) && defined(__STL_USE_OWN_NAMESPACE) -#define PHOENIX_STD _STLP_STD -#define PHOENIX_NO_STD_NAMESPACE -#else -#define PHOENIX_STD std -#endif - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix -{ - -/////////////////////////////////////////////////////////////////////////////// -// -// The following specializations take into account the C++ standard -// library components. There are a couple of issues that have to be -// dealt with to enable lazy operator overloads for the standard -// library classes. -// -// *iostream (e.g. cout, cin, strstream/ stringstream) uses non- -// canonical shift operator overloads where the lhs is taken in -// by reference. -// -// *I/O manipulators overloads for the RHS of the << and >> -// operators. -// -// *STL iterators can be objects that conform to pointer semantics. -// Some operators need to be specialized for these. -// -// *std::complex is given a rank (see rank class in operators.hpp) -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// -// specialization for rank<std::complex> -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T> struct rank<PHOENIX_STD::complex<T> > -{ static int const value = 170 + rank<T>::value; }; - -/////////////////////////////////////////////////////////////////////////////// -// -// specializations for std::istream -// -/////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////// -template <typename T1> -struct binary_operator<shift_r_op, PHOENIX_STD::istream, T1> -{ - typedef PHOENIX_STD::istream& result_type; - static result_type eval(PHOENIX_STD::istream& out, T1& rhs) - { return out >> rhs; } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_binary3 - <shift_r_op, variable<PHOENIX_STD::istream>, BaseT>::type -operator>>(PHOENIX_STD::istream& _0, actor<BaseT> const& _1) -{ - return impl::make_binary3 - <shift_r_op, variable<PHOENIX_STD::istream>, BaseT> - ::construct(var(_0), _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// specializations for std::ostream -// -/////////////////////////////////////////////////////////////////////////////// - -////////////////////////////////// -template <typename T1> -struct binary_operator<shift_l_op, PHOENIX_STD::ostream, T1> -{ - typedef PHOENIX_STD::ostream& result_type; - static result_type eval(PHOENIX_STD::ostream& out, T1 const& rhs) - { return out << rhs; } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_binary3 - <shift_l_op, variable<PHOENIX_STD::ostream>, BaseT>::type -operator<<(PHOENIX_STD::ostream& _0, actor<BaseT> const& _1) -{ - return impl::make_binary3 - <shift_l_op, variable<PHOENIX_STD::ostream>, BaseT> - ::construct(var(_0), _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// specializations for std::strstream / stringstream -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T1> -struct binary_operator<shift_r_op, PHOENIX_STD::PHOENIX_SSTREAM, T1> -{ - typedef PHOENIX_STD::istream& result_type; - static result_type eval(PHOENIX_STD::istream& out, T1& rhs) - { return out >> rhs; } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_binary3 - <shift_r_op, variable<PHOENIX_STD::PHOENIX_SSTREAM>, BaseT>::type -operator>>(PHOENIX_STD::PHOENIX_SSTREAM& _0, actor<BaseT> const& _1) -{ - return impl::make_binary3 - <shift_r_op, variable<PHOENIX_STD::PHOENIX_SSTREAM>, BaseT> - ::construct(var(_0), _1); -} - -////////////////////////////////// -template <typename T1> -struct binary_operator<shift_l_op, PHOENIX_STD::PHOENIX_SSTREAM, T1> -{ - typedef PHOENIX_STD::ostream& result_type; - static result_type eval(PHOENIX_STD::ostream& out, T1 const& rhs) - { return out << rhs; } -}; - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_binary3 - <shift_l_op, variable<PHOENIX_STD::PHOENIX_SSTREAM>, BaseT>::type -operator<<(PHOENIX_STD::PHOENIX_SSTREAM& _0, actor<BaseT> const& _1) -{ - return impl::make_binary3 - <shift_l_op, variable<PHOENIX_STD::PHOENIX_SSTREAM>, BaseT> - ::construct(var(_0), _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// I/O manipulator specializations -// -/////////////////////////////////////////////////////////////////////////////// - -typedef PHOENIX_STD::ios_base& (*iomanip_t)(PHOENIX_STD::ios_base&); -typedef PHOENIX_STD::istream& (*imanip_t)(PHOENIX_STD::istream&); -typedef PHOENIX_STD::ostream& (*omanip_t)(PHOENIX_STD::ostream&); - -#if defined(BOOST_BORLANDC) - -/////////////////////////////////////////////////////////////////////////////// -// -// Borland does not like i/o manipulators functions such as endl to -// be the rhs of a lazy << operator (Borland incorrectly reports -// ambiguity). To get around the problem, we provide function -// pointer versions of the same name with a single trailing -// underscore. -// -// You can use the same trick for other i/o manipulators. -// Alternatively, you can prefix the manipulator with a '&' -// operator. Example: -// -// cout << arg1 << &endl -// -/////////////////////////////////////////////////////////////////////////////// - -imanip_t ws_ = &PHOENIX_STD::ws; -iomanip_t dec_ = &PHOENIX_STD::dec; -iomanip_t hex_ = &PHOENIX_STD::hex; -iomanip_t oct_ = &PHOENIX_STD::oct; -omanip_t endl_ = &PHOENIX_STD::endl; -omanip_t ends_ = &PHOENIX_STD::ends; -omanip_t flush_ = &PHOENIX_STD::flush; - -#else // BOOST_BORLANDC - -/////////////////////////////////////////////////////////////////////////////// -// -// The following are overloads for I/O manipulators. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename BaseT> -inline typename impl::make_binary1<shift_l_op, BaseT, imanip_t>::type -operator>>(actor<BaseT> const& _0, imanip_t _1) -{ - return impl::make_binary1<shift_l_op, BaseT, imanip_t>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_binary1<shift_l_op, BaseT, iomanip_t>::type -operator>>(actor<BaseT> const& _0, iomanip_t _1) -{ - return impl::make_binary1<shift_l_op, BaseT, iomanip_t>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_binary1<shift_l_op, BaseT, omanip_t>::type -operator<<(actor<BaseT> const& _0, omanip_t _1) -{ - return impl::make_binary1<shift_l_op, BaseT, omanip_t>::construct(_0, _1); -} - -////////////////////////////////// -template <typename BaseT> -inline typename impl::make_binary1<shift_l_op, BaseT, iomanip_t>::type -operator<<(actor<BaseT> const& _0, iomanip_t _1) -{ - return impl::make_binary1<shift_l_op, BaseT, iomanip_t>::construct(_0, _1); -} - -#endif // BOOST_BORLANDC - -/////////////////////////////////////////////////////////////////////////////// -// -// specializations for stl iterators and containers -// -/////////////////////////////////////////////////////////////////////////////// -template <typename T> -struct unary_operator<dereference_op, T> -{ - typedef typename T::reference result_type; - static result_type eval(T const& iter) - { return *iter; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<index_op, T0, T1> -{ - typedef typename T0::reference result_type; - static result_type eval(T0& container, T1 const& index) - { return container[index]; } -}; - -////////////////////////////////// -template <typename T0, typename T1> -struct binary_operator<index_op, T0 const, T1> -{ - typedef typename T0::const_reference result_type; - static result_type eval(T0 const& container, T1 const& index) - { return container[index]; } -}; - -/////////////////////////////////////////////////////////////////////////////// -} // namespace phoenix - -#undef PHOENIX_SSTREAM -#undef PHOENIX_STD -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/statements.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/statements.hpp deleted file mode 100644 index c85df44fbf..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/statements.hpp +++ /dev/null @@ -1,443 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_STATEMENTS_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_STATEMENTS_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/phoenix/composite.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -/////////////////////////////////////////////////////////////////////////////// -// -// sequential_composite -// -// Two or more actors separated by the comma generates a -// sequential_composite which is a composite actor. Example: -// -// actor, -// actor, -// actor -// -// The actors are evaluated sequentially. The result type of this -// is void. Note that the last actor should not have a trailing -// comma. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A0, typename A1> -struct sequential_composite { - - typedef sequential_composite<A0, A1> self_t; - - template <typename TupleT> - struct result { typedef void type; }; - - sequential_composite(A0 const& _0, A1 const& _1) - : a0(_0), a1(_1) {} - - template <typename TupleT> - void - eval(TupleT const& args) const - { - a0.eval(args); - a1.eval(args); - } - - A0 a0; A1 a1; // actors -}; - -////////////////////////////////// -template <typename BaseT0, typename BaseT1> -inline actor<sequential_composite<actor<BaseT0>, actor<BaseT1> > > -operator,(actor<BaseT0> const& _0, actor<BaseT1> const& _1) -{ - return sequential_composite<actor<BaseT0>, actor<BaseT1> >(_0, _1); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// if_then_else_composite -// -// This composite has two (2) forms: -// -// if_(condition) -// [ -// statement -// ] -// -// and -// -// if_(condition) -// [ -// true_statement -// ] -// .else_ -// [ -// false_statement -// ] -// -// where condition is an actor that evaluates to bool. If condition -// is true, the true_statement (again an actor) is executed -// otherwise, the false_statement (another actor) is executed. The -// result type of this is void. Note the trailing underscore after -// if_ and the leading dot and the trailing underscore before -// and after .else_. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename CondT, typename ThenT, typename ElseT> -struct if_then_else_composite { - - typedef if_then_else_composite<CondT, ThenT, ElseT> self_t; - - template <typename TupleT> - struct result { - - typedef void type; - }; - - if_then_else_composite( - CondT const& cond_, - ThenT const& then_, - ElseT const& else__) - : cond(cond_), then(then_), else_(else__) {} - - template <typename TupleT> - void eval(TupleT const& args) const - { - if (cond.eval(args)) - then.eval(args); - else - else_.eval(args); - } - - CondT cond; ThenT then; ElseT else_; // actors -}; - -////////////////////////////////// -template <typename CondT, typename ThenT> -struct else_gen { - - else_gen(CondT const& cond_, ThenT const& then_) - : cond(cond_), then(then_) {} - - template <typename ElseT> - actor<if_then_else_composite<CondT, ThenT, - typename as_actor<ElseT>::type> > - operator[](ElseT const& else_) - { - typedef if_then_else_composite<CondT, ThenT, - typename as_actor<ElseT>::type> - result; - - return result(cond, then, as_actor<ElseT>::convert(else_)); - } - - CondT cond; ThenT then; -}; - -////////////////////////////////// -template <typename CondT, typename ThenT> -struct if_then_composite { - - typedef if_then_composite<CondT, ThenT> self_t; - - template <typename TupleT> - struct result { typedef void type; }; - - if_then_composite(CondT const& cond_, ThenT const& then_) - : cond(cond_), then(then_), else_(cond, then) {} - - template <typename TupleT> - void eval(TupleT const& args) const - { - if (cond.eval(args)) - then.eval(args); - } - - CondT cond; ThenT then; // actors - else_gen<CondT, ThenT> else_; -}; - -////////////////////////////////// -template <typename CondT> -struct if_gen { - - if_gen(CondT const& cond_) - : cond(cond_) {} - - template <typename ThenT> - actor<if_then_composite< - typename as_actor<CondT>::type, - typename as_actor<ThenT>::type> > - operator[](ThenT const& then) const - { - typedef if_then_composite< - typename as_actor<CondT>::type, - typename as_actor<ThenT>::type> - result; - - return result( - as_actor<CondT>::convert(cond), - as_actor<ThenT>::convert(then)); - } - - CondT cond; -}; - -////////////////////////////////// -template <typename CondT> -inline if_gen<CondT> -if_(CondT const& cond) -{ - return if_gen<CondT>(cond); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// while_composite -// -// This composite has the form: -// -// while_(condition) -// [ -// statement -// ] -// -// While the condition (an actor) evaluates to true, statement -// (another actor) is executed. The result type of this is void. -// Note the trailing underscore after while_. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename CondT, typename DoT> -struct while_composite { - - typedef while_composite<CondT, DoT> self_t; - - template <typename TupleT> - struct result { typedef void type; }; - - while_composite(CondT const& cond_, DoT const& do__) - : cond(cond_), do_(do__) {} - - template <typename TupleT> - void eval(TupleT const& args) const - { - while (cond.eval(args)) - do_.eval(args); - } - - CondT cond; - DoT do_; -}; - -////////////////////////////////// -template <typename CondT> -struct while_gen { - - while_gen(CondT const& cond_) - : cond(cond_) {} - - template <typename DoT> - actor<while_composite< - typename as_actor<CondT>::type, - typename as_actor<DoT>::type> > - operator[](DoT const& do_) const - { - typedef while_composite< - typename as_actor<CondT>::type, - typename as_actor<DoT>::type> - result; - - return result( - as_actor<CondT>::convert(cond), - as_actor<DoT>::convert(do_)); - } - - CondT cond; -}; - -////////////////////////////////// -template <typename CondT> -inline while_gen<CondT> -while_(CondT const& cond) -{ - return while_gen<CondT>(cond); -} - -/////////////////////////////////////////////////////////////////////////////// -// -// do_composite -// -// This composite has the form: -// -// do_ -// [ -// statement -// ] -// .while_(condition) -// -// While the condition (an actor) evaluates to true, statement -// (another actor) is executed. The statement is executed at least -// once. The result type of this is void. Note the trailing -// underscore after do_ and the leading dot and the trailing -// underscore before and after .while_. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename DoT, typename CondT> -struct do_composite { - - typedef do_composite<DoT, CondT> self_t; - - template <typename TupleT> - struct result { typedef void type; }; - - do_composite(DoT const& do__, CondT const& cond_) - : do_(do__), cond(cond_) {} - - template <typename TupleT> - void eval(TupleT const& args) const - { - do - do_.eval(args); - while (cond.eval(args)); - } - - DoT do_; - CondT cond; -}; - -//////////////////////////////////// -template <typename DoT> -struct do_gen2 { - - do_gen2(DoT const& do__) - : do_(do__) {} - - template <typename CondT> - actor<do_composite< - typename as_actor<DoT>::type, - typename as_actor<CondT>::type> > - while_(CondT const& cond) const - { - typedef do_composite< - typename as_actor<DoT>::type, - typename as_actor<CondT>::type> - result; - - return result( - as_actor<DoT>::convert(do_), - as_actor<CondT>::convert(cond)); - } - - DoT do_; -}; - -//////////////////////////////////// -struct do_gen { - - template <typename DoT> - do_gen2<DoT> - operator[](DoT const& do_) const - { - return do_gen2<DoT>(do_); - } -}; - -do_gen const do_ = do_gen(); - -/////////////////////////////////////////////////////////////////////////////// -// -// for_composite -// -// This statement has the form: -// -// for_(init, condition, step) -// [ -// statement -// ] -// -// Where init, condition, step and statement are all actors. init -// is executed once before entering the for-loop. The for-loop -// exits once condition evaluates to false. At each loop iteration, -// step and statement is called. The result of this statement is -// void. Note the trailing underscore after for_. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename InitT, typename CondT, typename StepT, typename DoT> -struct for_composite { - - typedef composite<InitT, CondT, StepT, DoT> self_t; - - template <typename TupleT> - struct result { typedef void type; }; - - for_composite( - InitT const& init_, - CondT const& cond_, - StepT const& step_, - DoT const& do__) - : init(init_), cond(cond_), step(step_), do_(do__) {} - - template <typename TupleT> - void - eval(TupleT const& args) const - { - for (init.eval(args); cond.eval(args); step.eval(args)) - do_.eval(args); - } - - InitT init; CondT cond; StepT step; DoT do_; // actors -}; - -////////////////////////////////// -template <typename InitT, typename CondT, typename StepT> -struct for_gen { - - for_gen( - InitT const& init_, - CondT const& cond_, - StepT const& step_) - : init(init_), cond(cond_), step(step_) {} - - template <typename DoT> - actor<for_composite< - typename as_actor<InitT>::type, - typename as_actor<CondT>::type, - typename as_actor<StepT>::type, - typename as_actor<DoT>::type> > - operator[](DoT const& do_) const - { - typedef for_composite< - typename as_actor<InitT>::type, - typename as_actor<CondT>::type, - typename as_actor<StepT>::type, - typename as_actor<DoT>::type> - result; - - return result( - as_actor<InitT>::convert(init), - as_actor<CondT>::convert(cond), - as_actor<StepT>::convert(step), - as_actor<DoT>::convert(do_)); - } - - InitT init; CondT cond; StepT step; -}; - -////////////////////////////////// -template <typename InitT, typename CondT, typename StepT> -inline for_gen<InitT, CondT, StepT> -for_(InitT const& init, CondT const& cond, StepT const& step) -{ - return for_gen<InitT, CondT, StepT>(init, cond, step); -} - -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/tuple_helpers.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/tuple_helpers.hpp deleted file mode 100644 index de97416061..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/tuple_helpers.hpp +++ /dev/null @@ -1,1076 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2002 Joel de Guzman - Copyright (c) 2002-2003 Hartmut Kaiser - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -==============================================================================*/ -#ifndef BOOST_SPIRIT_CLASSIC_PHOENIX_TUPLE_HELPERS_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_TUPLE_HELPERS_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <cassert> -#include <boost/spirit/home/classic/phoenix/tuples.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix -{ - -/////////////////////////////////////////////////////////////////////////////// -// -// make_tuple template class -// -// This template class is used to calculate a tuple type required to hold -// the given template parameter type -// -/////////////////////////////////////////////////////////////////////////////// - -/////////////////////////////////////////////////////////////////////////////// -// normal (non-tuple types are wrapped into a tuple) -template <typename ResultT> -struct make_tuple { - - typedef tuple<ResultT> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// nil_t is converted to an empty tuple type -template <> -struct make_tuple<nil_t> { - - typedef tuple<> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// tuple types are left alone without any refactoring -template < - typename A, typename B, typename C -#if PHOENIX_LIMIT > 3 - , typename D, typename E, typename F -#if PHOENIX_LIMIT > 6 - , typename G, typename H, typename I -#if PHOENIX_LIMIT > 9 - , typename J, typename K, typename L -#if PHOENIX_LIMIT > 12 - , typename M, typename N, typename O -#endif -#endif -#endif -#endif -> -struct make_tuple<tuple<A, B, C -#if PHOENIX_LIMIT > 3 - , D, E, F -#if PHOENIX_LIMIT > 6 - , G, H, I -#if PHOENIX_LIMIT > 9 - , J, K, L -#if PHOENIX_LIMIT > 12 - , M, N, O -#endif -#endif -#endif -#endif - > > { - -// the tuple parameter itself is the required tuple type - typedef tuple<A, B, C -#if PHOENIX_LIMIT > 3 - , D, E, F -#if PHOENIX_LIMIT > 6 - , G, H, I -#if PHOENIX_LIMIT > 9 - , J, K, L -#if PHOENIX_LIMIT > 12 - , M, N, O -#endif -#endif -#endif -#endif - > type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat_tuple type computer -// -// This class returns the type of a tuple, which is constructed by -// concatenating a tuple with a given type -// -/////////////////////////////////////////////////////////////////////////////// -template <typename TupleT, typename AppendT> -struct concat_tuple; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <0 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename AppendT> -struct concat_tuple<tuple<>, AppendT> { - - typedef tuple<AppendT> type; -}; - -template <> -struct concat_tuple<tuple<>, nil_t> { - - typedef tuple<> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <1 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A, typename AppendT> -struct concat_tuple<tuple<A>, AppendT> { - - typedef tuple<A, AppendT> type; -}; - -template <typename A> -struct concat_tuple<tuple<A>, nil_t> { - - typedef tuple<A> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <2 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A, typename B, typename AppendT> -struct concat_tuple<tuple<A, B>, AppendT> { - - typedef tuple<A, B, AppendT> type; -}; - -template <typename A, typename B> -struct concat_tuple<tuple<A, B>, nil_t> { - - typedef tuple<A, B> type; -}; - -#if PHOENIX_LIMIT > 3 -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <3 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, - typename AppendT -> -struct concat_tuple<tuple<A, B, C>, AppendT> { - - typedef tuple<A, B, C, AppendT> type; -}; - -template < - typename A, typename B, typename C -> -struct concat_tuple<tuple<A, B, C>, nil_t> { - - typedef tuple<A, B, C> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <4 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D>, AppendT> { - - typedef tuple<A, B, C, D, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D -> -struct concat_tuple<tuple<A, B, C, D>, nil_t> { - - typedef tuple<A, B, C, D> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <5 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E>, AppendT> { - - typedef tuple<A, B, C, D, E, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E -> -struct concat_tuple<tuple<A, B, C, D, E>, nil_t> { - - typedef tuple<A, B, C, D, E> type; -}; - -#if PHOENIX_LIMIT > 6 -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <6 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F>, AppendT> { - - typedef tuple<A, B, C, D, E, F, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F -> -struct concat_tuple<tuple<A, B, C, D, E, F>, nil_t> { - - typedef tuple<A, B, C, D, E, F> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <7 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F, G>, AppendT> { - - typedef tuple<A, B, C, D, E, F, G, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G -> -struct concat_tuple<tuple<A, B, C, D, E, F, G>, nil_t> { - - typedef tuple<A, B, C, D, E, F, G> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <8 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H>, AppendT> { - - typedef tuple<A, B, C, D, E, F, G, H, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H>, nil_t> { - - typedef tuple<A, B, C, D, E, F, G, H> type; -}; - -#if PHOENIX_LIMIT > 9 -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <9 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I>, AppendT> { - - typedef tuple<A, B, C, D, E, F, G, H, I, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I>, nil_t> { - - typedef tuple<A, B, C, D, E, F, G, H, I> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <10 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J>, AppendT> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J>, nil_t> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <11 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, typename K, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J, K>, AppendT> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, K, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, typename K -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J, K>, nil_t> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, K> type; -}; - -#if PHOENIX_LIMIT > 12 -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <12 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, typename K, typename L, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J, K, L>, AppendT> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, K, L, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, typename K, typename L -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J, K, L>, nil_t> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, K, L> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <13 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, typename K, typename L, - typename M, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J, K, L, M>, AppendT> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, typename K, typename L, - typename M -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J, K, L, M>, nil_t> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, K, L, M> type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// concat tuple <14 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, typename K, typename L, - typename M, typename N, - typename AppendT -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N>, AppendT> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N, AppendT> type; -}; - -template < - typename A, typename B, typename C, typename D, typename E, typename F, - typename G, typename H, typename I, typename J, typename K, typename L, - typename M, typename N -> -struct concat_tuple<tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N>, nil_t> { - - typedef tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N> type; -}; - -#endif -#endif -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// concat_tuples type computer -// -// This template class returns the type of a tuple built from the -// concatenation of two given tuples. -// -/////////////////////////////////////////////////////////////////////////////// -template <typename TupleT1, typename TupleT2, int N, typename AppendT> -struct concat_tuple_element { - - typedef - typename concat_tuple_element< - typename concat_tuple<TupleT1, AppendT>::type, TupleT2, N+1, - typename tuple_element<N+1, TupleT2>::type - >::type - type; -}; - -template <typename TupleT1, typename TupleT2, int N> -struct concat_tuple_element<TupleT1, TupleT2, N, nil_t> { - - typedef TupleT1 type; -}; - -template <typename TupleT1, typename TupleT2> -struct concat_tuples { - - typedef - typename concat_tuple_element< - TupleT1, TupleT2, 0, - typename tuple_element<0, TupleT2>::type - >::type - type; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// convert_actors template function -// -// The convert_actors template functions constructs a new tuple object -// composed of the elements returned by the actors contained in the -// input tuple. (i.e. the given tuple type 'actor_tuple' contains a set -// of actors to evaluate and the resulting tuple contains the results of -// evaluating the actors.) -// -/////////////////////////////////////////////////////////////////////////////// -template <typename ActorT, typename TupleT> -struct actor_result; // forward declaration - -namespace impl -{ - template <unsigned N> - struct convert_actors_ {}; -} - -template <typename TupleResultT, typename ActorTupleT> -TupleResultT -convert_actors(ActorTupleT const& actor_tuple) -{ - BOOST_STATIC_ASSERT(ActorTupleT::length <= TupleResultT::length); - BOOST_STATIC_CONSTANT(int, length = TupleResultT::length); - return impl::convert_actors_<length> - ::template apply<TupleResultT, ActorTupleT>::do_(actor_tuple); -} - -namespace impl -{ - template <int N, typename TupleResultT, typename ActorTupleT> - struct convert_actor - { - typedef typename tuple_element<N, TupleResultT>::type type; - - template <bool C> - struct is_default_t {}; - typedef is_default_t<true> is_default; - typedef is_default_t<false> is_not_default; - - static type - actor_element(ActorTupleT const& /*actor_tuple*/, is_default) - { - return type(); // default construct - } - - static type - actor_element(ActorTupleT const& actor_tuple, is_not_default) - { - BOOST_STATIC_ASSERT(ActorTupleT::length <= TupleResultT::length); - tuple_index<N> const idx; - return actor_tuple[idx](); // apply the actor - } - - static type - do_(ActorTupleT const& actor_tuple) - { - return actor_element( - actor_tuple, is_default_t<(N >= ActorTupleT::length)>()); - } - }; - - /////////////////////////////////////// - template <> - struct convert_actors_<1> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - - return TupleResultT( - converter0::do_(actor_tuple) - ); - } - }; - }; - - /////////////////////////////////////// - template <> - struct convert_actors_<2> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - ); - } - }; - }; - - /////////////////////////////////////// - template <> - struct convert_actors_<3> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - ); - } - }; - }; - - #if PHOENIX_LIMIT > 3 - - ///////////////////////////////////// - template <> - struct convert_actors_<4> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - ); - } - }; - }; - - ///////////////////////////////////// - template <> - struct convert_actors_<5> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - ); - } - }; - }; - - ///////////////////////////////////// - template <> - struct convert_actors_<6> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - ); - } - }; - }; - - #if PHOENIX_LIMIT > 6 - - ///////////////////////////////////// - template <> - struct convert_actors_<7> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - ); - } - }; - }; - - ///////////////////////////////////// - template <> - struct convert_actors_<8> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - typedef impl::convert_actor<7, TupleResultT, ActorTupleT> converter7; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - , converter7::do_(actor_tuple) - ); - } - }; - }; - - ///////////////////////////////////// - template <> - struct convert_actors_<9> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - typedef impl::convert_actor<7, TupleResultT, ActorTupleT> converter7; - typedef impl::convert_actor<8, TupleResultT, ActorTupleT> converter8; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - , converter7::do_(actor_tuple) - , converter8::do_(actor_tuple) - ); - } - }; - }; - - #if PHOENIX_LIMIT > 9 - - ///////////////////////////////////// - template <> - struct convert_actors_<10> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - typedef impl::convert_actor<7, TupleResultT, ActorTupleT> converter7; - typedef impl::convert_actor<8, TupleResultT, ActorTupleT> converter8; - typedef impl::convert_actor<9, TupleResultT, ActorTupleT> converter9; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - , converter7::do_(actor_tuple) - , converter8::do_(actor_tuple) - , converter9::do_(actor_tuple) - ); - } - }; - }; - - ///////////////////////////////////// - template <> - struct convert_actors_<11> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - typedef impl::convert_actor<7, TupleResultT, ActorTupleT> converter7; - typedef impl::convert_actor<8, TupleResultT, ActorTupleT> converter8; - typedef impl::convert_actor<9, TupleResultT, ActorTupleT> converter9; - typedef impl::convert_actor<10, TupleResultT, ActorTupleT> converter10; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - , converter7::do_(actor_tuple) - , converter8::do_(actor_tuple) - , converter9::do_(actor_tuple) - , converter10::do_(actor_tuple) - ); - } - }; - }; - - ///////////////////////////////////// - template <> - struct convert_actors_<12> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - typedef impl::convert_actor<7, TupleResultT, ActorTupleT> converter7; - typedef impl::convert_actor<8, TupleResultT, ActorTupleT> converter8; - typedef impl::convert_actor<9, TupleResultT, ActorTupleT> converter9; - typedef impl::convert_actor<10, TupleResultT, ActorTupleT> converter10; - typedef impl::convert_actor<11, TupleResultT, ActorTupleT> converter11; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - , converter7::do_(actor_tuple) - , converter8::do_(actor_tuple) - , converter9::do_(actor_tuple) - , converter10::do_(actor_tuple) - , converter11::do_(actor_tuple) - ); - } - }; - }; - - #if PHOENIX_LIMIT > 12 - - ///////////////////////////////////// - template <> - struct convert_actors_<13> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - typedef impl::convert_actor<7, TupleResultT, ActorTupleT> converter7; - typedef impl::convert_actor<8, TupleResultT, ActorTupleT> converter8; - typedef impl::convert_actor<9, TupleResultT, ActorTupleT> converter9; - typedef impl::convert_actor<10, TupleResultT, ActorTupleT> converter10; - typedef impl::convert_actor<11, TupleResultT, ActorTupleT> converter11; - typedef impl::convert_actor<12, TupleResultT, ActorTupleT> converter12; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - , converter7::do_(actor_tuple) - , converter8::do_(actor_tuple) - , converter9::do_(actor_tuple) - , converter10::do_(actor_tuple) - , converter11::do_(actor_tuple) - , converter12::do_(actor_tuple) - ); - } - }; - }; - - /////////////////////////////////////// - template <> - struct convert_actors_<14> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - typedef impl::convert_actor<7, TupleResultT, ActorTupleT> converter7; - typedef impl::convert_actor<8, TupleResultT, ActorTupleT> converter8; - typedef impl::convert_actor<9, TupleResultT, ActorTupleT> converter9; - typedef impl::convert_actor<10, TupleResultT, ActorTupleT> converter10; - typedef impl::convert_actor<11, TupleResultT, ActorTupleT> converter11; - typedef impl::convert_actor<12, TupleResultT, ActorTupleT> converter12; - typedef impl::convert_actor<13, TupleResultT, ActorTupleT> converter13; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - , converter7::do_(actor_tuple) - , converter8::do_(actor_tuple) - , converter9::do_(actor_tuple) - , converter10::do_(actor_tuple) - , converter11::do_(actor_tuple) - , converter12::do_(actor_tuple) - , converter13::do_(actor_tuple) - ); - } - }; - }; - - /////////////////////////////////////// - template <> - struct convert_actors_<15> - { - template <typename TupleResultT, typename ActorTupleT> - struct apply - { - static TupleResultT - do_(ActorTupleT const& actor_tuple) - { - typedef impl::convert_actor<0, TupleResultT, ActorTupleT> converter0; - typedef impl::convert_actor<1, TupleResultT, ActorTupleT> converter1; - typedef impl::convert_actor<2, TupleResultT, ActorTupleT> converter2; - typedef impl::convert_actor<3, TupleResultT, ActorTupleT> converter3; - typedef impl::convert_actor<4, TupleResultT, ActorTupleT> converter4; - typedef impl::convert_actor<5, TupleResultT, ActorTupleT> converter5; - typedef impl::convert_actor<6, TupleResultT, ActorTupleT> converter6; - typedef impl::convert_actor<7, TupleResultT, ActorTupleT> converter7; - typedef impl::convert_actor<8, TupleResultT, ActorTupleT> converter8; - typedef impl::convert_actor<9, TupleResultT, ActorTupleT> converter9; - typedef impl::convert_actor<10, TupleResultT, ActorTupleT> converter10; - typedef impl::convert_actor<11, TupleResultT, ActorTupleT> converter11; - typedef impl::convert_actor<12, TupleResultT, ActorTupleT> converter12; - typedef impl::convert_actor<13, TupleResultT, ActorTupleT> converter13; - typedef impl::convert_actor<14, TupleResultT, ActorTupleT> converter14; - - using namespace tuple_index_names; - return TupleResultT( - converter0::do_(actor_tuple) - , converter1::do_(actor_tuple) - , converter2::do_(actor_tuple) - , converter3::do_(actor_tuple) - , converter4::do_(actor_tuple) - , converter5::do_(actor_tuple) - , converter6::do_(actor_tuple) - , converter7::do_(actor_tuple) - , converter8::do_(actor_tuple) - , converter9::do_(actor_tuple) - , converter10::do_(actor_tuple) - , converter11::do_(actor_tuple) - , converter12::do_(actor_tuple) - , converter13::do_(actor_tuple) - , converter14::do_(actor_tuple) - ); - } - }; - }; - - #endif - #endif - #endif - #endif -} // namespace impl - - -/////////////////////////////////////////////////////////////////////////////// -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/tuples.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/tuples.hpp deleted file mode 100644 index 666e7ffe1d..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/phoenix/tuples.hpp +++ /dev/null @@ -1,1306 +0,0 @@ -/*============================================================================= - Phoenix V1.2.1 - Copyright (c) 2001-2002 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_SPIRIT_CLASSIC_PHOENIX_TUPLES_HPP -#define BOOST_SPIRIT_CLASSIC_PHOENIX_TUPLES_HPP - -/////////////////////////////////////////////////////////////////////////////// -// -// Phoenix predefined maximum limit. This limit defines the maximum -// number of elements a tuple can hold. This number defaults to 3. The -// actual maximum is rounded up in multiples of 3. Thus, if this value -// is 4, the actual limit is 6. The ultimate maximum limit in this -// implementation is 15. -// -/////////////////////////////////////////////////////////////////////////////// -#ifndef PHOENIX_LIMIT -#define PHOENIX_LIMIT 3 -#endif - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/static_assert.hpp> -#include <boost/call_traits.hpp> -#include <boost/type_traits/remove_reference.hpp> - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -// bogus https://developercommunity.visualstudio.com/t/buggy-warning-c4709/471956 -#pragma warning(disable:4709) //comma operator within array index expression -#endif - -/////////////////////////////////////////////////////////////////////////////// -namespace phoenix { - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple -// -// Tuples hold heterogeneous types up to a predefined maximum. Only -// the most basic functionality needed is provided. Unlike other -// recursive list-like tuple implementations, this tuple -// implementation uses simple structs similar to std::pair with -// specialization for 0 to N tuple elements. -// -// 1) Construction -// Here are examples on how to construct tuples: -// -// typedef tuple<int, char> t1_t; -// typedef tuple<int, std::string, double> t2_t; -// -// // this tuple has an int and char members -// t1_t t1(3, 'c'); -// -// // this tuple has an int, std::string and double members -// t2_t t2(3, "hello", 3.14); -// -// Tuples can also be constructed from other tuples. The -// source and destination tuples need not have exactly the -// same element types. The only requirement is that the -// source tuple have the same number of elements as the -// destination and that each element slot in the -// destination can be copy constructed from the source -// element. For example: -// -// tuple<double, double> t3(t1); // OK. Compatible tuples -// tuple<double, double> t4(t2); // Error! Incompatible tuples -// -// 2) Member access -// A member in a tuple can be accessed using the -// tuple's [] operator by specifying the Nth -// tuple_index. Here are some examples: -// -// tuple_index<0> ix0; // 0th index == 1st item -// tuple_index<1> ix1; // 1st index == 2nd item -// tuple_index<2> ix2; // 2nd index == 3rd item -// -// t1[ix0] = 33; // sets the int member of the tuple t1 -// t2[ix2] = 6e6; // sets the double member of the tuple t2 -// t1[ix1] = 'a'; // sets the char member of the tuple t1 -// -// There are some predefined names are provided in sub- -// namespace tuple_index_names: -// -// tuple_index<0> _1; -// tuple_index<1> _2; -// ... -// tuple_index<N> _N; -// -// These indexes may be used by 'using' namespace -// phoenix::tuple_index_names. -// -// Access to out of bound indexes returns a nil_t value. -// -// 3) Member type inquiry -// The type of an individual member can be queried. -// Example: -// -// tuple_element<1, t2_t>::type -// -// Refers to the type of the second member (note zero based, -// thus 0 = 1st item, 1 = 2nd item) of the tuple. -// -// Aside from tuple_element<N, T>::type, there are two -// more types that tuple_element provides: rtype and -// crtype. While 'type' is the plain underlying type, -// 'rtype' is the reference type, or type& and 'crtype' -// is the constant reference type or type const&. The -// latter two are provided to make it easy for the -// client in dealing with the possibility of reference -// to reference when type is already a reference, which -// is illegal in C++. -// -// Access to out of bound indexes returns a nil_t type. -// -// 4) Tuple length -// The number of elements in a tuple can be queried. -// Example: -// -// int n = t1.length; -// -// gets the number of elements in tuple t1. -// -// length is a static constant. Thus, TupleT::length -// also works. Example: -// -// int n = t1_t::length; -// -/////////////////////////////////////////////////////////////////////////////// -struct nil_t {}; -using boost::remove_reference; -using boost::call_traits; - -////////////////////////////////// -namespace impl { - - template <typename T> - struct access { - - typedef const T& ctype; - typedef T& type; - }; - - template <typename T> - struct access<T&> { - - typedef T& ctype; - typedef T& type; - }; -} - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple_element -// -// A query class that gets the Nth element inside a tuple. -// Examples: -// -// tuple_element<1, tuple<int, char, void*> >::type // plain -// tuple_element<1, tuple<int, char, void*> >::rtype // ref -// tuple_element<1, tuple<int, char, void*> >::crtype // const ref -// -// Has type char which is the 2nd type in the tuple -// (note zero based, thus 0 = 1st item, 1 = 2nd item). -// -// Given a tuple object, the static function tuple_element<N, -// TupleT>::get(tuple) gets the Nth element in the tuple. The -// tuple class' tuple::operator[] uses this to get its Nth -// element. -// -/////////////////////////////////////////////////////////////////////////////// -template <int N, typename TupleT> -struct tuple_element -{ - typedef nil_t type; - typedef nil_t& rtype; - typedef nil_t const& crtype; - - static nil_t get(TupleT const&) { return nil_t(); } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<0, TupleT> -{ - typedef typename TupleT::a_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.a; } - static crtype get(TupleT const& t) { return t.a; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<1, TupleT> -{ - typedef typename TupleT::b_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.b; } - static crtype get(TupleT const& t) { return t.b; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<2, TupleT> -{ - typedef typename TupleT::c_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.c; } - static crtype get(TupleT const& t) { return t.c; } -}; - -#if PHOENIX_LIMIT > 3 -////////////////////////////////// -template <typename TupleT> -struct tuple_element<3, TupleT> -{ - typedef typename TupleT::d_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.d; } - static crtype get(TupleT const& t) { return t.d; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<4, TupleT> -{ - typedef typename TupleT::e_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.e; } - static crtype get(TupleT const& t) { return t.e; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<5, TupleT> -{ - typedef typename TupleT::f_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.f; } - static crtype get(TupleT const& t) { return t.f; } -}; - -#if PHOENIX_LIMIT > 6 -////////////////////////////////// -template <typename TupleT> -struct tuple_element<6, TupleT> -{ - typedef typename TupleT::g_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.g; } - static crtype get(TupleT const& t) { return t.g; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<7, TupleT> -{ - typedef typename TupleT::h_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.h; } - static crtype get(TupleT const& t) { return t.h; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<8, TupleT> -{ - typedef typename TupleT::i_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.i; } - static crtype get(TupleT const& t) { return t.i; } -}; - -#if PHOENIX_LIMIT > 9 -////////////////////////////////// -template <typename TupleT> -struct tuple_element<9, TupleT> -{ - typedef typename TupleT::j_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.j; } - static crtype get(TupleT const& t) { return t.j; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<10, TupleT> -{ - typedef typename TupleT::k_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.k; } - static crtype get(TupleT const& t) { return t.k; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<11, TupleT> -{ - typedef typename TupleT::l_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.l; } - static crtype get(TupleT const& t) { return t.l; } -}; - -#if PHOENIX_LIMIT > 12 -////////////////////////////////// -template <typename TupleT> -struct tuple_element<12, TupleT> -{ - typedef typename TupleT::m_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.m; } - static crtype get(TupleT const& t) { return t.m; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<13, TupleT> -{ - typedef typename TupleT::n_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.n; } - static crtype get(TupleT const& t) { return t.n; } -}; - -////////////////////////////////// -template <typename TupleT> -struct tuple_element<14, TupleT> -{ - typedef typename TupleT::o_type type; - typedef typename impl::access<type>::type rtype; - typedef typename impl::access<type>::ctype crtype; - - static rtype get(TupleT& t) { return t.o; } - static crtype get(TupleT const& t) { return t.o; } -}; - -#endif -#endif -#endif -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple forward declaration. -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A = nil_t - , typename B = nil_t - , typename C = nil_t - -#if PHOENIX_LIMIT > 3 - , typename D = nil_t - , typename E = nil_t - , typename F = nil_t - -#if PHOENIX_LIMIT > 6 - , typename G = nil_t - , typename H = nil_t - , typename I = nil_t - -#if PHOENIX_LIMIT > 9 - , typename J = nil_t - , typename K = nil_t - , typename L = nil_t - -#if PHOENIX_LIMIT > 12 - , typename M = nil_t - , typename N = nil_t - , typename O = nil_t - -#endif -#endif -#endif -#endif - - , typename NU = nil_t // Not used -> -struct tuple; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple_index -// -// This class wraps an integer in a type to be used for indexing -// the Nth element in a tuple. See tuple operator[]. Some -// predefined names are provided in sub-namespace -// tuple_index_names. -// -/////////////////////////////////////////////////////////////////////////////// -template <int N> -struct tuple_index {}; - -////////////////////////////////// -namespace tuple_index_names { - - tuple_index<0> const _1 = tuple_index<0>(); - tuple_index<1> const _2 = tuple_index<1>(); - tuple_index<2> const _3 = tuple_index<2>(); - -#if PHOENIX_LIMIT > 3 - tuple_index<3> const _4 = tuple_index<3>(); - tuple_index<4> const _5 = tuple_index<4>(); - tuple_index<5> const _6 = tuple_index<5>(); - -#if PHOENIX_LIMIT > 6 - tuple_index<6> const _7 = tuple_index<6>(); - tuple_index<7> const _8 = tuple_index<7>(); - tuple_index<8> const _9 = tuple_index<8>(); - -#if PHOENIX_LIMIT > 9 - tuple_index<9> const _10 = tuple_index<9>(); - tuple_index<10> const _11 = tuple_index<10>(); - tuple_index<11> const _12 = tuple_index<11>(); - -#if PHOENIX_LIMIT > 12 - tuple_index<12> const _13 = tuple_index<12>(); - tuple_index<13> const _14 = tuple_index<13>(); - tuple_index<14> const _15 = tuple_index<14>(); - -#endif -#endif -#endif -#endif -} - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple_common class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename DerivedT> -struct tuple_base { - - typedef nil_t a_type; - typedef nil_t b_type; - typedef nil_t c_type; - -#if PHOENIX_LIMIT > 3 - typedef nil_t d_type; - typedef nil_t e_type; - typedef nil_t f_type; - -#if PHOENIX_LIMIT > 6 - typedef nil_t g_type; - typedef nil_t h_type; - typedef nil_t i_type; - -#if PHOENIX_LIMIT > 9 - typedef nil_t j_type; - typedef nil_t k_type; - typedef nil_t l_type; - -#if PHOENIX_LIMIT > 12 - typedef nil_t m_type; - typedef nil_t n_type; - typedef nil_t o_type; - -#endif -#endif -#endif -#endif - - template <int N> - typename tuple_element<N, DerivedT>::crtype - operator[](tuple_index<N>) const - { - return tuple_element<N, DerivedT> - ::get(*static_cast<DerivedT const*>(this)); - } - - template <int N> - typename tuple_element<N, DerivedT>::rtype - operator[](tuple_index<N>) - { - return tuple_element<N, DerivedT> - ::get(*static_cast<DerivedT*>(this)); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <0 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <> -struct tuple<> -: public tuple_base<tuple<> > { - - BOOST_STATIC_CONSTANT(int, length = 0); -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <1 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A> -struct tuple<A, nil_t, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A> > { - - BOOST_STATIC_CONSTANT(int, length = 1); - typedef A a_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_ - ): a(a_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <2 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A, typename B> -struct tuple<A, B, nil_t, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B> > { - - BOOST_STATIC_CONSTANT(int, length = 2); - typedef A a_type; typedef B b_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_ - ): a(a_), b(b_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <3 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A, typename B, typename C> -struct tuple<A, B, C, -#if PHOENIX_LIMIT > 3 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C> > { - - BOOST_STATIC_CONSTANT(int, length = 3); - typedef A a_type; typedef B b_type; - typedef C c_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_ - ): a(a_), b(b_), c(c_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; -}; - -#if PHOENIX_LIMIT > 3 -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <4 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A, typename B, typename C, typename D> -struct tuple<A, B, C, D, nil_t, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D> > { - - BOOST_STATIC_CONSTANT(int, length = 4); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_ - ): a(a_), b(b_), c(c_), d(d_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <5 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template <typename A, typename B, typename C, typename D, typename E> -struct tuple<A, B, C, D, E, nil_t, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D, E> > { - - BOOST_STATIC_CONSTANT(int, length = 5); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_ - ): a(a_), b(b_), c(c_), d(d_), e(e_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <6 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F> -struct tuple<A, B, C, D, E, F, -#if PHOENIX_LIMIT > 6 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D, E, F> > { - - BOOST_STATIC_CONSTANT(int, length = 6); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; -}; - -#if PHOENIX_LIMIT > 6 -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <7 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G> -struct tuple<A, B, C, D, E, F, G, nil_t, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D, E, F, G> > { - - BOOST_STATIC_CONSTANT(int, length = 7); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <8 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H> -struct tuple<A, B, C, D, E, F, G, H, nil_t, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D, E, F, G, H> > { - - BOOST_STATIC_CONSTANT(int, length = 8); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; typedef H h_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_, - typename call_traits<H>::param_type h_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]), h(init[tuple_index<7>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; H h; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <9 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I> -struct tuple<A, B, C, D, E, F, G, H, I, -#if PHOENIX_LIMIT > 9 - nil_t, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D, E, F, G, H, I> > { - - BOOST_STATIC_CONSTANT(int, length = 9); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; typedef H h_type; - typedef I i_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_, - typename call_traits<H>::param_type h_, - typename call_traits<I>::param_type i_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), - i(init[tuple_index<8>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; H h; I i; -}; - -#if PHOENIX_LIMIT > 9 -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <10 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J> -struct tuple<A, B, C, D, E, F, G, H, I, J, nil_t, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D, E, F, G, H, I, J> > { - - BOOST_STATIC_CONSTANT(int, length = 10); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; typedef H h_type; - typedef I i_type; typedef J j_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_, - typename call_traits<H>::param_type h_, - typename call_traits<I>::param_type i_, - typename call_traits<J>::param_type j_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), - i(init[tuple_index<8>()]), j(init[tuple_index<9>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; H h; I i; J j; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <11 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K> -struct tuple<A, B, C, D, E, F, G, H, I, J, K, nil_t, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D, E, F, G, H, I, J, K> > { - - BOOST_STATIC_CONSTANT(int, length = 11); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; typedef H h_type; - typedef I i_type; typedef J j_type; - typedef K k_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_, - typename call_traits<H>::param_type h_, - typename call_traits<I>::param_type i_, - typename call_traits<J>::param_type j_, - typename call_traits<K>::param_type k_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), - i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), - k(init[tuple_index<10>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; H h; I i; J j; - K k; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <12 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L> -struct tuple<A, B, C, D, E, F, G, H, I, J, K, L, -#if PHOENIX_LIMIT > 12 - nil_t, nil_t, nil_t, -#endif - nil_t // Unused -> -: public tuple_base<tuple<A, B, C, D, E, F, G, H, I, J, K, L> > { - - BOOST_STATIC_CONSTANT(int, length = 12); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; typedef H h_type; - typedef I i_type; typedef J j_type; - typedef K k_type; typedef L l_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_, - typename call_traits<H>::param_type h_, - typename call_traits<I>::param_type i_, - typename call_traits<J>::param_type j_, - typename call_traits<K>::param_type k_, - typename call_traits<L>::param_type l_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_), l(l_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), - i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), - k(init[tuple_index<10>()]), l(init[tuple_index<11>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; H h; I i; J j; - K k; L l; -}; - -#if PHOENIX_LIMIT > 12 -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <13 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M> -struct tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, nil_t, nil_t, nil_t> -: public tuple_base< - tuple<A, B, C, D, E, F, G, H, I, J, K, L, M> > { - - BOOST_STATIC_CONSTANT(int, length = 13); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; typedef H h_type; - typedef I i_type; typedef J j_type; - typedef K k_type; typedef L l_type; - typedef M m_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_, - typename call_traits<H>::param_type h_, - typename call_traits<I>::param_type i_, - typename call_traits<J>::param_type j_, - typename call_traits<K>::param_type k_, - typename call_traits<L>::param_type l_, - typename call_traits<M>::param_type m_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_), l(l_), m(m_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), - i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), - k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), - m(init[tuple_index<12>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; H h; I i; J j; - K k; L l; M m; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <14 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N> -struct tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N, nil_t, nil_t> -: public tuple_base< - tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N> > { - - BOOST_STATIC_CONSTANT(int, length = 14); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; typedef H h_type; - typedef I i_type; typedef J j_type; - typedef K k_type; typedef L l_type; - typedef M m_type; typedef N n_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_, - typename call_traits<H>::param_type h_, - typename call_traits<I>::param_type i_, - typename call_traits<J>::param_type j_, - typename call_traits<K>::param_type k_, - typename call_traits<L>::param_type l_, - typename call_traits<M>::param_type m_, - typename call_traits<N>::param_type n_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_), l(l_), m(m_), n(n_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), - i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), - k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), - m(init[tuple_index<12>()]), n(init[tuple_index<13>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; H h; I i; J j; - K k; L l; M m; N n; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// tuple <15 member> class -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename A, typename B, typename C, typename D, typename E, - typename F, typename G, typename H, typename I, typename J, - typename K, typename L, typename M, typename N, typename O> -struct tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, nil_t> -: public tuple_base< - tuple<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> > { - - BOOST_STATIC_CONSTANT(int, length = 15); - typedef A a_type; typedef B b_type; - typedef C c_type; typedef D d_type; - typedef E e_type; typedef F f_type; - typedef G g_type; typedef H h_type; - typedef I i_type; typedef J j_type; - typedef K k_type; typedef L l_type; - typedef M m_type; typedef N n_type; - typedef O o_type; - - tuple() {} - - tuple( - typename call_traits<A>::param_type a_, - typename call_traits<B>::param_type b_, - typename call_traits<C>::param_type c_, - typename call_traits<D>::param_type d_, - typename call_traits<E>::param_type e_, - typename call_traits<F>::param_type f_, - typename call_traits<G>::param_type g_, - typename call_traits<H>::param_type h_, - typename call_traits<I>::param_type i_, - typename call_traits<J>::param_type j_, - typename call_traits<K>::param_type k_, - typename call_traits<L>::param_type l_, - typename call_traits<M>::param_type m_, - typename call_traits<N>::param_type n_, - typename call_traits<O>::param_type o_ - ): a(a_), b(b_), c(c_), d(d_), e(e_), - f(f_), g(g_), h(h_), i(i_), j(j_), - k(k_), l(l_), m(m_), n(n_), o(o_) {} - - template <typename TupleT> - tuple(TupleT const& init) - : a(init[tuple_index<0>()]), b(init[tuple_index<1>()]), - c(init[tuple_index<2>()]), d(init[tuple_index<3>()]), - e(init[tuple_index<4>()]), f(init[tuple_index<5>()]), - g(init[tuple_index<6>()]), h(init[tuple_index<7>()]), - i(init[tuple_index<8>()]), j(init[tuple_index<9>()]), - k(init[tuple_index<10>()]), l(init[tuple_index<11>()]), - m(init[tuple_index<12>()]), n(init[tuple_index<13>()]), - o(init[tuple_index<14>()]) - { BOOST_STATIC_ASSERT(TupleT::length == length); } - - A a; B b; C c; D d; E e; - F f; G g; H h; I i; J j; - K k; L l; M m; N n; O o; -}; - -#endif -#endif -#endif -#endif - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif - -/////////////////////////////////////////////////////////////////////////////// -} // namespace phoenix - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/confix.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/confix.hpp deleted file mode 100644 index 42228ea242..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/confix.hpp +++ /dev/null @@ -1,405 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_CONFIX_HPP -#define BOOST_SPIRIT_CONFIX_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/config.hpp> -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/meta/as_parser.hpp> -#include <boost/spirit/home/classic/core/composite/operators.hpp> - -#include <boost/spirit/home/classic/utility/confix_fwd.hpp> -#include <boost/spirit/home/classic/utility/impl/confix.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// confix_parser class -// -// Parses a sequence of 3 sub-matches. This class may -// be used to parse structures, where the opening part is possibly -// contained in the expression part and the whole sequence is only -// parsed after seeing the closing part matching the first opening -// subsequence. Example: C-comments: -// -// /* This is a C-comment */ -// -/////////////////////////////////////////////////////////////////////////////// - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(push) -#pragma warning(disable:4512) //assignment operator could not be generated -#endif - -template<typename NestedT = non_nested, typename LexemeT = non_lexeme> -struct confix_parser_gen; - -template < - typename OpenT, typename ExprT, typename CloseT, typename CategoryT, - typename NestedT, typename LexemeT -> -struct confix_parser : - public parser< - confix_parser<OpenT, ExprT, CloseT, CategoryT, NestedT, LexemeT> - > -{ - typedef - confix_parser<OpenT, ExprT, CloseT, CategoryT, NestedT, LexemeT> - self_t; - - confix_parser(OpenT const &open_, ExprT const &expr_, CloseT const &close_) - : open(open_), expr(expr_), close(close_) - {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - return impl::confix_parser_type<CategoryT>:: - parse(NestedT(), LexemeT(), *this, scan, open, expr, close); - } - -private: - - typename as_parser<OpenT>::type::embed_t open; - typename as_parser<ExprT>::type::embed_t expr; - typename as_parser<CloseT>::type::embed_t close; -}; - -#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) -#pragma warning(pop) -#endif - -/////////////////////////////////////////////////////////////////////////////// -// -// Confix parser generator template -// -// This is a helper for generating a correct confix_parser<> from -// auxiliary parameters. There are the following types supported as -// parameters yet: parsers, single characters and strings (see -// as_parser). -// -// If the body parser is an action_parser_category type parser (a parser -// with an attached semantic action) we have to do something special. This -// happens, if the user wrote something like: -// -// confix_p(open, body[f], close) -// -// where 'body' is the parser matching the body of the confix sequence -// and 'f' is a functor to be called after matching the body. If we would -// do nothing, the resulting code would parse the sequence as follows: -// -// start >> (body[f] - close) >> close -// -// what in most cases is not what the user expects. -// (If this _is_ what you've expected, then please use the confix_p -// generator function 'direct()', which will inhibit -// re-attaching the actor to the body parser). -// -// To make the confix parser behave as expected: -// -// start >> (body - close)[f] >> close -// -// the actor attached to the 'body' parser has to be re-attached to the -// (body - close) parser construct, which will make the resulting confix -// parser 'do the right thing'. This refactoring is done by the help of -// the refactoring parsers (see the files refactoring.[hi]pp). -// -// Additionally special care must be taken, if the body parser is a -// unary_parser_category type parser as -// -// confix_p(open, *anychar_p, close) -// -// which without any refactoring would result in -// -// start >> (*anychar_p - close) >> close -// -// and will not give the expected result (*anychar_p will eat up all the -// input up to the end of the input stream). So we have to refactor this -// into: -// -// start >> *(anychar_p - close) >> close -// -// what will give the correct result. -// -// The case, where the body parser is a combination of the two mentioned -// problems (i.e. the body parser is a unary parser with an attached -// action), is handled accordingly too: -// -// confix_p(start, (*anychar_p)[f], end) -// -// will be parsed as expected: -// -// start >> (*(anychar_p - end))[f] >> end. -// -/////////////////////////////////////////////////////////////////////////////// - -template<typename NestedT, typename LexemeT> -struct confix_parser_gen -{ - // Generic generator function for creation of concrete confix parsers - - template<typename StartT, typename ExprT, typename EndT> - struct paren_op_result_type - { - typedef confix_parser< - typename as_parser<StartT>::type, - typename as_parser<ExprT>::type, - typename as_parser<EndT>::type, - typename as_parser<ExprT>::type::parser_category_t, - NestedT, - LexemeT - > type; - }; - - template<typename StartT, typename ExprT, typename EndT> - typename paren_op_result_type<StartT, ExprT, EndT>::type - operator()(StartT const &start_, ExprT const &expr_, EndT const &end_) const - { - typedef typename paren_op_result_type<StartT,ExprT,EndT>::type - return_t; - - return return_t( - as_parser<StartT>::convert(start_), - as_parser<ExprT>::convert(expr_), - as_parser<EndT>::convert(end_) - ); - } - - // Generic generator function for creation of concrete confix parsers - // which have an action directly attached to the ExprT part of the - // parser (see comment above, no automatic refactoring) - - template<typename StartT, typename ExprT, typename EndT> - struct direct_result_type - { - typedef confix_parser< - typename as_parser<StartT>::type, - typename as_parser<ExprT>::type, - typename as_parser<EndT>::type, - plain_parser_category, // do not re-attach action - NestedT, - LexemeT - > type; - }; - - template<typename StartT, typename ExprT, typename EndT> - typename direct_result_type<StartT,ExprT,EndT>::type - direct(StartT const &start_, ExprT const &expr_, EndT const &end_) const - { - typedef typename direct_result_type<StartT,ExprT,EndT>::type - return_t; - - return return_t( - as_parser<StartT>::convert(start_), - as_parser<ExprT>::convert(expr_), - as_parser<EndT>::convert(end_) - ); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Predefined non_nested confix parser generators -// -/////////////////////////////////////////////////////////////////////////////// - -const confix_parser_gen<non_nested, non_lexeme> confix_p = - confix_parser_gen<non_nested, non_lexeme>(); - -/////////////////////////////////////////////////////////////////////////////// -// -// Comments are special types of confix parsers -// -// Comment parser generator template. This is a helper for generating a -// correct confix_parser<> from auxiliary parameters, which is able to -// parse comment constructs: (StartToken >> Comment text >> EndToken). -// -// There are the following types supported as parameters yet: parsers, -// single characters and strings (see as_parser). -// -// There are two diffenerent predefined comment parser generators -// (comment_p and comment_nest_p, see below), which may be used for -// creating special comment parsers in two different ways. -// -// If these are used with one parameter, a comment starting with the given -// first parser parameter up to the end of the line is matched. So for -// instance the following parser matches C++ style comments: -// -// comment_p("//"). -// -// If these are used with two parameters, a comment starting with the -// first parser parameter up to the second parser parameter is matched. -// For instance a C style comment parser should be constrcuted as: -// -// comment_p("/*", "*/"). -// -// Please note, that a comment is parsed implicitly as if the whole -// comment_p(...) statement were embedded into a lexeme_d[] directive. -// -/////////////////////////////////////////////////////////////////////////////// - -template<typename NestedT> -struct comment_parser_gen -{ - // Generic generator function for creation of concrete comment parsers - // from an open token. The newline parser eol_p is used as the - // closing token. - - template<typename StartT> - struct paren_op1_result_type - { - typedef confix_parser< - typename as_parser<StartT>::type, - kleene_star<anychar_parser>, - alternative<eol_parser, end_parser>, - unary_parser_category, // there is no action to re-attach - NestedT, - is_lexeme // insert implicit lexeme_d[] - > - type; - }; - - template<typename StartT> - typename paren_op1_result_type<StartT>::type - operator() (StartT const &start_) const - { - typedef typename paren_op1_result_type<StartT>::type - return_t; - - return return_t( - as_parser<StartT>::convert(start_), - *anychar_p, - eol_p | end_p - ); - } - - // Generic generator function for creation of concrete comment parsers - // from an open and a close tokens. - - template<typename StartT, typename EndT> - struct paren_op2_result_type - { - typedef confix_parser< - typename as_parser<StartT>::type, - kleene_star<anychar_parser>, - typename as_parser<EndT>::type, - unary_parser_category, // there is no action to re-attach - NestedT, - is_lexeme // insert implicit lexeme_d[] - > type; - }; - - template<typename StartT, typename EndT> - typename paren_op2_result_type<StartT,EndT>::type - operator() (StartT const &start_, EndT const &end_) const - { - typedef typename paren_op2_result_type<StartT,EndT>::type - return_t; - - return return_t( - as_parser<StartT>::convert(start_), - *anychar_p, - as_parser<EndT>::convert(end_) - ); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Predefined non_nested comment parser generator -// -/////////////////////////////////////////////////////////////////////////////// - -const comment_parser_gen<non_nested> comment_p = - comment_parser_gen<non_nested>(); - -/////////////////////////////////////////////////////////////////////////////// -// -// comment_nest_parser class -// -// Parses a nested comments. -// Example: nested PASCAL-comments: -// -// { This is a { nested } PASCAL-comment } -// -/////////////////////////////////////////////////////////////////////////////// - -template<typename OpenT, typename CloseT> -struct comment_nest_parser: - public parser<comment_nest_parser<OpenT, CloseT> > -{ - typedef comment_nest_parser<OpenT, CloseT> self_t; - - comment_nest_parser(OpenT const &open_, CloseT const &close_): - open(open_), close(close_) - {} - - template<typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const &scan) const - { - return do_parse( - open >> *(*this | (anychar_p - close)) >> close, - scan); - } - -private: - template<typename ParserT, typename ScannerT> - typename parser_result<self_t, ScannerT>::type - do_parse(ParserT const &p, ScannerT const &scan) const - { - return - impl::contiguous_parser_parse< - typename parser_result<ParserT, ScannerT>::type - >(p, scan, scan); - } - - typename as_parser<OpenT>::type::embed_t open; - typename as_parser<CloseT>::type::embed_t close; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Predefined nested comment parser generator -// -/////////////////////////////////////////////////////////////////////////////// - -template<typename OpenT, typename CloseT> -struct comment_nest_p_result -{ - typedef comment_nest_parser< - typename as_parser<OpenT>::type, - typename as_parser<CloseT>::type - > type; -}; - -template<typename OpenT, typename CloseT> -inline typename comment_nest_p_result<OpenT,CloseT>::type -comment_nest_p(OpenT const &open, CloseT const &close) -{ - typedef typename comment_nest_p_result<OpenT,CloseT>::type - result_t; - - return result_t( - as_parser<OpenT>::convert(open), - as_parser<CloseT>::convert(close) - ); -} - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/confix_fwd.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/confix_fwd.hpp deleted file mode 100644 index 24e2236233..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/confix_fwd.hpp +++ /dev/null @@ -1,39 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Tobias Schwinger - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_CONFIX_FWD_HPP) -#define BOOST_SPIRIT_CONFIX_FWD_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - struct is_nested; - struct non_nested; - struct is_lexeme; - struct non_lexeme; - - template < - typename OpenT, typename ExprT, typename CloseT, - typename CategoryT = plain_parser_category, - typename NestedT = non_nested, typename LexemeT = non_lexeme - > - struct confix_parser; - - template<typename OpenT, typename CloseT> - struct comment_nest_parser; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/distinct.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/distinct.hpp deleted file mode 100644 index b66d409f5d..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/distinct.hpp +++ /dev/null @@ -1,229 +0,0 @@ -/*============================================================================= - Copyright (c) 1998-2003 Joel de Guzman - Copyright (c) 2003 Vaclav Vesely - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_DISTINCT_HPP) -#define BOOST_SPIRIT_DISTINCT_HPP - -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/primitives/primitives.hpp> -#include <boost/spirit/home/classic/core/composite/operators.hpp> -#include <boost/spirit/home/classic/core/composite/directives.hpp> -#include <boost/spirit/home/classic/core/composite/epsilon.hpp> -#include <boost/spirit/home/classic/core/non_terminal/rule.hpp> -#include <boost/spirit/home/classic/utility/chset.hpp> - -#include <boost/spirit/home/classic/utility/distinct_fwd.hpp> - -namespace boost { - namespace spirit { - BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -//----------------------------------------------------------------------------- -// distinct_parser class - -template <typename CharT, typename TailT> -class distinct_parser -{ -public: - typedef - contiguous< - sequence< - chseq<CharT const*>, - negated_empty_match_parser< - TailT - > - > - > - result_t; - - distinct_parser() - : tail(chset<CharT>()) - { - } - - explicit distinct_parser(parser<TailT> const & tail_) - : tail(tail_.derived()) - { - } - - explicit distinct_parser(CharT const* letters) - : tail(chset_p(letters)) - { - } - - result_t operator()(CharT const* str) const - { - return lexeme_d[chseq_p(str) >> ~epsilon_p(tail)]; - } - - TailT tail; -}; - -//----------------------------------------------------------------------------- -// distinct_directive class - -template <typename CharT, typename TailT> -class distinct_directive -{ -public: - template<typename ParserT> - struct result { - typedef - contiguous< - sequence< - ParserT, - negated_empty_match_parser< - TailT - > - > - > - type; - }; - - distinct_directive() - : tail(chset<CharT>()) - { - } - - explicit distinct_directive(CharT const* letters) - : tail(chset_p(letters)) - { - } - - explicit distinct_directive(parser<TailT> const & tail_) - : tail(tail_.derived()) - { - } - - template<typename ParserT> - typename result<typename as_parser<ParserT>::type>::type - operator[](ParserT const &subject) const - { - return - lexeme_d[as_parser<ParserT>::convert(subject) >> ~epsilon_p(tail)]; - } - - TailT tail; -}; - -//----------------------------------------------------------------------------- -// dynamic_distinct_parser class - -template <typename ScannerT> -class dynamic_distinct_parser -{ -public: - typedef typename ScannerT::value_t char_t; - - typedef - rule< - typename no_actions_scanner< - typename lexeme_scanner<ScannerT>::type - >::type - > - tail_t; - - typedef - contiguous< - sequence< - chseq<char_t const*>, - negated_empty_match_parser< - tail_t - > - > - > - result_t; - - dynamic_distinct_parser() - : tail(nothing_p) - { - } - - template<typename ParserT> - explicit dynamic_distinct_parser(parser<ParserT> const & tail_) - : tail(tail_.derived()) - { - } - - explicit dynamic_distinct_parser(char_t const* letters) - : tail(chset_p(letters)) - { - } - - result_t operator()(char_t const* str) const - { - return lexeme_d[chseq_p(str) >> ~epsilon_p(tail)]; - } - - tail_t tail; -}; - -//----------------------------------------------------------------------------- -// dynamic_distinct_directive class - -template <typename ScannerT> -class dynamic_distinct_directive -{ -public: - typedef typename ScannerT::value_t char_t; - - typedef - rule< - typename no_actions_scanner< - typename lexeme_scanner<ScannerT>::type - >::type - > - tail_t; - - template<typename ParserT> - struct result { - typedef - contiguous< - sequence< - ParserT, - negated_empty_match_parser< - tail_t - > - > - > - type; - }; - - dynamic_distinct_directive() - : tail(nothing_p) - { - } - - template<typename ParserT> - explicit dynamic_distinct_directive(parser<ParserT> const & tail_) - : tail(tail_.derived()) - { - } - - explicit dynamic_distinct_directive(char_t const* letters) - : tail(chset_p(letters)) - { - } - - template<typename ParserT> - typename result<typename as_parser<ParserT>::type>::type - operator[](ParserT const &subject) const - { - return - lexeme_d[as_parser<ParserT>::convert(subject) >> ~epsilon_p(tail)]; - } - - tail_t tail; -}; - -//----------------------------------------------------------------------------- - BOOST_SPIRIT_CLASSIC_NAMESPACE_END - } // namespace spirit -} // namespace boost - -#endif // !defined(BOOST_SPIRIT_DISTINCT_HPP) diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/distinct_fwd.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/distinct_fwd.hpp deleted file mode 100644 index 368d1f0162..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/distinct_fwd.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Tobias Schwinger - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_DISTINCT_FWD_HPP) -#define BOOST_SPIRIT_DISTINCT_FWD_HPP - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - template<typename CharT> class chset; - - template <typename CharT = char, typename TailT = chset<CharT> > - class distinct_parser; - - template <typename CharT = char, typename TailT = chset<CharT> > - class distinct_directive; - - template <typename ScannerT = scanner<> > - class dynamic_distinct_parser; - - template <typename ScannerT = scanner<> > - class dynamic_distinct_directive; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/escape_char.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/escape_char.hpp deleted file mode 100644 index 375402f73a..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/escape_char.hpp +++ /dev/null @@ -1,184 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Daniel Nuffer - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ESCAPE_CHAR_HPP -#define BOOST_SPIRIT_ESCAPE_CHAR_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <string> -#include <iterator> -#include <cctype> -#include <boost/limits.hpp> - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/debug.hpp> - -#include <boost/spirit/home/classic/utility/escape_char_fwd.hpp> -#include <boost/spirit/home/classic/utility/impl/escape_char.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// escape_char_action class -// -// Links an escape char parser with a user defined semantic action. -// The semantic action may be a function or a functor. A function -// should be compatible with the interface: -// -// void f(CharT ch); -// -// A functor should have a member operator() with a compatible signature -// as above. The matching character is passed into the function/functor. -// This is the default class that character parsers use when dealing with -// the construct: -// -// p[f] -// -// where p is a parser and f is a function or functor. -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename ParserT, typename ActionT, - unsigned long Flags, typename CharT -> -struct escape_char_action -: public unary<ParserT, - parser<escape_char_action<ParserT, ActionT, Flags, CharT> > > -{ - typedef escape_char_action - <ParserT, ActionT, Flags, CharT> self_t; - typedef action_parser_category parser_category_t; - typedef unary<ParserT, parser<self_t> > base_t; - - template <typename ScannerT> - struct result - { - typedef typename match_result<ScannerT, CharT>::type type; - }; - - escape_char_action(ParserT const& p, ActionT const& a) - : base_t(p), actor(a) {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - return impl::escape_char_action_parse<Flags, CharT>:: - parse(scan, *this); - } - - ActionT const& predicate() const { return actor; } - -private: - - ActionT actor; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// escape_char_parser class -// -// The escape_char_parser helps in conjunction with the escape_char_action -// template class (see above) in parsing escaped characters. There are two -// different variants of this parser: one for parsing C style escaped -// characters and one for parsing LEX style escaped characters. -// -// The C style escaped character parser is generated, when the template -// parameter 'Flags' is equal to 'c_escapes' (a constant defined in the -// file impl/escape_char.ipp). This parser recognizes all valid C escape -// character sequences: '\t', '\b', '\f', '\n', '\r', '\"', '\'', '\\' -// and the numeric style escapes '\120' (octal) and '\x2f' (hexadecimal) -// and converts these to their character equivalent, for instance the -// sequence of a backslash and a 'b' is parsed as the character '\b'. -// All other escaped characters are rejected by this parser. -// -// The LEX style escaped character parser is generated, when the template -// parameter 'Flags' is equal to 'lex_escapes' (a constant defined in the -// file impl/escape_char.ipp). This parser recognizes all the C style -// escaped character sequences (as described above) and additionally -// does not reject all other escape sequences. All not mentioned escape -// sequences are converted by the parser to the plain character, for -// instance '\a' will be parsed as 'a'. -// -// All not escaped characters are parsed without modification. -// -/////////////////////////////////////////////////////////////////////////////// - -template <unsigned long Flags, typename CharT> -struct escape_char_action_parser_gen; - -template <unsigned long Flags, typename CharT> -struct escape_char_parser : - public parser<escape_char_parser<Flags, CharT> > { - - // only the values c_escapes and lex_escapes are valid for Flags - BOOST_STATIC_ASSERT(Flags == c_escapes || Flags == lex_escapes); - - typedef escape_char_parser<Flags, CharT> self_t; - typedef - escape_char_action_parser_gen<Flags, CharT> - action_parser_generator_t; - - template <typename ScannerT> - struct result { - - typedef typename match_result<ScannerT, CharT>::type type; - }; - - template <typename ActionT> - escape_char_action<self_t, ActionT, Flags, CharT> - operator[](ActionT const& actor) const - { - return escape_char_action<self_t, ActionT, Flags, CharT>(*this, actor); - } - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const &scan) const - { - return impl::escape_char_parse<CharT>::parse(scan, *this); - } -}; - -template <unsigned long Flags, typename CharT> -struct escape_char_action_parser_gen { - - template <typename ParserT, typename ActionT> - static escape_char_action<ParserT, ActionT, Flags, CharT> - generate (ParserT const &p, ActionT const &actor) - { - typedef - escape_char_action<ParserT, ActionT, Flags, CharT> - action_parser_t; - return action_parser_t(p, actor); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// predefined escape_char_parser objects -// -// These objects should be used for generating correct escaped character -// parsers. -// -/////////////////////////////////////////////////////////////////////////////// -const escape_char_parser<lex_escapes> lex_escape_ch_p = - escape_char_parser<lex_escapes>(); - -const escape_char_parser<c_escapes> c_escape_ch_p = - escape_char_parser<c_escapes>(); - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/escape_char_fwd.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/escape_char_fwd.hpp deleted file mode 100644 index 1485367164..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/escape_char_fwd.hpp +++ /dev/null @@ -1,30 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Tobias Schwinger - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_ESCAPE_CHAR_FWD_HPP) -#define BOOST_SPIRIT_ESCAPE_CHAR_FWD_HPP - -#include <boost/spirit/home/classic/namespace.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - template <unsigned long Flags, typename CharT = char> - struct escape_char_parser; - - template < - class ParserT, typename ActionT, - unsigned long Flags, typename CharT = char> - struct escape_char_action; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/confix.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/confix.ipp deleted file mode 100644 index 494c4807cd..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/confix.ipp +++ /dev/null @@ -1,221 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#ifndef BOOST_SPIRIT_CONFIX_IPP -#define BOOST_SPIRIT_CONFIX_IPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/meta/refactoring.hpp> -#include <boost/spirit/home/classic/core/composite/impl/directives.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// Types to distinguish nested and non-nested confix parsers -// -/////////////////////////////////////////////////////////////////////////////// -struct is_nested {}; -struct non_nested {}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Types to distinguish between confix parsers, which are implicitly lexems -// and without this behaviour -// -/////////////////////////////////////////////////////////////////////////////// -struct is_lexeme {}; -struct non_lexeme {}; - -/////////////////////////////////////////////////////////////////////////////// -// -// confix_parser_type class implementation -// -/////////////////////////////////////////////////////////////////////////////// -namespace impl { - - /////////////////////////////////////////////////////////////////////////// - // implicitly insert a lexeme_d into the parsing process - - template <typename LexemeT> - struct select_confix_parse_lexeme; - - template <> - struct select_confix_parse_lexeme<is_lexeme> { - - template <typename ParserT, typename ScannerT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const& p, ScannerT const& scan) - { - typedef typename parser_result<ParserT, ScannerT>::type result_t; - return contiguous_parser_parse<result_t>(p, scan, scan); - } - }; - - template <> - struct select_confix_parse_lexeme<non_lexeme> { - - template <typename ParserT, typename ScannerT> - static typename parser_result<ParserT, ScannerT>::type - parse(ParserT const& p, ScannerT const& scan) - { - return p.parse(scan); - } - }; - - /////////////////////////////////////////////////////////////////////////// - // parse confix sequences with refactoring - - template <typename NestedT> - struct select_confix_parse_refactor; - - template <> - struct select_confix_parse_refactor<is_nested> { - - template < - typename LexemeT, typename ParserT, typename ScannerT, - typename OpenT, typename ExprT, typename CloseT - > - static typename parser_result<ParserT, ScannerT>::type - parse( - LexemeT const &, ParserT const& this_, ScannerT const& scan, - OpenT const& open, ExprT const& expr, CloseT const& close) - { - typedef refactor_action_gen<refactor_unary_gen<> > refactor_t; - const refactor_t refactor_body_d = refactor_t(refactor_unary_d); - - return select_confix_parse_lexeme<LexemeT>::parse(( - open - >> (this_ | refactor_body_d[expr - close]) - >> close - ), scan); - } - }; - - template <> - struct select_confix_parse_refactor<non_nested> { - - template < - typename LexemeT, typename ParserT, typename ScannerT, - typename OpenT, typename ExprT, typename CloseT - > - static typename parser_result<ParserT, ScannerT>::type - parse( - LexemeT const &, ParserT const& /*this_*/, ScannerT const& scan, - OpenT const& open, ExprT const& expr, CloseT const& close) - { - typedef refactor_action_gen<refactor_unary_gen<> > refactor_t; - const refactor_t refactor_body_d = refactor_t(refactor_unary_d); - - return select_confix_parse_lexeme<LexemeT>::parse(( - open - >> refactor_body_d[expr - close] - >> close - ), scan); - } - }; - - /////////////////////////////////////////////////////////////////////////// - // parse confix sequences without refactoring - - template <typename NestedT> - struct select_confix_parse_no_refactor; - - template <> - struct select_confix_parse_no_refactor<is_nested> { - - template < - typename LexemeT, typename ParserT, typename ScannerT, - typename OpenT, typename ExprT, typename CloseT - > - static typename parser_result<ParserT, ScannerT>::type - parse( - LexemeT const &, ParserT const& this_, ScannerT const& scan, - OpenT const& open, ExprT const& expr, CloseT const& close) - { - return select_confix_parse_lexeme<LexemeT>::parse(( - open - >> (this_ | (expr - close)) - >> close - ), scan); - } - }; - - template <> - struct select_confix_parse_no_refactor<non_nested> { - - template < - typename LexemeT, typename ParserT, typename ScannerT, - typename OpenT, typename ExprT, typename CloseT - > - static typename parser_result<ParserT, ScannerT>::type - parse( - LexemeT const &, ParserT const & /*this_*/, ScannerT const& scan, - OpenT const& open, ExprT const& expr, CloseT const& close) - { - return select_confix_parse_lexeme<LexemeT>::parse(( - open - >> (expr - close) - >> close - ), scan); - } - }; - - // the refactoring is handled by the refactoring parsers, so here there - // is no need to pay attention to these issues. - - template <typename CategoryT> - struct confix_parser_type { - - template < - typename NestedT, typename LexemeT, - typename ParserT, typename ScannerT, - typename OpenT, typename ExprT, typename CloseT - > - static typename parser_result<ParserT, ScannerT>::type - parse( - NestedT const &, LexemeT const &lexeme, - ParserT const& this_, ScannerT const& scan, - OpenT const& open, ExprT const& expr, CloseT const& close) - { - return select_confix_parse_refactor<NestedT>:: - parse(lexeme, this_, scan, open, expr, close); - } - }; - - template <> - struct confix_parser_type<plain_parser_category> { - - template < - typename NestedT, typename LexemeT, - typename ParserT, typename ScannerT, - typename OpenT, typename ExprT, typename CloseT - > - static typename parser_result<ParserT, ScannerT>::type - parse( - NestedT const &, LexemeT const &lexeme, - ParserT const& this_, ScannerT const& scan, - OpenT const& open, ExprT const& expr, CloseT const& close) - { - return select_confix_parse_no_refactor<NestedT>:: - parse(lexeme, this_, scan, open, expr, close); - } - }; - -} // namespace impl - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/escape_char.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/escape_char.ipp deleted file mode 100644 index 6e19043c8d..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/escape_char.ipp +++ /dev/null @@ -1,224 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2003 Daniel Nuffer - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#ifndef BOOST_SPIRIT_ESCAPE_CHAR_IPP -#define BOOST_SPIRIT_ESCAPE_CHAR_IPP - -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/primitives/numerics.hpp> -#include <boost/spirit/home/classic/core/composite/difference.hpp> -#include <boost/spirit/home/classic/core/composite/sequence.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// escape_char_parser class -// -/////////////////////////////////////////////////////////////////////////////// - -const unsigned long c_escapes = 1; -const unsigned long lex_escapes = c_escapes << 1; - -////////////////////////////////// -namespace impl { - - ////////////////////////////////// -#if defined(BOOST_MSVC) -#pragma warning(push) -#pragma warning(disable:4127) -#endif - template <unsigned long Flags, typename CharT> - struct escape_char_action_parse { - - template <typename ParserT, typename ScannerT> - static typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const& scan, ParserT const &p) - { - // Actually decode the escape char. - typedef CharT char_t; - typedef typename ScannerT::iterator_t iterator_t; - typedef typename parser_result<ParserT, ScannerT>::type result_t; - - if (scan.first != scan.last) { - - iterator_t save = scan.first; - if (result_t hit = p.subject().parse(scan)) { - - char_t unescaped; - - scan.first = save; - if (*scan.first == '\\') { - - ++scan.first; - switch (*scan.first) { - case 'b': unescaped = '\b'; ++scan.first; break; - case 't': unescaped = '\t'; ++scan.first; break; - case 'n': unescaped = '\n'; ++scan.first; break; - case 'f': unescaped = '\f'; ++scan.first; break; - case 'r': unescaped = '\r'; ++scan.first; break; - case '"': unescaped = '"'; ++scan.first; break; - case '\'': unescaped = '\''; ++scan.first; break; - case '\\': unescaped = '\\'; ++scan.first; break; - - case 'x': case 'X': - { - char_t hex = 0; - char_t const lim = - (std::numeric_limits<char_t>::max)() >> 4; - - ++scan.first; - while (scan.first != scan.last) - { - char_t c = *scan.first; - if (hex > lim && impl::isxdigit_(c)) - { - // overflow detected - scan.first = save; - return scan.no_match(); - } - if (impl::isdigit_(c)) - { - hex <<= 4; - hex |= c - '0'; - ++scan.first; - } - else if (impl::isxdigit_(c)) - { - hex <<= 4; - c = impl::toupper_(c); - hex |= c - 'A' + 0xA; - ++scan.first; - } - else - { - break; // reached the end of the number - } - } - unescaped = hex; - } - break; - - case '0': case '1': case '2': case '3': - case '4': case '5': case '6': case '7': - { - char_t oct = 0; - char_t const lim = - (std::numeric_limits<char_t>::max)() >> 3; - while (scan.first != scan.last) - { - char_t c = *scan.first; - if (oct > lim && (c >= '0' && c <= '7')) - { - // overflow detected - scan.first = save; - return scan.no_match(); - } - - if (c >= '0' && c <= '7') - { - oct <<= 3; - oct |= c - '0'; - ++scan.first; - } - else - { - break; // reached end of digits - } - } - unescaped = oct; - } - break; - - default: - if (Flags & c_escapes) - { - // illegal C escape sequence - scan.first = save; - return scan.no_match(); - } - else - { - unescaped = *scan.first; - ++scan.first; - } - break; - } - } - else { - unescaped = *scan.first; - ++scan.first; - } - - scan.do_action(p.predicate(), unescaped, save, scan.first); - return hit; - } - } - return scan.no_match(); // overflow detected - } - }; -#if defined(BOOST_MSVC) -#pragma warning(pop) -#endif - - ////////////////////////////////// - template <typename CharT> - struct escape_char_parse { - - template <typename ScannerT, typename ParserT> - static typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const &scan, ParserT const &/*p*/) - { - typedef - uint_parser<CharT, 8, 1, - std::numeric_limits<CharT>::digits / 3 + 1 - > - oct_parser_t; - typedef - uint_parser<CharT, 16, 1, - std::numeric_limits<CharT>::digits / 4 + 1 - > - hex_parser_t; - - typedef alternative<difference<anychar_parser, chlit<CharT> >, - sequence<chlit<CharT>, alternative<alternative<oct_parser_t, - sequence<inhibit_case<chlit<CharT> >, hex_parser_t > >, - difference<difference<anychar_parser, - inhibit_case<chlit<CharT> > >, oct_parser_t > > > > - parser_t; - - static parser_t p = - ( (anychar_p - chlit<CharT>(CharT('\\'))) - | (chlit<CharT>(CharT('\\')) >> - ( oct_parser_t() - | as_lower_d[chlit<CharT>(CharT('x'))] >> hex_parser_t() - | (anychar_p - as_lower_d[chlit<CharT>(CharT('x'))] - oct_parser_t()) - ) - )); - - BOOST_SPIRIT_DEBUG_TRACE_NODE(p, - (BOOST_SPIRIT_DEBUG_FLAGS & BOOST_SPIRIT_DEBUG_FLAGS_ESCAPE_CHAR) != 0); - - return p.parse(scan); - } - }; - -/////////////////////////////////////////////////////////////////////////////// -} // namespace impl - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/lists.ipp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/lists.ipp deleted file mode 100644 index a3dd462fcd..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/impl/lists.ipp +++ /dev/null @@ -1,168 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - 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) -=============================================================================*/ -#ifndef BOOST_SPIRIT_LISTS_IPP -#define BOOST_SPIRIT_LISTS_IPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/spirit/home/classic/meta/refactoring.hpp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// list_parser_type class implementation -// -/////////////////////////////////////////////////////////////////////////////// -struct no_list_endtoken { typedef no_list_endtoken embed_t; }; - -namespace impl { - -/////////////////////////////////////////////////////////////////////////////// -// -// Refactor the original list item parser -// -/////////////////////////////////////////////////////////////////////////////// - - // match list with 'extended' syntax - template <typename EndT> - struct select_list_parse_refactor { - - template < - typename ParserT, typename ScannerT, - typename ItemT, typename DelimT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const& scan, ParserT const& /*p*/, - ItemT const &item, DelimT const &delim, EndT const &end) - { - typedef refactor_action_gen<refactor_unary_gen<> > refactor_t; - const refactor_t refactor_item_d = refactor_t(refactor_unary_d); - - return ( - refactor_item_d[item - (end | delim)] - >> *(delim >> refactor_item_d[item - (end | delim)]) - >> !(delim >> end) - ).parse(scan); - } - }; - - // match list with 'normal' syntax (without an 'end' parser) - template <> - struct select_list_parse_refactor<no_list_endtoken> { - - template < - typename ParserT, typename ScannerT, - typename ItemT, typename DelimT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const& scan, ParserT const& /*p*/, - ItemT const &item, DelimT const &delim, no_list_endtoken const&) - { - typedef refactor_action_gen<refactor_unary_gen<> > refactor_t; - const refactor_t refactor_item_d = refactor_t(refactor_unary_d); - - return ( - refactor_item_d[item - delim] - >> *(delim >> refactor_item_d[item - delim]) - ).parse(scan); - } - }; - -/////////////////////////////////////////////////////////////////////////////// -// -// Do not refactor the original list item parser. -// -/////////////////////////////////////////////////////////////////////////////// - - // match list with 'extended' syntax - template <typename EndT> - struct select_list_parse_no_refactor { - - template < - typename ParserT, typename ScannerT, - typename ItemT, typename DelimT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const& scan, ParserT const& /*p*/, - ItemT const &item, DelimT const &delim, EndT const &end) - { - return ( - (item - (end | delim)) - >> *(delim >> (item - (end | delim))) - >> !(delim >> end) - ).parse(scan); - } - }; - - // match list with 'normal' syntax (without an 'end' parser) - template <> - struct select_list_parse_no_refactor<no_list_endtoken> { - - template < - typename ParserT, typename ScannerT, - typename ItemT, typename DelimT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const& scan, ParserT const& /*p*/, - ItemT const &item, DelimT const &delim, no_list_endtoken const&) - { - return ( - (item - delim) - >> *(delim >> (item - delim)) - ).parse(scan); - } - }; - - // the refactoring is handled by the refactoring parsers, so here there - // is no need to pay attention to these issues. - - template <typename CategoryT> - struct list_parser_type { - - template < - typename ParserT, typename ScannerT, - typename ItemT, typename DelimT, typename EndT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const& scan, ParserT const& p, - ItemT const &item, DelimT const &delim, EndT const &end) - { - return select_list_parse_refactor<EndT>:: - parse(scan, p, item, delim, end); - } - }; - - template <> - struct list_parser_type<plain_parser_category> { - - template < - typename ParserT, typename ScannerT, - typename ItemT, typename DelimT, typename EndT - > - static typename parser_result<ParserT, ScannerT>::type - parse(ScannerT const& scan, ParserT const& p, - ItemT const &item, DelimT const &delim, EndT const &end) - { - return select_list_parse_no_refactor<EndT>:: - parse(scan, p, item, delim, end); - } - }; - -} // namespace impl - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace boost::spirit - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/lists.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/lists.hpp deleted file mode 100644 index 48e9de01da..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/lists.hpp +++ /dev/null @@ -1,340 +0,0 @@ -/*============================================================================= - Copyright (c) 2002-2003 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_LISTS_HPP -#define BOOST_SPIRIT_LISTS_HPP - -/////////////////////////////////////////////////////////////////////////////// -#include <boost/config.hpp> -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/meta/as_parser.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> -#include <boost/spirit/home/classic/core/composite/composite.hpp> - -#include <boost/spirit/home/classic/utility/lists_fwd.hpp> -#include <boost/spirit/home/classic/utility/impl/lists.ipp> - -/////////////////////////////////////////////////////////////////////////////// -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - -/////////////////////////////////////////////////////////////////////////////// -// -// list_parser class -// -// List parsers allow to parse constructs like -// -// item >> *(delim >> item) -// -// where 'item' is an auxiliary expression to parse and 'delim' is an -// auxiliary delimiter to parse. -// -// The list_parser class also can match an optional closing delimiter -// represented by the 'end' parser at the end of the list: -// -// item >> *(delim >> item) >> !end. -// -// If ItemT is an action_parser_category type (parser with an attached -// semantic action) we have to do something special. This happens, if the -// user wrote something like: -// -// list_p(item[f], delim) -// -// where 'item' is the parser matching one item of the list sequence and -// 'f' is a functor to be called after matching one item. If we would do -// nothing, the resulting code would parse the sequence as follows: -// -// (item[f] - delim) >> *(delim >> (item[f] - delim)) -// -// what in most cases is not what the user expects. -// (If this _is_ what you've expected, then please use one of the list_p -// generator functions 'direct()', which will inhibit re-attaching -// the actor to the item parser). -// -// To make the list parser behave as expected: -// -// (item - delim)[f] >> *(delim >> (item - delim)[f]) -// -// the actor attached to the 'item' parser has to be re-attached to the -// *(item - delim) parser construct, which will make the resulting list -// parser 'do the right thing'. -// -// Additionally special care must be taken, if the item parser is a -// unary_parser_category type parser as -// -// list_p(*anychar_p, ',') -// -// which without any refactoring would result in -// -// (*anychar_p - ch_p(',')) -// >> *( ch_p(',') >> (*anychar_p - ch_p(',')) ) -// -// and will not give the expected result (the first *anychar_p will eat up -// all the input up to the end of the input stream). So we have to -// refactor this into: -// -// *(anychar_p - ch_p(',')) -// >> *( ch_p(',') >> *(anychar_p - ch_p(',')) ) -// -// what will give the correct result. -// -// The case, where the item parser is a combination of the two mentioned -// problems (i.e. the item parser is a unary parser with an attached -// action), is handled accordingly too: -// -// list_p((*anychar_p)[f], ',') -// -// will be parsed as expected: -// -// (*(anychar_p - ch_p(',')))[f] -// >> *( ch_p(',') >> (*(anychar_p - ch_p(',')))[f] ). -// -/////////////////////////////////////////////////////////////////////////////// -template < - typename ItemT, typename DelimT, typename EndT, typename CategoryT -> -struct list_parser : - public parser<list_parser<ItemT, DelimT, EndT, CategoryT> > { - - typedef list_parser<ItemT, DelimT, EndT, CategoryT> self_t; - typedef CategoryT parser_category_t; - - list_parser(ItemT const &item_, DelimT const &delim_, - EndT const& end_ = no_list_endtoken()) - : item(item_), delim(delim_), end(end_) - {} - - template <typename ScannerT> - typename parser_result<self_t, ScannerT>::type - parse(ScannerT const& scan) const - { - return impl::list_parser_type<CategoryT> - ::parse(scan, *this, item, delim, end); - } - -private: - typename as_parser<ItemT>::type::embed_t item; - typename as_parser<DelimT>::type::embed_t delim; - typename as_parser<EndT>::type::embed_t end; -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// List parser generator template -// -// This is a helper for generating a correct list_parser<> from -// auxiliary parameters. There are the following types supported as -// parameters yet: parsers, single characters and strings (see -// as_parser<> in meta/as_parser.hpp). -// -// The list_parser_gen by itself can be used for parsing comma separated -// lists without item formatting: -// -// list_p.parse(...) -// matches any comma separated list. -// -// If list_p is used with one parameter, this parameter is used to match -// the delimiter: -// -// list_p(';').parse(...) -// matches any semicolon separated list. -// -// If list_p is used with two parameters, the first parameter is used to -// match the items and the second parameter matches the delimiters: -// -// list_p(uint_p, ',').parse(...) -// matches comma separated unsigned integers. -// -// If list_p is used with three parameters, the first parameter is used -// to match the items, the second one is used to match the delimiters and -// the third one is used to match an optional ending token sequence: -// -// list_p(real_p, ';', eol_p).parse(...) -// matches a semicolon separated list of real numbers optionally -// followed by an end of line. -// -// The list_p in the previous examples denotes the predefined parser -// generator, which should be used to define list parsers (see below). -// -/////////////////////////////////////////////////////////////////////////////// - -template <typename CharT = char> -struct list_parser_gen : - public list_parser<kleene_star<anychar_parser>, chlit<CharT> > -{ - typedef list_parser_gen<CharT> self_t; - -// construct the list_parser_gen object as an list parser for comma separated -// lists without item formatting. - list_parser_gen() - : list_parser<kleene_star<anychar_parser>, chlit<CharT> > - (*anychar_p, chlit<CharT>(',')) - {} - -// The following generator functions should be used under normal circumstances. -// (the operator()(...) functions) - - // Generic generator functions for creation of concrete list parsers, which - // support 'normal' syntax: - // - // item >> *(delim >> item) - // - // If item isn't given, everything between two delimiters is matched. - - template<typename DelimT> - list_parser< - kleene_star<anychar_parser>, - typename as_parser<DelimT>::type, - no_list_endtoken, - unary_parser_category // there is no action to re-attach - > - operator()(DelimT const &delim_) const - { - typedef kleene_star<anychar_parser> item_t; - typedef typename as_parser<DelimT>::type delim_t; - - typedef - list_parser<item_t, delim_t, no_list_endtoken, unary_parser_category> - return_t; - - return return_t(*anychar_p, as_parser<DelimT>::convert(delim_)); - } - - template<typename ItemT, typename DelimT> - list_parser< - typename as_parser<ItemT>::type, - typename as_parser<DelimT>::type, - no_list_endtoken, - typename as_parser<ItemT>::type::parser_category_t - > - operator()(ItemT const &item_, DelimT const &delim_) const - { - typedef typename as_parser<ItemT>::type item_t; - typedef typename as_parser<DelimT>::type delim_t; - typedef list_parser<item_t, delim_t, no_list_endtoken, - BOOST_DEDUCED_TYPENAME item_t::parser_category_t> - return_t; - - return return_t( - as_parser<ItemT>::convert(item_), - as_parser<DelimT>::convert(delim_) - ); - } - - // Generic generator function for creation of concrete list parsers, which - // support 'extended' syntax: - // - // item >> *(delim >> item) >> !end - - template<typename ItemT, typename DelimT, typename EndT> - list_parser< - typename as_parser<ItemT>::type, - typename as_parser<DelimT>::type, - typename as_parser<EndT>::type, - typename as_parser<ItemT>::type::parser_category_t - > - operator()( - ItemT const &item_, DelimT const &delim_, EndT const &end_) const - { - typedef typename as_parser<ItemT>::type item_t; - typedef typename as_parser<DelimT>::type delim_t; - typedef typename as_parser<EndT>::type end_t; - - typedef list_parser<item_t, delim_t, end_t, - BOOST_DEDUCED_TYPENAME item_t::parser_category_t> - return_t; - - return return_t( - as_parser<ItemT>::convert(item_), - as_parser<DelimT>::convert(delim_), - as_parser<EndT>::convert(end_) - ); - } - -// The following functions should be used, if the 'item' parser has an attached -// semantic action or is a unary_parser_category type parser and the structure -// of the resulting list parser should _not_ be refactored during parser -// construction (see comment above). - - // Generic generator function for creation of concrete list parsers, which - // support 'normal' syntax: - // - // item >> *(delim >> item) - - template<typename ItemT, typename DelimT> - list_parser< - typename as_parser<ItemT>::type, - typename as_parser<DelimT>::type, - no_list_endtoken, - plain_parser_category // inhibit action re-attachment - > - direct(ItemT const &item_, DelimT const &delim_) const - { - typedef typename as_parser<ItemT>::type item_t; - typedef typename as_parser<DelimT>::type delim_t; - typedef list_parser<item_t, delim_t, no_list_endtoken, - plain_parser_category> - return_t; - - return return_t( - as_parser<ItemT>::convert(item_), - as_parser<DelimT>::convert(delim_) - ); - } - - // Generic generator function for creation of concrete list parsers, which - // support 'extended' syntax: - // - // item >> *(delim >> item) >> !end - - template<typename ItemT, typename DelimT, typename EndT> - list_parser< - typename as_parser<ItemT>::type, - typename as_parser<DelimT>::type, - typename as_parser<EndT>::type, - plain_parser_category // inhibit action re-attachment - > - direct( - ItemT const &item_, DelimT const &delim_, EndT const &end_) const - { - typedef typename as_parser<ItemT>::type item_t; - typedef typename as_parser<DelimT>::type delim_t; - typedef typename as_parser<EndT>::type end_t; - - typedef - list_parser<item_t, delim_t, end_t, plain_parser_category> - return_t; - - return return_t( - as_parser<ItemT>::convert(item_), - as_parser<DelimT>::convert(delim_), - as_parser<EndT>::convert(end_) - ); - } -}; - -/////////////////////////////////////////////////////////////////////////////// -// -// Predefined list parser generator -// -// The list_p parser generator can be used -// - by itself for parsing comma separated lists without item formatting -// or -// - for generating list parsers with auxiliary parser parameters -// for the 'item', 'delim' and 'end' subsequences. -// (see comment above) -// -/////////////////////////////////////////////////////////////////////////////// -const list_parser_gen<> list_p = list_parser_gen<>(); - -/////////////////////////////////////////////////////////////////////////////// -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/lists_fwd.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/lists_fwd.hpp deleted file mode 100644 index 1defcb6d66..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/home/classic/utility/lists_fwd.hpp +++ /dev/null @@ -1,31 +0,0 @@ -/*============================================================================= - Copyright (c) 2006 Tobias Schwinger - http://spirit.sourceforge.net/ - - Distributed under the 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_SPIRIT_LISTS_FWD_HPP) -#define BOOST_SPIRIT_LISTS_FWD_HPP - -#include <boost/spirit/home/classic/namespace.hpp> -#include <boost/spirit/home/classic/core/parser.hpp> - -namespace boost { namespace spirit { - -BOOST_SPIRIT_CLASSIC_NAMESPACE_BEGIN - - struct no_list_endtoken; - - template < - typename ItemT, typename DelimT, typename EndT = no_list_endtoken, - typename CategoryT = plain_parser_category - > - struct list_parser; - -BOOST_SPIRIT_CLASSIC_NAMESPACE_END - -}} // namespace BOOST_SPIRIT_CLASSIC_NS - -#endif - diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_actor.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_actor.hpp deleted file mode 100644 index a4c991419c..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_actor.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_ACTOR -#define BOOST_SPIRIT_INCLUDE_CLASSIC_ACTOR -#include <boost/spirit/home/classic/actor.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_attribute.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_attribute.hpp deleted file mode 100644 index 033e484641..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_attribute.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_ATTRIBUTE -#define BOOST_SPIRIT_INCLUDE_CLASSIC_ATTRIBUTE -#include <boost/spirit/home/classic/attribute.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_closure.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_closure.hpp deleted file mode 100644 index 977b923729..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_closure.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_CLOSURE -#define BOOST_SPIRIT_INCLUDE_CLASSIC_CLOSURE -#include <boost/spirit/home/classic/attribute/closure.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_confix.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_confix.hpp deleted file mode 100644 index 0c390da9ab..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_confix.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_CONFIX -#define BOOST_SPIRIT_INCLUDE_CLASSIC_CONFIX -#include <boost/spirit/home/classic/utility/confix.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_core.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_core.hpp deleted file mode 100644 index ba6aacbe7b..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_core.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_CORE -#define BOOST_SPIRIT_INCLUDE_CLASSIC_CORE -#include <boost/spirit/home/classic/core.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_distinct.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_distinct.hpp deleted file mode 100644 index a0f6ce54f0..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_distinct.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_DISTINCT -#define BOOST_SPIRIT_INCLUDE_CLASSIC_DISTINCT -#include <boost/spirit/home/classic/utility/distinct.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_dynamic.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_dynamic.hpp deleted file mode 100644 index 91a772e55a..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_dynamic.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_DYNAMIC -#define BOOST_SPIRIT_INCLUDE_CLASSIC_DYNAMIC -#include <boost/spirit/home/classic/dynamic.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_escape_char.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_escape_char.hpp deleted file mode 100644 index 08468cc9ef..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_escape_char.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_ESCAPE_CHAR -#define BOOST_SPIRIT_INCLUDE_CLASSIC_ESCAPE_CHAR -#include <boost/spirit/home/classic/utility/escape_char.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_lists.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_lists.hpp deleted file mode 100644 index f5d4b2693d..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_lists.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_LISTS -#define BOOST_SPIRIT_INCLUDE_CLASSIC_LISTS -#include <boost/spirit/home/classic/utility/lists.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_multi_pass.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_multi_pass.hpp deleted file mode 100644 index 4d4c0765c2..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/classic_multi_pass.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_CLASSIC_MULTI_PASS -#define BOOST_SPIRIT_INCLUDE_CLASSIC_MULTI_PASS -#include <boost/spirit/home/classic/iterator/multi_pass.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/phoenix1.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/phoenix1.hpp deleted file mode 100644 index fb75af1b2f..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/phoenix1.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_PHOENIX1 -#define BOOST_SPIRIT_INCLUDE_PHOENIX1 -#include <boost/spirit/home/classic/phoenix.hpp> -#endif diff --git a/contrib/restricted/boost/spirit/include/boost/spirit/include/phoenix1_binders.hpp b/contrib/restricted/boost/spirit/include/boost/spirit/include/phoenix1_binders.hpp deleted file mode 100644 index f7b0220819..0000000000 --- a/contrib/restricted/boost/spirit/include/boost/spirit/include/phoenix1_binders.hpp +++ /dev/null @@ -1,12 +0,0 @@ -/*============================================================================= - Copyright (c) 2001-2008 Joel de Guzman - Copyright (c) 2001-2008 Hartmut Kaiser - http://spirit.sourceforge.net/ - - Distributed under the Boost Software License, Version 1.0. (See accompanying - file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -=============================================================================*/ -#ifndef BOOST_SPIRIT_INCLUDE_PHOENIX1_BINDERS -#define BOOST_SPIRIT_INCLUDE_PHOENIX1_BINDERS -#include <boost/spirit/home/classic/phoenix/binders.hpp> -#endif diff --git a/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/compile.hpp b/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/compile.hpp deleted file mode 100644 index 0ce5a5adf3..0000000000 --- a/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/compile.hpp +++ /dev/null @@ -1,104 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// compile.hpp -// -// Copyright 2008 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) - -#ifndef BOOST_XPRESSIVE_DETAIL_STATIC_COMPILE_HPP_EAN_10_04_2005 -#define BOOST_XPRESSIVE_DETAIL_STATIC_COMPILE_HPP_EAN_10_04_2005 - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -#include <boost/mpl/bool.hpp> -#include <boost/iterator/iterator_traits.hpp> -#include <boost/proto/core.hpp> -#include <boost/xpressive/regex_traits.hpp> -#include <boost/xpressive/detail/core/regex_impl.hpp> -#include <boost/xpressive/detail/core/linker.hpp> -#include <boost/xpressive/detail/core/optimize.hpp> -#include <boost/xpressive/detail/core/adaptor.hpp> -#include <boost/xpressive/detail/core/matcher/end_matcher.hpp> -#include <boost/xpressive/detail/static/static.hpp> -#include <boost/xpressive/detail/static/visitor.hpp> -#include <boost/xpressive/detail/static/grammar.hpp> - -namespace boost { namespace xpressive { namespace detail -{ - - /////////////////////////////////////////////////////////////////////////////// - // static_compile_impl2 - template<typename Xpr, typename BidiIter, typename Traits> - void static_compile_impl2(Xpr const &xpr, shared_ptr<regex_impl<BidiIter> > const &impl, Traits const &tr) - { - typedef typename iterator_value<BidiIter>::type char_type; - impl->tracking_clear(); - impl->traits_ = new traits_holder<Traits>(tr); - - // "compile" the regex and wrap it in an xpression_adaptor. - typedef xpression_visitor<BidiIter, mpl::false_, Traits> visitor_type; - visitor_type visitor(tr, impl); - intrusive_ptr<matchable_ex<BidiIter> const> adxpr = make_adaptor<matchable_ex<BidiIter> >( - typename Grammar<char_type>::template impl<Xpr const &, end_xpression, visitor_type &>()( - xpr - , end_xpression() - , visitor - ) - ); - - // Link and optimize the regex - common_compile(adxpr, *impl, visitor.traits()); - - // References changed, update dependencies. - impl->tracking_update(); - } - - /////////////////////////////////////////////////////////////////////////////// - // pattern for imbued regexes. - struct XpressiveLocaleModifier - : proto::binary_expr< - modifier_tag - , proto::terminal<locale_modifier<proto::_> > - , proto::_ - > - {}; - - /////////////////////////////////////////////////////////////////////////////// - // static_compile_impl1 - template<typename Xpr, typename BidiIter> - typename disable_if<proto::matches<Xpr, XpressiveLocaleModifier> >::type - static_compile_impl1(Xpr const &xpr, shared_ptr<regex_impl<BidiIter> > const &impl) - { - // use default traits - typedef typename iterator_value<BidiIter>::type char_type; - typedef typename default_regex_traits<char_type>::type traits_type; - traits_type tr; - static_compile_impl2(xpr, impl, tr); - } - - /////////////////////////////////////////////////////////////////////////////// - // static_compile_impl1 - template<typename Xpr, typename BidiIter> - typename enable_if<proto::matches<Xpr, XpressiveLocaleModifier> >::type - static_compile_impl1(Xpr const &xpr, shared_ptr<regex_impl<BidiIter> > const &impl) - { - // use specified traits - typedef typename proto::result_of::value<typename proto::result_of::left<Xpr>::type>::type::locale_type locale_type; - typedef typename regex_traits_type<locale_type, BidiIter>::type traits_type; - static_compile_impl2(proto::right(xpr), impl, traits_type(proto::value(proto::left(xpr)).getloc())); - } - - /////////////////////////////////////////////////////////////////////////////// - // static_compile - template<typename Xpr, typename BidiIter> - void static_compile(Xpr const &xpr, shared_ptr<regex_impl<BidiIter> > const &impl) - { - static_compile_impl1(xpr, impl); - } - -}}} // namespace boost::xpressive::detail - -#endif diff --git a/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/transmogrify.hpp b/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/transmogrify.hpp deleted file mode 100644 index 5016416c73..0000000000 --- a/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/transmogrify.hpp +++ /dev/null @@ -1,240 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// transmogrify.hpp -// -// Copyright 2008 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) - -#ifndef BOOST_XPRESSIVE_DETAIL_STATIC_TRANSMOGRIFY_HPP_EAN_10_04_2005 -#define BOOST_XPRESSIVE_DETAIL_STATIC_TRANSMOGRIFY_HPP_EAN_10_04_2005 - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -#include <cstring> // for std::strlen -#include <boost/mpl/if.hpp> -#include <boost/mpl/or.hpp> -#include <boost/mpl/bool.hpp> -#include <boost/mpl/assert.hpp> -#include <boost/type_traits/is_same.hpp> -#include <boost/xpressive/detail/detail_fwd.hpp> -#include <boost/xpressive/detail/core/matchers.hpp> -#include <boost/xpressive/detail/static/placeholders.hpp> -#include <boost/xpressive/detail/utility/dont_care.hpp> -#include <boost/xpressive/detail/utility/traits_utils.hpp> - -namespace boost { namespace xpressive { namespace detail -{ - template<typename T, typename Char> - struct is_char_literal - : mpl::or_<is_same<T, Char>, is_same<T, char> > - {}; - - /////////////////////////////////////////////////////////////////////////////// - // transmogrify - // - template<typename BidiIter, typename ICase, typename Traits, typename Matcher, typename EnableIf = void> - struct default_transmogrify - { - typedef typename Traits::char_type char_type; - typedef typename Traits::string_type string_type; - - typedef typename mpl::if_c - < - is_char_literal<Matcher, char_type>::value - , literal_matcher<Traits, ICase, mpl::false_> - , string_matcher<Traits, ICase> - >::type type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2 const &m, Visitor &visitor) - { - return default_transmogrify::call_(m, visitor, is_char_literal<Matcher2, char_type>()); - } - - template<typename Matcher2, typename Visitor> - static type call_(Matcher2 const &m, Visitor &visitor, mpl::true_) - { - char_type ch = char_cast<char_type>(m, visitor.traits()); - return type(ch, visitor.traits()); - } - - template<typename Matcher2, typename Visitor> - static type call_(Matcher2 const &m, Visitor &visitor, mpl::false_) - { - string_type str = string_cast<string_type>(m, visitor.traits()); - return type(str, visitor.traits()); - } - }; - - template<typename BidiIter, typename ICase, typename Traits, typename Matcher> - struct default_transmogrify<BidiIter, ICase, Traits, Matcher, typename Matcher::is_boost_xpressive_xpression_> - { - typedef Matcher type; - - template<typename Matcher2> - static Matcher2 const &call(Matcher2 const &m, dont_care) - { - return m; - } - }; - - template<typename BidiIter, typename ICase, typename Traits, typename Matcher> - struct transmogrify - : default_transmogrify<BidiIter, ICase, Traits, Matcher> - {}; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, assert_bol_placeholder > - { - typedef assert_bol_matcher<Traits> type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2, Visitor &visitor) - { - return type(visitor.traits()); - } - }; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, assert_eol_placeholder > - { - typedef assert_eol_matcher<Traits> type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2, Visitor &visitor) - { - return type(visitor.traits()); - } - }; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, logical_newline_placeholder > - { - typedef logical_newline_matcher<Traits> type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2, Visitor &visitor) - { - return type(visitor.traits()); - } - }; - - template<typename BidiIter, typename ICase, typename Traits, typename Char> - struct transmogrify<BidiIter, ICase, Traits, range_placeholder<Char> > - { - // By design, we don't widen character ranges. - typedef typename iterator_value<BidiIter>::type char_type; - BOOST_MPL_ASSERT((is_same<Char, char_type>)); - typedef range_matcher<Traits, ICase> type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2 const &m, Visitor &visitor) - { - return type(m.ch_min_, m.ch_max_, m.not_, visitor.traits()); - } - }; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, mark_placeholder > - { - typedef mark_matcher<Traits, ICase> type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2 const &m, Visitor &visitor) - { - return type(m.mark_number_, visitor.traits()); - } - }; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, posix_charset_placeholder > - { - typedef posix_charset_matcher<Traits> type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2 const &m, Visitor &visitor) - { - char const *name_end = m.name_ + std::strlen(m.name_); - return type(visitor.traits().lookup_classname(m.name_, name_end, ICase::value), m.not_); - } - }; - - template<typename BidiIter, typename Traits, typename Size> - struct transmogrify<BidiIter, mpl::true_, Traits, set_matcher<Traits, Size> > - { - typedef set_matcher<Traits, Size> type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2 m, Visitor &visitor) - { - m.nocase(visitor.traits()); - return m; - } - }; - - template<typename BidiIter, typename ICase, typename Traits, typename Cond> - struct transmogrify<BidiIter, ICase, Traits, assert_word_placeholder<Cond> > - { - typedef assert_word_matcher<Cond, Traits> type; - - template<typename Visitor> - static type call(dont_care, Visitor &visitor) - { - return type(visitor.traits()); - } - }; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, reference_wrapper<basic_regex<BidiIter> > > - { - typedef regex_byref_matcher<BidiIter> type; - - template<typename Matcher2> - static type call(Matcher2 const &m, dont_care) - { - return type(detail::core_access<BidiIter>::get_regex_impl(m.get())); - } - }; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, reference_wrapper<basic_regex<BidiIter> const> > - { - typedef regex_byref_matcher<BidiIter> type; - - template<typename Matcher2> - static type call(Matcher2 const &m, dont_care) - { - return type(detail::core_access<BidiIter>::get_regex_impl(m.get())); - } - }; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, tracking_ptr<regex_impl<BidiIter> > > - { - typedef regex_matcher<BidiIter> type; - - template<typename Matcher2> - static type call(Matcher2 const &m, dont_care) - { - return type(m.get()); - } - }; - - template<typename BidiIter, typename ICase, typename Traits> - struct transmogrify<BidiIter, ICase, Traits, self_placeholder > - { - typedef regex_byref_matcher<BidiIter> type; - - template<typename Matcher2, typename Visitor> - static type call(Matcher2, Visitor &visitor) - { - return type(visitor.self()); - } - }; - -}}} - -#endif diff --git a/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/visitor.hpp b/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/visitor.hpp deleted file mode 100644 index 46fd6c1641..0000000000 --- a/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/static/visitor.hpp +++ /dev/null @@ -1,143 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// visitor.hpp -// -// Copyright 2008 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) - -#ifndef BOOST_XPRESSIVE_DETAIL_STATIC_VISITOR_HPP_EAN_10_04_2005 -#define BOOST_XPRESSIVE_DETAIL_STATIC_VISITOR_HPP_EAN_10_04_2005 - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -#include <boost/ref.hpp> -#include <boost/shared_ptr.hpp> -#include <boost/xpressive/detail/detail_fwd.hpp> -#include <boost/xpressive/detail/core/regex_impl.hpp> -#include <boost/xpressive/detail/static/transmogrify.hpp> -#include <boost/xpressive/detail/core/matcher/mark_begin_matcher.hpp> - -namespace boost { namespace xpressive { namespace detail -{ - /////////////////////////////////////////////////////////////////////////////// - // - template<typename BidiIter> - struct xpression_visitor_base - { - explicit xpression_visitor_base(shared_ptr<regex_impl<BidiIter> > const &self) - : self_(self) - { - } - - void swap(xpression_visitor_base<BidiIter> &that) - { - this->self_.swap(that.self_); - } - - int get_hidden_mark() - { - return -(int)(++this->self_->hidden_mark_count_); - } - - void mark_number(int mark_nbr) - { - if(0 < mark_nbr) - { - this->self_->mark_count_ = - (std::max)(this->self_->mark_count_, (std::size_t)mark_nbr); - } - } - - shared_ptr<regex_impl<BidiIter> > &self() - { - return this->self_; - } - - protected: - - template<typename Matcher> - void visit_(Matcher const &) - { - } - - void visit_(reference_wrapper<basic_regex<BidiIter> > const &rex) - { - // when visiting an embedded regex, track the references - this->self_->track_reference(*detail::core_access<BidiIter>::get_regex_impl(rex.get())); - } - - void visit_(reference_wrapper<basic_regex<BidiIter> const> const &rex) - { - // when visiting an embedded regex, track the references - this->self_->track_reference(*detail::core_access<BidiIter>::get_regex_impl(rex.get())); - } - - void visit_(tracking_ptr<regex_impl<BidiIter> > const &rex) - { - // when visiting an embedded regex, track the references - this->self_->track_reference(*rex.get()); - } - - void visit_(mark_placeholder const &backref) - { - // keep track of the largest mark number found - this->mark_number(backref.mark_number_); - } - - void visit_(mark_begin_matcher const &mark_begin) - { - // keep track of the largest mark number found - this->mark_number(mark_begin.mark_number_); - } - - private: - shared_ptr<regex_impl<BidiIter> > self_; - }; - - /////////////////////////////////////////////////////////////////////////////// - // - template<typename BidiIter, typename ICase, typename Traits> - struct xpression_visitor - : xpression_visitor_base<BidiIter> - { - typedef BidiIter iterator_type; - typedef ICase icase_type; - typedef Traits traits_type; - typedef typename boost::iterator_value<BidiIter>::type char_type; - - explicit xpression_visitor(Traits const &tr, shared_ptr<regex_impl<BidiIter> > const &self) - : xpression_visitor_base<BidiIter>(self) - , traits_(tr) - { - } - - template<typename Matcher> - struct apply - { - typedef typename transmogrify<BidiIter, ICase, Traits, Matcher>::type type; - }; - - template<typename Matcher> - typename apply<Matcher>::type - call(Matcher const &matcher) - { - this->visit_(matcher); - return transmogrify<BidiIter, ICase, Traits, Matcher>::call(matcher, *this); - } - - Traits const &traits() const - { - return this->traits_; - } - - private: - - Traits traits_; - }; - -}}} - -#endif diff --git a/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/utility/dont_care.hpp b/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/utility/dont_care.hpp deleted file mode 100644 index 3e7a7a5f91..0000000000 --- a/contrib/restricted/boost/xpressive/include/boost/xpressive/detail/utility/dont_care.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// dont_care.hpp -// -// Copyright 2008 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) - -#ifndef BOOST_XPRESSIVE_DETAIL_UTILITY_DONT_CARE_HPP_EAN_10_04_2005 -#define BOOST_XPRESSIVE_DETAIL_UTILITY_DONT_CARE_HPP_EAN_10_04_2005 - -namespace boost { namespace xpressive { namespace detail -{ - /////////////////////////////////////////////////////////////////////////////// - // for function arguments we don't care about - struct dont_care - { - dont_care() {} - - template<typename T> - dont_care(T const &) {} - }; - -}}} - -#endif diff --git a/contrib/restricted/boost/xpressive/include/boost/xpressive/regex_primitives.hpp b/contrib/restricted/boost/xpressive/include/boost/xpressive/regex_primitives.hpp deleted file mode 100644 index dcce60b491..0000000000 --- a/contrib/restricted/boost/xpressive/include/boost/xpressive/regex_primitives.hpp +++ /dev/null @@ -1,927 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -/// \file regex_primitives.hpp -/// Contains the syntax elements for writing static regular expressions. -// -// Copyright 2008 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) - -#ifndef BOOST_XPRESSIVE_REGEX_PRIMITIVES_HPP_EAN_10_04_2005 -#define BOOST_XPRESSIVE_REGEX_PRIMITIVES_HPP_EAN_10_04_2005 - -#include <vector> -#include <climits> -#include <boost/config.hpp> -#include <boost/assert.hpp> -#include <boost/mpl/if.hpp> -#include <boost/mpl/and.hpp> -#include <boost/mpl/assert.hpp> -#include <boost/detail/workaround.hpp> -#include <boost/preprocessor/cat.hpp> -#include <boost/xpressive/detail/detail_fwd.hpp> -#include <boost/xpressive/detail/core/matchers.hpp> -#include <boost/xpressive/detail/core/regex_domain.hpp> -#include <boost/xpressive/detail/utility/ignore_unused.hpp> - -// Doxygen can't handle proto :-( -#ifndef BOOST_XPRESSIVE_DOXYGEN_INVOKED -# include <boost/proto/core.hpp> -# include <boost/proto/transform/arg.hpp> -# include <boost/proto/transform/when.hpp> -# include <boost/xpressive/detail/core/icase.hpp> -# include <boost/xpressive/detail/static/compile.hpp> -# include <boost/xpressive/detail/static/modifier.hpp> -#endif - -namespace boost { namespace xpressive { namespace detail -{ - - typedef assert_word_placeholder<word_boundary<mpl::true_> > assert_word_boundary; - typedef assert_word_placeholder<word_begin> assert_word_begin; - typedef assert_word_placeholder<word_end> assert_word_end; - - // workaround msvc-7.1 bug with function pointer types - // within function types: - #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) - #define mark_number(x) proto::call<mark_number(x)> - #define minus_one() proto::make<minus_one()> - #endif - - struct push_back : proto::callable - { - typedef int result_type; - - template<typename Subs> - int operator ()(Subs &subs, int i) const - { - subs.push_back(i); - return i; - } - }; - - struct mark_number : proto::callable - { - typedef int result_type; - - template<typename Expr> - int operator ()(Expr const &expr) const - { - return expr.mark_number_; - } - }; - - typedef mpl::int_<-1> minus_one; - - // s1 or -s1 - struct SubMatch - : proto::or_< - proto::when<basic_mark_tag, push_back(proto::_data, mark_number(proto::_value)) > - , proto::when<proto::negate<basic_mark_tag>, push_back(proto::_data, minus_one()) > - > - {}; - - struct SubMatchList - : proto::or_<SubMatch, proto::comma<SubMatchList, SubMatch> > - {}; - - template<typename Subs> - typename enable_if< - mpl::and_<proto::is_expr<Subs>, proto::matches<Subs, SubMatchList> > - , std::vector<int> - >::type - to_vector(Subs const &subs) - { - std::vector<int> subs_; - SubMatchList()(subs, 0, subs_); - return subs_; - } - - #if BOOST_WORKAROUND(BOOST_MSVC, == 1310) - #undef mark_number - #undef minus_one - #endif - - // replace "Expr" with "keep(*State) >> Expr" - struct skip_primitives : proto::transform<skip_primitives> - { - template<typename Expr, typename State, typename Data> - struct impl : proto::transform_impl<Expr, State, Data> - { - typedef - typename proto::shift_right< - typename proto::unary_expr< - keeper_tag - , typename proto::dereference<State>::type - >::type - , Expr - >::type - result_type; - - result_type operator ()( - typename impl::expr_param expr - , typename impl::state_param state - , typename impl::data_param - ) const - { - result_type that = {{{state}}, expr}; - return that; - } - }; - }; - - struct Primitives - : proto::or_< - proto::terminal<proto::_> - , proto::comma<proto::_, proto::_> - , proto::subscript<proto::terminal<set_initializer>, proto::_> - , proto::assign<proto::terminal<set_initializer>, proto::_> - , proto::assign<proto::terminal<attribute_placeholder<proto::_> >, proto::_> - , proto::complement<Primitives> - > - {}; - - struct SkipGrammar - : proto::or_< - proto::when<Primitives, skip_primitives> - , proto::assign<proto::terminal<mark_placeholder>, SkipGrammar> // don't "skip" mark tags - , proto::subscript<SkipGrammar, proto::_> // don't put skips in actions - , proto::binary_expr<modifier_tag, proto::_, SkipGrammar> // don't skip modifiers - , proto::unary_expr<lookbehind_tag, proto::_> // don't skip lookbehinds - , proto::nary_expr<proto::_, proto::vararg<SkipGrammar> > // everything else is fair game! - > - {}; - - template<typename Skip> - struct skip_directive - { - typedef typename proto::result_of::as_expr<Skip>::type skip_type; - - skip_directive(Skip const &skip) - : skip_(proto::as_expr(skip)) - {} - - template<typename Sig> - struct result {}; - - template<typename This, typename Expr> - struct result<This(Expr)> - { - typedef - SkipGrammar::impl< - typename proto::result_of::as_expr<Expr>::type - , skip_type const & - , mpl::void_ & - > - skip_transform; - - typedef - typename proto::shift_right< - typename skip_transform::result_type - , typename proto::dereference<skip_type>::type - >::type - type; - }; - - template<typename Expr> - typename result<skip_directive(Expr)>::type - operator ()(Expr const &expr) const - { - mpl::void_ ignore; - typedef result<skip_directive(Expr)> result_fun; - typename result_fun::type that = { - typename result_fun::skip_transform()(proto::as_expr(expr), this->skip_, ignore) - , {skip_} - }; - return that; - } - - private: - skip_type skip_; - }; - -/* -/////////////////////////////////////////////////////////////////////////////// -/// INTERNAL ONLY -// BOOST_XPRESSIVE_GLOBAL -// for defining globals that neither violate the One Definition Rule nor -// lead to undefined behavior due to global object initialization order. -//#define BOOST_XPRESSIVE_GLOBAL(type, name, init) \ -// namespace detail \ -// { \ -// template<int Dummy> \ -// struct BOOST_PP_CAT(global_pod_, name) \ -// { \ -// static type const value; \ -// private: \ -// union type_must_be_pod \ -// { \ -// type t; \ -// char ch; \ -// } u; \ -// }; \ -// template<int Dummy> \ -// type const BOOST_PP_CAT(global_pod_, name)<Dummy>::value = init; \ -// } \ -// type const &name = detail::BOOST_PP_CAT(global_pod_, name)<0>::value -*/ - - -} // namespace detail - -/// INTERNAL ONLY (for backwards compatibility) -unsigned int const repeat_max = UINT_MAX-1; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief For infinite repetition of a sub-expression. -/// -/// Magic value used with the repeat\<\>() function template -/// to specify an unbounded repeat. Use as: repeat<17, inf>('a'). -/// The equivalent in perl is /a{17,}/. -unsigned int const inf = UINT_MAX-1; - -/// INTERNAL ONLY (for backwards compatibility) -proto::terminal<detail::epsilon_matcher>::type const epsilon = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Successfully matches nothing. -/// -/// Successfully matches a zero-width sequence. nil always succeeds and -/// never consumes any characters. -proto::terminal<detail::epsilon_matcher>::type const nil = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches an alpha-numeric character. -/// -/// The regex traits are used to determine which characters are alpha-numeric. -/// To match any character that is not alpha-numeric, use ~alnum. -/// -/// \attention alnum is equivalent to /[[:alnum:]]/ in perl. ~alnum is equivalent -/// to /[[:^alnum:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const alnum = {{"alnum", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches an alphabetic character. -/// -/// The regex traits are used to determine which characters are alphabetic. -/// To match any character that is not alphabetic, use ~alpha. -/// -/// \attention alpha is equivalent to /[[:alpha:]]/ in perl. ~alpha is equivalent -/// to /[[:^alpha:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const alpha = {{"alpha", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a blank (horizonal white-space) character. -/// -/// The regex traits are used to determine which characters are blank characters. -/// To match any character that is not blank, use ~blank. -/// -/// \attention blank is equivalent to /[[:blank:]]/ in perl. ~blank is equivalent -/// to /[[:^blank:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const blank = {{"blank", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a control character. -/// -/// The regex traits are used to determine which characters are control characters. -/// To match any character that is not a control character, use ~cntrl. -/// -/// \attention cntrl is equivalent to /[[:cntrl:]]/ in perl. ~cntrl is equivalent -/// to /[[:^cntrl:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const cntrl = {{"cntrl", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a digit character. -/// -/// The regex traits are used to determine which characters are digits. -/// To match any character that is not a digit, use ~digit. -/// -/// \attention digit is equivalent to /[[:digit:]]/ in perl. ~digit is equivalent -/// to /[[:^digit:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const digit = {{"digit", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a graph character. -/// -/// The regex traits are used to determine which characters are graphable. -/// To match any character that is not graphable, use ~graph. -/// -/// \attention graph is equivalent to /[[:graph:]]/ in perl. ~graph is equivalent -/// to /[[:^graph:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const graph = {{"graph", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a lower-case character. -/// -/// The regex traits are used to determine which characters are lower-case. -/// To match any character that is not a lower-case character, use ~lower. -/// -/// \attention lower is equivalent to /[[:lower:]]/ in perl. ~lower is equivalent -/// to /[[:^lower:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const lower = {{"lower", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a printable character. -/// -/// The regex traits are used to determine which characters are printable. -/// To match any character that is not printable, use ~print. -/// -/// \attention print is equivalent to /[[:print:]]/ in perl. ~print is equivalent -/// to /[[:^print:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const print = {{"print", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a punctuation character. -/// -/// The regex traits are used to determine which characters are punctuation. -/// To match any character that is not punctuation, use ~punct. -/// -/// \attention punct is equivalent to /[[:punct:]]/ in perl. ~punct is equivalent -/// to /[[:^punct:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const punct = {{"punct", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a space character. -/// -/// The regex traits are used to determine which characters are space characters. -/// To match any character that is not white-space, use ~space. -/// -/// \attention space is equivalent to /[[:space:]]/ in perl. ~space is equivalent -/// to /[[:^space:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const space = {{"space", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches an upper-case character. -/// -/// The regex traits are used to determine which characters are upper-case. -/// To match any character that is not upper-case, use ~upper. -/// -/// \attention upper is equivalent to /[[:upper:]]/ in perl. ~upper is equivalent -/// to /[[:^upper:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const upper = {{"upper", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a hexadecimal digit character. -/// -/// The regex traits are used to determine which characters are hex digits. -/// To match any character that is not a hex digit, use ~xdigit. -/// -/// \attention xdigit is equivalent to /[[:xdigit:]]/ in perl. ~xdigit is equivalent -/// to /[[:^xdigit:]]/ in perl. -proto::terminal<detail::posix_charset_placeholder>::type const xdigit = {{"xdigit", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Beginning of sequence assertion. -/// -/// For the character sequence [begin, end), 'bos' matches the -/// zero-width sub-sequence [begin, begin). -proto::terminal<detail::assert_bos_matcher>::type const bos = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief End of sequence assertion. -/// -/// For the character sequence [begin, end), -/// 'eos' matches the zero-width sub-sequence [end, end). -/// -/// \attention Unlike the perl end of sequence assertion \$, 'eos' will -/// not match at the position [end-1, end-1) if *(end-1) is '\\n'. To -/// get that behavior, use (!_n >> eos). -proto::terminal<detail::assert_eos_matcher>::type const eos = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Beginning of line assertion. -/// -/// 'bol' matches the zero-width sub-sequence -/// immediately following a logical newline sequence. The regex traits -/// is used to determine what constitutes a logical newline sequence. -proto::terminal<detail::assert_bol_placeholder>::type const bol = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief End of line assertion. -/// -/// 'eol' matches the zero-width sub-sequence -/// immediately preceeding a logical newline sequence. The regex traits -/// is used to determine what constitutes a logical newline sequence. -proto::terminal<detail::assert_eol_placeholder>::type const eol = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Beginning of word assertion. -/// -/// 'bow' matches the zero-width sub-sequence -/// immediately following a non-word character and preceeding a word character. -/// The regex traits are used to determine what constitutes a word character. -proto::terminal<detail::assert_word_begin>::type const bow = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief End of word assertion. -/// -/// 'eow' matches the zero-width sub-sequence -/// immediately following a word character and preceeding a non-word character. -/// The regex traits are used to determine what constitutes a word character. -proto::terminal<detail::assert_word_end>::type const eow = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Word boundary assertion. -/// -/// '_b' matches the zero-width sub-sequence at the beginning or the end of a word. -/// It is equivalent to (bow | eow). The regex traits are used to determine what -/// constitutes a word character. To match a non-word boundary, use ~_b. -/// -/// \attention _b is like \\b in perl. ~_b is like \\B in perl. -proto::terminal<detail::assert_word_boundary>::type const _b = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a word character. -/// -/// '_w' matches a single word character. The regex traits are used to determine which -/// characters are word characters. Use ~_w to match a character that is not a word -/// character. -/// -/// \attention _w is like \\w in perl. ~_w is like \\W in perl. -proto::terminal<detail::posix_charset_placeholder>::type const _w = {{"w", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a digit character. -/// -/// '_d' matches a single digit character. The regex traits are used to determine which -/// characters are digits. Use ~_d to match a character that is not a digit -/// character. -/// -/// \attention _d is like \\d in perl. ~_d is like \\D in perl. -proto::terminal<detail::posix_charset_placeholder>::type const _d = {{"d", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a space character. -/// -/// '_s' matches a single space character. The regex traits are used to determine which -/// characters are space characters. Use ~_s to match a character that is not a space -/// character. -/// -/// \attention _s is like \\s in perl. ~_s is like \\S in perl. -proto::terminal<detail::posix_charset_placeholder>::type const _s = {{"s", false}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a literal newline character, '\\n'. -/// -/// '_n' matches a single newline character, '\\n'. Use ~_n to match a character -/// that is not a newline. -/// -/// \attention ~_n is like '.' in perl without the /s modifier. -proto::terminal<char>::type const _n = {'\n'}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches a logical newline sequence. -/// -/// '_ln' matches a logical newline sequence. This can be any character in the -/// line separator class, as determined by the regex traits, or the '\\r\\n' sequence. -/// For the purpose of back-tracking, '\\r\\n' is treated as a unit. -/// To match any one character that is not a logical newline, use ~_ln. -detail::logical_newline_xpression const _ln = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Matches any one character. -/// -/// Match any character, similar to '.' in perl syntax with the /s modifier. -/// '_' matches any one character, including the newline. -/// -/// \attention To match any character except the newline, use ~_n -proto::terminal<detail::any_matcher>::type const _ = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Reference to the current regex object -/// -/// Useful when constructing recursive regular expression objects. The 'self' -/// identifier is a short-hand for the current regex object. For instance, -/// sregex rx = '(' >> (self | nil) >> ')'; will create a regex object that -/// matches balanced parens such as "((()))". -proto::terminal<detail::self_placeholder>::type const self = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Used to create character sets. -/// -/// There are two ways to create character sets with the 'set' identifier. The -/// easiest is to create a comma-separated list of the characters in the set, -/// as in (set= 'a','b','c'). This set will match 'a', 'b', or 'c'. The other -/// way is to define the set as an argument to the set subscript operator. -/// For instance, set[ 'a' | range('b','c') | digit ] will match an 'a', 'b', -/// 'c' or a digit character. -/// -/// To complement a set, apply the '~' operator. For instance, ~(set= 'a','b','c') -/// will match any character that is not an 'a', 'b', or 'c'. -/// -/// Sets can be composed of other, possibly complemented, sets. For instance, -/// set[ ~digit | ~(set= 'a','b','c') ]. -detail::set_initializer_type const set = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Sub-match placeholder type, used to create named captures in -/// static regexes. -/// -/// \c mark_tag is the type of the global sub-match placeholders \c s0, \c s1, etc.. You -/// can use the \c mark_tag type to create your own sub-match placeholders with -/// more meaningful names. This is roughly equivalent to the "named capture" -/// feature of dynamic regular expressions. -/// -/// To create a named sub-match placeholder, initialize it with a unique integer. -/// The integer must only be unique within the regex in which the placeholder -/// is used. Then you can use it within static regexes to created sub-matches -/// by assigning a sub-expression to it, or to refer back to already created -/// sub-matches. -/// -/// \code -/// mark_tag number(1); // "number" is now equivalent to "s1" -/// // Match a number, followed by a space and the same number again -/// sregex rx = (number = +_d) >> ' ' >> number; -/// \endcode -/// -/// After a successful \c regex_match() or \c regex_search(), the sub-match placeholder -/// can be used to index into the <tt>match_results\<\></tt> object to retrieve the -/// corresponding sub-match. -struct mark_tag - : proto::extends<detail::basic_mark_tag, mark_tag, detail::regex_domain> -{ -private: - typedef proto::extends<detail::basic_mark_tag, mark_tag, detail::regex_domain> base_type; - - static detail::basic_mark_tag make_tag(int mark_nbr) - { - detail::basic_mark_tag mark = {{mark_nbr}}; - return mark; - } - -public: - /// \brief Initialize a mark_tag placeholder - /// \param mark_nbr An integer that uniquely identifies this \c mark_tag - /// within the static regexes in which this \c mark_tag will be used. - /// \pre <tt>mark_nbr \> 0</tt> - mark_tag(int mark_nbr) - : base_type(mark_tag::make_tag(mark_nbr)) - { - // Marks numbers must be integers greater than 0. - BOOST_ASSERT(mark_nbr > 0); - } - - /// INTERNAL ONLY - operator detail::basic_mark_tag const &() const - { - return this->proto_base(); - } - - BOOST_PROTO_EXTENDS_USING_ASSIGN_NON_DEPENDENT(mark_tag) -}; - -// This macro is used when declaring mark_tags that are global because -// it guarantees that they are statically initialized. That avoids -// order-of-initialization bugs. In user code, the simpler: mark_tag s0(0); -// would be preferable. -/// INTERNAL ONLY -#define BOOST_XPRESSIVE_GLOBAL_MARK_TAG(NAME, VALUE) \ - boost::xpressive::mark_tag::proto_base_expr const NAME = {{VALUE}} \ - /**/ - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Sub-match placeholder, like $& in Perl -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s0, 0); - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Sub-match placeholder, like $1 in perl. -/// -/// To create a sub-match, assign a sub-expression to the sub-match placeholder. -/// For instance, (s1= _) will match any one character and remember which -/// character was matched in the 1st sub-match. Later in the pattern, you can -/// refer back to the sub-match. For instance, (s1= _) >> s1 will match any -/// character, and then match the same character again. -/// -/// After a successful regex_match() or regex_search(), the sub-match placeholders -/// can be used to index into the match_results\<\> object to retrieve the Nth -/// sub-match. -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s1, 1); -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s2, 2); -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s3, 3); -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s4, 4); -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s5, 5); -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s6, 6); -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s7, 7); -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s8, 8); -BOOST_XPRESSIVE_GLOBAL_MARK_TAG(s9, 9); - -// NOTE: For the purpose of xpressive's documentation, make icase() look like an -// ordinary function. In reality, it is a function object defined in detail/icase.hpp -// so that it can serve double-duty as regex_constants::icase, the syntax_option_type. -#ifdef BOOST_XPRESSIVE_DOXYGEN_INVOKED -/////////////////////////////////////////////////////////////////////////////// -/// \brief Makes a sub-expression case-insensitive. -/// -/// Use icase() to make a sub-expression case-insensitive. For instance, -/// "foo" >> icase(set['b'] >> "ar") will match "foo" exactly followed by -/// "bar" irrespective of case. -template<typename Expr> detail::unspecified icase(Expr const &expr) { return 0; } -#endif - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Makes a literal into a regular expression. -/// -/// Use as_xpr() to turn a literal into a regular expression. For instance, -/// "foo" >> "bar" will not compile because both operands to the right-shift -/// operator are const char*, and no such operator exists. Use as_xpr("foo") >> "bar" -/// instead. -/// -/// You can use as_xpr() with character literals in addition to string literals. -/// For instance, as_xpr('a') will match an 'a'. You can also complement a -/// character literal, as with ~as_xpr('a'). This will match any one character -/// that is not an 'a'. -#ifdef BOOST_XPRESSIVE_DOXYGEN_INVOKED -template<typename Literal> detail::unspecified as_xpr(Literal const &literal) { return 0; } -#else -proto::functional::as_expr<> const as_xpr = {}; -#endif - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Embed a regex object by reference. -/// -/// \param rex The basic_regex object to embed by reference. -template<typename BidiIter> -inline typename proto::terminal<reference_wrapper<basic_regex<BidiIter> const> >::type const -by_ref(basic_regex<BidiIter> const &rex) -{ - reference_wrapper<basic_regex<BidiIter> const> ref(rex); - return proto::terminal<reference_wrapper<basic_regex<BidiIter> const> >::type::make(ref); -} - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Match a range of characters. -/// -/// Match any character in the range [ch_min, ch_max]. -/// -/// \param ch_min The lower end of the range to match. -/// \param ch_max The upper end of the range to match. -template<typename Char> -inline typename proto::terminal<detail::range_placeholder<Char> >::type const -range(Char ch_min, Char ch_max) -{ - detail::range_placeholder<Char> that = {ch_min, ch_max, false}; - return proto::terminal<detail::range_placeholder<Char> >::type::make(that); -} - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Make a sub-expression optional. Equivalent to !as_xpr(expr). -/// -/// \param expr The sub-expression to make optional. -template<typename Expr> -typename proto::result_of::make_expr< - proto::tag::logical_not - , proto::default_domain - , Expr const & ->::type const -optional(Expr const &expr) -{ - return proto::make_expr< - proto::tag::logical_not - , proto::default_domain - >(boost::ref(expr)); -} - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Repeat a sub-expression multiple times. -/// -/// There are two forms of the repeat\<\>() function template. To match a -/// sub-expression N times, use repeat\<N\>(expr). To match a sub-expression -/// from M to N times, use repeat\<M,N\>(expr). -/// -/// The repeat\<\>() function creates a greedy quantifier. To make the quantifier -/// non-greedy, apply the unary minus operator, as in -repeat\<M,N\>(expr). -/// -/// \param expr The sub-expression to repeat. -template<unsigned int Min, unsigned int Max, typename Expr> -typename proto::result_of::make_expr< - detail::generic_quant_tag<Min, Max> - , proto::default_domain - , Expr const & ->::type const -repeat(Expr const &expr) -{ - return proto::make_expr< - detail::generic_quant_tag<Min, Max> - , proto::default_domain - >(boost::ref(expr)); -} - -/// \overload -/// -template<unsigned int Count, typename Expr2> -typename proto::result_of::make_expr< - detail::generic_quant_tag<Count, Count> - , proto::default_domain - , Expr2 const & ->::type const -repeat(Expr2 const &expr2) -{ - return proto::make_expr< - detail::generic_quant_tag<Count, Count> - , proto::default_domain - >(boost::ref(expr2)); -} - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Create an independent sub-expression. -/// -/// Turn off back-tracking for a sub-expression. Any branches or repeats within -/// the sub-expression will match only one way, and no other alternatives are -/// tried. -/// -/// \attention keep(expr) is equivalent to the perl (?>...) extension. -/// -/// \param expr The sub-expression to modify. -template<typename Expr> -typename proto::result_of::make_expr< - detail::keeper_tag - , proto::default_domain - , Expr const & ->::type const -keep(Expr const &expr) -{ - return proto::make_expr< - detail::keeper_tag - , proto::default_domain - >(boost::ref(expr)); -} - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Look-ahead assertion. -/// -/// before(expr) succeeds if the expr sub-expression would match at the current -/// position in the sequence, but expr is not included in the match. For instance, -/// before("foo") succeeds if we are before a "foo". Look-ahead assertions can be -/// negated with the bit-compliment operator. -/// -/// \attention before(expr) is equivalent to the perl (?=...) extension. -/// ~before(expr) is a negative look-ahead assertion, equivalent to the -/// perl (?!...) extension. -/// -/// \param expr The sub-expression to put in the look-ahead assertion. -template<typename Expr> -typename proto::result_of::make_expr< - detail::lookahead_tag - , proto::default_domain - , Expr const & ->::type const -before(Expr const &expr) -{ - return proto::make_expr< - detail::lookahead_tag - , proto::default_domain - >(boost::ref(expr)); -} - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Look-behind assertion. -/// -/// after(expr) succeeds if the expr sub-expression would match at the current -/// position minus N in the sequence, where N is the width of expr. expr is not included in -/// the match. For instance, after("foo") succeeds if we are after a "foo". Look-behind -/// assertions can be negated with the bit-complement operator. -/// -/// \attention after(expr) is equivalent to the perl (?<=...) extension. -/// ~after(expr) is a negative look-behind assertion, equivalent to the -/// perl (?<!...) extension. -/// -/// \param expr The sub-expression to put in the look-ahead assertion. -/// -/// \pre expr cannot match a variable number of characters. -template<typename Expr> -typename proto::result_of::make_expr< - detail::lookbehind_tag - , proto::default_domain - , Expr const & ->::type const -after(Expr const &expr) -{ - return proto::make_expr< - detail::lookbehind_tag - , proto::default_domain - >(boost::ref(expr)); -} - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Specify a regex traits or a std::locale. -/// -/// imbue() instructs the regex engine to use the specified traits or locale -/// when matching the regex. The entire expression must use the same traits/locale. -/// For instance, the following specifies a locale for use with a regex: -/// std::locale loc; -/// sregex rx = imbue(loc)(+digit); -/// -/// \param loc The std::locale or regex traits object. -template<typename Locale> -inline detail::modifier_op<detail::locale_modifier<Locale> > const -imbue(Locale const &loc) -{ - detail::modifier_op<detail::locale_modifier<Locale> > mod = - { - detail::locale_modifier<Locale>(loc) - , regex_constants::ECMAScript - }; - return mod; -} - -proto::terminal<detail::attribute_placeholder<mpl::int_<1> > >::type const a1 = {{}}; -proto::terminal<detail::attribute_placeholder<mpl::int_<2> > >::type const a2 = {{}}; -proto::terminal<detail::attribute_placeholder<mpl::int_<3> > >::type const a3 = {{}}; -proto::terminal<detail::attribute_placeholder<mpl::int_<4> > >::type const a4 = {{}}; -proto::terminal<detail::attribute_placeholder<mpl::int_<5> > >::type const a5 = {{}}; -proto::terminal<detail::attribute_placeholder<mpl::int_<6> > >::type const a6 = {{}}; -proto::terminal<detail::attribute_placeholder<mpl::int_<7> > >::type const a7 = {{}}; -proto::terminal<detail::attribute_placeholder<mpl::int_<8> > >::type const a8 = {{}}; -proto::terminal<detail::attribute_placeholder<mpl::int_<9> > >::type const a9 = {{}}; - -/////////////////////////////////////////////////////////////////////////////// -/// \brief Specify which characters to skip when matching a regex. -/// -/// <tt>skip()</tt> instructs the regex engine to skip certain characters when matching -/// a regex. It is most useful for writing regexes that ignore whitespace. -/// For instance, the following specifies a regex that skips whitespace and -/// punctuation: -/// -/// \code -/// // A sentence is one or more words separated by whitespace -/// // and punctuation. -/// sregex word = +alpha; -/// sregex sentence = skip(set[_s | punct])( +word ); -/// \endcode -/// -/// The way it works in the above example is to insert -/// <tt>keep(*set[_s | punct])</tt> before each primitive within the regex. -/// A "primitive" includes terminals like strings, character sets and nested -/// regexes. A final <tt>*set[_s | punct]</tt> is added to the end of the -/// regex. The regex <tt>sentence</tt> specified above is equivalent to -/// the following: -/// -/// \code -/// sregex sentence = +( keep(*set[_s | punct]) >> word ) -/// >> *set[_s | punct]; -/// \endcode -/// -/// \attention Skipping does not affect how nested regexes are handled because -/// they are treated atomically. String literals are also treated -/// atomically; that is, no skipping is done within a string literal. So -/// <tt>skip(_s)("this that")</tt> is not the same as -/// <tt>skip(_s)("this" >> as_xpr("that"))</tt>. The first will only match -/// when there is only one space between "this" and "that". The second will -/// skip any and all whitespace between "this" and "that". -/// -/// \param skip A regex that specifies which characters to skip. -template<typename Skip> -detail::skip_directive<Skip> skip(Skip const &skip) -{ - return detail::skip_directive<Skip>(skip); -} - -namespace detail -{ - inline void ignore_unused_regex_primitives() - { - detail::ignore_unused(repeat_max); - detail::ignore_unused(inf); - detail::ignore_unused(epsilon); - detail::ignore_unused(nil); - detail::ignore_unused(alnum); - detail::ignore_unused(bos); - detail::ignore_unused(eos); - detail::ignore_unused(bol); - detail::ignore_unused(eol); - detail::ignore_unused(bow); - detail::ignore_unused(eow); - detail::ignore_unused(_b); - detail::ignore_unused(_w); - detail::ignore_unused(_d); - detail::ignore_unused(_s); - detail::ignore_unused(_n); - detail::ignore_unused(_ln); - detail::ignore_unused(_); - detail::ignore_unused(self); - detail::ignore_unused(set); - detail::ignore_unused(s0); - detail::ignore_unused(s1); - detail::ignore_unused(s2); - detail::ignore_unused(s3); - detail::ignore_unused(s4); - detail::ignore_unused(s5); - detail::ignore_unused(s6); - detail::ignore_unused(s7); - detail::ignore_unused(s8); - detail::ignore_unused(s9); - detail::ignore_unused(a1); - detail::ignore_unused(a2); - detail::ignore_unused(a3); - detail::ignore_unused(a4); - detail::ignore_unused(a5); - detail::ignore_unused(a6); - detail::ignore_unused(a7); - detail::ignore_unused(a8); - detail::ignore_unused(a9); - detail::ignore_unused(as_xpr); - } -} - -}} // namespace boost::xpressive - -#endif diff --git a/contrib/restricted/boost/xpressive/include/boost/xpressive/xpressive_static.hpp b/contrib/restricted/boost/xpressive/include/boost/xpressive/xpressive_static.hpp deleted file mode 100644 index eef6b04940..0000000000 --- a/contrib/restricted/boost/xpressive/include/boost/xpressive/xpressive_static.hpp +++ /dev/null @@ -1,32 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -/// \file xpressive_static.hpp -/// Includes everything you need to write static regular expressions and use -/// them. -// -// Copyright 2008 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) - -#ifndef BOOST_XPRESSIVE_STATIC_HPP_EAN_10_04_2005 -#define BOOST_XPRESSIVE_STATIC_HPP_EAN_10_04_2005 - -// MS compatible compilers support #pragma once -#if defined(_MSC_VER) -# pragma once -#endif - -#ifdef _MSC_VER -// inline aggressively -# pragma inline_recursion(on) // turn on inline recursion -# pragma inline_depth(255) // max inline depth -#endif - -#include <boost/xpressive/regex_primitives.hpp> -#include <boost/xpressive/basic_regex.hpp> -#include <boost/xpressive/sub_match.hpp> -#include <boost/xpressive/match_results.hpp> -#include <boost/xpressive/regex_algorithms.hpp> -#include <boost/xpressive/regex_iterator.hpp> -#include <boost/xpressive/regex_token_iterator.hpp> - -#endif |