Loading...
Searching...
No Matches
lahr2: Partial factorization; used by gehrd
Dense LA » Eigenvalues » Non-symmetric eigenvalues » Auxiliary routines

## Functions

magma_int_t | magma_clahr2 (magma_int_t n, magma_int_t k, magma_int_t nb, magmaFloatComplex_ptr dA, magma_int_t ldda, magmaFloatComplex_ptr dV, magma_int_t lddv, magmaFloatComplex *A, magma_int_t lda, magmaFloatComplex *tau, magmaFloatComplex *T, magma_int_t ldt, magmaFloatComplex *Y, magma_int_t ldy, magma_queue_t queue)
| CLAHR2 reduces the first NB columns of a complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.
magma_int_t | magma_clahr2_m (magma_int_t n, magma_int_t k, magma_int_t nb, magmaFloatComplex *A, magma_int_t lda, magmaFloatComplex *tau, magmaFloatComplex *T, magma_int_t ldt, magmaFloatComplex *Y, magma_int_t ldy, struct cgehrd_data *data)
| CLAHR2 reduces the first NB columns of a complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.
magma_int_t | magma_dlahr2 (magma_int_t n, magma_int_t k, magma_int_t nb, magmaDouble_ptr dA, magma_int_t ldda, magmaDouble_ptr dV, magma_int_t lddv, double *A, magma_int_t lda, double *tau, double *T, magma_int_t ldt, double *Y, magma_int_t ldy, magma_queue_t queue)
| DLAHR2 reduces the first NB columns of a real general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.
magma_int_t | magma_dlahr2_m (magma_int_t n, magma_int_t k, magma_int_t nb, double *A, magma_int_t lda, double *tau, double *T, magma_int_t ldt, double *Y, magma_int_t ldy, struct dgehrd_data *data)
| DLAHR2 reduces the first NB columns of a real general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.
magma_int_t | magma_slahr2 (magma_int_t n, magma_int_t k, magma_int_t nb, magmaFloat_ptr dA, magma_int_t ldda, magmaFloat_ptr dV, magma_int_t lddv, float *A, magma_int_t lda, float *tau, float *T, magma_int_t ldt, float *Y, magma_int_t ldy, magma_queue_t queue)
| SLAHR2 reduces the first NB columns of a real general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.
magma_int_t | magma_slahr2_m (magma_int_t n, magma_int_t k, magma_int_t nb, float *A, magma_int_t lda, float *tau, float *T, magma_int_t ldt, float *Y, magma_int_t ldy, struct sgehrd_data *data)
| SLAHR2 reduces the first NB columns of a real general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.
magma_int_t | magma_zlahr2 (magma_int_t n, magma_int_t k, magma_int_t nb, magmaDoubleComplex_ptr dA, magma_int_t ldda, magmaDoubleComplex_ptr dV, magma_int_t lddv, magmaDoubleComplex *A, magma_int_t lda, magmaDoubleComplex *tau, magmaDoubleComplex *T, magma_int_t ldt, magmaDoubleComplex *Y, magma_int_t ldy, magma_queue_t queue)
| ZLAHR2 reduces the first NB columns of a complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.
magma_int_t | magma_zlahr2_m (magma_int_t n, magma_int_t k, magma_int_t nb, magmaDoubleComplex *A, magma_int_t lda, magmaDoubleComplex *tau, magmaDoubleComplex *T, magma_int_t ldt, magmaDoubleComplex *Y, magma_int_t ldy, struct zgehrd_data *data)
| ZLAHR2 reduces the first NB columns of a complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

## Detailed Description

## Function Documentation

## magma_clahr2()

magma_int_t magma_clahr2 | ( | magma_int_t | n,
|  | magma_int_t | k,
|  | magma_int_t | nb,
|  | magmaFloatComplex_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaFloatComplex_ptr | dV,
|  | magma_int_t | lddv,
|  | magmaFloatComplex * | A,
|  | magma_int_t | lda,
|  | magmaFloatComplex * | tau,
|  | magmaFloatComplex * | T,
|  | magma_int_t | ldt,
|  | magmaFloatComplex * | Y,
|  | magma_int_t | ldy,
|  | magma_queue_t | queue )

CLAHR2 reduces the first NB columns of a complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

The reduction is performed by an orthogonal similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V. (Note this is different than LAPACK, which computes Y = A * V * T.)

This is an auxiliary routine called by CGEHRD.

Parameters

  [in] | n | INTEGER The order of the matrix A.
  [in] | k | INTEGER The offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero. K < N.
  [in] | nb | INTEGER The number of columns to be reduced.
  [in,out] | dA | COMPLEX array on the GPU, dimension (LDDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements in rows K:N of the first NB columns are overwritten with the matrix Y.
  [in] | ldda | INTEGER The leading dimension of the array dA. LDDA >= max(1,N).
  [out] | dV | COMPLEX array on the GPU, dimension (LDDV, NB) On exit this n-by-nb array contains the Householder vectors of the transformation.
  [in] | lddv | INTEGER The leading dimension of the array dV. LDDV >= max(1,N).

  [in,out]

  A

  COMPLEX array, dimension (LDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [out] | tau | COMPLEX array, dimension (NB) The scalar factors of the elementary reflectors. See Further Details.
  [out] | T | COMPLEX array, dimension (LDT,NB) The upper triangular matrix T.
  [in] | ldt | INTEGER The leading dimension of the array T. LDT >= NB.
  [out] | Y | COMPLEX array, dimension (LDY,NB) The n-by-nb matrix Y.
  [in] | ldy | INTEGER The leading dimension of the array Y. LDY >= N.
  [in] | queue | magma_queue_t Queue to execute in.

## Further Details

The matrix Q is represented as a product of nb elementary reflectors

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a complex scalar, and v is a complex vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V') * (A - Y*T*V').

The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( h   h   a   a   a )
       ( v1  h   a   a   a )
       ( v1  v2  a   a   a )
       ( v1  v2  a   a   a )

where "a" denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This implementation follows the hybrid algorithm and notations described in

S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.

## magma_clahr2_m()

magma_int_t magma_clahr2_m | ( | magma_int_t | n,
|  | magma_int_t | k,
|  | magma_int_t | nb,
|  | magmaFloatComplex * | A,
|  | magma_int_t | lda,
|  | magmaFloatComplex * | tau,
|  | magmaFloatComplex * | T,
|  | magma_int_t | ldt,
|  | magmaFloatComplex * | Y,
|  | magma_int_t | ldy,
|  | struct cgehrd_data * | data )

CLAHR2 reduces the first NB columns of a complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

The reduction is performed by an orthogonal similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V. (Note this is different than LAPACK, which computes Y = A * V * T.)

This is an auxiliary routine called by CGEHRD.

Parameters

  [in] | n | INTEGER The order of the matrix A.
  [in] | k | INTEGER The offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero. K < N.
  [in] | nb | INTEGER The number of columns to be reduced.

  [in,out]

  A

  COMPLEX array, dimension (LDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [out] | tau | COMPLEX array, dimension (NB) The scalar factors of the elementary reflectors. See Further Details.
  [out] | T | COMPLEX array, dimension (LDT,NB) The upper triangular matrix T.
  [in] | ldt | INTEGER The leading dimension of the array T. LDT >= NB.
  [out] | Y | COMPLEX array, dimension (LDY,NB) The n-by-nb matrix Y.
  [in] | ldy | INTEGER The leading dimension of the array Y. LDY >= N.
  [in,out] | data | Structure with pointers to dA, dT, dV, dW, dY which are distributed across multiple GPUs.

## Further Details

The matrix Q is represented as a product of nb elementary reflectors

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a complex scalar, and v is a complex vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V') * (A - Y*T*V').

The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( h   h   a   a   a )
       ( v1  h   a   a   a )
       ( v1  v2  a   a   a )
       ( v1  v2  a   a   a )

where "a" denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This implementation follows the hybrid algorithm and notations described in

S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.

## magma_dlahr2()

magma_int_t magma_dlahr2 | ( | magma_int_t | n,
|  | magma_int_t | k,
|  | magma_int_t | nb,
|  | magmaDouble_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaDouble_ptr | dV,
|  | magma_int_t | lddv,
|  | double * | A,
|  | magma_int_t | lda,
|  | double * | tau,
|  | double * | T,
|  | magma_int_t | ldt,
|  | double * | Y,
|  | magma_int_t | ldy,
|  | magma_queue_t | queue )

DLAHR2 reduces the first NB columns of a real general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

The reduction is performed by an orthogonal similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V. (Note this is different than LAPACK, which computes Y = A * V * T.)

This is an auxiliary routine called by DGEHRD.

Parameters

  [in] | n | INTEGER The order of the matrix A.
  [in] | k | INTEGER The offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero. K < N.
  [in] | nb | INTEGER The number of columns to be reduced.
  [in,out] | dA | DOUBLE PRECISION array on the GPU, dimension (LDDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements in rows K:N of the first NB columns are overwritten with the matrix Y.
  [in] | ldda | INTEGER The leading dimension of the array dA. LDDA >= max(1,N).
  [out] | dV | DOUBLE PRECISION array on the GPU, dimension (LDDV, NB) On exit this n-by-nb array contains the Householder vectors of the transformation.
  [in] | lddv | INTEGER The leading dimension of the array dV. LDDV >= max(1,N).

  [in,out]

  A

  DOUBLE PRECISION array, dimension (LDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [out] | tau | DOUBLE PRECISION array, dimension (NB) The scalar factors of the elementary reflectors. See Further Details.
  [out] | T | DOUBLE PRECISION array, dimension (LDT,NB) The upper triangular matrix T.
  [in] | ldt | INTEGER The leading dimension of the array T. LDT >= NB.
  [out] | Y | DOUBLE PRECISION array, dimension (LDY,NB) The n-by-nb matrix Y.
  [in] | ldy | INTEGER The leading dimension of the array Y. LDY >= N.
  [in] | queue | magma_queue_t Queue to execute in.

## Further Details

The matrix Q is represented as a product of nb elementary reflectors

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V') * (A - Y*T*V').

The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( h   h   a   a   a )
       ( v1  h   a   a   a )
       ( v1  v2  a   a   a )
       ( v1  v2  a   a   a )

where "a" denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This implementation follows the hybrid algorithm and notations described in

S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.

## magma_dlahr2_m()

magma_int_t magma_dlahr2_m | ( | magma_int_t | n,
|  | magma_int_t | k,
|  | magma_int_t | nb,
|  | double * | A,
|  | magma_int_t | lda,
|  | double * | tau,
|  | double * | T,
|  | magma_int_t | ldt,
|  | double * | Y,
|  | magma_int_t | ldy,
|  | struct dgehrd_data * | data )

DLAHR2 reduces the first NB columns of a real general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

The reduction is performed by an orthogonal similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V. (Note this is different than LAPACK, which computes Y = A * V * T.)

This is an auxiliary routine called by DGEHRD.

Parameters

  [in] | n | INTEGER The order of the matrix A.
  [in] | k | INTEGER The offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero. K < N.
  [in] | nb | INTEGER The number of columns to be reduced.

  [in,out]

  A

  DOUBLE PRECISION array, dimension (LDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [out] | tau | DOUBLE PRECISION array, dimension (NB) The scalar factors of the elementary reflectors. See Further Details.
  [out] | T | DOUBLE PRECISION array, dimension (LDT,NB) The upper triangular matrix T.
  [in] | ldt | INTEGER The leading dimension of the array T. LDT >= NB.
  [out] | Y | DOUBLE PRECISION array, dimension (LDY,NB) The n-by-nb matrix Y.
  [in] | ldy | INTEGER The leading dimension of the array Y. LDY >= N.
  [in,out] | data | Structure with pointers to dA, dT, dV, dW, dY which are distributed across multiple GPUs.

## Further Details

The matrix Q is represented as a product of nb elementary reflectors

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V') * (A - Y*T*V').

The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( h   h   a   a   a )
       ( v1  h   a   a   a )
       ( v1  v2  a   a   a )
       ( v1  v2  a   a   a )

where "a" denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This implementation follows the hybrid algorithm and notations described in

S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.

## magma_slahr2()

magma_int_t magma_slahr2 | ( | magma_int_t | n,
|  | magma_int_t | k,
|  | magma_int_t | nb,
|  | magmaFloat_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaFloat_ptr | dV,
|  | magma_int_t | lddv,
|  | float * | A,
|  | magma_int_t | lda,
|  | float * | tau,
|  | float * | T,
|  | magma_int_t | ldt,
|  | float * | Y,
|  | magma_int_t | ldy,
|  | magma_queue_t | queue )

SLAHR2 reduces the first NB columns of a real general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

The reduction is performed by an orthogonal similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V. (Note this is different than LAPACK, which computes Y = A * V * T.)

This is an auxiliary routine called by SGEHRD.

Parameters

  [in] | n | INTEGER The order of the matrix A.
  [in] | k | INTEGER The offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero. K < N.
  [in] | nb | INTEGER The number of columns to be reduced.
  [in,out] | dA | REAL array on the GPU, dimension (LDDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements in rows K:N of the first NB columns are overwritten with the matrix Y.
  [in] | ldda | INTEGER The leading dimension of the array dA. LDDA >= max(1,N).
  [out] | dV | REAL array on the GPU, dimension (LDDV, NB) On exit this n-by-nb array contains the Householder vectors of the transformation.
  [in] | lddv | INTEGER The leading dimension of the array dV. LDDV >= max(1,N).

  [in,out]

  A

  REAL array, dimension (LDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [out] | tau | REAL array, dimension (NB) The scalar factors of the elementary reflectors. See Further Details.
  [out] | T | REAL array, dimension (LDT,NB) The upper triangular matrix T.
  [in] | ldt | INTEGER The leading dimension of the array T. LDT >= NB.
  [out] | Y | REAL array, dimension (LDY,NB) The n-by-nb matrix Y.
  [in] | ldy | INTEGER The leading dimension of the array Y. LDY >= N.
  [in] | queue | magma_queue_t Queue to execute in.

## Further Details

The matrix Q is represented as a product of nb elementary reflectors

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V') * (A - Y*T*V').

The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( h   h   a   a   a )
       ( v1  h   a   a   a )
       ( v1  v2  a   a   a )
       ( v1  v2  a   a   a )

where "a" denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This implementation follows the hybrid algorithm and notations described in

S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.

## magma_slahr2_m()

magma_int_t magma_slahr2_m | ( | magma_int_t | n,
|  | magma_int_t | k,
|  | magma_int_t | nb,
|  | float * | A,
|  | magma_int_t | lda,
|  | float * | tau,
|  | float * | T,
|  | magma_int_t | ldt,
|  | float * | Y,
|  | magma_int_t | ldy,
|  | struct sgehrd_data * | data )

SLAHR2 reduces the first NB columns of a real general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

The reduction is performed by an orthogonal similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V. (Note this is different than LAPACK, which computes Y = A * V * T.)

This is an auxiliary routine called by SGEHRD.

Parameters

  [in] | n | INTEGER The order of the matrix A.
  [in] | k | INTEGER The offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero. K < N.
  [in] | nb | INTEGER The number of columns to be reduced.

  [in,out]

  A

  REAL array, dimension (LDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [out] | tau | REAL array, dimension (NB) The scalar factors of the elementary reflectors. See Further Details.
  [out] | T | REAL array, dimension (LDT,NB) The upper triangular matrix T.
  [in] | ldt | INTEGER The leading dimension of the array T. LDT >= NB.
  [out] | Y | REAL array, dimension (LDY,NB) The n-by-nb matrix Y.
  [in] | ldy | INTEGER The leading dimension of the array Y. LDY >= N.
  [in,out] | data | Structure with pointers to dA, dT, dV, dW, dY which are distributed across multiple GPUs.

## Further Details

The matrix Q is represented as a product of nb elementary reflectors

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a real scalar, and v is a real vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V') * (A - Y*T*V').

The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( h   h   a   a   a )
       ( v1  h   a   a   a )
       ( v1  v2  a   a   a )
       ( v1  v2  a   a   a )

where "a" denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This implementation follows the hybrid algorithm and notations described in

S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.

## magma_zlahr2()

magma_int_t magma_zlahr2 | ( | magma_int_t | n,
|  | magma_int_t | k,
|  | magma_int_t | nb,
|  | magmaDoubleComplex_ptr | dA,
|  | magma_int_t | ldda,
|  | magmaDoubleComplex_ptr | dV,
|  | magma_int_t | lddv,
|  | magmaDoubleComplex * | A,
|  | magma_int_t | lda,
|  | magmaDoubleComplex * | tau,
|  | magmaDoubleComplex * | T,
|  | magma_int_t | ldt,
|  | magmaDoubleComplex * | Y,
|  | magma_int_t | ldy,
|  | magma_queue_t | queue )

ZLAHR2 reduces the first NB columns of a complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

The reduction is performed by an orthogonal similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V. (Note this is different than LAPACK, which computes Y = A * V * T.)

This is an auxiliary routine called by ZGEHRD.

Parameters

  [in] | n | INTEGER The order of the matrix A.
  [in] | k | INTEGER The offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero. K < N.
  [in] | nb | INTEGER The number of columns to be reduced.
  [in,out] | dA | COMPLEX_16 array on the GPU, dimension (LDDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements in rows K:N of the first NB columns are overwritten with the matrix Y.
  [in] | ldda | INTEGER The leading dimension of the array dA. LDDA >= max(1,N).
  [out] | dV | COMPLEX_16 array on the GPU, dimension (LDDV, NB) On exit this n-by-nb array contains the Householder vectors of the transformation.
  [in] | lddv | INTEGER The leading dimension of the array dV. LDDV >= max(1,N).

  [in,out]

  A

  COMPLEX_16 array, dimension (LDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [out] | tau | COMPLEX_16 array, dimension (NB) The scalar factors of the elementary reflectors. See Further Details.
  [out] | T | COMPLEX_16 array, dimension (LDT,NB) The upper triangular matrix T.
  [in] | ldt | INTEGER The leading dimension of the array T. LDT >= NB.
  [out] | Y | COMPLEX_16 array, dimension (LDY,NB) The n-by-nb matrix Y.
  [in] | ldy | INTEGER The leading dimension of the array Y. LDY >= N.
  [in] | queue | magma_queue_t Queue to execute in.

## Further Details

The matrix Q is represented as a product of nb elementary reflectors

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a complex scalar, and v is a complex vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V') * (A - Y*T*V').

The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( h   h   a   a   a )
       ( v1  h   a   a   a )
       ( v1  v2  a   a   a )
       ( v1  v2  a   a   a )

where "a" denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This implementation follows the hybrid algorithm and notations described in

S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.

## magma_zlahr2_m()

magma_int_t magma_zlahr2_m | ( | magma_int_t | n,
|  | magma_int_t | k,
|  | magma_int_t | nb,
|  | magmaDoubleComplex * | A,
|  | magma_int_t | lda,
|  | magmaDoubleComplex * | tau,
|  | magmaDoubleComplex * | T,
|  | magma_int_t | ldt,
|  | magmaDoubleComplex * | Y,
|  | magma_int_t | ldy,
|  | struct zgehrd_data * | data )

ZLAHR2 reduces the first NB columns of a complex general n-BY-(n-k+1) matrix A so that elements below the k-th subdiagonal are zero.

The reduction is performed by an orthogonal similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V. (Note this is different than LAPACK, which computes Y = A * V * T.)

This is an auxiliary routine called by ZGEHRD.

Parameters

  [in] | n | INTEGER The order of the matrix A.
  [in] | k | INTEGER The offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero. K < N.
  [in] | nb | INTEGER The number of columns to be reduced.

  [in,out]

  A

  COMPLEX_16 array, dimension (LDA,N-K+1) On entry, the n-by-(n-k+1) general matrix A. On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A are unchanged. See Further Details.

  [in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,N).
  [out] | tau | COMPLEX_16 array, dimension (NB) The scalar factors of the elementary reflectors. See Further Details.
  [out] | T | COMPLEX_16 array, dimension (LDT,NB) The upper triangular matrix T.
  [in] | ldt | INTEGER The leading dimension of the array T. LDT >= NB.
  [out] | Y | COMPLEX_16 array, dimension (LDY,NB) The n-by-nb matrix Y.
  [in] | ldy | INTEGER The leading dimension of the array Y. LDY >= N.
  [in,out] | data | Structure with pointers to dA, dT, dV, dW, dY which are distributed across multiple GPUs.

## Further Details

The matrix Q is represented as a product of nb elementary reflectors

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form

H(i) = I - tau * v * v'

where tau is a complex scalar, and v is a complex vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(i+k+1:n,i), and tau in TAU(i).

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form: A := (I - V*T*V') * (A - Y*T*V').

The contents of A on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( a   a   a   a   a )
       ( h   h   a   a   a )
       ( v1  h   a   a   a )
       ( v1  v2  a   a   a )
       ( v1  v2  a   a   a )

where "a" denotes an element of the original matrix A, h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i).

This implementation follows the hybrid algorithm and notations described in

S. Tomov and J. Dongarra, "Accelerating the reduction to upper Hessenberg form through hybrid GPU-based computing," University of Tennessee Computer Science Technical Report, UT-CS-09-642 (also LAPACK Working Note 219), May 24, 2009.