final byte[][] DShallowCopy = Arrays.copyOf(D, D.length);
final ByteMatrix DM = new RowIndirected2DByteMatrix(Drows, Dcols, DShallowCopy, d);
for (int row = 0; row < Xrows; row++) {
// multiply X[row] by D
BasicByteVector prod = (BasicByteVector)X.multiplyRow(row, DM, 0, Xcols, LinearAlgebra.BASIC2D_FACTORY);
D[d[row]] = prod.getInternalArray();
}
// ISDCodeWriter.instance().writePhase3Code(X, Xrows, Xcols, d); // DEBUG
// DEBUG