Home

Awesome

TropicalNumbers

This package implements tropical numbers and tropical algebras in Julia. Tropical algebra is also known as the semiring algebra, which is a set $R$ equipped with two binary operations $\oplus$ and $\otimes$, called addition and multiplication, such that:

Build Status Codecov

Installation

To install this package, press ] in Julia REPL to enter package mode, then type

pkg> add TropicalNumbers

Using

A Topical algebra can be described as a tuple $(R, \oplus, \otimes, \mathbb{0}, \mathbb{1})$, where $R$ is the set, $\oplus$ and $\otimes$ are the opeartions and $\mathbb{0}$, $\mathbb{1}$ are their identity element, respectively. In this package, the following tropical algebras are implemented:

julia> using TropicalNumbers

julia> Tropical(3) * Tropical(4)
Tropical(7)

julia> TropicalMaxMul(3) * TropicalMaxMul(4)
TropicalMaxMul(12)

Warnings

  1. TropicalMaxPlus is an alias of Tropical.
  2. TropicalMaxMul should not contain negative numbers. However, this package does not check the data validity. Not only for performance reason, but also for future GPU support.

Why another tropical number?

Related packages include

These packages include unnecessary fields in its tropical numbers, such as isinf. However, Inf and -Inf can be used directly for floating point numbers, which is more memory efficient and computationally cheap. TropicalNumbers is designed for high performance matrix multiplication on both CPU and GPU.

Ecosystem