From f34db9c7e8b2655fb5da174f7f92ab5c58ba891e Mon Sep 17 00:00:00 2001 From: Serguei Sokol <sokol@insa-toulouse.fr> Date: Fri, 11 Oct 2024 18:33:48 +0200 Subject: [PATCH] added example to readme --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 77e18d1..01e694a 100644 --- a/README.md +++ b/README.md @@ -22,4 +22,11 @@ This is a basic example which shows you how to solve a common problem: ``` r library(gmresls) +# prepare a 4x3 toy problem Ax=b +A=rbind(diag(1:3)+matrix(1, 3,3), rep(1, 3)) +xsol=1:3 +b=A%*%xsol +f_Ax=function(x,...) list(...)$A%*%x +f_Br=function(r,...) t(list(...)$A)%*%r +x=gmresls(f_Ax, f_Br, b, A=A) ``` -- GitLab