Main       Commercial support       FAQ       Forum       Contact Us

Systems of linear equations

Systems of linear equations Ax=b may be divided into two classes: those with square non-degenerate A and those with rectangular possibly rank deficient A. ALGLIB package have subroutines for both types of problems.

Contents

    Subroutines: general system
    Subroutines: SPD/HPD system
    Subroutines: non-square possibly singular system
    Performance
    Iterative refinement
    Manual entries

Subroutines: general system

The following subroutines can be used to solve real/complex systems with general form NxN non-singular matrix:

These subroutines can be divided into following groups:

The latter requires some more explanations:

Subroutines: SPD/HPD system

The following subroutines can be used to solve real/complex systems with symmetric/Hermitian positive definite matrix:

Naming conventions are the same as in previous section. It should be noted that subroutines from this section do not support iterative refinement.

Subroutines: non-square possibly singular system

RMatrixSolveLS solves systems with rectangular possibly degenerate matrix. Is system matrix is rank deficient, solution in a least squares sense is searched for. Subroutine supports iterative refinement. Current version of ALGLIB doesn't include complex version of this subroutine or version which accept multiple right-hand parts.

Performance

Several factors influence linear solver performance:

Iterative refinement

Iterative refinement is a method proposed by James H. Wilkinson to improve the accuracy of numerical solutions to systems of linear equations. After system has been solved and solutionx has been found, we calculate residual r=b-Ax and use it to refine solution: Ad=r, x=x+d Operation may be repeated several times. In ALGLIB package two-pass iterative refinement is used.

Note #1
Iterative refinement can decrease errors which arise due to floating point round-off. It can make solution as precise as condition number of A allows. However, refinement result depends on accuracy with which b-Ax is calculated. For iterative refinement to be worth the effort this difference must be calculated with much higher precision than that was used to find a solution. ALGLIB solver uses portable extra-precise matrix multiplier. It allows to calculate b-Ax with maximum precision possible given than A and b may have errors as large as one ULP. "Portable" in this context means that it doesn't use architecture-specific or compiler-specific extensions (like 80-bit Intel floating point type) nor it contains low level assembler code.

Manual entries

C++ densesolver.h   
C# densesolver.cs   
MPFR densesolver.h   
Delphi densesolver.pas   
FreePascal densesolver.pas   
VBA densesolver.bas   

This article is intended for personal use only.

Download ALGLIB

C#

C# source.

Downloads page

 

C++

C++ source.

Downloads page

 

C++, multiple precision arithmetic

C++ source. MPFR/GMP is used.

GMP source is available from gmplib.org. MPFR source is available from www.mpfr.org.

Downloads page

 

FreePascal

FreePascal source.

Downloads page

 

Delphi

Delphi source.

Downloads page

 

Visual Basic

VBA source.

Downloads page

 

 

ALGLIB project, 1999-2010