Range adaptor that generates a cartesian product from the given input ranges.
More...
#include <detray/utils/ranges/cartesian_product.hpp>
|
|
using | iterator_coll_t = dtuple<detray::ranges::iterator_t<range_ts>...> |
| | Tuple of the begin or end iterator for each input range.
|
| using | iterator_t |
| | Iterator that advances through the Cartesian product.
|
| using | value_type |
| | Tuple of references to the current element of each input range.
|
|
|
constexpr | cartesian_product_view ()=default |
| | Default constructor.
|
template<detray::ranges::range... deduced_range_ts>
requires ((sizeof...(deduced_range_ts) > 1) || ((!std::same_as<cartesian_product_view, deduced_range_ts>) && ...)) |
| constexpr | cartesian_product_view (deduced_range_ts... ranges) |
| | Construct from a pack of ranges.
|
| constexpr auto | begin () const -> iterator_t |
| constexpr auto | data () |
| constexpr auto | data () const |
| constexpr auto | end () const -> iterator_t |
| template<int I = static_cast<int>(sizeof...(range_ts)) - 1> |
| constexpr auto | size (std::size_t s=1u) const noexcept -> std::size_t |
| constexpr decltype(auto) | back () const |
| | Return a reference to the last element.
|
| constexpr auto | data () const |
| | Return a pointer to the first element, or null for an empty view.
|
| constexpr auto | empty () const -> bool |
| | Check whether the view contains no elements.
|
| constexpr decltype(auto) | front () const |
| | Return a reference to the first element.
|
| constexpr | operator bool () const |
| | Test whether the view contains at least one element.
|
| constexpr decltype(auto) | operator[] (const dindex i) const |
| | Subscript operator that takes detray dindex.
|
| constexpr auto | size () const |
| | Return the number of elements in the view.
|
template<detray::ranges::range... range_ts>
struct detray::ranges::cartesian_product_view< range_ts >
Range adaptor that generates a cartesian product from the given input ranges.
- See also
- https://en.cppreference.com/w/cpp/ranges/cartesian_product_view
-
https://github.com/gcc-mirror/gcc/blob/master/libstdc%2B%2B-v3/include/std/ranges
◆ iterator_t
template<detray::ranges::range... range_ts>
Initial value:
detray::ranges::iterator_t<range_ts>...>
Iterator implementation for the cartesian product view.
Definition cartesian_product.hpp:135
Iterator that advances through the Cartesian product.
◆ value_type
template<detray::ranges::range... range_ts>
Initial value:
detray::tuple< types... > dtuple
Tuple type used by detray storage and dispatch.
Definition containers.hpp:46
Tuple of references to the current element of each input range.
◆ cartesian_product_view()
template<detray::ranges::range... range_ts>
template<detray::ranges::range... deduced_range_ts>
requires ((sizeof...(deduced_range_ts) > 1) || ((!std::same_as<cartesian_product_view, deduced_range_ts>) && ...))
Construct from a pack of ranges.
- Template Parameters
-
| deduced_range_ts | input range types |
- Parameters
-
| ranges | input ranges whose elements form the product |
◆ begin()
template<detray::ranges::range... range_ts>
- Returns
- start position of range - const
◆ data() [1/2]
template<detray::ranges::range... range_ts>
- Returns
- a pointer to the beginning of the data of the first underlying range - non-const
◆ data() [2/2]
template<detray::ranges::range... range_ts>
- Returns
- a pointer to the beginning of the data of the first underlying range - const
◆ end()
template<detray::ranges::range... range_ts>
- Returns
- sentinel of the range - const
◆ size()
template<detray::ranges::range... range_ts>
template<int I = static_cast<int>(sizeof...(range_ts)) - 1>
- Returns
- product of the number elements of all ranges in the view
- Template Parameters
-
| I | index of the input range currently being counted |
- Parameters
-
| s | product accumulated from ranges already visited |
- Returns
- product of the input range lengths