swh:1:snp:81eadaa089e8253d8469bcef66aa332632c6c669
Tip revision: 579123307d89d9c83ce74568d6dfb56864019c93 authored by Hans W. Borchers on 05 February 2014, 00:00:00 UTC
version 1.6.4
version 1.6.4
Tip revision: 5791233
moler.R
##
## m o l e r . R
##
moler <- function(n) {
if (length(n) != 1 || n != round(n))
stop("Argument 'n' must be an integer.")
if (n <= 0) return(c())
A <- matrix(0, nrow = n, ncol = n)
for (i in 1:n) {
A[i, 1:i] <- (1:i) - 2
}
A <- A + t(A)
diag(A) <- 1:n
A
}