use of dr.math.Procrustes in project beast-mcmc by beast-dev.
the class ProcrustesTest method runTest.
private void runTest(double[][] X, double[][] Xstar, double[][] goldStandard, boolean allowTranslation, boolean allowDilation, double tolerance, String header) {
RealMatrix rmX = new Array2DRowRealMatrix(X);
RealMatrix rmXstar = new Array2DRowRealMatrix(Xstar);
Procrustes procrustes = new Procrustes(rmX, rmXstar, allowTranslation, allowDilation);
RealMatrix rmXnew = procrustes.procrustinate(rmX);
System.out.println(header);
System.out.print("Translation:\n" + new Matrix(procrustes.getTranslation().getData()));
System.out.println("Dilation = " + procrustes.getDilation());
System.out.println("Xnew:");
System.out.println(new Matrix(rmXnew.getData()));
assertEquals(rmXnew.getData(), goldStandard, tolerance);
}
Aggregations