Beispiel #1
0
void ATL_rherkLN
(
   RC3_HERK_T                 * RTYP,
   const int                  N,
   const int                  K,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   const void                 * BETA,
   void                       * C,
   const int                  LDC,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rherkLN performs the following Hermitian rank-k operation
 *
 *    C := alpha * A * conjg( A' ) + beta * C,
 *
 * where alpha and beta are real scalars,  C is an n by n (lower) Hermi-
 * tian matrix and  A is an n by k matrix.
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        n1, n2;
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( n1 = N - RB ) <= 0 )
   { RTYP->Therk( N, K, ALPHA, A, LDA, BETA, C, LDC ); return; }

   n2 = N - ( n1 = RB + ( n1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rherkLN( RTYP, n1, K, ALPHA, A, LDA, BETA, C, LDC, RB );

   RTYP->Tgemm( n2, n1, K, ALPHA, Mrc3( A, n1, 0, LDA, size ), LDA,
                A, LDA, BETA, Mrc3( C, n1, 0, LDC, size ), LDC );

   ATL_rherkLN( RTYP, n2, K, ALPHA, Mrc3( A, n1, 0, LDA, size ), LDA,
                BETA, Mrc3( C, n1, n1, LDC, size ), LDC, RB );
/*
 * End of ATL_rherkLN
 */
}
Beispiel #2
0
void ATL_rsyrkUT
(
   RC3_SYRK_T                 * RTYP,
   const int                  N,
   const int                  K,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   const void                 * BETA,
   void                       * C,
   const int                  LDC,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rsyrkUT performs the following symmetric rank-k operation
 *
 *    C := alpha * A' * A + beta * C,
 *
 * where  alpha and beta  are scalars, C  is an n by n (upper) symmetric
 * matrix and A is an  k by n  matrix.
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        n1, n2;
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( n1 = N - RB ) <= 0 )
   { RTYP->Tsyrk( N, K, ALPHA, A, LDA, BETA, C, LDC ); return; }

   n2 = N - ( n1 = RB + ( n1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rsyrkUT( RTYP, n1, K, ALPHA, A, LDA, BETA, C, LDC, RB );

   RTYP->Tgemm( n1, n2, K, ALPHA, A, LDA, Mrc3( A, 0, n1, LDA, size ),
                LDA, BETA, Mrc3( C, 0, n1, LDC, size ), LDC );

   ATL_rsyrkUT( RTYP, n2, K, ALPHA, Mrc3( A, 0, n1, LDA, size ), LDA,
                BETA, Mrc3( C, n1, n1, LDC, size ), LDC, RB );
/*
 * End of ATL_rsyrkUT
 */
}
Beispiel #3
0
void ATL_rtrmmRLC
(
   RC3_TRMM_T                 * RTYP,
   const int                  M,
   const int                  N,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   void                       * B,
   const int                  LDB,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rtrmmRLC performs the following matrix-matrix operation
 *
 *    B := alpha * B * conjg( A' ),
 *
 * where alpha is a scalar, B is an m by n matrix, A is a unit,  or non-
 * unit, lower triangular matrix.
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        n1, n2;
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( n1 = N - RB ) <= 0 )
   { RTYP->Ttrmm( M, N, ALPHA, A, LDA, B, LDB ); return; }

   n2 = N - ( n1 = RB + ( n1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rtrmmRLC( RTYP, M, n2, ALPHA, Mrc3( A, n1, n1, LDA, size ),
                 LDA, Mrc3( B, 0, n1, LDB, size ), LDB, RB );

   RTYP->Tgemm( M, n2, n1, ALPHA, B, LDB, Mrc3( A, n1, 0, LDA, size ),
                LDA, RTYP->one, Mrc3( B, 0, n1, LDB, size ), LDB );

   ATL_rtrmmRLC( RTYP, M, n1, ALPHA, A, LDA, B, LDB, RB );
/*
 * End of ATL_rtrmmRLC
 */
}
Beispiel #4
0
void ATL_rtrsmLUT
(
   RC3_TRSM_T                 * RTYP,
   const int                  M,
   const int                  N,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   void                       * B,
   const int                  LDB,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rtrsmLUT solves the matrix equation
 *
 *    A' * X = alpha * B,
 *
 * where alpha is a scalar, X and B are m by n matrices, A is a unit, or
 * non-unit, upper triangular matrix. The matrix X is overwritten on B.
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        m1, m2;
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( m1 = M - RB ) <= 0 )
   { RTYP->Ttrsm( M, N, ALPHA, A, LDA, B, LDB ); return; }

   m2 = M - ( m1 = RB + ( m1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rtrsmLUT( RTYP, m1, N, ALPHA, A, LDA, B, LDB, RB );

   RTYP->Tgemm( m2, N, m1, RTYP->negone, Mrc3( A, 0, m1, LDA, size ),
                LDA, B, LDB, ALPHA, Mrc3( B, m1, 0, LDB, size ), LDB );

   ATL_rtrsmLUT( RTYP, m2, N, RTYP->one, Mrc3( A, m1, m1, LDA, size ),
                 LDA, Mrc3( B, m1, 0, LDB, size ), LDB, RB );
/*
 * End of ATL_rtrsmLUT
 */
}
Beispiel #5
0
void ATL_rtrsmRLT
(
   RC3_TRSM_T                 * RTYP,
   const int                  M,
   const int                  N,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   void                       * B,
   const int                  LDB,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rtrsmRLT solves the matrix equation
 *
 *    X * A' = alpha * B,
 *
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        n1, n2;
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( n1 = N - RB ) <= 0 )
   { RTYP->Ttrsm( M, N, ALPHA, A, LDA, B, LDB ); return; }

   n2 = N - ( n1 = RB + ( n1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rtrsmRLT( RTYP, M, n1, ALPHA, A, LDA, B, LDB, RB );

   RTYP->Tgemm( M, n2, n1, RTYP->negone, B, LDB, Mrc3( A, n1, 0, LDA,
                size ), LDA, ALPHA, Mrc3( B, 0, n1, LDB, size ), LDB );

   ATL_rtrsmRLT( RTYP, M, n2, RTYP->one, Mrc3( A, n1, n1, LDA, size ),
                 LDA, Mrc3( B, 0, n1, LDB, size ), LDB, RB );
/*
 * End of ATL_rtrsmRLT
 */
}
Beispiel #6
0
void ATL_rtrsmRLN
(
   RC3_TRSM_T                 * RTYP,
   const int                  M,
   const int                  N,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   void                       * B,
   const int                  LDB,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rtrsmRLN solves the matrix equation
 *
 *    X * A = alpha * B,
 *
 * where alpha is a scalar, X and B are m by n matrices, A is a unit, or
 * non-unit, lower triangular matrix. The matrix X is overwritten on B.
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        n1, n2;
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( n1 = N - RB ) <= 0 )
   { RTYP->Ttrsm( M, N, ALPHA, A, LDA, B, LDB ); return; }

   n2 = N - ( n1 = RB + ( n1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rtrsmRLN( RTYP, M, n2, ALPHA, Mrc3( A, n1, n1, LDA, size ),
                 LDA, Mrc3( B, 0, n1, LDB, size ), LDB, RB );
   RTYP->Tgemm( M, n1, n2, RTYP->negone, Mrc3( B, 0, n1, LDB, size ),
                LDB, Mrc3( A, n1, 0, LDA, size ), LDA, ALPHA, B, LDB );
   ATL_rtrsmRLN( RTYP, M, n1, RTYP->one, A, LDA, B, LDB, RB );
/*
 * End of ATL_rtrsmRLN
 */
}
Beispiel #7
0
void ATL_rhemmLL
(
   RC3_HEMM_T                 * RTYP,
   const int                  M,
   const int                  N,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   const void                 * B,
   const int                  LDB,
   const void                 * BETA,
   void                       * C,
   const int                  LDC,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rhemmLL performs the following matrix-matrix operation
 *
 *    C := alpha * A * B + beta * C,
 *
 * where alpha and beta are scalars, A is a (lower) Hermitian matrix and
 * B and C are m by n matrices.
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        m1, m2;
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( m1 = M - RB ) <= 0 )
   { RTYP->Themm( M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC ); return; }

   m2 = M - ( m1 = RB + ( m1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rhemmLL( RTYP, m1, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC, RB );

   RTYP->TgemmNN( m2, N, m1, ALPHA, Mrc3( A, m1, 0, LDA, size ), LDA, B,
                  LDB, BETA, Mrc3( C, m1, 0, LDC, size ), LDC );

   RTYP->Tgemm( m1, N, m2, ALPHA, Mrc3( A, m1, 0, LDA, size ), LDA,
                Mrc3( B, m1, 0, LDB, size ), LDB, RTYP->one, C, LDC );

   ATL_rhemmLL( RTYP, m2, N, ALPHA, Mrc3( A, m1, m1, LDA, size ), LDA,
                Mrc3( B, m1, 0, LDB, size ), LDB, RTYP->one, Mrc3( C,
                m1, 0, LDC, size ), LDC, RB );
/*
 * End of ATL_rhemmLL
 */
}
Beispiel #8
0
void ATL_rsymmRU
(
   RC3_SYMM_T                 * RTYP,
   const int                  M,
   const int                  N,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   const void                 * B,
   const int                  LDB,
   const void                 * BETA,
   void                       * C,
   const int                  LDC,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rsymmRU performs the following matrix-matrix operation
 *
 *    C := alpha * B * A + beta * C,
 *
 * where alpha and beta are scalars, A is a (upper) symmetric matrix and
 * B and C are m by n matrices.
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        n1, n2;
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( n1 = N - RB ) <= 0 )
   { RTYP->Tsymm( M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC ); return; }

   n2 = N - ( n1 = RB + ( n1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rsymmRU( RTYP, M, n1, ALPHA, A, LDA, B, LDB, BETA, C, LDC, RB );

   RTYP->TgemmNN( M, n2, n1, ALPHA, B, LDB, Mrc3( A, 0, n1, LDA, size ),
                  LDA, BETA, Mrc3( C, 0, n1, LDC, size ), LDC );

   RTYP->Tgemm( M, n1, n2, ALPHA, Mrc3( B, 0, n1, LDB, size ), LDB,
                Mrc3( A, 0, n1, LDA, size ), LDA, RTYP->one, C, LDC );

   ATL_rsymmRU( RTYP, M, n2, ALPHA, Mrc3( A, n1, n1, LDA, size ), LDA,
                Mrc3( B, 0, n1, LDB, size ), LDB, RTYP->one, Mrc3( C,
                0, n1, LDC, size ), LDC, RB );
/*
 * End of ATL_rsymmRU
 */
}
Beispiel #9
0
void ATL_rsyr2kUN
(
   RC3_SYR2K_T                * RTYP,
   const int                  N,
   const int                  K,
   const void                 * ALPHA,
   const void                 * A,
   const int                  LDA,
   const void                 * B,
   const int                  LDB,
   const void                 * BETA,
   void                       * C,
   const int                  LDC,
   const int                  RB
)
{
/*
 * Purpose
 * =======
 *
 * ATL_rsyr2kUN performs the following symmetric rank-2k operation
 *
 *    C := alpha * A * B' + alpha * B * A' + beta * C,
 *
 * where  alpha and beta  are scalars,  C is an n by n (upper) symmetric
 * matrix and A and B are n by k matrices.
 *
 * This is a type-less recursive version of the algorithm.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   size_t                     size;
   int                        n1, n2;
/* ..
 * .. Executable Statements ..
 *
 */
#ifndef SYR2K_REC
   if( !RTYP->Tsyr2k( N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC ) ) return;
#endif
   if( ( n1 = N - RB ) <= 0 )
   {
      ATL_assert( RTYP->Tsyr2k( N, K, ALPHA, A, LDA, B, LDB, BETA,
                                C, LDC ) == 0 );
      return;
   }

   n2 = N - ( n1 = RB + ( n1 / ( RB << 1 ) ) * RB ); size = RTYP->size;

   ATL_rsyr2kUN( RTYP, n1, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC, RB );

   RTYP->Tgemm( n1, n2, K, ALPHA, A, LDA, Mrc3( B, n1, 0, LDB, size ),
                LDB, BETA,      Mrc3( C, 0, n1, LDC, size ), LDC );

   RTYP->Tgemm( n1, n2, K, ALPHA, B, LDB, Mrc3( A, n1, 0, LDA, size ),
                LDA, RTYP->one, Mrc3( C, 0, n1, LDC, size ), LDC );

   ATL_rsyr2kUN( RTYP, n2, K, ALPHA, Mrc3( A, n1, 0, LDA, size ), LDA,
                 Mrc3( B, n1, 0, LDB, size ), LDB, BETA, Mrc3( C, n1,
                 n1, LDC, size ), LDC, RB );
/*
 * End of ATL_rsyr2kUN
 */
}