Boost logo

Boost :

Subject: [boost] Log/tropical semiring for boost math
From: Alex Graves (alex.graves_at_[hidden])
Date: 2010-04-10 08:46:46


I work in machine learning, and often need to do probability computations in
the log scale to avoid underflows. A nice way to do this is to use a class
where the add, divide etc. operators are overloaded by their log scale
equivalents (e.g. log(a*b) = log(a) + log(b)). In other words a class
implementing the log semiring <>. Also
useful in this context is the tropical semiring, where adding is replaced by
taking the maximum (or minimum) of the arguments. I looked for these in the
boost math library, but couldn't find anything. So I wrote my own. Did I
miss something? And if not, is anyone interested in adding my implementation
to boost math?


Boost list run by bdawes at, gregod at, cpdaniel at, john at