Implement Axpy__unb

This commit is contained in:
Julien Lengrand-Lambert
2018-05-04 15:21:41 +02:00
parent b131d044ea
commit 40ec774a40

53
Homework/Week1/Axpy_unb.m Normal file
View File

@@ -0,0 +1,53 @@
% Copyright 2018 The University of Texas at Austin
%
% For licensing information see
% http://www.cs.utexas.edu/users/flame/license.html
%
% Programmed by: Julien Lengrand-Lambert
% julien@lengrand.fr
function [ y_out ] = Axpy__unb( alpha, x, y )
[ xT, ...
xB ] = FLA_Part_2x1( x, ...
0, 'FLA_TOP' );
[ yT, ...
yB ] = FLA_Part_2x1( y, ...
0, 'FLA_TOP' );
while ( size( xT, 1 ) < size( x, 1 ) )
[ x0, ...
chi1, ...
x2 ] = FLA_Repart_2x1_to_3x1( xT, ...
xB, ...
1, 'FLA_BOTTOM' );
[ y0, ...
psi1, ...
y2 ] = FLA_Repart_2x1_to_3x1( yT, ...
yB, ...
1, 'FLA_BOTTOM' );
psi1 = chi1 * alpha + psi1;
[ xT, ...
xB ] = FLA_Cont_with_3x1_to_2x1( x0, ...
chi1, ...
x2, ...
'FLA_TOP' );
[ yT, ...
yB ] = FLA_Cont_with_3x1_to_2x1( y0, ...
psi1, ...
y2, ...
'FLA_TOP' );
end
y_out = [ yT
yB ];
endfunction