Debian Codegraph @

man/diagX.Rd

raw
1 \name{diagX}
2 \alias{diagX}
3 \title{The \dQuote{Other} Diagonal Matrix}
4 \description{
5 Compute the \emph{other} diagonal identity matrix.
6 The result is basically a \emph{fast} version of \code{diag(n)[, n:1]}.
7 }
8 \usage{
9 diagX(n)
10 }
11 \arguments{
12 \item{n}{positive integer.}
13 }
14 \value{
15 a numeric \eqn{n \times n}{n * n} matrix with many zeros -- apart from
16 \code{1}s in the \emph{other} diagonal.
17 }
18 \author{Martin Maechler, 1992.}
19 \seealso{\code{\link{diag}}.}
20 \examples{
21 diagX(4)
22 for(m in 1:5)
23 stopifnot(identical(diagX(m), diag(m)[, m:1, drop = FALSE]))
24 }
25 \keyword{array}
26 \keyword{utilities}