Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
5 #ifndef GLOBALSIM_AP_FIXED_H
6 #define GLOBALSIM_AP_FIXED_H
26 template<std::
size_t w
idth,
typename T>
29 static_assert(8*
sizeof(
t) >=
width,
"ap_fixed underlying int to small");
30 for (std::size_t
i = 0;
i <=
sizeof(
t)*8-
width; ++
i){
39 template <std::size_t
width,
79 return form(this->m_value +
f.m_value);
84 this->m_value +=
f.m_value;
90 return form(this->m_value -
f.m_value);
95 this->m_value -=
f.m_value;
101 return form((WS(this->m_value) * WS(
f.m_value)) >>
dp);
105 this->m_value = (WS(this->m_value) * WS(
f.m_value) >>
dp);
112 return form((WS(this->m_value) <<
dp) / WS(
f.m_value));
116 this->m_value = ((WS(this->m_value) <<
dp) / WS(
f.m_value));
123 return form(-this->m_value);
139 std::stringstream
ss;
142 ss <<
"ap_fixed overflow. val: "
144 <<
' ' << std::hex <<
val
146 throw std::out_of_range(
ss.str());
ap_fixed operator/(const ap_fixed &f) const
const ap_fixed & operator*=(const ap_fixed &f)
ap_fixed operator-() const
constexpr T max_to_overflow()
requires requires()
This specialization is used for classes deriving from DataObject.
setScaleOne setStatusOne setSaturated int16_t
friend std::ostream & operator<<(std::ostream &os, const ap_fixed< width, dp, S, T, WS > ap)
static ap_fixed form(T v)
ap_fixed operator*(const ap_fixed &f) const
AlgTool to obtain a selection of eFex RoIs read in from the event store.
ap_fixed(const double d) requires(std
const ap_fixed & operator/=(const ap_fixed &f)
static constexpr T m_overflow_mask
const ap_fixed & operator-=(const ap_fixed &f)
const ap_fixed operator+(const ap_fixed &f) const
const ap_fixed & operator+=(const ap_fixed &f)