# naginterfaces.library.lapackeig.zgelsy¶

naginterfaces.library.lapackeig.zgelsy(a, b, jpvt, rcond)[source]

zgelsy computes the minimum norm solution to a complex linear least squares problem

using a complete orthogonal factorization of . is an matrix which may be rank-deficient. Several right-hand side vectors and solution vectors can be handled in a single call.

For full information please refer to the NAG Library document for f08bn

https://support.nag.com/numeric/nl/nagdoc_30.1/flhtml/f08/f08bnf.html

Parameters
acomplex, array-like, shape

The matrix .

bcomplex, array-like, shape

The right-hand side matrix .

jpvtint, array-like, shape

If , the th column of is permuted to the front of , otherwise column is a free column.

rcondfloat

Used to determine the effective rank of , which is defined as the order of the largest leading triangular sub-matrix in the factorization of , whose estimated condition number is .

Suggested value: if the condition number of is not known then (where is machine precision, see machine.precision) is a good choice. Negative values or values less than machine precision should be avoided since this will cause to have an effective that could be larger than its actual rank, leading to meaningless results.

Returns
acomplex, ndarray, shape

has been overwritten by details of its complete orthogonal factorization.

bcomplex, ndarray, shape

The solution matrix .

jpvtint, ndarray, shape

If , the th column of was the th column of .

rankint

The effective rank of , i.e., the order of the sub-matrix . This is the same as the order of the sub-matrix in the complete orthogonal factorization of .

Raises
NagValueError
(errno )

On entry, error in parameter .

Constraint: .

(errno )

On entry, error in parameter .

Constraint: .

(errno )

On entry, error in parameter .

Constraint: .

Notes

The right-hand side vectors are stored as the columns of the matrix and the solution vectors in the matrix .

zgelsy first computes a factorization with column pivoting

with defined as the largest leading sub-matrix whose estimated condition number is less than . The order of , , is the effective rank of .

Then, is considered to be negligible, and is annihilated by orthogonal transformations from the right, arriving at the complete orthogonal factorization

The minimum norm solution is then

where consists of the first columns of .

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