// Allocate general dense 3x4 matrix: auto denseMatrix = matrix!real(3, 4); // Allocate dense 3x2 zero-filled matrix: auto denseZeroMatrix = matrix!real(3, 2, 0.0L); // Allocate lower triangular 3x3 matrix: auto loMatrix = matrix!(real, Storage.Triangular, Triangle.Lower)(3); // Allocate upper triangular 2x2 matrix where the upper // triangular elements are set to 3.14. auto upMatrix = matrix!(real, Storage.Triangular)(2, 3.14L);
A convenience function that allocates memory for a matrix (using the GC), optionally sets the values of the matrix elements, and returns a MatrixView of the allocated memory.