24#ifndef MYSQL_SETS_NESTED_SET_VOLUME_H
25#define MYSQL_SETS_NESTED_SET_VOLUME_H
57template <Is_nested_set Nested_set_t>
60 mysql::ranges::make_flat_view<detail::Unfold_set>(nested_set);
61 return mysql::ranges::make_transform_view<Volume_transform>(flat_view);
76template <
class Result_t =
double, Is_nested_set Nested_set_t>
77[[nodiscard]] Result_t
volume(
const Nested_set_t &
set) {
80 std::accumulate(volume_view.begin(), volume_view.end(), Result_t{});
101template <
class Result_t =
double, Is_nested_set Set1_t, Is_nested_set Set2_t>
102 requires Is_compatible_set<Set1_t, Set2_t>
104 const Set2_t &set2) {
107 return mysql::math::sequence_sum_difference<Result_t>(
108 volume_view1.begin(), volume_view1.end(), volume_view2.begin(),
True if Test is a nested set.
Definition: nested_set_meta.h:110
auto make_mapped_view(const auto &source)
Factory function to create a new view over the mapped values in a range of pairs.
Definition: projection_views.h:175
auto make_volume_view(const Nested_set_t &nested_set)
Given a Nested set, returns a range over the volumes of the inner sets.
Definition: nested_set_volume.h:58
Definition: gtid_set.h:183
constexpr auto volume(const Boundary_set_t &set)
Return the sum of the lengths of all intervals in the given Boundary set.
Definition: boundary_set_volume.h:43
Result_t volume_difference(const Set1_t &set1, const Set2_t &set2)
Return the volume of the first set minus the volume of the second set.
Definition: base_volume.h:57
std::set< Key, Compare, ut::allocator< Key > > set
Specialization of set which uses ut_allocator.
Definition: ut0new.h:2888
Given a nested set, returns a range over its inner sets.
Definition: nested_set_volume.h:50
static auto unfold(const Is_nested_set auto &nested_set)
Definition: nested_set_volume.h:51