78 
.sparseDiagonal(n, x, uplo, shape = "t") 
.sparseDiagonal(n, x, uplo, shape = "t") 
79 


80 


81 
### This is modified from a post of Bert Gunter to Rhelp on 1 Sep 2005. 
## This is modified from a post of Bert Gunter to Rhelp on 1 Sep 2005. 
82 
### Bert's code built on a post by Andy Liaw who most probably was influenced 
## Bert's code built on a post by Andy Liaw who most probably was influenced 
83 
### by earlier posts, notably one by Scott Chasalow on Snews, 16 Jan 2002 
## by earlier posts, notably one by Scott Chasalow on Snews, 16 Jan 2002 
84 
### who posted his bdiag() function written in December 1995. 
## who posted his bdiag() function written in December 1995. 
85 
if(FALSE)## no longer used: 
if(FALSE)## no longer used: 
86 
.bdiag < function(lst) { 
.bdiag < function(lst) { 
87 
### blockdiagonal matrix [a dgTMatrix] from list of matrices 
## blockdiagonal matrix [a dgTMatrix] from list of matrices 
88 
stopifnot(is.list(lst), length(lst) >= 1) 
stopifnot(is.list(lst), length(lst) >= 1) 
89 
dims < sapply(lst, dim, USE.NAMES=FALSE) 
dims < sapply(lst, dim, USE.NAMES=FALSE) 
90 
## make sure we had all matrices: 
## make sure we had all matrices: 