Say I have a banded, unsymmetric sparse matrix like the one below, created using the R Matrix package:
x = Matrix(matrix(c(1,0,0,0,0,1,1,0,0,1,0,0,0,0,1,1), 4, 4), sparse = TRUE)
print(x)
1 . . .
. 1 1 .
. 1 . 1
. . . 1
- Are there any preexisting packages I can use to store such a matrix more efficiently due to its banded nature? I will be working with matrices with thousands of rows/columns, so the sparse matrix classes from Matrix save lots of storage there, but I'm hoping to go a step further due to its banded structure. I am thinking of storing the diagonals and off-diagonals of the matrix as a quick fix, but perhaps there is a smarter solution available iin R.
- Is there currently an implementation of matrix multiplication in R (or Rcpp or Fortran) that can perform faster matrix multiplications with these banded matrices compared to what is available for regular sparse matrices?