The Other Diagonal Matrix
Compute the other diagonal identity matrix. The result is basically a fast version of diag(n)[, n:1]
.
diagX(n)
n
: positive integer.a numeric matrix with many zeros -- apart from 1
s in the other diagonal.
Martin Maechler, 1992.
diag
.
diagX(4) for(m in 1:5) stopifnot(identical(diagX(m), diag(m)[, m:1, drop = FALSE]))