Skip to content

nidtec-una/krysbas-dev

Repository files navigation

MATLAB tests miss_hit Julia tests Julia style codecov readthedocs Julia docs License: LGPL v3

KrySBAS: Krylov Subspace-Based Adaptive Solvers

KrySBAS logo

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.

Installation

MATLAB

Clone this repository and add the source directory to your MATLAB path:

addpath(genpath('matlab/src'))

Julia

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 KrySBAS

Solvers catalogue

All 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))

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))

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])

Contributing

If you wish to contribute to KrySBAS, please read the developer guide before opening a pull request.

Feature requests and bug reports

For feature requests and bug reports, please create an issue. For bug reports, please provide a minimal working example that reproduces the error.

About

A collection of Krylov Subspace-Based Adaptive Solvers (KrySBAS) for MATLAB/Octave and Julia

Topics

Resources

License

Stars

6 stars

Watchers

3 watching

Forks

Packages

 
 
 

Contributors