private void secondPass() throws IOException { qSolver = null; // release mem FileSystem localFs = FileSystem.getLocal(jobConf); SequenceFile.Reader tempQr = new SequenceFile.Reader(localFs, tempQPath, jobConf); closeables.addFirst(tempQr); int qCnt = 0; while (tempQr.next(tempKey, value)) { value .setBlock(GivensThinSolver.computeQtHat(value.getBlock(), qCnt, new CopyConstructorIterator<UpperTriangular>(rSubseq .iterator()))); if (qCnt == 1) { /* * just merge r[0] <- r[1] so it doesn't have to repeat in subsequent * computeQHat iterators */ GivensThinSolver.mergeR(rSubseq.get(0), rSubseq.remove(1)); } else { qCnt++; } outputQHat(value); } assert rSubseq.size() == 1; outputR(new VectorWritable(new DenseVector(rSubseq.get(0).getData(), true))); }
private void secondPass() throws IOException { qSolver = null; // release mem FileSystem localFs = FileSystem.getLocal(jobConf); SequenceFile.Reader tempQr = new SequenceFile.Reader(localFs, tempQPath, jobConf); closeables.addFirst(tempQr); int qCnt = 0; while (tempQr.next(tempKey, value)) { value .setBlock(GivensThinSolver.computeQtHat(value.getBlock(), qCnt, new CopyConstructorIterator<>(rSubseq.iterator()))); if (qCnt == 1) { /* * just merge r[0] <- r[1] so it doesn't have to repeat in subsequent * computeQHat iterators */ GivensThinSolver.mergeR(rSubseq.get(0), rSubseq.remove(1)); } else { qCnt++; } outputQHat(value); } assert rSubseq.size() == 1; outputR(new VectorWritable(new DenseVector(rSubseq.get(0).getData(), true))); }
private void secondPass() throws IOException { qSolver = null; // release mem FileSystem localFs = FileSystem.getLocal(jobConf); SequenceFile.Reader tempQr = new SequenceFile.Reader(localFs, tempQPath, jobConf); closeables.addFirst(tempQr); int qCnt = 0; while (tempQr.next(tempKey, value)) { value .setBlock(GivensThinSolver.computeQtHat(value.getBlock(), qCnt, new CopyConstructorIterator<UpperTriangular>(rSubseq .iterator()))); if (qCnt == 1) { /* * just merge r[0] <- r[1] so it doesn't have to repeat in subsequent * computeQHat iterators */ GivensThinSolver.mergeR(rSubseq.get(0), rSubseq.remove(1)); } else { qCnt++; } outputQHat(value); } assert rSubseq.size() == 1; outputR(new VectorWritable(new DenseVector(rSubseq.get(0).getData(), true))); }
private void flushQBlocks() throws IOException { if (blockCnt == 1) { /* * only one block, no temp file, no second pass. should be the default * mode for efficiency in most cases. Sure mapper should be able to load * the entire split in memory -- and we don't require even that. */ value.setBlock(qSolver.getThinQtTilde()); outputQHat(value); outputR(new VectorWritable(new DenseVector(qSolver.getRTilde().getData(), true))); } else { secondPass(); } }
private void flushQBlocks() throws IOException { if (blockCnt == 1) { /* * only one block, no temp file, no second pass. should be the default * mode for efficiency in most cases. Sure mapper should be able to load * the entire split in memory -- and we don't require even that. */ value.setBlock(qSolver.getThinQtTilde()); outputQHat(value); outputR(new VectorWritable(new DenseVector(qSolver.getRTilde().getData(), true))); } else { secondPass(); } }
private void flushQBlocks() throws IOException { if (blockCnt == 1) { /* * only one block, no temp file, no second pass. should be the default * mode for efficiency in most cases. Sure mapper should be able to load * the entire split in memory -- and we don't require even that. */ value.setBlock(qSolver.getThinQtTilde()); outputQHat(value); outputR(new VectorWritable(new DenseVector(qSolver.getRTilde().getData(), true))); } else { secondPass(); } }