You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The speedup isn't huge with modern gcc/clang. With icx 2024.1 I get for
using S = mp_iota_c<100>;
template <classS>
using mp_enumerate = mp_transform<mp_list, S, mp_iota<mp_size<S>>>;
using E = mp_enumerate<S>;
template <classS, classV>
using mp_set_find = mp_second<mp_map_find<E, V>>;
// using mp_set_find = mp_find<S,V>;template<classA, classB> using F = mp_less<mp_set_find<S, A>, mp_set_find<S, B>>;
static_assert(std::is_same_v<mp_sort<S, F>, S>);
I think this is an improvement that justifies having mp_set_find.
I'd like to add mp_enumerate as well, but most other languages (and std::views::enumerate) put the index first, not second. (Which is actually what mp_at uses.)
Activity
pdimov commentedon Jan 7, 2024
Probably makes sense for completeness. I wonder what's the actual difference in performance in 2024 compared to
mp_find, though.rolandschulz commentedon Jan 8, 2024
The speedup isn't huge with modern gcc/clang. With icx 2024.1 I get for
1.6s for mp_set_find and 2.2s for mp_find.
pdimov commentedon Jan 8, 2024
I think this is an improvement that justifies having
mp_set_find.I'd like to add
mp_enumerateas well, but most other languages (andstd::views::enumerate) put the index first, not second. (Which is actually whatmp_atuses.)