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

Fixed Ac_mul_Bt and added export and tests, added a missing lapack test #15296

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 2 additions & 0 deletions base/exports.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ export
Ac_mul_B!,
Ac_mul_Bc,
Ac_mul_Bc!,
Ac_mul_Bt,
Ac_mul_Bt!,
Ac_rdiv_B,
Ac_rdiv_Bc,
At_ldiv_B,
Expand Down
2 changes: 2 additions & 0 deletions base/linalg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,8 @@ export
Ac_mul_B!,
Ac_mul_Bc,
Ac_mul_Bc!,
Ac_mul_Bt,
Ac_mul_Bt!,
Ac_rdiv_B,
Ac_rdiv_Bc,
At_ldiv_B,
Expand Down
2 changes: 1 addition & 1 deletion base/linalg/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ A_mul_Bc!(C::StridedMatrix, A::StridedVecOrMat, B::StridedVecOrMat) = generic_ma
Ac_mul_Bc{T,S}(A::AbstractMatrix{T}, B::StridedMatrix{S}) = Ac_mul_Bc!(similar(B, promote_op(MulFun(),arithtype(T), arithtype(S)), (size(A,2), size(B,1))), A, B)
Ac_mul_Bc!{T<:BlasFloat}(C::StridedMatrix{T}, A::StridedVecOrMat{T}, B::StridedVecOrMat{T}) = gemm_wrapper!(C, 'C', 'C', A, B)
Ac_mul_Bc!(C::StridedMatrix, A::StridedVecOrMat, B::StridedVecOrMat) = generic_matmatmul!(C, 'C', 'C', A, B)
Ac_mul_Bt{T,S}(A::AbstractMatrix{T}, B::StridedMatrix{S}) = Ac_mul_Bt(similar(B, promote_op(MulFun(),arithtype(A), arithtype(B)), (size(A,2), size(B,1))), A, B)
Ac_mul_Bt{T,S}(A::AbstractMatrix{T}, B::StridedMatrix{S}) = Ac_mul_Bt!(similar(B, promote_op(MulFun(),arithtype(T), arithtype(S)), (size(A,2), size(B,1))), A, B)
Ac_mul_Bt!(C::StridedMatrix, A::StridedVecOrMat, B::StridedVecOrMat) = generic_matmatmul!(C, 'C', 'T', A, B)

# Supporting functions for matrix multiplication
Expand Down
1 change: 1 addition & 0 deletions test/linalg/lapack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ for elty in (Complex64, Complex128)
B = copy(A)
B,ipiv = LAPACK.hetrf!('U',B)
@test_throws DimensionMismatch LAPACK.hetrs!('U',B,ipiv,rand(elty,11,5))
@test_throws DimensionMismatch LAPACK.hetrs_rook!('U',B,ipiv,rand(elty,11,5))
end

# stev, stebz, stein, stegr
Expand Down
1 change: 1 addition & 0 deletions test/linalg/matmul.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ A = rand(1:20, 5, 5) .- 10
B = rand(1:20, 5, 5) .- 10
@test At_mul_B(A, B) == A'*B
@test A_mul_Bt(A, B) == A*B'
@test Ac_mul_Bt(A, B) == A'*B.'
Copy link
Contributor

Choose a reason for hiding this comment

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

should this actually get tested on complex inputs so we can be sure the conjugation behavior is right?

v = [1,2]
C = Array(Int, 2, 2)
@test @inferred(A_mul_Bc!(C, v, v)) == [1 2; 2 4]
Expand Down