Commit 3c0f634e authored by Alessandro 's avatar Alessandro

trying to understand how to propagate errors

parent f3b82863
......@@ -23,7 +23,6 @@ for op in (:eigvals, :eigvecs)
end
end
##
@doc raw"""
get_matrix(corr_diag::Vector{Array}, corr_upper::Vector{Array} )
......@@ -191,7 +190,7 @@ function uweigvals(a::Matrix{uwreal}; iter = 30)
q_k, r_k = qr(a)
a = uwdot(r_k, q_k)
end
return a#get_diag(a)
return get_diag(a)
end
function uweigvals(a::Matrix{uwreal}, b::Matrix{uwreal}; iter = 30)
c = uwdot(invert(b), a)
......@@ -200,10 +199,9 @@ function uweigvals(a::Matrix{uwreal}, b::Matrix{uwreal}; iter = 30)
q_k, r_k = qr(c)
c = uwdot(r_k, q_k)
end
return c#get_diag(c)
return get_diag(c)
end
function uweigvecs(a::Matrix{uwreal}; iter = 30)
n = size(a,1)
u = idty(n)
......@@ -225,11 +223,12 @@ function uweigvecs(a::Matrix{uwreal}, b::Matrix{uwreal}; iter = 30)
end
return u
end
function uweigen(a::Matrix{uwreal}; iter = 30)
return uweigvals(a, iter=iter), uweigvecs(a, iter=iter)
end
function uweigen(a::Matrix{uwreal}, b::Matrix{uwreal}; iter = 30)
return uweigvals(a,b, iter=iter), uweigvecs(a,b, iter=iter)
return uweigvals(a, b, iter=iter), uweigvecs(a, b, iter=iter)
end
function norm_evec(evec::Matrix{uwreal}, ctnot::Matrix{uwreal})
......@@ -249,6 +248,14 @@ function get_diag(a::Matrix{uwreal})
res = [a[k, k] for k = 1:n]
return res
end
function get_diag(v::Vector{uwreal})
n = length(v)
res = idty(n)
for i =1:n
res[i,i] = v[i]
end
return res
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