Open chriselrod opened 1 year ago
Note this is on the following custom branches: https://github.com/JuliaLinearAlgebra/Octavian.jl/pull/157 https://github.com/JuliaArrays/ArrayInterface.jl/pull/369 as it threw errors before.
Hey, @chriselrod . Thanks for the issue. The adjoint of Tropical numbers are not well defined.
julia> (Matrix(td') * Matrix(td'))[1:10, 1:10]
ERROR: MethodError: no method matching conj(::TropicalF32)
Closest candidates are:
conj(::Union{LinearAlgebra.Hermitian{T, S}, LinearAlgebra.Symmetric{T, S}} where {T, S}) at ~/.julia/juliaup/julia-1.8.3+0.x64.linux.gnu/share/julia/stdlib/v1.8/LinearAlgebra/src/symmetric.jl:368
conj(::LinearAlgebra.UniformScaling) at ~/.julia/juliaup/julia-1.8.3+0.x64.linux.gnu/share/julia/stdlib/v1.8/LinearAlgebra/src/uniformscaling.jl:123
conj(::LinearAlgebra.Adjoint) at ~/.julia/juliaup/julia-1.8.3+0.x64.linux.gnu/share/julia/stdlib/v1.8/LinearAlgebra/src/adjtrans.jl:345
...
Stacktrace:
[1] adjoint(x::TropicalF32)
@ Base ./number.jl:213
So I am confused why matmul!
can produce a result. If you use the following statement instead,
julia> @time(Octavian.matmul!(tr, transpose(td), transpose(td)));
The result is correct.
(jl_QKsjQL) pkg> st
Status `/tmp/jl_QKsjQL/Project.toml`
[6fd5a793] Octavian v0.3.18
[a4ad3063] TropicalGEMM v0.1.8 `~/.julia/dev/TropicalGEMM` # master branch is the same as the registered version
[bc48ee85] Tullio v0.3.5
If you're curious, the motivation was this slack discussion: https://julialang.slack.com/archives/C67TK21LJ/p1670593631969889
I can confirm that tranpose
works. I was using adjoints because '
is faster to type.
e.g.
while it works for
Float64
: