what's the proper way to cast to slice for multidimensional arrays?
pub const Matrix2 = struct {
I: usize,
J: usize,
M: [][]f32,
allocator: ?std.mem.Allocator,
}
...
var values = [5][3]f32{
[_]f32{23.0, 16.0, 18.0},
[_]f32{21.0, 23.0, 22.0},
[_]f32{24.0, 20.0, 25.0},
[_]f32{17.0, 21.0, 21.0},
[_]f32{19.0, 18.0, 20.0},
};
var matrix = Matrix2{ .I = 5, .J = 3, .M = &values };
I get an error
error: expected type '[][]f32', found '*[5][3]f32'
var matrix = Matrix2{ .I = 5, .J = 3, .M = &values };
^~~~~~~
src/anova_tests.zig:16:48: note: pointer type child '[3]f32' cannot cast into pointer type child '[]f32'