-
Notifications
You must be signed in to change notification settings - Fork 2
Implement matrix multiplication #64
Copy link
Copy link
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Since matrix multiplication is a nice mathematical feature, I would like to see it implemented in RocketLang.
For the definition of matrix multiplications, see here: https://en.wikipedia.org/wiki/Matrix_multiplication
Condition: all entries have to be numbers (ints, doubles etc.)
Example:
[[1,2],[3,4]]*[[8,7],[6,5]] = [ (1*8+2*6), (1*7+2*5)], [(3*8+4*6) ,(3*7+4*5) ] = [[20 , 17 ] , [48, 41]]
More general:
If size(A) =[m,n] and size(B) = [n,p] (the n is important!), then C=A*B with
C[i,j]=0
for k in [1, n]:
C[i,j]+= A[i,k]*B[k,j]
I am open to write the test cases :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request