I have the below MWE. I have two things:
1- The matrices of factor
and factor1
are different. However, why the fifth element of factor.nzval=7
not 6
. but the matrices of ``?
using SparseArrays, LinearAlgebra, KLU
A_Mat = spzeros(3,3);
A_Mat[diagind(A_Mat)[1:3]] .= 1.0;
A_Mat[2,1] = 9; A_Mat[3,1] = 10; A_Mat[1,3] = 6;
b_Mat = zeros(3); b_Mat[1,1] = 2.0; b_Mat[2,1] = 3; b_Mat[3,1] = 4;
x_Mat = zeros(3);
factor = klu(A_Mat);
A_Mat[1,3] = 7;
factor1 = klu(A_Mat);
ldiv!(x_Mat, factor, b_Mat)
julia> factor.nzval
6-element Vector{Float64}:
1.0
9.0
10.0
1.0
7.0
1.0
julia> factor1.nzval
6-element Vector{Float64}:
1.0
9.0
10.0
1.0
7.0
1.0
2- In the REPL, I can see all the matrices of factor, for example factor.L
, but I cannot see them in the workspace (variables/global(main)) in VS code. Any reason for that?