stclib / STC

A modern, user friendly, generic, type-safe and fast C99 container library: String, Vector, Sorted and Unordered Map and Set, Deque, Forward List, Smart Pointers, Bitset and Random numbers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Span with custom strides?

ib00 opened this issue · comments

commented

Is there an easy way to use multidimensional span with custom strides?
Sometimes data is stored in a different order (row-major vs column-major).

Not atm. I haven't thought too much about it, but I have considered making a column-major variant. Will look more into this later.

I will soon commit an updated version of cspan.h on the dev43 branch with option to create column-major (or layout left) md spans. cspan_md_left(arr, ...) instead of cspan_md(arr, ...). In addition there will be a cspan_transpose(&ms) function to transpose the mdspan (will NOT change the underlying array, just the span itself).

Closed. Added support for column-major md span views in dev43 branch. Currently there is a API change, in cspan_md() with either 'C' or 'F' as first argument. I haven't decided if I revert to the description in prev. post for the 4.3 release.