I want to recreate a solve function(solve Ax = b for x) for sparse matrix. In the Julia documentation, it says that when we applied a sparse matrix to lufact(), it returns the following:
L, U, p, q, Rs = F[:(:)]
With the given formula in Julia doc: LU = Rs.*A[p,q], I did some algebra and obtained the following formula:
x = U \ ( L \ (Rs.*b[p]) )
ipermute!(x,q)
This formula matched with the default F\b solver in Julia when the matrix is dense but the result is off when the matrix is sparse. Does anyone know why?