Skip to content
/ sanic Public

Fast routines for solving large systems of linear equations in R. Makes Eigen Cholesky-, LU-, QR-, and iterative (Conjugate Gradient, BiCGSTAB) solvers for both dense and sparse problems available.

License

Notifications You must be signed in to change notification settings

nk027/sanic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sanic: Solving Ax = b Nimbly in C++

CRAN month total

Routines for solving large systems of linear equations in R. Direct and iterative solvers from the Eigen C++ library are made available. Solvers include Cholesky, LU, QR, and Krylov subspace methods (Conjugate Gradient, BiCGSTAB). Both dense and sparse problems are supported.

Installation

sanic is available on CRAN. The development version can be installed from GitHub.

install.packages("sanic")
devtools::install_github("nk027/sanic")

Usage

To solve a linear system of equations, use the solve2() function for automatic dispatch to a specific solver or access the LU, QR, Cholesky or Conjugate Gradient solvers directly.

To solve an eigenproblem, use the eigen2() or svd2() functions, or the arnoldi() function.

Solvers

Solver Function Notes Sparse Reference
LU decomposition solve_lu() Partial pivoting, full pivoting Yes 1, 2, 3
Householder QR decomposition solve_qr() Column pivoting, full pivoting, no pivoting Yes 1, 2, 3, 4
Cholesky decomposition solve_chol() LDLT for semidefinite problems, LLT for positive definite problems Yes 1, 2 3, 4
Conjugate Gradient (CG) solve_cg() Biconjugate gradient stabilised (BiCGTAB) for square problems, least squares (LSCG) for rectangular problems, classic CG for symmetric positive definite problems, preconditioners Always 1, 2, 3

Eigenproblems

Solver Function Notes Sparse Reference
Spectral decomposition eigen2() Square and symmetric problems No 1, 2
Singular value decomposition svd2() Bidiagonal Divide and Conquer SVD for large and Jacobi SVD for small problems No 1, 2
Arnoldi iteration arnoldi() Square problems using an iteratively constructed Hessenberg matrix Always 1
Lanczos algorithm lanczos() Symmetric problems using an iteratively constructed tridiagonal matrix Always 1

About

Fast routines for solving large systems of linear equations in R. Makes Eigen Cholesky-, LU-, QR-, and iterative (Conjugate Gradient, BiCGSTAB) solvers for both dense and sparse problems available.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published