gftool.linalg.lstsq_ec

gftool.linalg.lstsq_ec(a, b, c, d, rcond=None)[source]

Least-squares solution with equality constraint for linear matrix eq.

Solves the equation ax = b with the constraint cx = d, where the vector x minimizes the squared Euclidean 2-norm \(||ax - b||^2_2\). Internally numpy.linalg.lstsq is used to solve the least-squares problem. The algorithm is taken from [golub2013].

Parameters:
a(M, N) np.ndarray

“Coefficient” matrix.

b(M) np.ndarray

Ordinate or “dependent variable” values.

c(L, N) np.ndarray

“Coefficient” matrix of the constrains with L < M.

d(L) np.ndarray

Ordinate of the constrains with L < M.

rcondfloat, optional

Cut-off ratio for small singular values of a. For the purposes of rank determination, singular values are treated as zero if they are smaller than rcond times the largest singular value of a (default: machine precision times max(M, N)).

Returns:
  1. np.ndarray Least-squares solution.

References

[golub2013]

Golub, Gene H., und Charles F. Van Loan. Matrix Computations. JHU Press, 2013.