Commit 5f368dae authored by Alessandro 's avatar Alessandro

minor changes in juobs_linalg

parent d05ccd35
...@@ -8,7 +8,7 @@ include("juobs_tools.jl") ...@@ -8,7 +8,7 @@ include("juobs_tools.jl")
include("juobs_obs.jl") include("juobs_obs.jl")
export read_mesons, read_ms1, read_ms, read_md export read_mesons, read_ms1, read_ms, read_md
export get_matrix, uwgevp_tot, energies, uwdot export get_matrix, uwgevp_tot, energies, uwdot, transpose, uwgevp, invert
export corr_obs, plat_av, lin_fit, x_lin_fit, y_lin_fit, fit_routine export corr_obs, plat_av, lin_fit, x_lin_fit, y_lin_fit, fit_routine
export meff, dec_const_pcvc, comp_t0 export meff, dec_const_pcvc, comp_t0
......
...@@ -123,18 +123,18 @@ function uwgevp_tot(mat_list::Vector{Matrix}, tnot::Int64; iter::Int64 = 30, eve ...@@ -123,18 +123,18 @@ function uwgevp_tot(mat_list::Vector{Matrix}, tnot::Int64; iter::Int64 = 30, eve
c_inv = invert(mat_list[tnot]) c_inv = invert(mat_list[tnot])
for i =1:n for i =1:n
aux_evals = uwgevp(mat_list[i], c_inv, iter = iter) aux_evals = uwgevp(mat_list[i], c_inv, iter = iter)
push!(evals , get_diag(aux_evals)) push!(evals , aux_evals)
end end
return evals return evals
else else
evecs = Array{Matrix}(undef, 0) evecs = Array{Matrix}(undef, 0)
for i = 2:n-4 c_inv = invert(mat_list[tnot])
c_inv = invert(mat_list[i]) for i = 1:n
aux_evals, aux_evec = uwgevp(mat_list[i+3], c_inv, evec=evec, iter=iter) aux_evals, aux_evec = uwgevp(mat_list[i], c_inv, evec=evec, iter=iter)
push!(evals, get_diag(aux_evals)) push!(evals, aux_evals)
ptilda = norm_evec(aux_evec, mat_list[i]) #ptilda = norm_evec(aux_evec, mat_list[i])
m = uwdot(mat_list[i], ptilda) #m = uwdot(mat_list[i], ptilda)
push!(evecs, m) push!(evecs, aux_evec)
end end
return evals, evecs return evals, evecs
end end
...@@ -181,13 +181,13 @@ function uwevp(a::Matrix{uwreal}; iter = 30, evec = false) ...@@ -181,13 +181,13 @@ function uwevp(a::Matrix{uwreal}; iter = 30, evec = false)
a = uwdot(r_k, q_k) a = uwdot(r_k, q_k)
u = uwdot(u, q_k) u = uwdot(u, q_k)
end end
return a, u return get_diag(a), u
else else
for k in 1:iter for k in 1:iter
q_k, r_k = qr(a) q_k, r_k = qr(a)
a = uwdot(r_k, q_k) a = uwdot(r_k, q_k)
end end
return a return get_diag(a)
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment