[macstl-dev] Interleave/transpose function -- opinions wanted
Glen Low
glen.low at pixelglow.com
Fri Jul 15 23:58:45 WST 2005
Hi All
Andrew Brownsword would like interleave/transpose functions added to
macstl valarrays and it is a sensible and interesting addition, so
I'm going to be pursuing it for 0.3.x.
Given a valarray v = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ...}
Then deinterleave <n, m> (v) = {n, n+m, n+2m ... } e.g. deinterleave
<0, 4> (v) = {0, 4, 8 ... }
and
interleave (x, y, z ... ) = { x0, y0, z0 ... x1, y1, z1 ... } etc.
Obviously for the right values of n, m and # of parameters in
interleave (and types), suitable Altivec or SSE instructions could be
substituted for the scalar operations above. (Both n, m and # of
parameters will be compile-time constants, so no runtime jiggling of
opcodes need be done.)
Questions:
1. Name of these functions? Interleave/deinterleave, splice/
desplice/unsplice, transpose/detranspose/retranspose (???), merge/
unmerge/demerge etc.? Something short, succinct and similar enough to
existing usage (LISP, other languages, matrix libraries) would be good.
2. What should the syntax of deinterleave be?
Should it be as above i.e. deinterleave <n, m> (v)
or more similar to other sorts of valarray subsetting operations
e.g. v [deinterleave <n, m> ()]
Cheers, Glen Low
---
pixelglow software | simply brilliant stuff
www.pixelglow.com
aim: pixglen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pixelglow.com/lists/archive/macstl-dev/attachments/20050715/54cce9be/attachment.html
More information about the macstl-dev
mailing list