#include <NumericValue.h>
|
BoundedDouble | operator== (const BoundedDouble &lhs, const BoundedDouble &rhs) |
| Reload operator. More...
|
|
BoundedDouble | operator!= (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator> (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator< (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator<= (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator>= (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator+ (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator- (const BoundedDouble &lhs) |
|
BoundedDouble | operator- (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator* (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator/ (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator% (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator^ (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator& (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator| (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator&& (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator|| (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator! (const BoundedDouble &lhs) |
|
BoundedDouble | operator>> (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | operator<< (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | ite (const BoundedDouble &cond, const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
std::ostream & | operator<< (std::ostream &out, const BoundedDouble &expr) |
|
bool | eq (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | min (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | max (const BoundedDouble &lhs, const BoundedDouble &rhs) |
|
BoundedDouble | abs (const BoundedDouble &lhs) |
|
Bounded double numeric value
Definition at line 723 of file NumericValue.h.
◆ BoundedDouble() [1/4]
SVF::BoundedDouble::BoundedDouble |
( |
| ) |
|
|
protecteddefault |
◆ BoundedDouble() [2/4]
SVF::BoundedDouble::BoundedDouble |
( |
double |
fVal | ) |
|
|
inline |
◆ BoundedDouble() [3/4]
◆ BoundedDouble() [4/4]
Definition at line 741 of file NumericValue.h.
constexpr std::remove_reference< T >::type && move(T &&t) noexcept
◆ ~BoundedDouble()
virtual SVF::BoundedDouble::~BoundedDouble |
( |
| ) |
|
|
inlinevirtual |
◆ doubleEqual()
static bool SVF::BoundedDouble::doubleEqual |
( |
double |
a, |
|
|
double |
b |
|
) |
| |
|
inlinestatic |
◆ equal()
bool SVF::BoundedDouble::equal |
( |
const BoundedDouble & |
rhs | ) |
const |
|
inline |
Definition at line 808 of file NumericValue.h.
static bool doubleEqual(double a, double b)
◆ geq()
Definition at line 837 of file NumericValue.h.
847 return rhs.is_minus_infinity();
855 return rhs.is_minus_infinity();
858 return _fVal >= rhs._fVal;
bool is_plus_infinity() const
◆ getFVal()
const double SVF::BoundedDouble::getFVal |
( |
| ) |
const |
|
inline |
◆ getIntNumeral()
s64_t SVF::BoundedDouble::getIntNumeral |
( |
| ) |
const |
|
inline |
◆ getNumeral()
s64_t SVF::BoundedDouble::getNumeral |
( |
| ) |
const |
|
inline |
Return Numeral.
Definition at line 1256 of file NumericValue.h.
1268 return std::round(
_fVal);
bool is_minus_infinity() const
◆ getRealNumeral()
double SVF::BoundedDouble::getRealNumeral |
( |
| ) |
const |
|
inline |
◆ is_infinity()
bool SVF::BoundedDouble::is_infinity |
( |
| ) |
const |
|
inline |
◆ is_int()
bool SVF::BoundedDouble::is_int |
( |
| ) |
const |
|
inline |
◆ is_minus_infinity()
bool SVF::BoundedDouble::is_minus_infinity |
( |
| ) |
const |
|
inline |
◆ is_plus_infinity()
bool SVF::BoundedDouble::is_plus_infinity |
( |
| ) |
const |
|
inline |
◆ is_real()
bool SVF::BoundedDouble::is_real |
( |
| ) |
const |
|
inline |
◆ is_true()
bool SVF::BoundedDouble::is_true |
( |
| ) |
const |
|
inline |
◆ is_zero()
bool SVF::BoundedDouble::is_zero |
( |
| ) |
const |
|
inline |
◆ isZero()
static bool SVF::BoundedDouble::isZero |
( |
const BoundedDouble & |
expr | ) |
|
|
inlinestatic |
◆ leq()
Definition at line 813 of file NumericValue.h.
823 return rhs.is_plus_infinity();
831 return rhs.is_plus_infinity();
834 return _fVal <= rhs._fVal;
◆ max()
Definition at line 1230 of file NumericValue.h.
1233 for (
const auto& it : _l)
1235 if (it.is_plus_infinity())
1237 else if (!it.leq(ret))
static BoundedDouble minus_infinity()
static BoundedDouble plus_infinity()
◆ min()
Definition at line 1215 of file NumericValue.h.
1218 for (
const auto& it : _l)
1220 if (it.is_minus_infinity())
1222 else if (!it.geq(ret))
◆ minus_infinity()
Definition at line 793 of file NumericValue.h.
795 return -std::numeric_limits<double>::infinity();
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ plus_infinity()
Definition at line 788 of file NumericValue.h.
790 return std::numeric_limits<double>::infinity();
◆ safeAdd()
static double SVF::BoundedDouble::safeAdd |
( |
double |
lhs, |
|
|
double |
rhs |
|
) |
| |
|
inlinestatic |
Adds two floating-point numbers safely, checking for overflow and underflow conditions.
- Parameters
-
lhs | Left-hand side operand of the addition. |
rhs | Right-hand side operand of the addition. |
- Returns
- The sum of lhs and rhs. If overflow or underflow occurs, returns positive or negative infinity.
Definition at line 908 of file NumericValue.h.
910 if ((lhs == std::numeric_limits<double>::infinity() &&
911 rhs == -std::numeric_limits<double>::infinity()) ||
912 (lhs == -std::numeric_limits<double>::infinity() &&
913 rhs == std::numeric_limits<double>::infinity()))
915 assert(
false &&
"invalid add");
921 if (res == std::numeric_limits<double>::infinity())
929 if (res == -std::numeric_limits<double>::infinity())
937 if (lhs > 0 && rhs > 0 &&
938 (std::numeric_limits<double>::max() - lhs) < rhs)
940 res = std::numeric_limits<double>::infinity();
948 if (lhs < 0 && rhs < 0 &&
949 (-std::numeric_limits<double>::max() - lhs) > rhs)
951 res = -std::numeric_limits<
◆ safeDiv()
static double SVF::BoundedDouble::safeDiv |
( |
double |
lhs, |
|
|
double |
rhs |
|
) |
| |
|
inlinestatic |
Safely divides one floating-point number by another, checking for division by zero and overflow.
- Parameters
-
lhs | Left-hand side operand (numerator). |
rhs | Right-hand side operand (denominator). |
- Returns
- The quotient of lhs and rhs. Returns positive or negative infinity for division by zero, or when overflow occurs.
Definition at line 1049 of file NumericValue.h.
1054 return (lhs >= 0.0f) ? std::numeric_limits<double>::infinity()
1055 : -std::numeric_limits<double>::infinity();
1057 double res = lhs / rhs;
1059 if (res == std::numeric_limits<double>::infinity())
1067 if (res == -std::numeric_limits<double>::infinity())
1074 if (rhs > 0 && rhs < std::numeric_limits<double>::min() &&
1075 lhs > std::numeric_limits<double>::max() * rhs)
1077 return std::numeric_limits<double>::infinity();
1079 if (rhs < 0 && rhs > -std::numeric_limits<double>::min() &&
1080 lhs > std::numeric_limits<double>::max() * rhs)
1082 return -std::numeric_limits<double>::infinity();
◆ safeMul()
static double SVF::BoundedDouble::safeMul |
( |
double |
lhs, |
|
|
double |
rhs |
|
) |
| |
|
inlinestatic |
Safely multiplies two floating-point numbers, checking for overflow and underflow.
- Parameters
-
lhs | Left-hand side operand of the multiplication. |
rhs | Right-hand side operand of the multiplication. |
- Returns
- The product of lhs and rhs. If overflow or underflow occurs, returns positive or negative infinity accordingly.
Definition at line 988 of file NumericValue.h.
992 double res = lhs * rhs;
994 if (res == std::numeric_limits<double>::infinity())
1002 if (res == -std::numeric_limits<double>::infinity())
1008 if (lhs > 0 && rhs > 0 &&
1009 lhs > std::numeric_limits<double>::max() / rhs)
1011 return std::numeric_limits<double>::infinity();
1013 if (lhs < 0 && rhs < 0 &&
1014 lhs < std::numeric_limits<double>::max() / rhs)
1016 return std::numeric_limits<double>::infinity();
1020 if (lhs > 0 && rhs < 0 &&
1021 rhs < std::numeric_limits<double>::lowest() / lhs)
1023 return -std::numeric_limits<double>::infinity();
1025 if (lhs < 0 && rhs > 0 &&
1026 lhs < std::numeric_limits<double>::lowest() / rhs)
1028 return -std::numeric_limits<double>::infinity();
◆ set_minus_infinity()
void SVF::BoundedDouble::set_minus_infinity |
( |
| ) |
|
|
inline |
◆ set_plus_infinity()
void SVF::BoundedDouble::set_plus_infinity |
( |
| ) |
|
|
inline |
◆ to_string()
virtual const std::string SVF::BoundedDouble::to_string |
( |
| ) |
const |
|
inlinevirtual |
◆ abs
◆ eq
◆ ite
Definition at line 1187 of file NumericValue.h.
1190 return cond._fVal != 0.0f ? lhs._fVal : rhs._fVal;
◆ max
Definition at line 1210 of file NumericValue.h.
1212 return std::max(lhs._fVal, rhs._fVal);
◆ min
Definition at line 1205 of file NumericValue.h.
1207 return std::min(lhs._fVal, rhs._fVal);
◆ operator!
◆ operator!=
◆ operator%
Definition at line 1094 of file NumericValue.h.
1098 assert(
false &&
"divide by zero");
1099 else if (!lhs.is_infinity() && !rhs.is_infinity())
1100 return std::fmod(lhs._fVal, rhs._fVal);
1101 else if (!lhs.is_infinity() && rhs.is_infinity())
1104 else if (lhs.is_infinity() && !rhs.is_infinity())
1105 return ite(rhs._fVal > 0.0f, lhs, -lhs);
friend BoundedDouble ite(const BoundedDouble &cond, const BoundedDouble &lhs, const BoundedDouble &rhs)
friend bool eq(const BoundedDouble &lhs, const BoundedDouble &rhs)
◆ operator&
Definition at line 1128 of file NumericValue.h.
1131 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
◆ operator&&
◆ operator*
Definition at line 1034 of file NumericValue.h.
1037 return safeMul(lhs._fVal, rhs._fVal);
static double safeMul(double lhs, double rhs)
◆ operator+
Definition at line 962 of file NumericValue.h.
965 return safeAdd(lhs._fVal, rhs._fVal);
static double safeAdd(double lhs, double rhs)
◆ operator- [1/2]
◆ operator- [2/2]
◆ operator/
Definition at line 1088 of file NumericValue.h.
1091 return safeDiv(lhs._fVal, rhs._fVal);
static double safeDiv(double lhs, double rhs)
◆ operator<
◆ operator<< [1/2]
Definition at line 1173 of file NumericValue.h.
1176 assert(rhs.geq(0) &&
"rhs should be greater or equal than 0");
1179 else if (lhs.is_infinity())
1181 else if (rhs.is_infinity())
◆ operator<< [2/2]
std::ostream& operator<< |
( |
std::ostream & |
out, |
|
|
const BoundedDouble & |
expr |
|
) |
| |
|
friend |
◆ operator<=
◆ operator==
Reload operator.
Definition at line 863 of file NumericValue.h.
866 return lhs.equal(rhs);
◆ operator>
◆ operator>=
◆ operator>>
Definition at line 1159 of file NumericValue.h.
1162 assert(rhs.geq(0) &&
"rhs should be greater or equal than 0");
1165 else if (lhs.is_infinity())
1167 else if (rhs.is_infinity())
1168 return lhs.geq(0) ? 0 : -1;
1170 return (
s32_t)lhs.getNumeral() >> (
s32_t)rhs.getNumeral();
◆ operator^
Definition at line 1121 of file NumericValue.h.
1124 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
◆ operator|
Definition at line 1135 of file NumericValue.h.
1138 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
◆ operator||
◆ _fVal
double SVF::BoundedDouble::_fVal |
|
protected |
The documentation for this class was generated from the following file: