Fix performance regression from ScMatrix conversion to multi_type_matrix.