You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is the state of the matrix concatenation discussion/implementation? I've searched the issues and there seem to be multiple approaches in play at the moment.
As a user of nalgebra I'm missing this feature a lot. My best workaround at the moment seems to be:
Construct a new fixed-size Matrix, which fits both of the matrices I want to concatenate, with arbitrary values. (All my matrices are currently fixed-size.)
Call target_matrix.fixed_view_mut::<n, m>(x, y).clone_from(&source_matrix) for each source Matrix. Note that n and m can't be inferred, which makes it pretty clunky.
Any insight into when there might be a feature for this as well as better workarounds is much appreciated! Thanks a lot to the nalgebra contributors for this beautiful crate.
EDIT: My workaround above actually only seems to work if the source matrix has one column. (Haven't tied with one row.) Attempting to clone_from a 3x3 matrix into the top of a 4x3 matrix, I get:
error[E0599]: the method `clone_from` exists for struct `Matrix<f32, Const<3>, Const<3>, ViewStorageMut<'_, f32, Const<3>, Const<3>, Const<1>, Const<4>>>`, but its trait bounds were not satisfied
= note: the following trait bounds were not satisfied:
`ViewStorageMut<'_, f32, Const<3>, Const<3>, Const<1>, Const<4>>: Clone`
which is required by `Matrix<f32, Const<3>, Const<3>, ViewStorageMut<'_, f32, Const<3>, Const<3>, Const<1>, Const<4>>>: Clone`
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
What is the state of the matrix concatenation discussion/implementation? I've searched the issues and there seem to be multiple approaches in play at the moment.
As a user of nalgebra I'm missing this feature a lot. My best workaround at the moment seems to be:
Matrix
, which fits both of the matrices I want to concatenate, with arbitrary values. (All my matrices are currently fixed-size.)target_matrix.fixed_view_mut::<n, m>(x, y).clone_from(&source_matrix)
for each sourceMatrix
. Note thatn
andm
can't be inferred, which makes it pretty clunky.Any insight into when there might be a feature for this as well as better workarounds is much appreciated! Thanks a lot to the nalgebra contributors for this beautiful crate.
EDIT: My workaround above actually only seems to work if the source matrix has one column. (Haven't tied with one row.) Attempting to
clone_from
a 3x3 matrix into the top of a 4x3 matrix, I get:EDIT 2:
copy_from
works though. (T
isf32
.)Beta Was this translation helpful? Give feedback.
All reactions