Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
mpf committed Mar 1, 2022
1 parent fa8ca34 commit 1e76e3c
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ Update the "Q-less" QR factorization of a matrix. Routines are
provided for adding and deleting columns, adding rows, and solving
associated linear least-squares problems.

The least-squares solver uses Björck's corrected semi-normal equation (CSNE) approach [1] with one step of iterative refinement. Using double precision, the method should be stable for matrices `A` with condition number up to `10^8`.


## Installing

```julia
Expand All @@ -16,7 +19,7 @@ Pkg.add(url="https://github.com/mpf/QRupdate.jl")

### Adding columns

Build the "Q-less" QR factorization of A one column at a time.
Build the "Q-less" QR factorization of `A` one column at a time:

```julia
m, n = 100, 50
Expand All @@ -29,7 +32,7 @@ for i in 1:n
end
```

Solve a least-squares problem using R.
Minimize the least-squares residual `||Ax - b||₂` using the computed `R`:

```julia
b = randn(m)
Expand All @@ -38,7 +41,7 @@ x, r = csne(R, A, b)

### Deleting columns

Delete a column and compute new R.
Delete a random column and compute new `R`:

```julia
n = size(A,2)
Expand All @@ -47,15 +50,15 @@ A = A[:, 1:n .!= k]
R = qrdelcol(R, k)
```

Solve a least-squares problem using R.
Minimize the least-squares residual `||Ax - b||₂` using the computed `R`:

```julia
x, r = csne(R, A, b)
```

### Adding rows

Add a row to A.
Add a row to `A`:

```julia
n = size(A,2)
Expand All @@ -64,7 +67,7 @@ A = [A; a]
R = qraddrow(R, a)
```

Solve a least-squares problem using R.
Minimize the least-squares residual `||Ax - b||₂` using the computed `R`:

```julia
b = [b; randn()]
Expand All @@ -73,15 +76,14 @@ x, r = csne(R, A, b)

## Reference

Björck, A. (1996). Numerical methods for least squares problems. SIAM.
[1] Björck, A. (1996). Numerical methods for least squares problems. SIAM.

## Change Log

- 15 Jun 2007: First version of QRaddcol.m (without β).
- Where necessary, Ake Bjorck's CSNE (Corrected Semi-Normal Equations) method is used to improve the accuracy of `u` and `γ`. See p143 of Ake Bjork's Least Squares book.

- 15 Jun 2007: First version of QRaddcol.m (without `β`).
- Where necessary, Ake Bjorck's CSNE method is used to improve the accuracy of `u` and `γ`. See p143 of Ake Bjork's Least Squares book.
- 18 Jun 2007: `R` is now the exact size on entry and exit.
- 19 Oct 2007: Sparse `A`, a makes `c` and `u` sparse. Force them to be dense.
- 04 Aug 2008: Update `u` using `du`, rather than `u = R*z` as in Ake's book. We guess that it might be slightly more accurate, but it's hard to tell. No `R*z` makes it a little cheaper.
- 03 Sep 2008: Generalize `A` to be `[A; β*I]` for some scalar `β`. Update `u` using `du`, but keep Ake's version in comments.
- 29 Dec 2015: Converted to Julia.
- 29 Dec 2015: Converted to Julia.

0 comments on commit 1e76e3c

Please sign in to comment.