Static Value-Flow Analysis
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
SVF::BoundedDouble Class Reference

#include <NumericValue.h>

Public Member Functions

 BoundedDouble (double fVal)
 
 BoundedDouble (const BoundedDouble &rhs)
 
BoundedDoubleoperator= (const BoundedDouble &rhs)
 
 BoundedDouble (BoundedDouble &&rhs)
 
BoundedDoubleoperator= (BoundedDouble &&rhs)
 
virtual ~BoundedDouble ()
 
const double getFVal () const
 
bool is_plus_infinity () const
 
bool is_minus_infinity () const
 
bool is_infinity () const
 
void set_plus_infinity ()
 
void set_minus_infinity ()
 
bool is_zero () const
 
bool equal (const BoundedDouble &rhs) const
 
bool leq (const BoundedDouble &rhs) const
 
bool geq (const BoundedDouble &rhs) const
 
bool is_int () const
 
bool is_real () const
 
bool is_true () const
 
s64_t getNumeral () const
 Return Numeral.
 
s64_t getIntNumeral () const
 
double getRealNumeral () const
 
virtual const std::string to_string () const
 

Static Public Member Functions

static bool doubleEqual (double a, double b)
 
static BoundedDouble plus_infinity ()
 
static BoundedDouble minus_infinity ()
 
static bool isZero (const BoundedDouble &expr)
 
static double safeAdd (double lhs, double rhs)
 
static double safeMul (double lhs, double rhs)
 
static double safeDiv (double lhs, double rhs)
 
static BoundedDouble min (std::vector< BoundedDouble > &_l)
 
static BoundedDouble max (std::vector< BoundedDouble > &_l)
 

Protected Member Functions

 BoundedDouble ()=default
 

Protected Attributes

double _fVal
 

Friends

bool operator== (const BoundedDouble &lhs, const BoundedDouble &rhs)
 Reload operator.
 
bool operator!= (const BoundedDouble &lhs, const BoundedDouble &rhs)
 
bool operator> (const BoundedDouble &lhs, const BoundedDouble &rhs)
 
bool operator< (const BoundedDouble &lhs, const BoundedDouble &rhs)
 
bool operator<= (const BoundedDouble &lhs, const BoundedDouble &rhs)
 
bool 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)
 

Detailed Description

Bounded double numeric value

Definition at line 727 of file NumericValue.h.

Constructor & Destructor Documentation

◆ BoundedDouble() [1/4]

SVF::BoundedDouble::BoundedDouble ( )
protecteddefault

◆ BoundedDouble() [2/4]

SVF::BoundedDouble::BoundedDouble ( double  fVal)
inline

Definition at line 735 of file NumericValue.h.

735: _fVal(fVal) {}
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:76

◆ BoundedDouble() [3/4]

SVF::BoundedDouble::BoundedDouble ( const BoundedDouble rhs)
inline

Definition at line 737 of file NumericValue.h.

737: _fVal(rhs._fVal) {}

◆ BoundedDouble() [4/4]

SVF::BoundedDouble::BoundedDouble ( BoundedDouble &&  rhs)
inline

Definition at line 745 of file NumericValue.h.

745: _fVal(std::move(rhs._fVal)) {}

◆ ~BoundedDouble()

virtual SVF::BoundedDouble::~BoundedDouble ( )
inlinevirtual

Definition at line 753 of file NumericValue.h.

753{}

Member Function Documentation

◆ doubleEqual()

static bool SVF::BoundedDouble::doubleEqual ( double  a,
double  b 
)
inlinestatic

Definition at line 755 of file NumericValue.h.

756 {
757 if (std::isinf(a) && std::isinf(b))
758 return a == b;
759 return std::fabs(a - b) < epsilon;
760 }
#define epsilon
cJSON * a
Definition cJSON.cpp:2560
const cJSON *const b
Definition cJSON.h:255

◆ equal()

bool SVF::BoundedDouble::equal ( const BoundedDouble rhs) const
inline

Definition at line 812 of file NumericValue.h.

813 {
814 return doubleEqual(_fVal, rhs._fVal);
815 }
static bool doubleEqual(double a, double b)

◆ geq()

bool SVF::BoundedDouble::geq ( const BoundedDouble rhs) const
inline

Definition at line 841 of file NumericValue.h.

842 {
843 if (is_infinity() ^ rhs.is_infinity())
844 {
845 if (is_infinity())
846 {
847 return is_plus_infinity();
848 }
849 else
850 {
851 return rhs.is_minus_infinity();
852 }
853 }
854 if (is_infinity() && rhs.is_infinity())
855 {
856 if (is_plus_infinity())
857 return true;
858 else
859 return rhs.is_minus_infinity();
860 }
861 else
862 return _fVal >= rhs._fVal;
863 }
bool is_plus_infinity() const
bool is_infinity() const

