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
return nothing
end
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
aux = Matrix{uwreal}(undef, n, n)
count=0
#testing = corr_upper[1][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
aux[i,i] = corr_diag[i][t]
end
aux[n,n] = corr_diag[n][t]
res[t] = aux
res[t] = copy(aux)
end
return res
end
......@@ -89,15 +89,15 @@ function energies(evals::Vector{Vector{uwreal}})
time = length(evals)
n = length(evals[1])
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
aux_en = Vector{uwreal}(undef, time-1)
#aux_en = Vector{uwreal}(undef, time-1)
for t in 1:time-1
ratio = evals[t][i] / evals[t+1][i]
aux_en[t] = log(sqrt(ratio * ratio))
end
uwerr.(aux_en)
eff_en[i] = aux_en
eff_en[i] = copy(aux_en)
end
return eff_en
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