示例#1
0
void ATL_zrefhpmv
(
   const enum ATLAS_UPLO      UPLO,
   const int                  N,
   const double               * ALPHA,
   const double               * A,
   const double               * X,
   const int                  INCX,
   const double               * BETA,
   double                     * Y,
   const int                  INCY
)
{
/*
 * Purpose
 * =======
 *
 * ATL_zrefhpmv performs the matrix-vector operation
 *
 *    y := alpha * A * x + beta * y,
 *
 * where alpha and beta are scalars, x and y are n-element vectors and A
 * is an n by n Hermitian matrix, supplied in packed form.
 *
 * Arguments
 * =========
 *
 * UPLO    (input)                       const enum ATLAS_UPLO
 *         On entry, UPLO  specifies whether the upper or lower triangu-
 *         lar part of the matrix A is supplied in the packed array A
 *         as follows:
 *
 *             UPLO = AtlasUpper   The upper triangular part of A is
 *                                 supplied in A.
 *
 *             UPLO = AtlasLower   The lower triangular part of A is
 *                                 supplied in A.
 *
 *         Unchanged on exit.
 *
 * N       (input)                       const int
 *         On entry, N specifies the order of the matrix A. N must be at
 *         least zero. Unchanged on exit.
 *
 * ALPHA   (input)                       const double *
 *         On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
 *         supplied as zero then  A and X  need not be set on input. Un-
 *         changed on exit.
 *
 * A       (input)                       const double *
 *         On entry,  A  points  to an array of size equal to or greater
 *         than   (( n*(n+1) ) / 2) * sizeof( double[2] ).  Before entry
 *         with UPLO = AtlasUpper, the array  A  must contain  the upper
 *         triangular  part of the Hermitian matrix packed sequentially,
 *         column by column, so that A[ 0 ] contains a(0,0), A[ 1 ]  and
 *         A[ 2 ] contain a(0,1) and a(1,1) respectively, and so on.
 *         Before entry with UPLO = AtlasLower, the array A must contain
 *         the lower triangular  part of the Hermitian matrix packed se-
 *         quentially, column by column, so that A[ 0 ] contains a(0,0),
 *         A[ 1 ] and A[ 2 ] contain a(1,0) and a(2,0) respectively, and
 *         so on. Unchanged on exit.
 *         Note that the  imaginary parts  of the local entries  corres-
 *         ponding to the diagonal elements of A need not be set and as-
 *         sumed to be zero. Unchanged on exit.
 *
 * X       (input)                       const double *
 *         On entry,  X  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( double[2] ),
 *         that contains the vector x. Unchanged on exit.
 *
 * INCX    (input)                       const int
 *         On entry, INCX specifies the increment for the elements of X.
 *         INCX must not be zero. Unchanged on exit.
 *
 * BETA    (input)                       const double *
 *         On entry,  BETA  specifies the scalar  beta.   When  BETA  is
 *         supplied as zero then Y  need not be set on input.  Unchanged
 *         on exit.
 *
 * Y       (input/output)                double *
 *         On entry,  Y  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( n - 1 ) * abs( INCY ) ) * sizeof( double[2] ),
 *         that contains the vector y.  Before entry with BETA non-zero,
 *         the incremented array  Y  must contain the vector y. On exit,
 *         Y is overwritten by the updated vector y.
 *
 * INCY    (input)                       const int
 *         On entry, INCY specifies the increment for the elements of Y.
 *         INCY must not be zero. Unchanged on exit.
 *
 * ---------------------------------------------------------------------
 */
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( N == 0 ) ||
       ( Mdzero( ALPHA[0], ALPHA[1] ) && Mdone( BETA[0], BETA[1] ) ) ) return;
   if( Mdzero( ALPHA[0], ALPHA[1] ) )
   { Mzvscal( N, BETA, Y, INCY ); return; }

   if( UPLO == AtlasUpper )
   {
      ATL_zrefhpmvU( N,    ALPHA, A, 1,   X, INCX, BETA, Y, INCY );
   }
   else
   {
      ATL_zrefhpmvL( N,    ALPHA, A, N,   X, INCX, BETA, Y, INCY );
   }