◆ getFVal()

const double SVF::BoundedDouble::getFVal ( ) const
inline

Definition at line 762 of file NumericValue.h.

763 {
764 return _fVal;
765 }

◆ getIntNumeral()

s64_t SVF::BoundedDouble::getIntNumeral ( ) const
inline

Definition at line 1276 of file NumericValue.h.

1277 {
1278 return getNumeral();
1279 }
s64_t getNumeral() const
Return Numeral.

◆ getNumeral()

s64_t SVF::BoundedDouble::getNumeral ( ) const
inline

Return Numeral.

Definition at line 1260 of file NumericValue.h.

1261 {
1262 if (is_minus_infinity())
1263 {
1264 return INT64_MIN;
1265 }
1266 else if (is_plus_infinity())
1267 {
1268 return INT64_MAX;
1269 }
1270 else
1271 {
1272 return std::round(_fVal);
1273 }
1274 }
bool is_minus_infinity() const

◆ getRealNumeral()

double SVF::BoundedDouble::getRealNumeral ( ) const
inline

Definition at line 1281 of file NumericValue.h.

1282 {
1283 return _fVal;
1284 }

◆ is_infinity()

bool SVF::BoundedDouble::is_infinity ( ) const
inline

Definition at line 777 of file NumericValue.h.

778 {
780 }

◆ is_int()

bool SVF::BoundedDouble::is_int ( ) const
inline

Definition at line 1116 of file NumericValue.h.

1117 {
1118 return _fVal == std::round(_fVal);
1119 }

◆ is_minus_infinity()

bool SVF::BoundedDouble::is_minus_infinity ( ) const
inline

Definition at line 772 of file NumericValue.h.

773 {
774 return _fVal == -std::numeric_limits<double>::infinity();
775 }

◆ is_plus_infinity()

bool SVF::BoundedDouble::is_plus_infinity ( ) const
inline

Definition at line 767 of file NumericValue.h.

768 {
769 return _fVal == std::numeric_limits<double>::infinity();
770 }

◆ is_real()

bool SVF::BoundedDouble::is_real ( ) const
inline

Definition at line 1120 of file NumericValue.h.

1121 {
1122 return !is_int();
1123 }
bool is_int() const

◆ is_true()

bool SVF::BoundedDouble::is_true ( ) const
inline

Definition at line 1254 of file NumericValue.h.

1255 {
1256 return _fVal != 0.0f;
1257 }

◆ is_zero()

bool SVF::BoundedDouble::is_zero ( ) const
inline

Definition at line 802 of file NumericValue.h.

803 {
804 return doubleEqual(_fVal, 0.0f);
805 }

◆ isZero()

static bool SVF::BoundedDouble::isZero ( const BoundedDouble expr)
inlinestatic

Definition at line 807 of file NumericValue.h.

808 {
809 return doubleEqual(expr.getFVal(), 0.0f);
810 }

◆ leq()

bool SVF::BoundedDouble::leq ( const BoundedDouble rhs) const
inline

Definition at line 817 of file NumericValue.h.

818 {
819 if (is_infinity() ^ rhs.is_infinity())
820 {
821 if (is_infinity())
822 {
823 return is_minus_infinity();
824 }
825 else
826 {
827 return rhs.is_plus_infinity();
828 }
829 }
830 if (is_infinity() && rhs.is_infinity())
831 {
832 if (is_minus_infinity())
833 return true;
834 else
835 return rhs.is_plus_infinity();
836 }
837 else
838 return _fVal <= rhs._fVal;
839 }

◆ max()

static BoundedDouble SVF::BoundedDouble::max ( std::vector< BoundedDouble > &  _l)
inlinestatic

Definition at line 1234 of file NumericValue.h.

1235 {
1237 for (const auto& it : _l)
1238 {
1239 if (it.is_plus_infinity())
1240 return plus_infinity();
1241 else if (!it.leq(ret))
1242 {
1243 ret = it;
1244 }
1245 }
1246 return ret;
1247 }
BoundedDouble()=default
static BoundedDouble minus_infinity()
static BoundedDouble plus_infinity()

◆ min()

static BoundedDouble SVF::BoundedDouble::min ( std::vector< BoundedDouble > &  _l)
inlinestatic

Definition at line 1219 of file NumericValue.h.

