17 #ifndef OPENKALMAN_COLLECTIONS_VIEWS_IOTA_HPP 18 #define OPENKALMAN_COLLECTIONS_VIEWS_IOTA_HPP 27 template<
typename Start = std::
integral_constant<std::
size_t, 0>>
32 explicit constexpr
iota_generator(Start start) : start_ {std::move(start)} {};
35 template<values::index I>
37 template<
typename I, std::enable_if_t<values::index<I>,
int> = 0>
40 operator() (I i)
const 63 template<values::
integral Start = std::
integral_constant<std::
size_t, 0>, values::size Size = values::unbounded_
size_t>
65 std::same_as<Start, std::remove_reference_t<Start>> and
66 std::same_as<Size, std::remove_reference_t<Size>>
68 template<
typename Start = std::
integral_constant<std::
size_t, 0>,
typename Size = values::unbounded_
size_t>
83 iota_view(Start start, Size
size) requires values::index<Size>
85 template<
bool Enable = true, std::enable_if_t<Enable and values::index<Size>,
int> = 0>
96 iota_view(Start start) requires (not values::index<Size>)
98 template<
bool Enable = true, std::enable_if_t<Enable and not values::index<Size>,
int> = 0>
116 template<
typename Start,
typename Size>
122 template<
typename Start>
128 #ifdef __cpp_lib_ranges 129 namespace std::ranges
131 namespace OpenKalman::stdex::ranges
134 template<
typename Start,
typename Size>
135 constexpr
bool enable_borrowed_range<OpenKalman::collections::iota_view<Start, Size>> =
true;
141 #ifdef __cpp_concepts 142 template<
typename Start, OpenKalman::values::fixed Size>
144 : std::integral_constant<size_t, OpenKalman::values::fixed_value_of_v<Size>> {};
146 template<
typename Start,
typename Size>
148 : tuple_size<OpenKalman::collections::generate_view<OpenKalman::collections::detail::iota_generator<Start>, Size>> {};
152 #ifdef __cpp_concepts 153 template<std::
size_t i, OpenKalman::values::fixed Start,
typename Size>
160 template<std::
size_t i,
typename Start,
typename Size>
162 : tuple_element<i, OpenKalman::collections::generate_view<OpenKalman::collections::detail::iota_generator<Start>, Size>> {};
177 #ifdef __cpp_concepts 178 template<values::index Start, values::index Size> requires
181 template<
typename Start,
typename Size, std::enable_if_t<values::index<Start> and values::index<Size> and
182 stdex::convertible_to<values::value_type_of_t<Size>, values::value_type_of_t<Start>>,
int> = 0>
185 operator() (Start start, Size size)
const 194 #ifdef __cpp_concepts 195 template<values::index Start>
197 template<
typename Start, std::enable_if_t<values::index<Start>,
int> = 0>
200 operator() (Start start)
const constexpr detail::iota_adapter iota
a RangeAdapterObject associated with iota_view.
Definition: iota.hpp:225
Namespace for collections.
Definition: collections.hpp:27
Header file for code relating to values (e.g., scalars and indices)
typename value_type_of< T >::type value_type_of_t
Helper template for value_type_of.
Definition: value_type_of.hpp:52
constexpr bool value
T is a fixed or dynamic value that is reducible to a number.
Definition: value.hpp:45
An iota collection that is a std::range and may also be uniformly_gettable.
Definition: iota.hpp:70
Definition for collections::generate_view and collections::views::generate.
A collection_view created by lazily generating elements based on an index.
Definition: generate.hpp:39
constexpr bool size
T is either an index representing a size, or unbounded_size_t, which indicates that the size is unbou...
Definition: size.hpp:65
Namespace for generalized views.
Definition: collections.hpp:33
decltype(operation(std::declval< Operation && >(), std::declval< Args && >()...)) operation_t
The resulting type from an values::operation.
Definition: operation.hpp:115
iota_view(const Start &, const Size &) -> iota_view< Start, Size >
Deduction guide.
constexpr auto operation(Operation &&op, Args &&...args)
A potentially constant-evaluated operation involving some number of values.
Definition: operation.hpp:98
constexpr iota_view(Start start, Size size)
Construct from an initial value and size.
Definition: iota.hpp:86
constexpr iota_view(Start start)
Construct from an initial value, default-initializing Size.
Definition: iota.hpp:99