This PR introduces four new macros to
The intention here is to simplify matrix/vector construction by improving readability, ease-of-use and ensuring that the matrix construction is as fast as possible.
use nalgebra::matrix; // Directly constructs an SMatrix<_, 2, 3> let a = matrix![1, 2, 3; 4, 5, 6];
Benefits over e.g.
The user guide should probably be updated to accommodate these macros. My suggestion is to make these macros the de-facto way of constructing matrices with
This allows us to avoid injecting unsafe code into every macro invocation, which seems desirable.
Semantics, mostly. Although a vector is also a matrix, matrices and vectors often play different roles in applications, so at least in my opinion it benefits readability to distinguish them at the syntax level (although you can indeed use
Hey @Andlon, this is an amazing PR. Thank you! I will review this within the next few days.
I agree. I will take care of this later this month.