code: public double[] solve(double[] b) {
      final double[] sol = solveInplace(copy(b));
      return n < sol.length ? Arrays.copyOf(sol, n) : sol;
    }
docs: Least squares solution of A*X = b
  
  @param b A column vector with as many rows as A.
  @return X that minimizes the two norm of Q*R*X-b.
  @throws IllegalArgumentException Matrix row dimensions must agree.
  @throws ArithmeticException Matrix is rank deficient.