14template <
typename LayoutPolicy,
typename Extents>
17template <
typename Builder,
typename LayoutPolicy,
typename Extents>
19 { std::forward<Builder>(builder)(exts) } -> std::same_as<mapping_for_t<LayoutPolicy, Extents>>;
24template <
typename Extents>
25constexpr auto layout_right_strides(Extents
const& exts) -> std::array<
typename Extents::index_type, Extents::rank()>
27 using index_type =
typename Extents::index_type;
30 for (
int d =
static_cast<int>(Extents::rank()) - 1; d >= 0; --d)
33 run *= exts.extent(
static_cast<std::size_t
>(d));
38template <
typename Extents>
39constexpr auto layout_left_strides(Extents
const& exts) -> std::array<
typename Extents::index_type, Extents::rank()>
41 using index_type =
typename Extents::index_type;
44 for (std::size_t d = 0; d < Extents::rank(); ++d)
47 run *= exts.extent(d);
56 template <
typename Extents>
59 return {exts, detail::layout_right_strides(exts)};
65 template <
typename Extents>
68 return {exts, detail::layout_left_strides(exts)};
72template <
typename LayoutPolicy,
typename Extents>
75 if constexpr (std::is_same_v<LayoutPolicy, stdex::layout_stride>)
auto strides(S const &s)
Retrieve the strides associated with a strided mdspec-like type.
Definition mdspan/concepts.hpp:558
Configured gateway to Uni20's mdspan implementation.
constexpr auto make_mapping(Extents const &exts) -> mapping_for_t< LayoutPolicy, Extents >
Definition layout.hpp:73
typename LayoutPolicy::template mapping< Extents > mapping_for_t
Definition layout.hpp:15
KernelAttempt run(X &x, A &a, B &b, std::span< make_real_t< typename A::value_type > > residuals, LeastSquaresInfo &info, LeastSquaresOptions< make_real_t< typename A::value_type > > const &options, Precision p, Factor factor)
Definition least_squares_common.hpp:92
std::ptrdiff_t index_type
Definition types.hpp:19
constexpr auto operator()(Extents const &exts) const -> mapping_for_t< stdex::layout_stride, Extents >
Definition layout.hpp:66
constexpr auto operator()(Extents const &exts) const -> mapping_for_t< stdex::layout_stride, Extents >
Definition layout.hpp:57