Commit 1ad65f09 authored by Alessandro 's avatar Alessandro

update to alessandro's branch

parent 55c47ca9
...@@ -120,7 +120,6 @@ function uwgevp_tot(mat_list::Vector{Matrix}, tnot::Int64; iter::Int64 = 30, eve ...@@ -120,7 +120,6 @@ function uwgevp_tot(mat_list::Vector{Matrix}, tnot::Int64; iter::Int64 = 30, eve
n = length(mat_list) n = length(mat_list)
evals = Array{Array{uwreal}}(undef, 0 ) evals = Array{Array{uwreal}}(undef, 0 )
if !evec if !evec
println(tnot)
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)
...@@ -136,18 +135,26 @@ function uwgevp_tot(mat_list::Vector{Matrix}, tnot::Int64; iter::Int64 = 30, eve ...@@ -136,18 +135,26 @@ function uwgevp_tot(mat_list::Vector{Matrix}, tnot::Int64; iter::Int64 = 30, eve
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, m)
println( "\n t is ", i+3, " tnot is ", i)
#if 2*tnot < i && i<n-5
# tnot+=5
#end
end end
return evals, evecs return evals, evecs
end end
end end
function uwgevp_tot(mat_list::Vector{Matrix}; iter::Int64=30, delta_t::Int64=3)
n = length(mat_list) - delta_t
evecs = Array{Matrix}(undef, 0)
for i = 2:n
c_inv = invert(mat_list[i])
usless, temp_evec = uwgevp(mat_list[i+delta_t], c_inv, evec=true, iter=iter)
push!(evecs, uwdot(mat_list[i], norm_evec(temp_evec, mat_list[i])))
end
return evecs
end
""" """
uwgevp(c_t:: Matrix{uwreal}, c_tnot_inv::Matrix{uwreal}; iter = 30, evec = false) uwgevp(c_t:: Matrix{uwreal}, c_tnot_inv::Matrix{uwreal}; iter = 30, evec = false)
Given two matrices of uwreal C(t) and C(t0), this method solves the generalized eigenvalue problem Given two matrices of uwreal C(t) and C(t0)^-1, this method solves the generalized eigenvalue problem
C(t)V = C(t_0)D V, where V is the eigenvector matrix and D is the diagonal matrix of eigenvalues. C(t)V = C(t_0)D V, where V is the eigenvector matrix and D is the diagonal matrix of eigenvalues.
If evec = true also the eigenvectors are returned as columns of the orthogonal matrix u. If evec = true also the eigenvectors are returned as columns of the orthogonal matrix u.
......
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