【发布时间】:2020-11-09 17:01:40
【问题描述】:
有什么区别
function foo(a::Adjoint{Float64, Matrix{T}} where T)
return 0
end
和
function foo(a::Adjoint{Float64, Matrix{T} where T})
return 1
end
(注意花括号的位置。)
julia> methods(foo)
# 2 methods for generic function "foo":
[1] foo(a::Adjoint{Float64,Array{T,2}} where T) in Main at REPL[247]:2
[2] foo(a::Adjoint{Float64,Array{T,2} where T}) in Main at REPL[248]:2
似乎在这两种情况下,该函数都会接受T 类型的矩阵的伴随?我不知道这两个函数有什么区别。
【问题讨论】:
-
嗯,其中一个返回
0,另一个返回1=P
标签: julia where-clause