https://github.com/cran/pracma
Revision b5e4bf28fcba9f5eaffbeecfb0bc307452d074ee authored by Hans W. Borchers on 01 November 2014, 00:00:00 UTC, committed by Gabor Csardi on 01 November 2014, 00:00:00 UTC
1 parent d57c14d
Tip revision: b5e4bf28fcba9f5eaffbeecfb0bc307452d074ee authored by Hans W. Borchers on 01 November 2014, 00:00:00 UTC
version 1.7.7
version 1.7.7
Tip revision: b5e4bf2
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)
}
Computing file changes ...