Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
sw::universal::error_tracking_traits< T, typename > Struct Template Reference

Primary template for error tracking traits Provides default values suitable for unknown types. More...

#include <error_tracking_traits.hpp>

Public Types

using shadow_type = long double
 Type to use for shadow computation (higher precision reference).

Static Public Attributes

static constexpr bool has_exact_errors = false
 Does this type support exact error computation (two_sum/two_prod)?
static constexpr bool has_directed_rounding = false
 Does this type support directed rounding for interval arithmetic?
static constexpr bool exact_multiplication = false
 Is multiplication exact in this representation?
static constexpr bool tracks_uncertainty = false
 Does this type natively track uncertainty?
static constexpr bool is_interval_type = false
 Is this an interval type that represents a range of values?
static constexpr ErrorStrategy default_strategy = ErrorStrategy::Shadow
 Recommended default error tracking strategy.
static constexpr unsigned nbits = 0
 Number of bits in the type (0 if unknown/variable).
static constexpr unsigned rbits = 0
 Number of fraction bits, where the type has a meaningful one (0 if not).

Detailed Description

template<typename T, typename = void>
struct sw::universal::error_tracking_traits< T, typename >

Primary template for error tracking traits Provides default values suitable for unknown types.

Member Typedef Documentation

◆ shadow_type

template<typename T, typename = void>
using sw::universal::error_tracking_traits< T, typename >::shadow_type = long double

Type to use for shadow computation (higher precision reference).

Member Data Documentation

◆ default_strategy

template<typename T, typename = void>
ErrorStrategy sw::universal::error_tracking_traits< T, typename >::default_strategy = ErrorStrategy::Shadow
staticconstexpr

Recommended default error tracking strategy.

◆ exact_multiplication

template<typename T, typename = void>
bool sw::universal::error_tracking_traits< T, typename >::exact_multiplication = false
staticconstexpr

Is multiplication exact in this representation?

(True for LNS where mult is just addition in log domain)

◆ has_directed_rounding

template<typename T, typename = void>
bool sw::universal::error_tracking_traits< T, typename >::has_directed_rounding = false
staticconstexpr

Does this type support directed rounding for interval arithmetic?

◆ has_exact_errors

template<typename T, typename = void>
bool sw::universal::error_tracking_traits< T, typename >::has_exact_errors = false
staticconstexpr

Does this type support exact error computation (two_sum/two_prod)?

◆ is_interval_type

template<typename T, typename = void>
bool sw::universal::error_tracking_traits< T, typename >::is_interval_type = false
staticconstexpr

Is this an interval type that represents a range of values?

◆ nbits

template<typename T, typename = void>
unsigned sw::universal::error_tracking_traits< T, typename >::nbits = 0
staticconstexpr

Number of bits in the type (0 if unknown/variable).

◆ rbits

template<typename T, typename = void>
unsigned sw::universal::error_tracking_traits< T, typename >::rbits = 0
staticconstexpr

Number of fraction bits, where the type has a meaningful one (0 if not).

nbits counts the whole encoding, so it is not a precision: an lns<32,8> is 32 bits wide but keeps only 8 fractional bits of the logarithm (#1546).

◆ tracks_uncertainty

template<typename T, typename = void>
bool sw::universal::error_tracking_traits< T, typename >::tracks_uncertainty = false
staticconstexpr

Does this type natively track uncertainty?

(True for areal with ubit, interval types)


The documentation for this struct was generated from the following file: