summaryrefslogtreecommitdiff
path: root/src/matrix.zig
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2022-02-02 19:03:43 +0100
committerTom Barrett <tom@tombarrett.xyz>2022-02-02 19:03:43 +0100
commitb31f1d5379c61373f672fc689705acf902ad9cf9 (patch)
tree47086701735ae9077a41560501f8cfb7513bd941 /src/matrix.zig
parentb71d60ad473cf4771dc845c0ce0096bfc7ce8d6d (diff)
update for newest zig
Diffstat (limited to 'src/matrix.zig')
-rw-r--r--src/matrix.zig8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/matrix.zig b/src/matrix.zig
index e566bc4..41be14e 100644
--- a/src/matrix.zig
+++ b/src/matrix.zig
@@ -12,12 +12,12 @@ pub fn new(arena: *ArenaAllocator, h: usize, w: usize, x: []f32) matrix {
var m = matrix{
.h = h,
.w = w,
- .x = ArrayList(f32).init(&arena.allocator),
+ .x = ArrayList(f32).init(arena.allocator()),
};
var i: usize = 0;
while (i < h * w) : (i += 1) {
- if (m.x.append(x[i])) |val| {} else |err| {}
+ if (m.x.append(x[i])) |_| {} else |_| {}
}
return m;
@@ -39,14 +39,14 @@ pub fn dot(a: []f32, b: []f32, len: usize, step: usize) f32 {
}
pub fn multiply(arena: *ArenaAllocator, a: matrix, b: matrix) matrix {
- var x = ArrayList(f32).init(&arena.allocator);
+ var x = ArrayList(f32).init(arena.allocator());
var i: usize = 0;
var k: usize = 0;
while (i < a.h) : (i += 1) {
var j: usize = 0;
while (j < b.w) : (j += 1) {
- if (x.append(dot(a.x.items[k..], b.x.items[j..], a.w, b.w))) |val| {} else |err| {}
+ if (x.append(dot(a.x.items[k..], b.x.items[j..], a.w, b.w))) |_| {} else |_| {}
}
k += a.w;
}