Open
Description
Forgive me if this already exists, because I couldn't find it in the docs, but is there a way to construct a matrix row-by-row using an iterator? (for cases when source data structure already represents them in row-by-row form)
Currently the only way I found is creating matrix NxM
using from_iterator
, and then invoking transpose
to get MxN
, but this is rather inefficient - first, it needs to fill in matrix in incorrect order, then construct a separate matrix (transpose_mut
fails because it says it works only on square matrices), and then walk over all the temporary data rearranging items in correct order.