A julia package providing implementation of common semirings.
This package is largely inspired from JuliaComputing/SemiringAlgebra and mcognetta/Semirings.jl.
The package can be installed with the Julia package manager. From the Julia REPL, type ] to enter the Pkg REPL mode and run:
pkg> add Semirings
Here is a brief example:
julia> using Semirings
julia> a = TropicalSemiring{Float64}(3)
3.0
julia> TropicalSemiring{Float64}(5)
5.0
julia> a + b
5.0
julia> a * b
8.0
julia> x = ones(LogSemiring{Float64}, 2, 2)
2×2 Matrix{LogSemiring{Float64}}:
0.0 0.0
0.0 0.0
julia> x * x
2×2 Matrix{LogSemiring{Float64}}:
0.693147 0.693147
0.693147 0.693147
julia> x + x
2×2 Matrix{LogSemiring{Float64}}:
0.693147 0.693147
0.693147 0.693147
Lucas Ondel (website)