/** * Run the solver to produce the raw eigenvectors * * @param inputPath the Path to the input corpus * @param outputPath the Path to the output * @param outputTmpPath a Path to a temporary working directory * @param numRows the int number of rows * @param numCols the int number of columns * @param isSymmetric true if the input matrix is symmetric * @param desiredRank the int desired rank of eigenvectors to produce * @return an int indicating success (0) or otherwise */ public int run( Path inputPath, Path outputPath, Path outputTmpPath, Path workingDirPath, int numRows, int numCols, boolean isSymmetric, int desiredRank) throws Exception { DistributedRowMatrix matrix = new DistributedRowMatrix(inputPath, outputTmpPath, numRows, numCols); matrix.setConf(new Configuration(getConf() != null ? getConf() : new Configuration())); LanczosState state; if (workingDirPath == null) { state = new LanczosState(matrix, desiredRank, getInitialVector(matrix)); } else { HdfsBackedLanczosState hState = new HdfsBackedLanczosState(matrix, desiredRank, getInitialVector(matrix), workingDirPath); hState.setConf(matrix.getConf()); state = hState; } solve(state, desiredRank, isSymmetric); Path outputEigenVectorPath = new Path(outputPath, RAW_EIGENVECTORS); serializeOutput(state, outputEigenVectorPath); return 0; }