summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/stc/carr2.h5
-rw-r--r--include/stc/carr3.h5
2 files changed, 8 insertions, 2 deletions
diff --git a/include/stc/carr2.h b/include/stc/carr2.h
index 3f9d1540..a1dfc3ce 100644
--- a/include/stc/carr2.h
+++ b/include/stc/carr2.h
@@ -76,7 +76,10 @@ STC_INLINE size_t _cx_memb(_size)(_cx_self arr)
STC_INLINE _cx_value *_cx_memb(_data)(_cx_self* self)
{ return *self->data; }
-STC_INLINE _cx_value *_cx_memb(_at)(_cx_self* self, size_t x, size_t y)
+STC_INLINE _cx_value *_cx_memb(_elem)(_cx_self* self, size_t x, size_t y)
+ { return *self->data + self->ydim*x + y; }
+
+STC_INLINE const _cx_value *_cx_memb(_at)(const _cx_self* self, size_t x, size_t y)
{ return *self->data + self->ydim*x + y; }
STC_INLINE void _cx_memb(_copy)(_cx_self *self, _cx_self other) {
diff --git a/include/stc/carr3.h b/include/stc/carr3.h
index 1133dcc3..4d4fc84e 100644
--- a/include/stc/carr3.h
+++ b/include/stc/carr3.h
@@ -78,7 +78,10 @@ STC_INLINE size_t _cx_memb(_size)(_cx_self arr)
STC_INLINE _cx_value* _cx_memb(_data)(_cx_self* self)
{ return **self->data; }
-STC_INLINE _cx_value* _cx_memb(_at)(_cx_self* self, size_t x, size_t y, size_t z)
+STC_INLINE _cx_value* _cx_memb(_elem)(_cx_self* self, size_t x, size_t y, size_t z)
+ { return **self->data + self->zdim*(self->ydim*x + y) + z; }
+
+STC_INLINE const _cx_value* _cx_memb(_at)(const _cx_self* self, size_t x, size_t y, size_t z)
{ return **self->data + self->zdim*(self->ydim*x + y) + z; }
STC_INLINE void _cx_memb(_copy)(_cx_self *self, _cx_self other) {