Files
LAFF/Homework/Week1/Dot_unb.m
Julien Lengrand-Lambert b131d044ea Create Dot_unb
* Also add octaverc to add paths and silence warnings
2018-05-04 01:17:45 +02:00

61 lines
1.5 KiB
Matlab

% 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 [ alpha_out, x_out, c_out ] = Dot_unb( alpha, x, c )
alpha = 0;
[ xT, ...
xB ] = FLA_Part_2x1( x, ...
0, 'FLA_TOP' );
[ cT, ...
cB ] = FLA_Part_2x1( c, ...
0, 'FLA_TOP' );
while ( size( xT, 1 ) < size( x, 1 ) )
[ x0, ...
chi1, ...
x2 ] = FLA_Repart_2x1_to_3x1( xT, ...
xB, ...
1, 'FLA_BOTTOM' );
[ c0, ...
gamma1, ...
c2 ] = FLA_Repart_2x1_to_3x1( cT, ...
cB, ...
1, 'FLA_BOTTOM' );
alpha += chi1 * gamma1;
[ xT, ...
xB ] = FLA_Cont_with_3x1_to_2x1( x0, ...
chi1, ...
x2, ...
'FLA_TOP' );
[ cT, ...
cB ] = FLA_Cont_with_3x1_to_2x1( c0, ...
gamma1, ...
c2, ...
'FLA_TOP' );
end
alpha_out = alpha;
x_out = [ xT
xB ];
c_out = [ cT
cB ];
endfunction