Universal Numbers Library C++ API
sw::universal -- header-only custom arithmetic types (posit, cfloat, lns, fixpnt, dd/qd, and more)
Loading...
Searching...
No Matches
tracked_lns.hpp File Reference
#include <cmath>
#include <cstdint>
#include <limits>
#include <string>
#include <type_traits>
#include <typeinfo>
#include <ostream>
#include <iomanip>
#include "error_tracking_traits.hpp"

Classes

class  sw::universal::TrackedLNS< LNSType, ShadowType >
 TrackedLNS provides specialized error tracking for LNS types exploiting the fact that multiplication is exact in log representation. More...

Namespaces

namespace  sw
 required std libraries
namespace  sw::universal

Functions

template<typename LNSType, typename S>
std::ostream & sw::universal::operator<< (std::ostream &os, const TrackedLNS< LNSType, S > &v)
template<typename LNSType, typename S>
TrackedLNS< LNSType, S > sw::universal::abs (const TrackedLNS< LNSType, S > &v)
 Absolute value (no error, preserves absorptions).
template<typename LNSType, typename S>
TrackedLNS< LNSType, S > sw::universal::sqrt (const TrackedLNS< LNSType, S > &v)
 Square root (introduces error like addition, preserves absorptions).
template<typename LNSType, typename S>
TrackedLNS< LNSType, S > sw::universal::sqr (const TrackedLNS< LNSType, S > &v)
 Square (EXACT - just multiplication).
template<typename LNSType, typename S>
TrackedLNS< LNSType, S > sw::universal::pow (const TrackedLNS< LNSType, S > &base, int exp)
 Power with integer exponent (EXACT - repeated multiplication).
template<typename U, typename LNSType, typename S, typename = std::enable_if_t<std::is_arithmetic_v<U>>>
TrackedLNS< LNSType, S > sw::universal::operator+ (U lhs, const TrackedLNS< LNSType, S > &rhs)
template<typename U, typename LNSType, typename S, typename = std::enable_if_t<std::is_arithmetic_v<U>>>
TrackedLNS< LNSType, S > sw::universal::operator- (U lhs, const TrackedLNS< LNSType, S > &rhs)
template<typename U, typename LNSType, typename S, typename = std::enable_if_t<std::is_arithmetic_v<U>>>
TrackedLNS< LNSType, S > sw::universal::operator* (U lhs, const TrackedLNS< LNSType, S > &rhs)
template<typename U, typename LNSType, typename S, typename = std::enable_if_t<std::is_arithmetic_v<U>>>
TrackedLNS< LNSType, S > sw::universal::operator/ (U lhs, const TrackedLNS< LNSType, S > &rhs)
template<typename LNSType, typename S>
std::string sw::universal::type_tag (const TrackedLNS< LNSType, S > &={})