diff options
| author | tylov <[email protected]> | 2023-07-11 22:16:09 +0200 |
|---|---|---|
| committer | tylov <[email protected]> | 2023-07-11 22:16:09 +0200 |
| commit | 0bcb0fcd981cb15329dfd4fb675097564164da18 (patch) | |
| tree | 2bb26e1c0940bdbab326b780bce0a89b47e79d16 /misc/examples | |
| parent | afc968975a057f5b2653e3cfa51ef2eff83a8d5b (diff) | |
| download | STC-modified-0bcb0fcd981cb15329dfd4fb675097564164da18.tar.gz STC-modified-0bcb0fcd981cb15329dfd4fb675097564164da18.zip | |
Fixed an issue in template.h
Reverted to cspan_md() and cspan_md_left() for column-major.
Changed cspan_submdX(): add OutputSpanType as first parameter - aligns with cspan_slice() and adds type safety.
Diffstat (limited to 'misc/examples')
| -rw-r--r-- | misc/examples/multidim.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/misc/examples/multidim.c b/misc/examples/multidim.c index 43c21443..dbea9699 100644 --- a/misc/examples/multidim.c +++ b/misc/examples/multidim.c @@ -14,7 +14,7 @@ int main() ispan ms1 = cspan_from(&v); // View the same data as a 3D array 2 x 3 x 4 - ispan3 ms3 = cspan_md('C', v.data, 2, 3, 4); + ispan3 ms3 = cspan_md(v.data, 2, 3, 4); puts("ms3:"); for (int i=0; i != ms3.shape[0]; i++) { @@ -45,7 +45,7 @@ int main() printf(" %d", *i.ref); puts(""); - ispan2 ms2 = cspan_submd3(&ms3, 0); + ispan2 ms2 = cspan_submd3(ispan2, &ms3, 0); // write data using 2D view for (int i=0; i != ms2.shape[0]; i++) @@ -58,7 +58,7 @@ int main() puts(""); puts("iterate subspan ms3[1]:"); - ispan2 sub = cspan_submd3(&ms3, 1); + ispan2 sub = cspan_submd3(ispan2, &ms3, 1); c_foreach (i, ispan2, sub) printf(" %d", *i.ref); puts(""); |
