Sparse matrices and type constraints in Julia
问题 I am confused about how parametric methods work in Julia. I also hope that parametric is the right word to use here. I've read the docs on methods but it is still not clear why the following error occurs. If I define a function as below function Bazinga{T<:Real}(mat ::Union{Array{T,2},SparseMatrixCSC}) mat^4 end and run Penny = sparse(randn(10,10)) Bazinga(Penny) I get ERROR: MethodError: `Bazinga` has no method matching Bazinga(::SparseMatrixCSC{Float64,Int64}) Closest candidates are: