void Mjoin( PATL, tbmvLT ) ( const enum ATLAS_DIAG DIAG, const int N, /* N > 0 assumed */ const int K, const TYPE * A, const int LDA, TYPE * X ) { /* * Purpose * ======= * * Mjoin( PATL, tbmvLT ) performs the following matrix-vector operation * * x := A'* x, * * where x is an n-element vector and A is an n by n unit or non-unit, * lower triangular band matrix. * * This is a blocked version of the algorithm. For a more detailed des- * cription of the arguments of this function, see the reference imple- * mentation in the ATLAS/src/blas/reference directory. * * --------------------------------------------------------------------- */ /* * .. Local Variables .. */ #ifdef TREAL #define lda2 LDA #define one ATL_rone #else TYPE one[2] = { ATL_rone, ATL_rzero }; const int lda2 = ( LDA SHIFT ); #endif int ja, jan, kl, ku, ma, mb, mb1, na, nb; void (*tbmv0)( const int, const int, const TYPE *, const int, TYPE * ); #define gbmv0 Mjoin( PATL, gbmvT_a1_x1_b1_y1 ) /* .. * .. Executable Statements .. * */ ATL_GetPartMVT( A, LDA, &mb, &nb ); if( DIAG == AtlasNonUnit ) tbmv0 = Mjoin( PATL, tbmvLTN ); else tbmv0 = Mjoin( PATL, tbmvLTU ); mb1 = N - ( ( N - 1 ) / mb ) * mb; tbmv0( mb1, K, A, LDA, X ); for( jan = mb1; jan < N; jan += mb ) { ja = jan - K; ja = Mmax( ja, 0 ); ma = Mmin( mb, K ); ku = na = jan - ja; kl = K - ku; kl = Mmax( kl, 0 ); gbmv0( na, ma, kl, ku, one, A+ja*lda2, LDA, X+(jan SHIFT), 1, one, X+(ja SHIFT), 1 ); tbmv0( mb, K, A+jan*lda2, LDA, X+(jan SHIFT) ); } /* * End of Mjoin( PATL, tbmvLT ) */ }
void Mjoin( PATL, tbmvUC ) ( const enum ATLAS_DIAG DIAG, const int N, /* N > 0 assumed */ const int K, const TYPE * A, const int LDA, TYPE * X ) { /* * Purpose * ======= * * Mjoin( PATL, tbmvUC ) performs the following matrix-vector operation * * x := conjg( A ) * x, * * where x is an n-element vector and A is an n by n unit or non-unit, * upper triangular band matrix. * * This is a blocked version of the algorithm. For a more detailed des- * cription of the arguments of this function, see the reference imple- * mentation in the ATLAS/src/blas/reference directory. * * --------------------------------------------------------------------- */ /* * .. Local Variables .. */ void (*tbmv0)( const int, const int, const TYPE *, const int, TYPE * ); #ifdef TREAL #define one ATL_rone #define lda2 LDA #else const int lda2 = ( LDA SHIFT ); TYPE one[2] = { ATL_rone, ATL_rzero }; #endif #ifdef ATL_AXPYMV int ia, ian, j, kl, ku, ma, mb, mb1, n, na, nb; #else int ia, ian, kl, ku, ma, mb, na, nb, nb1; #endif #define gbmv0 Mjoin( PATL, gbmvNc_a1_x1_b1_y1 ) /* .. * .. Executable Statements .. * */ ATL_GetPartMVN( A, LDA, &mb, &nb ); if( DIAG == AtlasNonUnit ) tbmv0 = Mjoin( PATL, tbmvUCN ); else tbmv0 = Mjoin( PATL, tbmvUCU ); #ifdef ATL_AXPYMV mb1 = N - ( ( N - 1 ) / mb ) * mb; for( n = N - mb, j = 0; n > 0; n -= mb, j += mb ) { ian = j + mb; ia = mb - K; ia = j + Mmax( ia, 0 ); ma = ian - ia; na = N - ian; na = Mmin( na, K ); kl = ma - 1; kl = Mmax( kl, 0 ); ku = K - 1 - kl; ku = Mmax( ku, 0 ); tbmv0( mb, K, A+j*lda2, LDA, X+(j SHIFT) ); gbmv0( ma, na, kl, ku, one, A+ian*lda2, LDA, X+(ian SHIFT), 1, one, X+(ia SHIFT), 1 ); } tbmv0( mb1, K, A+j*lda2, LDA, X+(j SHIFT) ); #else nb1 = N - ( ( N - 1 ) / nb ) * nb; tbmv0( nb1, K, A, LDA, X ); for( ian = nb1; ian < N; ian += nb ) { ia = ian - K; ia = Mmax( ia, 0 ); ma = ian - ia; na = Mmin( nb, K ); kl = ma - 1; kl = Mmax( kl, 0 ); ku = K - 1 - kl; ku = Mmax( ku, 0 ); gbmv0( ma, na, kl, ku, one, A+ian*lda2, LDA, X+(ian SHIFT), 1, one, X+(ia SHIFT), 1 ); tbmv0( nb, K, A+ian*lda2, LDA, X+(ian SHIFT) ); } #endif /* * End of Mjoin( PATL, tbmvUC ) */ }