Problem with Upper Hessenberg Reduction

15 visualizaciones (últimos 30 días)
Daniela Valdés
Daniela Valdés el 31 de En. de 2015
Comentada: hemanth vemuluri el 9 de En. de 2021
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 comentario
hemanth vemuluri
hemanth vemuluri el 9 de En. de 2021
@Daniela Valdés I'm having the same problem, if you found the solution please do post it here.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre MATLAB en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by