diff --git a/core/math/linalg/general.odin b/core/math/linalg/general.odin index 318605ccf..53980d255 100644 --- a/core/math/linalg/general.odin +++ b/core/math/linalg/general.odin @@ -41,7 +41,7 @@ scalar_dot :: proc(a, b: $T) -> T where IS_FLOAT(T), !IS_ARRAY(T) { return a * b; } -vector_dot :: proc(a, b: $T/[$N]$E) -> (c: E) where IS_NUMERIC(E) { +vector_dot :: proc(a, b: $T/[$N]$E) -> (c: E) where IS_NUMERIC(E) #no_bounds_check { for i in 0.. (c: f64) { dot :: proc{scalar_dot, vector_dot, quaternion64_dot, quaternion128_dot, quaternion256_dot}; inner_product :: dot; -outer_product :: proc(a: $A/[$M]$E, b: $B/[$N]E) -> (out: [M][N]E) where IS_NUMERIC(E) { +outer_product :: proc(a: $A/[$M]$E, b: $B/[$N]E) -> (out: [M][N]E) where IS_NUMERIC(E) #no_bounds_check { for i in 0.. T where IS_NUMERIC(E) { return dot(x, normal) / dot(normal, normal) * normal; } -identity :: proc($T: typeid/[$N][N]$E) -> (m: T) { +identity :: proc($T: typeid/[$N][N]$E) -> (m: T) #no_bounds_check { for i in 0.. (tr: E) { return; } -transpose :: proc(a: $T/[$N][$M]$E) -> (m: (T when N == M else [M][N]E)) { +transpose :: proc(a: $T/[$N][$M]$E) -> (m: (T when N == M else [M][N]E)) #no_bounds_check { for j in 0.. (m: (T when N == M else [M][N]E)) { } matrix_mul :: proc(a, b: $M/[$N][N]$E) -> (c: M) - where !IS_ARRAY(E), - IS_NUMERIC(E) { + where !IS_ARRAY(E), IS_NUMERIC(E) #no_bounds_check { for i in 0.. (c: M) } matrix_comp_mul :: proc(a, b: $M/[$J][$I]$E) -> (c: M) - where !IS_ARRAY(E), - IS_NUMERIC(E) { + where !IS_ARRAY(E), IS_NUMERIC(E) #no_bounds_check { for j in 0.. (c: M) } matrix_mul_differ :: proc(a: $A/[$J][$I]$E, b: $B/[$K][J]E) -> (c: [K][I]E) - where !IS_ARRAY(E), - IS_NUMERIC(E), - I != K { + where !IS_ARRAY(E), IS_NUMERIC(E), I != K #no_bounds_check { for k in 0.. (c: [K][I]E) matrix_mul_vector :: proc(a: $A/[$I][$J]$E, b: $B/[I]E) -> (c: B) - where !IS_ARRAY(E), - IS_NUMERIC(E) { + where !IS_ARRAY(E), IS_NUMERIC(E) #no_bounds_check { for i in 0.. T { -array_cast :: proc(v: $A/[$N]$T, $Elem_Type: typeid) -> (w: [N]Elem_Type) { +array_cast :: proc(v: $A/[$N]$T, $Elem_Type: typeid) -> (w: [N]Elem_Type) #no_bounds_check { for i in 0.. (w: [M][N]Elem_Type) { +matrix_cast :: proc(v: $A/[$M][$N]$T, $Elem_Type: typeid) -> (w: [M][N]Elem_Type) #no_bounds_check { for i in 0..