1220 {
1222 for (const auto& it : _l)
1223 {
1224 if (it.is_minus_infinity())
1225 return minus_infinity();
1226 else if (!it.geq(ret))
1227 {
1228 ret = it;
1229 }
1230 }
1231 return ret;
1232 }

◆ minus_infinity()

static BoundedDouble SVF::BoundedDouble::minus_infinity ( )
inlinestatic

Definition at line 797 of file NumericValue.h.

798 {
799 return -std::numeric_limits<double>::infinity();
800 }

◆ operator=() [1/2]

BoundedDouble & SVF::BoundedDouble::operator= ( BoundedDouble &&  rhs)
inline

Definition at line 747 of file NumericValue.h.

748 {
749 _fVal = std::move(rhs._fVal);
750 return *this;
751 }

◆ operator=() [2/2]

BoundedDouble & SVF::BoundedDouble::operator= ( const BoundedDouble rhs)
inline

Definition at line 739 of file NumericValue.h.

740 {
741 _fVal = rhs._fVal;
742 return *this;
743 }

◆ plus_infinity()

static BoundedDouble SVF::BoundedDouble::plus_infinity ( )
inlinestatic

Definition at line 792 of file NumericValue.h.

793 {
794 return std::numeric_limits<double>::infinity();
795 }

◆ safeAdd()

static double SVF::BoundedDouble::safeAdd ( double  lhs,
double  rhs 
)
inlinestatic

Adds two floating-point numbers safely, checking for overflow and underflow conditions.

Parameters
lhsLeft-hand side operand of the addition.
rhsRight-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 912 of file NumericValue.h.

913 {
914 if ((lhs == std::numeric_limits<double>::infinity() &&
915 rhs == -std::numeric_limits<double>::infinity()) ||
916 (lhs == -std::numeric_limits<double>::infinity() &&
917 rhs == std::numeric_limits<double>::infinity()))
918 {
919 assert(false && "invalid add");
920 }
921 double res =
922 lhs + rhs; // Perform the addition and store the result in 'res'
923
924 // Check if the result is positive infinity due to overflow
925 if (res == std::numeric_limits<double>::infinity())
926 {
927 return res; // Positive overflow has occurred, return positive
928 // infinity
929 }
930
931 // Check if the result is negative infinity, which can indicate a large
932 // negative overflow
933 if (res == -std::numeric_limits<double>::infinity())
934 {
935 return res; // Negative "overflow", effectively an underflow to
936 // negative infinity
937 }
938
939 // Check for positive overflow: verify if both operands are positive and
940 // their sum exceeds the maximum double value
941 if (lhs > 0 && rhs > 0 &&
942 (std::numeric_limits<double>::max() - lhs) < rhs)
943 {
944 res = std::numeric_limits<double>::infinity(); // Set result to
945 // positive infinity to
946 // indicate overflow
947 return res;
948 }
949
950 // Check for an underflow scenario: both numbers are negative and their
951 // sum is more negative than what double can represent
952 if (lhs < 0 && rhs < 0 &&
953 (-std::numeric_limits<double>::max() - lhs) > rhs)
954 {
955 res = -std::numeric_limits<
956 double>::infinity(); // Set result to negative infinity to
957 // clarify extreme negative sum
958 return res;
959 }
960
961 // If none of the above conditions are met, return the result of the
962 // addition
963 return res;
964 }

◆ 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
lhsLeft-hand side operand (numerator).
rhsRight-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 1053 of file NumericValue.h.

1054 {
1055 // Check for division by zero
1056 if (doubleEqual(rhs, 0.0f))
1057 {
1058 return (lhs >= 0.0f) ? std::numeric_limits<double>::infinity()
1059 : -std::numeric_limits<double>::infinity();
1060 }
1061 double res = lhs / rhs;
1062 // Check if the result is positive infinity due to overflow
1063 if (res == std::numeric_limits<double>::infinity())
1064 {
1065 return res; // Positive overflow has occurred, return positive
1066 // infinity
1067 }
1068
1069 // Check if the result is negative infinity, which can indicate a large
1070 // negative overflow
1071 if (res == -std::numeric_limits<double>::infinity())
1072 {
1073 return res; // Negative "overflow", effectively an underflow to
1074 // negative infinity
1075 }
1076
1077 // Check for overflow when dividing small numbers
1078 if (rhs > 0 && rhs < std::numeric_limits<double>::min() &&
1079 lhs > std::numeric_limits<double>::max() * rhs)
1080 {
1081 return std::numeric_limits<double>::infinity();
1082 }
1083 if (rhs < 0 && rhs > -std::numeric_limits<double>::min() &&
1084 lhs > std::numeric_limits<double>::max() * rhs)
1085 {
1086 return -std::numeric_limits<double>::infinity();
1087 }
1088
1089 return res; // If no special cases, return the quotient
1090 }

