tighten signature of (complex mat) x (real vec) #33843
Merged
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.
Closes JuliaLang/LinearAlgebra.jl#655 (again).
Indeed, in #33743 I relaxed the signature by too much. Now, it is consistent with the corresponding mat-mat-mul function (as modified in #33229), that reinterpret the complex matrix as real. Now, if alpha or beta are not real (as was the case in the failing tests), some other
mul!
method is the first to be called, which decides on whether to use BLAS or not.I found a similar issue with the complexMatrix * transpose(realMatrix) function.
I went by the assumption that all this reinterpretation stuff makes sense only if for the reinterpreted real matrices BLAS gets called. So I added code that would check whether this is the case, and otherwise fall back to generic mul. This specializes again a change in #33229.I think the reinterpret should make sense even if the generic mul gets called.