I am just confused about one thing related to LU factorization. It is known that the solution of A.x=b
is x = U\L\P*b. Why when I apply it in the below it gives another solution comparing with A\b
, while LU\b
gives the same result?
A = [1 3 3; 6 9 7;-3 3 4]; b = [1,2,3];
julia> A\b
3-element Vector{Float64}:
-0.6000000000000001
0.9333333333333331
-0.39999999999999974
LU = lu(A);
julia> LU.U\LU.L\(LU.P)*b
3-element Vector{Float64}:
46.00000000000013
53.0000000000001
-17.933333333333373
julia> LU\b
3-element Vector{Float64}:
-0.6000000000000001
0.9333333333333331
-0.39999999999999974