Closed
Description
I have two vectors, and want to multiply them to a 2d matrix by transposing one of them.
Currently I am using nalgebra + ndarray for that:
let a = // the 1d ndarray
let a = Vector::from(a.to_vec()); // convert to nalgebra
let a_adjoint = a.adjoint(); // transpose
let b = a * a_adjoint; // create matrix in nalgebra
let b = Array2::from_shape_fn((a_len, a_len), |i| b [i]);
Both better integration with nalgebra (adding some From
implementations through a feature flag) or supporting this operation directly would help.
Maybe there is a better way to do this I'm not seeing.
Metadata
Metadata
Assignees
Labels
No labels