Commit 5f368dae authored by Alessandro 's avatar Alessandro

minor changes in juobs_linalg

parent d05ccd35
......@@ -8,7 +8,7 @@ include("juobs_tools.jl")
include("juobs_obs.jl")
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 meff, dec_const_pcvc, comp_t0
......
......@@ -123,18 +123,18 @@ function uwgevp_tot(mat_list::Vector{Matrix}, tnot::Int64; iter::Int64 = 30, eve
c_inv = invert(mat_list[tnot])
for i =1:n
aux_evals = uwgevp(mat_list[i], c_inv, iter = iter)
push!(evals , get_diag(aux_evals))
push!(evals , aux_evals)
end
return evals
else
evecs = Array{Matrix}(undef, 0)
for i = 2:n-4
c_inv = invert(mat_list[i])
aux_evals, aux_evec = uwgevp(mat_list[i+3], c_inv, evec=evec, iter=iter)
push!(evals, get_diag(aux_evals))
ptilda = norm_evec(aux_evec, mat_list[i])
m = uwdot(mat_list[i], ptilda)
push!(evecs, m)
c_inv = invert(mat_list[tnot])
for i = 1:n
aux_evals, aux_evec = uwgevp(mat_list[i], c_inv, evec=evec, iter=iter)
push!(evals, aux_evals)
#ptilda = norm_evec(aux_evec, mat_list[i])
#m = uwdot(mat_list[i], ptilda)
push!(evecs, aux_evec)
end
return evals, evecs
end
......@@ -181,13 +181,13 @@ function uwevp(a::Matrix{uwreal}; iter = 30, evec = false)
a = uwdot(r_k, q_k)
u = uwdot(u, q_k)
end
return a, u
return get_diag(a), u
else
for k in 1:iter
q_k, r_k = qr(a)
a = uwdot(r_k, q_k)
end
return a
return get_diag(a)
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