Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upNew approach to array indexing #115
Comments
|
Not sure where this would leave 2d and higher arrays though |
|
should be fine - it's the same logic as one would use from R... |
Rather than the current
minus1approach (which seems quite fragile) go the other way and unpack matrices offset so that everything just goes.This will affect
<= boundrather than 0 to< boundbut a large class of off-by-one errors will go away. When unpacking, rather than writing
double *x = odin_p->state[offset];we'd just write
and then later we can write
x[1]and it will use the 0 offset of the actual state