}
@Test
public void testDistributedLanczosSolverEVJCLI() throws Exception {
Path testData = getTestTempDirPath("testdata");
DistributedRowMatrix corpus = new TestDistributedRowMatrix()
.randomDenseHierarchicalDistributedMatrix(10, 9, false, testData.toString());
corpus.setConf(getConfiguration());
Path output = getTestTempDirPath("output");
Path tmp = getTestTempDirPath("tmp");
String[] args = {
"-i", new Path(testData, "distMatrix").toString(),
"-o", output.toString(),
"--tempDir", tmp.toString(),
"--numRows", "10",
"--numCols", "9",
"--rank", "6",
"--symmetric", "false",
"--cleansvd", "true"
};
ToolRunner.run(getConfiguration(), new DistributedLanczosSolver().new DistributedLanczosSolverJob(), args);
Path cleanEigenvectors = new Path(output, EigenVerificationJob.CLEAN_EIGENVECTORS);
Matrix eigenVectors = new DenseMatrix(6, corpus.numCols());
Collection<Double> eigenvalues = Lists.newArrayList();
output = getTestTempDirPath("output2");
tmp = getTestTempDirPath("tmp2");
args = new String[] {
"-i", new Path(testData, "distMatrix").toString(),
"-o", output.toString(),
"--tempDir", tmp.toString(),
"--numRows", "10",
"--numCols", "9",
"--rank", "7",
"--symmetric", "false",
"--cleansvd", "true"
};
ToolRunner.run(getConfiguration(), new DistributedLanczosSolver().new DistributedLanczosSolverJob(), args);
Path cleanEigenvectors2 = new Path(output, EigenVerificationJob.CLEAN_EIGENVECTORS);
Matrix eigenVectors2 = new DenseMatrix(7, corpus.numCols());
Configuration conf = getConfiguration();
Collection<Double> newEigenValues = Lists.newArrayList();
int i = 0;
for (VectorWritable value : new SequenceFileValueIterable<VectorWritable>(cleanEigenvectors, conf)) {