} finally {
in.close();
}
Matrix aI = m.get();
Matrix omega = new RandomTrinaryMatrix(seed, aI.columnSize(), internalDimension, false);
Matrix y = aI.times(omega);
if (y2 == null) {
y2 = y.transpose().times(y);
} else {
y2.assign(y.transpose().times(y), Functions.PLUS);
}
}
r2 = new CholeskyDecomposition(y2);
// step 2, compute B
int ncols = 0;
for (File file : partsOfA) {
MatrixWritable m = new MatrixWritable();
final DataInputStream in = new DataInputStream(new FileInputStream(file));
try {
m.readFields(in);
} finally {
in.close();
}
Matrix aI = m.get();
ncols = Math.max(ncols, aI.columnSize());
Matrix omega = new RandomTrinaryMatrix(seed, aI.numCols(), internalDimension, false);
for (int j = 0; j < aI.numCols(); j += columnsPerSlice) {
Matrix yI = aI.times(omega);
Matrix aIJ = aI.viewPart(0, aI.rowSize(), j, Math.min(columnsPerSlice, aI.columnSize() - j));
Matrix bIJ = r2.solveRight(yI).transpose().times(aIJ);
addToSavedCopy(bFile(tmpDir, j), bIJ);