image thumbnail

Updating thin QR factorization

version 1.0.1 (4.55 KB) by Meimei Chen
Update existing QR factorization of A when A is modified, such as rank one update, delete or insert a row or a column.

8 Downloads

Updated 21 Apr 2021

View License

Updating the thin QR factorization of A when A is modified. These functions run faster than qr when the dimension of A is large, such as 5000-by-50.

Rank one update: rankoneupdate(Q, R, v, u):
Update the thin QR factorization of A when A = A + vu'.
Example:
A = rand(5,3);
v = rand(5,1);
u = rand(3,1);
[Q, R] = qr(A,0);
[Q_1, R_1] = rankoneupdate(Q, R, v, u);

Deleting a row: deleterow(Q, R, k)
Update the thin QR factorization of A when the kth row of A is deleted.
Example:
A = rand(5,3);
[Q, R] = qr(A, 0);
[Q_1, R_1] = deleterow(Q, R, 3);

Deleting a column: deletecolumn(Q, R, k)
Update the thin QR factorization of A when the kth column of A is deleted.
Example:
A = rand(5,3);
[Q, R] = qr(A, 0);
[Q_1, R_1] = deletecolumn(Q, R, 2);

Inserting a row: insertrow(Q, R, u, k)
Update the thin QR factorization of A when vector u is inserted as the kth row of A.
Example:
A = rand(5, 3);
[Q, R] = qr(A,0);
u = rand(3, 1);
[Q_1, R_1] = insertrow(Q, R, u, 2);

Inserting a row: insertcolumn(Q, R, u, k)
Update the thin QR factorization of A when vector u is inserted as the kth column of A.
Example:
A = rand(5, 3);
[Q, R] = qr(A,0);
u = rand(5, 1);
[Q_1, R_1] = insertcolumn(Q, R, u, 2);

Cite As

Meimei Chen (2021). Updating thin QR factorization (https://www.mathworks.com/matlabcentral/fileexchange/90835-updating-thin-qr-factorization), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2021a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!