Skip to content

Gaussian elimination algorithm implemented in purescript.

Notifications You must be signed in to change notification settings

emilhaugberg/gaussian-elimination

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gaussian Elimination

This implements the Gaussian elimination algorithm in PureScript, and can be used for solving systems of linear equations.

Usage

Let's say you have the following system of linear equations:

x      - z = 0
x  + y     = 1
-x + y + z = 4

Filling in the coefficients and the constant results in the following augmented matrix:

let m = Matrix
 [ [  1.0, 0.0, -1.0, 0.0 ]
 , [  1.0, 1.0,  0.0, 1.0 ]
 , [ -1.0, 1.0,  1.0, 4.0 ]
 ]

Pass this to the gauss function defined in Data.Gaussian, and the result will be:

> gauss m
[ -1.0, 4.0, -1.0 ]

wrapped in an Either.

About

Gaussian elimination algorithm implemented in purescript.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published