RealMatrix translation = multiply(y1, x2);
FastByIDMap<float[]> xMerged = MatrixUtils.multiply(translation.transpose(), x1);
FastIDSet emptySet = new FastIDSet();
FastByIDMap<FastIDSet> knownItems = new FastByIDMap<FastIDSet>();
LongPrimitiveIterator it = xMerged.keySetIterator();
while (it.hasNext()) {
knownItems.put(it.nextLong(), emptySet);
}
FastIDSet x1ItemTagIDs = model1.getItemTagIDs();
FastIDSet y2UserTagIDs = model2.getUserTagIDs();
Generation merged = new Generation(knownItems, xMerged, y2, x1ItemTagIDs, y2UserTagIDs);
GenerationSerializer.writeGeneration(merged, mergedModelFile);
}