◆ safeMul()

static double SVF::BoundedDouble::safeMul ( double  lhs,
double  rhs 
)
inlinestatic

Safely multiplies two floating-point numbers, checking for overflow and underflow.

Parameters
lhsLeft-hand side operand of the multiplication.
rhsRight-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 992 of file NumericValue.h.

993 {
994 if (doubleEqual(lhs, 0.0f) || doubleEqual(rhs, 0.0f))
995 return 0.0f;
996 double res = lhs * rhs;
997 // Check if the result is positive infinity due to overflow
998 if (res == std::numeric_limits<double>::infinity())
999 {
1000 return res; // Positive overflow has occurred, return positive
1001 // infinity
1002 }
1003
1004 // Check if the result is negative infinity, which can indicate a large
1005 // negative overflow
1006 if (res == -std::numeric_limits<double>::infinity())
1007 {
1008 return res; // Negative "overflow", effectively an underflow to
1009 // negative infinity
1010 }
1011 // Check for overflow scenarios
1012 if (lhs > 0 && rhs > 0 &&
1013 lhs > std::numeric_limits<double>::max() / rhs)
1014 {
1015 return std::numeric_limits<double>::infinity();
1016 }
1017 if (lhs < 0 && rhs < 0 &&
1018 lhs < std::numeric_limits<double>::max() / rhs)
1019 {
1020 return std::numeric_limits<double>::infinity();
1021 }
1022
1023 // Check for "underflow" scenarios (negative overflow)
1024 if (lhs > 0 && rhs < 0 &&
1025 rhs < std::numeric_limits<double>::lowest() / lhs)
1026 {
1027 return -std::numeric_limits<double>::infinity();
1028 }
1029 if (lhs < 0 && rhs > 0 &&
1030 lhs < std::numeric_limits<double>::lowest() / rhs)
1031 {
1032 return -std::numeric_limits<double>::infinity();
1033 }
1034
1035 return res; // If no overflow or underflow, return the product
1036 }

◆ set_minus_infinity()

void SVF::BoundedDouble::set_minus_infinity ( )
inline

Definition at line 787 of file NumericValue.h.

788 {
789 *this = minus_infinity();
790 }

◆ set_plus_infinity()

void SVF::BoundedDouble::set_plus_infinity ( )
inline

Definition at line 782 of file NumericValue.h.

783 {
784 *this = plus_infinity();
785 }

◆ to_string()

virtual const std::string SVF::BoundedDouble::to_string ( ) const
inlinevirtual

Definition at line 1286 of file NumericValue.h.

1287 {
1288 return std::to_string(_fVal);
1289 }

Friends And Related Symbol Documentation

◆ abs

BoundedDouble abs ( const BoundedDouble lhs)
friend

Definition at line 1249 of file NumericValue.h.

1250 {
1251 return lhs.leq(0) ? -lhs : lhs;
1252 }

◆ eq

bool eq ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1204 of file NumericValue.h.

1205 {
1206 return doubleEqual(lhs._fVal, rhs._fVal);
1207 }

◆ ite

