Ejemplo n.º 1
0
void ATL_zrefgbmvT
(
   const int                  M,
   const int                  N,
   const int                  KL,
   const int                  KU,
   const double               * ALPHA,
   const double               * A,
   const int                  LDA,
   const double               * X,
   const int                  INCX,
   const double               * BETA,
   double                     * Y,
   const int                  INCY
)
{
/*
 * Purpose
 * =======
 *
 * ATL_zrefgbmvT( ... ) <=> ATL_zrefgbmv( AtlasTrans, ... )
 *
 * See ATL_zrefgbmv for details.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   register double            t0_i, t0_r;
   int                        i, i0, i1, iaij, ix, j, jaj, jy, k, kx=0, ky=0;
   int                        incx2 = 2 * INCX, incy2 = 2 * INCY,
                              lda2 = ( LDA << 1 );
/* ..
 * .. Executable Statements ..
 *
 */
   for( j = 0, jaj = 0, jy = ky; j < M; j++, jaj += lda2, jy += incy2 )
   {
      Mset( ATL_dZERO, ATL_dZERO, t0_r, t0_i );
      k = KU - j; i0 = ( j - KU > 0 ? j - KU : 0 );
      i1 = ( N - 1 > j + KL ? j + KL : N - 1 );

      for( i  = i0,      iaij  = ((k+i0) << 1)+jaj, ix  = kx;
           i <= i1; i++, iaij += 2,                 ix += incx2 )
      { Mmla( A[iaij],  A[iaij+1], X[ix], X[ix+1], t0_r, t0_i ); }
      Mzelscal( BETA[0], BETA[1], Y[jy], Y[jy+1] );
      Mmla( ALPHA[0], ALPHA[1], t0_r, t0_i, Y[jy], Y[jy+1] );
      if( j >= KU ) kx += incx2;
   }
/*
 * End of ATL_zrefgbmvT
 */
}
Ejemplo n.º 2
0
void ATL_zrefsyrkLT
(
   const int                  N,
   const int                  K,
   const double               * ALPHA,
   const double               * A,
   const int                  LDA,
   const double               * BETA,
   double                     * C,
   const int                  LDC
)
{
/*
 * Purpose
 * =======
 *
 * ATL_zrefsyrkLT( ... )
 *
 * <=>
 *
 * ATL_zrefsyrk( AtlasLower, AtlasTrans, ... )
 *
 * See ATL_zrefsyrk for details.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   register double            t0_i, t0_r;
   int                        i, iali, ialj, icij, j, jai, jaj, jcj, l,
                              lda2 = ( LDA << 1 ), ldc2 = ( LDC << 1 );
/* ..
 * .. Executable Statements ..
 *
 */
   for( j = 0, jaj = 0, jcj = 0; j < N; j++, jaj += lda2, jcj += ldc2 )
   {
      for( i = j,      jai  = j*lda2, icij  = (j << 1)+jcj;
           i < N; i++, jai += lda2,   icij += 2 )
      {
         Mset( ATL_dZERO, ATL_dZERO, t0_r, t0_i );
         for( l = 0, iali = jai, ialj = jaj; l < K; l++, iali += 2, ialj += 2 )
         { Mmla( A[iali], A[iali+1], A[ialj], A[ialj+1], t0_r, t0_i ); }
         Mzelscal( BETA[0], BETA[1], C[icij], C[icij+1] );
         Mmla( ALPHA[0], ALPHA[1], t0_r, t0_i, C[icij], C[icij+1] );
      }
   }
/*
 * End of ATL_zrefsyrkLT
 */
}
Ejemplo n.º 3
0
void ATL_zrefgpmvUT
(
   const int                  M,
   const int                  N,
   const double               * ALPHA,
   const double               * A,
   const int                  LDA,
   const double               * X,
   const int                  INCX,
   const double               * BETA,
   double                     * Y,
   const int                  INCY
)
{
/*
 * Purpose
 * =======
 *
 * ATL_zrefgpmvLT( ... )
 *
 * <=>
 *
 * ATL_zrefgpmv( AtlasUpper, AtlasTrans, ... )
 *
 * See ATL_zrefgpmv for details.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   register double            t0_i, t0_r;
   int                        i, iaij, incx2 = 2 * INCX, incy2 = 2 * INCY,
                              ix, j, jaj, jy, lda2 = ( LDA << 1 );
/* ..
 * .. Executable Statements ..
 *
 */
   for( j = 0, jaj = 0, jy = 0; j < M; j++, jy += incy2 )
   {
      Mset( ATL_dZERO, ATL_dZERO, t0_r, t0_i );
      for( i = 0, iaij = jaj, ix = 0; i < N; i++, iaij += 2, ix += incx2 )
      { Mmla( A[iaij],  A[iaij+1], X[ix], X[ix+1], t0_r, t0_i ); }
      Mzelscal( BETA[0], BETA[1], Y[jy], Y[jy+1] );
      Mmla( ALPHA[0], ALPHA[1], t0_r, t0_i, Y[jy], Y[jy+1] );
      jaj += lda2; lda2 += 2;
   }
/*
 * End of ATL_zrefgpmvUT
 */
}
Ejemplo n.º 4
0
void ATL_zrefgemmCC
(
   const int                  M,
   const int                  N,
   const int                  K,
   const double               * ALPHA,
   const double               * A,
   const int                  LDA,
   const double               * B,
   const int                  LDB,
   const double               * BETA,
   double                     * C,
   const int                  LDC
)
{
/*
 * .. Local Variables ..
 */
   register double            t0_i, t0_r;
   int                        i, iali, ibj, ibjl, icij, j, jai, jcj, l,
                              lda2 = ( LDA << 1 ), ldb2 = ( LDB << 1 ),
                              ldc2 = ( LDC << 1 );
/* ..
 * .. Executable Statements ..
 *
 */
   for( j = 0, ibj = 0, jcj = 0; j < N; j++, ibj += 2, jcj += ldc2 )
   {
      for( i = 0, icij = jcj, jai = 0; i < M; i++, icij += 2, jai += lda2 )
      {
         Mset( ATL_dZERO, ATL_dZERO, t0_r, t0_i );
         for( l = 0,      iali  = jai, ibjl  = ibj;
              l < K; l++, iali += 2,   ibjl += ldb2 )
         { Mmla( A[iali], -A[iali+1], B[ibjl], -B[ibjl+1], t0_r, t0_i ); }
         Mzelscal( BETA[0], BETA[1], C[icij], C[icij+1] );
         Mmla( ALPHA[0], ALPHA[1], t0_r, t0_i, C[icij], C[icij+1] );
      }
   }
/*
 * End of ATL_zrefgemmCC
 */
}
Ejemplo n.º 5
0
void ATL_zrefsymmLU
(
   const int                  M,
   const int                  N,
   const double               * ALPHA,
   const double               * A,
   const int                  LDA,
   const double               * B,
   const int                  LDB,
   const double               * BETA,
   double                     * C,
   const int                  LDC
)
{
/*
 * Purpose
 * =======
 *
 * ATL_zrefsymmLU( ... )
 *
 * <=>
 *
 * ATL_zrefsymm( AtlasLeft, AtlasUpper, ... )
 *
 * See ATL_zrefsymm for details.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   register double            t0_i, t0_r, t1_i, t1_r;
   int                        i, iaki, ibij, ibkj, icij, ickj, j, jai,
                              jbj, jcj, k, lda2 = ( LDA << 1 ),
                              ldb2 = ( LDB << 1 ), ldc2 = ( LDC << 1 );
/* ..
 * .. Executable Statements ..
 *
 */
   for( j = 0, jbj = 0, jcj = 0; j < N; j++, jbj += ldb2, jcj += ldc2 )
   {
      for( i = 0,      jai  = 0,    ibij  = jbj, icij  = jcj;
           i < M; i++, jai += lda2, ibij += 2,   icij += 2 )
      {
         Mmul( ALPHA[0], ALPHA[1], B[ibij], B[ibij+1], t0_r, t0_i );
         Mset( ATL_dZERO, ATL_dZERO, t1_r, t1_i );
         for( k = 0,      iaki  = jai, ibkj  = jbj, ickj  = jcj;
              k < i; k++, iaki += 2,   ibkj += 2,   ickj += 2 )
         {
            Mmla( A[iaki], A[iaki+1], t0_r, t0_i, C[ickj], C[ickj+1] );
            Mmla( B[ibkj], B[ibkj+1], A[iaki], A[iaki+1], t1_r, t1_i );
         }
         Mzelscal( BETA[0], BETA[1], C[icij], C[icij+1] );
         k = ( i << 1 ) + jai;
         Mmla( t0_r, t0_i, A[k], A[k+1], C[icij], C[icij+1] );
         Mmla( ALPHA[0], ALPHA[1], t1_r, t1_i, C[icij], C[icij+1] );
      }
   }
/*
 * End of ATL_zrefsymmLU
 */
}
Ejemplo n.º 6
0
void ATL_zrefhemmRU
(
   const int                  M,
   const int                  N,
   const double               * ALPHA,
   const double               * A,
   const int                  LDA,
   const double               * B,
   const int                  LDB,
   const double               * BETA,
   double                     * C,
   const int                  LDC
)
{
/*
 * Purpose
 * =======
 *
 * ATL_zrefhemmRU( ... )
 *
 * <=>
 *
 * ATL_zrefhemm( AtlasRight, AtlasUpper, ... )
 *
 * See ATL_zrefhemm for details.
 *
 * ---------------------------------------------------------------------
 */
/*
 * .. Local Variables ..
 */
   register double            t0_i, t0_r;
   int                        i, iaj, iajk, iakj, ibij, ibik, icij, j,
                              jaj, jbj, jbk, jcj, k, lda2 = ( LDA << 1 ),
                              ldb2 = ( LDB << 1 ), ldc2 = ( LDC << 1 );
/* ..
 * .. Executable Statements ..
 *
 */
   for( j = 0,      iaj  = 0, jaj  = 0,    jbj  = 0,    jcj  = 0;
        j < N; j++, iaj += 2, jaj += lda2, jbj += ldb2, jcj += ldc2 )
   {
      i = ( j << 1 ) + jaj;
      Mset( ALPHA[0] * A[i], ALPHA[1] * A[i], t0_r, t0_i );
      for( i = 0, ibij = jbj, icij = jcj; i < M; i++, ibij += 2, icij += 2 )
      {
         Mzelscal( BETA[0], BETA[1], C[icij], C[icij+1] );
         Mmla( t0_r, t0_i, B[ibij], B[ibij+1], C[icij], C[icij+1] );
      }
      for( k = 0, iakj = jaj, jbk = 0; k < j; k++, iakj += 2, jbk += ldb2 )
      {
         Mmul( ALPHA[0], ALPHA[1], A[iakj], A[iakj+1], t0_r, t0_i );
         for( i = 0,      ibik  = jbk, icij  = jcj;
              i < M; i++, ibik += 2,   icij += 2 )
         { Mmla( t0_r, t0_i, B[ibik], B[ibik+1], C[icij], C[icij+1] ); }
      }
      for( k = j+1,    iajk  = iaj+(j+1)*lda2, jbk  = (j+1)*ldb2;
           k < N; k++, iajk += lda2,           jbk += ldb2 )
      {
         Mmul( ALPHA[0], ALPHA[1], A[iajk], -A[iajk+1], t0_r, t0_i );
         for( i = 0, ibik = jbk, icij = jcj; i < M; i++, ibik += 2, icij += 2 )
         { Mmla( t0_r, t0_i, B[ibik], B[ibik+1], C[icij], C[icij+1] ); }
      }
   }
/*
 * End of ATL_zrefhemmRU
 */
}