本文整理汇总了Java中no.uib.cipr.matrix.EVD类的典型用法代码示例。如果您正苦于以下问题:Java EVD类的具体用法?Java EVD怎么用?Java EVD使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
EVD类属于no.uib.cipr.matrix包,在下文中一共展示了EVD类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getPrincipleCurvatures
import no.uib.cipr.matrix.EVD; //导入依赖的package包/类
public static <
V extends Vertex<V, E, F>,
E extends Edge<V, E, F>,
F extends Face<V, E, F>
> double[] getPrincipleCurvatures(
double[] p,
double radius,
KdTree<V, E, F> kd,
AdapterSet a
) {
EVD evd = getCurvatureTensor(p, radius, kd, a);
double[] eigVal= evd.getRealEigenvalues();
LinkedList<Double> minMax = new LinkedList<Double>();
minMax.add(eigVal[0]);
minMax.add(eigVal[1]);
minMax.add(eigVal[2]);
int index = getIndexOfMinMagnitude(eigVal);
minMax.remove(index);
if(minMax.get(1)<minMax.get(0)) {
minMax.addFirst(minMax.removeLast());
}
eigVal[0]=minMax.get(0);
eigVal[1]=minMax.get(1);
return eigVal;
}
示例2: getSortedEigenVectors
import no.uib.cipr.matrix.EVD; //导入依赖的package包/类
/**
* The Eigenvector for the absolutely smallest Eigenvalue
* is sorted to the back. The two other vectors are sorted
* such that their Eigenvalues are ascending
* @param evd
* @return
*/
public static double[][] getSortedEigenVectors(EVD evd){
double[] eigVal = evd.getRealEigenvalues();
DenseMatrix eigVec = evd.getRightEigenvectors();
double[][] eigVecArr = new double[3][3];
for (int i = 0; i < 3; i++) {
for (int j = 0; j < 3; j++) {
eigVecArr[i][j]= eigVec.get(j,i);
}
}
//get minimal magnitude
int i3 = getIndexOfMinMagnitude(eigVal);
int i1 = (i3 + 1) % 3;
int i2 = (i3 + 2) % 3;
double k1 = eigVal[i1];
double k2 = eigVal[i2];
double[][] r = new double[3][];
r[0] = k1 < k2 ? eigVecArr[i1] : eigVecArr[i2];
r[1] = k1 < k2 ? eigVecArr[i2] : eigVecArr[i1];
r[2] = eigVecArr[i3];
return r;
}
示例3: getSortedEigenValues
import no.uib.cipr.matrix.EVD; //导入依赖的package包/类
public static double[] getSortedEigenValues(EVD evd){
double[] eigVal = evd.getRealEigenvalues();
//get minimal magnitude
int i3 = getIndexOfMinMagnitude(eigVal);
int i1 = (i3 + 1) % 3;
int i2 = (i3 + 2) % 3;
double k1 = eigVal[i1];
double k2 = eigVal[i2];
double[] r = new double[3];
r[0] = k1 < k2 ? k1 : k2;
r[1] = k1 < k2 ? k2 : k1;
r[2] = eigVal[i3];
return r;
}
示例4: eig
import no.uib.cipr.matrix.EVD; //导入依赖的package包/类
public Matrix[] eig() {
try {
EVD evd = EVD.factorize(getWrappedObject());
Matrix v = new MTJDenseDoubleMatrix2D(evd.getRightEigenvectors());
int m = (int) getRowCount();
double[] evds = evd.getRealEigenvalues();
Matrix d = new MTJDenseDoubleMatrix2D(m, m);
for (int i = 0; i < m; i++) {
d.setAsDouble(evds[i], i, i);
}
return new Matrix[] { v, d };
} catch (Exception e) {
throw new RuntimeException(e);
}
}