BoundedDouble ite ( const BoundedDouble cond,
const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1191 of file NumericValue.h.

1193 {
1194 return cond._fVal != 0.0f ? lhs._fVal : rhs._fVal;
1195 }

◆ max

BoundedDouble max ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1214 of file NumericValue.h.

1215 {
1216 return std::max(lhs._fVal, rhs._fVal);
1217 }

◆ min

BoundedDouble min ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1209 of file NumericValue.h.

1210 {
1211 return std::min(lhs._fVal, rhs._fVal);
1212 }

◆ operator!

BoundedDouble operator! ( const BoundedDouble lhs)
friend

Definition at line 1158 of file NumericValue.h.

1159 {
1160 return !lhs._fVal;
1161 }

◆ operator!=

bool operator!= ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 873 of file NumericValue.h.

875 {
876 return !lhs.equal(rhs);
877 }

◆ operator%

BoundedDouble operator% ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1098 of file NumericValue.h.

1100 {
1101 if (rhs.is_zero())
1102 assert(false && "divide by zero");
1103 else if (!lhs.is_infinity() && !rhs.is_infinity())
1104 return std::fmod(lhs._fVal, rhs._fVal);
1105 else if (!lhs.is_infinity() && rhs.is_infinity())
1106 return 0.0f;
1107 // TODO: not sure
1108 else if (lhs.is_infinity() && !rhs.is_infinity())
1109 return ite(rhs._fVal > 0.0f, lhs, -lhs);
1110 else
1111 // TODO: +oo/-oo L'Hôpital's rule?
1112 return eq(lhs, rhs) ? plus_infinity() : minus_infinity();
1113 abort();
1114 }
friend BoundedDouble ite(const BoundedDouble &cond, const BoundedDouble &lhs, const BoundedDouble &rhs)
friend bool eq(const BoundedDouble &lhs, const BoundedDouble &rhs)

◆ operator&

BoundedDouble operator& ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1132 of file NumericValue.h.

1134 {
1135 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
1136 return lInt & rInt;
1137 }

◆ operator&&

BoundedDouble operator&& ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1146 of file NumericValue.h.

1148 {
1149 return lhs._fVal && rhs._fVal;
1150 }

◆ operator*

BoundedDouble operator* ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1038 of file NumericValue.h.

1040 {
1041 return safeMul(lhs._fVal, rhs._fVal);
1042 }
static double safeMul(double lhs, double rhs)

◆ operator+

BoundedDouble operator+ ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 966 of file NumericValue.h.

968 {
969 return safeAdd(lhs._fVal, rhs._fVal);
970 }
static double safeAdd(double lhs, double rhs)

◆ operator- [1/2]

Definition at line 972 of file NumericValue.h.

973 {
974 return -lhs._fVal;
975 }

◆ operator- [2/2]

BoundedDouble operator- ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 977 of file NumericValue.h.

979 {
980 return safeAdd(lhs._fVal, -rhs._fVal);
981 }

◆ operator/

BoundedDouble operator/ ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1092 of file NumericValue.h.

1094 {
1095 return safeDiv(lhs._fVal, rhs._fVal);
1096 }
static double safeDiv(double lhs, double rhs)

◆ operator<

bool operator< ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 885 of file NumericValue.h.

887 {
888 return !lhs.geq(rhs);
889 }

◆ operator<< [1/2]

BoundedDouble operator<< ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1177 of file NumericValue.h.

1179 {
1180 assert(rhs.geq(0) && "rhs should be greater or equal than 0");
1181 if (lhs.is_zero())
1182 return lhs;
1183 else if (lhs.is_infinity())
1184 return lhs;
1185 else if (rhs.is_infinity())
1186 return lhs.geq(0) ? plus_infinity() : minus_infinity();
1187 else
1188 return (s32_t)lhs.getNumeral() << (s32_t)rhs.getNumeral();
1189 }
signed s32_t
Definition GeneralType.h:68

◆ operator<< [2/2]

std::ostream & operator<< ( std::ostream &  out,
const BoundedDouble expr 
)
friend

Definition at line 1197 of file NumericValue.h.

1199 {
1200 out << expr._fVal;
1201 return out;
1202 }

◆ operator<=

bool operator<= ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 891 of file NumericValue.h.

893 {
894 return lhs.leq(rhs);
895 }

◆ operator==

bool operator== ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Reload operator.

Definition at line 867 of file NumericValue.h.

869 {
870 return lhs.equal(rhs);
871 }

◆ operator>

bool operator> ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 879 of file NumericValue.h.

881 {
882 return !lhs.leq(rhs);
883 }

◆ operator>=

bool operator>= ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 897 of file NumericValue.h.

899 {
900 return lhs.geq(rhs);
901 }

◆ operator>>

BoundedDouble operator>> ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1163 of file NumericValue.h.

1165 {
1166 assert(rhs.geq(0) && "rhs should be greater or equal than 0");
1167 if (lhs.is_zero())
1168 return lhs;
1169 else if (lhs.is_infinity())
1170 return lhs;
1171 else if (rhs.is_infinity())
1172 return lhs.geq(0) ? 0 : -1;
1173 else
1174 return (s32_t)lhs.getNumeral() >> (s32_t)rhs.getNumeral();
1175 }

◆ operator^

BoundedDouble operator^ ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1125 of file NumericValue.h.

1127 {
1128 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
1129 return lInt ^ rInt;
1130 }

◆ operator|

BoundedDouble operator| ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1139 of file NumericValue.h.

1141 {
1142 int lInt = std::round(lhs._fVal), rInt = std::round(rhs._fVal);
1143 return lInt | rInt;
1144 }

◆ operator||

BoundedDouble operator|| ( const BoundedDouble lhs,
const BoundedDouble rhs 
)
friend

Definition at line 1152 of file NumericValue.h.

1154 {
1155 return lhs._fVal || rhs._fVal;
1156 }

Member Data Documentation

◆ _fVal

double SVF::BoundedDouble::_fVal
protected

Definition at line 730 of file NumericValue.h.


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