UNPKG

@thi.ng/vectors

Version:

Optimized 2d/3d/4d and arbitrary length vector operations, support for memory mapping/layouts

17 lines (16 loc) 321 B
function* vecIterator(ctor, buf, num, start, cstride, estride) { while (num-- > 0) { yield new ctor(buf, start, cstride); start += estride; } } function* stridedValues(buf, num, start, stride) { while (num-- > 0) { yield buf[start]; start += stride; } } export { stridedValues, vecIterator };