Click or drag to resize
GaussJordanElimination Class

The GaussJordanElimination data type provides methods to solve a linear system of equations Ax = B, where A is an N-by-N matrix and B is a length N vector. If no solution exists, it finds a solution Y to YA = 0, Yb != 0, which which serves as a certificate of infeasibility.

This implementation uses Gauss-Jordan elimination with partial pivoting. See for an implementation that uses Gaussian elimination (but does not provide the certificate of infeasibility). For an industrial-strength numerical linear algebra library, see JAMA.

Inheritance Hierarchy
SystemObject
  Algs4NetGaussJordanElimination

Namespace: Algs4Net
Assembly: Algs4Net (in Algs4Net.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
C#
public class GaussJordanElimination

The GaussJordanElimination type exposes the following members.

Constructors
  NameDescription
Public methodGaussJordanElimination
Solves the linear system of equations Ax = B where A is an N-by-N matrix and B is a length N vector.
Top
Properties
  NameDescription
Public propertyIsFeasible
Returns true if there exists a solution to the linear system of equations Ax = B.
Top
Methods
  NameDescription
Public methodDual
Returns a solution to the linear system of equations YA = 0, Yb != 0.
Public methodStatic memberMainTest
Demo test the GaussJordanElimination data type.
Public methodPrimal
Returns a solution to the linear system of equations Ax = B.
Top
Remarks

For additional documentation, see Section 9.9Algorithms, 4th Edition by Robert Sedgewick and Kevin Wayne.

This class is a C# port from the original Java class GaussJordanElimination implementation by the respective authors.

See Also