/*
 * End of ATL_zrefhpmv
 */
}
示例#2
0
void ATL_zrefgbmv
(
   const enum ATLAS_TRANS     TRANS,
   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_zrefgbmv performs one of the matrix-vector operations
 *
 *    y := alpha * op( A ) * x + beta * y,
 *
 * where op( X ) is one of
 *
 *    op( X ) = X   or   op( X ) = conjg( X  )   or
 *
 *    op( X ) = X'  or   op( X ) = conjg( X' ).
 *
 * where  alpha and beta are scalars, x and y are vectors and op( A ) is
 * an m by n band matrix, with kl sub-diagonals and ku super-diagonals.
 *
 * Arguments
 * =========
 *
 * TRANS   (input)                       const enum ATLAS_TRANS
 *         On entry,  TRANS  specifies the  operation to be performed as
 *         follows:
 *
 *            TRANS = AtlasNoTrans    y := alpha*A *x + beta*y,
 *
 *            TRANS = AtlasConj       y := alpha*conjg( A  )*x + beta*y,
 *
 *            TRANS = AtlasTrans      y := alpha*A'*x + beta*y,
 *
 *            TRANS = AtlasConjTrans  y := alpha*conjg( A' )*x + beta*y.
 *
 *         Unchanged on exit.
 *
 * M       (input)                       const int
 *         On entry,  M  specifies  the number of rows of  the matrix  A
 *         when TRANS = AtlasNoTrans or TRANS = AtlasConj,  and the num-
 *         ber of columns of the matrix  A otherwise. M must be at least
 *         zero. Unchanged on exit.
 *
 * N       (input)                       const int
 *         On entry, N  specifies  the number of columns of the matrix A
 *         when TRANS = AtlasNoTrans or TRANS = AtlasConj,  and the num-
 *         ber of rows of the matrix A otherwise. N must be at least ze-
 *         ro. Unchanged on exit.
 *
 * KL      (input)                       const int
 *         On entry, KL specifies the number of sub-diagonals of the ma-
 *         trix A. KL must satisfy 0 <= KL. Unchanged on exit.
 *
 * KU      (input)                       const int
 *         On entry, KU specifies the number of  super-diagonals of  the
 *         matrix A. KU must satisfy  0 <= KU. Unchanged on exit.
 *
 * ALPHA   (input)                       const double *
 *         On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
 *         supplied as zero then  A and X  need not be set on input. Un-
 *         changed on exit.
 *
 * A       (input)                       const double *
 *         On entry,  A  points  to an array of size equal to or greater
 *         than   LDA * ka * sizeof( double[2] ),  where  ka is  n  when
 *         TRANS = AtlasNotrans or TRANS = AtlasConj, and  m  otherwise.
 *         Before entry, the  leading ( kl + ku + 1 ) by ka  part of the
 *         array  A  must contain the matrix of  coefficients,  supplied
 *         column by column,  with the leading diagonal of the matrix in
 *         row ku of the array, the first super-diagonal starting at po-
 *         sition 1 in row ku-1,  the first sub-diagonal starting at po-
 *         sition 0 in row ku+1, and so on. Elements in the array A that
 *         do not correspond to elements in the band matrix (such as the
 *         top left ku by ku triangle) are not referenced.  Unchanged on
 *         exit.
 *
 *         The  following  program segment will transfer a real band ma-
 *         trix from conventional full matrix storage to band storage:
 *
 *            for( j = 0; j < n; j++ )
 *            {
 *               k  = ku - j; i1 = ( m > j + kl + 1 ? j + kl + 1 : m );
 *               for( i = ( k < 0 ? -k : 0 ); i < i1; i++ )
 *               {
 *                  a[((k+i+j*LDA)<<1)+0] = real( matrix( i, j ) );
 *                  a[((k+i+j*LDA)<<1)+1] = imag( matrix( i, j ) );
 *               }
 *            }
 *
 * LDA     (input)                       const int
 *         On entry, LDA  specifies the leading dimension of A as decla-
 *         red  in  the  calling (sub) program.  LDA  must  be  at least
 *         ( kl + ku + 1 ). Unchanged on exit.
 *
 * X       (input)                       const double *
 *         On entry,  X  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( double[2] ),
 *         that contains the vector x. Unchanged on exit.
 *
 * INCX    (input)                       const int
 *         On entry, INCX specifies the increment for the elements of X.
 *         INCX must not be zero. Unchanged on exit.
 *
 * BETA    (input)                       const double *
 *         On entry,  BETA  specifies the scalar  beta.   When  BETA  is
 *         supplied as zero then Y  need not be set on input.  Unchanged
 *         on exit.
 *
 * Y       (input/output)                double *
 *         On entry,  Y  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( m - 1 ) * abs( INCY ) ) * sizeof( double[2] ),
 *         that contains the vector y.  Before entry with BETA non-zero,
 *         the incremented array  Y  must contain the vector y. On exit,
 *         Y is overwritten by the updated vector y.
 *
 * INCY    (input)                       const int
 *         On entry, INCY specifies the increment for the elements of Y.
 *         INCY must not be zero. Unchanged on exit.
 *
 * ---------------------------------------------------------------------
 */
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( M == 0 ) || ( N == 0 ) ||
       ( Mdzero( ALPHA[0], ALPHA[1] ) && Mdone( BETA[0], BETA[1] ) ) )
      return;

   if( Mdzero( ALPHA[0], ALPHA[1] ) )
   { Mzvscal( M, BETA, Y, INCY ); return; }

   if(      TRANS == AtlasNoTrans )
   {
      ATL_zrefgbmvN( M, N, KL, KU, ALPHA, A, LDA, X, INCX, BETA, Y, INCY );
   }
   else if( TRANS == AtlasConj    )
   {
      ATL_zrefgbmvC( M, N, KL, KU, ALPHA, A, LDA, X, INCX, BETA, Y, INCY );
   }
   else if( TRANS == AtlasTrans   )
   {
      ATL_zrefgbmvT( M, N, KL, KU, ALPHA, A, LDA, X, INCX, BETA, Y, INCY );
   }
   else
   {
      ATL_zrefgbmvH( M, N, KL, KU, ALPHA, A, LDA, X, INCX, BETA, Y, INCY );
   }
