Commit 59d62eab authored by Alessandro 's avatar Alessandro

corrected issues with variable definition and usage of copy function. (linalg)

parent 47cbbe0d
...@@ -60,8 +60,8 @@ function get_matrix(corr_diag::Vector{Vector{uwreal}}, corr_upper::Vector{Vector ...@@ -60,8 +60,8 @@ function get_matrix(corr_diag::Vector{Vector{uwreal}}, corr_upper::Vector{Vector
return nothing return nothing
end end
res = Vector{Matrix}(undef, time) # array with all the matrices at each time step. res = Vector{Matrix}(undef, time) # array with all the matrices at each time step.
aux = Matrix{uwreal}(undef, n, n)
for t in 1:time for t in 1:time
aux = Matrix{uwreal}(undef, n, n)
count=0 count=0
#testing = corr_upper[1][1] #testing = corr_upper[1][1]
for i in range(n-1,1, step=-1) for i in range(n-1,1, step=-1)
...@@ -73,7 +73,7 @@ function get_matrix(corr_diag::Vector{Vector{uwreal}}, corr_upper::Vector{Vector ...@@ -73,7 +73,7 @@ function get_matrix(corr_diag::Vector{Vector{uwreal}}, corr_upper::Vector{Vector
aux[i,i] = corr_diag[i][t] aux[i,i] = corr_diag[i][t]
end end
aux[n,n] = corr_diag[n][t] aux[n,n] = corr_diag[n][t]
res[t] = aux res[t] = copy(aux)
end end
return res return res
end end
...@@ -89,15 +89,15 @@ function energies(evals::Vector{Vector{uwreal}}) ...@@ -89,15 +89,15 @@ function energies(evals::Vector{Vector{uwreal}})
time = length(evals) time = length(evals)
n = length(evals[1]) n = length(evals[1])
eff_en = Vector{Vector}(undef, n) eff_en = Vector{Vector}(undef, n)
#aux_en = Vector{uwreal}(undef, time-1) aux_en = Vector{uwreal}(undef, time-1)
for i in 1:n for i in 1:n
aux_en = Vector{uwreal}(undef, time-1) #aux_en = Vector{uwreal}(undef, time-1)
for t in 1:time-1 for t in 1:time-1
ratio = evals[t][i] / evals[t+1][i] ratio = evals[t][i] / evals[t+1][i]
aux_en[t] = log(sqrt(ratio * ratio)) aux_en[t] = log(sqrt(ratio * ratio))
end end
uwerr.(aux_en) uwerr.(aux_en)
eff_en[i] = aux_en eff_en[i] = copy(aux_en)
end end
return eff_en return eff_en
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