-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSet_to_upper_triangular_matrix_unb.m
46 lines (32 loc) · 1.42 KB
/
Set_to_upper_triangular_matrix_unb.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
% Copyright 2023 The University of Texas at Austin
%
% For licensing information see
% http://www.cs.utexas.edu/users/flame/license.html
%
% Programmed by: Anni Liu
% Interpret the function: http://edx-org-utaustinx.s3.amazonaws.com/UT501x/PictureFLAME/PictureFLAME.html
function [ A_out ] = Set_to_upper_triangular_matrix_unb( A )
[ ATL, ATR, ...
ABL, ABR ] = FLA_Part_2x2( A, ...
0, 0, 'FLA_TL' );
while ( size( ATL, 1 ) < size( A, 1 ) )
[ A00, a01, A02, ...
a10t, alpha11, a12t, ...
A20, a21, A22 ] = FLA_Repart_2x2_to_3x3( ATL, ATR, ...
ABL, ABR, ...
1, 1, 'FLA_BR' );
%------------------------------------------------------------%
a21 = laff_zerov( a21 );
%------------------------------------------------------------%
[ ATL, ATR, ...
ABL, ABR ] = FLA_Cont_with_3x3_to_2x2( A00, a01, A02, ...
a10t, alpha11, a12t, ...
A20, a21, A22, ...
'FLA_TL' );
end
A_out = [ ATL, ATR
ABL, ABR ];
return
% Test the function:
% A = randi([-2,2], 4, 4)
% Set_to_upper_triangular_matrix_unb( A )