From 43ac6ca8f4e68e87f673768d22429119422c325f Mon Sep 17 00:00:00 2001 From: gingerBill Date: Fri, 26 Mar 2021 16:24:56 +0000 Subject: [PATCH] Add `linalg.matrix_cast` --- core/container/priority_queue.odin | 2 +- core/math/linalg/general.odin | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/container/priority_queue.odin b/core/container/priority_queue.odin index 4b1a76c37..8f3f6bb32 100644 --- a/core/container/priority_queue.odin +++ b/core/container/priority_queue.odin @@ -3,7 +3,7 @@ package container Priority_Queue :: struct(T: typeid) { data: Array(T), len: int, - priority: proc(item: T) -> int + priority: proc(item: T) -> int, } priority_queue_init_none :: proc(q: ^$Q/Priority_Queue($T), f: proc(item: T) -> int, allocator := context.allocator) { diff --git a/core/math/linalg/general.odin b/core/math/linalg/general.odin index 0236f6130..84001184f 100644 --- a/core/math/linalg/general.odin +++ b/core/math/linalg/general.odin @@ -317,11 +317,12 @@ cubic :: proc(v1, v2, v3, v4: $T/[$N]$E, s: E) -> T { array_cast :: proc(v: $A/[$N]$T, $Elem_Type: typeid) -> (w: [N]Elem_Type) { - for _, i in v do w[i] = Elem_Type(v[i]); + for i in 0.. (w: [M][N]Elem_Type) { for i in 0..