-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3ea5a2
commit f3bc587
Showing
24 changed files
with
856 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
```@example usymlqr | ||
using Krylov, LinearOperators | ||
using LinearAlgebra, Printf, SparseArrays | ||
# Identity matrix. | ||
eye(n::Int) = sparse(1.0 * I, n, n) | ||
# Saddle-point systems | ||
n = m = 5 | ||
A = [2^(i/j)*j + (-1)^(i-j) * n*(i-1) for i = 1:n, j = 1:n] | ||
b = ones(n) | ||
D = diagm(0 => [2.0 * i for i = 1:n]) | ||
m, n = size(A) | ||
c = -b | ||
# [D A] [x] = [b] | ||
# [Aᴴ 0] [y] [c] | ||
opH = BlockDiagonalOperator(inv(D), eye(n)) | ||
(x, y, stats) = usymlqr(A, b, c, M=D, ldiv=true) | ||
K = [D A; A' zeros(n,n)] | ||
B = [b; c] | ||
r = B - K * [x; y] | ||
resid = sqrt(dot(r, opH * r)) | ||
@printf("USYMLQR: Relative residual: %8.1e\n", resid) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,3 +15,10 @@ tricg! | |
trimr | ||
trimr! | ||
``` | ||
|
||
## USYMLQR | ||
|
||
```@docs | ||
usymlqr! | ||
usymlqr | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.