From 1fa8e216fc3b7cac5c7a3170de2ab2d9360b57e1 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Sat, 5 Oct 2024 21:48:30 -0500 Subject: [PATCH] [documentation] Add an example with RandomizedPreconditioners.jl --- docs/make.jl | 1 - docs/src/preconditioners.md | 12 ++++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/docs/make.jl b/docs/make.jl index 6afe6ebc1..9668d815b 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -26,7 +26,6 @@ makedocs( "Storage requirements" => "storage.md", "Preconditioners" => "preconditioners.md", "GPU support" => "gpu.md", - # "KrylovPreconditioners.jl" => "krylov_preconditioners.md", "Warm-start" => "warm-start.md", "Matrix-free operators" => "matrix_free.md", "Callbacks" => "callbacks.md", diff --git a/docs/src/preconditioners.md b/docs/src/preconditioners.md index 62c67b98a..26026a1f6 100644 --- a/docs/src/preconditioners.md +++ b/docs/src/preconditioners.md @@ -199,6 +199,18 @@ N = ldl(F) x, y, stats = tricg(A, b, c, M=M, N=N, ldiv=true) ``` +```julia +using RandomizedPreconditioners, Krylov + +Â = NystromSketch(A, k, r) + +P = NystromPreconditioner(Â, μ) +x, stats = cg(A + μ*I, b; M=P) + +P⁻¹ = NystromPreconditionerInverse(Â, μ) +x, stats = cg(A + μ*I, b; M=P⁻¹) +``` + ```julia using SuiteSparse, Krylov import LinearAlgebra.ldiv!