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

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

Detailed Description

Bounded double numeric value

Definition at line 726 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 734 of file NumericValue.h.

734: _fVal(fVal) {}
llvm::IRBuilder IRBuilder
Definition BasicTypes.h:74

◆ BoundedDouble() [3/4]

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

Definition at line 736 of file NumericValue.h.

736: _fVal(rhs._fVal) {}

◆ BoundedDouble() [4/4]

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

Definition at line 744 of file NumericValue.h.

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

◆ ~BoundedDouble()

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

Definition at line 752 of file NumericValue.h.

752{}

Member Function Documentation

◆ doubleEqual()

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

Definition at line 754 of file NumericValue.h.

755 {
756 if (std::isinf(a) && std::isinf(b))
757 return a == b;
758 return std::fabs(a - b) < epsilon;
759 }
#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 811 of file NumericValue.h.

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

◆ geq()

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

Definition at line 840 of file NumericValue.h.

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

◆ getFVal()

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

Definition at line 761 of file NumericValue.h.

762 {
763 return _fVal;
764 }

◆ getIntNumeral()

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

Definition at line 1275 of file NumericValue.h.

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

◆ getNumeral()

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

Return Numeral.

Definition at line 1259 of file NumericValue.h.

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

◆ getRealNumeral()

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

Definition at line 1280 of file NumericValue.h.

1281 {
1282 return _fVal;
1283 }

◆ is_infinity()

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

Definition at line 776 of file NumericValue.h.

777 {
779 }

◆ is_int()

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

Definition at line 1115 of file NumericValue.h.

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

◆ is_minus_infinity()

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

Definition at line 771 of file NumericValue.h.

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

◆ is_plus_infinity()

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

Definition at line 766 of file NumericValue.h.

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

◆ is_real()

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

Definition at line 1119 of file NumericValue.h.

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

◆ is_true()

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

Definition at line 1253 of file NumericValue.h.

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

◆ is_zero()

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

Definition at line 801 of file NumericValue.h.

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

◆ isZero()

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

Definition at line 806 of file NumericValue.h.

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

◆ leq()

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

Definition at line 816 of file NumericValue.h.

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

◆ max()

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

Definition at line 1233 of file NumericValue.h.

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

◆ min()

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

Definition at line 1218 of file NumericValue.h.

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

◆ minus_infinity()

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

Definition at line 796 of file NumericValue.h.

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

◆ operator=() [1/2]

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

Definition at line 746 of file NumericValue.h.

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

◆ operator=() [2/2]

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

Definition at line 738 of file NumericValue.h.

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

◆ plus_infinity()

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

Definition at line 791 of file NumericValue.h.

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

◆ 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 911 of file NumericValue.h.

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

◆ 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 1052 of file NumericValue.h.

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

◆ 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 991 of file NumericValue.h.

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

◆ set_minus_infinity()

void SVF::BoundedDouble::set_minus_infinity ( )
inline

Definition at line 786 of file NumericValue.h.

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

◆ set_plus_infinity()

void SVF::BoundedDouble::set_plus_infinity ( )
inline

Definition at line 781 of file NumericValue.h.

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

◆ to_string()

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

Definition at line 1285 of file NumericValue.h.

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

Friends And Related Symbol Documentation

◆ abs

BoundedDouble abs ( const BoundedDouble lhs)
friend

Definition at line 1248 of file NumericValue.h.

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

◆ eq

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

Definition at line 1203 of file NumericValue.h.

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

◆ ite

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

Definition at line 1190 of file NumericValue.h.

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

◆ max

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

Definition at line 1213 of file NumericValue.h.

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

◆ min

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

Definition at line 1208 of file NumericValue.h.

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

◆ operator!

BoundedDouble operator! ( const BoundedDouble lhs)
friend

Definition at line 1157 of file NumericValue.h.

1158 {
1159 return !lhs._fVal;
1160 }

◆ operator!=

Definition at line 872 of file NumericValue.h.

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

◆ operator%

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

Definition at line 1097 of file NumericValue.h.

1099 {
1100 if (rhs.is_zero())
1101 assert(false && "divide by zero");
1102 else if (!lhs.is_infinity() && !rhs.is_infinity())
1103 return std::fmod(lhs._fVal, rhs._fVal);
1104 else if (!lhs.is_infinity() && rhs.is_infinity())
1105 return 0.0f;
1106 // TODO: not sure
1107 else if (lhs.is_infinity() && !rhs.is_infinity())
1108 return ite(rhs._fVal > 0.0f, lhs, -lhs);
1109 else
1110 // TODO: +oo/-oo L'Hôpital's rule?
1111 return eq(lhs, rhs) ? plus_infinity() : minus_infinity();
1112 abort();
1113 }
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 1131 of file NumericValue.h.

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

◆ operator&&

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

Definition at line 1145 of file NumericValue.h.

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

◆ operator*

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

Definition at line 1037 of file NumericValue.h.

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

◆ operator+

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

Definition at line 965 of file NumericValue.h.

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

◆ operator- [1/2]

Definition at line 971 of file NumericValue.h.

972 {
973 return -lhs._fVal;
974 }

◆ operator- [2/2]

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

Definition at line 976 of file NumericValue.h.

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

◆ operator/

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

Definition at line 1091 of file NumericValue.h.

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

◆ operator<

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

Definition at line 884 of file NumericValue.h.

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

◆ operator<< [1/2]

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

Definition at line 1176 of file NumericValue.h.

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

◆ operator<< [2/2]

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

Definition at line 1196 of file NumericValue.h.

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

◆ operator<=

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

Definition at line 890 of file NumericValue.h.

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

◆ operator==

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

Reload operator.

Definition at line 866 of file NumericValue.h.

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

◆ operator>

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

Definition at line 878 of file NumericValue.h.

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

◆ operator>=

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

Definition at line 896 of file NumericValue.h.

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

◆ operator>>

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

Definition at line 1162 of file NumericValue.h.

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

◆ operator^

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

Definition at line 1124 of file NumericValue.h.

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

◆ operator|

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

Definition at line 1138 of file NumericValue.h.

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

◆ operator||

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

Definition at line 1151 of file NumericValue.h.

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

Member Data Documentation

◆ _fVal

double SVF::BoundedDouble::_fVal
protected

Definition at line 729 of file NumericValue.h.


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