17 #ifndef OPENKALMAN_MAKE_FIXED_SQUARE_ADAPTER_LIKE_HPP 18 #define OPENKALMAN_MAKE_FIXED_SQUARE_ADAPTER_LIKE_HPP 28 template<
typename...Ts>
29 using best_desc = std::decay_t<decltype(most_fixed_pattern(std::declval<Ts>()...))>;
32 template<
typename...Ds,
typename Arg, std::size_t...Ix>
33 constexpr decltype(
auto) make_fixed_square_adapter_like_impl(Arg&& arg,
std::index_sequence<Ix...>)
35 using B = best_desc<Ds..., vector_space_descriptor_of_t<Arg, Ix>...>;
36 using F = decltype(make_fixed_size_adapter<std::conditional_t<Ix >= 0, B, B>...>(std::declval<Arg&&>()));
37 constexpr
bool better = (... or (dynamic_dimension<Arg, Ix> and not dynamic_dimension<F, Ix>));
38 if constexpr (better)
return F {std::forward<Arg>(arg)};
39 else return std::forward<Arg>(arg);
53 template<
typename...Ds,
typename Arg, std::enable_if_t<
54 (... and coordinates::pattern<Ds>) and square_shaped<Arg, applicability::permitted> and
57 constexpr decltype(
auto)
58 make_fixed_square_adapter_like(Arg&& arg)
60 return detail::make_fixed_square_adapter_like_impl<Ds...>(std::forward<Arg>(arg), std::make_index_sequence<index_count_v<Arg>>{});
Definition for compares_with.
The concept, trait, or restraint is permitted, but whether it applies is not necessarily known at com...
constexpr bool pattern
An object describing the set of coordinates associated with a tensor index.
Definition: pattern.hpp:31
Definition of the Dimensions class.
Definition for coordinates::pattern.
Dimensions< 1 > Axis
Alias for a 1D Euclidean coordinates::pattern object.
Definition: Dimensions.hpp:171
constexpr bool compares_with
Compares two coordinates::pattern objects.
Definition: compares_with.hpp:475
Definition: basics.hpp:48