Problem with Upper Hessenberg Reduction

15 ビュー (過去 30 日間)
Daniela Valdés
Daniela Valdés 2015 年 1 月 31 日
コメント済み: hemanth vemuluri 2021 年 1 月 9 日
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 件のコメント
hemanth vemuluri
hemanth vemuluri 2021 年 1 月 9 日
@Daniela Valdés I'm having the same problem, if you found the solution please do post it here.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeMATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by