Add matrix multiplication to Mat for iOS/Android#20731
Merged
opencv-pushbot merged 1 commit intoopencv:masterfrom Oct 5, 2021
Merged
Add matrix multiplication to Mat for iOS/Android#20731opencv-pushbot merged 1 commit intoopencv:masterfrom
opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
alalek
reviewed
Sep 22, 2021
| * Matrix multiplication | ||
| */ | ||
| public Mat matrixMul(Mat m) { | ||
| return new Mat(n_matrixMul(nativeObj, m.nativeObj)); |
Contributor
Author
There was a problem hiding this comment.
The problem I have with gemm is it takes 3 Mat as input. If you want to just simply multiply 2 matrices - you need to create a third completely unnecessary Mat just to do the operation. Also the name gemm makes it difficult to find without hunting around on Stack Overflow.
Member
There was a problem hiding this comment.
"GEMM" name comes from BLAS.
Also the name gemm makes it difficult to find
BTW,
Perhaps I would suggest to replace matrixMul -> matMul as OpenCV already have cv::Mat instead of cv::Matrix.
/cc @vpisarev @asmorkalov
e49d67d to
30955b3
Compare
39737f9 to
eb44528
Compare
eb44528 to
19a880b
Compare
Contributor
Author
|
Changed method name from |
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Readiness Checklist
Android and iOS wrapper both have element-wise multiplication operations (https://en.wikipedia.org/wiki/Hadamard_product_(matrices)) for
Matbut lack matrix multiplication operations (https://en.wikipedia.org/wiki/Matrix_multiplication).This PR adds matrix multiplication for
Matin Android and iOS wrappers.It also adds operator overloading for the
*operator in Swift and Kotlin