类 GaussJordanElimination


  • public class GaussJordanElimination
    extends java.lang.Object
    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 GaussianElimination 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.

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

    • 构造器概要

      构造器 
      构造器 说明
      GaussJordanElimination​(double[][] A, double[] b)
      Solves the linear system of equations Ax = b, where A is an n-by-n matrix and b is a length n vector.
    • 方法概要

      修饰符和类型 方法 说明
      double[] dual()
      Returns a solution to the linear system of equations yA = 0, yb ≠ 0.
      boolean isFeasible()
      Returns true if there exists a solution to the linear system of equations Ax = b.
      static void main​(java.lang.String[] args)
      Unit tests the GaussJordanElimination data type.
      double[] primal()
      Returns a solution to the linear system of equations Ax = b.
      • 从类继承的方法 java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 构造器详细资料

      • GaussJordanElimination

        public GaussJordanElimination​(double[][] A,
                                      double[] b)
        Solves the linear system of equations Ax = b, where A is an n-by-n matrix and b is a length n vector.
        参数:
        A - the n-by-n constraint matrix
        b - the length n right-hand-side vector
    • 方法详细资料

      • primal

        public double[] primal()
        Returns a solution to the linear system of equations Ax = b.
        返回:
        a solution x to the linear system of equations Ax = b; null if no such solution
      • dual

        public double[] dual()
        Returns a solution to the linear system of equations yA = 0, yb ≠ 0.
        返回:
        a solution y to the linear system of equations yA = 0, yb ≠ 0; null if no such solution
      • isFeasible

        public boolean isFeasible()
        Returns true if there exists a solution to the linear system of equations Ax = b.
        返回:
        true if there exists a solution to the linear system of equations Ax = b; false otherwise
      • main

        public static void main​(java.lang.String[] args)
        Unit tests the GaussJordanElimination data type.
        参数:
        args - the command-line arguments