Debian Codegraph @

src/blas/3/syr2k/un/flamec/FLA_Syr2k_un_unb_var3.c

raw
1 /*
2
3 Copyright (C) 2014, The University of Texas at Austin
4
5 This file is part of libflame and is available under the 3-Clause
6 BSD license, which can be found in the LICENSE file at the top-level
7 directory, or at http://opensource.org/licenses/BSD-3-Clause
8
9 */
10
11 #include "FLAME.h"
12
13 FLA_Error FLA_Syr2k_un_unb_var3( FLA_Obj alpha, FLA_Obj A, FLA_Obj B, FLA_Obj beta, FLA_Obj C )
14 {
15 FLA_Obj AT, A0,
16 AB, a1t,
17 A2;
18
19 FLA_Obj BT, B0,
20 BB, b1t,
21 B2;
22
23 FLA_Obj CTL, CTR, C00, c01, C02,
24 CBL, CBR, c10t, gamma11, c12t,
25 C20, c21, C22;
26
27
28 FLA_Scalr_external( FLA_UPPER_TRIANGULAR, beta, C );
29
30 FLA_Part_2x1( A, &AT,
31 &AB, 0, FLA_TOP );
32
33 FLA_Part_2x1( B, &BT,
34 &BB, 0, FLA_TOP );
35
36 FLA_Part_2x2( C, &CTL, &CTR,
37 &CBL, &CBR, 0, 0, FLA_TL );
38
39 while ( FLA_Obj_length( AT ) < FLA_Obj_length( A ) ){
40
41
42 FLA_Repart_2x1_to_3x1( AT, &A0,
43 /* ** */ /* ** */
44 &a1t,
45 AB, &A2, 1, FLA_BOTTOM );
46
47 FLA_Repart_2x1_to_3x1( BT, &B0,
48 /* ** */ /* ** */
49 &b1t,
50 BB, &B2, 1, FLA_BOTTOM );
51
52 FLA_Repart_2x2_to_3x3( CTL, /**/ CTR, &C00, /**/ &c01, &C02,
53 /* ************* */ /* ************************** */
54 &c10t, /**/ &gamma11, &c12t,
55 CBL, /**/ CBR, &C20, /**/ &c21, &C22,
56 1, 1, FLA_BR );
57
58 /*------------------------------------------------------------*/
59
60 /* c01 = c01 + A0 * b1t' */
61 FLA_Gemv_external( FLA_NO_TRANSPOSE, alpha, A0, b1t, FLA_ONE, c01 );
62
63 /* c12t = c12t + b1t * A2' */
64 FLA_Gemv_external( FLA_NO_TRANSPOSE, alpha, A2, b1t, FLA_ONE, c12t );
65
66 /* gamma11 = gamma11 + a1t * b1t' + b1t * a1t' */
67 FLA_Dot2s_external( alpha, a1t, b1t, FLA_ONE, gamma11 );
68
69 /*------------------------------------------------------------*/
70
71 FLA_Cont_with_3x1_to_2x1( &AT, A0,
72 a1t,
73 /* ** */ /* ** */
74 &AB, A2, FLA_TOP );
75
76 FLA_Cont_with_3x1_to_2x1( &BT, B0,
77 b1t,
78 /* ** */ /* ** */
79 &BB, B2, FLA_TOP );
80
81 FLA_Cont_with_3x3_to_2x2( &CTL, /**/ &CTR, C00, c01, /**/ C02,
82 c10t, gamma11, /**/ c12t,
83 /* ************** */ /* ************************ */
84 &CBL, /**/ &CBR, C20, c21, /**/ C22,
85 FLA_TL );
86
87 }
88
89 return FLA_SUCCESS;
90 }
91