scripts/temp-distance-functions/expand_matrix_symmetric.R

expand_matrix_symmetric <- function(A) {
    m <- nrow(A)
    n <- ncol(A)
    B <- Matrix(0, nrow = m, ncol = m, sparse = TRUE)
    C <- Matrix(0, nrow = n, ncol = n, sparse = TRUE)
    cbind(rbind(B, t(A)), rbind(A, C))
    # rbind(A, Matrix(0, nrow = n-m, ncol = n, sparse = TRUE))
}
jtipton25/sgMRA documentation built on Feb. 9, 2023, 4:53 a.m.