Hi Rick, Another application for the "cusum( 1 || " construct. I like it! How about something along the lines of:

start SLT(X);
i=repeat(1:nrow(X),nrow(X),1);
return( X[ loc(i
which returns the same in row major order? Conceptually it's simpler, but unfortunately it is not as quick.