mirror of
https://github.com/jlengrand/LAFF.git
synced 2026-03-10 08:31:21 +00:00
Implement Axpy__unb
This commit is contained in:
53
Homework/Week1/Axpy_unb.m
Normal file
53
Homework/Week1/Axpy_unb.m
Normal 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
|
||||||
Reference in New Issue
Block a user