code: private Matrix[] decomposeNonSymmetricMatrix(Matrix matrix) {
  
          Matrix A = matrix.copy();
          int n = matrix.columns();
  
          Matrix v = SparseMatrix.identity(n);
          Vector d = DenseVector.zero(n);
          Vector e = DenseVector.zero(n);
  
          Matrix h = A.copy();
          Vector ort = DenseVector.zero(n);
  
          // Reduce to Hessenberg form.
          orthes(h, v, ort);
  
          // Reduce Hessenberg to real Schur form.
          hqr2(h, v, d, e);
  
          Matrix dd = matrix.blankOfShape(n, n);
          for (int i = 0; i < n; i++) {
              dd.set(i, i, d.get(i));
  
              if (e.get(i) > 0) {
                  dd.set(i, i + 1, e.get(i));
              } else if (e.get(i) < 0) {
                  dd.set(i, i - 1, e.get(i));
              }
          }
  
          return new Matrix[] { v, dd };
      }
docs: Returns the result of Eigen decomposition for non-<a
  href="http://mathworld.wolfram.com/SymmetricMatrix.html">symmetric</a>
  matrix
  <p>
  See <a href="http://mathworld.wolfram.com/EigenDecomposition.html">
  http://mathworld.wolfram.com/EigenDecomposition.html</a> for more
  details.
  </p>
  
  @param matrix
  @return { P, D }