Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:35:31

0001 // Boost.Geometry Index
0002 //
0003 // R-tree options, algorithms, parameters
0004 //
0005 // Copyright (c) 2011-2014 Adam Wulkiewicz, Lodz, Poland.
0006 //
0007 // This file was modified by Oracle on 2019.
0008 // Modifications copyright (c) 2019 Oracle and/or its affiliates.
0009 // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle
0010 //
0011 // Use, modification and distribution is subject to the Boost Software License,
0012 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0013 // http://www.boost.org/LICENSE_1_0.txt)
0014 
0015 #ifndef BOOST_GEOMETRY_INDEX_DETAIL_RTREE_OPTIONS_HPP
0016 #define BOOST_GEOMETRY_INDEX_DETAIL_RTREE_OPTIONS_HPP
0017 
0018 #include <boost/geometry/index/parameters.hpp>
0019 
0020 namespace boost { namespace geometry { namespace index {
0021 
0022 namespace detail { namespace rtree {
0023 
0024 // InsertTag
0025 struct insert_default_tag {};
0026 struct insert_reinsert_tag {};
0027 
0028 // ChooseNextNodeTag
0029 struct choose_by_content_diff_tag {};
0030 struct choose_by_overlap_diff_tag {};
0031 
0032 // SplitTag
0033 struct split_default_tag {};
0034 //struct split_kmeans_tag {};
0035 
0036 // RedistributeTag
0037 struct linear_tag {};
0038 struct quadratic_tag {};
0039 struct rstar_tag {};
0040 
0041 // NodeTag
0042 struct node_variant_dynamic_tag {};
0043 struct node_variant_static_tag {};
0044 //struct node_weak_dynamic_tag {};
0045 //struct node_weak_static_tag {};
0046 
0047 template <typename Parameters, typename InsertTag, typename ChooseNextNodeTag, typename SplitTag, typename RedistributeTag, typename NodeTag>
0048 struct options
0049 {
0050     typedef Parameters parameters_type;
0051     typedef InsertTag insert_tag;
0052     typedef ChooseNextNodeTag choose_next_node_tag;
0053     typedef SplitTag split_tag;
0054     typedef RedistributeTag redistribute_tag;
0055     typedef NodeTag node_tag;
0056 };
0057 
0058 template <typename Parameters>
0059 struct options_type
0060 {
0061     // TODO: awulkiew - use static assert
0062 };
0063 
0064 template <size_t MaxElements, size_t MinElements>
0065 struct options_type< index::linear<MaxElements, MinElements> >
0066 {
0067     typedef options<
0068         index::linear<MaxElements, MinElements>,
0069         insert_default_tag,
0070         choose_by_content_diff_tag,
0071         split_default_tag,
0072         linear_tag,
0073         node_variant_static_tag
0074     > type;
0075 };
0076 
0077 template <size_t MaxElements, size_t MinElements>
0078 struct options_type< index::quadratic<MaxElements, MinElements> >
0079 {
0080     typedef options<
0081         index::quadratic<MaxElements, MinElements>,
0082         insert_default_tag,
0083         choose_by_content_diff_tag,
0084         split_default_tag,
0085         quadratic_tag,
0086         node_variant_static_tag
0087     > type;
0088 };
0089 
0090 template <size_t MaxElements, size_t MinElements, size_t OverlapCostThreshold, size_t ReinsertedElements>
0091 struct options_type< index::rstar<MaxElements, MinElements, OverlapCostThreshold, ReinsertedElements> >
0092 {
0093     typedef options<
0094         index::rstar<MaxElements, MinElements, OverlapCostThreshold, ReinsertedElements>,
0095         insert_reinsert_tag,
0096         choose_by_overlap_diff_tag,
0097         split_default_tag,
0098         rstar_tag,
0099         node_variant_static_tag
0100     > type;
0101 };
0102 
0103 //template <size_t MaxElements, size_t MinElements>
0104 //struct options_type< kmeans<MaxElements, MinElements> >
0105 //{
0106 //    typedef options<
0107 //        kmeans<MaxElements, MinElements>,
0108 //        insert_default_tag,
0109 //        choose_by_content_diff_tag, // change it?
0110 //        split_kmeans_tag,
0111 //        int, // dummy tag - not used for now
0112 //        node_variant_static_tag
0113 //    > type;
0114 //};
0115 
0116 template <>
0117 struct options_type< index::dynamic_linear >
0118 {
0119     typedef options<
0120         index::dynamic_linear,
0121         insert_default_tag,
0122         choose_by_content_diff_tag,
0123         split_default_tag,
0124         linear_tag,
0125         node_variant_dynamic_tag
0126     > type;
0127 };
0128 
0129 template <>
0130 struct options_type< index::dynamic_quadratic >
0131 {
0132     typedef options<
0133         index::dynamic_quadratic,
0134         insert_default_tag,
0135         choose_by_content_diff_tag,
0136         split_default_tag,
0137         quadratic_tag,
0138         node_variant_dynamic_tag
0139     > type;
0140 };
0141 
0142 template <>
0143 struct options_type< index::dynamic_rstar >
0144 {
0145     typedef options<
0146         index::dynamic_rstar,
0147         insert_reinsert_tag,
0148         choose_by_overlap_diff_tag,
0149         split_default_tag,
0150         rstar_tag,
0151         node_variant_dynamic_tag
0152     > type;
0153 };
0154 
0155 template <typename Parameters, typename Strategy>
0156 struct options_type< index::parameters<Parameters, Strategy> >
0157     : options_type<Parameters>
0158 {
0159     typedef typename options_type<Parameters>::type opt;
0160     typedef options<
0161         index::parameters<Parameters, Strategy>,
0162         typename opt::insert_tag,
0163         typename opt::choose_next_node_tag,
0164         typename opt::split_tag,
0165         typename opt::redistribute_tag,
0166         typename opt::node_tag
0167     > type;
0168 };
0169 
0170 }} // namespace detail::rtree
0171 
0172 }}} // namespace boost::geometry::index
0173 
0174 #endif // BOOST_GEOMETRY_INDEX_DETAIL_RTREE_OPTIONS_HPP