Replies: 2 comments 1 reply
-
I'm not sure I understand what you're asking. I understand your title but nor your code. So I'll answer from what I understand from the title. If you're asking for the most beautiful way, I don't have an answer for you. I think ndarray doesn't provide anything useful to do what you want. If I had your problem, I'd simply code a function to do it. Calculate the sum of the lengths, allocate once, then iterate and push/insert. Maye using Iter::chain with collect. can help you. |
Beta Was this translation helpful? Give feedback.
-
I apologize. I didn't write it clearly. I'm trying to use this method: Note that it takes a reference to a slice of |
Beta Was this translation helpful? Give feedback.
-
concatenate
expects ArrayView's (ViewRepr). I'm doing some calculations and collecting them into a Vec, so I'll have Arrays (OwnedRepr). What's the best way to concatenate in that situation?I understand I could
v.iter().map(|x| x.view()).collect::<Vec<_>>()
but it seems unfortunate and messy that I would need to create a new Vec.Beta Was this translation helpful? Give feedback.
All reactions