swh:1:snp:81eadaa089e8253d8469bcef66aa332632c6c669
Tip revision: c1688b374d201c13fb40b4dda2d2a89e34b94ec6 authored by Hans W. Borchers on 23 January 2021, 09:10:02 UTC
version 2.3.3
version 2.3.3
Tip revision: c1688b3
wilkinson.R
##
## w i l k i n s o n . R Wilkinson matrix
##
wilkinson <- function(n){
if (length(n) != 1 || n != round(n))
stop("Argument 'n' must be an integer.")
if (n <= 0) return(c())
m <- (n-1)/2.0
r <- rep(1, n-1)
Diag(abs(-m:m)) + Diag(r, 1) + Diag(r, -1)
}