-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTranspose_alternative_unb.m
54 lines (38 loc) · 1.57 KB
/
Transpose_alternative_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
47
48
49
50
51
52
53
54
% 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 [ B_out ] = Transpose_alternative_unb( A, B )
[ AT, ...
AB ] = FLA_Part_2x1( A, ...
0, 'FLA_TOP' );
[ BL, BR ] = FLA_Part_1x2( B, ...
0, 'FLA_LEFT' );
while ( size( AT, 1 ) < size( A, 1 ) )
[ A0, ...
a1t, ...
A2 ] = FLA_Repart_2x1_to_3x1( AT, ...
AB, ...
1, 'FLA_BOTTOM' );
[ B0, b1, B2 ]= FLA_Repart_1x2_to_1x3( BL, BR, ...
1, 'FLA_RIGHT' );
%------------------------------------------------------------%
b1 = laff_copy(a1t, b1); % laff_copy copies vector a1t into vector b1
%------------------------------------------------------------%
[ AT, ...
AB ] = FLA_Cont_with_3x1_to_2x1( A0, ...
a1t, ...
A2, ...
'FLA_TOP' );
[ BL, BR ] = FLA_Cont_with_1x3_to_1x2( B0, b1, B2, ...
'FLA_LEFT' );
end
B_out = [ BL, BR ];
return
% Test the function:
% A = randi([-2,2], 4, 3)
% B = randi([-1,9], 3, 4)
% Transpose_alternative_unb( A, B )