Skip to content
A fast implementation of probabilities, using log-probabilities
C++ Makefile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmark
external
include/probability
make @ 9675184
test
.gitignore
.gitmodules
.travis.yml
.version.mk
CPPLINT.cfg
Config.mk
LICENSE
Makefile
NOTICE
README.md
compile_commands.json
conf

README.md

Probability

Travis Codecov

A fast implementation of probabilities / positive floating point arithmetic using logarithms.

Usage

This library is header only, which means you can copy it and use it with a simple include:

#include "probability/probability.hpp"

We provide aliases for the most common uses:

Type Definition
log_float_t Logarithm floating point with value type float
log_double_t Logarithm floating point with value type double
log_long_double_t Logarithm floating point with value type long double
probability_float_t Probability with base type float
probability_double_t     Probability with base type double
probability_long_double_t Probability with base type long double
probability_t Alias to probability_double_t

The library defines a class LogFloatingPoint with 3 template parameters:

  • T, the value type, used for internal storage
  • ulp, the units in the last place, used to define the precision of comparisons.
  • C, the checker type, used to inject methods that verify consistency; the library provides two standard checkers: EmptyChecker (for the log_*_t types above) and ProbabilityChecker (for the probability_*_t types above).

By default, all aliases above have ulp = 0 (meaning that the precision equals the machine epsilon of the value type).

You can’t perform that action at this time.