Say I have a function
function f(a,x)
a[:,:] = x
end
a = zeros(2,2)
x = eye(2)
f(a,x) # Works fine
f(a,I) # Does not work
ERROR: MethodError: Cannot `convert` an object of type LinearAlgebra.UniformScaling{Bool} to an object of type Float64
Is there something I can do in f
such that it can handle both input arguments of type X::Matrix
and x::UniformScaling
? My example f
is simple, but my real use case involves a more complicated function and it would be nice if it could handle arguments of type UniformScaling
Thanks!