首页 > 代码库 > Householder Reduction Matlab Version
Householder Reduction Matlab Version
function [T, P] = householder(A) % Formations: RA = T, where A is original matrix % The implementation of Householder Reduction % R is constructed as a product of elementary reflector % T is upper triangular matrix % Author: Zhenlin Du(Johnsondu) % Email: qlduzhlin@126.com % Time: 2014-11-28 14:00 A = double(A) [m, n] = size(A); % m- number of rows, n- number of columns iter = 0; if m > n iter = n; else iter = m - 1; end T = A; P = eye(m); for i = 1 : iter % take the first column u = T(i:m, i); % construct identity matrix I = eye(m-i+1); e1 = I (:, 1); % u is elementary relector. u = u - norm(u) * e1; R11 = eye(m-i+1) - 2 * (u * u') / (u' * u); R1 = eye(m); for j = i: m R1(j, i: m) = R11(j-i+1, :); end T = R1 * T; P = R1 * P; end
Householder Reduction Matlab Version
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。