naginterfaces.library.lapackeig.zgelsd¶
- naginterfaces.library.lapackeig.zgelsd(a, b, rcond)[source]¶
zgelsd
computes the minimum norm solution to a complex linear least squares problemFor full information please refer to the NAG Library document for f08kq
https://support.nag.com/numeric/nl/nagdoc_30.2/flhtml/f08/f08kqf.html
- Parameters
- acomplex, array-like, shape
The coefficient matrix .
- bcomplex, array-like, shape
The right-hand side matrix .
- rcondfloat
Used to determine the effective rank of . Singular values are treated as zero. If , machine precision is used instead.
- Returns
- acomplex, ndarray, shape
The contents of are destroyed.
- bcomplex, ndarray, shape
is overwritten by the solution matrix . If and , the residual sum of squares for the solution in the th column is given by the sum of squares of the modulus of elements in that column.
- sfloat, ndarray, shape
The singular values of in decreasing order.
- rankint
The effective rank of , i.e., the number of singular values which are greater than .
- Raises
- NagValueError
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
On entry, error in parameter .
Constraint: .
- (errno )
The algorithm for computing the SVD failed to converge; off-diagonal elements of an intermediate bidiagonal form did not converge to zero.
- Notes
zgelsd
uses the singular value decomposition (SVD) of , where is a complex matrix which may be rank-deficient.Several right-hand side vectors and solution vectors can be handled in a single call; they are stored as the columns of the right-hand side matrix and the solution matrix .
The problem is solved in three steps:
reduce the coefficient matrix to bidiagonal form with Householder transformations, reducing the original problem into a ‘bidiagonal least squares problem’ (BLS);
solve the BLS using a divide-and-conquer approach;
apply back all the Householder transformations to solve the original least squares problem.
The effective rank of is determined by treating as zero those singular values which are less than times the largest singular value.
- References
Anderson, E, Bai, Z, Bischof, C, Blackford, S, Demmel, J, Dongarra, J J, Du Croz, J J, Greenbaum, A, Hammarling, S, McKenney, A and Sorensen, D, 1999, LAPACK Users’ Guide, (3rd Edition), SIAM, Philadelphia, https://www.netlib.org/lapack/lug
Golub, G H and Van Loan, C F, 1996, Matrix Computations, (3rd Edition), Johns Hopkins University Press, Baltimore