Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ambiguous scalar by matrix multiplication #96

Closed
CarloLucibello opened this issue Nov 7, 2022 · 2 comments
Closed

ambiguous scalar by matrix multiplication #96

CarloLucibello opened this issue Nov 7, 2022 · 2 comments

Comments

@CarloLucibello
Copy link

julia> using SparseArrays, SuiteSparseGraphBlas

julia> x = sprand(5, 5, 0.5) |> GBMatrix
5x5 GraphBLAS double matrix, sparse by col
  14 entries, memory: 480 bytes

    (1,1)    0.652571
    (2,1)    0.877267
    (5,1)    0.498966
    (4,2)    0.109951
    (1,3)    0.517752
    (3,3)    0.812603
    (1,4)    0.0272527
    (2,4)    0.997701
    (3,4)    0.31351
    (4,4)    0.0128793
    (5,4)    0.806709
    (1,5)    0.207728
    (3,5)    0.497848
    (4,5)    0.993865


julia> 2 * x
ERROR: MethodError: *(::Int64, ::GBMatrix{Float64, Nothing}) is ambiguous. Candidates:
  *(x::V, u::Union{Transpose{T, <:SuiteSparseGraphBLAS.AbstractGBArray{T}}, SuiteSparseGraphBLAS.AbstractGBArray{T}}; mask, accum, desc) where {T, V<:(Union{var"#s4468", T, var"#s4467"} where {var"#s4468"<:Union{Bool, Float32, Float64, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, ComplexF32, ComplexF64}, var"#s4467"<:Number})} in SuiteSparseGraphBLAS at /Users/carlo/.julia/packages/SuiteSparseGraphBLAS/ijDcs/src/operations/map.jl:118
  *(A::Number, B::AbstractArray) in Base at arraymath.jl:21
Possible fix, define
  *(::V, ::Union{Transpose{T, <:SuiteSparseGraphBLAS.AbstractGBArray{T}}, SuiteSparseGraphBLAS.AbstractGBArray{T}}) where {T, V<:Number}
Stacktrace:
 [1] top-level scope
   @ REPL[20]:1
@CarloLucibello CarloLucibello changed the title ambiguous scalar by matrix multuplication ambiguous scalar by matrix multiplication Nov 7, 2022
@rayegun
Copy link
Member

rayegun commented Nov 8, 2022

Can you check either 0.9 or master? This should have been fixed, but I haven't run Aqua's ambiguity checker recently.

@CarloLucibello
Copy link
Author

works on 0.9!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants