I’d like to write a method for an array of arrays, for example
simple(g::Array{Array{Float64}}) = g
should be an identity function.
But if try
A = [1. 2.; 3. 4.]
B = [5. 6. 7.; 8. 9. 0.]
g = [A, B]
simple(g)
I get
ERROR: MethodError: no method matching simple(::Array{Array{Float64,2},1})
Closest candidates are:
simple(::Array{Array{Float64,N} where N,N} where N) at REPL[1]:1
If I change the method to
simple(g::Array{Array{Float64, 2}, 1}) = g
I get the expected result, but I’d like to generalize this method to any dimension size. How do I modify my method to do this?