code: public static INDArray[] principalComponents(INDArray cov) {
          Preconditions.checkArgument(cov.isMatrix() && cov.isSquare(), "Convariance matrix must be a square matrix: has shape %s", cov.shape());
          INDArray[] result = new INDArray[2];
          result[0] = Nd4j.eye(cov.rows());
          result[1] = Eigen.symmetricGeneralizedEigenvalues(result[0], cov, true);
          return result;
      }
docs: Calculates the principal component vectors and their eigenvalues (lambda) for the covariance matrix.
  The result includes two things: the eigenvectors (modes) as result[0] and the eigenvalues (lambda)
  as result[1].
  
  @param cov The covariance matrix (calculated with the covarianceMatrix(in) method)
  @return Array INDArray[2] "result".  The principal component vectors in decreasing flexibility are
  the columns of element 0 and the eigenvalues are element 1.