summaryrefslogtreecommitdiffhomepage
path: root/misc
diff options
context:
space:
mode:
authorTyge Løvset <[email protected]>2023-02-03 17:48:43 +0100
committerTyge Løvset <[email protected]>2023-02-03 17:48:43 +0100
commit5f4076de684da4507943a86e26dcaa5479cdf69b (patch)
treed7d4673f295e743d80ccf40e45c5b6aa47976a76 /misc
parentfeef5067e0c3f1cf113b4fa8b302ac1bfa249e68 (diff)
downloadSTC-modified-5f4076de684da4507943a86e26dcaa5479cdf69b.tar.gz
STC-modified-5f4076de684da4507943a86e26dcaa5479cdf69b.zip
Temporary commit. Will cleanup cspan and usage.
Diffstat (limited to 'misc')
-rw-r--r--misc/examples/multidim.c4
-rw-r--r--misc/tests/cspan_test.c2
2 files changed, 4 insertions, 2 deletions
diff --git a/misc/examples/multidim.c b/misc/examples/multidim.c
index d0ddf839..49b24172 100644
--- a/misc/examples/multidim.c
+++ b/misc/examples/multidim.c
@@ -5,6 +5,7 @@
#include <stdio.h>
using_cspan3(ispan, int);
+#define c_ALL 0,-1
int main()
{
@@ -30,7 +31,8 @@ int main()
}
puts("ss3 = ms3[:, 1:3, 1:3]");
ispan3 ss3 = ms3;
- cspan_slice(&ss3, {0,-1}, {1,3}, {1,3});
+ //cspan_slice(&ss3, {c_ALL}, {1,3}, {1,3});
+ ss3 = cspan_subslice(ispan3, &ms3, {c_ALL}, {1,3}, {1,3});
for (int i=0; i != ss3.dim[0]; i++) {
for (int j=0; j != ss3.dim[1]; j++) {
diff --git a/misc/tests/cspan_test.c b/misc/tests/cspan_test.c
index 43422f1c..cd6a1271 100644
--- a/misc/tests/cspan_test.c
+++ b/misc/tests/cspan_test.c
@@ -32,7 +32,7 @@ CTEST(cspan, slice) {
}
intspan2 m2 = m1;
- cspan_slice(&m2, {0,-1}, {2,4});
+ cspan_slice(&m2, {c_ALL}, {2,4});
size_t sum2 = 0;
for (size_t i = 0; i < m2.dim[0]; ++i) {