/*
 * End of ATL_zrefgbmv
 */
}
示例#3
0
void ATL_zrefsymm
(
    const enum ATLAS_SIDE      SIDE,
    const enum ATLAS_UPLO      UPLO,
    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_zrefsymm  performs one of the matrix-matrix operations
     *
     *    C := alpha * A * B + beta * C,
     *
     * or
     *
     *    C := alpha * B * A + beta * C,
     *
     * where alpha and beta are scalars,  A is a symmetric matrix and B and
     * C are m by n matrices.
     *
     * Arguments
     * =========
     *
     * SIDE    (input)                       const enum ATLAS_SIDE
     *         On entry,  SIDE  specifies  whether the  symmetric  matrix  A
     *         appears  on  the left or right in the operation as follows:
     *
     *            SIDE = AtlasLeft     C := alpha * A * B + beta * C,
     *
     *            SIDE = AtlasRight    C := alpha * B * A + beta * C.
     *
     *         Unchanged on exit.
     *
     * UPLO    (input)                       const enum ATLAS_UPLO
     *         On entry, UPLO  specifies whether the upper or lower triangu-
     *         lar part of the array A is to be referenced as follows:
     *
     *             UPLO = AtlasUpper   Only the upper triangular part of A
     *                                 is to be referenced.
     *
     *             UPLO = AtlasLower   Only the lower triangular part of A
     *                                 is to be referenced.
     *
     *         Unchanged on exit.
     *
     * M       (input)                       const int
     *         On entry,  M  specifies  the number  of rows of the matrix C.
     *         M  must be at least zero. Unchanged on exit.
     *
     * N       (input)                       const int
     *         On entry, N  specifies the number of columns of the matrix C.
     *         N must be at least zero. Unchanged on exit.
     *
     * ALPHA   (input)                       const double *
     *         On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
     *         supplied  as  zero  then the elements of the matrices A and B
     *         need not be set on input.
     *
     * A       (input)                       const double *
     *         On entry,  A  points  to an array of size equal to or greater
     *         than   LDA * ka * sizeof( double[2] ),  where ka  is  m  when
     *         SIDE = AtlasLeft   and is  n  otherwise.  Before  entry  with
     *         SIDE = AtlasLeft, the  m by m  part of the  array A must con-
     *         tain the symmetric matrix, such that when  UPLO = AtlasUpper,
     *         the leading m by m upper triangular part of the array A  must
     *         contain the upper triangular part of the symmetric matrix and
     *         the  strictly lower triangular part of  A  is not referenced,
     *         and when  UPLO = AtlasLower, the  leading m by m lower trian-
     *         gular part of the array A must contain the  lower  triangular
     *         part of the symmetric matrix and the  strictly upper triangu-
     *         lar part of  A  is not referenced.
     *         Before  entry  with  SIDE = AtlasRight,  the  n by n  part of
     *         the  array  A  must contain the  symmetric matrix,  such that
     *         when  UPLO = AtlasUpper, the  leading n by n upper triangular
     *         part of the array  A  must  contain the upper triangular part
     *         of the  symmetric matrix  and the  strictly  lower triangular
     *         part of  A  is not  referenced,  and when  UPLO = AtlasLower,
     *         the leading  n by n  lower  triangular part  of the  array  A
     *         must  contain  the  lower  triangular part  of the  symmetric
     *         matrix and the  strictly  upper triangular part of  A  is not
     *         referenced. Unchanged on exit.
     *
     * LDA     (input)                       const int
     *         On entry, LDA  specifies the leading dimension of A as decla-
     *         red  in  the  calling  (sub) program.  LDA  must be  at least
     *         MAX( 1, m ) when SIDE = AtlasLeft, and MAX( 1, n ) otherwise.
     *         Unchanged on exit.
     *
     * B       (input)                       const double *
     *         On entry,  B  points  to an array of size equal to or greater
     *         than   LDB * n * sizeof( double[2] ).  Before entry, the lea-
     *         ding m by n  part of the array  B  must contain the matrix B.
     *         Unchanged on exit.
     *
     * LDB     (input)                       const int
     *         On entry, LDB  specifies the leading dimension of B as decla-
     *         red  in  the  calling  (sub) program.  LDB  must be  at least
     *         MAX( 1, m ). wise. Unchanged on exit.
     *
     * BETA    (input)                       const double *
     *         On entry,  BETA  specifies the scalar  beta.   When  BETA  is
     *         supplied  as  zero  then  the  elements of the matrix C  need
     *         not be set on input. Unchanged on exit.
     *
     * C       (input/output)                double *
     *         On entry,  C  points  to an array of size equal to or greater
     *         than   LDC * n * sizeof( double[2] ).  Before entry, the lea-
     *         ding m by n part of the array  C  must contain the matrix  C,
     *         except when beta is zero,  in which case C need not be set on
     *         entry.  On exit, the array C is overwritten by the m by n up-
     *         dated matrix.
     *
     * LDC     (input)                       const int
     *         On entry, LDC  specifies the leading dimension of A as decla-
     *         red  in  the  calling  (sub) program.  LDC  must be  at least
     *         MAX( 1, m ). Unchanged on exit.
     *
     * ---------------------------------------------------------------------
     */
    /* ..
     * .. Executable Statements ..
     *
     */
    if( ( M == 0 ) || ( N == 0 ) || ( Mdzero( ALPHA[0], ALPHA[1] ) &&
                                      Mdone ( BETA [0], BETA [1] ) ) ) return;

    if( Mdzero( ALPHA[0], ALPHA[1] ) )
    {
        Mzgescal( M, N, BETA, C, LDC );
        return;
    }

    if( SIDE == AtlasLeft )
    {
        if( UPLO == AtlasUpper )
        {
            ATL_zrefsymmLU( M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC );
        }
        else
        {
            ATL_zrefsymmLL( M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC );
        }
    }
    else
    {
        if( UPLO == AtlasUpper )
        {
            ATL_zrefsymmRU( M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC );
        }
        else
        {
            ATL_zrefsymmRL( M, N, ALPHA, A, LDA, B, LDB, BETA, C, LDC );
        }
    }
    /*
     * End of ATL_zrefsymm
     */
}
示例#4
0
void ATL_zrefgemv
(
   const enum ATLAS_TRANS     TRANS,
   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_zrefgemv performs one of the matrix-vector operations
 *
 *    y := alpha * op( A ) * x + beta * y,
 *
 * where op( X ) is one of
 *
 *    op( X ) = X   or   op( X ) = conjg( X  )   or
 *
 *    op( X ) = X'  or   op( X ) = conjg( X' ).
 *
 * where  alpha and beta are scalars, x and y are vectors and op( A ) is
 * an m by n matrix.
 *
 * Arguments
 * =========
 *
 * TRANS   (input)                       const enum ATLAS_TRANS
 *         On entry,  TRANS  specifies the  operation to be performed as
 *         follows:
 *
 *            TRANS = AtlasNoTrans    y := alpha*A *x + beta*y,
 *
 *            TRANS = AtlasConj       y := alpha*conjg( A  )*x + beta*y,
 *
 *            TRANS = AtlasTrans      y := alpha*A'*x + beta*y,
 *
 *            TRANS = AtlasConjTrans  y := alpha*conjg( A' )*x + beta*y.
 *
 *         Unchanged on exit.
 *
 * M       (input)                       const int
 *         On entry,  M  specifies  the number of rows of  the matrix  A
 *         when TRANS = AtlasNoTrans or TRANS = AtlasConj,  and the num-
 *         ber of columns of the matrix  A otherwise. M must be at least
 *         zero. Unchanged on exit.
 *
 * N       (input)                       const int
 *         On entry, N  specifies  the number of columns of the matrix A
 *         when TRANS = AtlasNoTrans or TRANS = AtlasConj,  and the num-
 *         ber of rows of the matrix A otherwise. N must be at least ze-
 *         ro. Unchanged on exit.
 *
 * ALPHA   (input)                       const double *
 *         On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
 *         supplied as zero then  A and X  need not be set on input. Un-
 *         changed on exit.
 *
 * A       (input)                       const double *
 *         On entry,  A  points  to an array of size equal to or greater
 *         than   LDA * ka * sizeof( double[2] ), where  ka  is  n  when
 *         TRANS = AtlasNotrans or TRANS = AtlasConj, and  m  otherwise.
 *         Before entry, when TRANS = AtlasNotrans or TRANS = AtlasConj,
 *         the leading m by n part of the array  A  must contain the ma-
 *         trix coefficients,  and otherwise the leading n by m  part of
 *         the array A  must contain the matrix coefficients.  Unchanged
 *         on exit.
 *
 * LDA     (input)                       const int
 *         On entry, LDA  specifies the leading dimension of A as decla-
 *         red  in  the  calling  (sub) program.  LDA  must be  at least
 *         MAX( 1, m )  when  TRANS = AtlasNotrans or TRANS = AtlasConj,
 *         and MAX( 1, n ) otherwise. Unchanged on exit.
 *
 * X       (input)                       const double *
 *         On entry,  X  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( double[2] ),
 *         that contains the vector x. Unchanged on exit.
 *
 * INCX    (input)                       const int
 *         On entry, INCX specifies the increment for the elements of X.
 *         INCX must not be zero. Unchanged on exit.
 *
 * BETA    (input)                       const double *
 *         On entry,  BETA  specifies the scalar  beta.   When  BETA  is
 *         supplied as zero then Y  need not be set on input.  Unchanged
 *         on exit.
 *
 * Y       (input/output)                double *
 *         On entry,  Y  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( m - 1 ) * abs( INCY ) ) * sizeof( double[2] ),
 *         that contains the vector y.  Before entry with BETA non-zero,
 *         the incremented array  Y  must contain the vector y. On exit,
 *         Y is overwritten by the updated vector y.
 *
 * INCY    (input)                       const int
 *         On entry, INCY specifies the increment for the elements of Y.
 *         INCY must not be zero. Unchanged on exit.
 *
 * ---------------------------------------------------------------------
 */
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( M == 0 ) || ( N == 0 ) ||
       ( Mdzero( ALPHA[0], ALPHA[1] ) && Mdone( BETA[0], BETA[1] ) ) )
      return;

   if( Mdzero( ALPHA[0], ALPHA[1] ) )
   { Mzvscal( M, BETA, Y, INCY ); return; }

   if(      TRANS == AtlasNoTrans )
   { ATL_zrefgemvN( M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY ); }
   else if( TRANS == AtlasConj    )
   { ATL_zrefgemvC( M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY ); }
   else if( TRANS == AtlasTrans   )
   { ATL_zrefgemvT( M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY ); }
   else
   { ATL_zrefgemvH( M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY ); }
/*
 * End of ATL_zrefgemv
 */
}
示例#5
0
void ATL_zrefhbmv
(
   const enum ATLAS_UPLO      UPLO,
   const int                  N,
   const int                  K,
   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_zrefhbmv performs the matrix-vector operation
 *
 *    y := alpha * A * x + beta * y,
 *
 * where alpha and beta are scalars, x and y are n-element vectors and A
 * is an n by n Hermitian band matrix, with k super-diagonals.
 *
 * Arguments
 * =========
 *
 * UPLO    (input)                       const enum ATLAS_UPLO
 *         On entry, UPLO  specifies whether the upper or lower triangu-
 *         lar part of the band matrix A is being supplied as follows:
 *
 *             UPLO = AtlasUpper   The upper triangular part of A is
 *                                 being supplied.
 *
 *             UPLO = AtlasLower   The lower triangular part of A is
 *                                 being supplied.
 *
 *         Unchanged on exit.
 *
 * N       (input)                       const int
 *         On entry, N specifies the order of the matrix A. N must be at
 *         least zero. Unchanged on exit.
 *
 * K       (input)                       const int
 *         On entry, K  specifies  the number of  super-diagonals of the
 *         matrix A. K must satisfy 0 <= K. Unchanged on exit.
 *
 * ALPHA   (input)                       const double *
 *         On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
 *         supplied as zero then  A and X  need not be set on input. Un-
 *         changed on exit.
 *
 * A       (input)                       const double *
 *         On entry,  A  points  to an array of size equal to or greater
 *         than   LDA * n * sizeof( double[2] ).    Before  entry   with
 *         UPLO = AtlasUpper, the leading ( k + 1 ) by n part of the ar-
 *         ray  A  must  contain  the  upper triangular band part of the
 *         Hermitian matrix, supplied column by column, with the leading
 *         diagonal  of the matrix in row  k of the array, the first su-
 *         per-diagonal starting  at position 1 in row k-1,  and  so on.
 *         The top left k by k triangle of the array  A  is not referen-
 *         ced. Unchanged on exit.
 *         The  following program segment will transfer the upper trian-
 *         gular part  of a Hermitian band matrix from conventional full
 *         matrix storage to band storage:
 *
 *            for( j = 0; j < n; j++ )
 *            {
 *               m  = k - j;
 *               for( i = ( m < 0 ? -m : 0 ); i < j; i++ )
 *               {
 *                  a[((m+i+j*LDA)<<1)+0] = real( matrix( i, j ) );
 *                  a[((m+i+j*LDA)<<1)+1] = imag( matrix( i, j ) );
 *               }
 *            }
 *
 *         Before entry with UPLO = AtlasLower, the leading ( k + 1 ) by
 *         n part of  the array A must contain the lower triangular band
 *         part of the Hermitian matrix, supplied column by column, with
 *         the leading diagonal of the matrix in row 0 of the array, the
 *         first sub-diagonal starting at position  0  in row  1, and so
 *         on.  The bottom right  k by k  triangle of the array A is not
 *         referenced. Unchanged on exit.
 *         The  following program segment will transfer the lower trian-
 *         gular part  of a Hermitian band matrix from conventional full
 *         matrix storage to band storage:
 *
 *            for( j = 0; j < n; j++ )
 *            {
 *               i1 = ( n > j + k + 1 ? j + k + 1 : n );
 *               for( i = j; i < i1; i++ )
 *               {
 *                  a[((i-j+j*LDA)<<1)+0] = real( matrix( i, j ) );
 *                  a[((i-j+j*LDA)<<1)+1] = imag( matrix( i, j ) );
 *               }
 *            }
 *
 *         Note that the  imaginary parts  of the local entries  corres-
 *         ponding to the diagonal elements of A need not be set and as-
 *         sumed to be zero. Unchanged on exit.
 *
 * LDA     (input)                       const int
 *         On entry, LDA  specifies the leading dimension of A as decla-
 *         red  in  the  calling (sub) program.  LDA  must  be  at least
 *         k + 1. Unchanged on exit.
 *
 * X       (input)                       const double *
 *         On entry,  X  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( double[2] ),
 *         that contains the vector x. Unchanged on exit.
 *
 * INCX    (input)                       const int
 *         On entry, INCX specifies the increment for the elements of X.
 *         INCX must not be zero. Unchanged on exit.
 *
 * BETA    (input)                       const double *
 *         On entry,  BETA  specifies the scalar  beta.   When  BETA  is
 *         supplied as zero then Y  need not be set on input.  Unchanged
 *         on exit.
 *
 * Y       (input/output)                double *
 *         On entry,  Y  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( n - 1 ) * abs( INCY ) ) * sizeof( double[2] ),
 *         that contains the vector y.  Before entry with BETA non-zero,
 *         the incremented array  Y  must contain the vector y. On exit,
 *         Y is overwritten by the updated vector y.
 *
 * INCY    (input)                       const int
 *         On entry, INCY specifies the increment for the elements of Y.
 *         INCY must not be zero. Unchanged on exit.
 *
 * ---------------------------------------------------------------------
 */
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( N == 0 ) ||
       ( Mdzero( ALPHA[0], ALPHA[1] ) && Mdone( BETA[0], BETA[1] ) ) ) return;
   if( Mdzero( ALPHA[0], ALPHA[1] ) )
   { Mzvscal( N, BETA, Y, INCY ); return; }

   if( UPLO == AtlasUpper )
   {
      ATL_zrefhbmvU( N, K, ALPHA, A, LDA, X, INCX, BETA, Y, INCY );
   }
   else
   {
      ATL_zrefhbmvL( N, K, ALPHA, A, LDA, X, INCX, BETA, Y, INCY );
   }
/*
 * End of ATL_zrefhbmv
 */
}
示例#6
0
void ATL_zrefhemv
(
   const enum ATLAS_UPLO      UPLO,
   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_zrefhemv performs the matrix-vector operation
 *
 *    y := alpha * A * x + beta * y,
 *
 * where alpha and beta are scalars, x and y are n-element vectors and A
 * is an n by n Hermitian matrix.
 *
 * Arguments
 * =========
 *
 * UPLO    (input)                       const enum ATLAS_UPLO
 *         On entry, UPLO  specifies whether the upper or lower triangu-
 *         lar part of the array A is to be referenced as follows:
 *
 *             UPLO = AtlasUpper   Only the upper triangular part of A
 *                                 is to be referenced.
 *
 *             UPLO = AtlasLower   Only the lower triangular part of A
 *                                 is to be referenced.
 *
 *         Unchanged on exit.
 *
 * N       (input)                       const int
 *         On entry, N specifies the order of the matrix A. N must be at
 *         least zero. Unchanged on exit.
 *
 * ALPHA   (input)                       const double *
 *         On entry, ALPHA specifies the scalar alpha.   When  ALPHA  is
 *         supplied as zero then  A and X  need not be set on input. Un-
 *         changed on exit.
 *
 * A       (input)                       const double *
 *         On entry,  A  points  to an array of size equal to or greater
 *         than   LDA * n * sizeof( double[2] ).   Before   entry   with
 *         UPLO = AtlasUpper, the leading  n by n  upper triangular part
 *         of the array  A must contain the upper triangular part of the
 *         Hermitian matrix  and  the strictly  lower triangular part of
 *         A is not referenced. Before entry with UPLO = AtlasLower, the
 *         leading  n by n  lower  triangular part of the array  A  must
 *         contain the lower triangular part of the Hermitian matrix and
 *         the  strictly upper triangular part of  A  is not referenced.
 *         Unchanged on exit.
 *         Note that the  imaginary parts  of the local entries  corres-
 *         ponding to the diagonal elements of A need not be set and as-
 *         sumed to be zero.
 *
 * LDA     (input)                       const int
 *         On entry, LDA  specifies the leading dimension of A as decla-
 *         red  in  the  calling  (sub) program.  LDA  must be  at least
 *         MAX( 1, n ). Unchanged on exit.
 *
 * X       (input)                       const double *
 *         On entry,  X  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( n - 1 ) * abs( INCX ) ) * sizeof( double[2] ),
 *         that contains the vector x. Unchanged on exit.
 *
 * INCX    (input)                       const int
 *         On entry, INCX specifies the increment for the elements of X.
 *         INCX must not be zero. Unchanged on exit.
 *
 * BETA    (input)                       const double *
 *         On entry,  BETA  specifies the scalar  beta.   When  BETA  is
 *         supplied as zero then Y  need not be set on input.  Unchanged
 *         on exit.
 *
 * Y       (input/output)                double *
 *         On entry,  Y  points to the  first entry to be accessed of an
 *         incremented array of size equal to or greater than
 *            ( 1 + ( n - 1 ) * abs( INCY ) ) * sizeof( double[2] ),
 *         that contains the vector y.  Before entry with BETA non-zero,
 *         the incremented array  Y  must contain the vector y. On exit,
 *         Y is overwritten by the updated vector y.
 *
 * INCY    (input)                       const int
 *         On entry, INCY specifies the increment for the elements of Y.
 *         INCY must not be zero. Unchanged on exit.
 *
 * ---------------------------------------------------------------------
 */
/* ..
 * .. Executable Statements ..
 *
 */
   if( ( N == 0 ) ||
       ( Mdzero( ALPHA[0], ALPHA[1] ) && Mdone( BETA[0], BETA[1] ) ) ) return;
   if( Mdzero( ALPHA[0], ALPHA[1] ) )
   { Mzvscal( N, BETA, Y, INCY ); return; }

   if( UPLO == AtlasUpper )
   {
      ATL_zrefhemvU( N,    ALPHA, A, LDA, X, INCX, BETA, Y, INCY );
   }
   else
   {
      ATL_zrefhemvL( N,    ALPHA, A, LDA, X, INCX, BETA, Y, INCY );
   }
/*
 * End of ATL_zrefhemv
 */
}