d.set(0, 0, 5);
d.set(1, 1, 3);
d.set(2, 2, 1);
d.set(3, 3, 0.5);
Matrix v = new RandomTrinaryMatrix(2, columns, rank, false);
Matrix a = u.times(d).times(v.transpose());
if (tmpDir != null) {
for (int i = 0; i < a.rowSize(); i += rowsPerSlice) {
MatrixWritable m = new MatrixWritable(a.viewPart(i, Math.min(a.rowSize() - i, rowsPerSlice), 0, a.columnSize()));
DataOutputStream out = new DataOutputStream(new FileOutputStream(new File(tmpDir, String.format("%s-%09d", aBase, i))));