View source: R/lanczos.precond.R
planczos | R Documentation |
The function solve a symmetric positive definite system by split preconditioning the system Ax = b. Then it is handled by a plain Lanczos algorithm.
planczos( A, b, x = rnorm(length(b)), m = length(b), tol = 1e-07, diag.comp = "aj", alpha = 1, L )
A |
A symmetric positive definite matrix for the system Ax = b. No default value. |
b |
A right hand side vector in Ax = b. No default value. |
x |
An initial guess which is produces the first residual r. Default is a random vector. |
m |
Maximum number of iterations to be run. Default is length(b). |
tol |
The relative tolerance for residual norms. Default is 1e-7. |
diag.comp |
A type of diagonal compensation for IC(0) preconditioning. Default is "aj". |
alpha |
The scale of diagonal compensation. Default is 1. |
L |
The preconditioner to supply. If missing, the IC(0) is above parameters is computed. |
A = matrix(rnorm(100^2), 100) A = t(A)%*%A b = rnorm(100) res = planczos(A, b) plot(solve(A, b), t="l") lines(res$x, col="red")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.