A <- magic(5)
LU <- lu(A, scheme = "ijk") # Doolittle scheme
LU$L %*% LU$U
## [,1] [,2] [,3] [,4] [,5]
## [1,] 17 24 1 8 15
## [2,] 23 5 7 14 16
## [3,] 4 6 13 20 22
## [4,] 10 12 19 21 3
## [5,] 11 18 25 2 9
Run the code above in your browser using DataLab