summaryrefslogtreecommitdiffhomepage
path: root/docs/cspan_api.md
diff options
context:
space:
mode:
authorTyge Lovset <[email protected]>2023-02-01 08:38:45 +0100
committerTyge Lovset <[email protected]>2023-02-01 08:38:45 +0100
commit6ce6ef3307e52db5813d3c8d6a2cba52df06daf8 (patch)
tree25af4be9fcd5e72778715b83ff312e157ca63b59 /docs/cspan_api.md
parentb677a0c3950b8294ba6458e682a885351273ac08 (diff)
downloadSTC-modified-6ce6ef3307e52db5813d3c8d6a2cba52df06daf8.tar.gz
STC-modified-6ce6ef3307e52db5813d3c8d6a2cba52df06daf8.zip
Massive update from unsigned sizes and indices to signed.
Diffstat (limited to 'docs/cspan_api.md')
-rw-r--r--docs/cspan_api.md22
1 files changed, 11 insertions, 11 deletions
diff --git a/docs/cspan_api.md b/docs/cspan_api.md
index c4cb7c16..8f6f695f 100644
--- a/docs/cspan_api.md
+++ b/docs/cspan_api.md
@@ -20,32 +20,32 @@ using_cspan4(S, ValueType); // define span types S, S2, S3, S4 with
Note that `cspan_md()`, `cmake_from*()`, `cspan_atN()`, `and cspan_subspanN()` require a (safe) cast to its span-type
on assignment, but not on initialization of a span variable. All functions are type-safe, and arguments are side-effect safe, except for SpanType arg. which must not have side-effects.
```c
-SpanTypeN cspan_md(ValueType* data, size_t xdim, ...); // create a multi-dimensional cspan
+SpanTypeN cspan_md(ValueType* data, intptr_t xdim, ...); // create a multi-dimensional cspan
SpanType cspan_make(T SpanType, {v1, v2, ...}); // make a 1d-dimensional cspan from values
SpanType cspan_from(STCContainer* cnt); // create a 1d cspan from a compatible STC container
SpanType cspan_from_array(ValueType array[]); // create a 1d cspan from a C array
-size_t cspan_size(const SpanTypeN* self); // return number of elements
+intptr_t cspan_size(const SpanTypeN* self); // return number of elements
unsigned cspan_rank(const SpanTypeN* self); // return number of dimensions
-size_t cspan_index(const SpanTypeN* self, size_t x, ...); // index of element
+intptr_t cspan_index(const SpanTypeN* self, intptr_t x, ...); // index of element
-ValueType* cspan_at(SpanTypeN* self, size_t x, ...); // at(): num of args specifies rank of input span.
+ValueType* cspan_at(SpanTypeN* self, intptr_t x, ...); // at(): num of args specifies rank of input span.
ValueType* cspan_front(SpanTypeN* self);
ValueType* cspan_back(SpanTypeN* self);
// return a subspan of lower rank:
-SpanType cspan_submd2(SpanType2* self, size_t x); // return a 1d subspan from a 2d span.
-SpanTypeN cspan_submd3(SpanType3* self, size_t x, ...); // return a 1d or 2d subspan from a 3d span.
-SpanTypeN cspan_submd4(SpanType4* self, size_t x, ...); // number of args determines rank of output span.
+SpanType cspan_submd2(SpanType2* self, intptr_t x); // return a 1d subspan from a 2d span.
+SpanTypeN cspan_submd3(SpanType3* self, intptr_t x, ...); // return a 1d or 2d subspan from a 3d span.
+SpanTypeN cspan_submd4(SpanType4* self, intptr_t x, ...); // number of args determines rank of output span.
// return a sliced span of same rank:
void cspan_slice(SpanTypeN* self, {x0,x1}, {y0,y1},...); // slice multidim span into a md subspan.
// return a subspan of same rank. Like e.g. cspan_slice(&ms3, {offset, offset+count}, {0}, {0});
-SpanType cspan_subspan(const SpanType* self, size_t offset, size_t count);
-SpanType2 cspan_subspan2(const SpanType2 self, size_t offset, size_t count);
-SpanType3 cspan_subspan3(const SpanType3 self, size_t offset, size_t count);
-SpanType4 cspan_subspan4(const SpanType4 self, size_t offset, size_t count);
+SpanType cspan_subspan(const SpanType* self, intptr_t offset, intptr_t count);
+SpanType2 cspan_subspan2(const SpanType2 self, intptr_t offset, intptr_t count);
+SpanType3 cspan_subspan3(const SpanType3 self, intptr_t offset, intptr_t count);
+SpanType4 cspan_subspan4(const SpanType4 self, intptr_t offset, intptr_t count);
SpanTypeN_iter SpanType_begin(const SpanTypeN* self);
SpanTypeN_iter SpanType_end(const SpanTypeN* self);