本文整理汇总了Java中org.ejml.interfaces.decomposition.EigenDecomposition类的典型用法代码示例。如果您正苦于以下问题:Java EigenDecomposition类的具体用法?Java EigenDecomposition怎么用?Java EigenDecomposition使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EigenDecomposition类属于org.ejml.interfaces.decomposition包,在下文中一共展示了EigenDecomposition类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getEigenvectors
import org.ejml.interfaces.decomposition.EigenDecomposition; //导入依赖的package包/类
/**
* Calculates a List of eigenvalues and eigenvectors from the provided 3x3 (covariance) matrix.
*
* @param matrix 3x3 Matrix to derive the eigenvalues and eigenvectors from.
* @return List of pairs containing both the eigenvalues and the eigenvectors. The entries are
* sorted in ascending order of the eigenvalue.
*/
private static List<Pair<Float,Vector3f>> getEigenvectors(DenseMatrix64F matrix) {
List<Pair<Float,Vector3f>> eigenvectors = new ArrayList<>();
EigenDecomposition<DenseMatrix64F> eig = DecompositionFactory.eig(3, true);
eig.decompose(matrix);
int eigValNum = eig.getNumberOfEigenvalues();
for(int i = 0; i < eigValNum; i++){
DenseMatrix64F eigMat = eig.getEigenVector(i);
if(eigMat != null){
eigenvectors.add(new Pair<>((float)eig.getEigenvalue(i).getReal(), new Vector3f((float)eigMat.get(0,0), (float)eigMat.get(1,0), (float)eigMat.get(2,0))));
}
}
eigenvectors.sort(Comparator.comparing(e -> e.first));
return eigenvectors;
}
开发者ID:vitrivr,项目名称:cineast,代码行数:26,代码来源:MeshTransformUtil.java示例2: defaultSymm
import org.ejml.interfaces.decomposition.EigenDecomposition; //导入依赖的package包/类
public static long defaultSymm(DMatrixRMaj orig , int numTrials ) {
EigenDecomposition<DMatrixRMaj> alg = DecompositionFactory_DDRM.eig(orig.numCols, true, true);
long prev = System.currentTimeMillis();
for( long i = 0; i < numTrials; i++ ) {
if( !DecompositionFactory_DDRM.decomposeSafe(alg,orig) ) {
throw new RuntimeException("Bad matrix");
}
}
return System.currentTimeMillis() - prev;
}
开发者ID:lessthanoptimal,项目名称:ejml,代码行数:15,代码来源:BenchmarkSymmetricEigenDecomposition.java示例3: testVectorsLinearlyIndependent
import org.ejml.interfaces.decomposition.EigenDecomposition; //导入依赖的package包/类
/**
* Checks to see if all the real eigenvectors are linearly independent of each other.
*/
public void testVectorsLinearlyIndependent( EigenDecomposition<DMatrixRMaj> alg ) {
int N = alg.getNumberOfEigenvalues();
// create a matrix out of the eigenvectors
DMatrixRMaj A = new DMatrixRMaj(N,N);
int off = 0;
for( int i = 0; i < N; i++ ) {
DMatrixRMaj v = alg.getEigenVector(i);
// it can only handle real eigenvectors
if( v == null )
off++;
else {
for( int j = 0; j < N; j++ ) {
A.set(i-off,j,v.get(j));
}
}
}
// see if there are any real eigenvectors
if( N == off )
return;
A.reshape(N-off,N, false);
assertTrue(MatrixFeatures_DDRM.isRowsLinearIndependent(A));
}
开发者ID:lessthanoptimal,项目名称:ejml,代码行数:32,代码来源:GeneralEigenDecompositionCheck_DDRM.java示例4: getEVD
import org.ejml.interfaces.decomposition.EigenDecomposition; //导入依赖的package包/类
/**
* Returns the underlying decomposition that this is a wrapper around.
*
* @return EigenDecomposition
*/
public EigenDecomposition getEVD() {
return eig;
}
开发者ID:lessthanoptimal,项目名称:ejml,代码行数:9,代码来源:SimpleEVD.java本文标签属性:
示例:示例是什么意思
代码:代码生成器
java:java面试题
EigenDecomposition:EigenDecomposition