@@ -223,7 +223,7 @@ maybe_step()
223223
224224template <class I , class N =dim_c<UNB>, class S =dim_c<1 >>
225225constexpr auto
226- ptr (I && i, N && n = N {}, S && s = maybe_step<S>())
226+ ptr (I && i, N && n= N {}, S && s= maybe_step<S>())
227227{
228228 if constexpr (std::ranges::bidirectional_range<std::remove_reference_t <I>>) {
229229 static_assert (std::is_same_v<dim_c<UNB>, N>, " Object has own length." );
@@ -283,8 +283,7 @@ struct Reframe<A, ilist_t<di ...>, ilist_t<i ...>>
283283 constexpr static int orig (int k) { int r=-1 ; (void )((di==k && (r=i, 1 )) || ...); return r; }
284284 constexpr static dim_t len_s (int k)
285285 {
286- int l=orig (k);
287- return l>=0 ? std::decay_t <A>::len_s (l) : UNB;
286+ int l=orig (k); return l>=0 ? std::decay_t <A>::len_s (l) : UNB;
288287 }
289288 constexpr static dim_t
290289 len (int k) requires (requires { std::decay_t <A>::len (k); })
@@ -321,16 +320,15 @@ struct Reframe<A, ilist_t<di ...>, ilist_t<i ...>>
321320 constexpr decltype (auto ) operator*() const { return *a; }
322321 constexpr auto save () const { return a.save (); }
323322 constexpr void load (auto const & p) { a.load (p); }
324- // FIXME if Dest preserves axis order (?) which wrank does
325323 constexpr void mov (auto const & s) { a.mov (s); }
326324};
327325
328326// Optimize nop case. TODO If A is CellBig, etc. beat Dest on it, same for eventual transpose_expr<>.
329- template <class Dest , class A >
327+ template <class A , class Dest >
330328constexpr decltype (auto )
331- reframe(A && a)
329+ reframe(A && a, Dest )
332330{
333- if constexpr (std::is_same_v<Dest, mp::iota<Reframe<A, Dest>:: rank () >>) {
331+ if constexpr (std::is_same_v<Dest, mp::iota<mp::len< Dest>>>) {
334332 return RA_FWD (a);
335333 } else {
336334 return Reframe<A, Dest> { RA_FWD (a) };
@@ -339,9 +337,9 @@ reframe(A && a)
339337
340338template <int w=0 , class I =dim_t , class N =dim_c<UNB>, class S =dim_c<1 >>
341339constexpr auto
342- iota (N && n = N {}, I && i = 0 , S && s = maybe_step<S>())
340+ iota (N && n= N {}, I && i= 0 , S && s= maybe_step<S>())
343341{
344- return reframe< ilist_t <w>> (Ptr<Seq<sarg<I>>, sarg<N>, sarg<S>> { {RA_FWD (i)}, RA_FWD (n), RA_FWD (s) });
342+ return reframe (Ptr<Seq<sarg<I>>, sarg<N>, sarg<S>> { {RA_FWD (i)}, RA_FWD (n), RA_FWD (s) }, ilist_t <w>{ });
345343}
346344
347345#define DEF_TENSORINDEX (w ) constexpr auto JOIN (_, w) = iota<w>();
@@ -613,7 +611,7 @@ constexpr bool
613611agree_verb (ilist_t <i ...>, V const & v, T const & ... t)
614612{
615613 using FM = Framematch<V, std::tuple<T ...>>;
616- return agree_op (FM::op (v), reframe< mp::ref<typename FM::R, i>>( ra::start (t) ) ...);
614+ return agree_op (FM::op (v), reframe ( ra::start (t), mp::ref<typename FM::R, i>{} ) ...);
617615}
618616
619617
@@ -656,7 +654,7 @@ constexpr auto
656654map_verb (ilist_t <i ...>, Op && op, P && ... p)
657655{
658656 using FM = Framematch<Op, std::tuple<P ...>>;
659- return map_ (FM::op (RA_FWD (op)), reframe< mp::ref<typename FM::R, i>>( RA_FWD (p) ) ...);
657+ return map_ (FM::op (RA_FWD (op)), reframe ( RA_FWD (p), mp::ref<typename FM::R, i>{} ) ...);
660658}
661659
662660constexpr auto
0 commit comments