Commit 1fc46b22 by Conor McCoid

### Extrap: added Householder reflections to MPE algo

parent 6d027f20
 function [x_out,r_out]=ALGO_extrap_MPE_v2_20211029(F,X) function [x_out,r_out]=ALGO_extrap_MPE_v2_20211029(F,X) % MPE performs minimal polynomial extrapolation using Arnoldi iteration % MPE performs minimal polynomial extrapolation [d,k] = size(F); [d,k] = size(F); x_out=zeros(d,k); x_out(:,1)=X(:,1); x_out=zeros(d,k); x_out(:,1)=X(:,1); ... ...
 function [x_out,r_out]=ALGO_extrap_MPE_v3_20211119(F,X) % MPE performs minimal polynomial extrapolation using Arnoldi iteration % with Householder reflections [d,k] = size(F); I=eye(d); Q=I; H = F; x_out=zeros(d,k); r_out = zeros(k,1); for i=1:min(d,k) w = SUB_extrap_Householder_v1_20211119(H(:,i),i); Q = (I-2*w*w')*Q; H = (I-2*w*w')*H; u = zeros(i,1); u(end)=1; u=H(1:i,1:i)\u; u=u/sum(u); x_out(:,i) = X(:,1:i)*u; r_out(i) = norm(F(:,1:i)*u); end \ No newline at end of file
 ... @@ -10,7 +10,8 @@ end ... @@ -10,7 +10,8 @@ end F = X(:,2:end) - X(:,1:n); F = X(:,2:end) - X(:,1:n); [x_v1,r_v1] = ALGO_extrap_MPE_v1_20211022(F,X(:,1:n)); [x_v1,r_v1] = ALGO_extrap_MPE_v1_20211022(F,X(:,1:n)); [x_v2,r_v2] = ALGO_extrap_MPE_v2_20211029(F,X(:,1:n)); % [x_v2,r_v2] = ALGO_extrap_MPE_v2_20211029(F,X(:,1:n)); [x_v2,r_v2] = ALGO_extrap_MPE_v3_20211119(F,X(:,1:n)); x = x_v1(:,end); x = x_v1(:,end); Error_abs= norm(x - x_true) Error_abs= norm(x - x_true) Error_rel= Error_abs/norm(x_true) Error_rel= Error_abs/norm(x_true) ... ...
 function w = SUB_extrap_Householder_v1_20211119(v,i) % HOUSEHOLDER calculates component of Householder reflection w = v(i:end); w(1) = w(1) + sign(w(1))*norm(w); w = w/norm(w); w = [zeros(i-1,1); w]; end \ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!