qr_multiply(a, c, mode='right', pivoting=False, conjugate=False, overwrite_a=False, overwrite_c=False)
Calculate the decomposition A = Q R
where Q is unitary/orthogonal and R upper triangular. Multiply Q with a vector or a matrix c.
This is an interface to the LAPACK routines ?GEQRF
, ?ORMQR
, ?UNMQR
, and ?GEQP3
.
Input array
Input array to be multiplied by q
.
Q @ c
is returned if mode is 'left', c @ Q
is returned if mode is 'right'. The shape of c must be appropriate for the matrix multiplications, if mode is 'left', min(a.shape) == c.shape[0]
, if mode is 'right', a.shape[0] == c.shape[1]
.
Whether or not factorization should include pivoting for rank-revealing qr decomposition, see the documentation of qr.
Whether Q should be complex-conjugated. This might be faster than explicit conjugation.
Whether data in a is overwritten (may improve performance)
Whether data in c is overwritten (may improve performance). If this is used, c must be big enough to keep the result, i.e. c.shape[0]
= a.shape[0]
if mode is 'left'.
Raised if QR decomposition fails.
The product of Q
and c
.
R array of the resulting QR factorization where K = min(M, N)
.
Integer pivot array. Only returned when pivoting=True
.
Calculate the QR decomposition and multiply Q with a matrix.
>>> from scipy.linalg import qr_multiply, qr
... A = np.array([[1, 3, 3], [2, 3, 2], [2, 3, 3], [1, 3, 2]])
... qc, r1, piv1 = qr_multiply(A, 2*np.eye(4), pivoting=1)
... qc array([[-1., 1., -1.], [-1., -1., 1.], [-1., -1., -1.], [-1., 1., 1.]])
>>> r1 array([[-6., -3., -5. ], [ 0., -1., -1.11022302e-16], [ 0., 0., -1. ]])
>>> piv1 array([1, 0, 2], dtype=int32)
>>> q2, r2, piv2 = qr(A, mode='economic', pivoting=1)See :
... np.allclose(2*q2 - qc, np.zeros((4, 3))) True
The following pages refer to to this document either explicitly or contain code examples using this.
scipy.linalg._decomp_update.qr_insert
scipy.linalg._decomp_update.qr_delete
scipy.linalg._decomp_qr.qr_multiply
scipy.linalg._decomp_update.qr_update
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them