KrySBAS is a free and open-source toolbox of adaptive iterative solvers for sparse linear systems (Ax = b), based on Krylov subspaces. It is available for both MATLAB/GNU-Octave and Julia.
The toolbox is developed by the Scientific Computing and Applied Mathematics group at the NIDTEC research center of the Polytechnic Faculty, National University of Asunción, Paraguay.
Clone this repository and add the source directory to your MATLAB path:
addpath(genpath('matlab/src'))The Julia package lives in the julia/ subdirectory. Activate and instantiate it once:
using Pkg
Pkg.activate("julia/")
Pkg.instantiate()Then load the package in your code:
using KrySBASAll solvers share the same output signature: x, flag, relresvec, kdvec, time.
GMRES-E(m, d) — Morgan, 1995
Restarted GMRES augmented with d harmonic Ritz vectors approximating the smallest eigenvalues of the Krylov subspace.
MATLAB
[x, flag, relresvec, kdvec, time] = gmres_e(A, b, m, d, tol, maxit, xInitial, eigstol)Julia
x, flag, relresvec, kdvec, time = gmres_e(A, b; m=10, d=3, tol=1e-6, maxit=10, x_initial=zeros(n))LGMRES(m, l) — Baker, Jessup & Manteuffel, 2005
Restarted GMRES augmented with l error approximation vectors from prior restart cycles, preserving information from discarded search subspaces.
MATLAB
[x, flag, relresvec, kdvec, time] = lgmres(A, b, m, l, tol, maxit, xInitial)Julia
x, flag, relresvec, kdvec, time = lgmres(A, b; m=10, l=3, tol=1e-6, maxit=10, x_initial=zeros(n))PD-GMRES(m) — Núñez, Schaerer & Bhaya, 2018
Restarted GMRES with a Proportional-Derivative (PD) controller that automatically adapts the restart parameter m each cycle.
MATLAB
[x, flag, relresvec, kdvec, time] = pd_gmres(A, b, mInitial, mMinMax, mStep, tol, maxit, xInitial, alphaPD)Julia
x, flag, relresvec, kdvec, time = pd_gmres(A, b; m_initial=10, m_min_max=nothing, m_step=1,
tol=1e-6, maxit=10, x_initial=zeros(n), alpha_pd=[-3.0, 5.0])If you wish to contribute to KrySBAS, please read the developer guide before opening a pull request.
For feature requests and bug reports, please create an issue. For bug reports, please provide a minimal working example that reproduces the error.
