|
Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
|
#include <lindex_impl.hpp>
Classes | |
| struct | outcome |
Public Types | |
| enum class | Op { add , sub , mul , div } |
| typedef bt | BlockType |
| using | Working = dd_cascade |
| using | ArithmeticWorking = std::conditional_t<(_nbits <= 32), double, dd_cascade> |
| using | BlockBinary = blockbinary<nbits, bt, BinaryNumberType::Unsigned> |
Public Member Functions | |
| lindex ()=default | |
| lindex (const lindex &)=default | |
| lindex (lindex &&)=default | |
| lindex & | operator= (const lindex &)=default |
| lindex & | operator= (lindex &&)=default |
| constexpr | lindex (const SpecificValue code) noexcept |
| lindex (signed char initial_value) noexcept | |
| lindex (short initial_value) noexcept | |
| lindex (int initial_value) noexcept | |
| lindex (long initial_value) noexcept | |
| lindex (long long initial_value) noexcept | |
| lindex (char initial_value) noexcept | |
| lindex (unsigned short initial_value) noexcept | |
| lindex (unsigned int initial_value) noexcept | |
| lindex (unsigned long initial_value) noexcept | |
| lindex (unsigned long long initial_value) noexcept | |
| lindex (float initial_value) noexcept | |
| lindex (double initial_value) noexcept | |
| lindex & | operator= (signed char rhs) noexcept |
| lindex & | operator= (short rhs) noexcept |
| lindex & | operator= (int rhs) noexcept |
| lindex & | operator= (long rhs) noexcept |
| lindex & | operator= (long long rhs) noexcept |
| lindex & | operator= (char rhs) noexcept |
| lindex & | operator= (unsigned short rhs) noexcept |
| lindex & | operator= (unsigned int rhs) noexcept |
| lindex & | operator= (unsigned long rhs) noexcept |
| lindex & | operator= (unsigned long long rhs) noexcept |
| lindex & | operator= (float rhs) noexcept |
| lindex & | operator= (double rhs) noexcept |
| operator int () const noexcept | |
| operator long () const noexcept | |
| operator long long () const noexcept | |
| operator unsigned int () const noexcept | |
| operator unsigned long () const noexcept | |
| operator unsigned long long () const noexcept | |
| operator float () const noexcept | |
| operator double () const noexcept | |
| constexpr lindex | operator- () const noexcept |
| constexpr lindex & | operator++ () noexcept |
| constexpr lindex | operator++ (int) noexcept |
| constexpr lindex & | operator-- () noexcept |
| constexpr lindex | operator-- (int) noexcept |
| lindex & | operator+= (const lindex &rhs) noexcept |
| lindex & | operator-= (const lindex &rhs) noexcept |
| lindex & | operator*= (const lindex &rhs) noexcept |
| lindex & | operator/= (const lindex &rhs) |
| lindex & | operator+= (double rhs) noexcept |
| lindex & | operator-= (double rhs) noexcept |
| lindex & | operator*= (double rhs) noexcept |
| lindex & | operator/= (double rhs) |
| lindex | reciprocal () const |
| constexpr void | clear () noexcept |
| constexpr void | setzero () noexcept |
| constexpr void | setnar () noexcept |
| constexpr void | setnan (bool sign=false) noexcept |
| constexpr void | setbit (unsigned i, bool v=true) noexcept |
| constexpr lindex & | setbits (std::uint64_t value) noexcept |
| constexpr lindex & | maxpos () noexcept |
| constexpr lindex & | minpos () noexcept |
| constexpr lindex & | zero () noexcept |
| constexpr lindex & | minneg () noexcept |
| constexpr lindex & | maxneg () noexcept |
| constexpr bool | iszero () const noexcept |
| constexpr bool | isnar () const noexcept |
| constexpr bool | isnan () const noexcept |
| constexpr bool | isinf () const noexcept |
| constexpr bool | sign () const noexcept |
| constexpr bool | isneg () const noexcept |
| constexpr bool | ispos () const noexcept |
| constexpr std::uint64_t | raw_bits () const noexcept |
| constexpr std::uint64_t | magnitude_bits () const noexcept |
| constexpr int | level () const noexcept |
| constexpr std::uint64_t | index_bits () const noexcept |
| double | index () const noexcept |
| double | psi () const noexcept |
| int64_t | scale () const noexcept |
| constexpr bool | at (unsigned bitIndex) const noexcept |
| constexpr bool | test (unsigned bitIndex) const noexcept |
| constexpr bt | block (unsigned b) const noexcept |
| constexpr std::uint8_t | nibble (unsigned n) const noexcept |
Static Public Member Functions | |
| template<typename W> | |
| static W | index_in (std::uint64_t mag) noexcept |
| template<typename W> | |
| static level_index::point< W > | point_of (std::uint64_t mag) noexcept |
| template<typename W> | |
| static outcome< W > | from_point (const level_index::point< W > &p) noexcept |
| template<typename W> | |
| static outcome< W > | up_a_level (const level_index::point< W > &p) noexcept |
| template<typename W> | |
| static outcome< W > | exact_magnitude (std::uint64_t mag) noexcept |
| template<typename W> | |
| static outcome< W > | up_a_level (const outcome< W > &r) noexcept |
| template<typename W> | |
| static outcome< W > | down_a_level (const outcome< W > &r) noexcept |
| template<typename W> | |
| static bool | point_less (const level_index::point< W > &a, const level_index::point< W > &b) noexcept |
| template<typename W> | |
| static bool | is_zero_point (const level_index::point< W > &a) noexcept |
| template<typename W> | |
| static outcome< W > | add_points (const level_index::point< W > &a, const level_index::point< W > &b) noexcept |
| template<typename W> | |
| static outcome< W > | sub_points (const level_index::point< W > &a, const level_index::point< W > &b) noexcept |
| template<typename W> | |
| static outcome< W > | mul_points (level_index::point< W > A, level_index::point< W > B) noexcept |
| template<typename W> | |
| static outcome< W > | div_points (const level_index::point< W > &A, const level_index::point< W > &B) noexcept |
| template<typename W> | |
| static std::uint64_t | round_outcome (const outcome< W > &r, bool &near_tie) noexcept |
| template<typename Compute> | |
| static lindex | round_psi (Compute &&compute, bool negative) noexcept |
| static lindex | from_value (const Working &X, bool negative) noexcept |
Static Public Attributes | |
| static constexpr unsigned | nbits = _nbits |
| static constexpr unsigned | lbits = _lbits |
| static constexpr unsigned | fbits = nbits - 1u - lbits |
| static constexpr unsigned | nr_levels = 1u << lbits |
| static constexpr unsigned | bitsInByte = 8u |
| static constexpr unsigned | bitsInBlock = sizeof(bt) * bitsInByte |
| static constexpr unsigned | nrBlocks = 1u + ((nbits - 1u) / bitsInBlock) |
| static constexpr unsigned | MSU = nrBlocks - 1u |
| static constexpr std::uint64_t | storageMask = (0xFFFF'FFFF'FFFF'FFFFull >> (64u - bitsInBlock)) |
| static constexpr bt | MSU_MASK = bt(bt(~0) >> (nrBlocks * bitsInBlock - nbits)) |
| static constexpr std::uint64_t | nbits_mask = (nbits == 64) ? ~0ull : ((1ull << nbits) - 1ull) |
| static constexpr std::uint64_t | sign_mask = 1ull << (nbits - 1u) |
| static constexpr std::uint64_t | index_mask = (1ull << fbits) - 1ull |
| static constexpr std::uint64_t | maxpos_bits = sign_mask - 1ull |
| static constexpr std::uint64_t | one_bits = 1ull << fbits |
Protected Member Functions | |
| lindex & | set_magnitude (std::uint64_t mag, bool negative) noexcept |
| lindex & | encode (int level, Working index, bool negative) noexcept |
| lindex & | convert_magnitude (const Working &X, bool negative) noexcept |
| template<typename SignedInt> | |
| lindex & | convert_signed (SignedInt rhs) noexcept |
| template<typename UnsignedInt> | |
| lindex & | convert_unsigned (UnsignedInt rhs) noexcept |
| lindex & | convert_integer_magnitude (unsigned long long m, bool negative) noexcept |
| lindex & | convert_ieee754 (double rhs) noexcept |
| lindex & | add_signed (const lindex &rhs, bool subtract) noexcept |
| template<typename Real> | |
| Real | to_ieee754 () const noexcept |
| template<typename SignedInt> | |
| SignedInt | to_signed () const noexcept |
| template<typename UnsignedInt> | |
| UnsignedInt | to_unsigned () const noexcept |
Static Protected Member Functions | |
| static std::int64_t | integer_of (double v) noexcept |
| static std::int64_t | integer_of (const dd_cascade &v) noexcept |
| static std::int64_t | integer_of (const qd_cascade &v) noexcept |
| template<typename W> | |
| static constexpr int | tie_band_bits () noexcept |
| template<typename W> | |
| static std::uint64_t | round_point (int level, W index, bool &near_tie) noexcept |
| static std::uint64_t | fixed_multiply (std::uint64_t a, std::uint64_t b) noexcept |
| static std::uint64_t | fixed_divide (std::uint64_t a, std::uint64_t b) noexcept |
| template<typename W> | |
| static outcome< W > | compute (Op op, std::uint64_t a, std::uint64_t b) noexcept |
| static std::uint64_t | evaluate (Op op, std::uint64_t a, std::uint64_t b) noexcept |
| template<typename Real> | |
| static Real | narrow (const Working &v) noexcept |
| using sw::universal::lindex< _nbits, _lbits, bt >::ArithmeticWorking = std::conditional_t<(_nbits <= 32), double, dd_cascade> |
| using sw::universal::lindex< _nbits, _lbits, bt >::BlockBinary = blockbinary<nbits, bt, BinaryNumberType::Unsigned> |
| typedef bt sw::universal::lindex< _nbits, _lbits, bt >::BlockType |
| using sw::universal::lindex< _nbits, _lbits, bt >::Working = dd_cascade |
|
strong |
|
default |
|
default |
|
default |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlineprotectednoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinestaticprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlineprotectednoexcept |
|
inlinestaticprotectednoexcept |
|
inlinestaticnoexcept |
|
inlinestaticprotectednoexcept |
|
inlinestaticprotectednoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticprotectednoexcept |
|
inlinestaticprotectednoexcept |
|
inlinestaticprotectednoexcept |
|
inlinestaticnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinestaticnoexcept |
|
inlinestaticprotectednoexcept |
|
inlineconstexprnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlineexplicitnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
default |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
default |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inlinestaticnoexcept |
|
inlinestaticprotectednoexcept |
|
inlinestaticnoexcept |
|
inlinenoexcept |
|
inlineprotectednoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inlinestaticnoexcept |
|
inlineconstexprnoexcept |
|
inlinestaticconstexprprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlineprotectednoexcept |
|
inlinestaticnoexcept |
|
inlinestaticnoexcept |
|
inlineconstexprnoexcept |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |