Developer Reference for Intel® oneAPI Math Kernel Library for C
?gebrd
Reduces a general matrix to bidiagonal form.
Syntax
lapack_int LAPACKE_sgebrd ( intmatrix_layout , lapack_intm , lapack_intn , float*a , lapack_intlda , float*d , float*e , float*tauq , float*taup );
lapack_int LAPACKE_dgebrd ( intmatrix_layout , lapack_intm , lapack_intn , double*a , lapack_intlda , double*d , double*e , double*tauq , double*taup );
lapack_int LAPACKE_cgebrd ( intmatrix_layout , lapack_intm , lapack_intn , lapack_complex_float*a , lapack_intlda , float*d , float*e , lapack_complex_float*tauq , lapack_complex_float*taup );
lapack_int LAPACKE_zgebrd ( intmatrix_layout , lapack_intm , lapack_intn , lapack_complex_double*a , lapack_intlda , double*d , double*e , lapack_complex_double*tauq , lapack_complex_double*taup );
Include Files
mkl.h
Description
sgebrd dgebrd cgebrd zgebrd gebrd
The routine reduces a general m -by- n matrix A to a bidiagonal matrix B by an orthogonal (unitary) transformation.
If m≥n , the reduction is given by
where B1 is an n -by- n upper diagonal matrix, Q and P are orthogonal or, for a complex A , unitary matrices; Q1 consists of the first n columns of Q .
If m < n , the reduction is given by
A = Q*B*P^{H} = Q*(B_{1}0)*P^{H} = Q_{1}*B_{1}*P_{1}^{H} ,
where B1 is an m -by- m lower diagonal matrix, Q and P are orthogonal or, for a complex A , unitary matrices; P1 consists of the first m columns of P .
The routine does not form the matrices Q and P explicitly, but represents them as products of elementary reflectors. Routines are provided to work with the matrices Q and P in this representation:
If the matrix A is real,
If the matrix A is complex,
Input Parameters
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
m
The number of rows in the matrix A ( m≥ 0 ).
n
The number of columns in A ( n≥ 0 ).
- a , work
-
REAL for sgebrd DOUBLE PRECISION for dgebrd COMPLEX for cgebrd DOUBLE COMPLEX for zgebrd . Arrays:
a (size max(1, lda * n ) for column major layout and max(1, lda * m ) for row major layout) contains the matrix A .
The second dimension of a must be at least max(1, n) . work is a workspace array, its dimension max(1, lwork) .
lda
The leading dimension of a ; at least max(1, m) for column major layout and at least max(1, n ) for row major layout .
lwork
The dimension of work ; at least max(1, m, n) . If lwork = -1 , then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla . See Application Notes for the suggested value of lwork .
Output Parameters
- a
-
If m≥n , the diagonal and first super-diagonal of a are overwritten by the upper bidiagonal matrix B . The elements below the diagonal, with the array tauq , represent the orthogonal matrix Q as a product of elementary reflectors, and the elements above the first superdiagonal, with the array taup , represent the orthogonal matrix P as a product of elementary reflectors. If m < n , the diagonal and first sub-diagonal of a are overwritten by the lower bidiagonal matrix B . The elements below the first subdiagonal, with the array tauq , represent the orthogonal matrix Q as a product of elementary reflectors, and the elements above the diagonal, with the array taup , represent the orthogonal matrix P as a product of elementary reflectors.
- d
-
REAL for single-precision flavors DOUBLE PRECISION for double-precision flavors. Array, size at least max(1, min(m, n)) . Contains the diagonal elements of B .
- e
-
REAL for single-precision flavors DOUBLE PRECISION for double-precision flavors. Array, size at least max(1, min(m, n) - 1) . Contains the off-diagonal elements of B .
- tauq , taup
-
REAL for sgebrd DOUBLE PRECISION for dgebrd COMPLEX for cgebrd DOUBLE COMPLEX for zgebrd . Arrays, size at least max (1, min(m, n)) . The scalar factors of the elementary reflectors which represent the orthogonal or unitary matrices P and Q .
- work(1)
-
If info = 0 , on exit work(1) contains the minimum value of lwork required for optimum performance. Use this lwork for subsequent runs.
Return Values
This function returns a value info .
If info=0 , the execution is successful.
If info = -i , the i -th parameter had an illegal value.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.
Application Notes
The computed matrices \(Q\) , \(B\) , and \(P\) satisfy \(QBP^{H} = A + E\) , where \(||E||_{2} = c(n)\varepsilon ||A||_{2}, c(n)\) is a modestly increasing function of n , and \(\varepsilon\) is the machine precision.
The approximate number of floating-point operations for real flavors is
\((4/3) n^{2} (3 m - n) for m\geq n,\)
\((4/3) m^{2} (3 n - m) for m < n.\)
The number of operations for complex flavors is four times greater.
If n is much less than m , it can be more efficient to first form the QR factorization of \(A\) by calling geqrf and then reduce the factor \(R\) to bidiagonal form. This requires approximately \(2 n^{2} (m + n)\) floating-point operations.
If m is much less than n , it can be more efficient to first form the LQ factorization of \(A\) by calling gelqf and then reduce the factor \(L\) to bidiagonal form. This requires approximately \(2 m^{2} (m + n)\) floating-point operations.