Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

math/linalg add matrix_mul_vector_differ & update matrix_mul_vector #4434

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion core/math/linalg/general.odin
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,13 @@ matrix_mul_differ :: proc "contextless" (a: $A/matrix[$I, $J]$E, b: $B/matrix[J,


@(require_results)
matrix_mul_vector :: proc "contextless" (a: $A/matrix[$I, $J]$E, b: $B/[J]E) -> (c: B)
matrix_mul_vector :: proc "contextless" (a: $A/matrix[$I, I]$E, b: $B/[I]E) -> (c: B)
where !IS_ARRAY(E), IS_NUMERIC(E) #no_bounds_check {
return a * b
}

@(require_results)
matrix_mul_vector_differ :: proc "contextless" (a: $A/matrix[$I, $J]$E, b: $B/[J]E) -> (c: matrix[I, 1]E)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you even tested this code to see if it even works?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but see I missed copying something over. Sorry about that.

where !IS_ARRAY(E), IS_NUMERIC(E) #no_bounds_check {
return a * b
}
Expand Down Expand Up @@ -252,6 +258,7 @@ mul :: proc{
matrix_mul,
matrix_mul_differ,
matrix_mul_vector,
matrix_mul_vector_differ,
quaternion64_mul_vector3,
quaternion128_mul_vector3,
quaternion256_mul_vector3,
Expand Down