Java 类weka.core.matrix.EigenvalueDecomposition 实例源码

项目:autoweka    文件:PLSFilter.java   
/**
 * determines the dominant eigenvector for the given matrix and returns it
 * 
 * @param m     the matrix to determine the dominant eigenvector for
 * @return      the dominant eigenvector
 */
protected Matrix getDominantEigenVector(Matrix m) {
  EigenvalueDecomposition   eigendecomp;
  double[]          eigenvalues;
  int               index;
  Matrix            result;

  eigendecomp = m.eig();
  eigenvalues = eigendecomp.getRealEigenvalues();
  index       = Utils.maxIndex(eigenvalues);
  result    = columnAsVector(eigendecomp.getV(), index);

  return result;
}
项目:jbossBA    文件:PLSFilter.java   
/**
 * determines the dominant eigenvector for the given matrix and returns it
 * 
 * @param m     the matrix to determine the dominant eigenvector for
 * @return      the dominant eigenvector
 */
protected Matrix getDominantEigenVector(Matrix m) {
  EigenvalueDecomposition   eigendecomp;
  double[]          eigenvalues;
  int               index;
  Matrix            result;

  eigendecomp = m.eig();
  eigenvalues = eigendecomp.getRealEigenvalues();
  index       = Utils.maxIndex(eigenvalues);
  result    = columnAsVector(eigendecomp.getV(), index);

  return result;
}