Problem with Upper Hessenberg Reduction

14 vues (au cours des 30 derniers jours)
Daniela Valdés
Daniela Valdés le 31 Jan 2015
Hello. I'm having trouble with the algorithm of the reduction to the Upper Hessenberg form through Householder reflections. Here it's what I have so far:
function [Q,H]=Hessenbergsup(A,p)
[m,n]=size(A)
Q=eye(n)
if m!=n
disp("A isn't a square matrix")
else
if p==1 # Householder Reflections
H=A
for k=1:(n-2)
x=H((k+1):n,k)
u=((sign(x(1)))*(norm(x,2))*eye((n-k),k)) + x
u=u/((norm(u,2))^2)
H(k+1:n,k:n)=H(k+1:n,k:n)-2*u*((u')*(H(k+1:n,k:n)))
H(1:n,(k+1):n)=H(1:n,(k+1):n)-2*((H(1:n,(k+1):n))*u)*(u')
Q(1:n,(k+1):n)=Q(1:n,(k+1):n)-2*((Q(1:n,(k+1):n))*u)*(u')
endfor
endif
if p==2 # Arnoldi Iterations (not done yet)
endif
endif
end
The thing is, the function works, but it doesn't give me the Upper Hessenberg form.
  1 commentaire
hemanth vemuluri
hemanth vemuluri le 9 Jan 2021
@Daniela Valdés I'm having the same problem, if you found the solution please do post it here.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur MATLAB dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by