ph-math/src/main/java/com/helger/numbercruncher/matrix/LinearSystem.java
public ColumnVector solve (final ColumnVector b, final boolean improve) throws MatrixException
  {
    // Validate b's size.
    if (b.m_nRows != m_nRows)
    {
      throw new MatrixException (MatrixException.INVALID_DIMENSIONS);
    }

    decompose ();

    // Solve Ly = b for y by forward substitution.
    // Solve Ux = y for x by back substitution.
    final ColumnVector y = _forwardSubstitution (b);
    final ColumnVector x = _backSubstitution (y);

    // Improve and return x.
    if (improve)
      _improve (b, x);
    return x;
  }
public ColumnVector solve (final ColumnVector b, final boolean improve) throws MatrixException
  {
    // Validate b's size.
    if (b.m_nRows != m_nRows)
    {
      throw new MatrixException (MatrixException.INVALID_DIMENSIONS);
    }

    decompose ();

    // Solve Ly = b for y by forward substitution.
    // Solve Ux = y for x by back substitution.
    final ColumnVector y = _forwardSubstitution (b);
    final ColumnVector x = _backSubstitution (y);

    // Improve and return x.
    if (improve)
      _improve (b, x);
    return x;
  }
Solve Ax = b for x using the Gaussian elimination algorithm.

@param b
the right-hand-side column vector
@param improve
true to improve the solution
@return the solution column vector
@throws MatrixException
if an error occurred