diff --git a/src/implementations/LinearAlgebra.jl b/src/implementations/LinearAlgebra.jl index 00b301f..42a1a57 100644 --- a/src/implementations/LinearAlgebra.jl +++ b/src/implementations/LinearAlgebra.jl @@ -157,6 +157,8 @@ end similar_array_type(::Type{Array{T,N}}, ::Type{S}) where {S,T,N} = Array{S,N} +similar_array_type(::Type{BitArray{N}}, ::Type{S}) where {S,N} = Array{S,N} + function promote_operation( op::typeof(*), A::Type{<:AbstractArray{T}}, diff --git a/test/interface.jl b/test/interface.jl index 787ca4a..24b51af 100644 --- a/test/interface.jl +++ b/test/interface.jl @@ -108,3 +108,16 @@ end end end end + +@testset "add_mul for BitArray" begin + x = BigInt[0, 0] + MA.operate!!(MA.add_mul, x, big(2), trues(2)) + @test x == BigInt[2, 2] + MA.operate!!(MA.add_mul, x, big(3), BitVector([true, false])) + @test x == BigInt[5, 2] + x = BigInt[0 0; 0 0] + MA.operate!!(MA.add_mul, x, big(2), trues(2, 2)) + @test x == BigInt[2 2; 2 2] + MA.operate!!(MA.add_mul, x, big(3), BitArray([true false; true true])) + @test x == BigInt[5 2; 5 5] +end