fromArray
This commit is contained in:
@@ -39,6 +39,10 @@ pub fn Matrix(rows: comptime_int, cols: comptime_int, T: type) type {
|
|||||||
fn array(self: Self) [self.rows]T {
|
fn array(self: Self) [self.rows]T {
|
||||||
return @bitCast(self.mat);
|
return @bitCast(self.mat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn fromArray(a: [rows]T) Self {
|
||||||
|
return .{ .mat = @bitCast(a) };
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
pub const get = if (cols == 1) vector.get else @compileError("Not a vector");
|
pub const get = if (cols == 1) vector.get else @compileError("Not a vector");
|
||||||
|
|||||||
Reference in New Issue
Block a user